|WARNING| net/e1000: fix VF multicast hashes never removed from MTA
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 16 11:57:32 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172915
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-16
**Warning: unsynchronised MTA rebuild between the app thread and the mailbox handler**
In `drivers/net/intel/e1000/igb_ethdev.c`:
```
e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr);
/* the base code rewrote the MTA from the PF list only: add the VF hashes back */
if (RTE_ETH_DEV_SRIOV(dev).active)
igb_pf_restore_mta(dev);
```
`eth_igb_set_mc_addr_list()` runs in the application's control thread. With this patch, `igb_pf_restore_mta()` is also called from `igb_vf_set_multicast()` and `igb_vf_reset_event()`, which run from the PF mailbox handler in the interrupt thread. Nothing serialises the two.
`igb_pf_restore_mta()` does `memcpy(mta, hw->mac.mta_shadow, sizeof(mta))` and walks `vfinfo[vf].num_vf_mc_hashes` / `vf_mc_hashes[]`. At the same time, the other thread may be rebuilding `mta_shadow` inside `e1000_update_mc_addr_list()`, or rewriting a VF's list:
```
vfinfo[vf].num_vf_mc_hashes = (uint16_t)entries;
...
vfinfo[vf].vf_mc_hashes[i] = hash_list[i];
```
If the mailbox-side rebuild snapshots a half-built shadow and writes the MTA last, the hardware is left missing PF (or VF) multicast bits until the next update. The ethdev serialisation rule does not cover this, because the mailbox interrupt handler is not an application-serialised ethdev callback.
Suggested fix: protect `mta_shadow`, `vfinfo[].vf_mc_hashes` / `num_vf_mc_hashes`, and the MTA write-out with a lock (e.g. an `rte_spinlock_t` in the adapter). Take it in `eth_igb_set_mc_addr_list()` around both the base-code update and the restore, and in the two mailbox paths.
**Info: transient loss of VF multicast reception**
`e1000_update_mc_addr_list()` first writes a PF-only MTA. `igb_pf_restore_mta()` then writes it again with the VF bits. Between the two writes, VFs briefly lose multicast reception. Building the merged table once and writing it a single time would avoid the gap, but this is minor.
Review-Result: WARNING
More information about the test-report
mailing list