Skip to content

Commit

Permalink
net/igc: fix Rx error counter for bad length
Browse files Browse the repository at this point in the history
[ upstream commit c69abf6 ]

When the size of a packet in Rx channel is less than the minimum
or greater than the maximum, the packet will be simultaneously
counted by RLEC(Receive Length Error Count) and
RUC(Receive Under Size Count)/ROC(Receive Oversize Count) registers.

This patch fixes the issue of counting a length error packet twice
when counting the total number of received error packets.

Fixes: e6defdf ("net/igc: enable statistics")

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
  • Loading branch information
Alvin Zhang authored and steevenlee committed May 8, 2021
1 parent 13e3e5e commit fa6df61
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/igc/igc_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,7 @@ eth_igc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)

/* Rx Errors */
rte_stats->imissed = stats->mpc;
rte_stats->ierrors = stats->crcerrs +
stats->rlec + stats->ruc + stats->roc +
rte_stats->ierrors = stats->crcerrs + stats->rlec +
stats->rxerrc + stats->algnerrc;

/* Tx Errors */
Expand Down

0 comments on commit fa6df61

Please sign in to comment.