DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: fix flex item flow handle size
@ 2022-02-28 10:01 Gregory Etelson
  2022-03-02 16:31 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Etelson @ 2022-02-28 10:01 UTC (permalink / raw)
  To: dev; +Cc: getelson, matan, rasland, stable, Viacheslav Ovsiienko

Reduce flex item flow handle size from 32 bits to 8 bits for each
flow.
The patch will save memory in setups with millions of flows.

Cc: stable@dpdk.org

Fixes: a23e9b6e3ee9 ("net/mlx5: handle flex item in flows")
Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.h    | 2 +-
 drivers/net/mlx5/mlx5_flow_dv.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index e510921a3f..484ce5791e 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -700,7 +700,6 @@ struct mlx5_flow_handle {
 	uint32_t split_flow_id:27; /**< Sub flow unique match flow id. */
 	uint32_t is_meter_flow_id:1; /**< Indicate if flow_id is for meter. */
 	uint32_t fate_action:3; /**< Fate action type. */
-	uint32_t flex_item; /**< referenced Flex Item bitmask. */
 	union {
 		uint32_t rix_hrxq; /**< Hash Rx queue object index. */
 		uint32_t rix_jump; /**< Index to the jump action resource. */
@@ -716,6 +715,7 @@ struct mlx5_flow_handle {
 #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
 	struct mlx5_flow_handle_dv dvh;
 #endif
+	uint8_t flex_item; /**< referenced Flex Item bitmask. */
 } __rte_packed;
 
 /*
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 2191ce6e58..fc4bcef6fb 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -10276,7 +10276,7 @@ flow_dv_translate_item_flex(struct rte_eth_dev *dev, void *matcher, void *key,
 		/* Don't count both inner and outer flex items in one rule. */
 		if (mlx5_flex_acquire_index(dev, spec->handle, true) != index)
 			MLX5_ASSERT(false);
-		dev_flow->handle->flex_item |= RTE_BIT32(index);
+		dev_flow->handle->flex_item |= (uint8_t)RTE_BIT32(index);
 	}
 	mlx5_flex_flow_translate_item(dev, matcher, key, item, is_inner);
 }
@@ -14627,7 +14627,7 @@ flow_dv_destroy(struct rte_eth_dev *dev, struct rte_flow *flow)
 			int index = rte_bsf32(dev_handle->flex_item);
 
 			mlx5_flex_release_index(dev, index);
-			dev_handle->flex_item &= ~RTE_BIT32(index);
+			dev_handle->flex_item &= ~(uint8_t)RTE_BIT32(index);
 		}
 		if (dev_handle->dvh.matcher)
 			flow_dv_matcher_release(dev, dev_handle);
-- 
2.34.1


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

* RE: [PATCH] net/mlx5: fix flex item flow handle size
  2022-02-28 10:01 [PATCH] net/mlx5: fix flex item flow handle size Gregory Etelson
@ 2022-03-02 16:31 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-03-02 16:31 UTC (permalink / raw)
  To: Gregory Etelson, dev; +Cc: Matan Azrad, stable, Slava Ovsiienko

Hi

> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Monday, February 28, 2022 12:01 PM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [PATCH] net/mlx5: fix flex item flow handle size
> 
> Reduce flex item flow handle size from 32 bits to 8 bits for each flow.
> The patch will save memory in setups with millions of flows.
> 
> Cc: stable@dpdk.org
> 
> Fixes: a23e9b6e3ee9 ("net/mlx5: handle flex item in flows")
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@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:[~2022-03-02 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 10:01 [PATCH] net/mlx5: fix flex item flow handle size Gregory Etelson
2022-03-02 16:31 ` 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).