From: Christian Hopps <chopps@chopps.org>
To: Steffen Klassert <steffen.klassert@secunet.com>
Cc: Christian Hopps <chopps@chopps.org>,
devel@linux-ipsec.org, netdev@vger.kernel.org,
Florian Westphal <fw@strlen.de>,
Sabrina Dubroca <sd@queasysnail.net>,
Simon Horman <horms@kernel.org>,
Antony Antony <antony@phenome.org>,
Christian Hopps <chopps@labn.net>
Subject: Re: [PATCH ipsec-next v12 14/16] xfrm: iptfs: add skb-fragment sharing code
Date: Sat, 02 Nov 2024 16:26:35 +0000 [thread overview]
Message-ID: <m2msihiou0.fsf@chopps.org> (raw)
In-Reply-To: <ZxYvWDFrdSMn8iVF@gauss3.secunet.de>
[-- Attachment #1: Type: text/plain, Size: 1944 bytes --]
Steffen Klassert <steffen.klassert@secunet.com> writes:
> On Mon, Oct 07, 2024 at 09:59:26AM -0400, Christian Hopps wrote:
>> From: Christian Hopps <chopps@labn.net>
>>
>> Avoid copying the inner packet data by sharing the skb data fragments
>> from the output packet skb into new inner packet skb.
>>
>> Signed-off-by: Christian Hopps <chopps@labn.net>
>> ---
>> net/xfrm/xfrm_iptfs.c | 312 ++++++++++++++++++++++++++++++++++++++++--
>> 1 file changed, 304 insertions(+), 8 deletions(-)
>>
>> diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
>> index 4c95656d7492..ef4c23159471 100644
>> --- a/net/xfrm/xfrm_iptfs.c
>> +++ b/net/xfrm/xfrm_iptfs.c
>> @@ -81,6 +81,9 @@
>> #define XFRM_IPTFS_MIN_L3HEADROOM 128
>> #define XFRM_IPTFS_MIN_L2HEADROOM (L1_CACHE_BYTES > 64 ? 64 : 64 + 16)
>>
>> +/* Min to try to share outer iptfs skb data vs copying into new skb */
>> +#define IPTFS_PKT_SHARE_MIN 129
>> +
>> #define NSECS_IN_USEC 1000
>>
>> #define IPTFS_HRTIMER_MODE HRTIMER_MODE_REL_SOFT
>> @@ -236,10 +239,261 @@ static void iptfs_skb_head_to_frag(const struct sk_buff *skb, skb_frag_t *frag)
>> skb_frag_fill_page_desc(frag, page, skb->data - addr, skb_headlen(skb));
>> }
>>
>> +/**
>> + * struct iptfs_skb_frag_walk - use to track a walk through fragments
>> + * @fragi: current fragment index
>> + * @past: length of data in fragments before @fragi
>> + * @total: length of data in all fragments
>> + * @nr_frags: number of fragments present in array
>> + * @initial_offset: the value passed in to skb_prepare_frag_walk()
>> + * @pp_recycle: copy of skb->pp_recycle
>> + * @frags: the page fragments inc. room for head page
>> + */
>> +struct iptfs_skb_frag_walk {
>> + u32 fragi;
>> + u32 past;
>> + u32 total;
>> + u32 nr_frags;
>> + u32 initial_offset;
>> + bool pp_recycle;
>
> This boll creates a 3 byte hole. Better to put it to the end.
Moved.
Thanks,
Chris.
>> + skb_frag_t frags[MAX_SKB_FRAGS + 1];
>> +};
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
next prev parent reply other threads:[~2024-11-02 16:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 13:59 [PATCH ipsec-next v12 00/16] Add IP-TFS mode to xfrm Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 01/16] xfrm: config: add CONFIG_XFRM_IPTFS Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 02/16] include: uapi: add ip_tfs_*_hdr packet formats Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 03/16] include: uapi: add IPPROTO_AGGFRAG for AGGFRAG in ESP Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 04/16] xfrm: netlink: add config (netlink) options Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 05/16] xfrm: add mode_cbs module functionality Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 06/16] xfrm: add generic iptfs defines and functionality Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 07/16] xfrm: iptfs: add new iptfs xfrm mode impl Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 08/16] xfrm: iptfs: add user packet (tunnel ingress) handling Christian Hopps
2024-10-21 9:30 ` Steffen Klassert
2024-11-02 15:44 ` Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 09/16] xfrm: iptfs: share page fragments of inner packets Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 10/16] xfrm: iptfs: add fragmenting of larger than MTU user packets Christian Hopps
2024-10-21 9:38 ` Steffen Klassert
2024-11-02 15:50 ` Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 11/16] xfrm: iptfs: add basic receive packet (tunnel egress) handling Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 12/16] xfrm: iptfs: handle received fragmented inner packets Christian Hopps
2024-10-21 10:26 ` Steffen Klassert
2024-11-02 16:01 ` Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 13/16] xfrm: iptfs: add reusing received skb for the tunnel egress packet Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 14/16] xfrm: iptfs: add skb-fragment sharing code Christian Hopps
2024-10-21 10:39 ` Steffen Klassert
2024-11-02 16:26 ` Christian Hopps [this message]
2024-10-07 13:59 ` [PATCH ipsec-next v12 15/16] xfrm: iptfs: handle reordering of received packets Christian Hopps
2024-10-21 8:21 ` Steffen Klassert
2024-11-02 16:30 ` Christian Hopps
2024-10-07 13:59 ` [PATCH ipsec-next v12 16/16] xfrm: iptfs: add tracepoint functionality Christian Hopps
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2msihiou0.fsf@chopps.org \
--to=chopps@chopps.org \
--cc=antony@phenome.org \
--cc=chopps@labn.net \
--cc=devel@linux-ipsec.org \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sd@queasysnail.net \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).