net/mlx5: add VXLAN to flow prepare routine
[dpdk.git] / drivers / net / ixgbe / ixgbe_vf_representor.c
index 8f8af49..5d2e3e0 100644 (file)
@@ -65,7 +65,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 =
@@ -135,7 +135,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,
@@ -153,6 +153,20 @@ struct eth_dev_ops ixgbe_vf_representor_dev_ops = {
        .mac_addr_set           = ixgbe_vf_representor_mac_addr_set,
 };
 
+static uint16_t
+ixgbe_vf_representor_rx_burst(__rte_unused void *rx_queue,
+       __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
+{
+       return 0;
+}
+
+static uint16_t
+ixgbe_vf_representor_tx_burst(__rte_unused void *tx_queue,
+       __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
+{
+       return 0;
+}
+
 int
 ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params)
 {
@@ -178,13 +192,16 @@ 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;
 
-       /* No data-path so no RX/TX functions */
-       ethdev->rx_pkt_burst = NULL;
-       ethdev->tx_pkt_burst = NULL;
+       /* No data-path, but need stub Rx/Tx functions to avoid crash
+        * when testing with the likes of testpmd.
+        */
+       ethdev->rx_pkt_burst = ixgbe_vf_representor_rx_burst;
+       ethdev->tx_pkt_burst = ixgbe_vf_representor_tx_burst;
 
        /* Setting the number queues allocated to the VF */
        ethdev->data->nb_rx_queues = IXGBE_VF_MAX_RX_QUEUES;
@@ -209,7 +226,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;
 }