Re: [PATCH RFC] IB/core: add max_send_sge and max_recv_sge attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Jun 5, 2018, at 2:14 PM, Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> Some devices have vastly different max sge depths for RQs vs SQs.  So add
> queue-specific attributes so applications can take full advantage of
> hw capabilities.

:
:

> diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> index 96cc8f6..cb3471b 100644
> --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
> +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
> @@ -736,7 +736,8 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
> 
> 	/* Qualify the transport resource defaults with the
> 	 * capabilities of this particular device */
> -	newxprt->sc_max_sge = min((size_t)dev->attrs.max_sge,
> +	newxprt->sc_max_sge = min3((size_t)dev->attrs.max_send_sge,
> +				   (size_t)dev->attrs.max_recv_sge,
> 				  (size_t)RPCSVC_MAXPAGES);

A patch coming in v4.18 replaces sc_max_sge with sc_max_send_sge.
Another patch changes the NFS server's Receive path to require
only a single SGE, so min3 won't be necessary here.

Shouldn't be difficult to sort out.


> 	newxprt->sc_max_req_size = svcrdma_max_req_size;
> 	newxprt->sc_max_requests = svcrdma_max_requests;
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index fe5eaca..7ffa388 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -504,7 +504,7 @@
> 	struct ib_cq *sendcq, *recvcq;
> 	int rc;
> 
> -	max_sge = min_t(unsigned int, ia->ri_device->attrs.max_sge,
> +	max_sge = min_t(unsigned int, ia->ri_device->attrs.max_send_sge,
> 			RPCRDMA_MAX_SEND_SGES);

That should work fine.


> 	if (max_sge < RPCRDMA_MIN_SEND_SGES) {
> 		pr_warn("rpcrdma: HCA provides only %d send SGEs\n", max_sge);
> -- 
> 1.8.3.1
> 

--
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux