From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E77524176; Wed, 12 Jul 2023 20:09:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 339B2C433C7; Wed, 12 Jul 2023 20:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689192596; bh=0tjYlRq1YbzrHKoKvcbNWiR3wUPzfcuxoNmZjxC+l0I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WoivpRErrsDBluPlX0jY/8PXOX9W2WlcAfkRrWPswNJ3agrzwqTdLAvC+zm8oeNHT 4pOE4jkvhsDTW+0UxRHaPFWt4K9s7KWvAfSuFDPel4vc7p8v357d35BdUJUL/93e0S AALRkqGCohFV82lVKFvTdOf5a+WHG/v5BKjZLJ/fKDrW4v5tYYo7gAXqg+7LBCkAP8 07Gx7sLQsGZ4PHE8RlKaheARxZkLovxMf+dQuhj8CCkjCYlSPJiZtbPoJrAonx4xEa /+J3ssCBRM2PeKnrDzeWHjQFNmrWZrZe6NuXqCN/D6BnX/TBceKkTqJ97bI4ODdKCM m1ZHUB2koNP0w== Date: Wed, 12 Jul 2023 13:09:54 -0700 From: Jakub Kicinski To: Alexei Starovoitov Cc: Willem de Bruijn , Stanislav Fomichev , bpf , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , Toke =?UTF-8?B?SMO4?= =?UTF-8?B?aWxhbmQtSsO4cmdlbnNlbg==?= , Willem de Bruijn , David Ahern , "Karlsson, Magnus" , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , "Fijalkowski, Maciej" , Jesper Dangaard Brouer , Network Development , xdp-hints@xdp-project.net Subject: Re: [RFC bpf-next v3 09/14] net/mlx5e: Implement devtx kfuncs Message-ID: <20230712130954.7c8dc5ef@kernel.org> In-Reply-To: References: <20230707193006.1309662-10-sdf@google.com> <20230711225657.kuvkil776fajonl5@MacBook-Pro-8.local> <20230712190342.dlgwh6uka5bcjfkl@macbook-pro-8.dhcp.thefacebook.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 12 Jul 2023 12:42:35 -0700 Alexei Starovoitov wrote: > > Basically, add to AF_XDP what we already have for its predecessor > > AF_PACKET: setsockopt PACKET_VNET_HDR? > > > > Possibly with a separate new struct, rather than virtio_net_hdr. As > > that has dependencies on other drivers, notably virtio and its > > specification process. =20 >=20 > yeah. Forgot about this one. > That's a perfect fit. I would reuse virtio_net_hdr as-is. > Why reinvent the wheel? > It would force uapi, but some might argue it's a good thing. I was gonna reply on the other leg of the thread but it sounds like we're in agreement now? =F0=9F=91=8F=EF=B8=8F virtio_net_hdr is the kind o= f generic descriptor I had in mind. I'd suggest breaking hdr_len into L2len, L3len and L4len, tho. How does virtio do IP length updates during TSO if it doesn't know where L3 starts? HW will want to know, and it's easy to add them together in cases where it doesn't. Which is why I kept saying "packet geometry" rather than pointing at virtio_net_hdr.