Skip to contentSkip to conversation

ethdev: add a new flow action of queue range

RFC PATCH In review Wei Hu (Xavier) 3 participants 4 messages Jul 17, 2020 – Jul 19, 2020

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ethdev: add a new flow action of queue range

From: Chengwen Feng <[email protected]>

This patch adds a new flow action of queue range, which was used to assign packets to a continuous queue range.

Current FD (flow director) provide a useful means to assign packets to a target queue. But it has the following shortage: it can only route to one queue, and there is an upper limit on one queue rxtx capacity, which means the FD rule need more accurate else it may exceed the queue capacity.

With the support of queue range action, user can create FD rule with action routed to a continuous queues, like:

	FD rule 0 ------|-----> queue 0
			|-----> queue 1

	FD rule 1 ------|-----> queue 8
			|-----> queue 9
			|-----> queue 10
			|-----> queue 11

Note: hardware can use RSS to distribute traffic to the continuous queues when packets match the above FD rule.

With the support of queue range action, we can further provide QoS service when DCB disabled.
eg: one NE (network element) is configured with two ip addresses, one for control plane and the other for data plane, user can create two FD rules, the first for directing control plane packets to queue 0, the second for directing data plane packets to queue 1~15.

---
 lib/librte_ethdev/rte_flow.c |  1 +
 lib/librte_ethdev/rte_flow.h | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
lib/librte_ethdev/rte_flow.c +1 -0
index f8fdd68..8d85576 100644
@@ -114,6 +114,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
 	MK_FLOW_ACTION(MARK, sizeof(struct rte_flow_action_mark)),
 	MK_FLOW_ACTION(FLAG, 0),
 	MK_FLOW_ACTION(QUEUE, sizeof(struct rte_flow_action_queue)),
+	MK_FLOW_ACTION(QUEUE_RANGE, sizeof(struct rte_flow_action_queue_range)),
 	MK_FLOW_ACTION(DROP, 0),
 	MK_FLOW_ACTION(COUNT, sizeof(struct rte_flow_action_count)),
 	MK_FLOW_ACTION(RSS, sizeof(struct rte_flow_action_rss)),
lib/librte_ethdev/rte_flow.h +17 -0
index da8bfa5..9211a2e 100644
@@ -1703,6 +1703,13 @@ enum rte_flow_action_type {
 	RTE_FLOW_ACTION_TYPE_QUEUE,
 
 	/**
+	 * Assigns packets to a given queue range.
+	 *
+	 * See struct rte_flow_action_queue_range.
+	 */
+	RTE_FLOW_ACTION_TYPE_QUEUE_RANGE,
+
+	/**
 	 * Drops packets.
 	 *
 	 * PASSTHRU overrides this action if both are specified.
@@ -2149,6 +2156,16 @@ struct rte_flow_action_mark {
 };
 
 /**
+ * RTE_FLOW_ACTION_TYPE_QUEUE_RANGE
+ *
+ * Assign packets to a given queue range.
+ */
+struct rte_flow_action_queue_range {
+	uint16_t start_index; /**< Index of start queue start to use. */
+	uint16_t queue_num;   /**< Num of continuous queues from start_index. */
+};
+
+/**
  * @warning
  * @b EXPERIMENTAL: this structure may change without prior notice
  *
Signature · 1 line
2.7.4
#1 lore raw
Quoted 23 lines · Wei Hu (Xavier)

From: Chengwen Feng <[email protected]>

This patch adds a new flow action of queue range, which was used to assign packets to a continuous queue range.

Current FD (flow director) provide a useful means to assign packets to a target queue. But it has the following shortage: it can only route to one queue, and there is an upper limit on one queue rxtx capacity, which means the FD rule need more accurate else it may exceed the queue capacity.

With the support of queue range action, user can create FD rule with action routed to a continuous queues, like:

	FD rule 0 ------|-----> queue 0
			|-----> queue 1

	FD rule 1 ------|-----> queue 8
			|-----> queue 9
			|-----> queue 10
			|-----> queue 11

Note: hardware can use RSS to distribute traffic to the continuous queues when packets match the above FD rule.

Quoted 6 lines

With the support of queue range action, we can further provide QoS service when DCB disabled.
eg: one NE (network element) is configured with two ip addresses, one for control plane and the other for data plane, user can create two FD rules, the first for directing control plane packets to queue 0, the second for directing data plane packets to queue 1~15.

I don't understand why it is not covered by RSS action.

Quoted 3 lines

[snip]

#2 lore raw
Quoted 29 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Andrew Rybchenko

Quoted 23 lines · Wei Hu (Xavier)

From: Chengwen Feng <[email protected]>

This patch adds a new flow action of queue range, which was used to assign packets to a continuous queue range.

Current FD (flow director) provide a useful means to assign packets to a target queue. But it has the following shortage: it can only route to one queue, and there is an upper limit on one queue rxtx capacity, which means the FD rule need more accurate else it may exceed the queue capacity.

With the support of queue range action, user can create FD rule with action routed to a continuous queues, like:

	FD rule 0 ------|-----> queue 0
			|-----> queue 1

	FD rule 1 ------|-----> queue 8
			|-----> queue 9
			|-----> queue 10
			|-----> queue 11

Note: hardware can use RSS to distribute traffic to the continuous queues when packets match the above FD rule.

Quoted 9 lines
Quoted 6 lines

With the support of queue range action, we can further provide QoS service when DCB disabled.
eg: one NE (network element) is configured with two ip addresses, one for control plane and the other for data plane, user can create two FD rules, the first for directing control plane packets to queue 0, the second for directing data plane packets to queue 1~15.

I don't understand why it is not covered by RSS action.

+1
This should be covered in RSS action.

Quoted 5 lines
Quoted 3 lines

[snip]

Best,
Ori

#3 lore raw

Hi Fengchen,

Please make sure to include maintainers next time.

Thanks,
Ori

Quoted 52 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ori Kam

Quoted 27 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Andrew Rybchenko

Quoted 23 lines · Wei Hu (Xavier)

From: Chengwen Feng <[email protected]>

This patch adds a new flow action of queue range, which was used to assign packets to a continuous queue range.

Current FD (flow director) provide a useful means to assign packets to a target queue. But it has the following shortage: it can only route to one queue, and there is an upper limit on one queue rxtx capacity, which means the FD rule need more accurate else it may exceed the queue capacity.

With the support of queue range action, user can create FD rule with action routed to a continuous queues, like:

	FD rule 0 ------|-----> queue 0
			|-----> queue 1

	FD rule 1 ------|-----> queue 8
			|-----> queue 9
			|-----> queue 10
			|-----> queue 11

Note: hardware can use RSS to distribute traffic to the continuous queues when packets match the above FD rule.

Quoted 9 lines
Quoted 6 lines

With the support of queue range action, we can further provide QoS service when DCB disabled.
eg: one NE (network element) is configured with two ip addresses, one for control plane and the other for data plane, user can create two FD rules, the first for directing control plane packets to queue 0, the second for directing data plane packets to queue 1~15.

I don't understand why it is not covered by RSS action.

+1
This should be covered in RSS action.

Quoted 5 lines
Quoted 3 lines

[snip]

Best,
Ori