| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved. |
|---|
| 3 | 4 | * 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. |
|---|
| 32 | 5 | */ |
|---|
| 33 | 6 | |
|---|
| 34 | 7 | #include <linux/skbuff.h> |
|---|
| .. | .. |
|---|
| 381 | 354 | struct rxe_pkt_info *pkt) |
|---|
| 382 | 355 | { |
|---|
| 383 | 356 | struct rxe_dev *rxe = to_rdev(qp->ibqp.device); |
|---|
| 384 | | - struct rxe_port *port = &rxe->port; |
|---|
| 385 | 357 | struct sk_buff *skb; |
|---|
| 386 | 358 | struct rxe_send_wr *ibwr = &wqe->wr; |
|---|
| 387 | 359 | struct rxe_av *av; |
|---|
| .. | .. |
|---|
| 419 | 391 | (pkt->mask & (RXE_WRITE_MASK | RXE_IMMDT_MASK)) == |
|---|
| 420 | 392 | (RXE_WRITE_MASK | RXE_IMMDT_MASK)); |
|---|
| 421 | 393 | |
|---|
| 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; |
|---|
| 425 | 395 | |
|---|
| 426 | 396 | qp_num = (pkt->mask & RXE_DETH_MASK) ? ibwr->wr.ud.remote_qpn : |
|---|
| 427 | 397 | qp->attr.dest_qp_num; |
|---|
| .. | .. |
|---|
| 479 | 449 | u32 *p; |
|---|
| 480 | 450 | int err; |
|---|
| 481 | 451 | |
|---|
| 482 | | - err = rxe_prepare(rxe, pkt, skb, &crc); |
|---|
| 452 | + err = rxe_prepare(pkt, skb, &crc); |
|---|
| 483 | 453 | if (err) |
|---|
| 484 | 454 | return err; |
|---|
| 485 | 455 | |
|---|
| .. | .. |
|---|
| 647 | 617 | |
|---|
| 648 | 618 | rmr->state = RXE_MEM_STATE_VALID; |
|---|
| 649 | 619 | 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; |
|---|
| 652 | 622 | rmr->iova = wqe->wr.wr.reg.mr->iova; |
|---|
| 653 | 623 | wqe->state = wqe_state_done; |
|---|
| 654 | 624 | wqe->status = IB_WC_SUCCESS; |
|---|
| .. | .. |
|---|
| 680 | 650 | opcode = next_opcode(qp, wqe, wqe->wr.opcode); |
|---|
| 681 | 651 | if (unlikely(opcode < 0)) { |
|---|
| 682 | 652 | wqe->status = IB_WC_LOC_QP_OP_ERR; |
|---|
| 683 | | - goto exit; |
|---|
| 653 | + goto err; |
|---|
| 684 | 654 | } |
|---|
| 685 | 655 | |
|---|
| 686 | 656 | mask = rxe_opcode[opcode].mask; |
|---|
| .. | .. |
|---|
| 736 | 706 | save_state(wqe, qp, &rollback_wqe, &rollback_psn); |
|---|
| 737 | 707 | update_wqe_state(qp, wqe, &pkt); |
|---|
| 738 | 708 | 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); |
|---|
| 740 | 710 | if (ret) { |
|---|
| 741 | 711 | qp->need_req_skb = 1; |
|---|
| 742 | 712 | |
|---|