From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <wenjia@linux.ibm.com>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<kuni1840@gmail.com>, <kuniyu@amazon.com>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>
Subject: Re: [PATCH v1 net-next 03/15] smc: Pass kern to smc_sock_alloc().
Date: Mon, 9 Dec 2024 20:55:28 +0900 [thread overview]
Message-ID: <20241209115528.54880-1-kuniyu@amazon.com> (raw)
In-Reply-To: <385f7646-7f87-43ca-9585-5ecdd59a4379@linux.ibm.com>
From: Wenjia Zhang <wenjia@linux.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@amazon.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.
next prev parent reply other threads:[~2024-12-09 11:55 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 7:54 [PATCH v1 net-next 00/15] treewide: socket: Clean up sock_create() and friends Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 01/15] socket: Un-export __sock_create() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 02/15] socket: Pass hold_net flag to __sock_create() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 03/15] smc: Pass kern to smc_sock_alloc() Kuniyuki Iwashima
2024-12-09 11:05 ` Wenjia Zhang
2024-12-09 11:55 ` Kuniyuki Iwashima [this message]
2024-12-06 7:54 ` [PATCH v1 net-next 04/15] socket: Pass hold_net to struct net_proto_family.create() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 05/15] ppp: Pass hold_net to struct pppox_proto.create() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 06/15] nfc: Pass hold_net to struct nfc_protocol.create() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 07/15] socket: Add hold_net flag to struct proto_accept_arg Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 08/15] socket: Pass hold_net to sk_alloc() Kuniyuki Iwashima
2024-12-06 21:43 ` kernel test robot
2024-12-06 23:21 ` Kuniyuki Iwashima
2024-12-09 4:04 ` kernel test robot
2024-12-06 7:54 ` [PATCH v1 net-next 09/15] socket: Respect hold_net in sk_alloc() Kuniyuki Iwashima
2024-12-06 7:54 ` [PATCH v1 net-next 10/15] socket: Don't count kernel sockets in /proc/net/sockstat Kuniyuki Iwashima
2024-12-06 7:55 ` [PATCH v1 net-next 11/15] socket: Introduce sock_create_net() Kuniyuki Iwashima
2024-12-06 7:55 ` [PATCH v1 net-next 12/15] socket: Remove kernel socket conversion Kuniyuki Iwashima
2024-12-09 11:00 ` Matthieu Baerts
2024-12-09 23:00 ` Allison Henderson
2024-12-06 7:55 ` [PATCH v1 net-next 13/15] socket: Use sock_create_net() instead of sock_create() Kuniyuki Iwashima
2024-12-06 7:55 ` [PATCH v1 net-next 14/15] socket: Rename sock_create() to sock_create_user() Kuniyuki Iwashima
2024-12-06 7:55 ` [PATCH v1 net-next 15/15] socket: Rename sock_create_kern() to sock_create_net_noref() Kuniyuki Iwashima
2024-12-08 10:54 ` [PATCH v1 net-next 00/15] treewide: socket: Clean up sock_create() and friends David Laight
2024-12-09 5:26 ` Kuniyuki Iwashima
2024-12-09 6:42 ` Kuniyuki Iwashima
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=20241209115528.54880-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wenjia@linux.ibm.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).