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 121E742E6E; Fri, 14 Jul 2023 09:50:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DACC9406B8; Fri, 14 Jul 2023 09:50:31 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 8EB6A40685 for ; Fri, 14 Jul 2023 09:50:30 +0200 (CEST) Received: from kwepemm600004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4R2NsN64tbzVjlX; Fri, 14 Jul 2023 15:49:12 +0800 (CST) Received: from [10.67.103.231] (10.67.103.231) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 14 Jul 2023 15:50:28 +0800 Message-ID: <890ef1a9-54c1-6e0a-1b1f-4292219e9a29@huawei.com> Date: Fri, 14 Jul 2023 15:50:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH] app/test-pipeline: relax RSS hash requirement To: Feifei Wang , Cristian Dumitrescu CC: , , Ruifeng Wang , Trevor Tao References: <20230626074538.3354554-1-feifei.wang2@arm.com> From: "lihuisong (C)" In-Reply-To: <20230626074538.3354554-1-feifei.wang2@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected 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 在 2023/6/26 15:45, Feifei Wang 写道: > 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 > --- > 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; > + please delete this blank line. > > /* 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); > This treatment is very common. Acked-by: Huisong Li