Ubuntu 20.04 - multicast counter is not increased in ip -s
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned | ||
Groovy |
Fix Released
|
Medium
|
Unassigned | ||
Hirsute |
Invalid
|
Undecided
|
Unassigned |
Bug Description
[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,
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,
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 47c97e6b10a1e36
Author: Ron Diskin <email address hidden>
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_
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 <email address hidden>
Reviewed-by: Tariq Toukan <email address hidden>
Reviewed-by: Moshe Shemesh <email address hidden>
Signed-off-by: Saeed Mahameed <email address hidden>
after applying this patch the mcast counter is increased.
before sending mcast packets
# ip -s l show ens5f0
10: ens5f0: <BROADCAST,
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,
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.
CVE References
Changed in linux (Ubuntu Groovy): | |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux (Ubuntu Focal): | |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in linux (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Groovy): | |
status: | In Progress → Fix Committed |
Patch exists upstream in 5.9. So Hirsute should be good, will need backport for Groovy and Focal.