aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex/benet/be_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_main.c')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 4babc8a4a543..e60e7f724144 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -471,11 +471,26 @@ static void accumulate_16bit_val(u32 *acc, u16 val)
471 ACCESS_ONCE(*acc) = newacc; 471 ACCESS_ONCE(*acc) = newacc;
472} 472}
473 473
474void populate_erx_stats(struct be_adapter *adapter,
475 struct be_rx_obj *rxo,
476 u32 erx_stat)
477{
478 if (!BEx_chip(adapter))
479 rx_stats(rxo)->rx_drops_no_frags = erx_stat;
480 else
481 /* below erx HW counter can actually wrap around after
482 * 65535. Driver accumulates a 32-bit value
483 */
484 accumulate_16bit_val(&rx_stats(rxo)->rx_drops_no_frags,
485 (u16)erx_stat);
486}
487
474void be_parse_stats(struct be_adapter *adapter) 488void be_parse_stats(struct be_adapter *adapter)
475{ 489{
476 struct be_erx_stats_v1 *erx = be_erx_stats_from_cmd(adapter); 490 struct be_erx_stats_v1 *erx = be_erx_stats_from_cmd(adapter);
477 struct be_rx_obj *rxo; 491 struct be_rx_obj *rxo;
478 int i; 492 int i;
493 u32 erx_stat;
479 494
480 if (lancer_chip(adapter)) { 495 if (lancer_chip(adapter)) {
481 populate_lancer_stats(adapter); 496 populate_lancer_stats(adapter);
@@ -488,12 +503,8 @@ void be_parse_stats(struct be_adapter *adapter)
488 503
489 /* as erx_v1 is longer than v0, ok to use v1 for v0 access */ 504 /* as erx_v1 is longer than v0, ok to use v1 for v0 access */
490 for_all_rx_queues(adapter, rxo, i) { 505 for_all_rx_queues(adapter, rxo, i) {
491 /* below erx HW counter can actually wrap around after 506 erx_stat = erx->rx_drops_no_fragments[rxo->q.id];
492 * 65535. Driver accumulates a 32-bit value 507 populate_erx_stats(adapter, rxo, erx_stat);
493 */
494 accumulate_16bit_val(&rx_stats(rxo)->rx_drops_no_frags,
495 (u16)erx->rx_drops_no_fragments \
496 [rxo->q.id]);
497 } 508 }
498 } 509 }
499} 510}