net/virtio: improve queue init error path
[dpdk.git] / drivers / net / ice / ice_dcf_ethdev.c
index e077229..215d71e 100644 (file)
@@ -743,31 +743,14 @@ ice_dcf_dev_allmulticast_disable(__rte_unused struct rte_eth_dev *dev)
 }
 
 static int
-ice_dcf_dev_filter_ctrl(struct rte_eth_dev *dev,
-                       enum rte_filter_type filter_type,
-                       enum rte_filter_op filter_op,
-                       void *arg)
+ice_dcf_dev_flow_ops_get(struct rte_eth_dev *dev,
+                        const struct rte_flow_ops **ops)
 {
-       int ret = 0;
-
        if (!dev)
                return -EINVAL;
 
-       switch (filter_type) {
-       case RTE_ETH_FILTER_GENERIC:
-               if (filter_op != RTE_ETH_FILTER_GET)
-                       return -EINVAL;
-               *(const void **)arg = &ice_flow_ops;
-               break;
-
-       default:
-               PMD_DRV_LOG(WARNING, "Filter type (%d) not supported",
-                           filter_type);
-               ret = -EINVAL;
-               break;
-       }
-
-       return ret;
+       *ops = &ice_flow_ops;
+       return 0;
 }
 
 #define ICE_DCF_32_BIT_WIDTH (CHAR_BIT * 4)
@@ -984,7 +967,7 @@ static const struct eth_dev_ops ice_dcf_eth_dev_ops = {
        .promiscuous_disable     = ice_dcf_dev_promiscuous_disable,
        .allmulticast_enable     = ice_dcf_dev_allmulticast_enable,
        .allmulticast_disable    = ice_dcf_dev_allmulticast_disable,
-       .filter_ctrl             = ice_dcf_dev_filter_ctrl,
+       .flow_ops_get            = ice_dcf_dev_flow_ops_get,
        .udp_tunnel_port_add     = ice_dcf_dev_udp_tunnel_port_add,
        .udp_tunnel_port_del     = ice_dcf_dev_udp_tunnel_port_del,
 };
@@ -1089,6 +1072,8 @@ eth_ice_dcf_pci_probe(__rte_unused struct rte_pci_driver *pci_drv,
                                            ice_dcf_dev_init);
        if (ret || !eth_da.nb_representor_ports)
                return ret;
+       if (eth_da.type != RTE_ETH_REPRESENTOR_VF)
+               return -ENOTSUP;
 
        dcf_ethdev = rte_eth_dev_allocated(pci_dev->device.name);
        if (dcf_ethdev == NULL)