diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 07:44:59 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 09:53:42 -0400 |
commit | 60ac10658c2e234cf7bc27e0930e324c6c6fcf61 (patch) | |
tree | b16ee9efd385806755c6912492db43997c4f4b98 /drivers/net/sfc/net_driver.h | |
parent | 26c086771a8ad0a1a72699674fa712fe6aeacb02 (diff) |
sfc: Use separate hardware TX queues to select checksum generation
Checksum generation is an attribute of our hardware TX queues, not TX
descriptors. We previously used a single queue and turned checksum
generation on or off as requested through ethtool. However, this can
result in regenerating checksums in raw packets that should not be
modified. We now create 2 hardware TX queues with checksum generation
on or off. They are presented to the net core as one queue since it
does not know how to select between them.
The self-test verifies that a bad checksum is unaltered on the queue
with checksum generation off.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 628f25e32918..f539e2e0da1b 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -88,9 +88,12 @@ do {if (net_ratelimit()) EFX_LOG(efx, fmt, ##args); } while (0) | |||
88 | **************************************************************************/ | 88 | **************************************************************************/ |
89 | 89 | ||
90 | #define EFX_MAX_CHANNELS 32 | 90 | #define EFX_MAX_CHANNELS 32 |
91 | #define EFX_MAX_TX_QUEUES 1 | ||
92 | #define EFX_MAX_RX_QUEUES EFX_MAX_CHANNELS | 91 | #define EFX_MAX_RX_QUEUES EFX_MAX_CHANNELS |
93 | 92 | ||
93 | #define EFX_TX_QUEUE_OFFLOAD_CSUM 0 | ||
94 | #define EFX_TX_QUEUE_NO_CSUM 1 | ||
95 | #define EFX_TX_QUEUE_COUNT 2 | ||
96 | |||
94 | /** | 97 | /** |
95 | * struct efx_special_buffer - An Efx special buffer | 98 | * struct efx_special_buffer - An Efx special buffer |
96 | * @addr: CPU base address of the buffer | 99 | * @addr: CPU base address of the buffer |
@@ -156,7 +159,6 @@ struct efx_tx_buffer { | |||
156 | * | 159 | * |
157 | * @efx: The associated Efx NIC | 160 | * @efx: The associated Efx NIC |
158 | * @queue: DMA queue number | 161 | * @queue: DMA queue number |
159 | * @used: Queue is used by net driver | ||
160 | * @channel: The associated channel | 162 | * @channel: The associated channel |
161 | * @buffer: The software buffer ring | 163 | * @buffer: The software buffer ring |
162 | * @txd: The hardware descriptor ring | 164 | * @txd: The hardware descriptor ring |
@@ -188,7 +190,6 @@ struct efx_tx_queue { | |||
188 | /* Members which don't change on the fast path */ | 190 | /* Members which don't change on the fast path */ |
189 | struct efx_nic *efx ____cacheline_aligned_in_smp; | 191 | struct efx_nic *efx ____cacheline_aligned_in_smp; |
190 | int queue; | 192 | int queue; |
191 | int used; | ||
192 | struct efx_channel *channel; | 193 | struct efx_channel *channel; |
193 | struct efx_nic *nic; | 194 | struct efx_nic *nic; |
194 | struct efx_tx_buffer *buffer; | 195 | struct efx_tx_buffer *buffer; |
@@ -699,7 +700,7 @@ struct efx_nic { | |||
699 | enum nic_state state; | 700 | enum nic_state state; |
700 | enum reset_type reset_pending; | 701 | enum reset_type reset_pending; |
701 | 702 | ||
702 | struct efx_tx_queue tx_queue[EFX_MAX_TX_QUEUES]; | 703 | struct efx_tx_queue tx_queue[EFX_TX_QUEUE_COUNT]; |
703 | struct efx_rx_queue rx_queue[EFX_MAX_RX_QUEUES]; | 704 | struct efx_rx_queue rx_queue[EFX_MAX_RX_QUEUES]; |
704 | struct efx_channel channel[EFX_MAX_CHANNELS]; | 705 | struct efx_channel channel[EFX_MAX_CHANNELS]; |
705 | 706 | ||
@@ -840,19 +841,15 @@ struct efx_nic_type { | |||
840 | /* Iterate over all used TX queues */ | 841 | /* Iterate over all used TX queues */ |
841 | #define efx_for_each_tx_queue(_tx_queue, _efx) \ | 842 | #define efx_for_each_tx_queue(_tx_queue, _efx) \ |
842 | for (_tx_queue = &_efx->tx_queue[0]; \ | 843 | for (_tx_queue = &_efx->tx_queue[0]; \ |
843 | _tx_queue < &_efx->tx_queue[EFX_MAX_TX_QUEUES]; \ | 844 | _tx_queue < &_efx->tx_queue[EFX_TX_QUEUE_COUNT]; \ |
844 | _tx_queue++) \ | 845 | _tx_queue++) |
845 | if (!_tx_queue->used) \ | ||
846 | continue; \ | ||
847 | else | ||
848 | 846 | ||
849 | /* Iterate over all TX queues belonging to a channel */ | 847 | /* Iterate over all TX queues belonging to a channel */ |
850 | #define efx_for_each_channel_tx_queue(_tx_queue, _channel) \ | 848 | #define efx_for_each_channel_tx_queue(_tx_queue, _channel) \ |
851 | for (_tx_queue = &_channel->efx->tx_queue[0]; \ | 849 | for (_tx_queue = &_channel->efx->tx_queue[0]; \ |
852 | _tx_queue < &_channel->efx->tx_queue[EFX_MAX_TX_QUEUES]; \ | 850 | _tx_queue < &_channel->efx->tx_queue[EFX_TX_QUEUE_COUNT]; \ |
853 | _tx_queue++) \ | 851 | _tx_queue++) \ |
854 | if ((!_tx_queue->used) || \ | 852 | if (_tx_queue->channel != _channel) \ |
855 | (_tx_queue->channel != _channel)) \ | ||
856 | continue; \ | 853 | continue; \ |
857 | else | 854 | else |
858 | 855 | ||