]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/mlx5: Refactor MACsec WQE metadata shifts
authorCarolina Jubran <cjubran@nvidia.com>
Thu, 11 Sep 2025 07:10:18 +0000 (10:10 +0300)
committerLeon Romanovsky <leon@kernel.org>
Wed, 17 Sep 2025 08:38:10 +0000 (04:38 -0400)
commitcce65f32443b61db2370a67d2e92d16b773fe8a4
tree517345df34812a38e8f45aff976e453430d61ca4
parentde2be98541dbe0de58d2dccf7fa19dfc9d9a8260
net/mlx5: Refactor MACsec WQE metadata shifts

Introduce MLX5_ETH_WQE_FT_META_SHIFT as a shared base offset for
features that use the lower 8 bits of the WQE flow_table_metadata
field, currently used for timestamping, IPsec, and MACsec.

Define MLX5_ETH_WQE_FT_META_MACSEC_FS_ID_MASK so that fs_id occupies
bits 2–5, making it clear that fs_id occupies bits in the metadata.

Set MLX5_ETH_WQE_FT_META_MACSEC_MASK as the OR of the MACsec flag and
MLX5_ETH_WQE_FT_META_MACSEC_FS_ID_MASK, corresponding to the original
0x3E mask.

Update the fs_id macro to right-shift the MACsec flag by
MLX5_ETH_WQE_FT_META_SHIFT and update the RoCE modify-header action to
use it.

Introduce the helper macro MLX5_MACSEC_TX_METADATA(fs_id) to compose
the full shifted MACsec metadata value.

These changes make it explicit exactly which metadata bits carry MACsec
information, simplifying future feature exclusions when multiple
features share the WQE flowtable metadata.

In addition, drop the incorrect “RX flow steering” comment, since this
applies to TX flow steering.

Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1757574619-604874-3-git-send-email-tariqt@nvidia.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c
drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.h
include/linux/mlx5/qp.h