DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: check for Rx RSS distribution and RSS hash
@ 2020-04-27 12:34 Lijun Ou
  2020-04-27 12:49 ` Andrew Rybchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Lijun Ou @ 2020-04-27 12:34 UTC (permalink / raw)
  To: thomas, ferruh.yigit, arybchenko; +Cc: dev, linuxarm

When rte api checks the Rx RSS distribution is enable but the RSS
hash is disabled, it will return an error.

Signed-off-by: Lijun Ou <oulijun@huawei.com>
---
 lib/librte_ethdev/rte_ethdev.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 0854ef8..07734c4 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1411,6 +1411,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx RSS distribution is enable but RSS hash is disabled. */
+	if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) != 0) &&
+	    !(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config valid Rx mq_mode with RSS but %s offload is no-requested\n",
+			port_id,
+			rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-01 16:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-27 12:34 [dpdk-dev] [PATCH] ethdev: check for Rx RSS distribution and RSS hash Lijun Ou
2020-04-27 12:49 ` Andrew Rybchenko
2020-04-27 13:27   ` Ferruh Yigit
2020-04-29  6:41     ` oulijun
2020-04-29 12:42       ` Ferruh Yigit
2020-05-01 16:04         ` Ferruh Yigit
2020-04-29  6:31   ` oulijun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).