[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241209115528.54880-1-kuniyu@amazon.com>
Date: Mon, 9 Dec 2024 20:55:28 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <wenjia@...ux.ibm.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<kuni1840@...il.com>, <kuniyu@...zon.com>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>
Subject: Re: [PATCH v1 net-next 03/15] smc: Pass kern to smc_sock_alloc().
From: Wenjia Zhang <wenjia@...ux.ibm.com>
Date: Mon, 9 Dec 2024 12:05:03 +0100
> On 06.12.24 08:54, Kuniyuki Iwashima wrote:
> > Since commit d7cd421da9da ("net/smc: Introduce TCP ULP support"),
> > smc_ulp_init() calls __smc_create() with kern=1.
> >
> > However, __smc_create() does not pass it to smc_sock_alloc(),
> > which finally calls sk_alloc() with kern=0.
> >
> > Let's pass kern down to smc_sock_alloc() and sk_alloc().
> >
> > Note that we change kern from 1 to 0 in smc_ulp_init() not to
> > introduce any functional change.
> >
> > Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
> > ---
> > net/smc/af_smc.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> Sorry, I didn't see the need to add the **kern** parameter in
> smc_sock_alloc(). Because the **kern** parameter in sk_alloc is not used
> others than to decide the value of sk->sk_net_refcnt, which in SMC code
> is already set in smc_create_clcsk(). Thus, IMO removing the **kern**
> parameter from __smc_create() makes more sense, since this parameter is
> not used in the function.
It would introduce another consufing situation when someone calls
sock_create_kern(PF_SMC) (sock_create_net() or sock_create_net_noref()),
which alaways create a userspace socket.
As long as it's part of the kernel socket API, we shouldn't use such a
hard-coded parameter.
Powered by blists - more mailing lists