IB/mlx5: Don't override existing ip_protocol
authorMaor Gottlieb <maorg@mellanox.com>
Thu, 17 Jan 2019 18:08:15 +0000 (20:08 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 22 Jan 2019 03:10:06 +0000 (20:10 -0700)
commit6113cc44015b41ca51c0a76fed82522b68108dac
tree76ef1b31190e30f9b4373c6005fa4792f3f71498
parent414556af5f27c1f40b2afb18c3a1fee4b9535d40
IB/mlx5: Don't override existing ip_protocol

Two flow specifications can set the ip protocol field in
the flow table entry:

1) IB_FLOW_SPEC_TCP/UDP/GRE - set the ip protocol accordingly.
2) IB_FLOW_SPEC_IPV4/6 - has ip_protocol field for users
who want to receive specific L4 packets.

We need to avoid overriding of the ip_protocol with zeros,
in case that the user first put the L4 specification and
only then the L3.

Fixes: ca0d47538528b ('IB/mlx5: Add support in TOS and protocol to flow steering')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c