sleep in control plane thread
[dpdk.git] / drivers / net / enic / enic_ethdev.c
index 5b6b004..a7a178e 100644 (file)
@@ -144,7 +144,10 @@ enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev,
        case RTE_ETH_FILTER_GENERIC:
                if (filter_op != RTE_ETH_FILTER_GET)
                        return -EINVAL;
-               *(const void **)arg = &enic_flow_ops;
+               if (enic->flow_filter_mode == FILTER_FLOWMAN)
+                       *(const void **)arg = &enic_fm_flow_ops;
+               else
+                       *(const void **)arg = &enic_flow_ops;
                break;
        case RTE_ETH_FILTER_FDIR:
                ret = enicpmd_fdir_ctrl_func(dev, filter_op, arg);
@@ -402,6 +405,10 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)
                return ret;
        }
 
+       if (eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               eth_dev->data->dev_conf.rxmode.offloads |=
+                       DEV_RX_OFFLOAD_RSS_HASH;
+
        enic->mc_count = 0;
        enic->hw_ip_checksum = !!(eth_dev->data->dev_conf.rxmode.offloads &
                                  DEV_RX_OFFLOAD_CHECKSUM);
@@ -504,6 +511,12 @@ static uint32_t speed_capa_from_pci_id(struct rte_eth_dev *eth_dev)
        /* 1300 and later models are at least 40G */
        if (id >= 0x0100)
                return ETH_LINK_SPEED_40G;
+       /* VFs have subsystem id 0, check device id */
+       if (id == 0) {
+               /* Newer VF implies at least 40G model */
+               if (pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_SN)
+                       return ETH_LINK_SPEED_40G;
+       }
        return ETH_LINK_SPEED_10G;
 }
 
@@ -1053,7 +1066,7 @@ static int enicpmd_dev_udp_tunnel_port_del(struct rte_eth_dev *eth_dev,
                             tnl->udp_port);
                return -EINVAL;
        }
-       return update_vxlan_port(enic, ENIC_DEFAULT_VXLAN_PORT);
+       return update_vxlan_port(enic, RTE_VXLAN_DEFAULT_PORT);
 }
 
 static int enicpmd_dev_fw_version_get(struct rte_eth_dev *eth_dev,
@@ -1288,6 +1301,11 @@ static struct rte_pci_driver rte_enic_pmd = {
        .remove = eth_enic_pci_remove,
 };
 
+int dev_is_enic(struct rte_eth_dev *dev)
+{
+       return dev->device->driver == &rte_enic_pmd.driver;
+}
+
 RTE_PMD_REGISTER_PCI(net_enic, rte_enic_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_enic, pci_id_enic_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_enic, "* igb_uio | uio_pci_generic | vfio-pci");