diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-16 17:32:39 +0100 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-05-16 17:35:19 +0100 |
commit | 602a5322a7a1b6b005cb50d423939bb7a8782838 (patch) | |
tree | 5372533d075ea2a13ab29b249024b50a8dccdc78 | |
parent | 47a8467cc0907e2fd3e6f4d02465dfb64494133e (diff) |
sfc: Fix TX queue numbering when separate_tx_channels=1
This option appears to have been broken by commit
8313aca38b3937947fffebca6e34bac8e24300c8 ('sfc: Allocate each channel
separately, along with its RX and TX queues').
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/sfc/efx.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 38a55e9e89e..796c47e03f6 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c @@ -1319,8 +1319,20 @@ static void efx_remove_interrupts(struct efx_nic *efx) static void efx_set_channels(struct efx_nic *efx) { + struct efx_channel *channel; + struct efx_tx_queue *tx_queue; + efx->tx_channel_offset = separate_tx_channels ? efx->n_channels - efx->n_tx_channels : 0; + + /* We need to adjust the TX queue numbers if we have separate + * RX-only and TX-only channels. + */ + efx_for_each_channel(channel, efx) { + efx_for_each_channel_tx_queue(tx_queue, channel) + tx_queue->queue -= (efx->tx_channel_offset * + EFX_TXQ_TYPES); + } } static int efx_probe_nic(struct efx_nic *efx) |