aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/chelsio/cxgb2.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-11-27 16:30:20 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-01 16:32:31 -0500
commite0348b9ae5374f9a24424ae680bcd80724415f60 (patch)
treef6934ec91bc1f4524991232189d40fc5bf765f81 /drivers/net/chelsio/cxgb2.c
parent445cf803ca757a5c43f4e11fdfba70355d510841 (diff)
cxgb - fix stats
Fix MAC stats accounting. Fix get_stats. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/chelsio/cxgb2.c')
-rwxr-xr-xdrivers/net/chelsio/cxgb2.c67
1 files changed, 51 insertions, 16 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 2461f91b0996..c5975047c89b 100755
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -374,7 +374,9 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
374 "TxInternalMACXmitError", 374 "TxInternalMACXmitError",
375 "TxFramesWithExcessiveDeferral", 375 "TxFramesWithExcessiveDeferral",
376 "TxFCSErrors", 376 "TxFCSErrors",
377 377 "TxJumboFramesOk",
378 "TxJumboOctetsOk",
379
378 "RxOctetsOK", 380 "RxOctetsOK",
379 "RxOctetsBad", 381 "RxOctetsBad",
380 "RxUnicastFramesOK", 382 "RxUnicastFramesOK",
@@ -392,11 +394,11 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
392 "RxInRangeLengthErrors", 394 "RxInRangeLengthErrors",
393 "RxOutOfRangeLengthField", 395 "RxOutOfRangeLengthField",
394 "RxFrameTooLongErrors", 396 "RxFrameTooLongErrors",
397 "RxJumboFramesOk",
398 "RxJumboOctetsOk",
395 399
396 /* Port stats */ 400 /* Port stats */
397 "RxPackets",
398 "RxCsumGood", 401 "RxCsumGood",
399 "TxPackets",
400 "TxCsumOffload", 402 "TxCsumOffload",
401 "TxTso", 403 "TxTso",
402 "RxVlan", 404 "RxVlan",
@@ -464,23 +466,56 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
464 const struct cmac_statistics *s; 466 const struct cmac_statistics *s;
465 const struct sge_intr_counts *t; 467 const struct sge_intr_counts *t;
466 struct sge_port_stats ss; 468 struct sge_port_stats ss;
467 unsigned int len;
468 469
469 s = mac->ops->statistics_update(mac, MAC_STATS_UPDATE_FULL); 470 s = mac->ops->statistics_update(mac, MAC_STATS_UPDATE_FULL);
470 471 t = t1_sge_get_intr_counts(adapter->sge);
471 len = sizeof(u64)*(&s->TxFCSErrors + 1 - &s->TxOctetsOK);
472 memcpy(data, &s->TxOctetsOK, len);
473 data += len;
474
475 len = sizeof(u64)*(&s->RxFrameTooLongErrors + 1 - &s->RxOctetsOK);
476 memcpy(data, &s->RxOctetsOK, len);
477 data += len;
478
479 t1_sge_get_port_stats(adapter->sge, dev->if_port, &ss); 472 t1_sge_get_port_stats(adapter->sge, dev->if_port, &ss);
480 memcpy(data, &ss, sizeof(ss));
481 data += sizeof(ss);
482 473
483 t = t1_sge_get_intr_counts(adapter->sge); 474 *data++ = s->TxOctetsOK;
475 *data++ = s->TxOctetsBad;
476 *data++ = s->TxUnicastFramesOK;
477 *data++ = s->TxMulticastFramesOK;
478 *data++ = s->TxBroadcastFramesOK;
479 *data++ = s->TxPauseFrames;
480 *data++ = s->TxFramesWithDeferredXmissions;
481 *data++ = s->TxLateCollisions;
482 *data++ = s->TxTotalCollisions;
483 *data++ = s->TxFramesAbortedDueToXSCollisions;
484 *data++ = s->TxUnderrun;
485 *data++ = s->TxLengthErrors;
486 *data++ = s->TxInternalMACXmitError;
487 *data++ = s->TxFramesWithExcessiveDeferral;
488 *data++ = s->TxFCSErrors;
489 *data++ = s->TxJumboFramesOK;
490 *data++ = s->TxJumboOctetsOK;
491
492 *data++ = s->RxOctetsOK;
493 *data++ = s->RxOctetsBad;
494 *data++ = s->RxUnicastFramesOK;
495 *data++ = s->RxMulticastFramesOK;
496 *data++ = s->RxBroadcastFramesOK;
497 *data++ = s->RxPauseFrames;
498 *data++ = s->RxFCSErrors;
499 *data++ = s->RxAlignErrors;
500 *data++ = s->RxSymbolErrors;
501 *data++ = s->RxDataErrors;
502 *data++ = s->RxSequenceErrors;
503 *data++ = s->RxRuntErrors;
504 *data++ = s->RxJabberErrors;
505 *data++ = s->RxInternalMACRcvError;
506 *data++ = s->RxInRangeLengthErrors;
507 *data++ = s->RxOutOfRangeLengthField;
508 *data++ = s->RxFrameTooLongErrors;
509 *data++ = s->RxJumboFramesOK;
510 *data++ = s->RxJumboOctetsOK;
511
512 *data++ = ss.rx_cso_good;
513 *data++ = ss.tx_cso;
514 *data++ = ss.tx_tso;
515 *data++ = ss.vlan_xtract;
516 *data++ = ss.vlan_insert;
517 *data++ = ss.tx_need_hdrroom;
518
484 *data++ = t->rx_drops; 519 *data++ = t->rx_drops;
485 *data++ = t->pure_rsps; 520 *data++ = t->pure_rsps;
486 *data++ = t->unhandled_irqs; 521 *data++ = t->unhandled_irqs;