New upstream version 18.08
[deb_dpdk.git] / drivers / net / ixgbe / ixgbe_pf.c
index ea99737..4b833ff 100644 (file)
@@ -90,6 +90,8 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
        if (*vfinfo == NULL)
                rte_panic("Cannot allocate memory for private VF data\n");
 
+       rte_eth_switch_domain_alloc(&(*vfinfo)->switch_domain_id);
+
        memset(mirror_info, 0, sizeof(struct ixgbe_mirror_info));
        memset(uta_info, 0, sizeof(struct ixgbe_uta_info));
        hw->mac.mc_filter_type = 0;
@@ -122,11 +124,10 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)
 {
        struct ixgbe_vf_info **vfinfo;
        uint16_t vf_num;
+       int ret;
 
        PMD_INIT_FUNC_TRACE();
 
-       vfinfo = IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
-
        RTE_ETH_DEV_SRIOV(eth_dev).active = 0;
        RTE_ETH_DEV_SRIOV(eth_dev).nb_q_per_pool = 0;
        RTE_ETH_DEV_SRIOV(eth_dev).def_vmdq_idx = 0;
@@ -136,6 +137,14 @@ void ixgbe_pf_host_uninit(struct rte_eth_dev *eth_dev)
        if (vf_num == 0)
                return;
 
+       vfinfo = IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
+       if (*vfinfo == NULL)
+               return;
+
+       ret = rte_eth_switch_domain_free((*vfinfo)->switch_domain_id);
+       if (ret)
+               PMD_INIT_LOG(WARNING, "failed to free switch domain: %d", ret);
+
        rte_free(*vfinfo);
        *vfinfo = NULL;
 }
@@ -329,10 +338,7 @@ set_rx_mode(struct rte_eth_dev *dev)
 
        IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
 
-       if (dev->data->dev_conf.rxmode.hw_vlan_strip)
-               ixgbe_vlan_hw_strip_enable_all(dev);
-       else
-               ixgbe_vlan_hw_strip_disable_all(dev);
+       ixgbe_vlan_hw_strip_config(dev);
 }
 
 static inline void