X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fi40e%2Fi40e_vf_representor.c;h=b07b35c03fe7682a84bfdc05c349c0b3d8925f44;hb=09096df509db3f026e9f112d5f63422db6f52968;hp=24751d13cd33f8bd8142e086ecd10de248ecc2f0;hpb=391797f04208aec3a75efd01bfa368899b2f37db;p=dpdk.git diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 24751d13cd..b07b35c03f 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -22,7 +22,7 @@ i40e_vf_representor_link_update(struct rte_eth_dev *ethdev, return i40e_dev_link_update(representor->adapter->eth_dev, wait_to_complete); } -static void +static int i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, struct rte_eth_dev_info *dev_info) { @@ -100,6 +100,8 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, representor->adapter->eth_dev->device->name; dev_info->switch_info.domain_id = representor->switch_domain_id; dev_info->switch_info.port_id = representor->vf_id; + + return 0; } static int @@ -262,52 +264,52 @@ i40e_vf_representor_stats_get(struct rte_eth_dev *ethdev, return ret; } -static void +static int i40e_vf_representor_stats_reset(struct rte_eth_dev *ethdev) { struct i40e_vf_representor *representor = ethdev->data->dev_private; - rte_pmd_i40e_get_vf_native_stats( + return rte_pmd_i40e_get_vf_native_stats( representor->adapter->eth_dev->data->port_id, representor->vf_id, &representor->stats_offset); } -static void +static int i40e_vf_representor_promiscuous_enable(struct rte_eth_dev *ethdev) { struct i40e_vf_representor *representor = ethdev->data->dev_private; - rte_pmd_i40e_set_vf_unicast_promisc( + return rte_pmd_i40e_set_vf_unicast_promisc( representor->adapter->eth_dev->data->port_id, representor->vf_id, 1); } -static void +static int i40e_vf_representor_promiscuous_disable(struct rte_eth_dev *ethdev) { struct i40e_vf_representor *representor = ethdev->data->dev_private; - rte_pmd_i40e_set_vf_unicast_promisc( + return rte_pmd_i40e_set_vf_unicast_promisc( representor->adapter->eth_dev->data->port_id, representor->vf_id, 0); } -static void +static int i40e_vf_representor_allmulticast_enable(struct rte_eth_dev *ethdev) { struct i40e_vf_representor *representor = ethdev->data->dev_private; - rte_pmd_i40e_set_vf_multicast_promisc( + return rte_pmd_i40e_set_vf_multicast_promisc( representor->adapter->eth_dev->data->port_id, representor->vf_id, 1); } -static void +static int i40e_vf_representor_allmulticast_disable(struct rte_eth_dev *ethdev) { struct i40e_vf_representor *representor = ethdev->data->dev_private; - rte_pmd_i40e_set_vf_multicast_promisc( + return rte_pmd_i40e_set_vf_multicast_promisc( representor->adapter->eth_dev->data->port_id, representor->vf_id, 0); } @@ -324,7 +326,7 @@ i40e_vf_representor_mac_addr_remove(struct rte_eth_dev *ethdev, uint32_t index) static int i40e_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_vf_representor *representor = ethdev->data->dev_private; @@ -420,7 +422,7 @@ i40e_vf_representor_vlan_pvid_set(struct rte_eth_dev *ethdev, uint16_t vlan_id, representor->vf_id, vlan_id); } -struct eth_dev_ops i40e_representor_dev_ops = { +static const struct eth_dev_ops i40e_representor_dev_ops = { .dev_infos_get = i40e_vf_representor_dev_infos_get, .dev_start = i40e_vf_representor_dev_start, @@ -504,6 +506,7 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) } ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR; + ethdev->data->representor_id = representor->vf_id; /* Setting the number queues allocated to the VF */ ethdev->data->nb_rx_queues = vf->vsi->nb_qps; @@ -523,7 +526,10 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) } int -i40e_vf_representor_uninit(struct rte_eth_dev *ethdev __rte_unused) +i40e_vf_representor_uninit(struct rte_eth_dev *ethdev) { + /* mac_addrs must not be freed because part of i40e_pf_vf */ + ethdev->data->mac_addrs = NULL; + return 0; }