OSDN Git Service

IB/mlx5: Don't override existing ip_protocol
authorMaor Gottlieb <maorg@mellanox.com>
Thu, 17 Jan 2019 18:08:15 +0000 (20:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:14 +0000 (14:50 +0100)
commita7a9df36803d18bf00870716c712907d9a355214
tree8f7140e68ec4cd0d5d4156b624bd7f70fef36e56
parent0594ddddf863f76afcfcf2c3480275aeee8bad33
IB/mlx5: Don't override existing ip_protocol

[ Upstream commit 6113cc44015b41ca51c0a76fed82522b68108dac ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/main.c