[PATCH 2/3] nvme-tcp: support specifying the congestion-control

Christoph Hellwig hch at lst.de
Thu Mar 10 23:15:18 PST 2022


On Fri, Mar 11, 2022 at 11:01:12AM +0800, Mingbao Sun wrote:
> +		case NVMF_OPT_TCP_CONGESTION:
> +			p = match_strdup(args);
> +			if (!p) {
> +				ret = -ENOMEM;
> +				goto out;
> +			}
> +
> +			kfree(opts->tcp_congestion);
> +			opts->tcp_congestion = p;

We'll need to check that the string is no loner than TCP_CA_NAME_MAX
somewhere.

>  
> +	if (nctrl->opts->mask & NVMF_OPT_TCP_CONGESTION) {
> +		ret = tcp_set_congestion_control(queue->sock->sk,
> +						 nctrl->opts->tcp_congestion,
> +						 true, true);

This needs to be called under lock_sock() protection.  Maybe also
add an assert to tcp_set_congestion_control to enforce that.



More information about the Linux-nvme mailing list