From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA242C433EF for ; Tue, 12 Jul 2022 22:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbiGLWO5 (ORCPT ); Tue, 12 Jul 2022 18:14:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229933AbiGLWOx (ORCPT ); Tue, 12 Jul 2022 18:14:53 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15693AE3BE for ; Tue, 12 Jul 2022 15:14:52 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id mm6-20020a17090b358600b001ef7bd409b0so4321179pjb.8 for ; Tue, 12 Jul 2022 15:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=y6t3iDm9GwNmjV2vlQyhKcUiXb93GbH2Nv8sz+9x1PM=; b=L+JGxUqk+x+Rvv1+JcEOnvYuGWypPqnYlFtTwCDRfh7+XIaQder6grPJXbYeqAtZBE Pv9osdMol+o8TKB8+Vr3YUJCD1oUKozPs3Xam6Dy8HQyRb/5dMrg0CeWCW7R+Qt4CXJM lFZn5r+oeVG0Gu8FGv5TASPc2LVFtPrlDTOidqIj7rgm1oJjTjHet/kWj2pUtUlMtsW0 0BKehu2K0h0Bfhx/DqvdzmJqktJiAOb3/V8/UI2UDZBmL6uuBPTZTWFoOdNexBeKCIKH 8G+aplAjz1F3qSeVgDkgeYY8m3Jz7xe5mVQn2XJv8DOxSqQ6dLScs2KZozyuhATYISes C7lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=y6t3iDm9GwNmjV2vlQyhKcUiXb93GbH2Nv8sz+9x1PM=; b=SFbwXfeVyNTreqam3dSGmJRCLypF5QRCnoW+whZOCjfEgZoNkrnpq+cCbD62I25Sb8 IrnUQEXciID9YvqXgnBhU0l6qX0xE7vE6mh9xlDUBqbZEYVyFGY60+fdJziCU5CkitHS 2P7ZZr5kOwpTxFPC4ZkGHQCrCepfGiwqgpUNZi0/hLR+WurMdhNkN+6Qq3iv7vEnUuLv 777K0S9XilDOfTLqomzV0KVtZqZ5lsjbpp15Vh2+gxfpheefucSW4tdSsWXSIKUB5Xjq L/C1h2CU07f0dl3C1Mrs8XwqjdZ4g/FTkss4aB16qClohcgiprjZjZflMnfouzpjR3w8 039A== X-Gm-Message-State: AJIora9DejqkQ2IpUh+Zl08piIAXE2NWZrRaefsy00nyV5BEgQv8urWl 5nI7OA0HxpN5jVHL8UkYgFarA6c= X-Google-Smtp-Source: AGRyM1s4iuYht14q6gFZMO3RWTR0QLcs3KatATGI4cdY3BULRTru2/uKD1hdqS40x4ACgE6WxjSz52E= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a17:902:e80a:b0:16c:3e68:bbe1 with SMTP id u10-20020a170902e80a00b0016c3e68bbe1mr148045plg.85.1657664091611; Tue, 12 Jul 2022 15:14:51 -0700 (PDT) Date: Tue, 12 Jul 2022 15:14:50 -0700 In-Reply-To: <20220712175837.16267-1-andrea.mayer@uniroma2.it> Message-Id: Mime-Version: 1.0 References: <20220712175837.16267-1-andrea.mayer@uniroma2.it> Subject: Re: [net 0/3] seg6: fix skb checksum for SRH encapsulation/insertion From: sdf@google.com To: Andrea Mayer Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hideaki YOSHIFUJI , David Ahern , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , David Lebrun , Mathieu Xhonneux , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Stefano Salsano , Paolo Lungaroni , Ahmed Abdelsalam , Anton Makarov Content-Type: text/plain; charset="UTF-8"; format=flowed; delsp=yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12, Andrea Mayer wrote: > The Linux kernel supports Segment Routing Header (SRH) > encapsulation/insertion operations by providing the capability to: i) > encapsulate a packet in an outer IPv6 header with a specified SRH; ii) > insert a specified SRH directly after the IPv6 header of the packet. > Note that the insertion operation is also referred to as 'injection'. > The two operations are respectively supported by seg6_do_srh_encap() and > seg6_do_srh_inline(), which operate on the skb associated to the packet as > needed (e.g. adding the necessary headers and initializing them, while > taking care to recalculate the skb checksum). > seg6_do_srh_encap() and seg6_do_srh_inline() do not initialize the payload > length of the IPv6 header, which is carried out by the caller functions. > However, this approach causes the corruption of the skb checksum which > needs to be updated only after initialization of headers is completed > (thanks to Paolo Abeni for detecting this issue). > The patchset fixes the skb checksum corruption by moving the IPv6 header > payload length initialization from the callers of seg6_do_srh_encap() and > seg6_do_srh_inline() directly into these functions. > This patchset is organized as follows: > - patch 1/3, seg6: fix skb checksum evaluation in SRH > encapsulation/insertion; > (* SRH encapsulation/insertion available since v4.10) > - patch 2/3, seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps > behaviors; > (* SRv6 End.B6 and End.B6.Encaps behaviors available since v4.14) > - patch 3/3, seg6: bpf: fix skb checksum in bpf_push_seg6_encap(); > (* bpf IPv6 Segment Routing helpers available since v4.18) BPF changes make sense. I've tested them by applying the whole series and running test_lwt_seg6local.sh. Reviewed-by: Stanislav Fomichev Tested-by: Stanislav Fomichev > Thank you all, > Andrea > Andrea Mayer (3): > seg6: fix skb checksum evaluation in SRH encapsulation/insertion > seg6: fix skb checksum in SRv6 End.B6 and End.B6.Encaps behaviors > seg6: bpf: fix skb checksum in bpf_push_seg6_encap() > net/core/filter.c | 1 - > net/ipv6/seg6_iptunnel.c | 5 ++++- > net/ipv6/seg6_local.c | 2 -- > 3 files changed, 4 insertions(+), 4 deletions(-) > -- > 2.20.1