DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix offset field size in conntrack action
@ 2023-11-20  8:24 Dariusz Sosnowski
  2023-11-21 15:11 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Dariusz Sosnowski @ 2023-11-20  8:24 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko, Ori Kam, Suanming Mou
  Cc: dev, Raslan Darawsheh, stable

In mlx5 PMD, struct mlx5_aso_ct_action represents a single ASO CT object
inside a ASO CT bulk, which is used to implement conntrack flow action.
offset field, which is 16 bits wide, in this struct represents
an offset of the given object inside a bulk.

When SW Steering flow engine is used, ASO CT bulks are allocated on
demand, each having 64 objects. In this case offset field can fit any
valid object offset.

When HW Steering flow engine is used, a single ASO CT bulk is allocated
during flow engine configuration. Since HW supports bulks bigger
than 2^16 this offset field is too small to fit all valid values.
This causes some ASO CT objects to be incorrectly reused on multiple
connections, when more than 2^16 conntrack flow actions are used.

This patch fixes this behavior. offset field size is increased
to 32 bits.

Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS")
Cc: suanmingm@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
 drivers/net/mlx5/mlx5.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 76bf7d0f4f..263ebead7f 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -1286,7 +1286,7 @@ struct mlx5_aso_ct_action {
 	/* General action object for reply dir. */
 	void *dr_action_rply;
 	uint32_t refcnt; /* Action used count in device flows. */
-	uint16_t offset; /* Offset of ASO CT in DevX objects bulk. */
+	uint32_t offset; /* Offset of ASO CT in DevX objects bulk. */
 	uint16_t peer; /* The only peer port index could also use this CT. */
 	enum mlx5_aso_ct_state state; /* ASO CT state. */
 	bool is_original; /* The direction of the DR action to be used. */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [PATCH] net/mlx5: fix offset field size in conntrack action
  2023-11-20  8:24 [PATCH] net/mlx5: fix offset field size in conntrack action Dariusz Sosnowski
@ 2023-11-21 15:11 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2023-11-21 15:11 UTC (permalink / raw)
  To: Dariusz Sosnowski, Matan Azrad, Slava Ovsiienko, Ori Kam, Suanming Mou
  Cc: dev, stable

Hi,
> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Monday, November 20, 2023 10:25 AM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>; Suanming Mou
> <suanmingm@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix offset field size in conntrack action
> 
> In mlx5 PMD, struct mlx5_aso_ct_action represents a single ASO CT object
> inside a ASO CT bulk, which is used to implement conntrack flow action.
> offset field, which is 16 bits wide, in this struct represents
> an offset of the given object inside a bulk.
> 
> When SW Steering flow engine is used, ASO CT bulks are allocated on
> demand, each having 64 objects. In this case offset field can fit any
> valid object offset.
> 
> When HW Steering flow engine is used, a single ASO CT bulk is allocated
> during flow engine configuration. Since HW supports bulks bigger
> than 2^16 this offset field is too small to fit all valid values.
> This causes some ASO CT objects to be incorrectly reused on multiple
> connections, when more than 2^16 conntrack flow actions are used.
> 
> This patch fixes this behavior. offset field size is increased
> to 32 bits.
> 
> Fixes: 463170a7c934 ("net/mlx5: support connection tracking with HWS")
> Cc: suanmingm@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com> 

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-21 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-20  8:24 [PATCH] net/mlx5: fix offset field size in conntrack action Dariusz Sosnowski
2023-11-21 15:11 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).