From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 889DCC43461 for ; Sun, 13 Sep 2020 15:49:50 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 189BA205CB for ; Sun, 13 Sep 2020 15:49:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 189BA205CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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