Skip to content

Commit

Permalink
DPDK: Set MTU of bonded interfaces as one of the slave's MTU in rte_e…
Browse files Browse the repository at this point in the history
…th_dev structure

Change-Id: I2a8c084b8f434bf2ad255bbea0784f6fff78a253
Closes-Bug: 1579243
  • Loading branch information
kirankn80 committed May 6, 2016
1 parent c5cbb52 commit fc830f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dpdk/vr_dpdk_ethdev.c
Expand Up @@ -583,6 +583,7 @@ dpdk_ethdev_bond_info_update(struct vr_dpdk_ethdev *ethdev)
{
int i, slave_port_id;
int port_id = ethdev->ethdev_port_id;
uint16_t mtu = 0;
struct rte_pci_addr *pci_addr;
struct ether_addr bond_mac, mac_addr;
struct ether_addr lacp_mac = { .addr_bytes = {0x01, 0x80, 0xc2, 0, 0, 0x02} };
Expand All @@ -601,6 +602,10 @@ dpdk_ethdev_bond_info_update(struct vr_dpdk_ethdev *ethdev)
/* log out and configure bond members */
for (i = 0; i < ethdev->ethdev_nb_slaves; i++) {
slave_port_id = ethdev->ethdev_slaves[i];
if (!rte_eth_devices[port_id].data->mtu) {
rte_eth_dev_get_mtu(slave_port_id, &mtu);
rte_eth_devices[port_id].data->mtu = mtu;
}
memset(&mac_addr, 0, sizeof(mac_addr));
rte_eth_macaddr_get(slave_port_id, &mac_addr);
pci_addr = &rte_eth_devices[slave_port_id].pci_dev->addr;
Expand Down
1 change: 1 addition & 0 deletions dpdk/vr_dpdk_knidev.c
Expand Up @@ -474,6 +474,7 @@ dpdk_knidev_change_mtu(uint8_t port_id, unsigned new_mtu)
RTE_LOG(INFO, VROUTER, "Changing bond eth device %" PRIu8 " MTU\n",
ethdev->ethdev_port_id);

rte_eth_devices[ethdev->ethdev_port_id].data->mtu = new_mtu;
for (i = 0; i < ethdev->ethdev_nb_slaves; i++) {
slave_port_id = ethdev->ethdev_slaves[i];
RTE_LOG(INFO, VROUTER,
Expand Down

0 comments on commit fc830f2

Please sign in to comment.