ethdev: set VMDq pool when adding mac address
authorIntel <intel.com>
Mon, 3 Jun 2013 00:00:00 +0000 (00:00 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 17 Sep 2013 12:16:08 +0000 (14:16 +0200)
Signed-off-by: Intel
lib/librte_ether/rte_ethdev.c

index f7535c8..4e8e73c 100644 (file)
@@ -530,11 +530,15 @@ rte_eth_dev_config_restore(uint8_t port_id)
        struct rte_eth_dev_info dev_info;
        struct ether_addr addr;
        uint16_t i;
+       uint32_t pool = 0;
 
        dev = &rte_eth_devices[port_id];
 
        rte_eth_dev_info_get(port_id, &dev_info);
 
+       if (RTE_ETH_DEV_SRIOV(dev).active)
+               pool = RTE_ETH_DEV_SRIOV(dev).def_vmdq_idx;
+
        /* replay MAC address configuration */
        for (i = 0; i < dev_info.max_mac_addrs; i++) {
                addr = dev->data->mac_addrs[i];
@@ -545,7 +549,7 @@ rte_eth_dev_config_restore(uint8_t port_id)
 
                /* add address to the hardware */
                if  (*dev->dev_ops->mac_addr_add)
-                       (*dev->dev_ops->mac_addr_add)(dev, &addr, i, 0);
+                       (*dev->dev_ops->mac_addr_add)(dev, &addr, i, pool);
                else {
                        PMD_DEBUG_TRACE("port %d: MAC address array not supported\n",
                                        port_id);