Skip to content

Commit

Permalink
DPDK: fix dpdk_if_get_mtu() callback for the bond interfaces
Browse files Browse the repository at this point in the history
Change-Id: I01f1aff2d2a5dad459a061fe28ed7de49716091e
Closes-bug: 1454995
  • Loading branch information
semihalf-berestovskyy-andriy committed Oct 7, 2015
1 parent 578aeb3 commit 7fa8707
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions dpdk/vr_dpdk_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,14 +1198,26 @@ dpdk_if_get_mtu(struct vr_interface *vif)
{
uint8_t port_id;
uint16_t mtu;
unsigned l3_mtu;

l3_mtu = vif->vif_mtu;

if (vif->vif_type == VIF_TYPE_PHYSICAL) {
port_id = (((struct vr_dpdk_ethdev *)(vif->vif_os))->ethdev_port_id);
if (rte_eth_dev_get_mtu(port_id, &mtu) == 0)
/* TODO: DPDK bond interfaces does not provide MTU (MTU is 0) */
if (rte_eth_dev_get_mtu(port_id, &mtu) == 0 && mtu > 0)
return mtu;

/* Decrement Ethernet header size. */
l3_mtu -= sizeof(struct vr_eth);
if (vr_dpdk.vlan_tag != VLAN_ID_INVALID) {
/* Decrement 802.1q header size. */
l3_mtu -= sizeof(uint32_t);
}
}

return vif->vif_mtu;

return l3_mtu;
}

static void
Expand Down

0 comments on commit 7fa8707

Please sign in to comment.