]> git.baikalelectronics.ru Git - kernel.git/commit
cxgb4: handle 4-tuple PEDIT to NAT mode translation
authorHerat Ramani <herat@chelsio.com>
Tue, 13 Oct 2020 09:31:29 +0000 (15:01 +0530)
committerJakub Kicinski <kuba@kernel.org>
Thu, 15 Oct 2020 01:20:37 +0000 (18:20 -0700)
commitf2cf0caa57b719c36cb95f90ba70dc58e4b4559a
tree55fd17222492fa68b240ccae6d5638030d2fa95c
parent98d595fac4ca17fa2f8e5afdc52d236c0deea17e
cxgb4: handle 4-tuple PEDIT to NAT mode translation

The 4-tuple NAT offload via PEDIT always overwrites all the 4-tuple
fields even if they had not been explicitly enabled. If any fields in
the 4-tuple are not enabled, then the hardware overwrites the
disabled fields with zeros, instead of ignoring them.

So, add a parser that can translate the enabled 4-tuple PEDIT fields
to one of the NAT mode combinations supported by the hardware and
hence avoid overwriting disabled fields to 0. Any rule with
unsupported NAT mode combination is rejected.

Signed-off-by: Herat Ramani <herat@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_flower.h