]> Pileus Git - ~andy/linux/commitdiff
sfc: Fix loopback self-test with separate_tx_channels=1
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 13 Sep 2012 01:22:52 +0000 (02:22 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Tue, 2 Oct 2012 00:58:41 +0000 (01:58 +0100)
The loopback self-test iterates over all the TX queues of channel 0,
which is not very interesting when that's an RX-only channel.

Signed-off-by: Ben Hutchings <bhutchings@solarflre.com>
drivers/net/ethernet/sfc/ethtool.c
drivers/net/ethernet/sfc/selftest.c

index 9df556c01b8e26412d047603bda7c6c51b9cef65..cf772074145af6b30f9b0829cebe4325e72b9f01 100644 (file)
@@ -337,7 +337,8 @@ static int efx_fill_loopback_test(struct efx_nic *efx,
                                  unsigned int test_index,
                                  struct ethtool_string *strings, u64 *data)
 {
-       struct efx_channel *channel = efx_get_channel(efx, 0);
+       struct efx_channel *channel =
+               efx_get_channel(efx, efx->tx_channel_offset);
        struct efx_tx_queue *tx_queue;
 
        efx_for_each_channel_tx_queue(tx_queue, channel) {
index 96068d15b601f5afc285618ea6fecd86b7713caf..ce72ae4f399fdf3861262967aeb8222d5856bd85 100644 (file)
@@ -614,7 +614,8 @@ static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests,
 {
        enum efx_loopback_mode mode;
        struct efx_loopback_state *state;
-       struct efx_channel *channel = efx_get_channel(efx, 0);
+       struct efx_channel *channel =
+               efx_get_channel(efx, efx->tx_channel_offset);
        struct efx_tx_queue *tx_queue;
        int rc = 0;