Skip to contentSkip to conversation

net/mlx5: fix NAT64 HW registers calculation

PATCH In review Bing Zhao 2 participants 2 messages Mar 25 Network drivers

lore
Share & tools
lore

Bing Zhao

author
#0 lore raw

PATCH 1/1 net/mlx5: fix NAT64 HW registers calculation

mlx5 PMD needs to select a set of 3 HW registers
which will be used to implement NAT64 flow action.
For compatibility reasons one of these registers has to be REG_C_6. Offending patch introduced a bug to register selection logic. If REG_C_6 was not available for use,
no registers were selected for NAT64.
So all the registers' information would not be initialized for the temporary storage of headers information of NAT64.

This patch adds missing logic to use the last 3 available tag registers in this case, allowing NAT64 flow action to be used.

Fixes f15535128617 ("net/mlx5: fix NAT64 register selection")
---
 drivers/net/mlx5/mlx5.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/mlx5/mlx5.c +6 -0
index d9bc5ee197..70f52df78a 100644
@@ -1679,6 +1679,12 @@ mlx5_init_hws_flow_tags_registers(struct mlx5_dev_ctx_shared *sh)
 		reg->nat64_regs[0] = REG_C_6;
 		reg->nat64_regs[1] = reg->hw_avl_tags[j - 2];
 		reg->nat64_regs[2] = reg->hw_avl_tags[j - 1];
+	} else {
+		if (j >= MLX5_FLOW_NAT64_REGS_MAX) {
+			reg->nat64_regs[0] = reg->hw_avl_tags[j - 3];
+			reg->nat64_regs[1] = reg->hw_avl_tags[j - 2];
+			reg->nat64_regs[2] = reg->hw_avl_tags[j - 1];
+		}
 	}
 }
 
Signature · 1 line
2.34.1
#1 lore raw

Hi,

Quoted 12 lines · Bing Zhao

mlx5 PMD needs to select a set of 3 HW registers
which will be used to implement NAT64 flow action.
For compatibility reasons one of these registers has to be REG_C_6. Offending patch introduced a bug to register selection logic. If REG_C_6 was not available for use,
no registers were selected for NAT64.
So all the registers' information would not be initialized for the temporary storage of headers information of NAT64.

This patch adds missing logic to use the last 3 available tag registers in this case, allowing NAT64 flow action to be used.

Quoted 6 lines
Fixes f15535128617 ("net/mlx5: fix NAT64 register selection")

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh