You have been subscribed to a public bug:

[Impact]
on a mlx5 device rx-mcast counter is not increased in ip -s after receiving 
mcast packets.
Rx-packets counter is increased normally.

[test case]
send multicast packets to a mlx5 device using mcast address (like 224.0.0.1)
# iperf --client 224.0.0.1 -u  --bind 15.194.5.1

see that before and after sending the mcast counter remains the same

before:
# ip -s l show ens5f0
10: ens5f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode 
DEFAULT group default qlen 1000
    link/ether ec:0d:9a:d4:2d:fc brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    1350216    893      0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    16221      94       0       0       0       0       

after
# ip -s l show ens5f0
10: ens5f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode 
DEFAULT group default qlen 1000
    link/ether ec:0d:9a:d4:2d:fc brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    2700432    1786     0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    16221      94       0       0       0       0     

[Fix]
The issue is solved with upstream commit:

commit 47c97e6b10a1e3680cad539929da092bfa535446
Author: Ron Diskin <ro...@mellanox.com>
Date:   Sun May 10 14:39:51 2020 +0300

    net/mlx5e: Fix multicast counter not up-to-date in "ip -s"
    
    Currently the FW does not generate events for counters other than error
    counters. Unlike ".get_ethtool_stats", ".ndo_get_stats64" (which ip -s
    uses) might run in atomic context, while the FW interface is non atomic.
    Thus, 'ip' is not allowed to issue FW commands, so it will only display
    cached counters in the driver.
    
    Add a SW counter (mcast_packets) in the driver to count rx multicast
    packets. The counter also counts broadcast packets, as we consider it a
    special case of multicast.
    Use the counter value when calling "ip -s"/"ifconfig".
    
    Fixes: f62b8bb8f2d3 ("net/mlx5: Extend mlx5_core to support ConnectX-4 
Ethernet functionality")
    Signed-off-by: Ron Diskin <ro...@mellanox.com>
    Reviewed-by: Tariq Toukan <tar...@mellanox.com>
    Reviewed-by: Moshe Shemesh <mo...@mellanox.com>
    Signed-off-by: Saeed Mahameed <sae...@mellanox.com>

after applying this patch the mcast counter is increased.
before sending mcast packets

# ip -s l show ens5f0
10: ens5f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode 
DEFAULT group default qlen 1000
    link/ether ec:0d:9a:d4:2d:fc brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    0          0        0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    7182       41       0       0       0       0  

after sending mcast packets
# ip -s l show ens5f0
10: ens5f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode 
DEFAULT group default qlen 1000
    link/ether ec:0d:9a:d4:2d:fc brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    1350216    893      0       0       0       893     
    TX: bytes  packets  errors  dropped carrier collsns 
    9860       58       0       0       0       0       

The patch is applied with 2 rejected hunks that need to be inserted
manually with no changes.

[Regression Potential]
Regression risk is low since this patch is small and inserts only minor changes 
to the statistics mechanism.

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Ubuntu 20.04 - multicast counter is not increased in ip -s
https://bugs.launchpad.net/bugs/1901842
You received this bug notification because you are a member of Kernel Packages, 
which is subscribed to linux in Ubuntu.

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to