From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 690BEA0545; Tue, 20 Dec 2022 21:03:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 576EE42D10; Tue, 20 Dec 2022 21:03:24 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id F05BC40684 for ; Tue, 20 Dec 2022 21:03:21 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BKHOmq4018275; Tue, 20 Dec 2022 12:03:21 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=0GH9XIQkbjvKO79hMHqWh79OYQ/bZdgYxDzPZBoE6o4=; b=YYg7VaRf0cNd3K3p9PxF1mhLw8YT7+BmfwLsMRRrKtXKJQIZVpcRhMU7kkx6m4bfT5Lf lNuBH7opmHjDcjB7f3hhzRj+uCJYfOt62QgZgyxAl+Qbums09KFotnjOmoaEImKko296 3D9Blqx2vUymv2qtZP5iC/8FBc/ZIxikpxhohXCFG0Qgm8c+qsdgzW/oMoi0ZIMBIsu9 AMad34h0+qJXbCSKy4mfGdtcjrsyVVEKMr5iOMj/hwfju+9IMhBoi7isnmSX4tHAFL43 NpO1SnRBsnrTaxCvo6eiWIG0wg++3xkd2ShetItAXEuoXMOqMev8PJHGDQI5YtSbtDuL GA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mkapj2yft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 20 Dec 2022 12:03:21 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 20 Dec 2022 12:03:19 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 20 Dec 2022 12:03:19 -0800 Received: from localhost.localdomain (unknown [10.28.36.155]) by maili.marvell.com (Postfix) with ESMTP id 4BFA03F7063; Tue, 20 Dec 2022 12:03:15 -0800 (PST) From: Hanumanth Pothula To: Aman Singh , Yuying Zhang CC: , , , , , Subject: [PATCH v4 2/2] app/testpmd: add command to process Rx metadata negotiation Date: Wed, 21 Dec 2022 01:32:50 +0530 Message-ID: <20221220200250.2413443-2-hpothula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220200250.2413443-1-hpothula@marvell.com> References: <20221006183522.1330826-1-hpothula@marvell.com> <20221220200250.2413443-1-hpothula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: ndk9Yw26e93-dIxBOg7Kprk7pl_2ZNq1 X-Proofpoint-GUID: ndk9Yw26e93-dIxBOg7Kprk7pl_2ZNq1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-20_06,2022-12-20_01,2022-06-22_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Presently, Rx metadata is sent to PMD by default, leading to a performance drop as processing for the same in Rx path takes extra cycles. Hence, add new testpmd command, 'enable port nic_to_pmd_rx_metadata' This command helps in sending Rx metadata to PMD and thereby Rx metadata flow command requests are processed. Signed-off-by: Hanumanth Pothula --- app/test-pmd/cmdline.c | 58 +++++++++++++++++++++ app/test-pmd/config.c | 9 ++++ app/test-pmd/testpmd.c | 5 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 +++ 4 files changed, 76 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index b32dc8bfd4..56946b2520 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -610,6 +610,9 @@ static void cmd_help_long_parsed(void *parsed_result, "set port (port_id) fec_mode auto|off|rs|baser\n" " set fec mode for a specific port\n\n" + "enable port nic_to_pmd_rx_metadata" + " Allow nic to pmd Rx metadata negotiation\n\n" + , list_pkt_forwarding_modes() ); } @@ -12621,6 +12624,60 @@ static cmdline_parse_inst_t cmd_show_port_flow_transfer_proxy = { } }; +/* Allow negotiating Rx metadata between NIC and PMD */ +struct cmd_config_port_rx_metadata { + cmdline_fixed_string_t enable; + cmdline_fixed_string_t port; + uint16_t port_id; + cmdline_fixed_string_t nic_to_pmd_rx_metadata; +}; + +static void +cmd_config_port_rx_metadata_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ + struct cmd_config_port_rx_metadata *res = parsed_result; + + if (port_id_is_invalid(res->port_id, ENABLED_WARN)) + return; + if (!port_is_stopped(res->port_id)) { + fprintf(stderr, "Please stop port %u first\n", res->port_id); + return; + } + + ports[res->port_id].dev_conf.nic_to_pmd_rx_metadata = 1; + + reset_port(res->port_id); +} + + +static cmdline_parse_token_string_t cmd_config_port_rx_metadata_enable = + TOKEN_STRING_INITIALIZER(struct cmd_config_port_rx_metadata, enable, + "enable"); +static cmdline_parse_token_string_t cmd_config_port_rx_metadata_port = + TOKEN_STRING_INITIALIZER(struct cmd_config_port_rx_metadata, port, + "port"); +static cmdline_parse_token_num_t cmd_config_port_rx_metadata_id = + TOKEN_NUM_INITIALIZER(struct cmd_config_port_rx_metadata, port_id, + RTE_UINT16); +static cmdline_parse_token_string_t cmd_config_port_rx_metadata_nic_to_pmd_rx_metadata = + TOKEN_STRING_INITIALIZER(struct cmd_config_port_rx_metadata, nic_to_pmd_rx_metadata, + "nic_to_pmd_rx_metadata"); + +static cmdline_parse_inst_t cmd_config_port_rx_metadata_parse = { + .f = cmd_config_port_rx_metadata_parsed, + .data = NULL, + .help_str = "enable port nic_to_pmd_rx_metadata", + .tokens = { + (void *)&cmd_config_port_rx_metadata_enable, + (void *)&cmd_config_port_rx_metadata_port, + (void *)&cmd_config_port_rx_metadata_id, + (void *)&cmd_config_port_rx_metadata_nic_to_pmd_rx_metadata, + NULL, + }, +}; + /* ******************************************************************************** */ /* list of instructions */ @@ -12851,6 +12908,7 @@ static cmdline_parse_ctx_t builtin_ctx[] = { (cmdline_parse_inst_t *)&cmd_show_capability, (cmdline_parse_inst_t *)&cmd_set_flex_is_pattern, (cmdline_parse_inst_t *)&cmd_set_flex_spec_pattern, + (cmdline_parse_inst_t *)&cmd_config_port_rx_metadata_parse, NULL, }; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index acccb6b035..47fce3accb 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3249,6 +3249,15 @@ port_flow_create(portid_t port_id, } id = port->flow_list->id + 1; } + + if (port->dev_conf.nic_to_pmd_rx_metadata == 0 && + (actions->type == RTE_FLOW_ACTION_TYPE_MARK || + actions->type == RTE_FLOW_ACTION_TYPE_FLAG)) { + fprintf(stderr, + "rx metadata is not negotiated with PMD\n"); + return -EINVAL; + } + if (tunnel_ops->enabled) { pft = port_flow_tunnel_offload_cmd_prep(port_id, pattern, actions, tunnel_ops); diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 134d79a555..22e5e08fc1 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1604,8 +1604,6 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id) int ret; int i; - eth_rx_metadata_negotiate_mp(pid); - port->dev_conf.txmode = tx_mode; port->dev_conf.rxmode = rx_mode; @@ -2946,6 +2944,9 @@ start_port(portid_t pid) port->update_conf = 0; } + if (port->dev_conf.nic_to_pmd_rx_metadata) + eth_rx_metadata_negotiate_mp(pi); + /* configure port */ diag = eth_dev_configure_mp(pi, nb_rxq + nb_hairpinq, nb_txq + nb_hairpinq, diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 0037506a79..024dbf6012 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1558,6 +1558,12 @@ Enable or disable a per port Rx offloading on all Rx queues of a port:: This command should be run when the port is stopped, or else it will fail. +Enable Rx metadata negotiation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Enable NIC to PMD Rx metadata negotiation:: + testpmd> enable port nic_to_pmd_rx_metadata + config per queue Rx offloading ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.25.1