All of lore.kernel.org
 help / color / mirror / Atom feed
* NFSoRDMA Fails for max_sge Less Than 18
@ 2017-01-11  7:41 Amrani, Ram
       [not found] ` <SN1PR07MB2207F28F05DC6E22B03CC516F8660-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Amrani, Ram @ 2017-01-11  7:41 UTC (permalink / raw)
  To: Chuck Lever
  Cc: Elior, Ariel, Kalderon, Michal,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Hariprasad S,
	Steve Wise, Faisal Latif, Doug Ledford

Hi Chuck,
We discovered that your recent work (see[1]) on NFSoRDMA broke that functionality on our device.
This seems to stem from a new requirement of minimum 18 SGES for NFSoRDMA to work.
Our device supports only 4 SGEs, and it seems other devices also have limitations in that
regard which would prevent the NFSoRDMA from working on them.

Mounting NFS over RDMA fails with the message: "Cannot allocate memory".
After enabling RPC debug information we've found this is due to this piece of code
from net/sunrpc/xprtrdma/verbs.c:

        if (ia->ri_device->attrs.max_sge < RPCRDMA_MAX_SEND_SGES) {
                dprintk("RPC:       %s: insufficient sge's available\n",
                        __func__);
                return -ENOMEM;
        }

Our device supports 4 sges while the minimum is now 18 sges, for PAGE_SIZE of 4KB:

        #define RPCRDMA_MAX_INLINE  (65536)     /* max inline thresh */

        RPCRDMA_MAX_SEND_PAGES = PAGE_SIZE + RPCRDMA_MAX_INLINE - 1,
        RPCRDMA_MAX_PAGE_SGES = (RPCRDMA_MAX_SEND_PAGES >> PAGE_SHIFT) + 1,
        RPCRDMA_MAX_SEND_SGES = 1 + 1 + RPCRDMA_MAX_PAGE_SGES + 1,

On kernel 4.8 and before, NFSoRDMA worked well with our device as only 2 SGEs were required.
The code looked like this:
        #define RPCRDMA_MAX_IOVS        (2)

        if (ia->ri_device->attrs.max_sge < RPCRDMA_MAX_IOVS) {
                dprintk("RPC:       %s: insufficient sge's available\n",
                        __func__);
                return -ENOMEM;
        }

Browsing the code of other drivers it can be seen that this ability is either hardcoded or is
learnt by the driver from the device. If I'm not mistaken, this issue affects nes and
cxgb3/4 drivers, and perhaps others.

E.g., for cxgb4:

        #define T4_MAX_RECV_SGE 4

        static int c4iw_query_device(struct ib_device *ibdev, struct ib_device_attr *props,
                                     struct ib_udata *uhw)
        {
                ...
                props->max_sge = T4_MAX_RECV_SGE;

***
[1] https://patchwork.kernel.org/patch/9333951/

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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-01-19 17:19 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-11  7:41 NFSoRDMA Fails for max_sge Less Than 18 Amrani, Ram
     [not found] ` <SN1PR07MB2207F28F05DC6E22B03CC516F8660-mikhvbZlbf8TSoR2DauN2+FPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-01-11 16:38   ` Chuck Lever
     [not found]     ` <FE817A76-28A7-4AEC-AF1E-01DE15790E43-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-11 17:04       ` Steve Wise
2017-01-11 19:40         ` Chuck Lever
     [not found]           ` <28B0D906-7BDB-4B87-94E9-6BE263BFBFF7-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-11 19:53             ` Steve Wise
2017-01-11 20:09               ` Chuck Lever
     [not found]                 ` <383D1FFB-346B-40E9-A174-606F13AFF849-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-11 20:18                   ` Steve Wise
2017-01-11 20:35                     ` Chuck Lever
     [not found]                       ` <A7A39994-66C6-4467-837B-288348C0CC53-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-13 22:42                         ` Steve Wise
2017-01-13 22:43                           ` Chuck Lever
     [not found]                             ` <906A1B75-67E9-4D10-AD87-18F694F54818-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-13 22:45                               ` Steve Wise
2017-01-19 17:19                               ` Amrani, Ram
2017-01-11 21:11             ` Jason Gunthorpe
     [not found]               ` <20170111211123.GD28917-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-11 21:15                 ` Steve Wise
2017-01-11 21:34                   ` Jason Gunthorpe
     [not found]                     ` <20170111213416.GA30681-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-01-11 21:48                       ` Steve Wise

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.