From patchwork Thu Mar 26 06:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasundhara Volam X-Patchwork-Id: 221825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B943EC43331 for ; Thu, 26 Mar 2020 06:30:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E1792078E for ; Thu, 26 Mar 2020 06:30:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="QUz3aUqz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbgCZGa4 (ORCPT ); Thu, 26 Mar 2020 02:30:56 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:50606 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726210AbgCZGa4 (ORCPT ); Thu, 26 Mar 2020 02:30:56 -0400 Received: by mail-wm1-f66.google.com with SMTP id d198so5277230wmd.0 for ; Wed, 25 Mar 2020 23:30:54 -0700 (PDT) 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=vCywXrPM+RXAEKueJsXEcStE/qK7ypaCxILLHInXhdU=; b=QUz3aUqz1Rv8+NdlBs9WDYP0acjj85eQr33P0bHZF14w0L/OXQqD4J8hnK1uHOLkiB LVFsLgipEmJC5TfRBgIX9y0IA9vncYGdT+AXn2p2qjoFkGtpCNv9tkILnDCmjIhzNijT rnhO+AKCTr4+fAHqtInDJ5mTXf3L6NYPbDJuY= 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=vCywXrPM+RXAEKueJsXEcStE/qK7ypaCxILLHInXhdU=; b=rNlkoEQAlGZcrkqiVkawtT2nJsqdi3vWO3JSKr7vUOv/pRaOfZ/whoKCMCyw5kVsU7 IKmfaDbiocfqUKemKfi+pMbPeKGLhv2zsZ2+xbLLzgJmomhufyemhGc15i9bMlxArdgK ruLf7DV4Dohbmc14yOapGJWwaokEU8KAuwoqPk+xU/u3dZaFRuhfKMFsGxDwKZK8k4cq l2rGnFwNcJzFoDgGVWaLLQaubM3aC4gZw9c81Ru5paPA0l1HEgBzvvEF7j6MKbhE2JV1 Uj8TGPBzakEVZmlU5UohU0D/Hai9EMBSV47URPnNFck4mAsWVINyiAiFrLQlWDgA2gGK 5zoQ== X-Gm-Message-State: ANhLgQ1cBbHLV3i8aRqBbAD4MtKZXLEtklABdVInlkCOOy/uXdPxHXA8 YZ5AfvkhgkVKgB3TTEhst+okRg== X-Google-Smtp-Source: ADFU+vuETKn9nsol7DcUSPTtagosAIWGAA8HDjSfIpHJEldZvnNEa36ExuvBxz+dm4ehlO2tJ+BJnA== X-Received: by 2002:a7b:c5cd:: with SMTP id n13mr1380001wmk.125.1585204254056; Wed, 25 Mar 2020 23:30:54 -0700 (PDT) Received: from lxpurley1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id o9sm2155583wrw.20.2020.03.25.23.30.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Mar 2020 23:30:53 -0700 (PDT) From: Vasundhara Volam To: davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam , Jakub Kicinski , Michael Chan Subject: [PATCH v2 net-next 7/7] bnxt_en: Add partno to devlink info_get cb Date: Thu, 26 Mar 2020 11:59:03 +0530 Message-Id: <1585204143-10417-2-git-send-email-vasundhara-v.volam@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585204143-10417-1-git-send-email-vasundhara-v.volam@broadcom.com> References: <1585204143-10417-1-git-send-email-vasundhara-v.volam@broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add part number info from the vital product data to info_get command via devlink tool. Update bnxt.rst documentation as well. Example display: $ devlink dev info pci/0000:3b:00.1 pci/0000:3b:00.1: driver bnxt_en serial_number B0-26-28-FF-FE-C8-85-20 versions: fixed: board.id BCM957508-P2100G asic.id 1750 asic.rev 1 running: hw.addr b0:26:28:c8:85:21 fw 216.0.286.0 fw.api 1.10.1 fw.psid 0.0.6 fw.app 216.0.251.0 Cc: Jakub Kicinski Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan --- v1->v2: Remove serial number information. --- Documentation/networking/devlink/bnxt.rst | 3 +++ drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/networking/devlink/bnxt.rst b/Documentation/networking/devlink/bnxt.rst index a514664..1f28e2f 100644 --- a/Documentation/networking/devlink/bnxt.rst +++ b/Documentation/networking/devlink/bnxt.rst @@ -51,6 +51,9 @@ The ``bnxt_en`` driver reports the following versions * - Name - Type - Description + * - ``board.id`` + - fixed + - Part number identifying the board design * - ``asic.id`` - fixed - ASIC design identifier diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c index 493a9eb..e1061c4 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -403,6 +403,14 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, if (rc) return rc; + if (strlen(bp->board_partno)) { + rc = devlink_info_version_fixed_put(req, + DEVLINK_INFO_VERSION_GENERIC_BOARD_ID, + bp->board_partno); + if (rc) + return rc; + } + sprintf(buf, "%X", bp->chip_num); rc = devlink_info_version_fixed_put(req, DEVLINK_INFO_VERSION_GENERIC_ASIC_ID, buf);