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 A4EA84331E; Mon, 13 Nov 2023 21:01:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3731A402AB; Mon, 13 Nov 2023 21:01:39 +0100 (CET) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 583A44026F for ; Mon, 13 Nov 2023 21:01:37 +0100 (CET) Received: from frapeml500008.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4STgJl1HTCz67y8R; Tue, 14 Nov 2023 04:00:23 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 13 Nov 2023 21:01:34 +0100 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.031; Mon, 13 Nov 2023 21:01:34 +0100 From: Konstantin Ananyev To: Stephen Hemminger , Trevor Tao CC: "dev@dpdk.org" Subject: RE: [PATCH v4 1/2] examples/l3fwd: relax RSS requirement with option Thread-Topic: [PATCH v4 1/2] examples/l3fwd: relax RSS requirement with option Thread-Index: AQHaFkryVdN9+oobAki9ObhtX/AxhbB4YUeAgAAV9oCAADJpsA== Date: Mon, 13 Nov 2023 20:01:34 +0000 Message-ID: References: <20231113160255.124385-1-taozj888@163.com> <20231113160255.124385-2-taozj888@163.com> <20231113083447.527c912b@hermes.local> <20231113095323.2c4064cf@hermes.local> In-Reply-To: <20231113095323.2c4064cf@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.81.190.147] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > > > Now the port Rx mq_mode had been set to RTE_ETH_MQ_RX_RSS > > > by default, but some hw and/or virtual interface does not > > > support the RSS and offload mode presupposed, e.g., some > > > virtio interfaces in the cloud don't support > > > RSS and the error msg may like: > > > > > > virtio_dev_configure(): RSS support requested but not supported by > > > the device > > > Port0 dev_configure =3D -95 > > > > > > So to enable the l3fwd running in that environment, the Rx mode requi= rement > > > can be relaxed to reflect the hardware feature reality here, and the = l3fwd > > > can run smoothly then. > > > > > > An option named "disable-rss" is added to disable the RX RSS explicit= ly, > > > and it's disabled by default. > > > > > > Signed-off-by: Trevor Tao > > > > Why is running with > 1 rx queue and RSS disabled useful? > > What happens is all packets arrive on 1st queue and you burn a thread > > polling an always empty queue. > > > > I would prefer not adding yet another command line option and > > just "do the right thing". If number of rx queues > 1, check that devic= e > > supports RSS before using it. If device does not support RSS give > > an error and exit. I think that's pretty much what we have right now in l3fwd. As I understand, the rational was: some virtual NICs does not support RSS (= vritio?), but there is still a desire to run l3fwd app on such devices. I presume for performance comparison purposes. So the idea was to relax NIC requirements and allow to run l3fwd with disab= led RSS. I suppose the main question here: what then will be the mechanism to distri= bute packets over different RX queues? >From my understanding with '--disable-rss' option enabled it is undefined a= nd=20 depends on particular NIC. In case of virtio, my guess - it will be hypervisor counterpart (vhost) to = determine packet distribution. >=20 > Something like this maybe: > diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c > index 6063eb139900..c747ef8aadfb 100644 > --- a/examples/l3fwd/main.c > +++ b/examples/l3fwd/main.c > @@ -1257,8 +1257,15 @@ l3fwd_poll_resource_setup(void) > local_port_conf.rx_adv_conf.rss_conf.rss_hf &=3D > dev_info.flow_type_rss_offloads; >=20 > - if (dev_info.max_rx_queues =3D=3D 1) > + if (nb_rx_queue > dev_info.max_rx_queues) > + rte_exit(EXIT_FAILURE, "Port %u only supports %u queues\n", > + portid, dev_info.max_rx_queues); > + > + if (nb_rx_queue =3D=3D 1) > local_port_conf.rxmode.mq_mode =3D RTE_ETH_MQ_RX_NONE; > + else if (!(dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_RSS_HASH)) > + rte_exit(EXIT_FAILURE, "Port %u does not support RSS but %u queues re= quested\n", > + portid, nb_rx_queue); >=20 > if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=3D > port_conf.rx_adv_conf.rss_conf.rss_hf) {