]> git.baikalelectronics.ru Git - kernel.git/commit
svcrdma: Remove max_sge check at connect time
authorChuck Lever <chuck.lever@oracle.com>
Fri, 25 Jan 2019 21:54:54 +0000 (16:54 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 6 Feb 2019 20:32:34 +0000 (15:32 -0500)
commit2503bf7de69d23d2eab2c88051ef8b81cee04522
treefc51afa03c6f57f52ab65b647fd88b120082d708
parentb5983d01bb4f63fc74c17603a717630962d7c37f
svcrdma: Remove max_sge check at connect time

Two and a half years ago, the client was changed to use gathered
Send for larger inline messages, in commit fe143e73b17 ("xprtrdma:
Use gathered Send for large inline messages"). Several fixes were
required because there are a few in-kernel device drivers whose
max_sge is 3, and these were broken by the change.

Apparently my memory is going, because some time later, I submitted
commit cfd11e05dbda ("svcrdma: Don't overrun the SGE array in
svc_rdma_send_ctxt"), and after that, commit 1c50a5f10519 ("svcrdma:
Reduce max_send_sges"). These too incorrectly assumed in-kernel
device drivers would have more than a few Send SGEs available.

The fix for the server side is not the same. This is because the
fundamental problem on the server is that, whether or not the client
has provisioned a chunk for the RPC reply, the server must squeeze
even the most complex RPC replies into a single RDMA Send. Failing
in the send path because of Send SGE exhaustion should never be an
option.

Therefore, instead of failing when the send path runs out of SGEs,
switch to using a bounce buffer mechanism to handle RPC replies that
are too complex for the device to send directly. That allows us to
remove the max_sge check to enable drivers with small max_sge to
work again.

Reported-by: Don Dutile <ddutile@redhat.com>
Fixes: cfd11e05dbda ("svcrdma: Don't overrun the SGE array in ...")
Cc: stable@vger.kernel.org
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c