i40e: enable multicast for promiscuous mode
authorDing Heng <hengx.ding@intel.com>
Fri, 15 Aug 2014 01:47:32 +0000 (09:47 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 25 Aug 2014 14:07:50 +0000 (16:07 +0200)
IPv6 will run NDP with multicast packets, but multicast packets will be
filtered by i40e driver by default. So we need to enable multicast when
promiscuous mode is on, or IPv6 will fail.

Signed-off-by: Ding Heng <hengx.ding@intel.com>
Reviewed-by: Helin Zhang <helin.zhang@intel.com>
lib/librte_pmd_i40e/i40e_ethdev.c

index 0a918a6..f5a3ae7 100644 (file)
@@ -873,6 +873,12 @@ i40e_dev_promiscuous_enable(struct rte_eth_dev *dev)
                                                        true, NULL);
        if (status != I40E_SUCCESS)
                PMD_DRV_LOG(ERR, "Failed to enable unicast promiscuous\n");
+
+       status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid,
+                                                       TRUE, NULL);
+       if (status != I40E_SUCCESS)
+               PMD_DRV_LOG(ERR, "Failed to enable multicast promiscuous\n");
+
 }
 
 static void
@@ -887,6 +893,11 @@ i40e_dev_promiscuous_disable(struct rte_eth_dev *dev)
                                                        false, NULL);
        if (status != I40E_SUCCESS)
                PMD_DRV_LOG(ERR, "Failed to disable unicast promiscuous\n");
+
+       status = i40e_aq_set_vsi_multicast_promiscuous(hw, vsi->seid,
+                                                       false, NULL);
+       if (status != I40E_SUCCESS)
+               PMD_DRV_LOG(ERR, "Failed to disable multicast promiscuous\n");
 }
 
 static void
@@ -910,6 +921,9 @@ i40e_dev_allmulticast_disable(struct rte_eth_dev *dev)
        struct i40e_vsi *vsi = pf->main_vsi;
        int ret;
 
+       if (dev->data->promiscuous == 1)
+               return; /* must remain in all_multicast mode */
+
        ret = i40e_aq_set_vsi_multicast_promiscuous(hw,
                                vsi->seid, FALSE, NULL);
        if (ret != I40E_SUCCESS)