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 9AE7DA034E; Mon, 21 Feb 2022 10:21:23 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B2624068C; Mon, 21 Feb 2022 10:21:23 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id BCE884013F for ; Mon, 21 Feb 2022 10:21:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645435281; x=1676971281; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=0d3d+25fedM1maRiG+AYVAQd0pQQDHagSKbAfqxeaqU=; b=VOTKpFrzX6idcdd/EvxmB8NTnNodLJ4Ok8e2Y6QJoox4JIYOrh0+AYzQ RpxqE6TFy+pBi5G5ARNA3JnY8NHTg81E3qpNjzH9gfpht/nCqMLA2kT/3 zmFkixSXa24FXB1yCkZYn19x+/rTx+Qumm+vFvCDyjo9Jyl6Y9I13JbvM 4qtdj45ob22Tm5C7cTnLxApQ8orhJO3HcDz/lzrIOTH2EO8/GnZzWQmTb Qn/lhqPdutO1Bz9mH6DKRmGgXJ/wa7PwFKPHLXeIiS67OQga8cZ2nLxXi GoIpA3pdYV24IJ49whTWzVcv6SR0BiAlFTchMy99FU1Sfe/cnBnzj5m7T Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="251420333" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="251420333" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 01:21:20 -0800 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="490381688" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.13.243]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-SHA; 21 Feb 2022 01:21:18 -0800 Date: Mon, 21 Feb 2022 09:21:14 +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 v2] examples/multi_process: reconfigure port when rss or csum isn't supported Message-ID: References: <20220217151755.442306-1-wenwux.ma@intel.com> <20220221153518.503722-1-wenwux.ma@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220221153518.503722-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 Mon, Feb 21, 2022 at 03:35:18PM +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 > --- > 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..c0e7ed70e0 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("Maybe port %u don't have csum offloads capabilities, " > + "so clear csum config and try again.\n", port); Two comments for here and below: 1. Don't split error messages across multiple lines, as it means the user/developer cannot find them using "grep" on the code. 2. Text should try and be shorter and clearer. I'd suggest: "Port configuration failed. Re-attempting with HW checksum disabled" > + 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("Maybe port %u don't support rss, " > + "so clear rss config and try again.\n", port); Same two comments from above apply here. > + 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 >