From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <luca.boccassi@gmail.com>
Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com
 [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 2446CDD2
 for <stable@dpdk.org>; Mon, 30 Apr 2018 16:55:05 +0200 (CEST)
Received: by mail-wr0-f194.google.com with SMTP id 94-v6so7004686wrf.5
 for <stable@dpdk.org>; Mon, 30 Apr 2018 07:55:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=Tx9/Ad7WLKR8DFleLqYid8Vzl1aErHgIE3MzjwpWbXs=;
 b=Zn/aCdXffz7qHB25lGQ2a9CCUVQD7H6kGUL7LIVUE4rM+URGdJPPOVdNR51eem8bVy
 /HFcxoJ909/BFdKFju94tqEbUCix9Jwne99Tl3EUPPyj8cr5x3WGed//o8nBJ79De669
 Ph29UKsp/R9yKurxWZQZprqi1I0tYp5uMNEjDUezlr+baLDB/fCwJ15puuSrPJ/KwTAi
 oKeoH5ob08nY32qZDUYKYjs9yHf3JXAI8gqBlqXlbC7kQC/Xial6J3hgSp0cg1vbNBFF
 w5wApfx9cPFxm7jA8ptyrR7zU6956KBHgHD/JC0//9oZZxfRLcVwk/AWdth5fKC6iLiM
 CpWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=Tx9/Ad7WLKR8DFleLqYid8Vzl1aErHgIE3MzjwpWbXs=;
 b=QbSGlwrRNvx8bsTlLqNe+3u0ycTT4TI7CpiF3axZ+jOxEKalvuYX8E8AR2YWPTn+zL
 rwueEf8+Cz9PHo8hualQCbbTRko65yOOojirJmAVR8dYb2mDzUtnTxtyfWvvzKcjoPEP
 qg0mLVzLB5Lsyc9vSa6NsfPickjtq01rtcAuZejElC0YVhcAtM0GvR2nAzJ/BMfaeXc3
 WlJSEyjKKWKTxtniaeUU3G2ASF9D+pRJFv99fqMo6455Q6aEaFauNcG1lfLWo2OfNt1t
 Q+j5IQNdYpFdMWYitTYknQt5vfKvXJqkHyZnTnxWnx28E3v3zubBafh9ym+YuIc4w0zn
 Xsjg==
X-Gm-Message-State: ALQs6tAx9u3yuwmvThicoq08puMzTbSzMpznIAqtLEK0/SUiCZAK5qhZ
 Z3jGvvoMjHp4UzVw9QdFr30=
X-Google-Smtp-Source: AB8JxZqb0gs/HM//CbL+KGlJ2Mx86LoR3dLYDSaL61ZA+pUjiOrhEVt/ShkIrsWFu0pS9BLGXo1qRA==
X-Received: by 2002:adf:9893:: with SMTP id
 w19-v6mr9679735wrb.34.1525100104836; 
 Mon, 30 Apr 2018 07:55:04 -0700 (PDT)
Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb])
 by smtp.gmail.com with ESMTPSA id 64sm7497260wmb.2.2018.04.30.07.55.03
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Mon, 30 Apr 2018 07:55:04 -0700 (PDT)
From: luca.boccassi@gmail.com
To: Ivan Malov <ivan.malov@oktetlabs.ru>
Cc: Andrew Rybchenko <arybchenko@solarflare.com>, dpdk stable <stable@dpdk.org>
Date: Mon, 30 Apr 2018 15:53:58 +0100
Message-Id: <20180430145402.23057-39-luca.boccassi@gmail.com>
X-Mailer: git-send-email 2.14.2
In-Reply-To: <20180430145402.23057-1-luca.boccassi@gmail.com>
References: <20180430144223.18657-85-luca.boccassi@gmail.com>
 <20180430145402.23057-1-luca.boccassi@gmail.com>
Subject: [dpdk-stable] patch 'net/sfc: process RSS settings on Rx configure
	step' has been queued to stable release 18.02.2
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Apr 2018 14:55:05 -0000

Hi,

FYI, your patch has been queued to stable release 18.02.2

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/02/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>>From e206d4e4a375f9f5d8a268566695cc988186e603 Mon Sep 17 00:00:00 2001
From: Ivan Malov <ivan.malov@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@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@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 64bc9d488..81c530079 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1187,6 +1187,41 @@ sfc_efx_to_rte_hash_type(efx_rx_hash_type_t efx_hash_types)
 #endif
 
 #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)
 {
@@ -1415,16 +1450,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.14.2