From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 39D89A00BE; Fri, 12 Jun 2020 15:36:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B7EC41BF60; Fri, 12 Jun 2020 15:34:16 +0200 (CEST) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.232.149]) by dpdk.org (Postfix) with ESMTP id 077CF1BF31 for ; Fri, 12 Jun 2020 15:34:14 +0200 (CEST) Received: from dhcp-10-123-153-55.dhcp.broadcom.net (dhcp-10-123-153-55.dhcp.broadcom.net [10.123.153.55]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 9C2991BD788; Fri, 12 Jun 2020 06:34:12 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 9C2991BD788 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1591968853; bh=NhgXOF+ekPYUllLx9sSmDV+kNk9Gu/nKtH/dVNUwCQc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aDLHom/izjCvEw7ydwtPuc6Qo2C4JpRXztu7GlyedzUOV6yJPpFfR8nNP4cbZVLio 7OutaUk+xaKiWjHdViE5cindFFuw/0Ohz9n1pRXd+HD1KwApFecSsGEPbiG5Zuo7yC LCL/m50ZFcprEmSnNFDeJQ2l2Jf5WycO0x3WanO4= From: Somnath Kotur To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 12 Jun 2020 18:58:51 +0530 Message-Id: <20200612132934.16488-8-somnath.kotur@broadcom.com> X-Mailer: git-send-email 2.10.1.613.g2cc2e70 In-Reply-To: <20200612132934.16488-1-somnath.kotur@broadcom.com> References: <20200612132934.16488-1-somnath.kotur@broadcom.com> Subject: [dpdk-dev] [PATCH 07/50] net/bnxt: add support for bnxt_hwrm_port_phy_qcaps X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Venkat Duvvuru Issue HWRM_PORT_PHY_QCAPS to the firmware to get the physical port count of the device. Signed-off-by: Venkat Duvvuru Reviewed-by: Somnath Kotur Reviewed-by: Kalesh Anakkur Purayil Reviewed-by: Kishore Padmanabha Signed-off-by: Somnath Kotur --- drivers/net/bnxt/bnxt.h | 1 + drivers/net/bnxt/bnxt_ethdev.c | 2 ++ drivers/net/bnxt/bnxt_hwrm.c | 22 ++++++++++++++++++++++ drivers/net/bnxt/bnxt_hwrm.h | 1 + 4 files changed, 26 insertions(+) diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index 0bdf8f5..65862ab 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -747,6 +747,7 @@ struct bnxt { uint32_t outer_tpid_bd; struct bnxt_pf_info *pf; struct bnxt_parent_info *parent; + uint8_t port_cnt; uint8_t vxlan_port_cnt; uint8_t geneve_port_cnt; uint16_t vxlan_port; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index af88b36..697cd66 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5287,6 +5287,8 @@ static int bnxt_init_fw(struct bnxt *bp) bnxt_hwrm_parent_pf_qcfg(bp); + bnxt_hwrm_port_phy_qcaps(bp); + rc = bnxt_hwrm_cfa_adv_flow_mgmt_qcaps(bp); if (rc) return rc; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 347e1c7..e6a28d0 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1330,6 +1330,28 @@ static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, return rc; } +int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp) +{ + int rc = 0; + struct hwrm_port_phy_qcaps_input req = {0}; + struct hwrm_port_phy_qcaps_output *resp = bp->hwrm_cmd_resp_addr; + + if (BNXT_VF(bp) && !BNXT_VF_IS_TRUSTED(bp)) + return 0; + + HWRM_PREP(&req, HWRM_PORT_PHY_QCAPS, BNXT_USE_CHIMP_MB); + + rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB); + + HWRM_CHECK_RESULT(); + + bp->port_cnt = resp->port_cnt; + + HWRM_UNLOCK(); + + return 0; +} + static bool bnxt_find_lossy_profile(struct bnxt *bp) { int i = 0; diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index ef89975..87cd407 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -275,4 +275,5 @@ int bnxt_hwrm_get_dflt_vnic_id(struct bnxt *bp, uint16_t fid, int bnxt_hwrm_get_dflt_vnic_svif(struct bnxt *bp, uint16_t fid, uint16_t *vnic_id, uint16_t *svif); int bnxt_hwrm_parent_pf_qcfg(struct bnxt *bp); +int bnxt_hwrm_port_phy_qcaps(struct bnxt *bp); #endif -- 2.7.4