hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/infiniband/sw/rxe/rxe_req.c
....@@ -1,34 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
12 /*
23 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
34 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
4
- *
5
- * This software is available to you under a choice of one of two
6
- * licenses. You may choose to be licensed under the terms of the GNU
7
- * General Public License (GPL) Version 2, available from the file
8
- * COPYING in the main directory of this source tree, or the
9
- * OpenIB.org BSD license below:
10
- *
11
- * Redistribution and use in source and binary forms, with or
12
- * without modification, are permitted provided that the following
13
- * conditions are met:
14
- *
15
- * - Redistributions of source code must retain the above
16
- * copyright notice, this list of conditions and the following
17
- * disclaimer.
18
- *
19
- * - Redistributions in binary form must reproduce the above
20
- * copyright notice, this list of conditions and the following
21
- * disclaimer in the documentation and/or other materials
22
- * provided with the distribution.
23
- *
24
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
28
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
29
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
30
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31
- * SOFTWARE.
325 */
336
347 #include <linux/skbuff.h>
....@@ -381,7 +354,6 @@
381354 struct rxe_pkt_info *pkt)
382355 {
383356 struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
384
- struct rxe_port *port = &rxe->port;
385357 struct sk_buff *skb;
386358 struct rxe_send_wr *ibwr = &wqe->wr;
387359 struct rxe_av *av;
....@@ -419,9 +391,7 @@
419391 (pkt->mask & (RXE_WRITE_MASK | RXE_IMMDT_MASK)) ==
420392 (RXE_WRITE_MASK | RXE_IMMDT_MASK));
421393
422
- pkey = (qp_type(qp) == IB_QPT_GSI) ?
423
- port->pkey_tbl[ibwr->wr.ud.pkey_index] :
424
- port->pkey_tbl[qp->attr.pkey_index];
394
+ pkey = IB_DEFAULT_PKEY_FULL;
425395
426396 qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn :
427397 qp->attr.dest_qp_num;
....@@ -479,7 +449,7 @@
479449 u32 *p;
480450 int err;
481451
482
- err = rxe_prepare(rxe, pkt, skb, &crc);
452
+ err = rxe_prepare(pkt, skb, &crc);
483453 if (err)
484454 return err;
485455
....@@ -647,8 +617,8 @@
647617
648618 rmr->state = RXE_MEM_STATE_VALID;
649619 rmr->access = wqe->wr.wr.reg.access;
650
- rmr->lkey = wqe->wr.wr.reg.key;
651
- rmr->rkey = wqe->wr.wr.reg.key;
620
+ rmr->ibmr.lkey = wqe->wr.wr.reg.key;
621
+ rmr->ibmr.rkey = wqe->wr.wr.reg.key;
652622 rmr->iova = wqe->wr.wr.reg.mr->iova;
653623 wqe->state = wqe_state_done;
654624 wqe->status = IB_WC_SUCCESS;
....@@ -680,7 +650,7 @@
680650 opcode = next_opcode(qp, wqe, wqe->wr.opcode);
681651 if (unlikely(opcode < 0)) {
682652 wqe->status = IB_WC_LOC_QP_OP_ERR;
683
- goto exit;
653
+ goto err;
684654 }
685655
686656 mask = rxe_opcode[opcode].mask;
....@@ -736,7 +706,7 @@
736706 save_state(wqe, qp, &rollback_wqe, &rollback_psn);
737707 update_wqe_state(qp, wqe, &pkt);
738708 update_wqe_psn(qp, wqe, &pkt, payload);
739
- ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
709
+ ret = rxe_xmit_packet(qp, &pkt, skb);
740710 if (ret) {
741711 qp->need_req_skb = 1;
742712