net/mlx5: Consider VLAN interface in MACsec TX steering rules
authorEmeel Hakim <ehakim@nvidia.com>
Wed, 19 Apr 2023 14:21:25 +0000 (17:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Apr 2023 07:22:15 +0000 (08:22 +0100)
commit765f974c7dfd104ed569fae1669adfc0e70ded1b
treebd5d18a8835fc2d7126250a3baf71deaad0f6c78
parent4bba492b04270c29259594d1b9ee66ce96af9466
net/mlx5: Consider VLAN interface in MACsec TX steering rules

Offloading MACsec when its configured over VLAN with current MACsec
TX steering rules will wrongly insert MACsec sec tag after inserting
the VLAN header leading to a ETHERNET | SECTAG | VLAN packet when
ETHERNET | VLAN | SECTAG is configured.

The above issue is due to adding the SECTAG by HW which is a later
stage compared to the VLAN header insertion stage.

Detect such a case and adjust TX steering rules to insert the
SECTAG in the correct place by using reformat_param_0 field in
the packet reformat to indicate the offset of SECTAG from end of
the MAC header to account for VLANs in granularity of 4Bytes.

Signed-off-by: Emeel Hakim <ehakim@nvidia.com>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c