From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6DA0FA0528; Fri, 17 Jul 2020 11:34:19 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27C151BF98; Fri, 17 Jul 2020 11:34:18 +0200 (CEST) Received: from huawei.com (szxga07-in.huawei.com [45.249.212.35]) by dpdk.org (Postfix) with ESMTP id 7C6141BF94 for ; Fri, 17 Jul 2020 11:34:16 +0200 (CEST) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9EAD974F230F6EB5DEF5 for ; Fri, 17 Jul 2020 17:34:13 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Fri, 17 Jul 2020 17:34:06 +0800 From: "Wei Hu (Xavier)" To: CC: , Date: Fri, 17 Jul 2020 17:32:19 +0800 Message-ID: <1594978339-9720-1-git-send-email-xavier.huwei@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [RFC PATCH] ethdev: add a new flow action of queue range X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Chengwen Feng 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 Signed-off-by: Wei Hu (Xavier) --- 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