X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fixgbe%2Fixgbe_vf_representor.c;h=d5b636a1940866db3b8cffbb3f26dffca522f517;hb=b43045eedeebb15354d85babdb84171a1073aa9d;hp=db516d9910b889cc921789d26007ac8784f89892;hpb=266c467f60f14feaa1d6ff56a302978bdf7eff60;p=dpdk.git diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c index db516d9910..d5b636a194 100644 --- a/drivers/net/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c @@ -6,6 +6,7 @@ #include #include +#include "ethdev_driver.h" #include "base/ixgbe_type.h" #include "base/ixgbe_vf.h" #include "ixgbe_ethdev.h" @@ -25,7 +26,7 @@ ixgbe_vf_representor_link_update(struct rte_eth_dev *ethdev, static int ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ixgbe_vf_representor *representor = ethdev->data->dev_private; @@ -34,7 +35,7 @@ ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, representor->vf_id, mac_addr); } -static void +static int ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, struct rte_eth_dev_info *dev_info) { @@ -65,7 +66,7 @@ ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, dev_info->tx_offload_capa = DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM | - DEV_TX_OFFLOAD_TCP_TSO; + DEV_TX_OFFLOAD_TCP_TSO | DEV_TX_OFFLOAD_MULTI_SEGS; /**< Device TX offload capabilities. */ dev_info->speed_capa = @@ -76,6 +77,8 @@ ixgbe_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, representor->pf_ethdev->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 ixgbe_vf_representor_dev_configure( @@ -110,8 +113,9 @@ static int ixgbe_vf_representor_dev_start(__rte_unused struct rte_eth_dev *dev) return 0; } -static void ixgbe_vf_representor_dev_stop(__rte_unused struct rte_eth_dev *dev) +static int ixgbe_vf_representor_dev_stop(__rte_unused struct rte_eth_dev *dev) { + return 0; } static int @@ -135,7 +139,7 @@ ixgbe_vf_representor_vlan_strip_queue_set(struct rte_eth_dev *ethdev, representor->vf_id, on); } -struct eth_dev_ops ixgbe_vf_representor_dev_ops = { +static const struct eth_dev_ops ixgbe_vf_representor_dev_ops = { .dev_infos_get = ixgbe_vf_representor_dev_infos_get, .dev_start = ixgbe_vf_representor_dev_start, @@ -192,6 +196,7 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) return -ENODEV; ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR; + ethdev->data->representor_id = representor->vf_id; /* Set representor device ops */ ethdev->dev_ops = &ixgbe_vf_representor_dev_ops; @@ -210,7 +215,7 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) vf_data = *IXGBE_DEV_PRIVATE_TO_P_VFDATA( representor->pf_ethdev->data->dev_private); - ethdev->data->mac_addrs = (struct ether_addr *) + ethdev->data->mac_addrs = (struct rte_ether_addr *) vf_data[representor->vf_id].vf_mac_addresses; /* Link state. Inherited from PF */ @@ -225,7 +230,10 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) } int -ixgbe_vf_representor_uninit(struct rte_eth_dev *ethdev __rte_unused) +ixgbe_vf_representor_uninit(struct rte_eth_dev *ethdev) { + /* mac_addrs must not be freed because part of ixgbe_vf_info */ + ethdev->data->mac_addrs = NULL; + return 0; }