All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenwu Ma <wenwux.ma@intel.com>
To: anatoly.burakov@intel.com
Cc: dev@dpdk.org, jiayu.hu@intel.com, yinan.wang@intel.com,
	xingguang.he@intel.com, Wenwu Ma <wenwux.ma@intel.com>
Subject: [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported
Date: Mon, 21 Feb 2022 15:35:18 +0000	[thread overview]
Message-ID: <20220221153518.503722-1-wenwux.ma@intel.com> (raw)
In-Reply-To: <20220217151755.442306-1-wenwux.ma@intel.com>

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 <wenwux.ma@intel.com>
---
 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


  parent reply	other threads:[~2022-02-21  7:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 15:17 [PATCH] examples/multi_process: add options to control port configuration Wenwu Ma
2022-02-17  9:06 ` Bruce Richardson
2022-02-18  6:49   ` Ma, WenwuX
2022-02-18  9:41     ` Bruce Richardson
2022-02-18 10:10       ` Ma, WenwuX
2022-02-18 10:22         ` Bruce Richardson
2022-02-21 15:35 ` Wenwu Ma [this message]
2022-02-21  9:21   ` [PATCH v2] examples/multi_process: reconfigure port when rss or csum isn't supported Bruce Richardson
2022-02-22 10:51 ` [PATCH v3] " Wenwu Ma
2022-02-22  9:41   ` Bruce Richardson
2022-02-28  7:55     ` Ling, WeiX
2022-03-08 13:22       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220221153518.503722-1-wenwux.ma@intel.com \
    --to=wenwux.ma@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiayu.hu@intel.com \
    --cc=xingguang.he@intel.com \
    --cc=yinan.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.