From patchwork Wed Aug 2 09:32:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13337942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CDEBC001DE for ; Wed, 2 Aug 2023 09:44:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232285AbjHBJob (ORCPT ); Wed, 2 Aug 2023 05:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231382AbjHBJo1 (ORCPT ); Wed, 2 Aug 2023 05:44:27 -0400 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3A911BFD for ; Wed, 2 Aug 2023 02:44:23 -0700 (PDT) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-56c7eb17945so2704984eaf.2 for ; Wed, 02 Aug 2023 02:44:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1690969463; x=1691574263; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=+QN3+M8WXFSAMcffrID+aHf8PDuD0JjAUphGpayU+XU=; b=f6SEsb+VZIVXjT+Zk2R0+KKRMkvaFEVR9WhXkfSC8pPu4TLHswa2VWVww9d8PB0Irx RN+Z6ElrB+ZJn3mv4wxutufHzzTUXa+wB1hgzYpDD+XKlHhn5eICI+ROizJv14oLOpm0 W+WWjRdocXpoAjbOLdktSn0cj/uo+gSRe0pBs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690969463; x=1691574263; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+QN3+M8WXFSAMcffrID+aHf8PDuD0JjAUphGpayU+XU=; b=O50BFFUuK3vbGXzqa2DWAP2fKb8NmXqwFTYPmAN9lT4LN4EZ6xPJPep3aqmqNWX+M4 jrVV7vpMbPrsZh/esGm3A8bRaJv18Ca4IsHAA9O2qb1d3tmtgnWrEXEwY+7Oeqsjchvd 5QtZWDGaDvxTKHO2lbVIx+WWlB2UuWdlEK0HrjawhZKsiivkgRoLr9aKt81vJy4DFpLP cZjqzr7sIGXfrVEtcarxsvtRtM2VMIStyrJAatabSzMXtXr56yqiFTPeIX97qbxt+tfe 6UZ3PxPn7hSmfaSshhho+FWhudpptq4KJyKy84ajVWIUMCN729TIi2HaujYIgF8ql38m Fj5g== X-Gm-Message-State: ABy/qLZXQ8EjCbH0NJtx7jQBxXjPXg+sQXQixtnaw7w/3KQcIdoDPSmS qGBx+AN239izcRnlSQFRzQm0Ww== X-Google-Smtp-Source: APBJJlGPk6C1NzP7sFlDgJA5HZgm8FCUzx/bYG7Y5MmrQT5GMbQOAToOteojIIrjSeu5nV1J5vDhGw== X-Received: by 2002:a05:6808:13c9:b0:3a4:225d:8135 with SMTP id d9-20020a05680813c900b003a4225d8135mr18802539oiw.31.1690969463062; Wed, 02 Aug 2023 02:44:23 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 5-20020a17090a000500b00263dfe9b972sm848790pja.0.2023.08.02.02.44.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2023 02:44:22 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kalesh AP , Selvin Xavier Subject: [PATCH for-next 2/6] RDMA/bnxt_re: Remove a redundant flag Date: Wed, 2 Aug 2023 02:32:35 -0700 Message-Id: <1690968759-9142-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1690968759-9142-1-git-send-email-selvin.xavier@broadcom.com> References: <1690968759-9142-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kalesh AP After the cited commit, BNXT_RE_FLAG_GOT_MSIX is redundant. Remove it. Fixes: 303432211324 ("bnxt_en: Remove runtime interrupt vector allocation") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/bnxt_re.h | 1 - drivers/infiniband/hw/bnxt_re/main.c | 5 ++--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 3 ++- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 6 ++++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h b/drivers/infiniband/hw/bnxt_re/bnxt_re.h index 03a1325..9fd9849 100644 --- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h +++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h @@ -140,7 +140,6 @@ struct bnxt_re_dev { struct list_head list; unsigned long flags; #define BNXT_RE_FLAG_NETDEV_REGISTERED 0 -#define BNXT_RE_FLAG_GOT_MSIX 2 #define BNXT_RE_FLAG_HAVE_L2_REF 3 #define BNXT_RE_FLAG_RCFW_CHANNEL_EN 4 #define BNXT_RE_FLAG_QOS_WORK_REG 5 diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index bbda694..2fe47b3 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1422,8 +1422,8 @@ static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev) bnxt_re_net_ring_free(rdev, rdev->rcfw.creq.ring_id, type); bnxt_qplib_free_rcfw_channel(&rdev->rcfw); } - if (test_and_clear_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags)) - rdev->num_msix = 0; + + rdev->num_msix = 0; if (rdev->pacing.dbr_pacing) bnxt_re_deinitialize_dbr_pacing(rdev); @@ -1480,7 +1480,6 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode) ibdev_dbg(&rdev->ibdev, "Got %d MSI-X vectors\n", rdev->en_dev->ulp_tbl->msix_requested); rdev->num_msix = rdev->en_dev->ulp_tbl->msix_requested; - set_bit(BNXT_RE_FLAG_GOT_MSIX, &rdev->flags); bnxt_re_query_hwrm_intf_version(rdev); diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c index b30e66b..4842a41 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c @@ -335,7 +335,8 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, cpu_to_le64(sbuf->dma_addr)); __set_cmdq_base_resp_size(msg->req, msg->req_sz, ALIGN(sbuf->size, - BNXT_QPLIB_CMDQE_UNITS)); + BNXT_QPLIB_CMDQE_UNITS) / + BNXT_QPLIB_CMDQE_UNITS); } preq = (u8 *)msg->req; diff --git a/drivers/infiniband/hw/bnxt_re/qplib_sp.c b/drivers/infiniband/hw/bnxt_re/qplib_sp.c index b77928a..89acb66 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -801,9 +801,11 @@ int bnxt_qplib_qext_stat(struct bnxt_qplib_rcfw *rcfw, u32 fid, struct cmdq_query_roce_stats_ext req = {}; struct bnxt_qplib_cmdqmsg msg = {}; struct bnxt_qplib_rcfw_sbuf *sbuf; + u32 size; int rc; - sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb)); + size = ALIGN(sizeof(*sb), BNXT_QPLIB_CMDQE_UNITS); + sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, size); if (!sbuf) { dev_err(&rcfw->pdev->dev, "SP: QUERY_ROCE_STATS_EXT alloc sb failed"); @@ -814,7 +816,7 @@ int bnxt_qplib_qext_stat(struct bnxt_qplib_rcfw *rcfw, u32 fid, CMDQ_QUERY_ROCE_STATS_EXT_OPCODE_QUERY_ROCE_STATS, sizeof(req)); - req.resp_size = ALIGN(sizeof(*sb), BNXT_QPLIB_CMDQE_UNITS); + req.resp_size = size / BNXT_QPLIB_CMDQE_UNITS; req.resp_addr = cpu_to_le64(sbuf->dma_addr); req.function_id = cpu_to_le32(fid); req.flags = cpu_to_le16(CMDQ_QUERY_ROCE_STATS_EXT_FLAGS_FUNCTION_ID);