]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
IB/mlx5: Fix GRE flow specification
authorMaor Gottlieb <maorg@mellanox.com>
Sun, 1 Jul 2018 12:50:17 +0000 (15:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:07 +0000 (16:59 -0700)
[ Upstream commit a93b632c4531ff50c43d658447a45cbc11f488fd ]

Currently the driver sets the mask of the gre_protocol to 0xffff
without consideration in the user request.

Fix it by copy the mask from the verbs spec.

Fixes: da2f22ae7707 ("IB/mlx5: Add support for GRE flow specification")
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Ariel Levkovich <lariel@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx5/main.c

index cbeae4509359452b6b06abba0a088cf0c699a89f..85677afa6f772e751e357e3ad10c57cc6bc02316 100644 (file)
@@ -2699,7 +2699,7 @@ static int parse_flow_attr(struct mlx5_core_dev *mdev, u32 *match_c,
                         IPPROTO_GRE);
 
                MLX5_SET(fte_match_set_misc, misc_params_c, gre_protocol,
-                        0xffff);
+                        ntohs(ib_spec->gre.mask.protocol));
                MLX5_SET(fte_match_set_misc, misc_params_v, gre_protocol,
                         ntohs(ib_spec->gre.val.protocol));