Skip to content

Commit 1e6bfcf

Browse files
Wei Fangmehmetb0
authored andcommitted
net: enetc: remove xdp_drops statistic from enetc_xdp_drop()
BugLink: https://bugs.launchpad.net/bugs/2097393 commit 412950d upstream. The xdp_drops statistic indicates the number of XDP frames dropped in the Rx direction. However, enetc_xdp_drop() is also used in XDP_TX and XDP_REDIRECT actions. If frame loss occurs in these two actions, the frames loss count should not be included in xdp_drops, because there are already xdp_tx_drops and xdp_redirect_failures to count the frame loss of these two actions, so it's better to remove xdp_drops statistic from enetc_xdp_drop() and increase xdp_drops in XDP_DROP action. Fixes: 7ed2bc8 ("net: enetc: add support for XDP_TX") Cc: [email protected] Signed-off-by: Wei Fang <[email protected]> Reviewed-by: Maciej Fijalkowski <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Koichiro Den <[email protected]>
1 parent 5cd92df commit 1e6bfcf

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/freescale/enetc

1 file changed

+1
-1
lines changed

drivers/net/ethernet/freescale/enetc/enetc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,6 @@ static void enetc_xdp_drop(struct enetc_bdr *rx_ring, int rx_ring_first,
15241524
&rx_ring->rx_swbd[rx_ring_first]);
15251525
enetc_bdr_idx_inc(rx_ring, &rx_ring_first);
15261526
}
1527-
rx_ring->stats.xdp_drops++;
15281527
}
15291528

15301529
static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
@@ -1589,6 +1588,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
15891588
fallthrough;
15901589
case XDP_DROP:
15911590
enetc_xdp_drop(rx_ring, orig_i, i);
1591+
rx_ring->stats.xdp_drops++;
15921592
break;
15931593
case XDP_PASS:
15941594
rxbd = orig_rxbd;

0 commit comments

Comments
 (0)