enic: Add support for adaptive interrupt coalescing
Subsystems (3)
PATCH 1/1 enic: Add support for adaptive interrupt coalescing
From: Sujith Sankar <[email protected]>
--- drivers/net/ethernet/cisco/enic/enic.h | 30 +++++ drivers/net/ethernet/cisco/enic/enic_dev.h | 2 + drivers/net/ethernet/cisco/enic/enic_ethtool.c | 67 +++++++++- drivers/net/ethernet/cisco/enic/enic_main.c | 168 +++++++++++++++++++++++++ drivers/net/ethernet/cisco/enic/vnic_cq.h | 8 ++ 5 files changed, 269 insertions(+), 6 deletions(-)
drivers/net/ethernet/cisco/enic/enic.h +30 -0
@@ -43,6 +43,8 @@#define ENIC_CQ_MAX (ENIC_WQ_MAX + ENIC_RQ_MAX)#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) +#define ENIC_AIC_LARGE_PKT_DIFF 3 +struct enic_msix_entry {int requested;char devname[IFNAMSIZ ];
@@ -50,6 +52,33 @@ struct enic_msix_entry {void *devid; }; +/* Store only the lower range. Higher range is given by fw. */ +struct enic_intr_mod_range { +u32 small_pkt_range_start; +u32 large_pkt_range_start; +}; + +struct enic_intr_mod_table { +u32 rx_rate; +u32 range_percent; +}; + +#define ENIC_MAX_LINK_SPEEDS 3 +#define ENIC_LINK_SPEED_10G 10000 +#define ENIC_LINK_SPEED_4G 4000 +#define ENIC_LINK_40G_INDEX 2 +#define ENIC_LINK_10G_INDEX 1 +#define ENIC_LINK_4G_INDEX 0 +#define ENIC_RX_COALESCE_RANGE_END 125 + +struct enic_rx_coal { +u32 small_pkt_range_start; +u32 large_pkt_range_start; +u32 range_end; +u32 use_adaptive_rx_coalesce; +struct hrtimer ts_timer; +}; +/* priv_flags */ #define ENIC_SRIOV_ENABLED (1 << 0)
@@ -92,6 +121,7 @@ struct enic {unsigned int mc_count;unsigned int uc_count;u32 port_mtu; +struct enic_rx_coal rx_coalesce_setting;u32 rx_coalesce_usecs;u32 tx_coalesce_usecs;#ifdef CONFIG_PCI_IOV
drivers/net/ethernet/cisco/enic/enic_dev.h +2 -0
@@ -62,4 +62,6 @@ int enic_dev_enable2(struct enic *enic, int arg);int enic_dev_enable2_done (struct enic *enic,int *status);int enic_dev_status_to_errno (int devcmd_status); +struct vic_provinfo ; +#endif /* _ENIC_DEV_H_ */
drivers/net/ethernet/cisco/enic/enic_ethtool.c +61 -6
111 lines not on this page · raw message
drivers/net/ethernet/cisco/enic/enic_main.c +168 -0
246 lines not on this page · raw message
drivers/net/ethernet/cisco/enic/vnic_cq.h +8 -0
@@ -50,6 +50,11 @@ struct vnic_cq_ctrl {u32 pad10; }; +struct vnic_rx_bytes_counter { +unsigned int small_pkt_bytes_cnt; +unsigned int large_pkt_bytes_cnt; +}; +struct vnic_cq {unsigned int index;struct vnic_dev *vdev;
@@ -58,6 +63,9 @@ struct vnic_cq {unsigned int to_clean;unsigned int last_color;unsigned int interrupt_offset; +struct vnic_rx_bytes_counter pkt_size_counter; +unsigned int cur_rx_coal_timeval; +ktime_t prev_ts; }; static inline unsigned int vnic_cq_service(struct vnic_cq *cq,
Signature · 1 line
1.9.2
David Miller
maintainerFrom: Govindarajulu Varadarajan <[email protected]>
Date: Tue, 6 May 2014 19:54:22 +0530
Quoted 4 lines
From: Sujith Sankar <[email protected]>
Signed-off-by Sujith Sankar <[email protected]>Signed-off-by Govindarajulu Varadarajan <[email protected]>
Please never submit patches except absolutely the most extremely trivial ones without a real commit log message explaining what the change does, how it does it, and why you implemented it that way.
drivers/net/ethernet/cisco/enic/enic_main.c static int enic_poll(struct napi_struct *napi, int budget) · line 1184
Quoted 4 lines
drivers/net/ethernet/cisco/enic/enic_main.c +4
-0+enum hrtimer_restart enic_hrtimer_cb (struct hrtimer *timer) +{ +return HRTIMER_RESTART ; +}
For example, I have no idea why in the world you need an hrtimer whose function is a complete NOP if the networking hardware does the interrupt coalescing for you.
Quoted 5 lines · David Miller
From: Govindarajulu Varadarajan <[email protected]>
Date: Tue, 6 May 2014 19:54:22 +0530Quoted 2 lines
From: Sujith Sankar <[email protected]>
Quoted 8 lines
Quoted 2 lines
Signed-off-by Sujith Sankar <[email protected]>Signed-off-by Govindarajulu Varadarajan <[email protected]>Please never submit patches except absolutely the most extremely trivial ones without a real commit log message explaining what the change does, how it does it, and why you implemented it that way.
Will add more description. Sorry
Quoted 9 lines
drivers/net/ethernet/cisco/enic/enic_main.c static int enic_poll(struct napi_struct *napi, int budget) · line 1184
Quoted 4 lines
drivers/net/ethernet/cisco/enic/enic_main.c +4
-0+enum hrtimer_restart enic_hrtimer_cb (struct hrtimer *timer) +{ +return HRTIMER_RESTART ; +}For example, I have no idea why in the world you need an hrtimer whose function is a complete NOP if the networking hardware does the interrupt coalescing for you.
The idea was to get time delta in usec, to measure the pkt rate. We want to make damping of coal timer more aggressive. I guess we can use ktime_get() instead of hrtimers.
Will resubmit the patch with changes in a week. Let us know if anything else needs to be changed.
thanks
Govind
David Miller
maintainerFrom: Govindarajulu Varadarajan <[email protected]>
Date: Thu, 8 May 2014 11:43:03 +0530 (IST)
Quoted 3 lines
The idea was to get time delta in usec, to measure the pkt rate. We want to make damping of coal timer more aggressive. I guess we can use
ktime_get()instead of hrtimers.
Yes, just use ktime_get().