diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-01-12 13:39:40 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-02-15 14:45:34 -0500 |
commit | 60031fcc17057e21566ed34ba23e93fffda1aa27 (patch) | |
tree | 820a3b0c418cd3d8664d61e4b36f634f07c59614 /drivers/net/sfc | |
parent | 5c56580b74e57e56f30e3c5bbc9d7ab487858497 (diff) |
sfc: Move TX queue core queue mapping into tx.c
efx_hard_start_xmit() needs to implement a mapping which is the
inverse of tx_queue::core_txq. Move the initialisation of
tx_queue::core_txq next to efx_hard_start_xmit() to make the
connection more obvious.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/efx.c | 6 | ||||
-rw-r--r-- | drivers/net/sfc/efx.h | 1 | ||||
-rw-r--r-- | drivers/net/sfc/tx.c | 7 |
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 002bac743843..c559bc372fc1 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -1910,10 +1910,8 @@ static int efx_register_netdev(struct efx_nic *efx) | |||
1910 | 1910 | ||
1911 | efx_for_each_channel(channel, efx) { | 1911 | efx_for_each_channel(channel, efx) { |
1912 | struct efx_tx_queue *tx_queue; | 1912 | struct efx_tx_queue *tx_queue; |
1913 | efx_for_each_channel_tx_queue(tx_queue, channel) { | 1913 | efx_for_each_channel_tx_queue(tx_queue, channel) |
1914 | tx_queue->core_txq = netdev_get_tx_queue( | 1914 | efx_init_tx_queue_core_txq(tx_queue); |
1915 | efx->net_dev, tx_queue->queue / EFX_TXQ_TYPES); | ||
1916 | } | ||
1917 | } | 1915 | } |
1918 | 1916 | ||
1919 | /* Always start with carrier off; PHY events will detect the link */ | 1917 | /* Always start with carrier off; PHY events will detect the link */ |
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h index d43a7e5212b1..116207045068 100644 --- a/drivers/net/sfc/efx.h +++ b/drivers/net/sfc/efx.h | |||
@@ -29,6 +29,7 @@ | |||
29 | extern int efx_probe_tx_queue(struct efx_tx_queue *tx_queue); | 29 | extern int efx_probe_tx_queue(struct efx_tx_queue *tx_queue); |
30 | extern void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); | 30 | extern void efx_remove_tx_queue(struct efx_tx_queue *tx_queue); |
31 | extern void efx_init_tx_queue(struct efx_tx_queue *tx_queue); | 31 | extern void efx_init_tx_queue(struct efx_tx_queue *tx_queue); |
32 | extern void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue); | ||
32 | extern void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); | 33 | extern void efx_fini_tx_queue(struct efx_tx_queue *tx_queue); |
33 | extern void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); | 34 | extern void efx_release_tx_buffers(struct efx_tx_queue *tx_queue); |
34 | extern netdev_tx_t | 35 | extern netdev_tx_t |
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c index 2f5e9da657bf..7e463fb19fb9 100644 --- a/drivers/net/sfc/tx.c +++ b/drivers/net/sfc/tx.c | |||
@@ -347,6 +347,13 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb, | |||
347 | return efx_enqueue_skb(tx_queue, skb); | 347 | return efx_enqueue_skb(tx_queue, skb); |
348 | } | 348 | } |
349 | 349 | ||
350 | void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue) | ||
351 | { | ||
352 | /* Must be inverse of queue lookup in efx_hard_start_xmit() */ | ||
353 | tx_queue->core_txq = netdev_get_tx_queue( | ||
354 | tx_queue->efx->net_dev, tx_queue->queue / EFX_TXQ_TYPES); | ||
355 | } | ||
356 | |||
350 | void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) | 357 | void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index) |
351 | { | 358 | { |
352 | unsigned fill_level; | 359 | unsigned fill_level; |