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 7496BA04C9; Sun, 13 Sep 2020 17:49:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5417E1BE81; Sun, 13 Sep 2020 17:49:49 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 971C9E07 for ; Sun, 13 Sep 2020 17:49:47 +0200 (CEST) From: Bing Zhao To: thomas@monjalon.net, orika@nvidia.com, ferruh.yigit@intel.com, arybchenko@solarflare.com Cc: dev@dpdk.org Date: Sun, 13 Sep 2020 23:48:58 +0800 Message-Id: <1600012140-70151-3-git-send-email-bingz@nvidia.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1600012140-70151-1-git-send-email-bingz@nvidia.com> References: <1600012140-70151-1-git-send-email-bingz@nvidia.com> Subject: [dpdk-dev] [RFC PATCH v2 2/4] testpmd: add item transmit queue in flow CLI 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" In the testpmd command line for flow creation, add the keyword 'tx_queue' in the pattern scope so the item transmit queue ID could be specified during the flow creation. The index of the transmit queue should be in the range [0, nb_tx_queue - 1] supplied to rte_eth_dev_configure() during initialization. Normal TX queues and hairpin TX queues will have a unified index number sequence. Signed-off-by: Bing Zhao --- app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 6263d30..f7816fc 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -109,6 +109,8 @@ enum index { ITEM_PHY_PORT_INDEX, ITEM_PORT_ID, ITEM_PORT_ID_ID, + ITEM_TX_QUEUE, + ITEM_TX_QUEUE_ID, ITEM_MARK, ITEM_MARK_ID, ITEM_RAW, @@ -759,6 +761,7 @@ static const enum index next_item[] = { ITEM_VF, ITEM_PHY_PORT, ITEM_PORT_ID, + ITEM_TX_QUEUE, ITEM_MARK, ITEM_RAW, ITEM_ETH, @@ -1954,6 +1957,21 @@ static const struct token token_list[] = { .next = NEXT(item_port_id, NEXT_ENTRY(UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY(struct rte_flow_item_port_id, id)), }, + [ITEM_TX_QUEUE] = { + .name = "tx_queue", + .help = "match traffic from a given transmit queue", + .priv = PRIV_ITEM(QUEUE, + sizeof(struct rte_flow_item_tx_queue)), + .next = NEXT(NEXT_ENTRY(ITEM_TX_QUEUE_ID)), + .call = parse_vc, + }, + [ITEM_TX_QUEUE_ID] = { + .name = "index", + .help = "TX queue index of this port", + .next = NEXT(NEXT_ENTRY(ITEM_NEXT), NEXT_ENTRY(UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_tx_queue, queue)), + }, [ITEM_MARK] = { .name = "mark", .help = "match traffic against value set in previously matched rule", -- 2.5.5