Skip to content

Commit

Permalink
lib/net: enable multicast addresses if IPv6 is enabled
Browse files Browse the repository at this point in the history
IPv6's protocol ND requires multicast.

Most DPDK's drivers have multicast enabled by default,
but a few drivers have it disabled by default.
Drivers known to have multicast disabled by default are
the bonding driver when LACP is being used and the i40e driver.
  • Loading branch information
AltraMayor committed Nov 19, 2024
1 parent 917021c commit 2195af5
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions lib/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1690,23 +1690,6 @@ create_bond(struct gatekeeper_if *iface)
}
}

if (__lacp_enabled(iface)) {
/*
* If LACP is enabled, enable multicast addresses.
* Otherwise, rx_burst_8023ad() of DPDK's bonding driver
* (see rte_eth_bond_pmd.c) is going to discard
* multicast Ethernet packets such as ARP and
* ND packets.
*/
ret = rte_eth_allmulticast_enable(iface->id);
if (unlikely(ret < 0)) {
G_LOG(ERR, "%s(%s): cannot enable multicast on bond device (errno=%i): %s\n",
__func__, iface->name,
-ret, rte_strerror(-ret));
goto close_bond;
}
}

/* Add members to bond. */
for (i = 0; i < iface->num_ports; i++) {
ret = rte_eth_bond_member_add(iface->id, iface->ports[i]);
Expand Down Expand Up @@ -2021,6 +2004,25 @@ init_iface(struct gatekeeper_if *iface)
goto free_ports;
}

/*
* IPv6's protocol ND requires multicast. Therefore,
* if IPv6 is enabled, enable multicast addresses.
*
* Most DPDK's drivers have multicast enabled by default,
* but a few drivers have it disabled by default.
* Drivers known to have multicast disabled by default are
* the bonding driver when LACP is being used and the i40e driver.
*/
if (ipv6_if_configured(iface)) {
ret = rte_eth_allmulticast_enable(iface->id);
if (unlikely(ret < 0)) {
G_LOG(ERR, "%s(%s): cannot enable multicast (errno=%i): %s\n",
__func__, iface->name,
-ret, rte_strerror(-ret));
goto close_ports;
}
}

/* Make sure the interface supports hardware offloads. */
ret = check_if_offloads(iface, &port_conf);
if (unlikely(ret < 0)) {
Expand Down

0 comments on commit 2195af5

Please sign in to comment.