]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/be2net-fix-number-of-rx-queues-used-for-flow-hashing.patch
4.19-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.19 / be2net-fix-number-of-rx-queues-used-for-flow-hashing.patch
1 From foo@baz Wed 19 Jun 2019 02:34:37 PM CEST
2 From: Ivan Vecera <ivecera@redhat.com>
3 Date: Fri, 14 Jun 2019 17:48:36 +0200
4 Subject: be2net: Fix number of Rx queues used for flow hashing
5
6 From: Ivan Vecera <ivecera@redhat.com>
7
8 [ Upstream commit 718f4a2537089ea41903bf357071306163bc7c04 ]
9
10 Number of Rx queues used for flow hashing returned by the driver is
11 incorrect and this bug prevents user to use the last Rx queue in
12 indirection table.
13
14 Let's say we have a NIC with 6 combined queues:
15
16 [root@sm-03 ~]# ethtool -l enp4s0f0
17 Channel parameters for enp4s0f0:
18 Pre-set maximums:
19 RX: 5
20 TX: 5
21 Other: 0
22 Combined: 6
23 Current hardware settings:
24 RX: 0
25 TX: 0
26 Other: 0
27 Combined: 6
28
29 Default indirection table maps all (6) queues equally but the driver
30 reports only 5 rings available.
31
32 [root@sm-03 ~]# ethtool -x enp4s0f0
33 RX flow hash indirection table for enp4s0f0 with 5 RX ring(s):
34 0: 0 1 2 3 4 5 0 1
35 8: 2 3 4 5 0 1 2 3
36 16: 4 5 0 1 2 3 4 5
37 24: 0 1 2 3 4 5 0 1
38 ...
39
40 Now change indirection table somehow:
41
42 [root@sm-03 ~]# ethtool -X enp4s0f0 weight 1 1
43 [root@sm-03 ~]# ethtool -x enp4s0f0
44 RX flow hash indirection table for enp4s0f0 with 6 RX ring(s):
45 0: 0 0 0 0 0 0 0 0
46 ...
47 64: 1 1 1 1 1 1 1 1
48 ...
49
50 Now it is not possible to change mapping back to equal (default) state:
51
52 [root@sm-03 ~]# ethtool -X enp4s0f0 equal 6
53 Cannot set RX flow hash configuration: Invalid argument
54
55 Fixes: 594ad54a2c3b ("be2net: Add support for setting and getting rx flow hash options")
56 Reported-by: Tianhao <tizhao@redhat.com>
57 Signed-off-by: Ivan Vecera <ivecera@redhat.com>
58 Signed-off-by: David S. Miller <davem@davemloft.net>
59 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
60 ---
61 drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 +-
62 1 file changed, 1 insertion(+), 1 deletion(-)
63
64 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
65 +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
66 @@ -1105,7 +1105,7 @@ static int be_get_rxnfc(struct net_devic
67 cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
68 break;
69 case ETHTOOL_GRXRINGS:
70 - cmd->data = adapter->num_rx_qs - 1;
71 + cmd->data = adapter->num_rx_qs;
72 break;
73 default:
74 return -EINVAL;