On October 2, 2026 3:07:47 PM GMT+02:00, Petr Oros <[email protected]> wrote:
>ice_get_vf_stats() fills tx_dropped from eth_stats.tx_discards, which
>ice_update_eth_stats() never updates because the GLV_TDPC register it
>would come from is not implemented in E810 hardware. The Tx drops of a
>VF, such as switch drops on an anti spoof violation, malicious driver
>drops or TTL expiry, are counted by GLV_TEPC into eth_stats.tx_errors
>instead, so the VF always reports zero dropped packets.
>
>With spoof checking on, a VF sending 60 valid frames and 30 frames with
>a forged source MAC shows:
>
>  vf 0 ... spoof checking on, link-state auto, trust off
>    TX: bytes  packets   dropped
>          3600       60        0
>
>Report tx_errors as tx_dropped, the VF stats have no separate error
>field. With the change the same test reports 30 dropped packets.
>
>i40e fixed the same issue in commit 50b2af451597 ("i40e: report VF
>tx_dropped with tx_errors instead of tx_discards").
>
>Fixes: 730fdea40bef ("ice: implement VF stats NDO")
>Assisted-by: LLM
>Signed-off-by: Petr Oros <[email protected]>
>---
> drivers/net/ethernet/intel/ice/ice_sriov.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c 
>b/drivers/net/ethernet/intel/ice/ice_sriov.c
>index b21279f0f5f1e1..8faddf8ba0d523 100644
>--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
>+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
>@@ -1640,7 +1640,7 @@ int ice_get_vf_stats(struct net_device *netdev, int 
>vf_id,
>       vf_stats->broadcast  = stats->rx_broadcast;
>       vf_stats->multicast  = stats->rx_multicast;
>       vf_stats->rx_dropped = stats->rx_discards;
>-      vf_stats->tx_dropped = stats->tx_discards;
>+      vf_stats->tx_dropped = stats->tx_errors;
> 
> out_put_vf:
>       ice_put_vf(vf);

Reviewed-by: Ivan Vecera <[email protected]>

Reply via email to