[dpdk-stable] patch 'net/sfc: process RSS settings on Rx configure step' has been queued to LTS release 17.11.3

Yuanhan Liu yliu at fridaylinux.org
Sun May 6 08:36:38 CEST 2018


Hi,

FYI, your patch has been queued to LTS release 17.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/09/18. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From ec3882def363854ef1c2393e76cbe13a972d28ca Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov at oktetlabs.ru>
Date: Wed, 25 Apr 2018 18:51:41 +0100
Subject: [PATCH] net/sfc: process RSS settings on Rx configure step

[ upstream commit 7803554a9e388538fc3ad32dedffbbe2dde055c8 ]

One may submit advanced RSS settings as part of
rte_eth_conf to customise RSS configuration from
the very beginning. Currently the driver does not
check that piece of settings and proceeds with
default choices for RSS hash functions and RSS key.

This patch implements the required processing.

Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")

Signed-off-by: Ivan Malov <ivan.malov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/sfc_rx.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index be778d387..8fc93d682 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1096,6 +1096,41 @@ sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types)
 
 #if EFSYS_OPT_RX_SCALE
 static int
+sfc_rx_process_adv_conf_rss(struct sfc_adapter *sa,
+			    struct rte_eth_rss_conf *conf)
+{
+	efx_rx_hash_type_t efx_hash_types = sa->rss_hash_types;
+
+	if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
+		if ((conf->rss_hf != 0 && conf->rss_hf != SFC_RSS_OFFLOADS) ||
+		    conf->rss_key != NULL)
+			return EINVAL;
+	}
+
+	if (conf->rss_hf != 0) {
+		if ((conf->rss_hf & ~SFC_RSS_OFFLOADS) != 0) {
+			sfc_err(sa, "unsupported hash functions requested");
+			return EINVAL;
+		}
+
+		efx_hash_types = sfc_rte_to_efx_hash_type(conf->rss_hf);
+	}
+
+	if (conf->rss_key != NULL) {
+		if (conf->rss_key_len != sizeof(sa->rss_key)) {
+			sfc_err(sa, "RSS key size is wrong (should be %lu)",
+				sizeof(sa->rss_key));
+			return EINVAL;
+		}
+		rte_memcpy(sa->rss_key, conf->rss_key, sizeof(sa->rss_key));
+	}
+
+	sa->rss_hash_types = efx_hash_types;
+
+	return 0;
+}
+
+static int
 sfc_rx_rss_config(struct sfc_adapter *sa)
 {
 	int rc = 0;
@@ -1347,16 +1382,23 @@ sfc_rx_configure(struct sfc_adapter *sa)
 			   MIN(sa->rxq_count, EFX_MAXRSS) : 0;
 
 	if (sa->rss_channels > 0) {
+		struct rte_eth_rss_conf *adv_conf_rss;
 		unsigned int sw_index;
 
 		for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index)
 			sa->rss_tbl[sw_index] = sw_index % sa->rss_channels;
+
+		adv_conf_rss = &dev_conf->rx_adv_conf.rss_conf;
+		rc = sfc_rx_process_adv_conf_rss(sa, adv_conf_rss);
+		if (rc != 0)
+			goto fail_rx_process_adv_conf_rss;
 	}
 #endif
 
 done:
 	return 0;
 
+fail_rx_process_adv_conf_rss:
 fail_rx_qinit_info:
 fail_rxqs_realloc:
 fail_rxqs_alloc:
-- 
2.11.0



More information about the stable mailing list