From patchwork Thu Mar 26 12:03:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasundhara Volam X-Patchwork-Id: 221800 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=-8.2 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, URIBL_BLACK, URIBL_BLOCKED, 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 31AEDC43331 for ; Thu, 26 Mar 2020 12:05:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07E8620714 for ; Thu, 26 Mar 2020 12:05:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="OBNRNRK2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728245AbgCZMFR (ORCPT ); Thu, 26 Mar 2020 08:05:17 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:38381 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728001AbgCZMFR (ORCPT ); Thu, 26 Mar 2020 08:05:17 -0400 Received: by mail-wm1-f65.google.com with SMTP id f6so109438wmj.3 for ; Thu, 26 Mar 2020 05:05:15 -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=VqeDlpwv1p4TqztAbL3WzSCThKYMNm+IpDoCwea6pPo=; b=OBNRNRK25AtAI/hbq6vYdTW/KhmrN3wVWpGVmo9J0vh7oZW3cmA10G7c5SaGxHTKuP h7lzhv2yet+zlFu6268AMqIxNkD3Dvm8lqOxfbl9w/oi24nXC6rfuCzELf0/MA7axMnU CqDAWdYRISnzK37VMbPdSa/aV/ppQaBaoIqcI= 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=VqeDlpwv1p4TqztAbL3WzSCThKYMNm+IpDoCwea6pPo=; b=QReVHlL5ds5pNmOJXao7RWxSAi0tEuLdBkyUXFxbEpg1eto7xZPS2VuNUzePUqdWbq Kaxf7QcwMRAVCXdxvN/YC0dh268ddVKFyNXyc7NbitN0zPXQtoPdzQO0e2ROkaMTrQv6 jdSfG7iIF1dnylTnmqJgXAKvPsUXNSmnH68ebIDi6DyKI+su0/ZhuQ5pxmVA5yzP2hWt 4ffW/9ljUQHygnP8fcNAPtwnaPWqgokdro/bJCYFV6He0LtAGaOVvEvi4diepj1FHno7 Hu3HJNlIZB6JKeou3XGjah4P7eom9CNGV2ZQEW8FuXq0wrNdf/T7d1/O7mvATOW8BIwC OTvg== X-Gm-Message-State: ANhLgQ0/X2nBAZ0zO1/6TCC1p0c2XU4+viTjDECDa80iWSWuIzPfqp0v VsFYm1+SeutwJDGHXDte+pQDTuyLvgU= X-Google-Smtp-Source: ADFU+vthDvMokaZnM3M5WswRU9VnLU4oOSpJ0/z8F7zkPYTCcWFBvocZK4QajApx0sZ/Z3VpKuoUNQ== X-Received: by 2002:a1c:41d6:: with SMTP id o205mr2776225wma.122.1585224314836; Thu, 26 Mar 2020 05:05:14 -0700 (PDT) Received: from lxpurley1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id t2sm3108969wml.30.2020.03.26.05.05.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Mar 2020 05:05:14 -0700 (PDT) From: Vasundhara Volam To: davem@davemloft.net Cc: netdev@vger.kernel.org, Vasundhara Volam , Jakub Kicinski , Michael Chan Subject: [PATCH v3 net-next 5/5] bnxt_en: Add partno to devlink info_get cb Date: Thu, 26 Mar 2020 17:33:25 +0530 Message-Id: <1585224205-11966-2-git-send-email-vasundhara-v.volam@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1585224205-11966-1-git-send-email-vasundhara-v.volam@broadcom.com> References: <1585224205-11966-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: 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 71f5a5a..ee8d0f4 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 51abc6c..b0e37ae 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);