Skip to content

Commit

Permalink
Merge pull request #716 from AltraMayor/ipv6_mc
Browse files Browse the repository at this point in the history
lib/net: enable multicast addresses if IPv6 is enabled
  • Loading branch information
AltraMayor authored Nov 25, 2024
2 parents 917021c + 2195af5 commit 23c7c38
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 23c7c38

Please sign in to comment.