i40e_fdir_filter_restore(pf);
}
-static int
-is_i40e_pmd(const char *driver_name)
+static bool
+is_device_supported(struct rte_eth_dev *dev, struct eth_driver *drv)
{
- if (!strstr(driver_name, "i40e"))
- return -ENOTSUP;
+ if (strcmp(dev->driver->pci_drv.driver.name,
+ drv->pci_drv.driver.name))
+ return false;
- if (strstr(driver_name, "i40e_vf"))
- return -ENOTSUP;
-
- return 0;
+ return true;
}
int
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
if (vlan_id > ETHER_MAX_VLAN_ID) {
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
dev = &rte_eth_devices[port];
- if (is_i40e_pmd(dev->data->drv_name))
+ if (!is_device_supported(dev, &rte_i40e_pmd))
return -ENOTSUP;
pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);