* [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access
[not found] <20180301220030.27433-1-bart.vanassche@wdc.com>
@ 2018-03-01 22:00 ` Bart Van Assche
2018-03-01 22:19 ` Jason Gunthorpe
2018-03-01 22:00 ` [PATCH 2/3] RDMA/rxe: Fix an out-of-bounds read Bart Van Assche
2018-03-01 22:00 ` [PATCH 3/3] IB/srpt: Fix an out-of-bounds stack access in srpt_zerolength_write() Bart Van Assche
2 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2018-03-01 22:00 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Doug Ledford, Laurence Oberman, linux-rdma, Bart Van Assche,
Steve Wise, Sagi Grimberg, stable
This patch fixes the following KASAN complaint:
==================================================================
BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x77d/0x9b0 [rdma_rxe]
Read of size 8 at addr ffff880061aef860 by task 01/1080
CPU: 2 PID: 1080 Comm: 01 Not tainted 4.16.0-rc3-dbg+ #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
Call Trace:
dump_stack+0x85/0xc7
print_address_description+0x65/0x270
kasan_report+0x231/0x350
rxe_post_send+0x77d/0x9b0 [rdma_rxe]
__ib_drain_sq+0x1ad/0x250 [ib_core]
ib_drain_qp+0x9/0x30 [ib_core]
srp_destroy_qp+0x51/0x70 [ib_srp]
srp_free_ch_ib+0xfc/0x380 [ib_srp]
srp_create_target+0x1071/0x19e0 [ib_srp]
kernfs_fop_write+0x180/0x210
__vfs_write+0xb1/0x2e0
vfs_write+0xf6/0x250
SyS_write+0x99/0x110
do_syscall_64+0xee/0x2b0
entry_SYSCALL_64_after_hwframe+0x42/0xb7
The buggy address belongs to the page:
page:ffffea000186bbc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x4000000000000000()
raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 ffffea000186bbe0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff880061aef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff880061aef780: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
>ffff880061aef800: f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 f2 f2 f2 f2
^
ffff880061aef880: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f2 f2
ffff880061aef900: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Fixes: 765d67748bcf ("IB: new common API for draining queues")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: stable@vger.kernel.org
---
drivers/infiniband/core/verbs.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 2c7b0ceb46e6..4e2b231b03f7 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -2194,7 +2194,13 @@ static void __ib_drain_sq(struct ib_qp *qp)
struct ib_cq *cq = qp->send_cq;
struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
struct ib_drain_cqe sdrain;
- struct ib_send_wr swr = {}, *bad_swr;
+ struct ib_send_wr *bad_swr;
+ struct ib_rdma_wr swr = {
+ .wr = {
+ .opcode = IB_WR_RDMA_WRITE,
+ .wr_cqe = &sdrain.cqe,
+ },
+ };
int ret;
ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
@@ -2203,11 +2209,10 @@ static void __ib_drain_sq(struct ib_qp *qp)
return;
}
- swr.wr_cqe = &sdrain.cqe;
sdrain.cqe.done = ib_drain_qp_done;
init_completion(&sdrain.done);
- ret = ib_post_send(qp, &swr, &bad_swr);
+ ret = ib_post_send(qp, &swr.wr, &bad_swr);
if (ret) {
WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
return;
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access
2018-03-01 22:00 ` [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access Bart Van Assche
@ 2018-03-01 22:19 ` Jason Gunthorpe
2018-03-01 22:23 ` Steve Wise
0 siblings, 1 reply; 6+ messages in thread
From: Jason Gunthorpe @ 2018-03-01 22:19 UTC (permalink / raw)
To: Bart Van Assche
Cc: Doug Ledford, Laurence Oberman, linux-rdma, Steve Wise,
Sagi Grimberg, stable
On Thu, Mar 01, 2018 at 02:00:28PM -0800, Bart Van Assche wrote:
> This patch fixes the following KASAN complaint:
>
> ==================================================================
> BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x77d/0x9b0 [rdma_rxe]
> Read of size 8 at addr ffff880061aef860 by task 01/1080
>
> CPU: 2 PID: 1080 Comm: 01 Not tainted 4.16.0-rc3-dbg+ #2
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
> Call Trace:
> dump_stack+0x85/0xc7
> print_address_description+0x65/0x270
> kasan_report+0x231/0x350
> rxe_post_send+0x77d/0x9b0 [rdma_rxe]
> __ib_drain_sq+0x1ad/0x250 [ib_core]
> ib_drain_qp+0x9/0x30 [ib_core]
> srp_destroy_qp+0x51/0x70 [ib_srp]
> srp_free_ch_ib+0xfc/0x380 [ib_srp]
> srp_create_target+0x1071/0x19e0 [ib_srp]
> kernfs_fop_write+0x180/0x210
> __vfs_write+0xb1/0x2e0
> vfs_write+0xf6/0x250
> SyS_write+0x99/0x110
> do_syscall_64+0xee/0x2b0
> entry_SYSCALL_64_after_hwframe+0x42/0xb7
>
> The buggy address belongs to the page:
> page:ffffea000186bbc0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
> flags: 0x4000000000000000()
> raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
> raw: 0000000000000000 ffffea000186bbe0 0000000000000000 0000000000000000
> page dumped because: kasan: bad access detected
>
> Memory state around the buggy address:
> ffff880061aef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> ffff880061aef780: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
> >ffff880061aef800: f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 f2 f2 f2 f2
> ^
> ffff880061aef880: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f2 f2
> ffff880061aef900: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
> ==================================================================
>
> Fixes: 765d67748bcf ("IB: new common API for draining queues")
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Steve Wise <swise@opengridcomputing.com>
> Cc: Sagi Grimberg <sagi@grimberg.me>
> Cc: stable@vger.kernel.org
> drivers/infiniband/core/verbs.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index 2c7b0ceb46e6..4e2b231b03f7 100644
> +++ b/drivers/infiniband/core/verbs.c
> @@ -2194,7 +2194,13 @@ static void __ib_drain_sq(struct ib_qp *qp)
> struct ib_cq *cq = qp->send_cq;
> struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> struct ib_drain_cqe sdrain;
> - struct ib_send_wr swr = {}, *bad_swr;
> + struct ib_send_wr *bad_swr;
> + struct ib_rdma_wr swr = {
> + .wr = {
> + .opcode = IB_WR_RDMA_WRITE,
> + .wr_cqe = &sdrain.cqe,
> + },
> + };
I don't get it..
Since when did ib_post_send() start requiring a ib_rdma_wr?
IB_WR_RDMA_WRITE == 0, so even missing that is 'OK' but ugly.
What is the actual bug here?
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread* RE: [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access
2018-03-01 22:19 ` Jason Gunthorpe
@ 2018-03-01 22:23 ` Steve Wise
2018-03-01 22:46 ` Jason Gunthorpe
0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2018-03-01 22:23 UTC (permalink / raw)
To: 'Jason Gunthorpe', 'Bart Van Assche'
Cc: 'Doug Ledford', 'Laurence Oberman', linux-rdma,
'Sagi Grimberg', stable
> =
> > BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x77d/0x9b0 [rdma_rxe]
> > Read of size 8 at addr ffff880061aef860 by task 01/1080
> >
> > CPU: 2 PID: 1080 Comm: 01 Not tainted 4.16.0-rc3-dbg+ #2
> > Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-
> prebuilt.qemu-project.org 04/01/2014
> > Call Trace:
> > dump_stack+0x85/0xc7
> > print_address_description+0x65/0x270
> > kasan_report+0x231/0x350
> > rxe_post_send+0x77d/0x9b0 [rdma_rxe]
> > __ib_drain_sq+0x1ad/0x250 [ib_core]
> > ib_drain_qp+0x9/0x30 [ib_core]
> > srp_destroy_qp+0x51/0x70 [ib_srp]
> > srp_free_ch_ib+0xfc/0x380 [ib_srp]
> > srp_create_target+0x1071/0x19e0 [ib_srp]
> > kernfs_fop_write+0x180/0x210
> > __vfs_write+0xb1/0x2e0
> > vfs_write+0xf6/0x250
> > SyS_write+0x99/0x110
> > do_syscall_64+0xee/0x2b0
> > entry_SYSCALL_64_after_hwframe+0x42/0xb7
> >
> > The buggy address belongs to the page:
> > page:ffffea000186bbc0 count:0 mapcount:0 mapping:0000000000000000
> index:0x0
> > flags: 0x4000000000000000()
> > raw: 4000000000000000 0000000000000000 0000000000000000
> 00000000ffffffff
> > raw: 0000000000000000 ffffea000186bbe0 0000000000000000
> 0000000000000000
> > page dumped because: kasan: bad access detected
> >
> > Memory state around the buggy address:
> > ffff880061aef700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> > ffff880061aef780: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
> > >ffff880061aef800: f2 f2 f2 f2 f2 f2 f2 00 00 00 00 00 f2 f2 f2 f2
> > ^
> > ffff880061aef880: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 f2 f2
> > ffff880061aef900: f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00 00
> >
> =================================================================
> =
> >
> > Fixes: 765d67748bcf ("IB: new common API for draining queues")
> > Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> > Cc: Steve Wise <swise@opengridcomputing.com>
> > Cc: Sagi Grimberg <sagi@grimberg.me>
> > Cc: stable@vger.kernel.org
> > drivers/infiniband/core/verbs.c | 11 ++++++++---
> > 1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/verbs.c
b/drivers/infiniband/core/verbs.c
> > index 2c7b0ceb46e6..4e2b231b03f7 100644
> > +++ b/drivers/infiniband/core/verbs.c
> > @@ -2194,7 +2194,13 @@ static void __ib_drain_sq(struct ib_qp *qp)
> > struct ib_cq *cq = qp->send_cq;
> > struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> > struct ib_drain_cqe sdrain;
> > - struct ib_send_wr swr = {}, *bad_swr;
> > + struct ib_send_wr *bad_swr;
> > + struct ib_rdma_wr swr = {
> > + .wr = {
> > + .opcode = IB_WR_RDMA_WRITE,
> > + .wr_cqe = &sdrain.cqe,
> > + },
> > + };
>
> I don't get it..
>
> Since when did ib_post_send() start requiring a ib_rdma_wr?
>
> IB_WR_RDMA_WRITE == 0, so even missing that is 'OK' but ugly.
>
> What is the actual bug here?
>
The WRs are now split up, so struct ib_send_wr doesn't encompass the full
size of all the possible WRs. See ib_rdma_wr, for example, which includes
ib_send_wr. So the bug is the drain code is posting a WRITE wr, but not
including the entire struct ib_rdma_wr.
Steve
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access
2018-03-01 22:23 ` Steve Wise
@ 2018-03-01 22:46 ` Jason Gunthorpe
0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2018-03-01 22:46 UTC (permalink / raw)
To: Steve Wise
Cc: 'Bart Van Assche', 'Doug Ledford',
'Laurence Oberman', linux-rdma, 'Sagi Grimberg',
stable
On Thu, Mar 01, 2018 at 04:23:15PM -0600, Steve Wise wrote:
> > I don't get it..
> >
> > Since when did ib_post_send() start requiring a ib_rdma_wr?
> >
> > IB_WR_RDMA_WRITE == 0, so even missing that is 'OK' but ugly.
> >
> > What is the actual bug here?
> >
>
> The WRs are now split up, so struct ib_send_wr doesn't encompass the full
> size of all the possible WRs. See ib_rdma_wr, for example, which includes
> ib_send_wr. So the bug is the drain code is posting a WRITE wr, but not
> including the entire struct ib_rdma_wr.
Oh.. yes, I forgot about that patch. Thanks, OK.
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/3] RDMA/rxe: Fix an out-of-bounds read
[not found] <20180301220030.27433-1-bart.vanassche@wdc.com>
2018-03-01 22:00 ` [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access Bart Van Assche
@ 2018-03-01 22:00 ` Bart Van Assche
2018-03-01 22:00 ` [PATCH 3/3] IB/srpt: Fix an out-of-bounds stack access in srpt_zerolength_write() Bart Van Assche
2 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2018-03-01 22:00 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Doug Ledford, Laurence Oberman, linux-rdma, Bart Van Assche,
Moni Shoua, stable
This patch avoids that KASAN reports the following when the SRP initiator
calls srp_post_send():
==================================================================
BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x5c4/0x980 [rdma_rxe]
Read of size 8 at addr ffff880066606e30 by task 02-mq/1074
CPU: 2 PID: 1074 Comm: 02-mq Not tainted 4.16.0-rc3-dbg+ #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.0.0-prebuilt.qemu-project.org 04/01/2014
Call Trace:
dump_stack+0x85/0xc7
print_address_description+0x65/0x270
kasan_report+0x231/0x350
rxe_post_send+0x5c4/0x980 [rdma_rxe]
srp_post_send.isra.16+0x149/0x190 [ib_srp]
srp_queuecommand+0x94d/0x1670 [ib_srp]
scsi_dispatch_cmd+0x1c2/0x550 [scsi_mod]
scsi_queue_rq+0x843/0xa70 [scsi_mod]
blk_mq_dispatch_rq_list+0x143/0xac0
blk_mq_do_dispatch_ctx+0x1c5/0x260
blk_mq_sched_dispatch_requests+0x2bf/0x2f0
__blk_mq_run_hw_queue+0xdb/0x160
__blk_mq_delay_run_hw_queue+0xba/0x100
blk_mq_run_hw_queue+0xf2/0x190
blk_mq_sched_insert_request+0x163/0x2f0
blk_execute_rq+0xb0/0x130
scsi_execute+0x14e/0x260 [scsi_mod]
scsi_probe_and_add_lun+0x366/0x13d0 [scsi_mod]
__scsi_scan_target+0x18a/0x810 [scsi_mod]
scsi_scan_target+0x11e/0x130 [scsi_mod]
srp_create_target+0x1522/0x19e0 [ib_srp]
kernfs_fop_write+0x180/0x210
__vfs_write+0xb1/0x2e0
vfs_write+0xf6/0x250
SyS_write+0x99/0x110
do_syscall_64+0xee/0x2b0
entry_SYSCALL_64_after_hwframe+0x42/0xb7
The buggy address belongs to the page:
page:ffffea0001998180 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x4000000000000000()
raw: 4000000000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: dead000000000100 dead000000000200 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff880066606d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1
ffff880066606d80: f1 00 f2 f2 f2 f2 f2 f2 f2 00 00 f2 f2 f2 f2 f2
>ffff880066606e00: f2 00 00 00 00 00 f2 f2 f2 f3 f3 f3 f3 00 00 00
^
ffff880066606e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff880066606f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
Fixes: 8700e3e7c485 ("Soft RoCE driver")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Moni Shoua <monis@mellanox.com>
Cc: stable@vger.kernel.org
---
drivers/infiniband/sw/rxe/rxe_verbs.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 3d99965e54fe..753d281b8321 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -711,9 +711,8 @@ static int init_send_wqe(struct rxe_qp *qp, const struct ib_send_wr *ibwr,
memcpy(wqe->dma.sge, ibwr->sg_list,
num_sge * sizeof(struct ib_sge));
- wqe->iova = (mask & WR_ATOMIC_MASK) ?
- atomic_wr(ibwr)->remote_addr :
- rdma_wr(ibwr)->remote_addr;
+ wqe->iova = mask & WR_ATOMIC_MASK ? atomic_wr(ibwr)->remote_addr :
+ mask & WR_READ_OR_WRITE_MASK ? rdma_wr(ibwr)->remote_addr : 0;
wqe->mask = mask;
wqe->dma.length = length;
wqe->dma.resid = length;
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] IB/srpt: Fix an out-of-bounds stack access in srpt_zerolength_write()
[not found] <20180301220030.27433-1-bart.vanassche@wdc.com>
2018-03-01 22:00 ` [PATCH 1/3] RDMA/core: Avoid that ib_drain_qp() triggers an out-of-bounds stack access Bart Van Assche
2018-03-01 22:00 ` [PATCH 2/3] RDMA/rxe: Fix an out-of-bounds read Bart Van Assche
@ 2018-03-01 22:00 ` Bart Van Assche
2 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2018-03-01 22:00 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Doug Ledford, Laurence Oberman, linux-rdma, Bart Van Assche,
Christoph Hellwig, stable
Avoid triggering an out-of-bounds stack access by changing the type
of 'wr' from ib_send_wr into ib_rdma_wr.
This patch fixes the following KASAN bug report:
BUG: KASAN: stack-out-of-bounds in rxe_post_send+0x7a9/0x9a0 [rdma_rxe]
Read of size 8 at addr ffff880068197a48 by task kworker/2:1/44
Workqueue: ib_cm cm_work_handler [ib_cm]
Call Trace:
dump_stack+0x8e/0xcd
print_address_description+0x6f/0x280
kasan_report+0x25a/0x380
__asan_load8+0x54/0x90
rxe_post_send+0x7a9/0x9a0 [rdma_rxe]
srpt_zerolength_write+0xf0/0x180 [ib_srpt]
srpt_cm_rtu_recv+0x68/0x110 [ib_srpt]
srpt_rdma_cm_handler+0xbb/0x15b [ib_srpt]
cma_ib_handler+0x1aa/0x4a0 [rdma_cm]
cm_process_work+0x30/0x100 [ib_cm]
cm_work_handler+0xa86/0x351b [ib_cm]
process_one_work+0x475/0x9f0
worker_thread+0x69/0x690
kthread+0x1ad/0x1d0
ret_from_fork+0x3a/0x50
Fixes: aaf45bd83eba ("IB/srpt: Detect session shutdown reliably")
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
---
drivers/infiniband/ulp/srpt/ib_srpt.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 4339ab0607b7..6305da34b5de 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -848,16 +848,19 @@ static int srpt_post_recv(struct srpt_device *sdev, struct srpt_rdma_ch *ch,
*/
static int srpt_zerolength_write(struct srpt_rdma_ch *ch)
{
- struct ib_send_wr wr, *bad_wr;
+ struct ib_send_wr *bad_wr;
+ struct ib_rdma_wr wr = {
+ .wr = {
+ .opcode = IB_WR_RDMA_WRITE,
+ .wr_cqe = &ch->zw_cqe,
+ .send_flags = IB_SEND_SIGNALED,
+ }
+ };
pr_debug("%s-%d: queued zerolength write\n", ch->sess_name,
ch->qp->qp_num);
- memset(&wr, 0, sizeof(wr));
- wr.opcode = IB_WR_RDMA_WRITE;
- wr.wr_cqe = &ch->zw_cqe;
- wr.send_flags = IB_SEND_SIGNALED;
- return ib_post_send(ch->qp, &wr, &bad_wr);
+ return ib_post_send(ch->qp, &wr.wr, &bad_wr);
}
static void srpt_zerolength_write_done(struct ib_cq *cq, struct ib_wc *wc)
--
2.16.2
^ permalink raw reply related [flat|nested] 6+ messages in thread