Skip to content

Commit

Permalink
Fix for flooding of packets in dpdk vrouter
Browse files Browse the repository at this point in the history
closes-jira-bug: CEM-5251
Disabling promiscuous mode should be done based on the result
of adding the unicast address.
Drivers such as i40e doesnt support the apis to set multicast
address. But the bond driver is made to enable all multicast for
all the slave drives. So this shouldnt be an issue.

Change-Id: Ie754fad59a215462b62da6e2ab309de13422d1fd
  • Loading branch information
Jeya ganesh babu J committed Jun 6, 2019
1 parent fe710ea commit 7a20fc6
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions dpdk/vr_dpdk_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ vr_dpdk_ethdev_filtering_init(struct vr_interface *vif,
static void
dpdk_ethdev_bond_info_update(struct vr_dpdk_ethdev *ethdev)
{
int i, slave_port_id;
int i, slave_port_id, ret;
int port_id = ethdev->ethdev_port_id;
uint16_t mtu = 0;
struct rte_pci_addr *pci_addr;
Expand Down Expand Up @@ -700,17 +700,24 @@ dpdk_ethdev_bond_info_update(struct vr_dpdk_ethdev *ethdev)
pci_addr->devid, pci_addr->function,
MAC_VALUE(mac_addr.addr_bytes));

/* try to add bond mac and LACP multicast MACs */
if (rte_eth_dev_mac_addr_add(slave_port_id, &bond_mac, 0) == 0
&& rte_eth_dev_set_mc_addr_list(slave_port_id, &lacp_mac, 1) == 0) {
/* disable the promisc mode enabled by default */
rte_eth_promiscuous_disable(ethdev->ethdev_port_id);
/* We just try to add the mc address. In any case, the bond driver would
* enable the 'all multicast' mode
*/
if ((ret=rte_eth_dev_set_mc_addr_list(slave_port_id, &lacp_mac, 1)) != 0)
RTE_LOG(INFO, VROUTER, " bond member eth device %" PRIu8
" promisc mode disabled\n", slave_port_id);
} else {
": unable to add multicast addresses %d\n", slave_port_id,ret);

/*
* Need to set the dev mac to disable the promiscuous mode
*/
if ((ret=rte_eth_dev_mac_addr_add(slave_port_id, &bond_mac, 0)) != 0)
RTE_LOG(INFO, VROUTER, " bond member eth device %" PRIu8
": unable to add MAC addresses\n", slave_port_id);
": unable to add MAC addresses %d\n", slave_port_id,ret);
else {
RTE_LOG(INFO, VROUTER, " disabling promiscuous mode for device %d\n", slave_port_id);
rte_eth_promiscuous_disable(ethdev->ethdev_port_id);
}

}
}
}
Expand Down

0 comments on commit 7a20fc6

Please sign in to comment.