OSDN Git Service

net: ena: fix incorrectly saving queue numbers when setting RSS indirection table
authorArthur Kiyanovski <akiyano@amazon.com>
Tue, 11 Feb 2020 15:17:47 +0000 (15:17 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Feb 2020 01:08:31 +0000 (17:08 -0800)
commit92569fd27f5cb0ccbdf7c7d70044b690e89a0277
treef8647184b836197b9e84f407603148b93c7ef028
parent4844470d472d660c26149ad764da2406adb13423
net: ena: fix incorrectly saving queue numbers when setting RSS indirection table

The indirection table has the indices of the Rx queues. When we store it
during set indirection operation, we convert the indices to our internal
representation of the indices.

Our internal representation of the indices is: even indices for Tx and
uneven indices for Rx, where every Tx/Rx pair are in a consecutive order
starting from 0. For example if the driver has 3 queues (3 for Tx and 3
for Rx) then the indices are as follows:
0  1  2  3  4  5
Tx Rx Tx Rx Tx Rx

The BUG:
The issue is that when we satisfy a get request for the indirection
table, we don't convert the indices back to the original representation.

The FIX:
Simply apply the inverse function for the indices of the indirection
table after we set it.

Fixes: 1738cd3ed342 ("net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)")
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amazon/ena/ena_ethtool.c
drivers/net/ethernet/amazon/ena/ena_netdev.h