From: Mingbao Sun <sunmingbao@tom.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
Sagi Grimberg <sagi@grimberg.me>,
Chaitanya Kulkarni <kch@nvidia.com>,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
tyler.sun@dell.com, ping.gan@dell.com, yanxiu.cai@dell.com,
libin.zhang@dell.com, ao.sun@dell.com
Subject: Re: [PATCH v2 2/2] nvme-tcp: support specifying the congestion-control
Date: Wed, 9 Mar 2022 21:41:59 +0800 [thread overview]
Message-ID: <20220309212852.00007828@tom.com> (raw)
In-Reply-To: <20220309153136.000048e1@tom.com>
On Wed, 9 Mar 2022 15:32:33 +0800
Mingbao Sun <sunmingbao@tom.com> wrote:
> > > @@ -1447,6 +1449,21 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl,
> > > if (nctrl->opts->tos >= 0)
> > > ip_sock_set_tos(queue->sock->sk, nctrl->opts->tos);
> > >
> > > + if (nctrl->opts->mask & NVMF_OPT_TCP_CONGESTION) {
> > > + strncpy(ca_name, nctrl->opts->tcp_congestion,
> > > + TCP_CA_NAME_MAX-1);
> > > + optval = KERNEL_SOCKPTR(ca_name);
> > > + ret = sock_common_setsockopt(queue->sock, IPPROTO_TCP,
> > > + TCP_CONGESTION, optval,
> > > + strlen(ca_name));
> >
> > This needs to use kernel_setsockopt. I also can see absolutely no
> > need for the optval local variable, and I also don't really see why
> > we need ca_name either - if we need to limit the length and terminate
> > it (but why?) that can be done during option parsing.
Regards to the replacement of 'sock_common_setsockopt'.
Per the story of the deletion of 'kernel_setsockopt',
users of this API should switch to small functions that
implement setting a sockopt directly.
So I tried with 'tcp_set_congestion_control'.
But then I found this symbol is not exported yet.
Then I applied ‘EXPORT_SYMBOL_GPL(tcp_set_congestion_control);’
in my local source, and it works well in the testing.
Then what should I do with this?
next prev parent reply other threads:[~2022-03-09 13:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 15:16 [PATCH v2 2/2] nvme-tcp: support specifying the congestion-control Mingbao Sun
2022-03-08 15:36 ` Mingbao Sun
2022-03-09 6:14 ` Christoph Hellwig
2022-03-09 7:32 ` Mingbao Sun
2022-03-09 13:41 ` Mingbao Sun [this message]
2022-03-10 8:19 ` Christoph Hellwig
2022-03-10 8:31 ` Mingbao Sun
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=20220309212852.00007828@tom.com \
--to=sunmingbao@tom.com \
--cc=ao.sun@dell.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=libin.zhang@dell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=ping.gan@dell.com \
--cc=sagi@grimberg.me \
--cc=tyler.sun@dell.com \
--cc=yanxiu.cai@dell.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