Patch "net: dsa: hellcreek: Calculate checksums in tagger" has been added to the 5.17-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: dsa: hellcreek: Calculate checksums in tagger

to the 5.17-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-dsa-hellcreek-calculate-checksums-in-tagger.patch
and it can be found in the queue-5.17 subdirectory.

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



commit 22577561c49e75a683139ba590a1fb2eaeeb5f49
Author: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx>
Date:   Fri Apr 15 12:33:20 2022 +0200

    net: dsa: hellcreek: Calculate checksums in tagger
    
    [ Upstream commit 0763120b090418a5257402754e22a34227ae5f12 ]
    
    In case the checksum calculation is offloaded to the DSA master network
    interface, it will include the switch trailing tag. As soon as the switch strips
    that tag on egress, the calculated checksum is wrong.
    
    Therefore, add the checksum calculation to the tagger (if required) before
    adding the switch tag. This way, the hellcreek code works with all DSA master
    interfaces regardless of their declared feature set.
    
    Fixes: 01ef09caad66 ("net: dsa: Add tag handling for Hirschmann Hellcreek switches")
    Signed-off-by: Kurt Kanzenbach <kurt@xxxxxxxxxxxxx>
    Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220415103320.90657-1-kurt@xxxxxxxxxxxxx
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/dsa/tag_hellcreek.c b/net/dsa/tag_hellcreek.c
index f64b805303cd..eb204ad36eee 100644
--- a/net/dsa/tag_hellcreek.c
+++ b/net/dsa/tag_hellcreek.c
@@ -21,6 +21,14 @@ static struct sk_buff *hellcreek_xmit(struct sk_buff *skb,
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	u8 *tag;
 
+	/* Calculate checksums (if required) before adding the trailer tag to
+	 * avoid including it in calculations. That would lead to wrong
+	 * checksums after the switch strips the tag.
+	 */
+	if (skb->ip_summed == CHECKSUM_PARTIAL &&
+	    skb_checksum_help(skb))
+		return NULL;
+
 	/* Tag encoding */
 	tag  = skb_put(skb, HELLCREEK_TAG_LEN);
 	*tag = BIT(dp->index);



[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