aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex/benet/be.h
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@emulex.com>2013-10-01 06:30:00 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-01 12:45:52 -0400
commit2632bafd74ae7d058ae52be80e6393139fd29f23 (patch)
treea1119a741b44afc7e68ab02b320a306c2238df30 /drivers/net/ethernet/emulex/benet/be.h
parent0599863d35410ea65ceadcca87497985b371039a (diff)
be2net: fix adaptive interrupt coalescing
The current EQ delay calculation for AIC is based only on RX packet rate. This fails to be effective when there's only TX and no RX. This patch inclues: - Calculating EQ-delay based on both RX and TX pps. - Modifying EQ-delay of all EQs via one cmd, instead of issuing a separate cmd for each EQ. - A new structure to store interrupt coalescing parameters, in a separate cache-line from the EQ-obj. Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be.h')
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index 4a540aff698c..e7cbc56a0c8f 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -88,7 +88,7 @@ static inline char *nic_name(struct pci_dev *pdev)
88#define BE_MIN_MTU 256 88#define BE_MIN_MTU 256
89 89
90#define BE_NUM_VLANS_SUPPORTED 64 90#define BE_NUM_VLANS_SUPPORTED 64
91#define BE_MAX_EQD 96u 91#define BE_MAX_EQD 128u
92#define BE_MAX_TX_FRAG_COUNT 30 92#define BE_MAX_TX_FRAG_COUNT 30
93 93
94#define EVNT_Q_LEN 1024 94#define EVNT_Q_LEN 1024
@@ -200,6 +200,17 @@ struct be_eq_obj {
200 struct be_adapter *adapter; 200 struct be_adapter *adapter;
201} ____cacheline_aligned_in_smp; 201} ____cacheline_aligned_in_smp;
202 202
203struct be_aic_obj { /* Adaptive interrupt coalescing (AIC) info */
204 bool enable;
205 u32 min_eqd; /* in usecs */
206 u32 max_eqd; /* in usecs */
207 u32 prev_eqd; /* in usecs */
208 u32 et_eqd; /* configured val when aic is off */
209 ulong jiffies;
210 u64 rx_pkts_prev; /* Used to calculate RX pps */
211 u64 tx_reqs_prev; /* Used to calculate TX pps */
212};
213
203struct be_mcc_obj { 214struct be_mcc_obj {
204 struct be_queue_info q; 215 struct be_queue_info q;
205 struct be_queue_info cq; 216 struct be_queue_info cq;
@@ -238,15 +249,12 @@ struct be_rx_page_info {
238struct be_rx_stats { 249struct be_rx_stats {
239 u64 rx_bytes; 250 u64 rx_bytes;
240 u64 rx_pkts; 251 u64 rx_pkts;
241 u64 rx_pkts_prev;
242 ulong rx_jiffies;
243 u32 rx_drops_no_skbs; /* skb allocation errors */ 252 u32 rx_drops_no_skbs; /* skb allocation errors */
244 u32 rx_drops_no_frags; /* HW has no fetched frags */ 253 u32 rx_drops_no_frags; /* HW has no fetched frags */
245 u32 rx_post_fail; /* page post alloc failures */ 254 u32 rx_post_fail; /* page post alloc failures */
246 u32 rx_compl; 255 u32 rx_compl;
247 u32 rx_mcast_pkts; 256 u32 rx_mcast_pkts;
248 u32 rx_compl_err; /* completions with err set */ 257 u32 rx_compl_err; /* completions with err set */
249 u32 rx_pps; /* pkts per second */
250 struct u64_stats_sync sync; 258 struct u64_stats_sync sync;
251}; 259};
252 260
@@ -403,6 +411,7 @@ struct be_adapter {
403 u32 big_page_size; /* Compounded page size shared by rx wrbs */ 411 u32 big_page_size; /* Compounded page size shared by rx wrbs */
404 412
405 struct be_drv_stats drv_stats; 413 struct be_drv_stats drv_stats;
414 struct be_aic_obj aic_obj[MAX_EVT_QS];
406 u16 vlans_added; 415 u16 vlans_added;
407 u8 vlan_tag[VLAN_N_VID]; 416 u8 vlan_tag[VLAN_N_VID];
408 u8 vlan_prio_bmap; /* Available Priority BitMap */ 417 u8 vlan_prio_bmap; /* Available Priority BitMap */