All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close
@ 2017-04-18 13:03 Andrew Rybchenko
  2017-04-18 13:03 ` [PATCH 2/3] net/sfc: use zero RSS channels as disabled RSS indicator Andrew Rybchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2017-04-18 13:03 UTC (permalink / raw)
  To: dev

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

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc_rx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index ddf9217..9f512d9 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -1320,6 +1320,8 @@ sfc_rx_close(struct sfc_adapter *sa)
 {
 	sfc_rx_fini_queues(sa, 0);
 
+	sa->rss_channels = 0;
+
 	rte_free(sa->rxq_info);
 	sa->rxq_info = NULL;
 }
-- 
2.7.4

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

* [PATCH 2/3] net/sfc: use zero RSS channels as disabled RSS indicator
  2017-04-18 13:03 [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Andrew Rybchenko
@ 2017-04-18 13:03 ` Andrew Rybchenko
  2017-04-18 13:03 ` [PATCH 3/3] net/sfc: correct RSS hash availability condition Andrew Rybchenko
  2017-04-18 16:32 ` [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2017-04-18 13:03 UTC (permalink / raw)
  To: dev

Enabled RSS enables RSS hash computation and provision in pseudo header.
It still makes sense for applications even if only one Rx queue is used.

Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
Fixes: 088e17210a7a ("net/sfc: query RSS key and hash types config")
Fixes: 82faef507608 ("net/sfc: set RSS key and hash types config")
Fixes: af0d9317970c ("net/sfc: query RSS redirection table")
Fixes: 32bcfb0a50b1 ("net/sfc: update RSS redirection table")
Fixes: f5258439ee5d ("net/sfc: avoid failure on port start if Rx mode is rejected")

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc_ethdev.c | 28 ++++++++++++++++++++--------
 drivers/net/sfc/sfc_rx.c     |  8 ++++----
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index 4f7b640..d117c29 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1083,10 +1083,12 @@ sfc_dev_rss_hash_conf_get(struct rte_eth_dev *dev,
 {
 	struct sfc_adapter *sa = dev->data->dev_private;
 
-	if ((sa->rss_channels == 1) ||
-	    (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE))
+	if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)
 		return -ENOTSUP;
 
+	if (sa->rss_channels == 0)
+		return -EINVAL;
+
 	sfc_adapter_lock(sa);
 
 	/*
@@ -1113,12 +1115,16 @@ sfc_dev_rss_hash_update(struct rte_eth_dev *dev,
 	unsigned int efx_hash_types;
 	int rc = 0;
 
-	if ((sa->rss_channels == 1) ||
-	    (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)) {
+	if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
 		sfc_err(sa, "RSS is not available");
 		return -ENOTSUP;
 	}
 
+	if (sa->rss_channels == 0) {
+		sfc_err(sa, "RSS is not configured");
+		return -EINVAL;
+	}
+
 	if ((rss_conf->rss_key != NULL) &&
 	    (rss_conf->rss_key_len != sizeof(sa->rss_key))) {
 		sfc_err(sa, "RSS key size is wrong (should be %lu)",
@@ -1175,10 +1181,12 @@ sfc_dev_rss_reta_query(struct rte_eth_dev *dev,
 	struct sfc_adapter *sa = dev->data->dev_private;
 	int entry;
 
-	if ((sa->rss_channels == 1) ||
-	    (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE))
+	if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)
 		return -ENOTSUP;
 
+	if (sa->rss_channels == 0)
+		return -EINVAL;
+
 	if (reta_size != EFX_RSS_TBL_SIZE)
 		return -EINVAL;
 
@@ -1208,12 +1216,16 @@ sfc_dev_rss_reta_update(struct rte_eth_dev *dev,
 	int rc;
 
 
-	if ((sa->rss_channels == 1) ||
-	    (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE)) {
+	if (sa->rss_support != EFX_RX_SCALE_EXCLUSIVE) {
 		sfc_err(sa, "RSS is not available");
 		return -ENOTSUP;
 	}
 
+	if (sa->rss_channels == 0) {
+		sfc_err(sa, "RSS is not configured");
+		return -EINVAL;
+	}
+
 	if (reta_size != EFX_RSS_TBL_SIZE) {
 		sfc_err(sa, "RETA size is wrong (should be %u)",
 			EFX_RSS_TBL_SIZE);
diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 9f512d9..664b38d 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -577,7 +577,7 @@ sfc_rx_qflush(struct sfc_adapter *sa, unsigned int sw_index)
 static int
 sfc_rx_default_rxq_set_filter(struct sfc_adapter *sa, struct sfc_rxq *rxq)
 {
-	boolean_t rss = (sa->rss_channels > 1) ? B_TRUE : B_FALSE;
+	boolean_t rss = (sa->rss_channels > 0) ? B_TRUE : B_FALSE;
 	struct sfc_port *port = &sa->port;
 	int rc;
 
@@ -1052,7 +1052,7 @@ sfc_rx_rss_config(struct sfc_adapter *sa)
 	int rc = 0;
 
 #if EFSYS_OPT_RX_SCALE
-	if (sa->rss_channels > 1) {
+	if (sa->rss_channels > 0) {
 		rc = efx_rx_scale_mode_set(sa->nic, EFX_RX_HASHALG_TOEPLITZ,
 					   sa->rss_hash_types, B_TRUE);
 		if (rc != 0)
@@ -1289,9 +1289,9 @@ sfc_rx_configure(struct sfc_adapter *sa)
 
 #if EFSYS_OPT_RX_SCALE
 	sa->rss_channels = (dev_conf->rxmode.mq_mode == ETH_MQ_RX_RSS) ?
-			   MIN(sa->rxq_count, EFX_MAXRSS) : 1;
+			   MIN(sa->rxq_count, EFX_MAXRSS) : 0;
 
-	if (sa->rss_channels > 1) {
+	if (sa->rss_channels > 0) {
 		for (sw_index = 0; sw_index < EFX_RSS_TBL_SIZE; ++sw_index)
 			sa->rss_tbl[sw_index] = sw_index % sa->rss_channels;
 	}
-- 
2.7.4

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

* [PATCH 3/3] net/sfc: correct RSS hash availability condition
  2017-04-18 13:03 [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Andrew Rybchenko
  2017-04-18 13:03 ` [PATCH 2/3] net/sfc: use zero RSS channels as disabled RSS indicator Andrew Rybchenko
@ 2017-04-18 13:03 ` Andrew Rybchenko
  2017-04-18 16:32 ` [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2017-04-18 13:03 UTC (permalink / raw)
  To: dev

RSS hash is computed by hardware if corresponding Rx filter (for
example, default Rx filters) has RSS flag set which is set if
the number of RSS channels is greater than zero.

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

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc_rx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c
index 664b38d..2ecd6f2 100644
--- a/drivers/net/sfc/sfc_rx.c
+++ b/drivers/net/sfc/sfc_rx.c
@@ -930,7 +930,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index,
 	info.prefix_size = encp->enc_rx_prefix_size;
 
 #if EFSYS_OPT_RX_SCALE
-	if (sa->hash_support == EFX_RX_HASH_AVAILABLE)
+	if (sa->hash_support == EFX_RX_HASH_AVAILABLE && sa->rss_channels > 0)
 		info.flags |= SFC_RXQ_FLAG_RSS_HASH;
 #endif
 
-- 
2.7.4

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

* Re: [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close
  2017-04-18 13:03 [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Andrew Rybchenko
  2017-04-18 13:03 ` [PATCH 2/3] net/sfc: use zero RSS channels as disabled RSS indicator Andrew Rybchenko
  2017-04-18 13:03 ` [PATCH 3/3] net/sfc: correct RSS hash availability condition Andrew Rybchenko
@ 2017-04-18 16:32 ` Ferruh Yigit
  2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-04-18 16:32 UTC (permalink / raw)
  To: Andrew Rybchenko, dev

On 4/18/2017 2:03 PM, Andrew Rybchenko wrote:
> Fixes: 4ec1fc3ba881 ("net/sfc: add basic stubs for RSS support on driver attach")
> 
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
> Reviewed-by: Andy Moreton <amoreton@solarflare.com>

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2017-04-18 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 13:03 [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Andrew Rybchenko
2017-04-18 13:03 ` [PATCH 2/3] net/sfc: use zero RSS channels as disabled RSS indicator Andrew Rybchenko
2017-04-18 13:03 ` [PATCH 3/3] net/sfc: correct RSS hash availability condition Andrew Rybchenko
2017-04-18 16:32 ` [PATCH 1/3] net/sfc: reset RSS channels back to 0 on close Ferruh Yigit

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.