Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / intel / ice / ice_lib.c
index 31c11ec..65e1420 100644 (file)
@@ -1563,6 +1563,22 @@ void ice_vsi_manage_rss_lut(struct ice_vsi *vsi, bool ena)
 }
 
 /**
+ * ice_vsi_cfg_crc_strip - Configure CRC stripping for a VSI
+ * @vsi: VSI to be configured
+ * @disable: set to true to have FCS / CRC in the frame data
+ */
+void ice_vsi_cfg_crc_strip(struct ice_vsi *vsi, bool disable)
+{
+       int i;
+
+       ice_for_each_rxq(vsi, i)
+               if (disable)
+                       vsi->rx_rings[i]->flags |= ICE_RX_FLAGS_CRC_STRIP_DIS;
+               else
+                       vsi->rx_rings[i]->flags &= ~ICE_RX_FLAGS_CRC_STRIP_DIS;
+}
+
+/**
  * ice_vsi_cfg_rss_lut_key - Configure RSS params for a VSI
  * @vsi: VSI to be configured
  */
@@ -3277,6 +3293,12 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, bool init_vsi)
                         */
                        if (test_bit(ICE_FLAG_RSS_ENA, pf->flags))
                                ice_vsi_cfg_rss_lut_key(vsi);
+
+               /* disable or enable CRC stripping */
+               if (vsi->netdev)
+                       ice_vsi_cfg_crc_strip(vsi, !!(vsi->netdev->features &
+                                             NETIF_F_RXFCS));
+
                break;
        case ICE_VSI_VF:
                ret = ice_vsi_alloc_q_vectors(vsi);