Patch "net: bcmgenet: use hardware padding of runt frames" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: bcmgenet: use hardware padding of runt frames

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-bcmgenet-use-hardware-padding-of-runt-frames.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0ac22e2588fa954d77753a09dc8b64d38262e70d
Author: Doug Berger <opendmb@xxxxxxxxx>
Date:   Wed Jun 24 18:14:55 2020 -0700

    net: bcmgenet: use hardware padding of runt frames
    
    [ Upstream commit 20d1f2d1b024f6be199a3bedf1578a1d21592bc5 ]
    
    When commit 474ea9cafc45 ("net: bcmgenet: correctly pad short
    packets") added the call to skb_padto() it should have been
    located before the nr_frags parameter was read since that value
    could be changed when padding packets with lengths between 55
    and 59 bytes (inclusive).
    
    The use of a stale nr_frags value can cause corruption of the
    pad data when tx-scatter-gather is enabled. This corruption of
    the pad can cause invalid checksum computation when hardware
    offload of tx-checksum is also enabled.
    
    Since the original reason for the padding was corrected by
    commit 7dd399130efb ("net: bcmgenet: fix skb_len in
    bcmgenet_xmit_single()") we can remove the software padding all
    together and make use of hardware padding of short frames as
    long as the hardware also always appends the FCS value to the
    frame.
    
    Fixes: 474ea9cafc45 ("net: bcmgenet: correctly pad short packets")
    Signed-off-by: Doug Berger <opendmb@xxxxxxxxx>
    Acked-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 3d3b1005d0761..03f82786c0b98 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -1591,11 +1591,6 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
 		goto out;
 	}
 
-	if (skb_padto(skb, ETH_ZLEN)) {
-		ret = NETDEV_TX_OK;
-		goto out;
-	}
-
 	/* Retain how many bytes will be sent on the wire, without TSB inserted
 	 * by transmit checksum offload
 	 */
@@ -1644,6 +1639,9 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
 		len_stat = (size << DMA_BUFLENGTH_SHIFT) |
 			   (priv->hw_params->qtag_mask << DMA_TX_QTAG_SHIFT);
 
+		/* Note: if we ever change from DMA_TX_APPEND_CRC below we
+		 * will need to restore software padding of "runt" packets
+		 */
 		if (!i) {
 			len_stat |= DMA_TX_APPEND_CRC | DMA_SOP;
 			if (skb->ip_summed == CHECKSUM_PARTIAL)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux