LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net] be2net: Fix number of Rx queues used for flow hashing
@ 2019-06-14 15:48 Ivan Vecera
  2019-06-16 20:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Vecera @ 2019-06-14 15:48 UTC (permalink / raw)
  To: netdev
  Cc: Tianhao, Sathya Perla, Ajit Khaparde, Sriharsha Basavapatna,
	Somnath Kotur, David S. Miller, open list

Number of Rx queues used for flow hashing returned by the driver is
incorrect and this bug prevents user to use the last Rx queue in
indirection table.

Let's say we have a NIC with 6 combined queues:

[root@sm-03 ~]# ethtool -l enp4s0f0
Channel parameters for enp4s0f0:
Pre-set maximums:
RX:             5
TX:             5
Other:          0
Combined:       6
Current hardware settings:
RX:             0
TX:             0
Other:          0
Combined:       6

Default indirection table maps all (6) queues equally but the driver
reports only 5 rings available.

[root@sm-03 ~]# ethtool -x enp4s0f0
RX flow hash indirection table for enp4s0f0 with 5 RX ring(s):
    0:      0     1     2     3     4     5     0     1
    8:      2     3     4     5     0     1     2     3
   16:      4     5     0     1     2     3     4     5
   24:      0     1     2     3     4     5     0     1
...

Now change indirection table somehow:

[root@sm-03 ~]# ethtool -X enp4s0f0 weight 1 1
[root@sm-03 ~]# ethtool -x enp4s0f0
RX flow hash indirection table for enp4s0f0 with 6 RX ring(s):
    0:      0     0     0     0     0     0     0     0
...
   64:      1     1     1     1     1     1     1     1
...

Now it is not possible to change mapping back to equal (default) state:

[root@sm-03 ~]# ethtool -X enp4s0f0 equal 6
Cannot set RX flow hash configuration: Invalid argument

Fixes: 594ad54a2c3b ("be2net: Add support for setting and getting rx flow hash options")
Reported-by: Tianhao <tizhao@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 4c218341c51b..6e635debc7fd 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -1105,7 +1105,7 @@ static int be_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
 		cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
 		break;
 	case ETHTOOL_GRXRINGS:
-		cmd->data = adapter->num_rx_qs - 1;
+		cmd->data = adapter->num_rx_qs;
 		break;
 	default:
 		return -EINVAL;
-- 
2.21.0


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

* Re: [PATCH net] be2net: Fix number of Rx queues used for flow hashing
  2019-06-14 15:48 [PATCH net] be2net: Fix number of Rx queues used for flow hashing Ivan Vecera
@ 2019-06-16 20:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-16 20:48 UTC (permalink / raw)
  To: ivecera
  Cc: netdev, tizhao, sathya.perla, ajit.khaparde,
	sriharsha.basavapatna, somnath.kotur, linux-kernel

From: Ivan Vecera <ivecera@redhat.com>
Date: Fri, 14 Jun 2019 17:48:36 +0200

> Number of Rx queues used for flow hashing returned by the driver is
> incorrect and this bug prevents user to use the last Rx queue in
> indirection table.
 ...
> Fixes: 594ad54a2c3b ("be2net: Add support for setting and getting rx flow hash options")
> Reported-by: Tianhao <tizhao@redhat.com>
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2019-06-16 20:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 15:48 [PATCH net] be2net: Fix number of Rx queues used for flow hashing Ivan Vecera
2019-06-16 20:48 ` David Miller

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).