Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 1 | /* |
Jubin John | 05d6ac1 | 2016-02-14 20:22:17 -0800 | [diff] [blame] | 2 | * Copyright(c) 2015, 2016 Intel Corporation. |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 3 | * |
| 4 | * This file is provided under a dual BSD/GPLv2 license. When using or |
| 5 | * redistributing this file, you may do so under either license. |
| 6 | * |
| 7 | * GPL LICENSE SUMMARY |
| 8 | * |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of version 2 of the GNU General Public License as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * General Public License for more details. |
| 17 | * |
| 18 | * BSD LICENSE |
| 19 | * |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 20 | * Redistribution and use in source and binary forms, with or without |
| 21 | * modification, are permitted provided that the following conditions |
| 22 | * are met: |
| 23 | * |
| 24 | * - Redistributions of source code must retain the above copyright |
| 25 | * notice, this list of conditions and the following disclaimer. |
| 26 | * - Redistributions in binary form must reproduce the above copyright |
| 27 | * notice, this list of conditions and the following disclaimer in |
| 28 | * the documentation and/or other materials provided with the |
| 29 | * distribution. |
| 30 | * - Neither the name of Intel Corporation nor the names of its |
| 31 | * contributors may be used to endorse or promote products derived |
| 32 | * from this software without specific prior written permission. |
| 33 | * |
| 34 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 35 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 36 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 37 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 38 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 39 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 40 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 41 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 42 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 44 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 45 | * |
| 46 | */ |
| 47 | |
| 48 | #include <linux/net.h> |
| 49 | #include <rdma/ib_smi.h> |
| 50 | |
| 51 | #include "hfi.h" |
| 52 | #include "mad.h" |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 53 | #include "verbs_txreq.h" |
Mike Marciniszyn | 711e104 | 2016-02-14 12:45:18 -0800 | [diff] [blame] | 54 | #include "qp.h" |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 55 | |
| 56 | /** |
| 57 | * ud_loopback - handle send on loopback QPs |
| 58 | * @sqp: the sending QP |
| 59 | * @swqe: the send work request |
| 60 | * |
| 61 | * This is called from hfi1_make_ud_req() to forward a WQE addressed |
| 62 | * to the same HFI. |
| 63 | * Note that the receive interrupt handler may be calling hfi1_ud_rcv() |
| 64 | * while this is being called. |
| 65 | */ |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 66 | static void ud_loopback(struct rvt_qp *sqp, struct rvt_swqe *swqe) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 67 | { |
| 68 | struct hfi1_ibport *ibp = to_iport(sqp->ibqp.device, sqp->port_num); |
| 69 | struct hfi1_pportdata *ppd; |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 70 | struct rvt_qp *qp; |
Dasaratharaman Chandramouli | 9089885 | 2017-04-29 14:41:18 -0400 | [diff] [blame] | 71 | struct rdma_ah_attr *ah_attr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 72 | unsigned long flags; |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 73 | struct rvt_sge_state ssge; |
| 74 | struct rvt_sge *sge; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 75 | struct ib_wc wc; |
| 76 | u32 length; |
| 77 | enum ib_qp_type sqptype, dqptype; |
| 78 | |
| 79 | rcu_read_lock(); |
| 80 | |
Dennis Dalessandro | ec4274f | 2016-01-19 14:43:44 -0800 | [diff] [blame] | 81 | qp = rvt_lookup_qpn(ib_to_rvt(sqp->ibqp.device), &ibp->rvp, |
| 82 | swqe->ud_wr.remote_qpn); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 83 | if (!qp) { |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 84 | ibp->rvp.n_pkt_drops++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 85 | rcu_read_unlock(); |
| 86 | return; |
| 87 | } |
| 88 | |
| 89 | sqptype = sqp->ibqp.qp_type == IB_QPT_GSI ? |
| 90 | IB_QPT_UD : sqp->ibqp.qp_type; |
| 91 | dqptype = qp->ibqp.qp_type == IB_QPT_GSI ? |
| 92 | IB_QPT_UD : qp->ibqp.qp_type; |
| 93 | |
| 94 | if (dqptype != sqptype || |
Dennis Dalessandro | 83693bd | 2016-01-19 14:43:33 -0800 | [diff] [blame] | 95 | !(ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK)) { |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 96 | ibp->rvp.n_pkt_drops++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 97 | goto drop; |
| 98 | } |
| 99 | |
Dennis Dalessandro | 15723f0 | 2016-01-19 14:42:17 -0800 | [diff] [blame] | 100 | ah_attr = &ibah_to_rvtah(swqe->ud_wr.ah)->attr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 101 | ppd = ppd_from_ibp(ibp); |
| 102 | |
| 103 | if (qp->ibqp.qp_num > 1) { |
| 104 | u16 pkey; |
| 105 | u16 slid; |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 106 | u8 sc5 = ibp->sl_to_sc[rdma_ah_get_sl(ah_attr)]; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 107 | |
| 108 | pkey = hfi1_get_pkey(ibp, sqp->s_pkey_index); |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 109 | slid = ppd->lid | (rdma_ah_get_path_bits(ah_attr) & |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 110 | ((1 << ppd->lmc) - 1)); |
| 111 | if (unlikely(ingress_pkey_check(ppd, pkey, sc5, |
| 112 | qp->s_pkey_index, slid))) { |
Dennis Dalessandro | 13d8491 | 2017-05-29 17:22:01 -0700 | [diff] [blame^] | 113 | hfi1_bad_pkey(ibp, pkey, |
| 114 | rdma_ah_get_sl(ah_attr), |
| 115 | sqp->ibqp.qp_num, qp->ibqp.qp_num, |
| 116 | slid, rdma_ah_get_dlid(ah_attr)); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 117 | goto drop; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /* |
| 122 | * Check that the qkey matches (except for QP0, see 9.6.1.4.1). |
| 123 | * Qkeys with the high order bit set mean use the |
| 124 | * qkey from the QP context instead of the WR (see 10.2.5). |
| 125 | */ |
| 126 | if (qp->ibqp.qp_num) { |
| 127 | u32 qkey; |
| 128 | |
Christoph Hellwig | e622f2f | 2015-10-08 09:16:33 +0100 | [diff] [blame] | 129 | qkey = (int)swqe->ud_wr.remote_qkey < 0 ? |
| 130 | sqp->qkey : swqe->ud_wr.remote_qkey; |
Dennis Dalessandro | 13d8491 | 2017-05-29 17:22:01 -0700 | [diff] [blame^] | 131 | if (unlikely(qkey != qp->qkey)) |
| 132 | goto drop; /* silently drop per IBTA spec */ |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | /* |
| 136 | * A GRH is expected to precede the data even if not |
| 137 | * present on the wire. |
| 138 | */ |
| 139 | length = swqe->length; |
| 140 | memset(&wc, 0, sizeof(wc)); |
| 141 | wc.byte_len = length + sizeof(struct ib_grh); |
| 142 | |
| 143 | if (swqe->wr.opcode == IB_WR_SEND_WITH_IMM) { |
| 144 | wc.wc_flags = IB_WC_WITH_IMM; |
| 145 | wc.ex.imm_data = swqe->wr.ex.imm_data; |
| 146 | } |
| 147 | |
| 148 | spin_lock_irqsave(&qp->r_lock, flags); |
| 149 | |
| 150 | /* |
| 151 | * Get the next work request entry to find where to put the data. |
| 152 | */ |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 153 | if (qp->r_flags & RVT_R_REUSE_SGE) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 154 | qp->r_flags &= ~RVT_R_REUSE_SGE; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 155 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 156 | int ret; |
| 157 | |
Dennis Dalessandro | ec4274f | 2016-01-19 14:43:44 -0800 | [diff] [blame] | 158 | ret = hfi1_rvt_get_rwqe(qp, 0); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 159 | if (ret < 0) { |
Brian Welty | beb5a04 | 2017-02-08 05:27:01 -0800 | [diff] [blame] | 160 | rvt_rc_error(qp, IB_WC_LOC_QP_OP_ERR); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 161 | goto bail_unlock; |
| 162 | } |
| 163 | if (!ret) { |
| 164 | if (qp->ibqp.qp_num == 0) |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 165 | ibp->rvp.n_vl15_dropped++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 166 | goto bail_unlock; |
| 167 | } |
| 168 | } |
| 169 | /* Silently drop packets which are too big. */ |
| 170 | if (unlikely(wc.byte_len > qp->r_len)) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 171 | qp->r_flags |= RVT_R_REUSE_SGE; |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 172 | ibp->rvp.n_pkt_drops++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 173 | goto bail_unlock; |
| 174 | } |
| 175 | |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 176 | if (rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH) { |
Dasaratharaman Chandramouli | 527dbf1 | 2016-07-25 13:40:40 -0700 | [diff] [blame] | 177 | struct ib_grh grh; |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 178 | const struct ib_global_route *grd = rdma_ah_read_grh(ah_attr); |
Dasaratharaman Chandramouli | 527dbf1 | 2016-07-25 13:40:40 -0700 | [diff] [blame] | 179 | |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 180 | hfi1_make_grh(ibp, &grh, grd, 0, 0); |
Dasaratharaman Chandramouli | 527dbf1 | 2016-07-25 13:40:40 -0700 | [diff] [blame] | 181 | hfi1_copy_sge(&qp->r_sge, &grh, |
Brian Welty | 0128fce | 2017-02-08 05:27:31 -0800 | [diff] [blame] | 182 | sizeof(grh), true, false); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 183 | wc.wc_flags |= IB_WC_GRH; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 184 | } else { |
Brian Welty | 1198fce | 2017-02-08 05:27:37 -0800 | [diff] [blame] | 185 | rvt_skip_sge(&qp->r_sge, sizeof(struct ib_grh), true); |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 186 | } |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 187 | ssge.sg_list = swqe->sg_list + 1; |
| 188 | ssge.sge = *swqe->sg_list; |
| 189 | ssge.num_sge = swqe->wr.num_sge; |
| 190 | sge = &ssge.sge; |
| 191 | while (length) { |
| 192 | u32 len = sge->length; |
| 193 | |
| 194 | if (len > length) |
| 195 | len = length; |
| 196 | if (len > sge->sge_length) |
| 197 | len = sge->sge_length; |
| 198 | WARN_ON_ONCE(len == 0); |
Brian Welty | 0128fce | 2017-02-08 05:27:31 -0800 | [diff] [blame] | 199 | hfi1_copy_sge(&qp->r_sge, sge->vaddr, len, true, false); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 200 | sge->vaddr += len; |
| 201 | sge->length -= len; |
| 202 | sge->sge_length -= len; |
| 203 | if (sge->sge_length == 0) { |
| 204 | if (--ssge.num_sge) |
| 205 | *sge = *ssge.sg_list++; |
| 206 | } else if (sge->length == 0 && sge->mr->lkey) { |
Dennis Dalessandro | cd4ceee | 2016-01-19 14:41:55 -0800 | [diff] [blame] | 207 | if (++sge->n >= RVT_SEGSZ) { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 208 | if (++sge->m >= sge->mr->mapsz) |
| 209 | break; |
| 210 | sge->n = 0; |
| 211 | } |
| 212 | sge->vaddr = |
| 213 | sge->mr->map[sge->m]->segs[sge->n].vaddr; |
| 214 | sge->length = |
| 215 | sge->mr->map[sge->m]->segs[sge->n].length; |
| 216 | } |
| 217 | length -= len; |
| 218 | } |
Dennis Dalessandro | ec4274f | 2016-01-19 14:43:44 -0800 | [diff] [blame] | 219 | rvt_put_ss(&qp->r_sge); |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 220 | if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 221 | goto bail_unlock; |
| 222 | wc.wr_id = qp->r_wr_id; |
| 223 | wc.status = IB_WC_SUCCESS; |
| 224 | wc.opcode = IB_WC_RECV; |
| 225 | wc.qp = &qp->ibqp; |
| 226 | wc.src_qp = sqp->ibqp.qp_num; |
| 227 | if (qp->ibqp.qp_type == IB_QPT_GSI || qp->ibqp.qp_type == IB_QPT_SMI) { |
| 228 | if (sqp->ibqp.qp_type == IB_QPT_GSI || |
| 229 | sqp->ibqp.qp_type == IB_QPT_SMI) |
Christoph Hellwig | e622f2f | 2015-10-08 09:16:33 +0100 | [diff] [blame] | 230 | wc.pkey_index = swqe->ud_wr.pkey_index; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 231 | else |
| 232 | wc.pkey_index = sqp->s_pkey_index; |
| 233 | } else { |
| 234 | wc.pkey_index = 0; |
| 235 | } |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 236 | wc.slid = ppd->lid | (rdma_ah_get_path_bits(ah_attr) & |
| 237 | ((1 << ppd->lmc) - 1)); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 238 | /* Check for loopback when the port lid is not set */ |
| 239 | if (wc.slid == 0 && sqp->ibqp.qp_type == IB_QPT_GSI) |
Dennis Dalessandro | 8859b4a | 2016-01-19 14:42:11 -0800 | [diff] [blame] | 240 | wc.slid = be16_to_cpu(IB_LID_PERMISSIVE); |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 241 | wc.sl = rdma_ah_get_sl(ah_attr); |
| 242 | wc.dlid_path_bits = rdma_ah_get_dlid(ah_attr) & ((1 << ppd->lmc) - 1); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 243 | wc.port_num = qp->port_num; |
| 244 | /* Signal completion event if the solicited bit is set. */ |
Dennis Dalessandro | abd712d | 2016-01-19 14:43:22 -0800 | [diff] [blame] | 245 | rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc, |
| 246 | swqe->wr.send_flags & IB_SEND_SOLICITED); |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 247 | ibp->rvp.n_loop_pkts++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 248 | bail_unlock: |
| 249 | spin_unlock_irqrestore(&qp->r_lock, flags); |
| 250 | drop: |
| 251 | rcu_read_unlock(); |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * hfi1_make_ud_req - construct a UD request packet |
| 256 | * @qp: the QP |
| 257 | * |
Mike Marciniszyn | 46a80d6 | 2016-02-14 12:10:04 -0800 | [diff] [blame] | 258 | * Assume s_lock is held. |
| 259 | * |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 260 | * Return 1 if constructed; otherwise, return 0. |
| 261 | */ |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 262 | int hfi1_make_ud_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 263 | { |
Dennis Dalessandro | 4c6829c | 2016-01-19 14:42:00 -0800 | [diff] [blame] | 264 | struct hfi1_qp_priv *priv = qp->priv; |
Mike Marciniszyn | 261a435 | 2016-09-06 04:35:05 -0700 | [diff] [blame] | 265 | struct ib_other_headers *ohdr; |
Dasaratharaman Chandramouli | 9089885 | 2017-04-29 14:41:18 -0400 | [diff] [blame] | 266 | struct rdma_ah_attr *ah_attr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 267 | struct hfi1_pportdata *ppd; |
| 268 | struct hfi1_ibport *ibp; |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 269 | struct rvt_swqe *wqe; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 270 | u32 nwords; |
| 271 | u32 extra_bytes; |
| 272 | u32 bth0; |
| 273 | u16 lrh0; |
| 274 | u16 lid; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 275 | int next_cur; |
| 276 | u8 sc5; |
| 277 | |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 278 | ps->s_txreq = get_txreq(ps->dev, qp); |
| 279 | if (IS_ERR(ps->s_txreq)) |
| 280 | goto bail_no_tx; |
| 281 | |
Dennis Dalessandro | 83693bd | 2016-01-19 14:43:33 -0800 | [diff] [blame] | 282 | if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_NEXT_SEND_OK)) { |
| 283 | if (!(ib_rvt_state_ops[qp->state] & RVT_FLUSH_SEND)) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 284 | goto bail; |
| 285 | /* We are in the error state, flush the work request. */ |
Mike Marciniszyn | 46a80d6 | 2016-02-14 12:10:04 -0800 | [diff] [blame] | 286 | smp_read_barrier_depends(); /* see post_one_send */ |
| 287 | if (qp->s_last == ACCESS_ONCE(qp->s_head)) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 288 | goto bail; |
| 289 | /* If DMAs are in progress, we can't flush immediately. */ |
Mike Marciniszyn | 14553ca | 2016-02-14 12:45:36 -0800 | [diff] [blame] | 290 | if (iowait_sdma_pending(&priv->s_iowait)) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 291 | qp->s_flags |= RVT_S_WAIT_DMA; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 292 | goto bail; |
| 293 | } |
Dennis Dalessandro | 83693bd | 2016-01-19 14:43:33 -0800 | [diff] [blame] | 294 | wqe = rvt_get_swqe_ptr(qp, qp->s_last); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 295 | hfi1_send_complete(qp, wqe, IB_WC_WR_FLUSH_ERR); |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 296 | goto done_free_tx; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 297 | } |
| 298 | |
Mike Marciniszyn | 46a80d6 | 2016-02-14 12:10:04 -0800 | [diff] [blame] | 299 | /* see post_one_send() */ |
| 300 | smp_read_barrier_depends(); |
| 301 | if (qp->s_cur == ACCESS_ONCE(qp->s_head)) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 302 | goto bail; |
| 303 | |
Dennis Dalessandro | 83693bd | 2016-01-19 14:43:33 -0800 | [diff] [blame] | 304 | wqe = rvt_get_swqe_ptr(qp, qp->s_cur); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 305 | next_cur = qp->s_cur + 1; |
| 306 | if (next_cur >= qp->s_size) |
| 307 | next_cur = 0; |
| 308 | |
| 309 | /* Construct the header. */ |
| 310 | ibp = to_iport(qp->ibqp.device, qp->port_num); |
| 311 | ppd = ppd_from_ibp(ibp); |
Dennis Dalessandro | 15723f0 | 2016-01-19 14:42:17 -0800 | [diff] [blame] | 312 | ah_attr = &ibah_to_rvtah(wqe->ud_wr.ah)->attr; |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 313 | if (rdma_ah_get_dlid(ah_attr) < be16_to_cpu(IB_MULTICAST_LID_BASE) || |
| 314 | rdma_ah_get_dlid(ah_attr) == be16_to_cpu(IB_LID_PERMISSIVE)) { |
| 315 | lid = rdma_ah_get_dlid(ah_attr) & ~((1 << ppd->lmc) - 1); |
Jubin John | 17fb4f2 | 2016-02-14 20:21:52 -0800 | [diff] [blame] | 316 | if (unlikely(!loopback && |
| 317 | (lid == ppd->lid || |
| 318 | (lid == be16_to_cpu(IB_LID_PERMISSIVE) && |
| 319 | qp->ibqp.qp_type == IB_QPT_GSI)))) { |
Mike Marciniszyn | 747f4d7 | 2016-04-12 10:46:10 -0700 | [diff] [blame] | 320 | unsigned long tflags = ps->flags; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 321 | /* |
| 322 | * If DMAs are in progress, we can't generate |
| 323 | * a completion for the loopback packet since |
| 324 | * it would be out of order. |
| 325 | * Instead of waiting, we could queue a |
| 326 | * zero length descriptor so we get a callback. |
| 327 | */ |
Mike Marciniszyn | 14553ca | 2016-02-14 12:45:36 -0800 | [diff] [blame] | 328 | if (iowait_sdma_pending(&priv->s_iowait)) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 329 | qp->s_flags |= RVT_S_WAIT_DMA; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 330 | goto bail; |
| 331 | } |
| 332 | qp->s_cur = next_cur; |
Mike Marciniszyn | 747f4d7 | 2016-04-12 10:46:10 -0700 | [diff] [blame] | 333 | spin_unlock_irqrestore(&qp->s_lock, tflags); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 334 | ud_loopback(qp, wqe); |
Mike Marciniszyn | 747f4d7 | 2016-04-12 10:46:10 -0700 | [diff] [blame] | 335 | spin_lock_irqsave(&qp->s_lock, tflags); |
| 336 | ps->flags = tflags; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 337 | hfi1_send_complete(qp, wqe, IB_WC_SUCCESS); |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 338 | goto done_free_tx; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 339 | } |
| 340 | } |
| 341 | |
| 342 | qp->s_cur = next_cur; |
| 343 | extra_bytes = -wqe->length & 3; |
| 344 | nwords = (wqe->length + extra_bytes) >> 2; |
| 345 | |
| 346 | /* header size in 32-bit words LRH+BTH+DETH = (8+12+8)/4. */ |
| 347 | qp->s_hdrwords = 7; |
Don Hiatt | e922ae0 | 2016-12-07 19:33:00 -0800 | [diff] [blame] | 348 | ps->s_txreq->s_cur_size = wqe->length; |
Mitko Haralanov | b777f15 | 2016-12-07 19:33:27 -0800 | [diff] [blame] | 349 | ps->s_txreq->ss = &qp->s_sge; |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 350 | qp->s_srate = rdma_ah_get_static_rate(ah_attr); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 351 | qp->srate_mbps = ib_rate_to_mbps(qp->s_srate); |
| 352 | qp->s_wqe = wqe; |
| 353 | qp->s_sge.sge = wqe->sg_list[0]; |
| 354 | qp->s_sge.sg_list = wqe->sg_list + 1; |
| 355 | qp->s_sge.num_sge = wqe->wr.num_sge; |
| 356 | qp->s_sge.total_len = wqe->length; |
| 357 | |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 358 | if (rdma_ah_get_ah_flags(ah_attr) & IB_AH_GRH) { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 359 | /* Header size in 32-bit words. */ |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 360 | qp->s_hdrwords += hfi1_make_grh(ibp, |
| 361 | &ps->s_txreq->phdr.hdr.u.l.grh, |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 362 | rdma_ah_read_grh(ah_attr), |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 363 | qp->s_hdrwords, nwords); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 364 | lrh0 = HFI1_LRH_GRH; |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 365 | ohdr = &ps->s_txreq->phdr.hdr.u.l.oth; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 366 | /* |
| 367 | * Don't worry about sending to locally attached multicast |
| 368 | * QPs. It is unspecified by the spec. what happens. |
| 369 | */ |
| 370 | } else { |
| 371 | /* Header size in 32-bit words. */ |
| 372 | lrh0 = HFI1_LRH_BTH; |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 373 | ohdr = &ps->s_txreq->phdr.hdr.u.oth; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 374 | } |
| 375 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) { |
| 376 | qp->s_hdrwords++; |
| 377 | ohdr->u.ud.imm_data = wqe->wr.ex.imm_data; |
| 378 | bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 379 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 380 | bth0 = IB_OPCODE_UD_SEND_ONLY << 24; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 381 | } |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 382 | sc5 = ibp->sl_to_sc[rdma_ah_get_sl(ah_attr)]; |
| 383 | lrh0 |= (rdma_ah_get_sl(ah_attr) & 0xf) << 4; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 384 | if (qp->ibqp.qp_type == IB_QPT_SMI) { |
| 385 | lrh0 |= 0xF000; /* Set VL (see ch. 13.5.3.1) */ |
Dennis Dalessandro | 4c6829c | 2016-01-19 14:42:00 -0800 | [diff] [blame] | 386 | priv->s_sc = 0xf; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 387 | } else { |
| 388 | lrh0 |= (sc5 & 0xf) << 12; |
Dennis Dalessandro | 4c6829c | 2016-01-19 14:42:00 -0800 | [diff] [blame] | 389 | priv->s_sc = sc5; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 390 | } |
Dennis Dalessandro | 4c6829c | 2016-01-19 14:42:00 -0800 | [diff] [blame] | 391 | priv->s_sde = qp_to_sdma_engine(qp, priv->s_sc); |
Mike Marciniszyn | 711e104 | 2016-02-14 12:45:18 -0800 | [diff] [blame] | 392 | ps->s_txreq->sde = priv->s_sde; |
Jubin John | 721d042 | 2016-02-14 12:45:00 -0800 | [diff] [blame] | 393 | priv->s_sendcontext = qp_to_send_context(qp, priv->s_sc); |
Mike Marciniszyn | 711e104 | 2016-02-14 12:45:18 -0800 | [diff] [blame] | 394 | ps->s_txreq->psc = priv->s_sendcontext; |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 395 | ps->s_txreq->phdr.hdr.lrh[0] = cpu_to_be16(lrh0); |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 396 | ps->s_txreq->phdr.hdr.lrh[1] = |
| 397 | cpu_to_be16(rdma_ah_get_dlid(ah_attr)); |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 398 | ps->s_txreq->phdr.hdr.lrh[2] = |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 399 | cpu_to_be16(qp->s_hdrwords + nwords + SIZE_OF_CRC); |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 400 | if (rdma_ah_get_dlid(ah_attr) == be16_to_cpu(IB_LID_PERMISSIVE)) { |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 401 | ps->s_txreq->phdr.hdr.lrh[3] = IB_LID_PERMISSIVE; |
| 402 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 403 | lid = ppd->lid; |
| 404 | if (lid) { |
Dasaratharaman Chandramouli | d8966fc | 2017-04-29 14:41:28 -0400 | [diff] [blame] | 405 | lid |= rdma_ah_get_path_bits(ah_attr) & |
| 406 | ((1 << ppd->lmc) - 1); |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 407 | ps->s_txreq->phdr.hdr.lrh[3] = cpu_to_be16(lid); |
| 408 | } else { |
| 409 | ps->s_txreq->phdr.hdr.lrh[3] = IB_LID_PERMISSIVE; |
| 410 | } |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 411 | } |
| 412 | if (wqe->wr.send_flags & IB_SEND_SOLICITED) |
| 413 | bth0 |= IB_BTH_SOLICITED; |
| 414 | bth0 |= extra_bytes << 20; |
| 415 | if (qp->ibqp.qp_type == IB_QPT_GSI || qp->ibqp.qp_type == IB_QPT_SMI) |
Christoph Hellwig | e622f2f | 2015-10-08 09:16:33 +0100 | [diff] [blame] | 416 | bth0 |= hfi1_get_pkey(ibp, wqe->ud_wr.pkey_index); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 417 | else |
| 418 | bth0 |= hfi1_get_pkey(ibp, qp->s_pkey_index); |
| 419 | ohdr->bth[0] = cpu_to_be32(bth0); |
Christoph Hellwig | e622f2f | 2015-10-08 09:16:33 +0100 | [diff] [blame] | 420 | ohdr->bth[1] = cpu_to_be32(wqe->ud_wr.remote_qpn); |
Mike Marciniszyn | 46a80d6 | 2016-02-14 12:10:04 -0800 | [diff] [blame] | 421 | ohdr->bth[2] = cpu_to_be32(mask_psn(wqe->psn)); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 422 | /* |
| 423 | * Qkeys with the high order bit set mean use the |
| 424 | * qkey from the QP context instead of the WR (see 10.2.5). |
| 425 | */ |
Christoph Hellwig | e622f2f | 2015-10-08 09:16:33 +0100 | [diff] [blame] | 426 | ohdr->u.ud.deth[0] = cpu_to_be32((int)wqe->ud_wr.remote_qkey < 0 ? |
| 427 | qp->qkey : wqe->ud_wr.remote_qkey); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 428 | ohdr->u.ud.deth[1] = cpu_to_be32(qp->ibqp.qp_num); |
| 429 | /* disarm any ahg */ |
Dasaratharaman Chandramouli | a9b6b3b | 2016-07-25 13:40:16 -0700 | [diff] [blame] | 430 | priv->s_ahg->ahgcount = 0; |
| 431 | priv->s_ahg->ahgidx = 0; |
| 432 | priv->s_ahg->tx_flags = 0; |
Mike Marciniszyn | 711e104 | 2016-02-14 12:45:18 -0800 | [diff] [blame] | 433 | /* pbc */ |
| 434 | ps->s_txreq->hdr_dwords = qp->s_hdrwords + 2; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 435 | |
Mike Marciniszyn | 46a80d6 | 2016-02-14 12:10:04 -0800 | [diff] [blame] | 436 | return 1; |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 437 | |
| 438 | done_free_tx: |
| 439 | hfi1_put_txreq(ps->s_txreq); |
| 440 | ps->s_txreq = NULL; |
| 441 | return 1; |
| 442 | |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 443 | bail: |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 444 | hfi1_put_txreq(ps->s_txreq); |
| 445 | |
| 446 | bail_no_tx: |
| 447 | ps->s_txreq = NULL; |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 448 | qp->s_flags &= ~RVT_S_BUSY; |
Dennis Dalessandro | bb5df5f | 2016-02-14 12:44:43 -0800 | [diff] [blame] | 449 | qp->s_hdrwords = 0; |
| 450 | return 0; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 451 | } |
| 452 | |
| 453 | /* |
| 454 | * Hardware can't check this so we do it here. |
| 455 | * |
| 456 | * This is a slightly different algorithm than the standard pkey check. It |
| 457 | * special cases the management keys and allows for 0x7fff and 0xffff to be in |
| 458 | * the table at the same time. |
| 459 | * |
| 460 | * @returns the index found or -1 if not found |
| 461 | */ |
| 462 | int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey) |
| 463 | { |
| 464 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
| 465 | unsigned i; |
| 466 | |
| 467 | if (pkey == FULL_MGMT_P_KEY || pkey == LIM_MGMT_P_KEY) { |
| 468 | unsigned lim_idx = -1; |
| 469 | |
| 470 | for (i = 0; i < ARRAY_SIZE(ppd->pkeys); ++i) { |
| 471 | /* here we look for an exact match */ |
| 472 | if (ppd->pkeys[i] == pkey) |
| 473 | return i; |
| 474 | if (ppd->pkeys[i] == LIM_MGMT_P_KEY) |
| 475 | lim_idx = i; |
| 476 | } |
| 477 | |
| 478 | /* did not find 0xffff return 0x7fff idx if found */ |
| 479 | if (pkey == FULL_MGMT_P_KEY) |
| 480 | return lim_idx; |
| 481 | |
| 482 | /* no match... */ |
| 483 | return -1; |
| 484 | } |
| 485 | |
| 486 | pkey &= 0x7fff; /* remove limited/full membership bit */ |
| 487 | |
| 488 | for (i = 0; i < ARRAY_SIZE(ppd->pkeys); ++i) |
| 489 | if ((ppd->pkeys[i] & 0x7fff) == pkey) |
| 490 | return i; |
| 491 | |
| 492 | /* |
| 493 | * Should not get here, this means hardware failed to validate pkeys. |
| 494 | */ |
| 495 | return -1; |
| 496 | } |
| 497 | |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 498 | void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 499 | u32 pkey, u32 slid, u32 dlid, u8 sc5, |
| 500 | const struct ib_grh *old_grh) |
| 501 | { |
| 502 | u64 pbc, pbc_flags = 0; |
| 503 | u32 bth0, plen, vl, hwords = 5; |
| 504 | u16 lrh0; |
| 505 | u8 sl = ibp->sc_to_sl[sc5]; |
Mike Marciniszyn | 261a435 | 2016-09-06 04:35:05 -0700 | [diff] [blame] | 506 | struct ib_header hdr; |
| 507 | struct ib_other_headers *ohdr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 508 | struct pio_buf *pbuf; |
| 509 | struct send_context *ctxt = qp_to_send_context(qp, sc5); |
| 510 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
| 511 | |
| 512 | if (old_grh) { |
| 513 | struct ib_grh *grh = &hdr.u.l.grh; |
| 514 | |
| 515 | grh->version_tclass_flow = old_grh->version_tclass_flow; |
| 516 | grh->paylen = cpu_to_be16((hwords - 2 + SIZE_OF_CRC) << 2); |
| 517 | grh->hop_limit = 0xff; |
| 518 | grh->sgid = old_grh->dgid; |
| 519 | grh->dgid = old_grh->sgid; |
| 520 | ohdr = &hdr.u.l.oth; |
| 521 | lrh0 = HFI1_LRH_GRH; |
| 522 | hwords += sizeof(struct ib_grh) / sizeof(u32); |
| 523 | } else { |
| 524 | ohdr = &hdr.u.oth; |
| 525 | lrh0 = HFI1_LRH_BTH; |
| 526 | } |
| 527 | |
| 528 | lrh0 |= (sc5 & 0xf) << 12 | sl << 4; |
| 529 | |
| 530 | bth0 = pkey | (IB_OPCODE_CNP << 24); |
| 531 | ohdr->bth[0] = cpu_to_be32(bth0); |
| 532 | |
Don Hiatt | 3d59109 | 2017-04-09 10:16:28 -0700 | [diff] [blame] | 533 | ohdr->bth[1] = cpu_to_be32(remote_qpn | (1 << IB_BECN_SHIFT)); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 534 | ohdr->bth[2] = 0; /* PSN 0 */ |
| 535 | |
| 536 | hdr.lrh[0] = cpu_to_be16(lrh0); |
| 537 | hdr.lrh[1] = cpu_to_be16(dlid); |
| 538 | hdr.lrh[2] = cpu_to_be16(hwords + SIZE_OF_CRC); |
| 539 | hdr.lrh[3] = cpu_to_be16(slid); |
| 540 | |
| 541 | plen = 2 /* PBC */ + hwords; |
Don Hiatt | 7dafbab | 2017-05-12 09:19:55 -0700 | [diff] [blame] | 542 | pbc_flags |= (ib_is_sc5(sc5) << PBC_DC_INFO_SHIFT); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 543 | vl = sc_to_vlt(ppd->dd, sc5); |
| 544 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, vl, plen); |
| 545 | if (ctxt) { |
| 546 | pbuf = sc_buffer_alloc(ctxt, plen, NULL, NULL); |
| 547 | if (pbuf) |
| 548 | ppd->dd->pio_inline_send(ppd->dd, pbuf, pbc, |
| 549 | &hdr, hwords); |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | /* |
| 554 | * opa_smp_check() - Do the regular pkey checking, and the additional |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 555 | * checks for SMPs specified in OPAv1 rev 1.0, 9/19/2016 update, section |
| 556 | * 9.10.25 ("SMA Packet Checks"). |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 557 | * |
| 558 | * Note that: |
| 559 | * - Checks are done using the pkey directly from the packet's BTH, |
| 560 | * and specifically _not_ the pkey that we attach to the completion, |
| 561 | * which may be different. |
| 562 | * - These checks are specifically for "non-local" SMPs (i.e., SMPs |
| 563 | * which originated on another node). SMPs which are sent from, and |
| 564 | * destined to this node are checked in opa_local_smp_check(). |
| 565 | * |
| 566 | * At the point where opa_smp_check() is called, we know: |
| 567 | * - destination QP is QP0 |
| 568 | * |
| 569 | * opa_smp_check() returns 0 if all checks succeed, 1 otherwise. |
| 570 | */ |
| 571 | static int opa_smp_check(struct hfi1_ibport *ibp, u16 pkey, u8 sc5, |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 572 | struct rvt_qp *qp, u16 slid, struct opa_smp *smp) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 573 | { |
| 574 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
| 575 | |
| 576 | /* |
| 577 | * I don't think it's possible for us to get here with sc != 0xf, |
| 578 | * but check it to be certain. |
| 579 | */ |
| 580 | if (sc5 != 0xf) |
| 581 | return 1; |
| 582 | |
| 583 | if (rcv_pkey_check(ppd, pkey, sc5, slid)) |
| 584 | return 1; |
| 585 | |
| 586 | /* |
| 587 | * At this point we know (and so don't need to check again) that |
| 588 | * the pkey is either LIM_MGMT_P_KEY, or FULL_MGMT_P_KEY |
| 589 | * (see ingress_pkey_check). |
| 590 | */ |
| 591 | if (smp->mgmt_class != IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE && |
| 592 | smp->mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED) { |
| 593 | ingress_pkey_table_fail(ppd, pkey, slid); |
| 594 | return 1; |
| 595 | } |
| 596 | |
| 597 | /* |
| 598 | * SMPs fall into one of four (disjoint) categories: |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 599 | * SMA request, SMA response, SMA trap, or SMA trap repress. |
| 600 | * Our response depends, in part, on which type of SMP we're |
| 601 | * processing. |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 602 | * |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 603 | * If this is an SMA response, skip the check here. |
| 604 | * |
| 605 | * If this is an SMA request or SMA trap repress: |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 606 | * - pkey != FULL_MGMT_P_KEY => |
| 607 | * increment port recv constraint errors, drop MAD |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 608 | * |
| 609 | * Otherwise: |
| 610 | * - accept if the port is running an SM |
| 611 | * - drop MAD if it's an SMA trap |
| 612 | * - pkey == FULL_MGMT_P_KEY => |
| 613 | * reply with unsupported method |
| 614 | * - pkey != FULL_MGMT_P_KEY => |
| 615 | * increment port recv constraint errors, drop MAD |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 616 | */ |
| 617 | switch (smp->method) { |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 618 | case IB_MGMT_METHOD_GET_RESP: |
| 619 | case IB_MGMT_METHOD_REPORT_RESP: |
| 620 | break; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 621 | case IB_MGMT_METHOD_GET: |
| 622 | case IB_MGMT_METHOD_SET: |
| 623 | case IB_MGMT_METHOD_REPORT: |
| 624 | case IB_MGMT_METHOD_TRAP_REPRESS: |
| 625 | if (pkey != FULL_MGMT_P_KEY) { |
| 626 | ingress_pkey_table_fail(ppd, pkey, slid); |
| 627 | return 1; |
| 628 | } |
| 629 | break; |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 630 | default: |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 631 | if (ibp->rvp.port_cap_flags & IB_PORT_SM) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 632 | return 0; |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 633 | if (smp->method == IB_MGMT_METHOD_TRAP) |
| 634 | return 1; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 635 | if (pkey == FULL_MGMT_P_KEY) { |
| 636 | smp->status |= IB_SMP_UNSUP_METHOD; |
| 637 | return 0; |
| 638 | } |
Jianxin Xiong | f380920 | 2016-09-30 20:11:09 -0700 | [diff] [blame] | 639 | ingress_pkey_table_fail(ppd, pkey, slid); |
| 640 | return 1; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 641 | } |
| 642 | return 0; |
| 643 | } |
| 644 | |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 645 | /** |
| 646 | * hfi1_ud_rcv - receive an incoming UD packet |
| 647 | * @ibp: the port the packet came in on |
| 648 | * @hdr: the packet header |
| 649 | * @rcv_flags: flags relevant to rcv processing |
| 650 | * @data: the packet data |
| 651 | * @tlen: the packet length |
| 652 | * @qp: the QP the packet came on |
| 653 | * |
| 654 | * This is called from qp_rcv() to process an incoming UD packet |
| 655 | * for the given QP. |
| 656 | * Called at interrupt level. |
| 657 | */ |
| 658 | void hfi1_ud_rcv(struct hfi1_packet *packet) |
| 659 | { |
Mike Marciniszyn | 261a435 | 2016-09-06 04:35:05 -0700 | [diff] [blame] | 660 | struct ib_other_headers *ohdr = packet->ohdr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 661 | u32 hdrsize = packet->hlen; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 662 | struct ib_wc wc; |
| 663 | u32 qkey; |
| 664 | u32 src_qp; |
Don Hiatt | 9039746 | 2017-05-12 09:20:20 -0700 | [diff] [blame] | 665 | u16 pkey; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 666 | int mgmt_pkey_idx = -1; |
Sebastian Sanchez | f3e862c | 2017-02-08 05:26:25 -0800 | [diff] [blame] | 667 | struct hfi1_ibport *ibp = rcd_to_iport(packet->rcd); |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 668 | struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); |
Mike Marciniszyn | 261a435 | 2016-09-06 04:35:05 -0700 | [diff] [blame] | 669 | struct ib_header *hdr = packet->hdr; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 670 | void *data = packet->ebuf; |
| 671 | u32 tlen = packet->tlen; |
Dennis Dalessandro | 895420d | 2016-01-19 14:42:28 -0800 | [diff] [blame] | 672 | struct rvt_qp *qp = packet->qp; |
Dasaratharaman Chandramouli | aad559c | 2017-04-09 10:16:15 -0700 | [diff] [blame] | 673 | u8 sc5 = hfi1_9B_get_sc5(hdr, packet->rhf); |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 674 | u32 bth1; |
Don Hiatt | 9039746 | 2017-05-12 09:20:20 -0700 | [diff] [blame] | 675 | u8 sl_from_sc; |
| 676 | u8 extra_bytes = packet->pad; |
| 677 | u8 opcode = packet->opcode; |
| 678 | u8 sl = packet->sl; |
| 679 | u32 dlid = packet->dlid; |
| 680 | u32 slid = packet->slid; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 681 | |
Don Hiatt | 9039746 | 2017-05-12 09:20:20 -0700 | [diff] [blame] | 682 | bth1 = be32_to_cpu(ohdr->bth[1]); |
Don Hiatt | 7dafbab | 2017-05-12 09:19:55 -0700 | [diff] [blame] | 683 | qkey = ib_get_qkey(ohdr); |
| 684 | src_qp = ib_get_sqpn(ohdr); |
Don Hiatt | cb427057 | 2017-04-09 10:16:22 -0700 | [diff] [blame] | 685 | pkey = ib_bth_get_pkey(ohdr); |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 686 | extra_bytes += (SIZE_OF_CRC << 2); |
| 687 | sl_from_sc = ibp->sc_to_sl[sc5]; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 688 | |
Mitko Haralanov | 5fd2b56 | 2016-07-25 13:38:07 -0700 | [diff] [blame] | 689 | process_ecn(qp, packet, (opcode != IB_OPCODE_CNP)); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 690 | /* |
| 691 | * Get the number of bytes the message was padded by |
| 692 | * and drop incomplete packets. |
| 693 | */ |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 694 | if (unlikely(tlen < (hdrsize + extra_bytes))) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 695 | goto drop; |
| 696 | |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 697 | tlen -= hdrsize + extra_bytes; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 698 | |
| 699 | /* |
| 700 | * Check that the permissive LID is only used on QP0 |
| 701 | * and the QKEY matches (see 9.6.1.4.1 and 9.6.1.5.1). |
| 702 | */ |
| 703 | if (qp->ibqp.qp_num) { |
| 704 | if (unlikely(hdr->lrh[1] == IB_LID_PERMISSIVE || |
| 705 | hdr->lrh[3] == IB_LID_PERMISSIVE)) |
| 706 | goto drop; |
| 707 | if (qp->ibqp.qp_num > 1) { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 708 | if (unlikely(rcv_pkey_check(ppd, pkey, sc5, slid))) { |
| 709 | /* |
| 710 | * Traps will not be sent for packets dropped |
| 711 | * by the HW. This is fine, as sending trap |
| 712 | * for invalid pkeys is optional according to |
| 713 | * IB spec (release 1.3, section 10.9.4) |
| 714 | */ |
Dennis Dalessandro | 13d8491 | 2017-05-29 17:22:01 -0700 | [diff] [blame^] | 715 | hfi1_bad_pkey(ibp, |
| 716 | pkey, sl, |
| 717 | src_qp, qp->ibqp.qp_num, |
| 718 | slid, dlid); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 719 | return; |
| 720 | } |
| 721 | } else { |
| 722 | /* GSI packet */ |
| 723 | mgmt_pkey_idx = hfi1_lookup_pkey_idx(ibp, pkey); |
| 724 | if (mgmt_pkey_idx < 0) |
| 725 | goto drop; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 726 | } |
Dennis Dalessandro | 13d8491 | 2017-05-29 17:22:01 -0700 | [diff] [blame^] | 727 | if (unlikely(qkey != qp->qkey)) /* Silent drop */ |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 728 | return; |
Dennis Dalessandro | 13d8491 | 2017-05-29 17:22:01 -0700 | [diff] [blame^] | 729 | |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 730 | /* Drop invalid MAD packets (see 13.5.3.1). */ |
| 731 | if (unlikely(qp->ibqp.qp_num == 1 && |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 732 | (tlen > 2048 || (sc5 == 0xF)))) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 733 | goto drop; |
| 734 | } else { |
| 735 | /* Received on QP0, and so by definition, this is an SMP */ |
| 736 | struct opa_smp *smp = (struct opa_smp *)data; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 737 | |
| 738 | if (opa_smp_check(ibp, pkey, sc5, qp, slid, smp)) |
| 739 | goto drop; |
| 740 | |
| 741 | if (tlen > 2048) |
| 742 | goto drop; |
| 743 | if ((hdr->lrh[1] == IB_LID_PERMISSIVE || |
| 744 | hdr->lrh[3] == IB_LID_PERMISSIVE) && |
| 745 | smp->mgmt_class != IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) |
| 746 | goto drop; |
| 747 | |
| 748 | /* look up SMI pkey */ |
| 749 | mgmt_pkey_idx = hfi1_lookup_pkey_idx(ibp, pkey); |
| 750 | if (mgmt_pkey_idx < 0) |
| 751 | goto drop; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 752 | } |
| 753 | |
| 754 | if (qp->ibqp.qp_num > 1 && |
| 755 | opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) { |
| 756 | wc.ex.imm_data = ohdr->u.ud.imm_data; |
| 757 | wc.wc_flags = IB_WC_WITH_IMM; |
| 758 | tlen -= sizeof(u32); |
| 759 | } else if (opcode == IB_OPCODE_UD_SEND_ONLY) { |
| 760 | wc.ex.imm_data = 0; |
| 761 | wc.wc_flags = 0; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 762 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 763 | goto drop; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 764 | } |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 765 | |
| 766 | /* |
| 767 | * A GRH is expected to precede the data even if not |
| 768 | * present on the wire. |
| 769 | */ |
| 770 | wc.byte_len = tlen + sizeof(struct ib_grh); |
| 771 | |
| 772 | /* |
| 773 | * Get the next work request entry to find where to put the data. |
| 774 | */ |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 775 | if (qp->r_flags & RVT_R_REUSE_SGE) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 776 | qp->r_flags &= ~RVT_R_REUSE_SGE; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 777 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 778 | int ret; |
| 779 | |
Dennis Dalessandro | ec4274f | 2016-01-19 14:43:44 -0800 | [diff] [blame] | 780 | ret = hfi1_rvt_get_rwqe(qp, 0); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 781 | if (ret < 0) { |
Brian Welty | beb5a04 | 2017-02-08 05:27:01 -0800 | [diff] [blame] | 782 | rvt_rc_error(qp, IB_WC_LOC_QP_OP_ERR); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 783 | return; |
| 784 | } |
| 785 | if (!ret) { |
| 786 | if (qp->ibqp.qp_num == 0) |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 787 | ibp->rvp.n_vl15_dropped++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 788 | return; |
| 789 | } |
| 790 | } |
| 791 | /* Silently drop packets which are too big. */ |
| 792 | if (unlikely(wc.byte_len > qp->r_len)) { |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 793 | qp->r_flags |= RVT_R_REUSE_SGE; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 794 | goto drop; |
| 795 | } |
Don Hiatt | 9039746 | 2017-05-12 09:20:20 -0700 | [diff] [blame] | 796 | if (packet->grh) { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 797 | hfi1_copy_sge(&qp->r_sge, &hdr->u.l.grh, |
Brian Welty | 0128fce | 2017-02-08 05:27:31 -0800 | [diff] [blame] | 798 | sizeof(struct ib_grh), true, false); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 799 | wc.wc_flags |= IB_WC_GRH; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 800 | } else { |
Brian Welty | 1198fce | 2017-02-08 05:27:37 -0800 | [diff] [blame] | 801 | rvt_skip_sge(&qp->r_sge, sizeof(struct ib_grh), true); |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 802 | } |
Dean Luick | 7b0b01a | 2016-02-03 14:35:49 -0800 | [diff] [blame] | 803 | hfi1_copy_sge(&qp->r_sge, data, wc.byte_len - sizeof(struct ib_grh), |
Brian Welty | 0128fce | 2017-02-08 05:27:31 -0800 | [diff] [blame] | 804 | true, false); |
Dennis Dalessandro | ec4274f | 2016-01-19 14:43:44 -0800 | [diff] [blame] | 805 | rvt_put_ss(&qp->r_sge); |
Dennis Dalessandro | 54d10c1 | 2016-01-19 14:43:01 -0800 | [diff] [blame] | 806 | if (!test_and_clear_bit(RVT_R_WRID_VALID, &qp->r_aflags)) |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 807 | return; |
| 808 | wc.wr_id = qp->r_wr_id; |
| 809 | wc.status = IB_WC_SUCCESS; |
| 810 | wc.opcode = IB_WC_RECV; |
| 811 | wc.vendor_err = 0; |
| 812 | wc.qp = &qp->ibqp; |
| 813 | wc.src_qp = src_qp; |
| 814 | |
| 815 | if (qp->ibqp.qp_type == IB_QPT_GSI || |
| 816 | qp->ibqp.qp_type == IB_QPT_SMI) { |
| 817 | if (mgmt_pkey_idx < 0) { |
| 818 | if (net_ratelimit()) { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 819 | struct hfi1_devdata *dd = ppd->dd; |
| 820 | |
| 821 | dd_dev_err(dd, "QP type %d mgmt_pkey_idx < 0 and packet not dropped???\n", |
| 822 | qp->ibqp.qp_type); |
| 823 | mgmt_pkey_idx = 0; |
| 824 | } |
| 825 | } |
| 826 | wc.pkey_index = (unsigned)mgmt_pkey_idx; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 827 | } else { |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 828 | wc.pkey_index = 0; |
Jubin John | e490974 | 2016-02-14 20:22:00 -0800 | [diff] [blame] | 829 | } |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 830 | |
Dasaratharaman Chandramouli | 89c057c | 2016-07-25 13:40:28 -0700 | [diff] [blame] | 831 | wc.slid = slid; |
| 832 | wc.sl = sl_from_sc; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 833 | |
| 834 | /* |
| 835 | * Save the LMC lower bits if the destination LID is a unicast LID. |
| 836 | */ |
Dennis Dalessandro | 8859b4a | 2016-01-19 14:42:11 -0800 | [diff] [blame] | 837 | wc.dlid_path_bits = dlid >= be16_to_cpu(IB_MULTICAST_LID_BASE) ? 0 : |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 838 | dlid & ((1 << ppd_from_ibp(ibp)->lmc) - 1); |
| 839 | wc.port_num = qp->port_num; |
| 840 | /* Signal completion event if the solicited bit is set. */ |
Dennis Dalessandro | abd712d | 2016-01-19 14:43:22 -0800 | [diff] [blame] | 841 | rvt_cq_enter(ibcq_to_rvtcq(qp->ibqp.recv_cq), &wc, |
| 842 | (ohdr->bth[0] & |
| 843 | cpu_to_be32(IB_BTH_SOLICITED)) != 0); |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 844 | return; |
| 845 | |
| 846 | drop: |
Dennis Dalessandro | 4eb0688 | 2016-01-19 14:42:39 -0800 | [diff] [blame] | 847 | ibp->rvp.n_pkt_drops++; |
Mike Marciniszyn | 7724105 | 2015-07-30 15:17:43 -0400 | [diff] [blame] | 848 | } |