netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 08/16] xfrm: iptfs: add user packet (tunnel ingress) handling
Date: Sat, 02 Nov 2024 15:44:25 +0000	[thread overview]
Message-ID: <m2zfmhiqk2.fsf@chopps.org> (raw)
In-Reply-To: <ZxYfLMIahzR9cpMw@gauss3.secunet.de>

[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]


Steffen Klassert <steffen.klassert@secunet.com> writes:

> On Mon, Oct 07, 2024 at 09:59:20AM -0400, Christian Hopps wrote:
>> From: Christian Hopps <chopps@labn.net>
>> @@ -77,8 +609,11 @@ static int iptfs_user_init(struct net *net, struct xfrm_state *x,
>>  {
>>  	struct xfrm_iptfs_data *xtfs = x->mode_data;
>>  	struct xfrm_iptfs_config *xc;
>> +	u64 q;
>>
>>  	xc = &xtfs->cfg;
>> +	xc->max_queue_size = IPTFS_DEFAULT_MAX_QUEUE_SIZE;
>> +	xtfs->init_delay_ns = IPTFS_DEFAULT_INIT_DELAY_USECS * NSECS_IN_USEC;
>>
>>  	if (attrs[XFRMA_IPTFS_PKT_SIZE]) {
>>  		xc->pkt_size = nla_get_u32(attrs[XFRMA_IPTFS_PKT_SIZE]);
>> @@ -92,6 +627,17 @@ static int iptfs_user_init(struct net *net, struct xfrm_state *x,
>>  			return -EINVAL;
>>  		}
>>  	}
>> +	if (attrs[XFRMA_IPTFS_MAX_QSIZE])
>> +		xc->max_queue_size = nla_get_u32(attrs[XFRMA_IPTFS_MAX_QSIZE]);
>> +	if (attrs[XFRMA_IPTFS_INIT_DELAY])
>> +		xtfs->init_delay_ns =
>> +			(u64)nla_get_u32(attrs[XFRMA_IPTFS_INIT_DELAY]) *
>> +			NSECS_IN_USEC;
>> +
>> +	q = (u64)xc->max_queue_size * 95;
>> +	(void)do_div(q, 100);
>
> This cast is not need.

Removed.

FWIW, the cast was to document the ignoring of the returned remainder value; however, this is outside the normal linux kernel coding style.

>> +	xtfs->ecn_queue_size = (u32)q;
>> +
>>  	return 0;
>>  }
>>
>> @@ -101,8 +647,11 @@ static unsigned int iptfs_sa_len(const struct xfrm_state *x)
>>  	struct xfrm_iptfs_config *xc = &xtfs->cfg;
>>  	unsigned int l = 0;
>>
>> -	if (x->dir == XFRM_SA_DIR_OUT)
>> +	if (x->dir == XFRM_SA_DIR_OUT) {
>> +		l += nla_total_size(sizeof(u32)); /* init delay usec */
>> +		l += nla_total_size(sizeof(xc->max_queue_size));
>>  		l += nla_total_size(sizeof(xc->pkt_size));
>> +	}
>>
>>  	return l;
>>  }
>> @@ -112,9 +661,22 @@ static int iptfs_copy_to_user(struct xfrm_state *x, struct sk_buff *skb)
>>  	struct xfrm_iptfs_data *xtfs = x->mode_data;
>>  	struct xfrm_iptfs_config *xc = &xtfs->cfg;
>>  	int ret = 0;
>> +	u64 q;
>> +
>> +	if (x->dir == XFRM_SA_DIR_OUT) {
>> +		q = xtfs->init_delay_ns;
>> +		(void)do_div(q, NSECS_IN_USEC);
>
> Same here.

Removed.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]

  reply	other threads:[~2024-11-02 15:57 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 [this message]
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
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=m2zfmhiqk2.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).