aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/net_driver.h
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-03-20 09:30:37 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-21 22:06:58 -0400
commit6fb70fd1b57707a5c7b9fb167b7790b2cba13f04 (patch)
tree311192bd4de07e1da571f1a6ac6a3ad123ab3f50 /drivers/net/sfc/net_driver.h
parent85451a951b9511605475fadcc0a8d3aeccefded8 (diff)
sfc: Implement adaptive IRQ moderation
Calculate a score for each 1000 IRQs: - TX completions are worth 1 point - RX completions are worth 4 if merged using LRO or 2 otherwise Reduce moderation if the score is less than 10000, down to a minimum of 5 us. Increase moderation if the score is more than 20000, up to the specified maximum. 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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index b81fc727dfff..e169e5dcd1e6 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -336,6 +336,8 @@ enum efx_rx_alloc_method {
336 * @eventq_read_ptr: Event queue read pointer 336 * @eventq_read_ptr: Event queue read pointer
337 * @last_eventq_read_ptr: Last event queue read pointer value. 337 * @last_eventq_read_ptr: Last event queue read pointer value.
338 * @eventq_magic: Event queue magic value for driver-generated test events 338 * @eventq_magic: Event queue magic value for driver-generated test events
339 * @irq_count: Number of IRQs since last adaptive moderation decision
340 * @irq_mod_score: IRQ moderation score
339 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors 341 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
340 * and diagnostic counters 342 * and diagnostic counters
341 * @rx_alloc_push_pages: RX allocation method currently in use for pushing 343 * @rx_alloc_push_pages: RX allocation method currently in use for pushing
@@ -364,6 +366,9 @@ struct efx_channel {
364 unsigned int last_eventq_read_ptr; 366 unsigned int last_eventq_read_ptr;
365 unsigned int eventq_magic; 367 unsigned int eventq_magic;
366 368
369 unsigned int irq_count;
370 unsigned int irq_mod_score;
371
367 int rx_alloc_level; 372 int rx_alloc_level;
368 int rx_alloc_push_pages; 373 int rx_alloc_push_pages;
369 374
@@ -703,6 +708,8 @@ union efx_multicast_hash {
703 * @membase: Memory BAR value 708 * @membase: Memory BAR value
704 * @biu_lock: BIU (bus interface unit) lock 709 * @biu_lock: BIU (bus interface unit) lock
705 * @interrupt_mode: Interrupt mode 710 * @interrupt_mode: Interrupt mode
711 * @irq_rx_adaptive: Adaptive IRQ moderation enabled for RX event queues
712 * @irq_rx_moderation: IRQ moderation time for RX event queues
706 * @i2c_adap: I2C adapter 713 * @i2c_adap: I2C adapter
707 * @board_info: Board-level information 714 * @board_info: Board-level information
708 * @state: Device state flag. Serialised by the rtnl_lock. 715 * @state: Device state flag. Serialised by the rtnl_lock.
@@ -784,6 +791,8 @@ struct efx_nic {
784 void __iomem *membase; 791 void __iomem *membase;
785 spinlock_t biu_lock; 792 spinlock_t biu_lock;
786 enum efx_int_mode interrupt_mode; 793 enum efx_int_mode interrupt_mode;
794 bool irq_rx_adaptive;
795 unsigned int irq_rx_moderation;
787 796
788 struct i2c_adapter i2c_adap; 797 struct i2c_adapter i2c_adap;
789 struct efx_board board_info; 798 struct efx_board board_info;