Skip to content

Commit b351b16

Browse files
chelsiocudbgdavem330
authored andcommitted
cxgb4: remove stats fetched from firmware
When running ethtool -S, some stats are requested from firmware. Since getting these stats via firmware mailbox is slow, some packets get dropped under heavy load while running ethtool -S. So, remove these stats from ethtool -S. Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b32b088 commit b351b16

File tree

1 file changed

+0
-133
lines changed

1 file changed

+0
-133
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -115,42 +115,10 @@ static char adapter_stats_strings[][ETH_GSTRING_LEN] = {
115115
"db_drop ",
116116
"db_full ",
117117
"db_empty ",
118-
"tcp_ipv4_out_rsts ",
119-
"tcp_ipv4_in_segs ",
120-
"tcp_ipv4_out_segs ",
121-
"tcp_ipv4_retrans_segs ",
122-
"tcp_ipv6_out_rsts ",
123-
"tcp_ipv6_in_segs ",
124-
"tcp_ipv6_out_segs ",
125-
"tcp_ipv6_retrans_segs ",
126-
"usm_ddp_frames ",
127-
"usm_ddp_octets ",
128-
"usm_ddp_drops ",
129-
"rdma_no_rqe_mod_defer ",
130-
"rdma_no_rqe_pkt_defer ",
131-
"tp_err_ofld_no_neigh ",
132-
"tp_err_ofld_cong_defer ",
133118
"write_coal_success ",
134119
"write_coal_fail ",
135120
};
136121

137-
static char channel_stats_strings[][ETH_GSTRING_LEN] = {
138-
"--------Channel--------- ",
139-
"tp_cpl_requests ",
140-
"tp_cpl_responses ",
141-
"tp_mac_in_errs ",
142-
"tp_hdr_in_errs ",
143-
"tp_tcp_in_errs ",
144-
"tp_tcp6_in_errs ",
145-
"tp_tnl_cong_drops ",
146-
"tp_tnl_tx_drops ",
147-
"tp_ofld_vlan_drops ",
148-
"tp_ofld_chan_drops ",
149-
"fcoe_octets_ddp ",
150-
"fcoe_frames_ddp ",
151-
"fcoe_frames_drop ",
152-
};
153-
154122
static char loopback_stats_strings[][ETH_GSTRING_LEN] = {
155123
"-------Loopback----------- ",
156124
"octets_ok ",
@@ -187,7 +155,6 @@ static int get_sset_count(struct net_device *dev, int sset)
187155
case ETH_SS_STATS:
188156
return ARRAY_SIZE(stats_strings) +
189157
ARRAY_SIZE(adapter_stats_strings) +
190-
ARRAY_SIZE(channel_stats_strings) +
191158
ARRAY_SIZE(loopback_stats_strings);
192159
case ETH_SS_PRIV_FLAGS:
193160
return ARRAY_SIZE(cxgb4_priv_flags_strings);
@@ -252,9 +219,6 @@ static void get_strings(struct net_device *dev, u32 stringset, u8 *data)
252219
memcpy(data, adapter_stats_strings,
253220
sizeof(adapter_stats_strings));
254221
data += sizeof(adapter_stats_strings);
255-
memcpy(data, channel_stats_strings,
256-
sizeof(channel_stats_strings));
257-
data += sizeof(channel_stats_strings);
258222
memcpy(data, loopback_stats_strings,
259223
sizeof(loopback_stats_strings));
260224
} else if (stringset == ETH_SS_PRIV_FLAGS) {
@@ -280,41 +244,10 @@ struct adapter_stats {
280244
u64 db_drop;
281245
u64 db_full;
282246
u64 db_empty;
283-
u64 tcp_v4_out_rsts;
284-
u64 tcp_v4_in_segs;
285-
u64 tcp_v4_out_segs;
286-
u64 tcp_v4_retrans_segs;
287-
u64 tcp_v6_out_rsts;
288-
u64 tcp_v6_in_segs;
289-
u64 tcp_v6_out_segs;
290-
u64 tcp_v6_retrans_segs;
291-
u64 frames;
292-
u64 octets;
293-
u64 drops;
294-
u64 rqe_dfr_mod;
295-
u64 rqe_dfr_pkt;
296-
u64 ofld_no_neigh;
297-
u64 ofld_cong_defer;
298247
u64 wc_success;
299248
u64 wc_fail;
300249
};
301250

302-
struct channel_stats {
303-
u64 cpl_req;
304-
u64 cpl_rsp;
305-
u64 mac_in_errs;
306-
u64 hdr_in_errs;
307-
u64 tcp_in_errs;
308-
u64 tcp6_in_errs;
309-
u64 tnl_cong_drops;
310-
u64 tnl_tx_drops;
311-
u64 ofld_vlan_drops;
312-
u64 ofld_chan_drops;
313-
u64 octets_ddp;
314-
u64 frames_ddp;
315-
u64 frames_drop;
316-
};
317-
318251
static void collect_sge_port_stats(const struct adapter *adap,
319252
const struct port_info *p,
320253
struct queue_port_stats *s)
@@ -337,45 +270,14 @@ static void collect_sge_port_stats(const struct adapter *adap,
337270

338271
static void collect_adapter_stats(struct adapter *adap, struct adapter_stats *s)
339272
{
340-
struct tp_tcp_stats v4, v6;
341-
struct tp_rdma_stats rdma_stats;
342-
struct tp_err_stats err_stats;
343-
struct tp_usm_stats usm_stats;
344273
u64 val1, val2;
345274

346275
memset(s, 0, sizeof(*s));
347276

348-
spin_lock(&adap->stats_lock);
349-
t4_tp_get_tcp_stats(adap, &v4, &v6, false);
350-
t4_tp_get_rdma_stats(adap, &rdma_stats, false);
351-
t4_get_usm_stats(adap, &usm_stats, false);
352-
t4_tp_get_err_stats(adap, &err_stats, false);
353-
spin_unlock(&adap->stats_lock);
354-
355277
s->db_drop = adap->db_stats.db_drop;
356278
s->db_full = adap->db_stats.db_full;
357279
s->db_empty = adap->db_stats.db_empty;
358280

359-
s->tcp_v4_out_rsts = v4.tcp_out_rsts;
360-
s->tcp_v4_in_segs = v4.tcp_in_segs;
361-
s->tcp_v4_out_segs = v4.tcp_out_segs;
362-
s->tcp_v4_retrans_segs = v4.tcp_retrans_segs;
363-
s->tcp_v6_out_rsts = v6.tcp_out_rsts;
364-
s->tcp_v6_in_segs = v6.tcp_in_segs;
365-
s->tcp_v6_out_segs = v6.tcp_out_segs;
366-
s->tcp_v6_retrans_segs = v6.tcp_retrans_segs;
367-
368-
if (is_offload(adap)) {
369-
s->frames = usm_stats.frames;
370-
s->octets = usm_stats.octets;
371-
s->drops = usm_stats.drops;
372-
s->rqe_dfr_mod = rdma_stats.rqe_dfr_mod;
373-
s->rqe_dfr_pkt = rdma_stats.rqe_dfr_pkt;
374-
}
375-
376-
s->ofld_no_neigh = err_stats.ofld_no_neigh;
377-
s->ofld_cong_defer = err_stats.ofld_cong_defer;
378-
379281
if (!is_t4(adap->params.chip)) {
380282
int v;
381283

@@ -389,36 +291,6 @@ static void collect_adapter_stats(struct adapter *adap, struct adapter_stats *s)
389291
}
390292
}
391293

392-
static void collect_channel_stats(struct adapter *adap, struct channel_stats *s,
393-
u8 i)
394-
{
395-
struct tp_cpl_stats cpl_stats;
396-
struct tp_err_stats err_stats;
397-
struct tp_fcoe_stats fcoe_stats;
398-
399-
memset(s, 0, sizeof(*s));
400-
401-
spin_lock(&adap->stats_lock);
402-
t4_tp_get_cpl_stats(adap, &cpl_stats, false);
403-
t4_tp_get_err_stats(adap, &err_stats, false);
404-
t4_get_fcoe_stats(adap, i, &fcoe_stats, false);
405-
spin_unlock(&adap->stats_lock);
406-
407-
s->cpl_req = cpl_stats.req[i];
408-
s->cpl_rsp = cpl_stats.rsp[i];
409-
s->mac_in_errs = err_stats.mac_in_errs[i];
410-
s->hdr_in_errs = err_stats.hdr_in_errs[i];
411-
s->tcp_in_errs = err_stats.tcp_in_errs[i];
412-
s->tcp6_in_errs = err_stats.tcp6_in_errs[i];
413-
s->tnl_cong_drops = err_stats.tnl_cong_drops[i];
414-
s->tnl_tx_drops = err_stats.tnl_tx_drops[i];
415-
s->ofld_vlan_drops = err_stats.ofld_vlan_drops[i];
416-
s->ofld_chan_drops = err_stats.ofld_chan_drops[i];
417-
s->octets_ddp = fcoe_stats.octets_ddp;
418-
s->frames_ddp = fcoe_stats.frames_ddp;
419-
s->frames_drop = fcoe_stats.frames_drop;
420-
}
421-
422294
static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
423295
u64 *data)
424296
{
@@ -438,11 +310,6 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
438310
collect_adapter_stats(adapter, (struct adapter_stats *)data);
439311
data += sizeof(struct adapter_stats) / sizeof(u64);
440312

441-
*data++ = (u64)pi->port_id;
442-
collect_channel_stats(adapter, (struct channel_stats *)data,
443-
pi->port_id);
444-
data += sizeof(struct channel_stats) / sizeof(u64);
445-
446313
*data++ = (u64)pi->port_id;
447314
memset(&s, 0, sizeof(s));
448315
t4_get_lb_stats(adapter, pi->port_id, &s);

0 commit comments

Comments
 (0)