From patchwork Tue Nov 19 15:48:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11252391 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15353109A for ; Tue, 19 Nov 2019 15:49:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9B97222CD for ; Tue, 19 Nov 2019 15:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Qmi+taPC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbfKSPtR (ORCPT ); Tue, 19 Nov 2019 10:49:17 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:39802 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbfKSPtR (ORCPT ); Tue, 19 Nov 2019 10:49:17 -0500 Received: by mail-pl1-f193.google.com with SMTP id o9so11964223plk.6 for ; Tue, 19 Nov 2019 07:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AeJSkx2kTbF412koD5SLlgijO+d9oJ/AcNJGEwZ6kSI=; b=Qmi+taPCTJzpLnPGv+Q6yxwuzP1StmA5EX+JEOE9eKAm/IP41utVA2mJt1sREfgWpf XoLCrMpmNqIbU1SlebJjFzspbi4cRAp1L53mFl0IL2dWUTTgPadk/MtPEAAs3t3388E4 BN2IwMmF9nQm8LHkpqQs+BK1MNXprf9sqNzpc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AeJSkx2kTbF412koD5SLlgijO+d9oJ/AcNJGEwZ6kSI=; b=gQx7/q06MCOjb0UR9a7vKOpt9zQwYFCIlmPqZD/psISZYQNr/9NXyvyWl2kHHswuA3 MMV88DRQy2dPte3qRfpKlstRPu0NatlcqXDOucQMO2r/zNHUEPcjvxM1r9D7iSzsigVV Cu3jkLE1beib3WAw+mOKWzKTJ4QnvHAQ1Wgs0xQwNFZ6s6Ln+BDd1V4t68cMb0dKQ+7d 8dyB97oa3SvcXuOfnhBw0G6OL2/mf2NaB4gecPSfOihVmGj+MflIz0tIW01ZXD2pDlLU c0itNwu5A8uSz81Xd4bwj6VDfPLZw8igNahsS01Hfn92wvlT0B4cAD0hm7NnP13twm7a E8cQ== X-Gm-Message-State: APjAAAVIOjtxLTp4HmGOCZwmNmAqPFQ/TIVSFpVN41Wl2stZWuKrew6Y 556D9E13o/BxEwq5WRhZKzRM1A== X-Google-Smtp-Source: APXvYqztMU93ByoUkEh3oy/HpaLP/dFRcEZzacWMOEp+npw5CYgdxW55C4BSDauMyE0LqHsKWsKKZg== X-Received: by 2002:a17:902:59c9:: with SMTP id d9mr34177622plj.229.1574178556313; Tue, 19 Nov 2019 07:49:16 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 10sm24263620pgs.11.2019.11.19.07.49.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 07:49:15 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Luke Starrett , Naresh Kumar PBS , Selvin Xavier , Devesh Sharma Subject: [PATCH for-rc 1/3] RDMA/bnxt_re: Fix chip number validation Broadcom's Gen P5 series Date: Tue, 19 Nov 2019 10:48:49 -0500 Message-Id: <1574178531-15898-2-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574178531-15898-1-git-send-email-devesh.sharma@broadcom.com> References: <1574178531-15898-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 From: Luke Starrett In the first version of Gen P5 ASIC, chip-id was always set to 0x1750 for all adaptor port configurations. This has been fixed in the new chip rev. Making a change in chip-number validation check to honor other chip-ids as well. Fixes: ae8637e13185 ("RDMA/bnxt_re: Add chip context to identify 57500 series") Signed-off-by: Naresh Kumar PBS Signed-off-by: Selvin Xavier Signed-off-by: Luke Starrett Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/qplib_res.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.h b/drivers/infiniband/hw/bnxt_re/qplib_res.h index fbda11a..aaa76d7 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.h @@ -186,7 +186,9 @@ struct bnxt_qplib_chip_ctx { u8 chip_metal; }; -#define CHIP_NUM_57500 0x1750 +#define CHIP_NUM_57508 0x1750 +#define CHIP_NUM_57504 0x1751 +#define CHIP_NUM_57502 0x1752 struct bnxt_qplib_res { struct pci_dev *pdev; @@ -203,7 +205,9 @@ struct bnxt_qplib_res { static inline bool bnxt_qplib_is_chip_gen_p5(struct bnxt_qplib_chip_ctx *cctx) { - return (cctx->chip_num == CHIP_NUM_57500); + return (cctx->chip_num == CHIP_NUM_57508 || + cctx->chip_num == CHIP_NUM_57504 || + cctx->chip_num == CHIP_NUM_57502); } static inline u8 bnxt_qplib_get_hwq_type(struct bnxt_qplib_res *res) From patchwork Tue Nov 19 15:48:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11252393 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD098109A for ; Tue, 19 Nov 2019 15:49:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAB74222AB for ; Tue, 19 Nov 2019 15:49:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KBtvLe9E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbfKSPtV (ORCPT ); Tue, 19 Nov 2019 10:49:21 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:45929 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbfKSPtV (ORCPT ); Tue, 19 Nov 2019 10:49:21 -0500 Received: by mail-pf1-f194.google.com with SMTP id z4so12348368pfn.12 for ; Tue, 19 Nov 2019 07:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Dm7pwqskUQg9AAcdSj5JfWWXFSWciy198ejCCVgYVao=; b=KBtvLe9E2wXvUj4crE8gH2QAV4+XsUr1lbzPfL2d5KGj7ijQB8xZAU7uu7xjwkDzqG x/KNGB5/hUEqENYTBxZ1P27WMw2TJHur4z4v7tg9yqzd/GwvK7OS1OQjm7XDxJ6IR+IM t7kTDcJ2b7rKBkc3HSPz3b2QXJTXkfrYT8xYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Dm7pwqskUQg9AAcdSj5JfWWXFSWciy198ejCCVgYVao=; b=GneNyrt6Ww3m/S1BjGyBoKU9InFMFSGpbU7DXcL/nhvc8BAyUilifb94QB4T7iDuHY wSi1SNjIolTzolNli9lXNyP/62id3mz1Vm+obBSsGRvECo6idp42iLLDZibxYoEo0Cbm J2py5M9Z61ZcIrs5Q5TJG117QwTuMFyMg3on4Qca14JkmsMnFsKpmlBWs0lPM7f0ZqXQ BwLf87AAa4EcGr0QI/lvYpiRZrVAFXBJfFET01J+Rdm3xkRd1bC7h1+Lq5W+HL167wKt vdkwmwt3e4oqPjQMT5mWz8id776ztiiAY1HrJvNNt7SvGAjyfSoFIlcbh0WNsMU1vJe3 GLoQ== X-Gm-Message-State: APjAAAWgjMxUn/SDdk0IbhbmBfNcbTw/WbsqLLLc//bpNKPFbrs//DMR xcuPt9VLy69HAHSji3TWb6ji+g== X-Google-Smtp-Source: APXvYqx9YAYAeQpf1jd2TZx98xF/YUNwlPIptNlz0pB2vEpMktujEsaMi47UzEbtR3bwsH7BCxmL9g== X-Received: by 2002:a63:1303:: with SMTP id i3mr6344046pgl.430.1574178560222; Tue, 19 Nov 2019 07:49:20 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 10sm24263620pgs.11.2019.11.19.07.49.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 07:49:18 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Devesh Sharma Subject: [PATCH for-rc 2/3] RDMA/bnxt_re: fix stat push into dma buffer on gen p5 devices Date: Tue, 19 Nov 2019 10:48:50 -0500 Message-Id: <1574178531-15898-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574178531-15898-1-git-send-email-devesh.sharma@broadcom.com> References: <1574178531-15898-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 Making a change to fix device stat push from chip to dma buffer. The new firmware command expects dma length to be specified during stat allocation. Fixes: 2792b5b95ed5 ("bnxt_en: Update firmware interface spec. to 1.10.0.89") Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 30a54f8..2ee2cd4 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -477,6 +477,7 @@ static int bnxt_re_net_stats_ctx_alloc(struct bnxt_re_dev *rdev, bnxt_re_init_hwrm_hdr(rdev, (void *)&req, HWRM_STAT_CTX_ALLOC, -1, -1); req.update_period_ms = cpu_to_le32(1000); req.stats_dma_addr = cpu_to_le64(dma_map); + req.stats_dma_length = cpu_to_le16(sizeof(struct ctx_hw_stats_ext)); req.stat_ctx_flags = STAT_CTX_ALLOC_REQ_STAT_CTX_FLAGS_ROCE; bnxt_re_fill_fw_msg(&fw_msg, (void *)&req, sizeof(req), (void *)&resp, sizeof(resp), DFLT_HWRM_CMD_TIMEOUT); From patchwork Tue Nov 19 15:48:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11252395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B2846C1 for ; Tue, 19 Nov 2019 15:49:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BB23222AB for ; Tue, 19 Nov 2019 15:49:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="KmIdMaUI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728371AbfKSPtX (ORCPT ); Tue, 19 Nov 2019 10:49:23 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39812 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727937AbfKSPtX (ORCPT ); Tue, 19 Nov 2019 10:49:23 -0500 Received: by mail-pl1-f195.google.com with SMTP id o9so11964371plk.6 for ; Tue, 19 Nov 2019 07:49:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=R1ASv1uSb+2yAWLsBi9prViTqXk/F+FbyHZh9azDYUs=; b=KmIdMaUIOmsh/2p0FfLb2LJw2+OlcwZkj3j0hg5kPRFq7pUA+7qjK3Ifr9tGXbWb2+ lEbxqs4jGaLwemeAKUN8MtDtG0gWP3NzKsxGB5A3Swf5u4yiRBhftJYhXvmwksSgMSVN 8sSMZGdkOrqwheUaBnYGH72AVRmzmOf6DmY+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=R1ASv1uSb+2yAWLsBi9prViTqXk/F+FbyHZh9azDYUs=; b=Xb6ddHOP3qELhHoM0qAxxx33FQGNGTfNWGg/1J/R6SF7WQU8pZKD18NpC8gFck3jTN pn6OnN9dSlnqV+6pRrEJ/aEGl11Lf5Ue8kY/TKXQC0fHzosTdSukzwiyAq035e/wXTAy W3n+1EcIvEpcmNuVefZylR6i+Kxrb/MIeI/UI1RCWiDSbtOQCoR7KGo+dhQ0/x31omZC H0KcfkJ8KmAwLhAQupznQ/O7joeWZL6TAroyb+kNdNGGPbG5h+MZPUJ26m4E3eipZ06q tIvOBfF5GEp4xpmTTKfxRP0/hHanO/5P/c8SLDEjLuKzFO4H13sIEA8qIs2kMInrsZhc dPBA== X-Gm-Message-State: APjAAAUTOloMWAwfDNUQIQEVDB9SHoJa5e5NI9fn8+leZXWG0aD60GZg kp8OFS83bRllE5ijymg2yBgcXw== X-Google-Smtp-Source: APXvYqwCWgnFbtPr+WOkyXtw/lhlKpeNAJXk+LGQlqjvK15orBeEtuOLcD/iLFaWFiYSEccs8w+k0w== X-Received: by 2002:a17:902:bd96:: with SMTP id q22mr36314522pls.169.1574178562849; Tue, 19 Nov 2019 07:49:22 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id 10sm24263620pgs.11.2019.11.19.07.49.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Nov 2019 07:49:22 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Devesh Sharma Subject: [PATCH for-rc 3/3] RDMA/bnxt_re: fix sparse warnings Date: Tue, 19 Nov 2019 10:48:51 -0500 Message-Id: <1574178531-15898-4-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574178531-15898-1-git-send-email-devesh.sharma@broadcom.com> References: <1574178531-15898-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 Making a change to fix following sparse warnings CHECK drivers/infiniband/hw/bnxt_re/main.c drivers/infiniband/hw/bnxt_re/main.c:1274:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1275:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1276:18: warning: cast from restricted __le16 drivers/infiniband/hw/bnxt_re/main.c:1277:21: warning: restricted __le16 degrades to integer Fixes: 2b827ea1926b ("RDMA/bnxt_re: Query HWRM Interface version from FW") Signed-off-by: Devesh Sharma --- drivers/infiniband/hw/bnxt_re/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 2ee2cd4..27e2df4 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1271,10 +1271,10 @@ static void bnxt_re_query_hwrm_intf_version(struct bnxt_re_dev *rdev) return; } rdev->qplib_ctx.hwrm_intf_ver = - (u64)resp.hwrm_intf_major << 48 | - (u64)resp.hwrm_intf_minor << 32 | - (u64)resp.hwrm_intf_build << 16 | - resp.hwrm_intf_patch; + (u64)le16_to_cpu(resp.hwrm_intf_major) << 48 | + (u64)le16_to_cpu(resp.hwrm_intf_minor) << 32 | + (u64)le16_to_cpu(resp.hwrm_intf_build) << 16 | + le16_to_cpu(resp.hwrm_intf_patch); } static void bnxt_re_ib_unreg(struct bnxt_re_dev *rdev)