From patchwork Fri May 12 10:24:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 9723869 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 DEA98600CB for ; Fri, 12 May 2017 10:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D317B287F3 for ; Fri, 12 May 2017 10:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6CF128801; Fri, 12 May 2017 10:24:41 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 76184287F3 for ; Fri, 12 May 2017 10:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756906AbdELKYk (ORCPT ); Fri, 12 May 2017 06:24:40 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:33517 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756901AbdELKYj (ORCPT ); Fri, 12 May 2017 06:24:39 -0400 Received: by mail-pf0-f177.google.com with SMTP id e193so28154249pfh.0 for ; Fri, 12 May 2017 03:24:39 -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=7yiLEea+SCab9ggFXQnxAyQP51LQNM+jcfDZQF5kdGM=; b=fMEq9QcaWw/qV4ky/W28nCbnGdaRrkTmOoSGUEQYx7hpDmDGDtLnH04uuNnK+UXC65 M+mxWlnz5Sw5rQlPMOn1k8FlMJppqipffQMEcWKRT82E+s/w6fi1jWjPINO2wthFUkmW uXvUwXS+8p3uXRhkx3++c3/rs6Zik+NaPJHyk= 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=7yiLEea+SCab9ggFXQnxAyQP51LQNM+jcfDZQF5kdGM=; b=oZhiOq8iwm9ogWFzxhNKmxgmx9vOq6EGERqxwsp5XQjzeOo7svRNpAqriC1YExxNzf l+v5nqJKGAJQpLnQMEPD8JobIukFVhz8HXImaletLdOku3UtIz4LyC2idQhBDG8Sc+kB mUDehXPtaeMUf3TfDKUDtRCPl63xmjZBPX7ibj4GxlINdTylQsYQXAyf/ajAdCeT+VXc MAdWNm4Re/PT57aadxAyojNO6B7s7/10r1+k2VSMSb6xHrnb0Um60LHXOQbZ1omuZofY 9lF/tjz2mUfLuYrNzMdDgU5dM2nu7NOhRepaIntg/yjc9zuXQd/W3ipGJy8LDn5Lp0mY V2Ow== X-Gm-Message-State: AODbwcAkr0A3+dPyjs0K+kh/B4iOevRnV0sWdfDPMa8H6HZvdbNxIMxj neX/B6f+NsQrwhsXuUO5/A== X-Received: by 10.99.154.18 with SMTP id o18mr3576090pge.59.1494584678808; Fri, 12 May 2017 03:24:38 -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.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 May 2017 03:24:38 -0700 (PDT) From: Devesh Sharma To: linux-rdma@vger.kernel.org Subject: [PATCH 2/5] libbnxt_re: fix wqe size for the 0-len posting Date: Fri, 12 May 2017 06:24:23 -0400 Message-Id: <1494584666-11064-3-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 rstream does not include any SGEs in the traffic it generates with zero length. In this case wqe preparation logic is calculating WQE-size=2. This is resulting WQE_FORMAT_ERROR when h/w is processing the wqe. Our h/w requires host to supply WQE Size with room for atleast one SGE. Thus, this patch is increasing the wqe-size by 1 whenever wr->num_sges are zero. Signed-off-by: Somnath Kotur Signed-off-by: Devesh Sharma --- providers/bnxt_re/verbs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c index 35eb12d..7cf0b86 100644 --- a/providers/bnxt_re/verbs.c +++ b/providers/bnxt_re/verbs.c @@ -1081,6 +1081,11 @@ static int bnxt_re_build_send_sqe(struct bnxt_re_qp *qp, void *wqe, } else { qesize = wr->num_sge; } + /* HW requires wqe size has room for atleast one sge even if none was + * supplied by application + */ + if (!wr->num_sge) + qesize++; qesize += (bnxt_re_get_sqe_hdr_sz() >> 4); hdrval |= (qesize & BNXT_RE_HDR_WS_MASK) << BNXT_RE_HDR_WS_SHIFT; hdr->rsv_ws_fl_wt |= htole32(hdrval); @@ -1259,6 +1264,11 @@ static int bnxt_re_build_rqe(struct bnxt_re_qp *qp, struct ibv_recv_wr *wr, len = bnxt_re_build_sge(sge, wr->sg_list, wr->num_sge, false); wqe_sz = wr->num_sge + (bnxt_re_get_rqe_hdr_sz() >> 4); /* 16B align */ + /* HW requires wqe size has room for atleast one sge even if none was + * supplied by application + */ + if (!wr->num_sge) + wqe_sz++; hdrval = BNXT_RE_WR_OPCD_RECV; hdrval |= ((wqe_sz & BNXT_RE_HDR_WS_MASK) << BNXT_RE_HDR_WS_SHIFT); hdr->rsv_ws_fl_wt = htole32(hdrval);