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 604FFA034E; Mon, 21 Feb 2022 08:36:46 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF38640DF6; Mon, 21 Feb 2022 08:36:45 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 727C64068C for ; Mon, 21 Feb 2022 08:36:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645429003; x=1676965003; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pDtyiM8+M8aLnIwLGR/xvTqxvFrye7D5ZT2Bi1bgvVk=; b=L2BvUJJkER9SVIyExOP1rFeNKhc6eDjKqKnY36FynFNq7xYWAuRAjDS/ Npr7c2QSN4d+9QuT2VCr2VmpMGzcwaLYEOTACq0AM0e4AUQfpt6cW1Rd2 LpmmxlraaOuqL2qtTqiTpKhJdWfzdmV2kipqPbLnUuYb8SSuSXQFiq/hw EDZflfT7BNPs8ktWRmNLdWnl+1xrZkWGj9v2zMfYPaCxdAwg961fKuUf+ xOwAmNAqCJjxCZuLpIP8JxbYowPtvJmtHl5p8/POnn0k/WlxnTjJPbDDO yhEBZd5Xw+43cTJL9EothqUl4hnR6GJd/PahrLb3WJgVIu9dPsJ9p+3BA A==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="312197805" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="312197805" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 23:36:29 -0800 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="638464221" Received: from unknown (HELO localhost.localdomain) ([10.239.251.209]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 23:36:17 -0800 From: Wenwu Ma To: anatoly.burakov@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com, xingguang.he@intel.com, Wenwu Ma Subject: [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported Date: Mon, 21 Feb 2022 15:35:18 +0000 Message-Id: <20220221153518.503722-1-wenwux.ma@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217151755.442306-1-wenwux.ma@intel.com> References: <20220217151755.442306-1-wenwux.ma@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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); + 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); + 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