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 7DB5CA0352; Tue, 22 Feb 2022 10:41:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1DD3E40DF6; Tue, 22 Feb 2022 10:41:32 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id BBF3F40DF4 for ; Tue, 22 Feb 2022 10:41:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645522890; x=1677058890; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=5jIot45IfF+QnNfTbwlborGGYcXAt94oszlJYzfWOTQ=; b=LW7KtvD/pY4kJ8j1tGhaKlJ65fMkLjY45L7riYdRCKsfZbhWy9c9Ealx AFcVsygYZqZ1+8JvaHEo3fwXjaZ+IK5JRKKtt21JpJfasrYq6vq8/n8/e 2Y4f+GFeF+6YYdh1cVsCib0n//nMYujRdR9ltaZSamslve81Zq1crX1Gg tOOL/ua4MVsb7JZr3OiHf2DOWLB0DIV6HGAo5P65dZKl0OlLX5tSj0XYE yNFDfEwIYYa4UJMg6I4sGRoOUktqF8MS/SvL0QNyilGDyF+WZHJ9FZyiI mqhKaIYImn9+X6DSm3mEmxn6TbfIiIeyz1ykrvRnO/K9Qub3JgstEiM9W A==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="249235112" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="249235112" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2022 01:41:29 -0800 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="547668479" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.15.160]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 22 Feb 2022 01:41:27 -0800 Date: Tue, 22 Feb 2022 09:41:24 +0000 From: Bruce Richardson To: Wenwu Ma Cc: anatoly.burakov@intel.com, dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com, xingguang.he@intel.com Subject: Re: [PATCH v3] examples/multi_process: reconfigure port when rss or csum isn't supported Message-ID: References: <20220217151755.442306-1-wenwux.ma@intel.com> <20220222105127.506505-1-wenwux.ma@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220222105127.506505-1-wenwux.ma@intel.com> 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 Tue, Feb 22, 2022 at 10:51:27AM +0000, Wenwu Ma wrote: > The default values of rx mq_mode and rx offloads for port > will cause symmetric_mp startup failure if the port do not > support rss or csum. This Patch make the app to reconfigure > the NIC without them. Only quit the app if the second > reconfiguration fails. > > Signed-off-by: Wenwu Ma > --- While I am surprised to see different error codes for different essentially the same issue - lack of HW support, that is a separate problem to the one this is addressing. Given this is just a sample app, I think this approach is fine for configuring things - keeping things simple for the user. Acked-by: Bruce Richardson > examples/multi_process/symmetric_mp/main.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c > index 050337765f..0e991acdf2 100644 > --- a/examples/multi_process/symmetric_mp/main.c > +++ b/examples/multi_process/symmetric_mp/main.c > @@ -232,6 +232,20 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, > } > > retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); > + if (retval == -EINVAL) { > + printf("Port %u configuration failed. Re-attempting with HW checksum disabled.\n", > + port); > + port_conf.rxmode.offloads &= ~(RTE_ETH_RX_OFFLOAD_CHECKSUM); > + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); > + } > + > + if (retval == -ENOTSUP) { > + printf("Port %u configuration failed. Re-attempting with HW rss disabled.\n", > + port); > + port_conf.rxmode.mq_mode &= ~(RTE_ETH_MQ_RX_RSS); > + retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); > + } > + > if (retval < 0) > return retval; > > -- > 2.25.1 >