X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fnetvsc%2Fhn_vf.c;h=764cf844c3b706d85e4816f306684f4e99a6c1e4;hb=92d23a57cafe8b57d6a430d5f3e911dd551b9de2;hp=de278eb7b403dc2be22926e9e3138a5a3a0aac67;hpb=4a9efcddaddd2477d370f3720bf93079717c6ddb;p=dpdk.git diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index de278eb7b4..764cf844c3 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include #include @@ -32,20 +32,17 @@ /* Search for VF with matching MAC address, return port id */ static int hn_vf_match(const struct rte_eth_dev *dev) { - const struct ether_addr *mac = dev->data->mac_addrs; - char buf[32]; + const struct rte_ether_addr *mac = dev->data->mac_addrs; int i; - ether_format_addr(buf, sizeof(buf), mac); RTE_ETH_FOREACH_DEV(i) { const struct rte_eth_dev *vf_dev = &rte_eth_devices[i]; - const struct ether_addr *vf_mac = vf_dev->data->mac_addrs; + const struct rte_ether_addr *vf_mac = vf_dev->data->mac_addrs; if (vf_dev == dev) continue; - ether_format_addr(buf, sizeof(buf), vf_mac); - if (is_same_ether_addr(mac, vf_mac)) + if (rte_is_same_ether_addr(mac, vf_mac)) return i; } return -ENOENT; @@ -365,7 +362,16 @@ void hn_vf_reset(struct rte_eth_dev *dev) void hn_vf_close(struct rte_eth_dev *dev) { - VF_ETHDEV_FUNC(dev, rte_eth_dev_close); + struct hn_data *hv = dev->data->dev_private; + uint16_t vf_port; + + rte_spinlock_lock(&hv->vf_lock); + vf_port = hv->vf_port; + if (vf_port != HN_INVALID_PORT) + rte_eth_dev_close(vf_port); + + hv->vf_port = HN_INVALID_PORT; + rte_spinlock_unlock(&hv->vf_lock); } void hn_vf_stats_reset(struct rte_eth_dev *dev) @@ -394,7 +400,7 @@ void hn_vf_promiscuous_disable(struct rte_eth_dev *dev) } int hn_vf_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) { struct hn_data *hv = dev->data->dev_private; @@ -547,3 +553,37 @@ void hn_vf_xstats_reset(struct rte_eth_dev *dev) vf_dev->dev_ops->xstats_reset(vf_dev); rte_spinlock_unlock(&hv->vf_lock); } + +int hn_vf_rss_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_conf *rss_conf) +{ + struct hn_data *hv = dev->data->dev_private; + struct rte_eth_dev *vf_dev; + int ret = 0; + + rte_spinlock_lock(&hv->vf_lock); + vf_dev = hn_get_vf_dev(hv); + if (vf_dev && vf_dev->dev_ops->rss_hash_update) + ret = vf_dev->dev_ops->rss_hash_update(vf_dev, rss_conf); + rte_spinlock_unlock(&hv->vf_lock); + + return ret; +} + +int hn_vf_reta_hash_update(struct rte_eth_dev *dev, + struct rte_eth_rss_reta_entry64 *reta_conf, + uint16_t reta_size) +{ + struct hn_data *hv = dev->data->dev_private; + struct rte_eth_dev *vf_dev; + int ret = 0; + + rte_spinlock_lock(&hv->vf_lock); + vf_dev = hn_get_vf_dev(hv); + if (vf_dev && vf_dev->dev_ops->reta_update) + ret = vf_dev->dev_ops->reta_update(vf_dev, + reta_conf, reta_size); + rte_spinlock_unlock(&hv->vf_lock); + + return ret; +}