diff options
author | Steve Hodgson <shodgson@solarflare.com> | 2010-09-10 02:42:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-10 15:27:33 -0400 |
commit | ecc910f520ba8f22848982ee816ad75c449b805d (patch) | |
tree | e934380209532b831b7e7e334ddc33d75db7eef5 /drivers/net/sfc/net_driver.h | |
parent | 8313aca38b3937947fffebca6e34bac8e24300c8 (diff) |
sfc: Make the dmaq size a run-time setting (rather than compile-time)
- Allow the ring size to be specified in non
power-of-two sizes (for instance to limit
the amount of receive buffers).
- Automatically size the event queue.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index cfc65f5a3c09..ac622ab72e11 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -137,6 +137,7 @@ struct efx_tx_buffer { | |||
137 | * @channel: The associated channel | 137 | * @channel: The associated channel |
138 | * @buffer: The software buffer ring | 138 | * @buffer: The software buffer ring |
139 | * @txd: The hardware descriptor ring | 139 | * @txd: The hardware descriptor ring |
140 | * @ptr_mask: The size of the ring minus 1. | ||
140 | * @flushed: Used when handling queue flushing | 141 | * @flushed: Used when handling queue flushing |
141 | * @read_count: Current read pointer. | 142 | * @read_count: Current read pointer. |
142 | * This is the number of buffers that have been removed from both rings. | 143 | * This is the number of buffers that have been removed from both rings. |
@@ -170,6 +171,7 @@ struct efx_tx_queue { | |||
170 | struct efx_nic *nic; | 171 | struct efx_nic *nic; |
171 | struct efx_tx_buffer *buffer; | 172 | struct efx_tx_buffer *buffer; |
172 | struct efx_special_buffer txd; | 173 | struct efx_special_buffer txd; |
174 | unsigned int ptr_mask; | ||
173 | enum efx_flush_state flushed; | 175 | enum efx_flush_state flushed; |
174 | 176 | ||
175 | /* Members used mainly on the completion path */ | 177 | /* Members used mainly on the completion path */ |
@@ -227,6 +229,7 @@ struct efx_rx_page_state { | |||
227 | * @efx: The associated Efx NIC | 229 | * @efx: The associated Efx NIC |
228 | * @buffer: The software buffer ring | 230 | * @buffer: The software buffer ring |
229 | * @rxd: The hardware descriptor ring | 231 | * @rxd: The hardware descriptor ring |
232 | * @ptr_mask: The size of the ring minus 1. | ||
230 | * @added_count: Number of buffers added to the receive queue. | 233 | * @added_count: Number of buffers added to the receive queue. |
231 | * @notified_count: Number of buffers given to NIC (<= @added_count). | 234 | * @notified_count: Number of buffers given to NIC (<= @added_count). |
232 | * @removed_count: Number of buffers removed from the receive queue. | 235 | * @removed_count: Number of buffers removed from the receive queue. |
@@ -238,9 +241,6 @@ struct efx_rx_page_state { | |||
238 | * @min_fill: RX descriptor minimum non-zero fill level. | 241 | * @min_fill: RX descriptor minimum non-zero fill level. |
239 | * This records the minimum fill level observed when a ring | 242 | * This records the minimum fill level observed when a ring |
240 | * refill was triggered. | 243 | * refill was triggered. |
241 | * @min_overfill: RX descriptor minimum overflow fill level. | ||
242 | * This records the minimum fill level at which RX queue | ||
243 | * overflow was observed. It should never be set. | ||
244 | * @alloc_page_count: RX allocation strategy counter. | 244 | * @alloc_page_count: RX allocation strategy counter. |
245 | * @alloc_skb_count: RX allocation strategy counter. | 245 | * @alloc_skb_count: RX allocation strategy counter. |
246 | * @slow_fill: Timer used to defer efx_nic_generate_fill_event(). | 246 | * @slow_fill: Timer used to defer efx_nic_generate_fill_event(). |
@@ -250,6 +250,7 @@ struct efx_rx_queue { | |||
250 | struct efx_nic *efx; | 250 | struct efx_nic *efx; |
251 | struct efx_rx_buffer *buffer; | 251 | struct efx_rx_buffer *buffer; |
252 | struct efx_special_buffer rxd; | 252 | struct efx_special_buffer rxd; |
253 | unsigned int ptr_mask; | ||
253 | 254 | ||
254 | int added_count; | 255 | int added_count; |
255 | int notified_count; | 256 | int notified_count; |
@@ -307,6 +308,7 @@ enum efx_rx_alloc_method { | |||
307 | * @reset_work: Scheduled reset work thread | 308 | * @reset_work: Scheduled reset work thread |
308 | * @work_pending: Is work pending via NAPI? | 309 | * @work_pending: Is work pending via NAPI? |
309 | * @eventq: Event queue buffer | 310 | * @eventq: Event queue buffer |
311 | * @eventq_mask: Event queue pointer mask | ||
310 | * @eventq_read_ptr: Event queue read pointer | 312 | * @eventq_read_ptr: Event queue read pointer |
311 | * @last_eventq_read_ptr: Last event queue read pointer value. | 313 | * @last_eventq_read_ptr: Last event queue read pointer value. |
312 | * @magic_count: Event queue test event count | 314 | * @magic_count: Event queue test event count |
@@ -339,6 +341,7 @@ struct efx_channel { | |||
339 | struct napi_struct napi_str; | 341 | struct napi_struct napi_str; |
340 | bool work_pending; | 342 | bool work_pending; |
341 | struct efx_special_buffer eventq; | 343 | struct efx_special_buffer eventq; |
344 | unsigned int eventq_mask; | ||
342 | unsigned int eventq_read_ptr; | 345 | unsigned int eventq_read_ptr; |
343 | unsigned int last_eventq_read_ptr; | 346 | unsigned int last_eventq_read_ptr; |
344 | unsigned int magic_count; | 347 | unsigned int magic_count; |
@@ -641,6 +644,8 @@ union efx_multicast_hash { | |||
641 | * @tx_queue: TX DMA queues | 644 | * @tx_queue: TX DMA queues |
642 | * @rx_queue: RX DMA queues | 645 | * @rx_queue: RX DMA queues |
643 | * @channel: Channels | 646 | * @channel: Channels |
647 | * @rxq_entries: Size of receive queues requested by user. | ||
648 | * @txq_entries: Size of transmit queues requested by user. | ||
644 | * @next_buffer_table: First available buffer table id | 649 | * @next_buffer_table: First available buffer table id |
645 | * @n_channels: Number of channels in use | 650 | * @n_channels: Number of channels in use |
646 | * @n_rx_channels: Number of channels used for RX (= number of RX queues) | 651 | * @n_rx_channels: Number of channels used for RX (= number of RX queues) |
@@ -726,6 +731,8 @@ struct efx_nic { | |||
726 | 731 | ||
727 | struct efx_channel *channel[EFX_MAX_CHANNELS]; | 732 | struct efx_channel *channel[EFX_MAX_CHANNELS]; |
728 | 733 | ||
734 | unsigned rxq_entries; | ||
735 | unsigned txq_entries; | ||
729 | unsigned next_buffer_table; | 736 | unsigned next_buffer_table; |
730 | unsigned n_channels; | 737 | unsigned n_channels; |
731 | unsigned n_rx_channels; | 738 | unsigned n_rx_channels; |