Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp412641pxb; Thu, 17 Feb 2022 06:50:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJySPvDSD/ZwnbJya9bbaHHJayh0LEArKOArygWU1+jQhuyV2aZB71cOgZhK1ZlJi71Iyx4j X-Received: by 2002:a17:906:6c8f:b0:6cf:95c:5d78 with SMTP id s15-20020a1709066c8f00b006cf095c5d78mr2638528ejr.74.1645109433925; Thu, 17 Feb 2022 06:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645109433; cv=none; d=google.com; s=arc-20160816; b=Y8TywheQUvn7uygQoNWMfaac50ERHlvhDXfZTzjQEQqoW2nwXIZTRF1dmzZKk3vd9C oReMH+nBSj2YO9Cp5vEp5F4anyTmHvIcbVeNVGhplZFlR08y8nbLzw04RHR47DTsj7vj I4zUKSbmF0WClKorr/jX40SdYofW5AvcMwlkQF75JmEDtAoeGtWS/pFlw0hrpoVqJrEC a6gxBAAGtjrYhSRW3QIC8VjLcmDrQQP7TLIilCFZ4g+eWMRYZ8/6DhrTa4eSb5dxOZYY baflLaSNpeWd/6u6S53qr/XWHbCYq/A5B3lCgTtAbKtzYnktyhtoDQyG9su5q4l6IsJU KDnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=l/VQgLhh1DBOYffBqGYngony3TZbnaAH3gw4sPL+y8Y=; b=V6YjvqrunXDulr6Kp+iNxfXVE8sahrGbVXsUx5QGxIgEtJq3v7PHIHdY3oELwaflhx 96Zgh+pGWJH20eSLy8iUJXoEmvv+DlAKJMXV7lCQBtSNbW4+5awwvA72lC+NNtewGWyZ kNT76B3hAb3EKwkaDACyWiQp/A+xgpvYhlv+51saiExJjZntjhqoBHCjk0xxAoItftx8 /E4IdihG18KVE+bOQhX8EhHEa0YWj2ID//2Yp3IiVmwjKT7FSGNkjqh/DEUCBSfKZ/dQ Rr+kviUmjzqOUy28ZAoJroSOEzUPKgqZrpE1C6SAhO9Ou8OV/JmYa/991v3Y5muhYVyn wLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THEdw38v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp33si964865ejc.676.2022.02.17.06.50.10; Thu, 17 Feb 2022 06:50:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=THEdw38v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233223AbiBQIpu (ORCPT + 99 others); Thu, 17 Feb 2022 03:45:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238037AbiBQIpr (ORCPT ); Thu, 17 Feb 2022 03:45:47 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A6EF2221B2 for ; Thu, 17 Feb 2022 00:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645087532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/VQgLhh1DBOYffBqGYngony3TZbnaAH3gw4sPL+y8Y=; b=THEdw38vzB0QWr4jHcxHN+OaOpdlOkXAwUgJbz0PFhdOFvTd7Peg6Z9BVjnBoC8DElB8V1 S/zG6gEwFUhy/PVPBynXGnn2tWYNL7XqZAAKk/0/sHS1u6t2l+KRbobbJb6z/Mb/7QIj83 Es249uGRRbdMgKDYdUXZpNiVbXBgZc4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-3pUNpWmmOY-7BjTJ1kT9Ew-1; Thu, 17 Feb 2022 03:45:30 -0500 X-MC-Unique: 3pUNpWmmOY-7BjTJ1kT9Ew-1 Received: by mail-wm1-f72.google.com with SMTP id r8-20020a7bc088000000b0037bbf779d26so1374168wmh.7 for ; Thu, 17 Feb 2022 00:45:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=l/VQgLhh1DBOYffBqGYngony3TZbnaAH3gw4sPL+y8Y=; b=OHAw3FjTW3AJ55i9zRmstwunGRujewDdv+/C/CKrODgHsFrFAVp40BsuHtulOxrBwM Xv9kdaP+mSaqFczokVrTfqlyygjnkOrUmZQRgeG3pQDzUqkVaRBloWSZ79f7/+nqyPkE fUlDddWEhSPbaqhzzLbjw/GvjEqOxORYGYcRv/Jg9KNZnRZE3NHgR2S1VtQ7gjZbaap6 VUoJVtfY9wGz0WzU8Kf47rCRXoz5sv69aR+TH5fYwJxN7Flywg3otcaXk4NfIdcnGqk6 wnTxoAgpufH7TFdPTZ0kzJ150aBCG8u2j0ukAVDXk+AhaXWpZbAK53/vStCjzwMQec4a nqBQ== X-Gm-Message-State: AOAM530AFDTEyLadhOpDAx5ASPnndrQtq6LTKpP54aWj2Qx3BZEGMZva QP42MNRknjxpNPLvOruk/t6+Ronf89EsswULsu5uozVmlERBFrLGepL2oc3orLn+kHMtqH/Ezpk 591bdaup5WslDThSswRK/eQtb X-Received: by 2002:a05:600c:4e0a:b0:37b:c548:622a with SMTP id b10-20020a05600c4e0a00b0037bc548622amr5359169wmq.55.1645087529261; Thu, 17 Feb 2022 00:45:29 -0800 (PST) X-Received: by 2002:a05:600c:4e0a:b0:37b:c548:622a with SMTP id b10-20020a05600c4e0a00b0037bc548622amr5359148wmq.55.1645087529037; Thu, 17 Feb 2022 00:45:29 -0800 (PST) Received: from gerbillo.redhat.com (146-241-112-206.dyn.eolo.it. [146.241.112.206]) by smtp.gmail.com with ESMTPSA id z7sm492824wml.40.2022.02.17.00.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 00:45:28 -0800 (PST) Message-ID: <41a3e6e4f9331c6a0a62fe838fc6f9084a5c89bc.camel@redhat.com> Subject: Re: [PATCH v3] net: fix wrong network header length From: Paolo Abeni To: Lina Wang , "David S . Miller" , Jakub Kicinski , Matthias Brugger , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: Network Development , LKML , linux-arm-kernel , bpf , Maciej =?UTF-8?Q?=C5=BBenczykowski?= , Willem de Bruijn , Eric Dumazet Date: Thu, 17 Feb 2022 09:45:27 +0100 In-Reply-To: <20220217070139.30028-1-lina.wang@mediatek.com> References: <20220217070139.30028-1-lina.wang@mediatek.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.3 (3.42.3-1.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, 2022-02-17 at 15:01 +0800, Lina Wang wrote: > On Wed, 2022-02-16 at 19:05 -0800, Alexei Starovoitov wrote: > > On Tue, Feb 15, 2022 at 11:37 PM Lina Wang > > wrote: > > > > > > When clatd starts with ebpf offloaing, and NETIF_F_GRO_FRAGLIST is > > > enable, > > > several skbs are gathered in skb_shinfo(skb)->frag_list. The first > > > skb's > > > ipv6 header will be changed to ipv4 after bpf_skb_proto_6_to_4, > > > network_header\transport_header\mac_header have been updated as > > > ipv4 acts, > > > but other skbs in frag_list didnot update anything, just ipv6 > > > packets. > > > > Please add a test that demonstrates the issue and verifies the fix. > > I used iperf udp test to verify the patch, server peer enabled -d to debug > received packets. > > 192.0.0.4 is clatd interface ip, corresponding ipv6 addr is > 2000:1:1:1:afca:1b1f:1a9:b367, server peer ip is 1.1.1.1, > whose ipv6 is 2004:1:1:1::101:101. > > Without the patch, when udp length 2840 packets received, iperf shows: > pcount 1 packet_count 0 > pcount 27898727 packet_count 1 > pcount 3 packet_count 27898727 > > pcount should be 2, but is 27898727(0x1a9b367) , which is 20 bytes put > forward. > > 12:08:02.680299 Unicast to us 2004:1:1:1::101:101 2000:1:1:1:afca:1b1f:1a9:b367 UDP 51196 → 5201 Len=2840 > 0000 20 00 00 01 00 01 00 01 af ca 1b 1f 01 a9 b3 67 ipv6 dst address > 0000 c7 fc 14 51 0b 20 c7 ab udp header > 0000 00 00 00 ab 00 0e f3 49 00 00 00 01 08 06 69 d2 00000001 is pcount > 12:08:02.682084 Unicast to us 1.1.1.1 192.0.0.4 UDP 51196 → 5201 Len=2840 > > After applied the patch, there is no OOO, pcount acted in order. To clarify: Alexei is asking to add a test under: tools/testing/selftests/net/ to cover this specific case. You can propbably extend the existing udpgro_fwd.sh. Please explicitly CC people who gave feedback to previous iterations, it makes easier to track the discussion. /P