License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2016-01-07 19:50:10 +00:00
|
|
|
/*
|
2018-05-07 19:28:04 +00:00
|
|
|
* Copyright (c) 2015-2018 Oracle. All rights reserved.
|
2016-01-07 19:50:10 +00:00
|
|
|
*
|
2021-02-04 16:59:19 +00:00
|
|
|
* Support for reverse-direction RPCs on RPC/RDMA (server-side).
|
2016-01-07 19:50:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/sunrpc/svc_rdma.h>
|
2018-05-07 19:27:16 +00:00
|
|
|
|
2016-01-07 19:50:10 +00:00
|
|
|
#include "xprt_rdma.h"
|
2018-05-07 19:27:16 +00:00
|
|
|
#include <trace/events/rpcrdma.h>
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2017-04-09 17:06:49 +00:00
|
|
|
/**
|
2020-03-20 21:32:41 +00:00
|
|
|
* svc_rdma_handle_bc_reply - Process incoming backchannel Reply
|
|
|
|
* @rqstp: resources for handling the Reply
|
|
|
|
* @rctxt: Received message
|
2017-04-09 17:06:49 +00:00
|
|
|
*
|
|
|
|
*/
|
2020-03-20 21:32:41 +00:00
|
|
|
void svc_rdma_handle_bc_reply(struct svc_rqst *rqstp,
|
|
|
|
struct svc_rdma_recv_ctxt *rctxt)
|
2016-01-07 19:50:10 +00:00
|
|
|
{
|
2020-03-20 21:32:41 +00:00
|
|
|
struct svc_xprt *sxprt = rqstp->rq_xprt;
|
|
|
|
struct rpc_xprt *xprt = sxprt->xpt_bc_xprt;
|
2016-01-07 19:50:10 +00:00
|
|
|
struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
|
2020-03-20 21:32:41 +00:00
|
|
|
struct xdr_buf *rcvbuf = &rqstp->rq_arg;
|
2016-01-07 19:50:10 +00:00
|
|
|
struct kvec *dst, *src = &rcvbuf->head[0];
|
2020-03-20 21:32:41 +00:00
|
|
|
__be32 *rdma_resp = rctxt->rc_recv_buf;
|
2016-01-07 19:50:10 +00:00
|
|
|
struct rpc_rqst *req;
|
|
|
|
u32 credits;
|
|
|
|
|
2018-08-31 14:21:00 +00:00
|
|
|
spin_lock(&xprt->queue_lock);
|
2020-03-20 19:11:56 +00:00
|
|
|
req = xprt_lookup_rqst(xprt, *rdma_resp);
|
2016-01-07 19:50:10 +00:00
|
|
|
if (!req)
|
2020-03-20 21:32:41 +00:00
|
|
|
goto out_unlock;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
|
|
|
dst = &req->rq_private_buf.head[0];
|
|
|
|
memcpy(&req->rq_private_buf, &req->rq_rcv_buf, sizeof(struct xdr_buf));
|
2020-03-20 19:11:56 +00:00
|
|
|
if (dst->iov_len < src->iov_len)
|
2016-01-07 19:50:10 +00:00
|
|
|
goto out_unlock;
|
2020-03-20 19:11:56 +00:00
|
|
|
memcpy(dst->iov_base, src->iov_base, src->iov_len);
|
2018-10-01 18:16:01 +00:00
|
|
|
xprt_pin_rqst(req);
|
2018-10-30 20:03:29 +00:00
|
|
|
spin_unlock(&xprt->queue_lock);
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2017-04-09 17:06:49 +00:00
|
|
|
credits = be32_to_cpup(rdma_resp + 2);
|
2016-01-07 19:50:10 +00:00
|
|
|
if (credits == 0)
|
|
|
|
credits = 1; /* don't deadlock */
|
|
|
|
else if (credits > r_xprt->rx_buf.rb_bc_max_requests)
|
|
|
|
credits = r_xprt->rx_buf.rb_bc_max_requests;
|
2019-05-02 15:21:08 +00:00
|
|
|
spin_lock(&xprt->transport_lock);
|
2016-01-07 19:50:10 +00:00
|
|
|
xprt->cwnd = credits << RPC_CWNDSHIFT;
|
2019-05-02 15:21:08 +00:00
|
|
|
spin_unlock(&xprt->transport_lock);
|
2017-08-16 19:30:35 +00:00
|
|
|
|
2018-10-30 20:03:29 +00:00
|
|
|
spin_lock(&xprt->queue_lock);
|
2016-01-07 19:50:10 +00:00
|
|
|
xprt_complete_rqst(req->rq_task, rcvbuf->len);
|
2018-10-01 18:16:01 +00:00
|
|
|
xprt_unpin_rqst(req);
|
2016-01-07 19:50:10 +00:00
|
|
|
rcvbuf->len = 0;
|
|
|
|
|
|
|
|
out_unlock:
|
2018-08-31 14:21:00 +00:00
|
|
|
spin_unlock(&xprt->queue_lock);
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
2021-02-04 16:59:19 +00:00
|
|
|
/* Send a reverse-direction RPC Call.
|
2016-01-07 19:50:10 +00:00
|
|
|
*
|
|
|
|
* Caller holds the connection's mutex and has already marshaled
|
|
|
|
* the RPC/RDMA request.
|
|
|
|
*
|
2017-04-09 17:06:25 +00:00
|
|
|
* This is similar to svc_rdma_send_reply_msg, but takes a struct
|
|
|
|
* rpc_rqst instead, does not support chunks, and avoids blocking
|
|
|
|
* memory allocation.
|
2016-01-07 19:50:10 +00:00
|
|
|
*
|
|
|
|
* XXX: There is still an opportunity to block in svc_rdma_send()
|
|
|
|
* if there are no SQ entries to post the Send. This may occur if
|
|
|
|
* the adapter has a small maximum SQ depth.
|
|
|
|
*/
|
|
|
|
static int svc_rdma_bc_sendto(struct svcxprt_rdma *rdma,
|
2018-05-07 19:28:25 +00:00
|
|
|
struct rpc_rqst *rqst,
|
2020-03-13 14:42:11 +00:00
|
|
|
struct svc_rdma_send_ctxt *sctxt)
|
2016-01-07 19:50:10 +00:00
|
|
|
{
|
2023-11-21 16:40:13 +00:00
|
|
|
struct svc_rdma_pcl empty_pcl;
|
2016-01-07 19:50:10 +00:00
|
|
|
int ret;
|
|
|
|
|
2023-11-21 16:40:13 +00:00
|
|
|
pcl_init(&empty_pcl);
|
|
|
|
ret = svc_rdma_map_reply_msg(rdma, sctxt, &empty_pcl, &empty_pcl,
|
|
|
|
&rqst->rq_snd_buf);
|
2017-04-09 17:05:44 +00:00
|
|
|
if (ret < 0)
|
2018-05-07 19:28:25 +00:00
|
|
|
return -EIO;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2017-10-16 16:14:33 +00:00
|
|
|
/* Bump page refcnt so Send completion doesn't release
|
|
|
|
* the rq_buffer before all retransmits are complete.
|
|
|
|
*/
|
|
|
|
get_page(virt_to_page(rqst->rq_buffer));
|
2020-03-13 14:42:11 +00:00
|
|
|
sctxt->sc_send_wr.opcode = IB_WR_SEND;
|
2024-02-04 23:17:22 +00:00
|
|
|
return svc_rdma_post_send(rdma, sctxt);
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Server-side transport endpoint wants a whole page for its send
|
|
|
|
* buffer. The client RPC code constructs the RPC header in this
|
|
|
|
* buffer before it invokes ->send_request.
|
|
|
|
*/
|
2016-09-15 14:55:20 +00:00
|
|
|
static int
|
|
|
|
xprt_rdma_bc_allocate(struct rpc_task *task)
|
2016-01-07 19:50:10 +00:00
|
|
|
{
|
|
|
|
struct rpc_rqst *rqst = task->tk_rqstp;
|
2016-09-15 14:55:20 +00:00
|
|
|
size_t size = rqst->rq_callsize;
|
2016-01-07 19:50:10 +00:00
|
|
|
struct page *page;
|
|
|
|
|
2016-09-15 14:55:20 +00:00
|
|
|
if (size > PAGE_SIZE) {
|
2016-01-07 19:50:10 +00:00
|
|
|
WARN_ONCE(1, "svcrdma: large bc buffer request (size %zu)\n",
|
|
|
|
size);
|
2016-09-15 14:55:20 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2022-09-23 13:06:05 +00:00
|
|
|
page = alloc_page(GFP_NOIO | __GFP_NOWARN);
|
2016-01-07 19:50:10 +00:00
|
|
|
if (!page)
|
2016-09-15 14:55:20 +00:00
|
|
|
return -ENOMEM;
|
|
|
|
rqst->rq_buffer = page_address(page);
|
2016-10-29 02:22:33 +00:00
|
|
|
|
2022-09-23 13:06:05 +00:00
|
|
|
rqst->rq_rbuffer = kmalloc(rqst->rq_rcvsize, GFP_NOIO | __GFP_NOWARN);
|
2016-10-29 02:22:33 +00:00
|
|
|
if (!rqst->rq_rbuffer) {
|
|
|
|
put_page(page);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
2016-09-15 14:55:20 +00:00
|
|
|
return 0;
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-09-15 14:55:29 +00:00
|
|
|
xprt_rdma_bc_free(struct rpc_task *task)
|
2016-01-07 19:50:10 +00:00
|
|
|
{
|
2016-10-29 02:22:33 +00:00
|
|
|
struct rpc_rqst *rqst = task->tk_rqstp;
|
|
|
|
|
2017-10-16 16:14:33 +00:00
|
|
|
put_page(virt_to_page(rqst->rq_buffer));
|
2016-10-29 02:22:33 +00:00
|
|
|
kfree(rqst->rq_rbuffer);
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
rpcrdma_bc_send_request(struct svcxprt_rdma *rdma, struct rpc_rqst *rqst)
|
|
|
|
{
|
|
|
|
struct rpc_xprt *xprt = rqst->rq_xprt;
|
|
|
|
struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
|
2018-05-07 19:28:25 +00:00
|
|
|
struct svc_rdma_send_ctxt *ctxt;
|
2017-02-07 16:58:40 +00:00
|
|
|
__be32 *p;
|
2016-01-07 19:50:10 +00:00
|
|
|
int rc;
|
|
|
|
|
2018-05-07 19:28:25 +00:00
|
|
|
ctxt = svc_rdma_send_ctxt_get(rdma);
|
|
|
|
if (!ctxt)
|
|
|
|
goto drop_connection;
|
|
|
|
|
2020-03-02 20:02:20 +00:00
|
|
|
p = xdr_reserve_space(&ctxt->sc_stream, RPCRDMA_HDRLEN_MIN);
|
|
|
|
if (!p)
|
|
|
|
goto put_ctxt;
|
2017-02-07 16:58:40 +00:00
|
|
|
*p++ = rqst->rq_xid;
|
|
|
|
*p++ = rpcrdma_version;
|
|
|
|
*p++ = cpu_to_be32(r_xprt->rx_buf.rb_bc_max_requests);
|
|
|
|
*p++ = rdma_msg;
|
|
|
|
*p++ = xdr_zero;
|
|
|
|
*p++ = xdr_zero;
|
|
|
|
*p = xdr_zero;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2019-11-20 21:25:46 +00:00
|
|
|
rqst->rq_xtime = ktime_get();
|
2018-05-07 19:28:25 +00:00
|
|
|
rc = svc_rdma_bc_sendto(rdma, rqst, ctxt);
|
2020-03-02 20:02:20 +00:00
|
|
|
if (rc)
|
|
|
|
goto put_ctxt;
|
2018-12-19 15:58:40 +00:00
|
|
|
return 0;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2020-03-02 20:02:20 +00:00
|
|
|
put_ctxt:
|
|
|
|
svc_rdma_send_ctxt_put(rdma, ctxt);
|
|
|
|
|
2016-01-07 19:50:10 +00:00
|
|
|
drop_connection:
|
|
|
|
return -ENOTCONN;
|
|
|
|
}
|
|
|
|
|
2020-05-02 14:37:44 +00:00
|
|
|
/**
|
|
|
|
* xprt_rdma_bc_send_request - Send a reverse-direction Call
|
|
|
|
* @rqst: rpc_rqst containing Call message to be sent
|
|
|
|
*
|
|
|
|
* Return values:
|
|
|
|
* %0 if the message was sent successfully
|
|
|
|
* %ENOTCONN if the message was not sent
|
2016-01-07 19:50:10 +00:00
|
|
|
*/
|
2020-05-02 14:37:44 +00:00
|
|
|
static int xprt_rdma_bc_send_request(struct rpc_rqst *rqst)
|
2016-01-07 19:50:10 +00:00
|
|
|
{
|
|
|
|
struct svc_xprt *sxprt = rqst->rq_xprt->bc_xprt;
|
2020-05-02 14:37:44 +00:00
|
|
|
struct svcxprt_rdma *rdma =
|
|
|
|
container_of(sxprt, struct svcxprt_rdma, sc_xprt);
|
2016-01-07 19:50:10 +00:00
|
|
|
int ret;
|
|
|
|
|
2020-05-02 14:37:44 +00:00
|
|
|
if (test_bit(XPT_DEAD, &sxprt->xpt_flags))
|
|
|
|
return -ENOTCONN;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
2020-05-02 14:37:44 +00:00
|
|
|
ret = rpcrdma_bc_send_request(rdma, rqst);
|
|
|
|
if (ret == -ENOTCONN)
|
2022-01-31 18:34:29 +00:00
|
|
|
svc_xprt_close(sxprt);
|
2020-05-02 14:37:44 +00:00
|
|
|
return ret;
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xprt_rdma_bc_close(struct rpc_xprt *xprt)
|
|
|
|
{
|
2020-04-17 16:40:31 +00:00
|
|
|
xprt_disconnect_done(xprt);
|
2018-10-01 18:25:14 +00:00
|
|
|
xprt->cwnd = RPC_CWNDSHIFT;
|
2016-01-07 19:50:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
xprt_rdma_bc_put(struct rpc_xprt *xprt)
|
|
|
|
{
|
2020-03-24 20:53:59 +00:00
|
|
|
xprt_rdma_free_addresses(xprt);
|
2016-01-07 19:50:10 +00:00
|
|
|
xprt_free(xprt);
|
|
|
|
}
|
|
|
|
|
2017-08-01 16:00:39 +00:00
|
|
|
static const struct rpc_xprt_ops xprt_rdma_bc_procs = {
|
2016-01-07 19:50:10 +00:00
|
|
|
.reserve_xprt = xprt_reserve_xprt_cong,
|
|
|
|
.release_xprt = xprt_release_xprt_cong,
|
|
|
|
.alloc_slot = xprt_alloc_slot,
|
2018-05-04 19:34:59 +00:00
|
|
|
.free_slot = xprt_free_slot,
|
2016-01-07 19:50:10 +00:00
|
|
|
.release_request = xprt_release_rqst_cong,
|
|
|
|
.buf_alloc = xprt_rdma_bc_allocate,
|
|
|
|
.buf_free = xprt_rdma_bc_free,
|
|
|
|
.send_request = xprt_rdma_bc_send_request,
|
2019-04-07 17:58:46 +00:00
|
|
|
.wait_for_reply_request = xprt_wait_for_reply_request_def,
|
2016-01-07 19:50:10 +00:00
|
|
|
.close = xprt_rdma_bc_close,
|
|
|
|
.destroy = xprt_rdma_bc_put,
|
|
|
|
.print_stats = xprt_rdma_print_stats
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct rpc_timeout xprt_rdma_bc_timeout = {
|
|
|
|
.to_initval = 60 * HZ,
|
|
|
|
.to_maxval = 60 * HZ,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* It shouldn't matter if the number of backchannel session slots
|
|
|
|
* doesn't match the number of RPC/RDMA credits. That just means
|
|
|
|
* one or the other will have extra slots that aren't used.
|
|
|
|
*/
|
|
|
|
static struct rpc_xprt *
|
|
|
|
xprt_setup_rdma_bc(struct xprt_create *args)
|
|
|
|
{
|
|
|
|
struct rpc_xprt *xprt;
|
|
|
|
struct rpcrdma_xprt *new_xprt;
|
|
|
|
|
2020-03-20 19:11:56 +00:00
|
|
|
if (args->addrlen > sizeof(xprt->addr))
|
2016-01-07 19:50:10 +00:00
|
|
|
return ERR_PTR(-EBADF);
|
|
|
|
|
|
|
|
xprt = xprt_alloc(args->net, sizeof(*new_xprt),
|
|
|
|
RPCRDMA_MAX_BC_REQUESTS,
|
|
|
|
RPCRDMA_MAX_BC_REQUESTS);
|
2020-03-20 19:11:56 +00:00
|
|
|
if (!xprt)
|
2016-01-07 19:50:10 +00:00
|
|
|
return ERR_PTR(-ENOMEM);
|
|
|
|
|
|
|
|
xprt->timeout = &xprt_rdma_bc_timeout;
|
|
|
|
xprt_set_bound(xprt);
|
|
|
|
xprt_set_connected(xprt);
|
2021-02-22 23:36:19 +00:00
|
|
|
xprt->bind_timeout = 0;
|
|
|
|
xprt->reestablish_timeout = 0;
|
|
|
|
xprt->idle_timeout = 0;
|
2016-01-07 19:50:10 +00:00
|
|
|
|
|
|
|
xprt->prot = XPRT_TRANSPORT_BC_RDMA;
|
|
|
|
xprt->ops = &xprt_rdma_bc_procs;
|
|
|
|
|
|
|
|
memcpy(&xprt->addr, args->dstaddr, args->addrlen);
|
|
|
|
xprt->addrlen = args->addrlen;
|
|
|
|
xprt_rdma_format_addresses(xprt, (struct sockaddr *)&xprt->addr);
|
|
|
|
xprt->resvport = 0;
|
|
|
|
|
|
|
|
xprt->max_payload = xprt_rdma_max_inline_read;
|
|
|
|
|
|
|
|
new_xprt = rpcx_to_rdmax(xprt);
|
|
|
|
new_xprt->rx_buf.rb_bc_max_requests = xprt->max_reqs;
|
|
|
|
|
|
|
|
xprt_get(xprt);
|
|
|
|
args->bc_xprt->xpt_bc_xprt = xprt;
|
|
|
|
xprt->bc_xprt = args->bc_xprt;
|
|
|
|
|
|
|
|
/* Final put for backchannel xprt is in __svc_rdma_free */
|
|
|
|
xprt_get(xprt);
|
|
|
|
return xprt;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct xprt_class xprt_rdma_bc = {
|
|
|
|
.list = LIST_HEAD_INIT(xprt_rdma_bc.list),
|
|
|
|
.name = "rdma backchannel",
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.ident = XPRT_TRANSPORT_BC_RDMA,
|
|
|
|
.setup = xprt_setup_rdma_bc,
|
|
|
|
};
|