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 22AB0A034E; Tue, 22 Feb 2022 03:52:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94C0940DF6; Tue, 22 Feb 2022 03:52:34 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D0F4F4068C for ; Tue, 22 Feb 2022 03:52:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645498353; x=1677034353; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lE30UDVZRMjvtY9SO4DksjjPu2xk9+r/DHOAmyZe5CM=; b=QjkU79r8Om0v1GRKxInkS0+930sadcltfL5T9OnvHia75bNfmR30IJaU ShojRIgXJS2aao3zmjii1Ttxny6KeeCJjjAEq1AQXI61GpdI9FRW4ZHky 53W9JPpu8IHf7ERTBsyKmbGHkvenV123Pd/KzvAxArhLcm9f/GDOpcGtZ VaNJ2O4nEnVhudVLDi2PO1rm3fMElku+zWscwpIiO98zjDspXjcjZhzx1 tmenf+Ui808KVh9uDd8Zuj+tZMnUPVHQ+4ZN2nujFW8ztd+plgbofwGzX 1NT9vW0HPBNY/mKV/5pQouzQ4QHx5sf2bpLR4kXTxiGOBSjSSUrk8kGp2 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="338032145" X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="338032145" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 18:52:31 -0800 X-IronPort-AV: E=Sophos;i="5.88,387,1635231600"; d="scan'208";a="507816870" Received: from unknown (HELO localhost.localdomain) ([10.239.251.209]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 18:52:27 -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 v3] examples/multi_process: reconfigure port when rss or csum isn't supported Date: Tue, 22 Feb 2022 10:51:27 +0000 Message-Id: <20220222105127.506505-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..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