Skip to contentSkip to conversation

net/mlx5: share QUOTA indirect action

PATCH In review Gregory Etelson 3 participants 3 messages Jun 29, 2023 – Sep 18, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: share QUOTA indirect action

Support shared indirect QUOTA action.

flow configure 1 queues_number 4 queues_size 64 quotas_number 32 flow configure 0 queues_number 4 queues_size 64 quotas_number 0 \
host_port 1 flags 2

flow indirect_action 1 create ingress action_id 8 \
action quota_create limit 18000 mode l3 / end

flow actions_template 0 create ingress actions_template_id 1 \
template shared_indirect / jump / end \
mask quota_create / jump group 0 / end

flow queue 0 create 0 template_table 1 \
     pattern_template 0 actions_template 0 postpone no \
     pattern eth / end \
     actions shared_indirect 1 8 / jump group 2 / end
---
 drivers/net/mlx5/mlx5.h            |  1 -
 drivers/net/mlx5/mlx5_flow_hw.c    |  2 +-
 drivers/net/mlx5/mlx5_flow_quota.c | 92 ++++++++++++++++++++----------
 3 files changed, 63 insertions(+), 32 deletions(-)
drivers/net/mlx5/mlx5.h +0 -1
index 2a82348135..9b7771abfb 100644
@@ -1716,7 +1716,6 @@ struct mlx5_quota {
 
 /* Bulk management structure for flow quota. */
 struct mlx5_quota_ctx {
-	uint32_t nb_quotas; /* Total number of quota objects */
 	struct mlx5dr_action *dr_action; /* HWS action */
 	struct mlx5_devx_obj *devx_obj; /* DEVX ranged object. */
 	struct mlx5_pmd_mr mr; /* MR for READ from MTR ASO */
drivers/net/mlx5/mlx5_flow_hw.c +1 -1
index b5137a822a..42e865cf42 100644
@@ -7787,7 +7787,7 @@ flow_hw_configure(struct rte_eth_dev *dev,
 		goto err;
 	}
 	/* Initialize quotas */
-	if (port_attr->nb_quotas) {
+	if (port_attr->nb_quotas || (host_priv && host_priv->quota_ctx.devx_obj)) {
 		ret = mlx5_flow_quota_init(dev, port_attr->nb_quotas);
 		if (ret)
 			goto err;
drivers/net/mlx5/mlx5_flow_quota.c +62 -30

137 lines not on this page · raw message

Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 23 lines

-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Thursday, June 29, 2023 7:48 PM
To: [email protected]
Cc: Maayan Kashani <[email protected]>; Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>
Subject: [PATCH] net/mlx5: share QUOTA indirect action

Support shared indirect QUOTA action.

flow configure 1 queues_number 4 queues_size 64 quotas_number 32 flow configure 0 queues_number 4 queues_size 64 quotas_number 0 \
host_port 1 flags 2

flow indirect_action 1 create ingress action_id 8 \
action quota_create limit 18000 mode l3 / end

flow actions_template 0 create ingress actions_template_id 1 \
template shared_indirect / jump / end \
mask quota_create / jump group 0 / end

Quoted 6 lines
flow queue 0 create 0 template_table 1 \
     pattern_template 0 actions_template 0 postpone no \
     pattern eth / end \
     actions shared_indirect 1 8 / jump group 2 / end
#2 lore raw
In reply to Gregory Etelson

Hi,

Quoted 23 lines

-----Original Message-----
From: Gregory Etelson <[email protected]>
Sent: Thursday, June 29, 2023 7:48 PM
To: [email protected]
Cc: Maayan Kashani <[email protected]>; Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>; Ori Kam <[email protected]>; Suanming Mou <[email protected]>
Subject: [PATCH] net/mlx5: share QUOTA indirect action

Support shared indirect QUOTA action.

flow configure 1 queues_number 4 queues_size 64 quotas_number 32 flow configure 0 queues_number 4 queues_size 64 quotas_number 0 \
host_port 1 flags 2

flow indirect_action 1 create ingress action_id 8 \
action quota_create limit 18000 mode l3 / end

flow actions_template 0 create ingress actions_template_id 1 \
template shared_indirect / jump / end \
mask quota_create / jump group 0 / end

Quoted 6 lines
flow queue 0 create 0 template_table 1 \
     pattern_template 0 actions_template 0 postpone no \
     pattern eth / end \
     actions shared_indirect 1 8 / jump group 2 / end

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh