net: add rte prefix to ether structures
[dpdk.git] / drivers / net / i40e / i40e_vf_representor.c
index 8dc94b4..633dca6 100644 (file)
@@ -48,6 +48,7 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev,
                DEV_RX_OFFLOAD_UDP_CKSUM |
                DEV_RX_OFFLOAD_TCP_CKSUM;
        dev_info->tx_offload_capa =
+               DEV_TX_OFFLOAD_MULTI_SEGS  |
                DEV_TX_OFFLOAD_VLAN_INSERT |
                DEV_TX_OFFLOAD_QINQ_INSERT |
                DEV_TX_OFFLOAD_IPV4_CKSUM |
@@ -323,7 +324,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;
 
@@ -378,7 +379,8 @@ i40e_vf_representor_vlan_offload_set(struct rte_eth_dev *ethdev, int mask)
 
        if (mask & ETH_VLAN_FILTER_MASK) {
                /* Enable or disable VLAN filtering offload */
-               if (ethdev->data->dev_conf.rxmode.hw_vlan_filter)
+               if (ethdev->data->dev_conf.rxmode.offloads &
+                   DEV_RX_OFFLOAD_VLAN_FILTER)
                        return i40e_vsi_config_vlan_filter(vsi, TRUE);
                else
                        return i40e_vsi_config_vlan_filter(vsi, FALSE);
@@ -386,7 +388,8 @@ i40e_vf_representor_vlan_offload_set(struct rte_eth_dev *ethdev, int mask)
 
        if (mask & ETH_VLAN_STRIP_MASK) {
                /* Enable or disable VLAN stripping offload */
-               if (ethdev->data->dev_conf.rxmode.hw_vlan_strip)
+               if (ethdev->data->dev_conf.rxmode.offloads &
+                   DEV_RX_OFFLOAD_VLAN_STRIP)
                        return i40e_vsi_config_vlan_stripping(vsi, TRUE);
                else
                        return i40e_vsi_config_vlan_stripping(vsi, FALSE);
@@ -417,7 +420,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,
@@ -484,9 +487,6 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
        if (representor->vf_id >= pf->vf_num)
                return -ENODEV;
 
-       /** representor shares the same driver as it's PF device */
-       ethdev->device->driver = representor->adapter->eth_dev->device->driver;
-
        /* Set representor device ops */
        ethdev->dev_ops = &i40e_representor_dev_ops;
 
@@ -504,6 +504,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 +524,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;
 }