]> git.ipfire.org Git - thirdparty/qemu.git/commit
e1000x: Fix BPRC and MPRC
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Tue, 23 May 2023 02:42:54 +0000 (11:42 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 24 May 2023 13:31:45 +0000 (16:31 +0300)
commit0f7ca2bf2c6476244113132539ff2d6ef1d47b34
treed8c12e5315e171db4d473dfdd023ec79eb42e9ea
parenteb134d1d589f3ed693b40f2654ff478424b5d9cb
e1000x: Fix BPRC and MPRC

Before this change, e1000 and the common code updated BPRC and MPRC
depending on the matched filter, but e1000e and igb decided to update
those counters by deriving the packet type independently. This
inconsistency caused a multicast packet to be counted twice.

Updating BPRC and MPRC depending on are fundamentally flawed anyway as
a filter can be used for different types of packets. For example, it is
possible to filter broadcast packets with MTA.

Always determine what counters to update by inspecting the packets.

Fixes: 3b27430177 ("e1000: Implementing various counters")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit f3f9b726afba1f53663768603189e574f80b5907)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/e1000.c
hw/net/e1000e_core.c
hw/net/e1000x_common.c
hw/net/e1000x_common.h
hw/net/igb_core.c