[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2v7x5iq56.fsf@chopps.org>
Date: Sat, 02 Nov 2024 15:50:42 +0000
From: Christian Hopps <chopps@...pps.org>
To: Steffen Klassert <steffen.klassert@...unet.com>
Cc: Christian Hopps <chopps@...pps.org>, devel@...ux-ipsec.org,
netdev@...r.kernel.org, Florian Westphal <fw@...len.de>, Sabrina Dubroca
<sd@...asysnail.net>, Simon Horman <horms@...nel.org>, Antony Antony
<antony@...nome.org>, Christian Hopps <chopps@...n.net>
Subject: Re: [PATCH ipsec-next v12 10/16] xfrm: iptfs: add fragmenting of
larger than MTU user packets
Steffen Klassert <steffen.klassert@...unet.com> writes:
> On Mon, Oct 07, 2024 at 09:59:22AM -0400, Christian Hopps wrote:
>> From: Christian Hopps <chopps@...n.net>
>>
>> Add support for tunneling user (inner) packets that are larger than the
>> tunnel's path MTU (outer) using IP-TFS fragmentation.
>>
>> Signed-off-by: Christian Hopps <chopps@...n.net>
>> ---
>> net/xfrm/xfrm_iptfs.c | 350 ++++++++++++++++++++++++++++++++++++++----
>> 1 file changed, 321 insertions(+), 29 deletions(-)
>>
>> diff --git a/net/xfrm/xfrm_iptfs.c b/net/xfrm/xfrm_iptfs.c
>> index 627b10ed4db0..7343ed77160c 100644
>> --- a/net/xfrm/xfrm_iptfs.c
>> +++ b/net/xfrm/xfrm_iptfs.c
>> @@ -46,12 +46,29 @@
>> */
>> #define IPTFS_DEFAULT_MAX_QUEUE_SIZE (1024 * 10240)
>>
>> +/* Assumed: skb->head is cache aligned.
>> + *
>> + * L2 Header resv: Arrange for cacheline to start at skb->data - 16 to keep the
>> + * to-be-pushed L2 header in the same cacheline as resulting `skb->data` (i.e.,
>> + * the L3 header). If cacheline size is > 64 then skb->data + pushed L2 will all
>> + * be in a single cacheline if we simply reserve 64 bytes.
>> + *
>> + * L3 Header resv: For L3+L2 headers (i.e., skb->data points at the IPTFS payload)
>> + * we want `skb->data` to be cacheline aligned and all pushed L2L3 headers will
>> + * be in their own cacheline[s]. 128 works for cachelins up to 128 bytes, for
>> + * any larger cacheline sizes the pushed headers will simply share the cacheline
>> + * with the start of the IPTFS payload (skb->data).
>> + */
>> +#define XFRM_IPTFS_MIN_L3HEADROOM 128
>> +#define XFRM_IPTFS_MIN_L2HEADROOM (L1_CACHE_BYTES > 64 ? 64 : 64 + 16)
>> +
>> #define NSECS_IN_USEC 1000
>>
>> #define IPTFS_HRTIMER_MODE HRTIMER_MODE_REL_SOFT
>>
>> /**
>> * struct xfrm_iptfs_config - configuration for the IPTFS tunnel.
>> + * @dont_frag: true to inhibit fragmenting across IPTFS outer packets.
>> * @pkt_size: size of the outer IP packet. 0 to use interface and MTU discovery,
>> * otherwise the user specified value.
>> * @max_queue_size: The maximum number of octets allowed to be queued to be sent
>> @@ -59,6 +76,7 @@
>> * packets enqueued.
>> */
>> struct xfrm_iptfs_config {
>> + bool dont_frag : 1;
>
> This bool creates a two byte hole at the beginning of the structure.
> Not a big issue here, but usually it is good to check the structure
> layout with pahole to avoid this.
Moved to bottom changed to `u8 dont_frag : 1`
>
>> u32 pkt_size; /* outer_packet_size or 0 */
>> u32 max_queue_size; /* octets */
>> };
Download attachment "signature.asc" of type "application/pgp-signature" (858 bytes)
Powered by blists - more mailing lists