From patchwork Sat Jun 20 16:31:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasundhara Volam X-Patchwork-Id: 217465 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 C086EC433DF for ; Sat, 20 Jun 2020 16:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 938B123380 for ; Sat, 20 Jun 2020 16:34:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="GcioExfO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728113AbgFTQef (ORCPT ); Sat, 20 Jun 2020 12:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbgFTQef (ORCPT ); Sat, 20 Jun 2020 12:34:35 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040ABC06174E for ; Sat, 20 Jun 2020 09:34:35 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id b6so12513173wrs.11 for ; Sat, 20 Jun 2020 09:34:34 -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=HnfTIYVZ5wB9NzJ0He1gW/q1BGjjos8MabSfnh8sooI=; b=GcioExfOe0cVPsVyN5HU71bI0bR5bt2+3aiyIqeondmOv9TKbOKeHuDX0AlI5RsLsc PJfK6Pgwej0WWDlntpd9T/8qwr5EnonXwNs/PfnMqtVaMf85NMAq1TtzqK9jVPbh+6xN WlFzKgz5X+6z7ySOEjodvGtL4DJgBk+tDUf2Y= 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=HnfTIYVZ5wB9NzJ0He1gW/q1BGjjos8MabSfnh8sooI=; b=DssFmGSrRY7gdqAu5etKSRyG2LTX0RRzpQJzknyrgAXGuDZOk1ivyOlGReVjEiWOJV AWlm9geryDJiLcLH5B/rrjIvAd9XGmioCAbFPwM8b+mqOSUTdyUFaozZDl1aW3yHmtXV EoNNBljbt4wgNeAW31TnjiM3tqYyEeoAYn8ljI8BJQjC1bPltfGFPepb99zsGTuiKKPJ 4q3HRxZCsonWWmcBMbEerp8gyIrriZeApO2UYZ7e/jdnE+9gLbhwIzfwXfN1yrwcPpcc h0o4l8B7fDeeakT6yMQZuP7hdo/6+/RIMarXZyrBZgw47XefSKhEhuAw0GScRQEdfUrf 5cRQ== X-Gm-Message-State: AOAM533QjH2S7rxVvzidSFRZDtpzaAxLV27egEhJLhG+biebip8d67Gc 8+hkQbk4ofbr/cJ97NE2ZpECXA== X-Google-Smtp-Source: ABdhPJxiPBv2HTegp9FOj8XL4y5YpoS1mDJFfC7Tf8/ELKuJdmOHcwdFSTgaTgfgBS0u7rYsgtPFxw== X-Received: by 2002:a5d:40ca:: with SMTP id b10mr1958265wrq.56.1592670873602; Sat, 20 Jun 2020 09:34:33 -0700 (PDT) Received: from lxpurley1.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id c6sm10825974wma.15.2020.06.20.09.34.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Jun 2020 09:34:33 -0700 (PDT) From: Vasundhara Volam To: davem@davemloft.net Cc: netdev@vger.kernel.org, michael.chan@broadcom.com, kuba@kernel.org, jiri@mellanox.com, jacob.e.keller@intel.com, Vasundhara Volam Subject: [PATCH v2 net-next 2/2] bnxt_en: Add board.serial_number field to info_get cb Date: Sat, 20 Jun 2020 22:01:57 +0530 Message-Id: <1592670717-28851-3-git-send-email-vasundhara-v.volam@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1592670717-28851-1-git-send-email-vasundhara-v.volam@broadcom.com> References: <1592670717-28851-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 board.serial_number field info to info_get cb via devlink, if driver can fetch the information from the device. Cc: Jiri Pirko Cc: Jakub Kicinski Signed-off-by: Vasundhara Volam Reviewed-by: Michael Chan --- v2: Combine 2 lines as column limit is increased to 100 now. --- drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c index a812beb..2bd610f 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c @@ -411,6 +411,12 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, return rc; } + if (strlen(bp->board_serialno)) { + rc = devlink_info_board_serial_number_put(req, bp->board_serialno); + if (rc) + return rc; + } + sprintf(buf, "%X", bp->chip_num); rc = devlink_info_version_fixed_put(req, DEVLINK_INFO_VERSION_GENERIC_ASIC_ID, buf);