From patchwork Thu Nov 21 06:22:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11255363 X-Patchwork-Delegate: jgg@ziepe.ca 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 4B2A1913 for ; Thu, 21 Nov 2019 06:22:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B0592089D for ; Thu, 21 Nov 2019 06:22:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Diz+QT1l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbfKUGWo (ORCPT ); Thu, 21 Nov 2019 01:22:44 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54350 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfKUGWo (ORCPT ); Thu, 21 Nov 2019 01:22:44 -0500 Received: by mail-wm1-f67.google.com with SMTP id x26so2072521wmk.4 for ; Wed, 20 Nov 2019 22:22:41 -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=b1VMUXLMfFtqtg1d5fgksjrRHSmcXvmqNc/pq4Zicfc=; b=Diz+QT1lsk/30eJhnEQ2DZYIKXNKWkUp0v4Zcves4B7avjmtqHZ5bebRYKEb/NRP0d ygZk0GpovEqI/IM8FaXPbjLi9JoG/nctC9WV6UZSg6YKi2PLkoRcDV2ezHi0Dcf4KRET yowO+vDh4cjPDQ4MNkka8EL4iDsXWBXA4ms+s= 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=b1VMUXLMfFtqtg1d5fgksjrRHSmcXvmqNc/pq4Zicfc=; b=Y5KRRIO32QIluR2nRRvAZjJKmzEVUXn66oyurWD3F8tcP7PGKCz6zplhFpLBcEnL07 Iyp5QmlTnyGFQbB1Lni+VPzOol83JcjKR+RDtA4eu5cX7Z6qMVGsKnrypWVapYWEi+ER /ebDOBZMnkUaIOqQ5iuBmLRn06pO/s8HaKUdHgiYpmxFciy0pQn844qv4/KpTc+CelA4 HDhfETUk/Fw1+H7XsjAt7CNR6VrCyzZ+rqSds3xkoeUqTFO8XR/Y7WllM7f2gT+LerhN 0MdLk/fMM1WZVKFsyesgc5NiB13/E0UPj86CEUgU8hqnVUNFbSDsm80BNUO4skMiQzVk nA3A== X-Gm-Message-State: APjAAAUjnGgwNRlsj67udJ8tyHdjCYAuIp5WY0oRGf72M6jlgFVpQRqv 5C+AIByRRHon5bDye91zByRSmw== X-Google-Smtp-Source: APXvYqxyaj+zQFlG7v+PKoF6c0Dj2K45S3KJ1+eX+4WJbY9lgvJbsujclncVOjfCi3GoPvrnncOS9A== X-Received: by 2002:a1c:2395:: with SMTP id j143mr7607671wmj.128.1574317360700; Wed, 20 Nov 2019 22:22:40 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y11sm76377wrq.12.2019.11.20.22.22.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2019 22:22:40 -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 V3 for-next 1/3] RDMA/bnxt_re: Fix chip number validation Broadcom's Gen P5 series Date: Thu, 21 Nov 2019 01:22:21 -0500 Message-Id: <1574317343-23300-2-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574317343-23300-1-git-send-email-devesh.sharma@broadcom.com> References: <1574317343-23300-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. Due to this missing fix the end customer are not able to use adaptors based on latest chip rev of Broadcom's Gen P5 adaptors. 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 Thu Nov 21 06:22:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11255365 X-Patchwork-Delegate: jgg@ziepe.ca 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 7B30E6C1 for ; Thu, 21 Nov 2019 06:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A0FA2089D for ; Thu, 21 Nov 2019 06:22:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="HlCPvHdQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725842AbfKUGWp (ORCPT ); Thu, 21 Nov 2019 01:22:45 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54123 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfKUGWp (ORCPT ); Thu, 21 Nov 2019 01:22:45 -0500 Received: by mail-wm1-f67.google.com with SMTP id u18so2367244wmc.3 for ; Wed, 20 Nov 2019 22:22:44 -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=zS+4DfAFhREpqSUQWMZ6TYr3xge9UYBqHXLfZYf66uo=; b=HlCPvHdQDe61MLQBz/qeZtx3ky0iWThUotVyTHRTFZSs11pqZLjMJI/u6MAje8KTUY kzAOntBVMG62G8+xSDOtVrLoxf5GK5nJ+JxybOXLVpxqKR+Ysek22P0Z2uYHr1YTm7qc BdwRVwDcMVezcgMmmonXiyFY6+DK9vRbx8Vn4= 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=zS+4DfAFhREpqSUQWMZ6TYr3xge9UYBqHXLfZYf66uo=; b=RuzpjVFeDYjmGioMWvRgdcHnxpEhdTuxG2lRYnKGSDWPL/nESElWra6Gu397+AETP3 UmbvMlOdXOlBpULjFX7sB097qcMWDRva17ZUaG8gZpl0kYQw8h/IAh5zI5WDYkXwlQ2A pkvOkQTR8PWcmDcj5kn/O8EjlPedZMLmWspQceFylOVJ2PZ33ZvIeaqkHpK2RFuBfwUD nVlbO5oF/2gDZJzEwt7I5pksxrmgs41dIDI7tD1xy1uY84Ds7JlGWSmVT7F03YXhGNDj vbeYHxV0RUqHUBce+vdK6j/wVZytrYXG0KBNVljWI8EpU2qjsRvSfLR39zCpv+3KfZay sQgQ== X-Gm-Message-State: APjAAAUsde+C6A9nWTvqe2mHeP2haRRC1HkvHFI7a8uRtwsxX6QkZf20 nH2QXOScjrmMS/qBY61+ndcxwg== X-Google-Smtp-Source: APXvYqyR2rn1m7yv/Teo7ZyAgSyXTaG6yPKfWu6d4ksx+/dLHk7dRQhem0SYrQAZ++/SanpjoP4PpA== X-Received: by 2002:a1c:1d10:: with SMTP id d16mr8109869wmd.14.1574317363437; Wed, 20 Nov 2019 22:22:43 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y11sm76377wrq.12.2019.11.20.22.22.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2019 22:22:42 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Devesh Sharma Subject: [PATCH V3 for-next 2/3] RDMA/bnxt_re: fix stat push into dma buffer on gen p5 devices Date: Thu, 21 Nov 2019 01:22:22 -0500 Message-Id: <1574317343-23300-3-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574317343-23300-1-git-send-email-devesh.sharma@broadcom.com> References: <1574317343-23300-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 Due to recent advances in the firmware for Broadcom's gen p5 series of adaptors the driver code to report hardware counters has been broken w.r.t. roce devices. Making a change to match the expectaion of newer firmware version when stat dma buffer is created. The new firmware command expects dma length to be specified during stat dma buffer 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 d6785b8..a2ac88e 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -494,6 +494,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 Thu Nov 21 06:22:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 11255367 X-Patchwork-Delegate: jgg@ziepe.ca 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 048FC6C1 for ; Thu, 21 Nov 2019 06:22:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D9A132089D for ; Thu, 21 Nov 2019 06:22:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="UOUA0AIA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbfKUGWs (ORCPT ); Thu, 21 Nov 2019 01:22:48 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46959 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfKUGWs (ORCPT ); Thu, 21 Nov 2019 01:22:48 -0500 Received: by mail-wr1-f68.google.com with SMTP id b3so2826627wrs.13 for ; Wed, 20 Nov 2019 22:22:46 -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=MM1ksQi3xrzRFKnnFVS1AWIpvA6hQ0ZeeyO3yxC1wLc=; b=UOUA0AIA/n2Hxfy7spmwLgTeRZ0aNXcmra03o6oY3ECsiGh7bSI6E7MxAQqGLp3xfh R/gtLjIKw73DERvfnz4fmHk6B5FBqg98EtPPxspd84ghxBqF9hXkibjne10obueTQDsW ZSsIKXdwvkshSNuRlNgl1IYA/nNOyjynG8bMI= 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=MM1ksQi3xrzRFKnnFVS1AWIpvA6hQ0ZeeyO3yxC1wLc=; b=p/qb1bq8pHTCtNirJ0XTHpP/pklsIQEJnriJZUr/RdfJifWqzA+1sEmOde2XE92AvR 44v4MDbx+e3I5AYx65MiYeF5ZsgMrmoi+ONVlLiKJIZwHMdrBYiWTCjxcxFzxjv1/XN+ HmYySNXAYYJwpVioEYEzXA26OvhOIKCBR6pJ5HeQ7+i88UVZFYEkuKR65EbQg/goei1u empw+MvidOMsEmsCJc6m2eu50RMmjaxmGqRbFm931g1Y2gyKS0Qa7nAJZzisK1sInlIf 7TQb/SriZFjq4AOD6x50XtBNuHXa1Lx+IqH6rE4e4qSGox+pWT0E7jO05wXLP5+pp3vr w+lQ== X-Gm-Message-State: APjAAAWYprsALnD/aUVJfO2s7T4DCktlj7L9HGBq2ojLaKojZlc9gUcB qduzukC2n4LguUNeUyQewrUihA== X-Google-Smtp-Source: APXvYqwnZ03xgMqF+6DCAB32y4NQdsJyJctUXN6lu3FZFS7PYeJLc7QcaEd6dTE2AOWv4+gOdYnUgQ== X-Received: by 2002:adf:ffd0:: with SMTP id x16mr8024197wrs.86.1574317366126; Wed, 20 Nov 2019 22:22:46 -0800 (PST) Received: from neo00-el73.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id y11sm76377wrq.12.2019.11.20.22.22.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2019 22:22:45 -0800 (PST) From: Devesh Sharma To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, Devesh Sharma Subject: [PATCH V3 for-next 3/3] RDMA/bnxt_re: fix sparse warnings Date: Thu, 21 Nov 2019 01:22:23 -0500 Message-Id: <1574317343-23300-4-git-send-email-devesh.sharma@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1574317343-23300-1-git-send-email-devesh.sharma@broadcom.com> References: <1574317343-23300-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 a2ac88e..e7e8a0f 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1291,10 +1291,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)