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 2CC074331D; Mon, 13 Nov 2023 18:53:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE0614026F; Mon, 13 Nov 2023 18:53:27 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 746A64026C for ; Mon, 13 Nov 2023 18:53:26 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so3578096b3a.3 for ; Mon, 13 Nov 2023 09:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1699898005; x=1700502805; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=moxQ8R5UBbRXLs3r2+MvmYCx/5P3gXc/4ii5cOHDpUU=; b=2A0VZGIlozEIwnFB9u8WPR5Fxf9T00ibgBfkQNcV4l5rxZ1QLHOUj6fzh8Ud8n85Pg fg0j7VZzVAupxT2Tffi57drhCY/fpqkEuy/0Vy041YK0HbDZ0j5r4Q94afi1dPuP+443 bxRAJEflPgtkX63BMRwuw97KbF4j0WGkVYrWv3WyAW5M6Nsi87d22NOJqcZsg00JSV8u 2MUCb9UVc+ns22SjPr9oDh/NwmSId8sOUd2BMLbh7rdql1CwDCJQ2X2jBz3SgfeXR0gf Uj+UhuZVarlTToEeCgwZHOnWwjR0eoLbH732zHUzgG54nVozadi4sm8YytU2szemOSm4 S4Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699898005; x=1700502805; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=moxQ8R5UBbRXLs3r2+MvmYCx/5P3gXc/4ii5cOHDpUU=; b=RNTEIsfR43CLC5Dr4sb7i0qKg7HeZ9/NYTWwjgka5cuRVhgXOp3o1giC4kw0825yiN dmvc/snxTpB0jS+qMk6gAXfoSW2GbaNzcCJh0VNwNz9BMv4MWRDdtn0SYTZgGEjaguuQ R+ZKwQ5MI/n7ivxcQ6Am1BPYu3gRRgUGxd7yf1RFJaMV92FkxDN39E4np6uneOX3Zkf0 Ht56OllQPw/5uhnq0noHn1QNNYlurXfTLrVpiC6Vrx1IjZEFHq25ETRUvOSx9EzYQ0JW zlofcCAoiOTKqT6D4EfGxLuqGqBJTOErKs3eplC7mwBJzZyMsrUcmO4pCaRFad5urDoH SaFw== X-Gm-Message-State: AOJu0YymH6jMcbGC6H6IrU2HP59g7aZL0suFQRRROJkuP+EarZ6p1231 bKNX7c+aPRnR02ATUPaugER8iA== X-Google-Smtp-Source: AGHT+IGCkQiB5JP9FDGVClR0elcftjMaZr9mkq2F9OREY2Sjrs7/s/e5Ho1JnerkKRiMkLm9N03REQ== X-Received: by 2002:a05:6a00:18a4:b0:6c4:b182:f3d9 with SMTP id x36-20020a056a0018a400b006c4b182f3d9mr6495898pfh.21.1699898005578; Mon, 13 Nov 2023 09:53:25 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id fb23-20020a056a002d9700b006b225011ee5sm4042763pfb.6.2023.11.13.09.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 09:53:25 -0800 (PST) Date: Mon, 13 Nov 2023 09:53:23 -0800 From: Stephen Hemminger To: Trevor Tao Cc: dev@dpdk.org Subject: Re: [PATCH v4 1/2] examples/l3fwd: relax RSS requirement with option Message-ID: <20231113095323.2c4064cf@hermes.local> In-Reply-To: <20231113083447.527c912b@hermes.local> References: <20231113160255.124385-1-taozj888@163.com> <20231113160255.124385-2-taozj888@163.com> <20231113083447.527c912b@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 13 Nov 2023 08:34:47 -0800 Stephen Hemminger wrote: > On Mon, 13 Nov 2023 16:02:54 +0000 > Trevor Tao wrote: > > > 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 = -95 > > > > So to enable the l3fwd running in that environment, the Rx mode requirement > > 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 explicitly, > > 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 device > supports RSS before using it. If device does not support RSS give > an error and exit. 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 &= dev_info.flow_type_rss_offloads; - if (dev_info.max_rx_queues == 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 == 1) local_port_conf.rxmode.mq_mode = 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 requested\n", + portid, nb_rx_queue); if (local_port_conf.rx_adv_conf.rss_conf.rss_hf != port_conf.rx_adv_conf.rss_conf.rss_hf) {