diff options
author | Ariel Levkovich <lariel@mellanox.com> | 2018-05-13 14:33:30 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-05-16 21:32:54 -0600 |
commit | d90e5e5038ef8e62c82710e3970317ef4eb367cf (patch) | |
tree | 39d9353012eb2fd518598eac2b7b16eb5162e34c /drivers | |
parent | 20b6563ba164efc1ae24f637cb269bb3a9eb5467 (diff) | |
download | linux-d90e5e5038ef8e62c82710e3970317ef4eb367cf.tar.gz linux-d90e5e5038ef8e62c82710e3970317ef4eb367cf.tar.bz2 linux-d90e5e5038ef8e62c82710e3970317ef4eb367cf.zip |
IB/uverbs: Introduce a GRE steering match filter
Adding a new GRE steering match filter that can match against
key and protocol fields.
Reviewed-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/core/uverbs_cmd.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 21a887c9523b..82c8c8b3e10b 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -2948,6 +2948,17 @@ int ib_uverbs_kern_spec_to_ib_spec_filter(enum ib_flow_spec_type type, memcpy(&ib_spec->esp.val, kern_spec_val, actual_filter_sz); memcpy(&ib_spec->esp.mask, kern_spec_mask, actual_filter_sz); break; + case IB_FLOW_SPEC_GRE: + ib_filter_sz = offsetof(struct ib_flow_gre_filter, real_sz); + actual_filter_sz = spec_filter_size(kern_spec_mask, + kern_filter_sz, + ib_filter_sz); + if (actual_filter_sz <= 0) + return -EINVAL; + ib_spec->gre.size = sizeof(struct ib_flow_spec_gre); + memcpy(&ib_spec->gre.val, kern_spec_val, actual_filter_sz); + memcpy(&ib_spec->gre.mask, kern_spec_mask, actual_filter_sz); + break; default: return -EINVAL; } |