X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fi40e%2Fi40e_ethdev_vf.c;h=63dbe14c358d2211e264d1e036d747b3bdf9cd5b;hb=35b2d13fd6fdcbd191f2a30d74648faeb1186c65;hp=87c45f2783919243325ad940e596ed7e3031f214;hpb=756cea41e9b8108ee8887b63abc357c1f678f480;p=dpdk.git diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 87c45f2783..63dbe14c35 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -106,7 +106,7 @@ static int i40evf_dev_tx_queue_start(struct rte_eth_dev *dev, static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); static int i40evf_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 i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index); @@ -123,7 +123,7 @@ static int i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int i40evf_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id); static int @@ -134,10 +134,11 @@ static void i40evf_handle_pf_event(struct rte_eth_dev *dev, static int i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr, bool add); static int -i40evf_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, +i40evf_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); /* Default hash key buffer for RSS */ @@ -776,7 +777,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev) static int i40evf_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -787,7 +788,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev, int err; struct vf_cmd_info args; - if (is_zero_ether_addr(addr)) { + if (rte_is_zero_ether_addr(addr)) { PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3], @@ -818,7 +819,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev, static void i40evf_del_mac_addr_by_addr(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { struct virtchnl_ether_addr_list *list; struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); @@ -859,7 +860,7 @@ static void i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index) { struct rte_eth_dev_data *data = dev->data; - struct ether_addr *addr; + struct rte_ether_addr *addr; addr = &data->mac_addrs[index]; @@ -1273,10 +1274,11 @@ i40evf_init_vf(struct rte_eth_dev *dev) vf->vsi.adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); /* Store the MAC address configured by host, or generate random one */ - if (is_valid_assigned_ether_addr((struct ether_addr *)hw->mac.addr)) + if (rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)hw->mac.addr)) vf->flags |= I40E_FLAG_VF_MAC_BY_PF; else - eth_random_addr(hw->mac.addr); /* Generate a random one */ + rte_eth_random_addr(hw->mac.addr); /* Generate a random one */ I40E_WRITE_REG(hw, I40E_VFINT_DYN_CTL01, (I40E_ITR_INDEX_DEFAULT << @@ -1503,15 +1505,15 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) /* copy mac addr */ eth_dev->data->mac_addrs = rte_zmalloc("i40evf_mac", - ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX, - 0); + RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX, + 0); if (eth_dev->data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Failed to allocate %d bytes needed to" " store MAC addresses", - ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX); + RTE_ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX); return -ENOMEM; } - ether_addr_copy((struct ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); return 0; @@ -1765,21 +1767,22 @@ i40evf_rxq_init(struct rte_eth_dev *dev, struct i40e_rx_queue *rxq) * Check if the jumbo frame and maximum packet length are set correctly */ if (dev_data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_JUMBO_FRAME) { - if (rxq->max_pkt_len <= ETHER_MAX_LEN || + if (rxq->max_pkt_len <= RTE_ETHER_MAX_LEN || rxq->max_pkt_len > I40E_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, + "frame is enabled", (uint32_t)RTE_ETHER_MAX_LEN, (uint32_t)I40E_FRAME_SIZE_MAX); return I40E_ERR_CONFIG; } } else { - if (rxq->max_pkt_len < ETHER_MIN_LEN || - rxq->max_pkt_len > ETHER_MAX_LEN) { + if (rxq->max_pkt_len < RTE_ETHER_MIN_LEN || + rxq->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); + "frame is disabled", + (uint32_t)RTE_ETHER_MIN_LEN, + (uint32_t)RTE_ETHER_MAX_LEN); return I40E_ERR_CONFIG; } } @@ -1929,14 +1932,14 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) int next_begin = 0; int begin = 0; uint32_t len; - struct ether_addr *addr; + struct rte_ether_addr *addr; struct vf_cmd_info args; do { j = 0; len = sizeof(struct virtchnl_ether_addr_list); for (i = begin; i < I40E_NUM_MACADDR_MAX; i++, next_begin++) { - if (is_zero_ether_addr(&dev->data->mac_addrs[i])) + if (rte_is_zero_ether_addr(&dev->data->mac_addrs[i])) continue; len += sizeof(struct virtchnl_ether_addr); if (len >= I40E_AQ_BUF_SZ) { @@ -1953,7 +1956,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) for (i = begin; i < next_begin; i++) { addr = &dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); @@ -2216,7 +2219,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN; dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX; dev_info->max_mtu = dev_info->max_rx_pktlen - I40E_ETH_OVERHEAD; - dev_info->min_mtu = ETHER_MIN_MTU; + dev_info->min_mtu = RTE_ETHER_MIN_MTU; dev_info->hash_key_size = (I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t); dev_info->reta_size = ETH_RSS_RETA_SIZE_64; dev_info->flow_type_rss_offloads = vf->adapter->flow_types_mask; @@ -2324,11 +2327,11 @@ i40evf_dev_close(struct rte_eth_dev *dev) */ i40evf_dev_promiscuous_disable(dev); i40evf_dev_allmulticast_disable(dev); + rte_eal_alarm_cancel(i40evf_dev_alarm_handler, dev); i40evf_reset_vf(dev); i40e_shutdown_adminq(hw); i40evf_disable_irq0(hw); - rte_eal_alarm_cancel(i40evf_dev_alarm_handler, dev); hw->adapter_closed = 1; } @@ -2678,7 +2681,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) int ret = 0; /* check if mtu is within the allowed range */ - if ((mtu < ETHER_MIN_MTU) || (frame_size > I40E_FRAME_SIZE_MAX)) + if (mtu < RTE_ETHER_MIN_MTU || frame_size > I40E_FRAME_SIZE_MAX) return -EINVAL; /* mtu setting is forbidden if port is start */ @@ -2688,7 +2691,7 @@ i40evf_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 @@ -2701,12 +2704,12 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int i40evf_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); return -EINVAL; } @@ -2714,18 +2717,18 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev, if (vf->flags & I40E_FLAG_VF_MAC_BY_PF) return -EPERM; - i40evf_del_mac_addr_by_addr(dev, (struct ether_addr *)hw->mac.addr); + i40evf_del_mac_addr_by_addr(dev, (struct rte_ether_addr *)hw->mac.addr); if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0) 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; } static int i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addrs, + struct rte_ether_addr *mc_addrs, uint32_t mc_addrs_num, bool add) { struct virtchnl_ether_addr_list *list; @@ -2779,7 +2782,8 @@ i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, } static int -i40evf_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addrs, +i40evf_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addrs, uint32_t mc_addrs_num) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);