|WARNING| net/e1000: fix VF multicast hashes never removed from MTA
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 16 12:07:05 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: MTA rebuild can race between the mailbox handler and the application thread**
`igb_pf_restore_mta()` now runs from two threads with no shared lock:
- The VF mailbox path: `igb_vf_set_multicast()` and `igb_vf_reset_event()`, driven by `igb_pf_mbx_process()` from the interrupt thread.
- The application's control thread: `eth_igb_set_mc_addr_list()` does
```
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);
```
Each call snapshots `hw->mac.mta_shadow` and every `vfinfo[vf].vf_mc_hashes[]`, then rewrites all MTA registers:
```
memcpy(mta, hw->mac.mta_shadow, sizeof(mta));
...
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, mta[i]);
```
The two calls can interleave. For example, the application updates `mta_shadow` while the interrupt thread is mid-rebuild, or the interrupt thread rewrites `vfinfo[vf].vf_mc_hashes[]` while the application thread reads it. The last writer then programs a stale image. That drops PF or VF hash bits, which is the symptom this patch is meant to fix.
The ethdev control-path serialisation rule does not cover this case, because the mailbox handler runs on the interrupt thread rather than as an application-serialised ethdev callback.
Suggested fix: protect the shadow, the per-VF hash lists and the MTA rewrite with a lock held by both paths. An `rte_spinlock_t` in the adapter private data works, taken around `e1000_update_mc_addr_list()` + `igb_pf_restore_mta()` and around the per-VF list update + rebuild.
Review-Result: WARNING
More information about the test-report
mailing list