]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sfc: Move TX queue core queue mapping into tx.c
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 12 Jan 2011 18:39:40 +0000 (18:39 +0000)
committerBen Hutchings <bhutchings@solarflare.com>
Tue, 15 Feb 2011 19:45:34 +0000 (19:45 +0000)
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>
drivers/net/sfc/efx.c
drivers/net/sfc/efx.h
drivers/net/sfc/tx.c

index 002bac7438434f8eb240a891815e1223b55b7c5c..c559bc372fc155c946ce0acf0c886b3d7857a2f3 100644 (file)
@@ -1910,10 +1910,8 @@ static int efx_register_netdev(struct efx_nic *efx)
 
        efx_for_each_channel(channel, efx) {
                struct efx_tx_queue *tx_queue;
-               efx_for_each_channel_tx_queue(tx_queue, channel) {
-                       tx_queue->core_txq = netdev_get_tx_queue(
-                               efx->net_dev, tx_queue->queue / EFX_TXQ_TYPES);
-               }
+               efx_for_each_channel_tx_queue(tx_queue, channel)
+                       efx_init_tx_queue_core_txq(tx_queue);
        }
 
        /* Always start with carrier off; PHY events will detect the link */
index d43a7e5212b1d0b4d5d5068bf8e3d71c8bb7a1f0..1162070450682af867eebb9b4c70a536d625a4ee 100644 (file)
@@ -29,6 +29,7 @@
 extern int efx_probe_tx_queue(struct efx_tx_queue *tx_queue);
 extern void efx_remove_tx_queue(struct efx_tx_queue *tx_queue);
 extern void efx_init_tx_queue(struct efx_tx_queue *tx_queue);
+extern void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue);
 extern void efx_fini_tx_queue(struct efx_tx_queue *tx_queue);
 extern void efx_release_tx_buffers(struct efx_tx_queue *tx_queue);
 extern netdev_tx_t
index 2f5e9da657bf7cc66d1ad945d0c69340f19dada0..7e463fb19fb94997631f83b495d5698572e0d1c3 100644 (file)
@@ -347,6 +347,13 @@ netdev_tx_t efx_hard_start_xmit(struct sk_buff *skb,
        return efx_enqueue_skb(tx_queue, skb);
 }
 
+void efx_init_tx_queue_core_txq(struct efx_tx_queue *tx_queue)
+{
+       /* Must be inverse of queue lookup in efx_hard_start_xmit() */
+       tx_queue->core_txq = netdev_get_tx_queue(
+               tx_queue->efx->net_dev, tx_queue->queue / EFX_TXQ_TYPES);
+}
+
 void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
 {
        unsigned fill_level;