Fix multicast enable on the bonded interface 53/6353/1
authorSteve Shin <jonshin@cisco.com>
Sat, 22 Apr 2017 13:58:23 +0000 (06:58 -0700)
committerSteve Shin <jonshin@cisco.com>
Sat, 22 Apr 2017 13:58:23 +0000 (06:58 -0700)
Multicast enable flag should be set when the bonded interface is up.
This flag allows multicast packets to be processed from the slave devices
of the bonded interface. Also promiscuous mode for all-multicast should
be correctly displayed as part of 'show hardware detail' output.

Change-Id: Ief0157c4c030a28afb9c45ebf3d6a12710083724
Signed-off-by: Steve Shin <jonshin@cisco.com>
src/plugins/dpdk/device/device.c
src/plugins/dpdk/device/format.c

index e84d524..48f3237 100644 (file)
@@ -649,6 +649,18 @@ dpdk_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
        rte_eth_promiscuous_disable (xd->device_index);
 
       rte_eth_allmulticast_enable (xd->device_index);
+
+      if (xd->pmd == VNET_DPDK_PMD_BOND)
+       {
+         u8 slink[16];
+         int nlink = rte_eth_bond_slaves_get (xd->device_index, slink, 16);
+         while (nlink >= 1)
+           {
+             u8 dpdk_port = slink[--nlink];
+             rte_eth_allmulticast_enable (dpdk_port);
+           }
+       }
+
       xd->flags |= DPDK_DEVICE_FLAG_ADMIN_UP;
       dpdk_update_counters (xd, now);
       dpdk_update_link_state (xd, now);
index f1cca3f..93eca52 100644 (file)
@@ -417,7 +417,7 @@ format_dpdk_device (u8 * s, va_list * args)
        format (s, "%Upromiscuous:       unicast %s all-multicast %s\n",
                format_white_space, indent + 2,
                rte_eth_promiscuous_get (xd->device_index) ? "on" : "off",
-               rte_eth_promiscuous_get (xd->device_index) ? "on" : "off");
+               rte_eth_allmulticast_get (xd->device_index) ? "on" : "off");
       vlan_off = rte_eth_dev_get_vlan_offload (xd->device_index);
       s = format (s, "%Uvlan offload:      strip %s filter %s qinq %s\n",
                  format_white_space, indent + 2,