net/bnxt: support 58818 chip family
[dpdk.git] / drivers / net / i40e / i40e_ethdev_vf.c
index 6e6eef5..dc076ae 100644 (file)
@@ -260,7 +260,7 @@ i40evf_read_pfmsg(struct rte_eth_dev *dev, struct i40evf_arq_msg_info *data)
                case VIRTCHNL_EVENT_RESET_IMPENDING:
                        vf->vf_reset = true;
                        vf->pend_msg |= PFMSG_RESET_IMPENDING;
-                       PMD_DRV_LOG(INFO, "vf is reseting");
+                       PMD_DRV_LOG(INFO, "VF is resetting");
                        break;
                case VIRTCHNL_EVENT_PF_DRIVER_CLOSE:
                        vf->dev_closed = true;
@@ -1078,8 +1078,18 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vlanid)
        args.out_buffer = vf->aq_resp;
        args.out_size = I40E_AQ_BUF_SZ;
        err = i40evf_execute_vf_cmd(dev, &args);
-       if (err)
+       if (err) {
                PMD_DRV_LOG(ERR, "fail to execute command OP_ADD_VLAN");
+               return err;
+       }
+       /**
+        * In linux kernel driver on receiving ADD_VLAN it enables
+        * VLAN_STRIP by default. So reconfigure the vlan_offload
+        * as it was done by the app earlier.
+        */
+       err = i40evf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK);
+       if (err)
+               PMD_DRV_LOG(ERR, "fail to set vlan_strip");
 
        return err;
 }
@@ -2406,6 +2416,7 @@ i40evf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
                stats->imissed = pstats->rx_discards;
                stats->oerrors = pstats->tx_errors + pstats->tx_discards;
                stats->ibytes = pstats->rx_bytes;
+               stats->ibytes -= stats->ipackets * RTE_ETHER_CRC_LEN;
                stats->obytes = pstats->tx_bytes;
        } else {
                PMD_DRV_LOG(ERR, "Get statistics failed");