Skip to content

Commit 43fbca0

Browse files
jbrandebanguy11
authored andcommitted
ice: fix lost multicast packets in promisc mode
There was a problem reported to us where the addition of a VF with an IPv6 address ending with a particular sequence would cause the parent device on the PF to no longer be able to respond to neighbor discovery packets. In this case, we had an ovs-bridge device living on top of a VLAN, which was on top of a PF, and it would not be able to talk anymore (the neighbor entry would expire and couldn't be restored). The root cause of the issue is that if the PF is asked to be in IFF_PROMISC mode (promiscuous mode) and it had an ipv6 address that needed the 33:33:ff:00:00:04 multicast address to work, then when the VF was added with the need for the same multicast address, the VF would steal all the traffic destined for that address. The ice driver didn't auto-subscribe a request of IFF_PROMISC to the "multicast replication from other port's traffic" meaning that it won't get for instance, packets with an exact destination in the VF, as above. The VF's IPv6 address, which adds a "perfect filter" for 33:33:ff:00:00:04, results in no packets for that multicast address making it to the PF (which is in promisc but NOT "multicast replication"). The fix is to enable "multicast promiscuous" whenever the driver is asked to enable IFF_PROMISC, and make sure to disable it when appropriate. Fixes: e94d447 ("ice: Implement filter sync, NDO operations and bump version") Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Rafal Romanowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 3e6dc11 commit 43fbca0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ static int ice_set_promisc(struct ice_vsi *vsi, u8 promisc_m)
275275
if (status && status != -EEXIST)
276276
return status;
277277

278+
netdev_dbg(vsi->netdev, "set promisc filter bits for VSI %i: 0x%x\n",
279+
vsi->vsi_num, promisc_m);
278280
return 0;
279281
}
280282

@@ -300,6 +302,8 @@ static int ice_clear_promisc(struct ice_vsi *vsi, u8 promisc_m)
300302
promisc_m, 0);
301303
}
302304

305+
netdev_dbg(vsi->netdev, "clear promisc filter bits for VSI %i: 0x%x\n",
306+
vsi->vsi_num, promisc_m);
303307
return status;
304308
}
305309

@@ -414,6 +418,16 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
414418
}
415419
err = 0;
416420
vlan_ops->dis_rx_filtering(vsi);
421+
422+
/* promiscuous mode implies allmulticast so
423+
* that VSIs that are in promiscuous mode are
424+
* subscribed to multicast packets coming to
425+
* the port
426+
*/
427+
err = ice_set_promisc(vsi,
428+
ICE_MCAST_PROMISC_BITS);
429+
if (err)
430+
goto out_promisc;
417431
}
418432
} else {
419433
/* Clear Rx filter to remove traffic from wire */
@@ -430,6 +444,18 @@ static int ice_vsi_sync_fltr(struct ice_vsi *vsi)
430444
NETIF_F_HW_VLAN_CTAG_FILTER)
431445
vlan_ops->ena_rx_filtering(vsi);
432446
}
447+
448+
/* disable allmulti here, but only if allmulti is not
449+
* still enabled for the netdev
450+
*/
451+
if (!(vsi->current_netdev_flags & IFF_ALLMULTI)) {
452+
err = ice_clear_promisc(vsi,
453+
ICE_MCAST_PROMISC_BITS);
454+
if (err) {
455+
netdev_err(netdev, "Error %d clearing multicast promiscuous on VSI %i\n",
456+
err, vsi->vsi_num);
457+
}
458+
}
433459
}
434460
}
435461
goto exit;

0 commit comments

Comments
 (0)