diff options
author | Doug Ledford <dledford@redhat.com> | 2015-06-02 13:33:22 (GMT) |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2015-06-02 13:33:22 (GMT) |
commit | b806ef3bbed39c95b45343bf0fd78802142f6017 (patch) | |
tree | eab4e67bef332c78c25d95e00b2d6ce3241f1aee /net/rds/ib_send.c | |
parent | 73cdaaeed10d91441cb946200b5dbbbeb143bace (diff) | |
parent | 1156256811e42908fd13c4cfcf32965d8b93f2a8 (diff) | |
download | linux-b806ef3bbed39c95b45343bf0fd78802142f6017.tar.xz |
Merge branch 'for-4.2-misc' into k.o/for-4.2
Diffstat (limited to 'net/rds/ib_send.c')
-rw-r--r-- | net/rds/ib_send.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 25d0482..5d0a704 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c @@ -571,6 +571,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, } rds_message_addref(rm); + rm->data.op_dmasg = 0; + rm->data.op_dmaoff = 0; ic->i_data_op = &rm->data; /* Finalize the header */ @@ -624,7 +626,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, send = &ic->i_sends[pos]; first = send; prev = NULL; - scat = &ic->i_data_op->op_sg[sg]; + scat = &ic->i_data_op->op_sg[rm->data.op_dmasg]; i = 0; do { unsigned int len = 0; @@ -646,17 +648,20 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, /* Set up the data, if present */ if (i < work_alloc && scat != &rm->data.op_sg[rm->data.op_count]) { - len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off); + len = min(RDS_FRAG_SIZE, + ib_sg_dma_len(dev, scat) - rm->data.op_dmaoff); send->s_wr.num_sge = 2; - send->s_sge[1].addr = ib_sg_dma_address(dev, scat) + off; + send->s_sge[1].addr = ib_sg_dma_address(dev, scat); + send->s_sge[1].addr += rm->data.op_dmaoff; send->s_sge[1].length = len; bytes_sent += len; - off += len; - if (off == ib_sg_dma_len(dev, scat)) { + rm->data.op_dmaoff += len; + if (rm->data.op_dmaoff == ib_sg_dma_len(dev, scat)) { scat++; - off = 0; + rm->data.op_dmasg++; + rm->data.op_dmaoff = 0; } } |