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 X-Spam-Level: X-Spam-Status: No, score=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9194C4338F for ; Fri, 20 Aug 2021 15:42:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5FE260FE6 for ; Fri, 20 Aug 2021 15:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241034AbhHTPnM (ORCPT ); Fri, 20 Aug 2021 11:43:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:33996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241240AbhHTPnJ (ORCPT ); Fri, 20 Aug 2021 11:43:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6D0A6103C; Fri, 20 Aug 2021 15:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629474151; bh=hyQ5oUK2g5LJ1uB0M3VyqPpmL20XIKOGHR2YsZfWqOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKLiC1UsQVku1fO2uTwKkKovq5s7qHYPZzl1rQpJkragO6Cc1gkuQdqQD6kYqCbaS g9kEw0r6RIYrnD7J95ViE+c9gclRzeQaDPBkqB+SjfqI5IrC8dvHl9axi1WgEZZunD 6vcXafY3rC4b9uzdvB5L1d7mb0bSLTRMBMpGClawgZoVHSjkK1i/wLDMg26Ez5zUmR z8LtkKD84iaJmpeIEPCP76KZpXYyGxyUCl4ilZ/fPp1y5QkXuEsj8dlJV3e90dlCuR VxUHNoSKt2vexsOFWi1Vr2pnKkRmE8FRcmtTY58sq2+mBWLpou9DuGOIvVeqYs1ujt sbkGFOJe06A0A== From: Lorenzo Bianconi To: bpf@vger.kernel.org, netdev@vger.kernel.org Cc: lorenzo.bianconi@redhat.com, davem@davemloft.net, kuba@kernel.org, ast@kernel.org, daniel@iogearbox.net, shayagr@amazon.com, john.fastabend@gmail.com, dsahern@kernel.org, brouer@redhat.com, echaudro@redhat.com, jasowang@redhat.com, alexander.duyck@gmail.com, saeed@kernel.org, maciej.fijalkowski@intel.com, magnus.karlsson@intel.com, tirthendu.sarkar@intel.com, toke@redhat.com Subject: [PATCH v12 bpf-next 01/18] net: skbuff: add size metadata to skb_shared_info for xdp Date: Fri, 20 Aug 2021 17:40:14 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Introduce xdp_frags_tsize field in skb_shared_info data structure to store xdp_buff/xdp_frame truesize (xdp_frags_tsize will be used in xdp multi-buff support). In order to not increase skb_shared_info size we will use a hole due to skb_shared_info alignment. Introduce xdp_frags_size field in skb_shared_info data structure reusing gso_type field in order to store xdp_buff/xdp_frame paged size. xdp_frags_size will be used in xdp multi-buff support. Signed-off-by: Lorenzo Bianconi --- include/linux/skbuff.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6bdb0db3e825..1abeba7ef82e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -522,13 +522,17 @@ struct skb_shared_info { unsigned short gso_segs; struct sk_buff *frag_list; struct skb_shared_hwtstamps hwtstamps; - unsigned int gso_type; + union { + unsigned int gso_type; + unsigned int xdp_frags_size; + }; u32 tskey; /* * Warning : all fields before dataref are cleared in __alloc_skb() */ atomic_t dataref; + unsigned int xdp_frags_tsize; /* Intermediate layers must ensure that destructor_arg * remains valid until skb destructor */ -- 2.31.1