| .. | .. |
|---|
| 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> |
|---|
| .. | .. |
|---|
| 146 | 119 | } |
|---|
| 147 | 120 | } |
|---|
| 148 | 121 | |
|---|
| 149 | | -void rxe_comp_queue_pkt(struct rxe_dev *rxe, struct rxe_qp *qp, |
|---|
| 150 | | - struct sk_buff *skb) |
|---|
| 122 | +void rxe_comp_queue_pkt(struct rxe_qp *qp, struct sk_buff *skb) |
|---|
| 151 | 123 | { |
|---|
| 152 | 124 | int must_sched; |
|---|
| 153 | 125 | |
|---|
| .. | .. |
|---|
| 155 | 127 | |
|---|
| 156 | 128 | must_sched = skb_queue_len(&qp->resp_pkts) > 1; |
|---|
| 157 | 129 | if (must_sched != 0) |
|---|
| 158 | | - rxe_counter_inc(rxe, RXE_CNT_COMPLETER_SCHED); |
|---|
| 130 | + rxe_counter_inc(SKB_TO_PKT(skb)->rxe, RXE_CNT_COMPLETER_SCHED); |
|---|
| 131 | + |
|---|
| 159 | 132 | rxe_run_task(&qp->comp.task, must_sched); |
|---|
| 160 | 133 | } |
|---|
| 161 | 134 | |
|---|
| .. | .. |
|---|
| 282 | 255 | if ((syn & AETH_TYPE_MASK) != AETH_ACK) |
|---|
| 283 | 256 | return COMPST_ERROR; |
|---|
| 284 | 257 | |
|---|
| 285 | | - /* fall through */ |
|---|
| 258 | + fallthrough; |
|---|
| 286 | 259 | /* (IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE doesn't have an AETH) |
|---|
| 287 | 260 | */ |
|---|
| 288 | 261 | case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE: |
|---|
| .. | .. |
|---|
| 439 | 412 | */ |
|---|
| 440 | 413 | static void do_complete(struct rxe_qp *qp, struct rxe_send_wqe *wqe) |
|---|
| 441 | 414 | { |
|---|
| 415 | + struct rxe_dev *rxe = to_rdev(qp->ibqp.device); |
|---|
| 442 | 416 | struct rxe_cqe cqe; |
|---|
| 443 | 417 | |
|---|
| 444 | 418 | if ((qp->sq_sig_type == IB_SIGNAL_ALL_WR) || |
|---|
| .. | .. |
|---|
| 450 | 424 | } else { |
|---|
| 451 | 425 | advance_consumer(qp->sq.queue); |
|---|
| 452 | 426 | } |
|---|
| 427 | + |
|---|
| 428 | + if (wqe->wr.opcode == IB_WR_SEND || |
|---|
| 429 | + wqe->wr.opcode == IB_WR_SEND_WITH_IMM || |
|---|
| 430 | + wqe->wr.opcode == IB_WR_SEND_WITH_INV) |
|---|
| 431 | + rxe_counter_inc(rxe, RXE_CNT_RDMA_SEND); |
|---|
| 453 | 432 | |
|---|
| 454 | 433 | /* |
|---|
| 455 | 434 | * we completed something so let req run again |
|---|
| .. | .. |
|---|
| 552 | 531 | { |
|---|
| 553 | 532 | struct rxe_qp *qp = (struct rxe_qp *)arg; |
|---|
| 554 | 533 | struct rxe_dev *rxe = to_rdev(qp->ibqp.device); |
|---|
| 555 | | - struct rxe_send_wqe *wqe = wqe; |
|---|
| 534 | + struct rxe_send_wqe *wqe = NULL; |
|---|
| 556 | 535 | struct sk_buff *skb = NULL; |
|---|
| 557 | 536 | struct rxe_pkt_info *pkt = NULL; |
|---|
| 558 | 537 | enum comp_state state; |
|---|
| .. | .. |
|---|
| 684 | 663 | */ |
|---|
| 685 | 664 | |
|---|
| 686 | 665 | /* there is nothing to retry in this case */ |
|---|
| 687 | | - if (!wqe || (wqe->state == wqe_state_posted)) { |
|---|
| 666 | + if (!wqe || (wqe->state == wqe_state_posted)) |
|---|
| 688 | 667 | goto exit; |
|---|
| 689 | | - } |
|---|
| 690 | 668 | |
|---|
| 691 | 669 | /* if we've started a retry, don't start another |
|---|
| 692 | 670 | * retry sequence, unless this is a timeout. |
|---|