diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-21 16:21:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-21 16:21:35 -0400 |
commit | a418500b42c5c54f3f9d68036950c701740a2765 (patch) | |
tree | 17541c0ab858c3251a4e0ef802a9ac74f425943e /drivers | |
parent | 62a36c43c898d45efcfe3376ea1da6a9a182e1ad (diff) | |
parent | f2065e4242e5078d53c521b973c5cd4eae91eca2 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/core/mad_rmpp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index 2bd8b1cc57c4..e23836d0e21b 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -412,8 +412,8 @@ static inline int get_mad_len(struct mad_rmpp_recv *rmpp_recv) | |||
412 | 412 | ||
413 | hdr_size = data_offset(rmpp_mad->mad_hdr.mgmt_class); | 413 | hdr_size = data_offset(rmpp_mad->mad_hdr.mgmt_class); |
414 | data_size = sizeof(struct ib_rmpp_mad) - hdr_size; | 414 | data_size = sizeof(struct ib_rmpp_mad) - hdr_size; |
415 | pad = data_size - be32_to_cpu(rmpp_mad->rmpp_hdr.paylen_newwin); | 415 | pad = IB_MGMT_RMPP_DATA - be32_to_cpu(rmpp_mad->rmpp_hdr.paylen_newwin); |
416 | if (pad > data_size || pad < 0) | 416 | if (pad > IB_MGMT_RMPP_DATA || pad < 0) |
417 | pad = 0; | 417 | pad = 0; |
418 | 418 | ||
419 | return hdr_size + rmpp_recv->seg_num * data_size - pad; | 419 | return hdr_size + rmpp_recv->seg_num * data_size - pad; |
@@ -583,6 +583,7 @@ static int send_next_seg(struct ib_mad_send_wr_private *mad_send_wr) | |||
583 | { | 583 | { |
584 | struct ib_rmpp_mad *rmpp_mad; | 584 | struct ib_rmpp_mad *rmpp_mad; |
585 | int timeout; | 585 | int timeout; |
586 | u32 paylen; | ||
586 | 587 | ||
587 | rmpp_mad = (struct ib_rmpp_mad *)mad_send_wr->send_wr.wr.ud.mad_hdr; | 588 | rmpp_mad = (struct ib_rmpp_mad *)mad_send_wr->send_wr.wr.ud.mad_hdr; |
588 | ib_set_rmpp_flags(&rmpp_mad->rmpp_hdr, IB_MGMT_RMPP_FLAG_ACTIVE); | 589 | ib_set_rmpp_flags(&rmpp_mad->rmpp_hdr, IB_MGMT_RMPP_FLAG_ACTIVE); |
@@ -590,11 +591,9 @@ static int send_next_seg(struct ib_mad_send_wr_private *mad_send_wr) | |||
590 | 591 | ||
591 | if (mad_send_wr->seg_num == 1) { | 592 | if (mad_send_wr->seg_num == 1) { |
592 | rmpp_mad->rmpp_hdr.rmpp_rtime_flags |= IB_MGMT_RMPP_FLAG_FIRST; | 593 | rmpp_mad->rmpp_hdr.rmpp_rtime_flags |= IB_MGMT_RMPP_FLAG_FIRST; |
593 | rmpp_mad->rmpp_hdr.paylen_newwin = | 594 | paylen = mad_send_wr->total_seg * IB_MGMT_RMPP_DATA - |
594 | cpu_to_be32(mad_send_wr->total_seg * | 595 | mad_send_wr->pad; |
595 | (sizeof(struct ib_rmpp_mad) - | 596 | rmpp_mad->rmpp_hdr.paylen_newwin = cpu_to_be32(paylen); |
596 | offsetof(struct ib_rmpp_mad, data)) - | ||
597 | mad_send_wr->pad); | ||
598 | mad_send_wr->sg_list[0].length = sizeof(struct ib_rmpp_mad); | 597 | mad_send_wr->sg_list[0].length = sizeof(struct ib_rmpp_mad); |
599 | } else { | 598 | } else { |
600 | mad_send_wr->send_wr.num_sge = 2; | 599 | mad_send_wr->send_wr.num_sge = 2; |
@@ -608,10 +607,8 @@ static int send_next_seg(struct ib_mad_send_wr_private *mad_send_wr) | |||
608 | 607 | ||
609 | if (mad_send_wr->seg_num == mad_send_wr->total_seg) { | 608 | if (mad_send_wr->seg_num == mad_send_wr->total_seg) { |
610 | rmpp_mad->rmpp_hdr.rmpp_rtime_flags |= IB_MGMT_RMPP_FLAG_LAST; | 609 | rmpp_mad->rmpp_hdr.rmpp_rtime_flags |= IB_MGMT_RMPP_FLAG_LAST; |
611 | rmpp_mad->rmpp_hdr.paylen_newwin = | 610 | paylen = IB_MGMT_RMPP_DATA - mad_send_wr->pad; |
612 | cpu_to_be32(sizeof(struct ib_rmpp_mad) - | 611 | rmpp_mad->rmpp_hdr.paylen_newwin = cpu_to_be32(paylen); |
613 | offsetof(struct ib_rmpp_mad, data) - | ||
614 | mad_send_wr->pad); | ||
615 | } | 612 | } |
616 | 613 | ||
617 | /* 2 seconds for an ACK until we can find the packet lifetime */ | 614 | /* 2 seconds for an ACK until we can find the packet lifetime */ |