diff options
-rw-r--r-- | net/rds/ib_send.c | 26 | ||||
-rw-r--r-- | net/rds/iw_send.c | 24 | ||||
-rw-r--r-- | net/rds/message.c | 22 | ||||
-rw-r--r-- | net/rds/rds.h | 6 | ||||
-rw-r--r-- | net/rds/send.c | 10 | ||||
-rw-r--r-- | net/rds/tcp_send.c | 14 |
6 files changed, 51 insertions, 51 deletions
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c index 63981cd1827a..95f15247acd7 100644 --- a/net/rds/ib_send.c +++ b/net/rds/ib_send.c | |||
@@ -76,7 +76,7 @@ static void rds_ib_send_unmap_rm(struct rds_ib_connection *ic, | |||
76 | rdsdebug("ic %p send %p rm %p\n", ic, send, rm); | 76 | rdsdebug("ic %p send %p rm %p\n", ic, send, rm); |
77 | 77 | ||
78 | ib_dma_unmap_sg(ic->i_cm_id->device, | 78 | ib_dma_unmap_sg(ic->i_cm_id->device, |
79 | rm->data.m_sg, rm->data.m_nents, | 79 | rm->data.op_sg, rm->data.op_nents, |
80 | DMA_TO_DEVICE); | 80 | DMA_TO_DEVICE); |
81 | 81 | ||
82 | if (rm->rdma.op_active) { | 82 | if (rm->rdma.op_active) { |
@@ -513,20 +513,20 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
513 | 513 | ||
514 | /* map the message the first time we see it */ | 514 | /* map the message the first time we see it */ |
515 | if (!ic->i_rm) { | 515 | if (!ic->i_rm) { |
516 | if (rm->data.m_nents) { | 516 | if (rm->data.op_nents) { |
517 | rm->data.m_count = ib_dma_map_sg(dev, | 517 | rm->data.op_count = ib_dma_map_sg(dev, |
518 | rm->data.m_sg, | 518 | rm->data.op_sg, |
519 | rm->data.m_nents, | 519 | rm->data.op_nents, |
520 | DMA_TO_DEVICE); | 520 | DMA_TO_DEVICE); |
521 | rdsdebug("ic %p mapping rm %p: %d\n", ic, rm, rm->data.m_count); | 521 | rdsdebug("ic %p mapping rm %p: %d\n", ic, rm, rm->data.op_count); |
522 | if (rm->data.m_count == 0) { | 522 | if (rm->data.op_count == 0) { |
523 | rds_ib_stats_inc(s_ib_tx_sg_mapping_failure); | 523 | rds_ib_stats_inc(s_ib_tx_sg_mapping_failure); |
524 | rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc); | 524 | rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc); |
525 | ret = -ENOMEM; /* XXX ? */ | 525 | ret = -ENOMEM; /* XXX ? */ |
526 | goto out; | 526 | goto out; |
527 | } | 527 | } |
528 | } else { | 528 | } else { |
529 | rm->data.m_count = 0; | 529 | rm->data.op_count = 0; |
530 | } | 530 | } |
531 | 531 | ||
532 | rds_message_addref(rm); | 532 | rds_message_addref(rm); |
@@ -583,7 +583,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
583 | send = &ic->i_sends[pos]; | 583 | send = &ic->i_sends[pos]; |
584 | first = send; | 584 | first = send; |
585 | prev = NULL; | 585 | prev = NULL; |
586 | scat = &rm->data.m_sg[sg]; | 586 | scat = &rm->data.op_sg[sg]; |
587 | i = 0; | 587 | i = 0; |
588 | do { | 588 | do { |
589 | unsigned int len = 0; | 589 | unsigned int len = 0; |
@@ -604,7 +604,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
604 | 604 | ||
605 | /* Set up the data, if present */ | 605 | /* Set up the data, if present */ |
606 | if (i < work_alloc | 606 | if (i < work_alloc |
607 | && scat != &rm->data.m_sg[rm->data.m_count]) { | 607 | && scat != &rm->data.op_sg[rm->data.op_count]) { |
608 | len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off); | 608 | len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off); |
609 | send->s_wr.num_sge = 2; | 609 | send->s_wr.num_sge = 2; |
610 | 610 | ||
@@ -649,7 +649,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
649 | i++; | 649 | i++; |
650 | 650 | ||
651 | } while (i < work_alloc | 651 | } while (i < work_alloc |
652 | && scat != &rm->data.m_sg[rm->data.m_count]); | 652 | && scat != &rm->data.op_sg[rm->data.op_count]); |
653 | 653 | ||
654 | /* Account the RDS header in the number of bytes we sent, but just once. | 654 | /* Account the RDS header in the number of bytes we sent, but just once. |
655 | * The caller has no concept of fragmentation. */ | 655 | * The caller has no concept of fragmentation. */ |
@@ -657,7 +657,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
657 | bytes_sent += sizeof(struct rds_header); | 657 | bytes_sent += sizeof(struct rds_header); |
658 | 658 | ||
659 | /* if we finished the message then send completion owns it */ | 659 | /* if we finished the message then send completion owns it */ |
660 | if (scat == &rm->data.m_sg[rm->data.m_count]) { | 660 | if (scat == &rm->data.op_sg[rm->data.op_count]) { |
661 | prev->s_rm = ic->i_rm; | 661 | prev->s_rm = ic->i_rm; |
662 | prev->s_wr.send_flags |= IB_SEND_SOLICITED; | 662 | prev->s_wr.send_flags |= IB_SEND_SOLICITED; |
663 | ic->i_rm = NULL; | 663 | ic->i_rm = NULL; |
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c index 05ebf16ecad7..6280ea020d4e 100644 --- a/net/rds/iw_send.c +++ b/net/rds/iw_send.c | |||
@@ -82,7 +82,7 @@ static void rds_iw_send_unmap_rm(struct rds_iw_connection *ic, | |||
82 | rdsdebug("ic %p send %p rm %p\n", ic, send, rm); | 82 | rdsdebug("ic %p send %p rm %p\n", ic, send, rm); |
83 | 83 | ||
84 | ib_dma_unmap_sg(ic->i_cm_id->device, | 84 | ib_dma_unmap_sg(ic->i_cm_id->device, |
85 | rm->data.m_sg, rm->data.m_nents, | 85 | rm->data.op_sg, rm->data.op_nents, |
86 | DMA_TO_DEVICE); | 86 | DMA_TO_DEVICE); |
87 | 87 | ||
88 | if (rm->rdma.op_active) { | 88 | if (rm->rdma.op_active) { |
@@ -562,20 +562,20 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
562 | rm->m_inc.i_hdr.h_flags, | 562 | rm->m_inc.i_hdr.h_flags, |
563 | be32_to_cpu(rm->m_inc.i_hdr.h_len)); | 563 | be32_to_cpu(rm->m_inc.i_hdr.h_len)); |
564 | */ | 564 | */ |
565 | if (rm->data.m_nents) { | 565 | if (rm->data.op_nents) { |
566 | rm->data.m_count = ib_dma_map_sg(dev, | 566 | rm->data.op_count = ib_dma_map_sg(dev, |
567 | rm->data.m_sg, | 567 | rm->data.op_sg, |
568 | rm->data.m_nents, | 568 | rm->data.op_nents, |
569 | DMA_TO_DEVICE); | 569 | DMA_TO_DEVICE); |
570 | rdsdebug("ic %p mapping rm %p: %d\n", ic, rm, rm->data.m_count); | 570 | rdsdebug("ic %p mapping rm %p: %d\n", ic, rm, rm->data.op_count); |
571 | if (rm->data.m_count == 0) { | 571 | if (rm->data.op_count == 0) { |
572 | rds_iw_stats_inc(s_iw_tx_sg_mapping_failure); | 572 | rds_iw_stats_inc(s_iw_tx_sg_mapping_failure); |
573 | rds_iw_ring_unalloc(&ic->i_send_ring, work_alloc); | 573 | rds_iw_ring_unalloc(&ic->i_send_ring, work_alloc); |
574 | ret = -ENOMEM; /* XXX ? */ | 574 | ret = -ENOMEM; /* XXX ? */ |
575 | goto out; | 575 | goto out; |
576 | } | 576 | } |
577 | } else { | 577 | } else { |
578 | rm->data.m_count = 0; | 578 | rm->data.op_count = 0; |
579 | } | 579 | } |
580 | 580 | ||
581 | ic->i_unsignaled_wrs = rds_iw_sysctl_max_unsig_wrs; | 581 | ic->i_unsignaled_wrs = rds_iw_sysctl_max_unsig_wrs; |
@@ -622,7 +622,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
622 | send = &ic->i_sends[pos]; | 622 | send = &ic->i_sends[pos]; |
623 | first = send; | 623 | first = send; |
624 | prev = NULL; | 624 | prev = NULL; |
625 | scat = &rm->data.m_sg[sg]; | 625 | scat = &rm->data.op_sg[sg]; |
626 | sent = 0; | 626 | sent = 0; |
627 | i = 0; | 627 | i = 0; |
628 | 628 | ||
@@ -651,7 +651,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
651 | } | 651 | } |
652 | 652 | ||
653 | /* if there's data reference it with a chain of work reqs */ | 653 | /* if there's data reference it with a chain of work reqs */ |
654 | for (; i < work_alloc && scat != &rm->data.m_sg[rm->data.m_count]; i++) { | 654 | for (; i < work_alloc && scat != &rm->data.op_sg[rm->data.op_count]; i++) { |
655 | unsigned int len; | 655 | unsigned int len; |
656 | 656 | ||
657 | send = &ic->i_sends[pos]; | 657 | send = &ic->i_sends[pos]; |
@@ -729,7 +729,7 @@ add_header: | |||
729 | sent += sizeof(struct rds_header); | 729 | sent += sizeof(struct rds_header); |
730 | 730 | ||
731 | /* if we finished the message then send completion owns it */ | 731 | /* if we finished the message then send completion owns it */ |
732 | if (scat == &rm->data.m_sg[rm->data.m_count]) { | 732 | if (scat == &rm->data.op_sg[rm->data.op_count]) { |
733 | prev->s_rm = ic->i_rm; | 733 | prev->s_rm = ic->i_rm; |
734 | prev->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED; | 734 | prev->s_wr.send_flags |= IB_SEND_SIGNALED | IB_SEND_SOLICITED; |
735 | ic->i_rm = NULL; | 735 | ic->i_rm = NULL; |
diff --git a/net/rds/message.c b/net/rds/message.c index bca7eda6dde9..4bd9504ca048 100644 --- a/net/rds/message.c +++ b/net/rds/message.c | |||
@@ -62,12 +62,12 @@ static void rds_message_purge(struct rds_message *rm) | |||
62 | if (unlikely(test_bit(RDS_MSG_PAGEVEC, &rm->m_flags))) | 62 | if (unlikely(test_bit(RDS_MSG_PAGEVEC, &rm->m_flags))) |
63 | return; | 63 | return; |
64 | 64 | ||
65 | for (i = 0; i < rm->data.m_nents; i++) { | 65 | for (i = 0; i < rm->data.op_nents; i++) { |
66 | rdsdebug("putting data page %p\n", (void *)sg_page(&rm->data.m_sg[i])); | 66 | rdsdebug("putting data page %p\n", (void *)sg_page(&rm->data.op_sg[i])); |
67 | /* XXX will have to put_page for page refs */ | 67 | /* XXX will have to put_page for page refs */ |
68 | __free_page(sg_page(&rm->data.m_sg[i])); | 68 | __free_page(sg_page(&rm->data.op_sg[i])); |
69 | } | 69 | } |
70 | rm->data.m_nents = 0; | 70 | rm->data.op_nents = 0; |
71 | 71 | ||
72 | if (rm->rdma.op_active) | 72 | if (rm->rdma.op_active) |
73 | rds_rdma_free_op(&rm->rdma); | 73 | rds_rdma_free_op(&rm->rdma); |
@@ -261,11 +261,11 @@ struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in | |||
261 | 261 | ||
262 | set_bit(RDS_MSG_PAGEVEC, &rm->m_flags); | 262 | set_bit(RDS_MSG_PAGEVEC, &rm->m_flags); |
263 | rm->m_inc.i_hdr.h_len = cpu_to_be32(total_len); | 263 | rm->m_inc.i_hdr.h_len = cpu_to_be32(total_len); |
264 | rm->data.m_nents = ceil(total_len, PAGE_SIZE); | 264 | rm->data.op_nents = ceil(total_len, PAGE_SIZE); |
265 | rm->data.m_sg = rds_message_alloc_sgs(rm, num_sgs); | 265 | rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs); |
266 | 266 | ||
267 | for (i = 0; i < rm->data.m_nents; ++i) { | 267 | for (i = 0; i < rm->data.op_nents; ++i) { |
268 | sg_set_page(&rm->data.m_sg[i], | 268 | sg_set_page(&rm->data.op_sg[i], |
269 | virt_to_page(page_addrs[i]), | 269 | virt_to_page(page_addrs[i]), |
270 | PAGE_SIZE, 0); | 270 | PAGE_SIZE, 0); |
271 | } | 271 | } |
@@ -288,7 +288,7 @@ int rds_message_copy_from_user(struct rds_message *rm, struct iovec *first_iov, | |||
288 | /* | 288 | /* |
289 | * now allocate and copy in the data payload. | 289 | * now allocate and copy in the data payload. |
290 | */ | 290 | */ |
291 | sg = rm->data.m_sg; | 291 | sg = rm->data.op_sg; |
292 | iov = first_iov; | 292 | iov = first_iov; |
293 | iov_off = 0; | 293 | iov_off = 0; |
294 | sg_off = 0; /* Dear gcc, sg->page will be null from kzalloc. */ | 294 | sg_off = 0; /* Dear gcc, sg->page will be null from kzalloc. */ |
@@ -299,7 +299,7 @@ int rds_message_copy_from_user(struct rds_message *rm, struct iovec *first_iov, | |||
299 | GFP_HIGHUSER); | 299 | GFP_HIGHUSER); |
300 | if (ret) | 300 | if (ret) |
301 | goto out; | 301 | goto out; |
302 | rm->data.m_nents++; | 302 | rm->data.op_nents++; |
303 | sg_off = 0; | 303 | sg_off = 0; |
304 | } | 304 | } |
305 | 305 | ||
@@ -354,7 +354,7 @@ int rds_message_inc_copy_to_user(struct rds_incoming *inc, | |||
354 | 354 | ||
355 | iov = first_iov; | 355 | iov = first_iov; |
356 | iov_off = 0; | 356 | iov_off = 0; |
357 | sg = rm->data.m_sg; | 357 | sg = rm->data.op_sg; |
358 | vec_off = 0; | 358 | vec_off = 0; |
359 | copied = 0; | 359 | copied = 0; |
360 | 360 | ||
diff --git a/net/rds/rds.h b/net/rds/rds.h index 76eeb5988b5f..d70284989124 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h | |||
@@ -339,9 +339,9 @@ struct rds_message { | |||
339 | } rdma; | 339 | } rdma; |
340 | struct rm_data_op { | 340 | struct rm_data_op { |
341 | unsigned int op_active:1; | 341 | unsigned int op_active:1; |
342 | unsigned int m_nents; | 342 | unsigned int op_nents; |
343 | unsigned int m_count; | 343 | unsigned int op_count; |
344 | struct scatterlist *m_sg; | 344 | struct scatterlist *op_sg; |
345 | } data; | 345 | } data; |
346 | }; | 346 | }; |
347 | unsigned int m_used_sgs; | 347 | unsigned int m_used_sgs; |
diff --git a/net/rds/send.c b/net/rds/send.c index 08df279ced2a..d60d31309032 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
@@ -166,7 +166,7 @@ int rds_send_xmit(struct rds_connection *conn) | |||
166 | rm = conn->c_xmit_rm; | 166 | rm = conn->c_xmit_rm; |
167 | if (rm && | 167 | if (rm && |
168 | conn->c_xmit_hdr_off == sizeof(struct rds_header) && | 168 | conn->c_xmit_hdr_off == sizeof(struct rds_header) && |
169 | conn->c_xmit_sg == rm->data.m_nents) { | 169 | conn->c_xmit_sg == rm->data.op_nents) { |
170 | conn->c_xmit_rm = NULL; | 170 | conn->c_xmit_rm = NULL; |
171 | conn->c_xmit_sg = 0; | 171 | conn->c_xmit_sg = 0; |
172 | conn->c_xmit_hdr_off = 0; | 172 | conn->c_xmit_hdr_off = 0; |
@@ -296,7 +296,7 @@ int rds_send_xmit(struct rds_connection *conn) | |||
296 | 296 | ||
297 | if (rm->data.op_active | 297 | if (rm->data.op_active |
298 | && (conn->c_xmit_hdr_off < sizeof(struct rds_header) || | 298 | && (conn->c_xmit_hdr_off < sizeof(struct rds_header) || |
299 | conn->c_xmit_sg < rm->data.m_nents)) { | 299 | conn->c_xmit_sg < rm->data.op_nents)) { |
300 | ret = conn->c_trans->xmit(conn, rm, | 300 | ret = conn->c_trans->xmit(conn, rm, |
301 | conn->c_xmit_hdr_off, | 301 | conn->c_xmit_hdr_off, |
302 | conn->c_xmit_sg, | 302 | conn->c_xmit_sg, |
@@ -312,7 +312,7 @@ int rds_send_xmit(struct rds_connection *conn) | |||
312 | ret -= tmp; | 312 | ret -= tmp; |
313 | } | 313 | } |
314 | 314 | ||
315 | sg = &rm->data.m_sg[conn->c_xmit_sg]; | 315 | sg = &rm->data.op_sg[conn->c_xmit_sg]; |
316 | while (ret) { | 316 | while (ret) { |
317 | tmp = min_t(int, ret, sg->length - | 317 | tmp = min_t(int, ret, sg->length - |
318 | conn->c_xmit_data_off); | 318 | conn->c_xmit_data_off); |
@@ -323,7 +323,7 @@ int rds_send_xmit(struct rds_connection *conn) | |||
323 | sg++; | 323 | sg++; |
324 | conn->c_xmit_sg++; | 324 | conn->c_xmit_sg++; |
325 | BUG_ON(ret != 0 && | 325 | BUG_ON(ret != 0 && |
326 | conn->c_xmit_sg == rm->data.m_nents); | 326 | conn->c_xmit_sg == rm->data.op_nents); |
327 | } | 327 | } |
328 | } | 328 | } |
329 | } | 329 | } |
@@ -959,7 +959,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
959 | goto out; | 959 | goto out; |
960 | } | 960 | } |
961 | 961 | ||
962 | rm->data.m_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE)); | 962 | rm->data.op_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE)); |
963 | /* XXX fix this to not allocate memory */ | 963 | /* XXX fix this to not allocate memory */ |
964 | ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len); | 964 | ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len); |
965 | if (ret) | 965 | if (ret) |
diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c index d63aa35ac673..53c1de55f471 100644 --- a/net/rds/tcp_send.c +++ b/net/rds/tcp_send.c | |||
@@ -166,21 +166,21 @@ int rds_tcp_xmit(struct rds_connection *conn, struct rds_message *rm, | |||
166 | goto out; | 166 | goto out; |
167 | } | 167 | } |
168 | 168 | ||
169 | while (sg < rm->data.m_nents) { | 169 | while (sg < rm->data.op_nents) { |
170 | ret = tc->t_sock->ops->sendpage(tc->t_sock, | 170 | ret = tc->t_sock->ops->sendpage(tc->t_sock, |
171 | sg_page(&rm->data.m_sg[sg]), | 171 | sg_page(&rm->data.op_sg[sg]), |
172 | rm->data.m_sg[sg].offset + off, | 172 | rm->data.op_sg[sg].offset + off, |
173 | rm->data.m_sg[sg].length - off, | 173 | rm->data.op_sg[sg].length - off, |
174 | MSG_DONTWAIT|MSG_NOSIGNAL); | 174 | MSG_DONTWAIT|MSG_NOSIGNAL); |
175 | rdsdebug("tcp sendpage %p:%u:%u ret %d\n", (void *)sg_page(&rm->data.m_sg[sg]), | 175 | rdsdebug("tcp sendpage %p:%u:%u ret %d\n", (void *)sg_page(&rm->data.op_sg[sg]), |
176 | rm->data.m_sg[sg].offset + off, rm->data.m_sg[sg].length - off, | 176 | rm->data.op_sg[sg].offset + off, rm->data.op_sg[sg].length - off, |
177 | ret); | 177 | ret); |
178 | if (ret <= 0) | 178 | if (ret <= 0) |
179 | break; | 179 | break; |
180 | 180 | ||
181 | off += ret; | 181 | off += ret; |
182 | done += ret; | 182 | done += ret; |
183 | if (off == rm->data.m_sg[sg].length) { | 183 | if (off == rm->data.op_sg[sg].length) { |
184 | off = 0; | 184 | off = 0; |
185 | sg++; | 185 | sg++; |
186 | } | 186 | } |