From patchwork Sun Oct 8 23:37:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nikolova, Tatyana E" X-Patchwork-Id: 9992083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 353EE60244 for ; Sun, 8 Oct 2017 23:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22C892858F for ; Sun, 8 Oct 2017 23:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16CE42863E; Sun, 8 Oct 2017 23:38:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90CCB2858F for ; Sun, 8 Oct 2017 23:38:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbdJHXiA (ORCPT ); Sun, 8 Oct 2017 19:38:00 -0400 Received: from mga14.intel.com ([192.55.52.115]:57883 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751263AbdJHXiA (ORCPT ); Sun, 8 Oct 2017 19:38:00 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2017 16:38:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,497,1500966000"; d="scan'208";a="160266108" Received: from tenikolo-mobl.amr.corp.intel.com ([10.252.138.39]) by fmsmga005.fm.intel.com with ESMTP; 08 Oct 2017 16:37:58 -0700 From: Tatyana Nikolova To: jgunthorpe@obsidianresearch.com, dledford@redhat.com, leonro@mellanox.com Cc: linux-rdma@vger.kernel.org, e1000-rdma@lists.sourceforge.net Subject: [PATCH rdma-core] providers/i40iw: Do not generate CQE for RTR on QP flush Date: Sun, 8 Oct 2017 18:37:41 -0500 Message-Id: <20171008233741.9168-1-tatyana.e.nikolova@intel.com> X-Mailer: git-send-email 2.14.2 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mustafa Ismail If RTR WQE is posted and QP is flushed, a CQE is incorrectly generated for the RTR WQE. Add code to look for the RTR and not generate a CQE when QP is flushed. Signed-off-by: Mustafa Ismail Signed-off-by: Tatyana Nikolova --- providers/i40iw/i40iw_uk.c | 12 ++++++++++++ providers/i40iw/i40iw_user.h | 1 + 2 files changed, 13 insertions(+) diff --git a/providers/i40iw/i40iw_uk.c b/providers/i40iw/i40iw_uk.c index ea3255f7..4c7e5cff 100644 --- a/providers/i40iw/i40iw_uk.c +++ b/providers/i40iw/i40iw_uk.c @@ -829,6 +829,17 @@ static enum i40iw_status_code i40iw_cq_poll_completion(struct i40iw_cq_uk *cq, I40IW_RING_SET_TAIL(qp->rq_ring, array_idx + 1); pring = &qp->rq_ring; } else { + if (qp->first_sq_wq) { + qp->first_sq_wq = false; + if (!wqe_idx && (qp->sq_ring.head == qp->sq_ring.tail)) { + I40IW_RING_MOVE_HEAD_NOCHECK(cq->cq_ring); + I40IW_RING_MOVE_TAIL(cq->cq_ring); + set_64bit_val(cq->shadow_area, I40IW_BYTE_0, + I40IW_RING_GETCURRENT_HEAD(cq->cq_ring)); + memset(info, 0, sizeof(struct i40iw_cq_poll_info)); + return i40iw_cq_poll_completion(cq, info); + } + } if (info->comp_status != I40IW_COMPL_STATUS_FLUSHED) { info->wr_id = qp->sq_wrtrk_array[wqe_idx].wrid; @@ -997,6 +1008,7 @@ enum i40iw_status_code i40iw_qp_uk_init(struct i40iw_qp_uk *qp, I40IW_RING_MOVE_TAIL(qp->sq_ring); I40IW_RING_MOVE_HEAD(qp->initial_ring, ret_code); qp->swqe_polarity = 1; + qp->first_sq_wq = true; qp->swqe_polarity_deferred = 1; qp->rwqe_polarity = 0; diff --git a/providers/i40iw/i40iw_user.h b/providers/i40iw/i40iw_user.h index 1e95c23a..7bceca43 100644 --- a/providers/i40iw/i40iw_user.h +++ b/providers/i40iw/i40iw_user.h @@ -382,6 +382,7 @@ struct i40iw_qp_uk { u8 rwqe_polarity; u8 rq_wqe_size; u8 rq_wqe_size_multiplier; + bool first_sq_wq; bool deferred_flag; };