/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2017 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
static void ixgbe_set_default_mac_addr(struct rte_eth_dev *dev,
struct ether_addr *mac_addr);
static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config);
+static int is_ixgbe_pmd(const char *driver_name);
/* For Virtual Function support */
static int eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev);
ixgbe_add_rar(dev, addr, 0, 0);
}
+static int
+is_ixgbe_pmd(const char *driver_name)
+{
+ if (!strstr(driver_name, "ixgbe"))
+ return -ENOTSUP;
+
+ if (strstr(driver_name, "ixgbe_vf"))
+ return -ENOTSUP;
+
+ return 0;
+}
+
int
rte_pmd_ixgbe_set_vf_mac_addr(uint8_t port, uint16_t vf,
struct ether_addr *mac_addr)
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
if (vf >= dev_info.max_vfs)
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
if (vf >= dev_info.max_vfs)
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
if (vf >= dev_info.max_vfs)
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
if (vf >= dev_info.max_vfs)
return -EINVAL;
- if (vlan_id > 4095)
+ if (vlan_id > ETHER_MAX_VLAN_ID)
return -EINVAL;
hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct ixgbe_hw *hw;
uint32_t ctrl;
struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
if (on > 1)
return -EINVAL;
int i;
int num_queues = (int)(IXGBE_QDE_IDX_MASK >> IXGBE_QDE_IDX_SHIFT);
struct rte_eth_dev *dev;
+ struct rte_eth_dev_info dev_info;
RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
dev = &rte_eth_devices[port];
+ rte_eth_dev_info_get(port, &dev_info);
+
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
if (on > 1)
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
/* only support VF's 0 to 63 */
if ((vf >= dev_info.max_vfs) || (vf > 63))
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
+ return -ENOTSUP;
+
if (vf >= dev_info.max_vfs)
return -EINVAL;
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
- if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
return -ENOTSUP;
if (vf >= dev_info.max_vfs)
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
- if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
return -ENOTSUP;
if (vf >= dev_info.max_vfs)
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
- if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
return -ENOTSUP;
if (vf >= dev_info.max_vfs)
dev = &rte_eth_devices[port];
rte_eth_dev_info_get(port, &dev_info);
- if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
return -ENOTSUP;
if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
rte_eth_dev_info_get(port, &dev_info);
rte_eth_link_get_nowait(port, &link);
- if (strstr(dev_info.driver_name, "ixgbe_vf"))
+ if (is_ixgbe_pmd(dev_info.driver_name) != 0)
return -ENOTSUP;
if (vf >= dev_info.max_vfs)