ethdev: add new offload flag to keep CRC
[dpdk.git] / drivers / net / i40e / i40e_ethdev_vf.c
index b9dea2e..5ee0e36 100644 (file)
@@ -1536,7 +1536,7 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
        /* For non-DPDK PF drivers, VF has no ability to disable HW
         * CRC strip, and is implicitly enabled by the PF.
         */
-       if (!(conf->rxmode.offloads & DEV_RX_OFFLOAD_CRC_STRIP)) {
+       if (rte_eth_dev_must_keep_crc(conf->rxmode.offloads)) {
                vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
                if ((vf->version_major == VIRTCHNL_VERSION_MAJOR) &&
                    (vf->version_minor <= VIRTCHNL_VERSION_MINOR)) {
@@ -2182,7 +2182,6 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
        struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
-       memset(dev_info, 0, sizeof(*dev_info));
        dev_info->max_rx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
@@ -2200,7 +2199,10 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_RX_OFFLOAD_TCP_CKSUM |
                DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM |
                DEV_RX_OFFLOAD_CRC_STRIP |
-               DEV_RX_OFFLOAD_SCATTER;
+               DEV_RX_OFFLOAD_KEEP_CRC |
+               DEV_RX_OFFLOAD_SCATTER |
+               DEV_RX_OFFLOAD_JUMBO_FRAME |
+               DEV_RX_OFFLOAD_VLAN_FILTER;
 
        dev_info->tx_queue_offload_capa = 0;
        dev_info->tx_offload_capa =
@@ -2215,7 +2217,8 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
                DEV_TX_OFFLOAD_GRE_TNL_TSO |
                DEV_TX_OFFLOAD_IPIP_TNL_TSO |
-               DEV_TX_OFFLOAD_GENEVE_TNL_TSO;
+               DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
+               DEV_TX_OFFLOAD_MULTI_SEGS;
 
        dev_info->default_rxconf = (struct rte_eth_rxconf) {
                .rx_thresh = {
@@ -2287,6 +2290,14 @@ i40evf_dev_close(struct rte_eth_dev *dev)
 
        i40evf_dev_stop(dev);
        i40e_dev_free_queues(dev);
+       /*
+        * disable promiscuous mode before reset vf
+        * it is a workaround solution when work with kernel driver
+        * and it is not the normal way
+        */
+       i40evf_dev_promiscuous_disable(dev);
+       i40evf_dev_allmulticast_disable(dev);
+
        i40evf_reset_vf(hw);
        i40e_shutdown_adminq(hw);
        /* disable uio intr before callback unregister */