DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
To: <dev@dpdk.org>
Cc: <huwei87@hisilicon.com>, <fengchengwen@huawei.com>
Subject: [dpdk-dev] [RFC PATCH] ethdev: add a new flow action of queue range
Date: Fri, 17 Jul 2020 17:32:19 +0800	[thread overview]
Message-ID: <1594978339-9720-1-git-send-email-xavier.huwei@huawei.com> (raw)

From: Chengwen Feng <fengchengwen@huawei.com>

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.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
---
 lib/librte_ethdev/rte_flow.c |  1 +
 lib/librte_ethdev/rte_flow.h | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c
index f8fdd68..8d85576 100644
--- a/lib/librte_ethdev/rte_flow.c
+++ b/lib/librte_ethdev/rte_flow.c
@@ -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)),
diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
index da8bfa5..9211a2e 100644
--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -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
  *
-- 
2.7.4


             reply	other threads:[~2020-07-17  9:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  9:32 Wei Hu (Xavier) [this message]
2020-07-19 12:30 ` Andrew Rybchenko
2020-07-19 13:32   ` Ori Kam
2020-07-19 13:34     ` Ori Kam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1594978339-9720-1-git-send-email-xavier.huwei@huawei.com \
    --to=xavier.huwei@huawei.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=huwei87@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).