aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amazon/ena/ena_netdev.h
diff options
context:
space:
mode:
authorArthur Kiyanovski <akiyano@amazon.com>2020-02-11 15:17:47 +0000
committerDavid S. Miller <davem@davemloft.net>2020-02-11 17:08:31 -0800
commit92569fd27f5cb0ccbdf7c7d70044b690e89a0277 (patch)
treef8647184b836197b9e84f407603148b93c7ef028 /drivers/net/ethernet/amazon/ena/ena_netdev.h
parentnet: ena: rss: store hash function as values and not bits (diff)
downloadlinux-dev-92569fd27f5cb0ccbdf7c7d70044b690e89a0277.tar.xz
linux-dev-92569fd27f5cb0ccbdf7c7d70044b690e89a0277.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_netdev.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 094324fd0edc..8795e0b1dc3c 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -130,6 +130,8 @@
#define ENA_IO_TXQ_IDX(q) (2 * (q))
#define ENA_IO_RXQ_IDX(q) (2 * (q) + 1)
+#define ENA_IO_TXQ_IDX_TO_COMBINED_IDX(q) ((q) / 2)
+#define ENA_IO_RXQ_IDX_TO_COMBINED_IDX(q) (((q) - 1) / 2)
#define ENA_MGMNT_IRQ_IDX 0
#define ENA_IO_IRQ_FIRST_IDX 1