[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c765b30-3006-448e-8782-e01161d049f9@linux.ibm.com>
Date: Fri, 13 Dec 2024 14:46:52 +0100
From: Wenjia Zhang <wenjia@...ux.ibm.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>
Cc: Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 03/15] smc: Pass kern to smc_sock_alloc().
On 13.12.24 10:21, Kuniyuki Iwashima wrote:
> AF_SMC was introduced in commit ac7138746e14 ("smc: establish
> new socket family").
>
> Since then, smc_create() ignores the kern argument and calls
> smc_sock_alloc(), which calls sk_alloc() with hard-coded arguments.
>
> sk = sk_alloc(net, PF_SMC, GFP_KERNEL, prot, 0);
>
> This means sock_create_kern(AF_SMC) always creates a userspace
> socket.
>
> Later, commit d7cd421da9da ("net/smc: Introduce TCP ULP support")
> added another confusing call site.
>
> smc_ulp_init() calls __smc_create() with kern=1, but again,
> smc_sock_alloc() allocates a userspace socket by calling
> sk_alloc() with kern=0.
>
> To fix up the weird paths, let's pass kern down to smc_sock_alloc()
> and sk_alloc().
>
> This commit does not introduce functional change because we have
> no in-tree users calling sock_create_kern(AF_SMC) and we change
> kern from 1 to 0 in smc_ulp_init().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> ---
> net/smc/af_smc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
Ok, thank you for the detailed description, LGTM!
Reviewed-by: Wenjia Zhang <wenjia@...ux.ibm.com>
Powered by blists - more mailing lists