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 25476C43217 for ; Sat, 27 Nov 2021 03:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352103AbhK0DoZ (ORCPT ); Fri, 26 Nov 2021 22:44:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbhK0DmY (ORCPT ); Fri, 26 Nov 2021 22:42:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0990EC08ECA9; Fri, 26 Nov 2021 18:32:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C300060B0C; Sat, 27 Nov 2021 02:32:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2850DC53FC9; Sat, 27 Nov 2021 02:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637980342; bh=k8LPEgdOrY1JwBzenXCurgiwoYPg9UZhK//hAysuHbY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QyUuswkQ+eRwMDpaAxk+9wHrqAQtw8Za8PaRwO8j5EQU2tilOgrI7TmGd/oYtQ0Tr 6bhZcLjDpSAp8hyJQB+v/kjIelFjFgai9/LgZSrxuNs+4lwAuZzPh9bCQiX9tojwoZ gNIAKi1krvekP15uVvzSoSYgngMJRi3jVu5eO/pz9LcDcymCBj7HZeV0vqkM9+1PcC boiD+qRiOgCWDTO8vWi/QYP24t6/s1ecbPdro08wGYXPQUdw6guyKJcw77kXaY8BJR 9wpxi4ySxl30aHZs0Dk0KpE4CIlJ+IQ/Q8hrF/d/hb8d7sYh+2KlCi1KugSfyv9dW/ n+2jH4HDiFp4g== Received: by mail-yb1-f176.google.com with SMTP id f186so24722168ybg.2; Fri, 26 Nov 2021 18:32:22 -0800 (PST) X-Gm-Message-State: AOAM533dgzq9f6UkKEgFp8Q/PvBaURux/i3xUNHccl1ow0T6Zt5w69z1 aQziXWIO6I5MKB/4DXtaNi/kRiEnnd4Hwh5NJx0= X-Google-Smtp-Source: ABdhPJwWnYS34Lk4+MdywnVNl1ggmxTzMSgFmz1hcYDbfnrnw37rp1Dxgp2qjPYdfrN6sh5bYfHyYF9rlBIPcm1XVuM= X-Received: by 2002:a25:324d:: with SMTP id y74mr20085550yby.526.1637980341173; Fri, 26 Nov 2021 18:32:21 -0800 (PST) MIME-Version: 1.0 References: <20211123230632.1503854-1-zenczykowski@gmail.com> In-Reply-To: <20211123230632.1503854-1-zenczykowski@gmail.com> From: Song Liu Date: Fri, 26 Nov 2021 18:32:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next] net-bpf: bpf_skb_change_proto() - add support for ipv6 fragments To: =?UTF-8?Q?Maciej_=C5=BBenczykowski?= Cc: =?UTF-8?Q?Maciej_=C5=BBenczykowski?= , Alexei Starovoitov , Daniel Borkmann , Linux Network Development Mailing List , Linux Kernel Mailing List , BPF Mailing List , "David S . Miller" , Lorenzo Colitti Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 23, 2021 at 3:06 PM Maciej =C5=BBenczykowski wrote: > > From: Maciej =C5=BBenczykowski > > IPv4 fragments (20 byte IPv4 header) need to be translated to/from > IPv6 fragments (40 byte IPv6 header with additional 8 byte IPv6 > fragmentation header). > > This allows this to be done by adding an extra flag BPF_F_IPV6_FRAGMENT > to bpf_skb_change_proto(). > > I think this is already technically achievable via the use of > bpf_skb_adjust_room() which was added in v4.12 commit 2be7e212d541, > but this is far easier to use and eliminates the need to call two > helper functions, so it's also faster. > > Cc: Lorenzo Colitti > Signed-off-by: Maciej =C5=BBenczykowski Please add a selftest to exercise the new flag. Thanks, Song