Skip to content

Commit

Permalink
sfc: Move TX queue core queue mapping into tx.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings committed Feb 15, 2011
1 parent 5c56580 commit 60031fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions drivers/net/sfc/efx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/sfc/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 60031fc

Please sign in to comment.