From patchwork Fri May 12 10:24:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 9723871 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 D5C73600CB for ; Fri, 12 May 2017 10:24:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA196287F3 for ; Fri, 12 May 2017 10:24:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BEED028801; Fri, 12 May 2017 10:24:43 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 66BE0287F3 for ; Fri, 12 May 2017 10:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756909AbdELKYm (ORCPT ); Fri, 12 May 2017 06:24:42 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:33526 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756901AbdELKYl (ORCPT ); Fri, 12 May 2017 06:24:41 -0400 Received: by mail-pf0-f169.google.com with SMTP id e193so28154604pfh.0 for ; Fri, 12 May 2017 03:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=Qe5QgVOIxL1M2VmO1SPI4xa8wNr5TY47+84PLKXmzO4=; b=fbbk6/z807y1O57avZyIfYcNK5KKfyotcizzQ+XMY0GvRZuPnnVraMdR3MZfiuDXSS RiELfXZmEGMvTSyr1sTgArgQ5w73esbUTGq+ICnWy8SPMoYIZ4FKEAthdV7DR7V3yYBs 8JsZ2IceSUZ4nQMInFEypBFJwJYmwsJzcemcU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Qe5QgVOIxL1M2VmO1SPI4xa8wNr5TY47+84PLKXmzO4=; b=B4qD+5rC2874f788epsyiKgPoiAj+YwJoEYJupKMjyig20plFnZyKpS39gBWBMRzao aV3sxOlARCvaQ4qZUsoGGVhXAqGCIE5LWt4TcR7PY1NsTgxoIqzGCTftxP+Ca89HQJEs TbAbvd5wIVC0LrzOC3QcxxPRm9+1tfSAJKKc2niW1yqUuIIFkOZU7jRUw2/RRRgCcJ06 5vmP+cGN4vXcXlzHmr/X7UQ8Jkc6q5MRziXldi8hVdcxtF5GU06nvAyWGFNjDaMV+fWH 4xqcLU97xJRLWvQnOBnIilRJ36r2iMSfYvjv3Av8suXWrah8aOuLlEFOrumEsO9myD7M DehQ== X-Gm-Message-State: AODbwcCx/8OUvrK9R0cLMX/3remUyEBYj50eo/e+QPsX7ZdLDcdP0aKH OfSyjwvsYGaNltXWQBX/8w== X-Received: by 10.99.117.66 with SMTP id f2mr3672069pgn.58.1494584680740; Fri, 12 May 2017 03:24:40 -0700 (PDT) Received: from neo00-el73.iig.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id c12sm4901872pfl.79.2017.05.12.03.24.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 May 2017 03:24:39 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Subject: [PATCH 3/5] libbnxt_re: move rts to rts after a threshold Date: Fri, 12 May 2017 06:24:24 -0400 Message-Id: <1494584666-11064-4-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1494584666-11064-1-git-send-email-devesh.sharma@broadcom.com> References: <1494584666-11064-1-git-send-email-devesh.sharma@broadcom.com> 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: Somnath Kotur Due to a know bug, h/w is stopping UD-WQE processing after 0x800000 WQEs. Library needs to move the QP from RTS to RTS around half-way mark. This patch adds a simple wqe-counter and modfies the qp to circumvent the problem. Signed-off-by: Somnath Kotur Signed-off-by: Devesh Sharma --- providers/bnxt_re/main.h | 3 +++ providers/bnxt_re/verbs.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/providers/bnxt_re/main.h b/providers/bnxt_re/main.h index 4cc8abd..9688fec 100644 --- a/providers/bnxt_re/main.h +++ b/providers/bnxt_re/main.h @@ -54,6 +54,8 @@ #define DEV "bnxt_re : " +#define BNXT_RE_UD_QP_HW_STALL 0x400000 + struct bnxt_re_dpi { __u32 dpindx; __u64 *dbpage; @@ -113,6 +115,7 @@ struct bnxt_re_qp { uint32_t tbl_indx; uint32_t sq_psn; uint32_t pending_db; + uint64_t wqe_cnt; uint16_t mtu; uint16_t qpst; uint8_t qptyp; diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 7cf0b86..abe4e2e 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -1240,8 +1240,20 @@ int bnxt_re_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, bnxt_re_fill_wrid(wrid, wr, bytes, qp->cap.sqsig); bnxt_re_fill_psns(qp, psns, wr->opcode, bytes); bnxt_re_incr_tail(sq); + qp->wqe_cnt++; wr = wr->next; bnxt_re_ring_sq_db(qp); + if (qp->wqe_cnt == BNXT_RE_UD_QP_HW_STALL && qp->qptyp == + IBV_QPT_UD) { + /* Move RTS to RTS since it is time. */ + struct ibv_qp_attr attr; + int attr_mask; + + attr_mask = IBV_QP_STATE; + attr.qp_state = IBV_QPS_RTS; + bnxt_re_modify_qp(&qp->ibvqp, &attr, attr_mask); + qp->wqe_cnt = 0; + } } pthread_spin_unlock(&sq->qlock);