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 7025942579; Tue, 12 Sep 2023 08:39:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57F78402D7; Tue, 12 Sep 2023 08:39:17 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id 64E48402CF for ; Tue, 12 Sep 2023 08:39:15 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C86E8C15; Mon, 11 Sep 2023 23:39:51 -0700 (PDT) Received: from net-x86-dell-8268.shanghai.arm.com (net-x86-dell-8268.shanghai.arm.com [10.169.210.116]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4B83F3F67D; Mon, 11 Sep 2023 23:39:12 -0700 (PDT) From: Feifei Wang To: Cristian Dumitrescu Cc: dev@dpdk.org, nd@arm.com, Feifei Wang , Ruifeng Wang , Trevor Tao , Huisong Li Subject: [PATCH v3 1/3] app/test-pipeline: relax RSS hash requirement Date: Tue, 12 Sep 2023 14:39:01 +0800 Message-Id: <20230912063903.1266245-2-feifei.wang2@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230912063903.1266245-1-feifei.wang2@arm.com> References: <20230626074538.3354554-1-feifei.wang2@arm.com> <20230912063903.1266245-1-feifei.wang2@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 For some drivers which can not support the configured RSS hash functions, the thread reports 'invalid rss_hf' when doing device configure. For example, i40e driver can not support 'RTE_ETH_RSS_IPV4', 'RTE_ETH_RSS_IPV6' and 'RTE_ETH_RSS_NONFRAG_IPV6_OTHER', thus it can not run successfully in test-pipeline with XL710 NIC and reports the issue: ------------------------------------------------------------- Ethdev port_id=0 invalid rss_hf: 0xa38c, valid value: 0x7ef8 PANIC in app_init_ports(): Cannot init NIC port 0 (-22) ------------------------------------------------------------- To fix this, referring to l3fwd operation, adjust the 'rss_hf' based on device capability and just report a warning. Signed-off-by: Feifei Wang Reviewed-by: Ruifeng Wang Reviewed-by: Trevor Tao Acked-by: Huisong Li --- app/test-pipeline/init.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c index d146c44be0..84a1734519 100644 --- a/app/test-pipeline/init.c +++ b/app/test-pipeline/init.c @@ -188,21 +188,41 @@ static void app_init_ports(void) { uint32_t i; + struct rte_eth_dev_info dev_info; + /* Init NIC ports, then start the ports */ for (i = 0; i < app.n_ports; i++) { uint16_t port; int ret; + struct rte_eth_conf local_port_conf = port_conf; port = app.ports[i]; RTE_LOG(INFO, USER1, "Initializing NIC port %u ...\n", port); + ret = rte_eth_dev_info_get(port, &dev_info); + if (ret != 0) + rte_panic("Error during getting device (port %u) info: %s\n", + port, rte_strerror(-ret)); + /* Init port */ + local_port_conf.rx_adv_conf.rss_conf.rss_hf &= + dev_info.flow_type_rss_offloads; + if (local_port_conf.rx_adv_conf.rss_conf.rss_hf != + port_conf.rx_adv_conf.rss_conf.rss_hf) { + printf("Warning:" + "Port %u modified RSS hash function based on hardware support," + "requested:%#"PRIx64" configured:%#"PRIx64"\n", + port, + port_conf.rx_adv_conf.rss_conf.rss_hf, + local_port_conf.rx_adv_conf.rss_conf.rss_hf); + } + ret = rte_eth_dev_configure( port, 1, 1, - &port_conf); + &local_port_conf); if (ret < 0) rte_panic("Cannot init NIC port %u (%d)\n", port, ret); -- 2.25.1