[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220309212852.00007828@tom.com>
Date: Wed, 9 Mar 2022 21:41:59 +0800
From: Mingbao Sun <sunmingbao@....com>
To: Christoph Hellwig <hch@....de>
Cc: Keith Busch <kbusch@...nel.org>, Jens Axboe <axboe@...com>,
Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>,
linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
tyler.sun@...l.com, ping.gan@...l.com, yanxiu.cai@...l.com,
libin.zhang@...l.com, ao.sun@...l.com
Subject: Re: [PATCH v2 2/2] nvme-tcp: support specifying the
congestion-control
On Wed, 9 Mar 2022 15:32:33 +0800
Mingbao Sun <sunmingbao@....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?
Powered by blists - more mailing lists