X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fiavf%2Fiavf_ethdev.c;h=53dc05c78d1c98119c29c33a1613a8b91c628776;hb=35b2d13fd6fdcbd191f2a30d74648faeb1186c65;hp=4072a7b7904e4c2046f1511c4680c660777a2f73;hpb=c387effde8fe244f70a937a66f63dd82d9a79f29;p=dpdk.git diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 4072a7b790..53dc05c78d 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -48,7 +48,7 @@ static void iavf_dev_promiscuous_disable(struct rte_eth_dev *dev); static void iavf_dev_allmulticast_enable(struct rte_eth_dev *dev); static void iavf_dev_allmulticast_disable(struct rte_eth_dev *dev); static int iavf_dev_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, uint32_t index, uint32_t pool); static void iavf_dev_del_mac_addr(struct rte_eth_dev *dev, uint32_t index); @@ -67,7 +67,7 @@ static int iavf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int iavf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id); static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, @@ -225,23 +225,23 @@ iavf_init_rxq(struct rte_eth_dev *dev, struct iavf_rx_queue *rxq) * correctly. */ if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { - if (max_pkt_len <= ETHER_MAX_LEN || + if (max_pkt_len <= RTE_ETHER_MAX_LEN || max_pkt_len > IAVF_FRAME_SIZE_MAX) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, " "as jumbo frame is enabled", - (uint32_t)ETHER_MAX_LEN, + (uint32_t)RTE_ETHER_MAX_LEN, (uint32_t)IAVF_FRAME_SIZE_MAX); return -EINVAL; } } else { - if (max_pkt_len < ETHER_MIN_LEN || - max_pkt_len > ETHER_MAX_LEN) { + if (max_pkt_len < RTE_ETHER_MIN_LEN || + max_pkt_len > RTE_ETHER_MAX_LEN) { PMD_DRV_LOG(ERR, "maximum packet length must be " "larger than %u and smaller than %u, " "as jumbo frame is disabled", - (uint32_t)ETHER_MIN_LEN, - (uint32_t)ETHER_MAX_LEN); + (uint32_t)RTE_ETHER_MIN_LEN, + (uint32_t)RTE_ETHER_MAX_LEN); return -EINVAL; } } @@ -697,7 +697,7 @@ iavf_dev_allmulticast_disable(struct rte_eth_dev *dev) } static int -iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr, +iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -706,7 +706,7 @@ iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr, struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); int err; - if (is_zero_ether_addr(addr)) { + if (rte_is_zero_ether_addr(addr)) { PMD_DRV_LOG(ERR, "Invalid Ethernet Address"); return -EINVAL; } @@ -728,7 +728,7 @@ iavf_dev_del_mac_addr(struct rte_eth_dev *dev, uint32_t index) struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct ether_addr *addr; + struct rte_ether_addr *addr; int err; addr = &dev->data->mac_addrs[index]; @@ -917,7 +917,7 @@ iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) uint32_t frame_size = mtu + IAVF_ETH_OVERHEAD; int ret = 0; - if (mtu < ETHER_MIN_MTU || frame_size > IAVF_FRAME_SIZE_MAX) + if (mtu < RTE_ETHER_MIN_MTU || frame_size > IAVF_FRAME_SIZE_MAX) return -EINVAL; /* mtu setting is forbidden if port is start */ @@ -926,7 +926,7 @@ iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) return -EBUSY; } - if (frame_size > ETHER_MAX_LEN) + if (frame_size > RTE_ETHER_MAX_LEN) dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; else @@ -940,22 +940,22 @@ iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter); - struct ether_addr *perm_addr, *old_addr; + struct rte_ether_addr *perm_addr, *old_addr; int ret; - old_addr = (struct ether_addr *)hw->mac.addr; - perm_addr = (struct ether_addr *)hw->mac.perm_addr; + old_addr = (struct rte_ether_addr *)hw->mac.addr; + perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; - if (is_same_ether_addr(mac_addr, old_addr)) + if (rte_is_same_ether_addr(mac_addr, old_addr)) return 0; /* If the MAC address is configured by host, skip the setting */ - if (is_valid_assigned_ether_addr(perm_addr)) + if (rte_is_valid_assigned_ether_addr(perm_addr)) return -EPERM; ret = iavf_add_del_eth_addr(adapter, old_addr, FALSE); @@ -983,7 +983,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, if (ret) return -EIO; - ether_addr_copy(mac_addr, (struct ether_addr *)hw->mac.addr); + rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); return 0; } @@ -1305,21 +1305,20 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) /* copy mac addr */ eth_dev->data->mac_addrs = rte_zmalloc( - "iavf_mac", - ETHER_ADDR_LEN * IAVF_NUM_MACADDR_MAX, - 0); + "iavf_mac", RTE_ETHER_ADDR_LEN * IAVF_NUM_MACADDR_MAX, 0); if (!eth_dev->data->mac_addrs) { PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to" " store MAC addresses", - ETHER_ADDR_LEN * IAVF_NUM_MACADDR_MAX); + RTE_ETHER_ADDR_LEN * IAVF_NUM_MACADDR_MAX); return -ENOMEM; } /* If the MAC address is not configured by host, * generate a random one. */ - if (!is_valid_assigned_ether_addr((struct ether_addr *)hw->mac.addr)) - eth_random_addr(hw->mac.addr); - ether_addr_copy((struct ether_addr *)hw->mac.addr, + if (!rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)hw->mac.addr)) + rte_eth_random_addr(hw->mac.addr); + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* register callback func to eal lib */