Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da2faffc authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: stmmac: disable CRC stripping in SW"

parents fc20998d ef454a95
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -603,6 +603,7 @@ struct mac_device_info {
	unsigned int pmt;
	unsigned int ps;
	unsigned int crc_strip_en;
	unsigned int acs_strip_en;
};

struct stmmac_rx_routing {
+5 −0
Original line number Diff line number Diff line
@@ -93,6 +93,11 @@ static int dwmac4_wrback_get_rx_status(void *data, struct stmmac_extra_stats *x,
	if (likely(!(rdes3 & RDES3_LAST_DESCRIPTOR)))
		return discard_frame;

	if (unlikely(!(rdes3 & RDES3_PACKET_LEN_TYPE_MASK))) {
		pr_info("rdes3 = 0xX\n", rdes3);
		ret = llc_snap;
	}

	if (unlikely(rdes3 & RDES3_ERROR_SUMMARY)) {
		if (unlikely(rdes3 & RDES3_GIANT_PACKET))
			stats->rx_length_errors++;
+8 −2
Original line number Diff line number Diff line
@@ -2626,6 +2626,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
		}
	}
	priv->hw->crc_strip_en = priv->plat->crc_strip_en;
	priv->hw->acs_strip_en = 0;

	/* Initialize the MAC Core */
	priv->hw->mac->core_init(priv->hw, dev);
@@ -3608,8 +3609,13 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
			 * feature is always disabled and packets need to be
			 * stripped manually.
			 */
			if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
			    unlikely(status != llc_snap))
			if ((likely(priv->synopsys_id >= DWMAC_CORE_4_00) &&
			     ((unlikely(!priv->hw->crc_strip_en) &&
			       status != llc_snap) ||
			      (unlikely(!priv->hw->acs_strip_en) &&
			       status == llc_snap))) ||
			    (unlikely(priv->synopsys_id < DWMAC_CORE_4_00) &&
			     unlikely(status != llc_snap)))
				frame_len -= ETH_FCS_LEN;

			if (netif_msg_rx_status(priv)) {