diff options
author | Mike Marciniszyn <mike.marciniszyn@qlogic.com> | 2011-09-23 13:16:34 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-10-21 12:38:50 -0400 |
commit | cc6ea1385b43487f6ef03bdc91416c8366d28311 (patch) | |
tree | 013266a6ebb9c9e810761677614bddd42a45932b /drivers/infiniband | |
parent | 2fc109c890f7d9620cfed8d439be071a8b2a8bbd (diff) |
IB/qib: Decode path MTU optimization
Store both the encoded and decoded MTU in the QP structure as a minor
optimization for UC/RC receive routines.
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@qlogic.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/qib/qib_qp.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_rc.c | 6 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_uc.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/qib/qib_verbs.h | 1 |
4 files changed, 9 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/qib/qib_qp.c b/drivers/infiniband/hw/qib/qib_qp.c index e16751f8639e..9d094f910360 100644 --- a/drivers/infiniband/hw/qib/qib_qp.c +++ b/drivers/infiniband/hw/qib/qib_qp.c | |||
@@ -765,8 +765,10 @@ int qib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
765 | } | 765 | } |
766 | } | 766 | } |
767 | 767 | ||
768 | if (attr_mask & IB_QP_PATH_MTU) | 768 | if (attr_mask & IB_QP_PATH_MTU) { |
769 | qp->path_mtu = pmtu; | 769 | qp->path_mtu = pmtu; |
770 | qp->pmtu = ib_mtu_enum_to_int(pmtu); | ||
771 | } | ||
770 | 772 | ||
771 | if (attr_mask & IB_QP_RETRY_CNT) { | 773 | if (attr_mask & IB_QP_RETRY_CNT) { |
772 | qp->s_retry_cnt = attr->retry_cnt; | 774 | qp->s_retry_cnt = attr->retry_cnt; |
diff --git a/drivers/infiniband/hw/qib/qib_rc.c b/drivers/infiniband/hw/qib/qib_rc.c index 5c1c49b299f1..5d77cb8aa052 100644 --- a/drivers/infiniband/hw/qib/qib_rc.c +++ b/drivers/infiniband/hw/qib/qib_rc.c | |||
@@ -239,7 +239,7 @@ int qib_make_rc_req(struct qib_qp *qp) | |||
239 | u32 len; | 239 | u32 len; |
240 | u32 bth0; | 240 | u32 bth0; |
241 | u32 bth2; | 241 | u32 bth2; |
242 | u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); | 242 | u32 pmtu = qp->pmtu; |
243 | char newreq; | 243 | char newreq; |
244 | unsigned long flags; | 244 | unsigned long flags; |
245 | int ret = 0; | 245 | int ret = 0; |
@@ -1732,7 +1732,7 @@ static int qib_rc_rcv_error(struct qib_other_headers *ohdr, | |||
1732 | * same request. | 1732 | * same request. |
1733 | */ | 1733 | */ |
1734 | offset = ((psn - e->psn) & QIB_PSN_MASK) * | 1734 | offset = ((psn - e->psn) & QIB_PSN_MASK) * |
1735 | ib_mtu_enum_to_int(qp->path_mtu); | 1735 | qp->pmtu; |
1736 | len = be32_to_cpu(reth->length); | 1736 | len = be32_to_cpu(reth->length); |
1737 | if (unlikely(offset + len != e->rdma_sge.sge_length)) | 1737 | if (unlikely(offset + len != e->rdma_sge.sge_length)) |
1738 | goto unlock_done; | 1738 | goto unlock_done; |
@@ -1876,7 +1876,7 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr, | |||
1876 | u32 psn; | 1876 | u32 psn; |
1877 | u32 pad; | 1877 | u32 pad; |
1878 | struct ib_wc wc; | 1878 | struct ib_wc wc; |
1879 | u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); | 1879 | u32 pmtu = qp->pmtu; |
1880 | int diff; | 1880 | int diff; |
1881 | struct ib_reth *reth; | 1881 | struct ib_reth *reth; |
1882 | unsigned long flags; | 1882 | unsigned long flags; |
diff --git a/drivers/infiniband/hw/qib/qib_uc.c b/drivers/infiniband/hw/qib/qib_uc.c index d31f33a99887..9a4630f8276f 100644 --- a/drivers/infiniband/hw/qib/qib_uc.c +++ b/drivers/infiniband/hw/qib/qib_uc.c | |||
@@ -51,7 +51,7 @@ int qib_make_uc_req(struct qib_qp *qp) | |||
51 | u32 hwords; | 51 | u32 hwords; |
52 | u32 bth0; | 52 | u32 bth0; |
53 | u32 len; | 53 | u32 len; |
54 | u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); | 54 | u32 pmtu = qp->pmtu; |
55 | int ret = 0; | 55 | int ret = 0; |
56 | 56 | ||
57 | spin_lock_irqsave(&qp->s_lock, flags); | 57 | spin_lock_irqsave(&qp->s_lock, flags); |
@@ -249,7 +249,7 @@ void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr, | |||
249 | u32 psn; | 249 | u32 psn; |
250 | u32 pad; | 250 | u32 pad; |
251 | struct ib_wc wc; | 251 | struct ib_wc wc; |
252 | u32 pmtu = ib_mtu_enum_to_int(qp->path_mtu); | 252 | u32 pmtu = qp->pmtu; |
253 | struct ib_reth *reth; | 253 | struct ib_reth *reth; |
254 | int ret; | 254 | int ret; |
255 | 255 | ||
diff --git a/drivers/infiniband/hw/qib/qib_verbs.h b/drivers/infiniband/hw/qib/qib_verbs.h index 95e5b47223b3..ec3711f743c5 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.h +++ b/drivers/infiniband/hw/qib/qib_verbs.h | |||
@@ -485,6 +485,7 @@ struct qib_qp { | |||
485 | u8 alt_timeout; /* Alternate path timeout for this QP */ | 485 | u8 alt_timeout; /* Alternate path timeout for this QP */ |
486 | u8 port_num; | 486 | u8 port_num; |
487 | enum ib_mtu path_mtu; | 487 | enum ib_mtu path_mtu; |
488 | u32 pmtu; /* decoded from path_mtu */ | ||
488 | u32 remote_qpn; | 489 | u32 remote_qpn; |
489 | u32 qkey; /* QKEY for this QP (for UD or RD) */ | 490 | u32 qkey; /* QKEY for this QP (for UD or RD) */ |
490 | u32 s_size; /* send work queue size */ | 491 | u32 s_size; /* send work queue size */ |