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 024C7A0487 for ; Sun, 30 Jun 2019 20:13:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 51F5B1BA68; Sun, 30 Jun 2019 20:10:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8EECC1BB46 for ; Sun, 30 Jun 2019 20:08:57 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5UI5FMh027215; Sun, 30 Jun 2019 11:08:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=qsjJFi4yxwNjYZfJkNEQ21fUR/LGlV6qgIgp22JSQsU=; b=PFKX2A1/3FfNxzZ5l+XzxacppSbByyBpbVljawHZLcknO1IvocFDXr9jMRchZoxPOqga SjZq5rZ4jNDpqBiJ+0CC/heaNNCQJ8xw9tre0sg3qWlaTWa/mCkINMyhwSVv6cF6/xyX 8IzuwKAjpaTqS2apTOSEcSjbBvvNEwQpNIFMIl+PxFNCd7Y88qNnLh4eQUjxE4MenAU1 Iie4YPtvfHLqGHOBfBmDXk3RJuZixtM08hE67OV8O6xV5ZnOVIn/CGWDALHVgkG2IVgg n7E3pWFh72khYcO82JM23s5MeqnnpCSfsAQidHre/hmO5FeDMsNgOaxmiZW3vr9d9xDB Yw== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2te5bn4gnq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 30 Jun 2019 11:08:56 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 30 Jun 2019 11:08:55 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 30 Jun 2019 11:08:55 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 8FE533F703F; Sun, 30 Jun 2019 11:08:53 -0700 (PDT) From: To: , John McNamara , Marko Kovacevic , Jerin Jacob , "Nithin Dabilpuram" , Kiran Kumar K CC: Vamsi Attunuru Date: Sun, 30 Jun 2019 23:35:59 +0530 Message-ID: <20190630180609.36705-48-jerinj@marvell.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630180609.36705-1-jerinj@marvell.com> References: <20190602152434.23996-1-jerinj@marvell.com> <20190630180609.36705-1-jerinj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-30_08:, , signatures=0 Subject: [dpdk-dev] [PATCH v2 47/57] net/octeontx2: add FW version get operation 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: Vamsi Attunuru Add firmware version get operation. Signed-off-by: Vamsi Attunuru --- doc/guides/nics/features/octeontx2.ini | 1 + doc/guides/nics/features/octeontx2_vec.ini | 1 + doc/guides/nics/features/octeontx2_vf.ini | 1 + drivers/net/octeontx2/otx2_ethdev.c | 1 + drivers/net/octeontx2/otx2_ethdev.h | 3 +++ drivers/net/octeontx2/otx2_ethdev_ops.c | 19 +++++++++++++++++++ drivers/net/octeontx2/otx2_flow.c | 7 +++++++ 7 files changed, 33 insertions(+) diff --git a/doc/guides/nics/features/octeontx2.ini b/doc/guides/nics/features/octeontx2.ini index 37b802999..211ff93e7 100644 --- a/doc/guides/nics/features/octeontx2.ini +++ b/doc/guides/nics/features/octeontx2.ini @@ -33,6 +33,7 @@ Rx descriptor status = Y Basic stats = Y Stats per queue = Y Extended stats = Y +FW version = Y Module EEPROM dump = Y Registers dump = Y Linux VFIO = Y diff --git a/doc/guides/nics/features/octeontx2_vec.ini b/doc/guides/nics/features/octeontx2_vec.ini index ccedd1359..967a3757d 100644 --- a/doc/guides/nics/features/octeontx2_vec.ini +++ b/doc/guides/nics/features/octeontx2_vec.ini @@ -31,6 +31,7 @@ Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y +FW version = Y Module EEPROM dump = Y Registers dump = Y Linux VFIO = Y diff --git a/doc/guides/nics/features/octeontx2_vf.ini b/doc/guides/nics/features/octeontx2_vf.ini index 24df14717..884167c88 100644 --- a/doc/guides/nics/features/octeontx2_vf.ini +++ b/doc/guides/nics/features/octeontx2_vf.ini @@ -26,6 +26,7 @@ Rx descriptor status = Y Basic stats = Y Extended stats = Y Stats per queue = Y +FW version = Y Module EEPROM dump = Y Registers dump = Y Linux VFIO = Y diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c index ad305dcd8..15f46a9bf 100644 --- a/drivers/net/octeontx2/otx2_ethdev.c +++ b/drivers/net/octeontx2/otx2_ethdev.c @@ -1336,6 +1336,7 @@ static const struct eth_dev_ops otx2_eth_dev_ops = { .filter_ctrl = otx2_nix_dev_filter_ctrl, .get_module_info = otx2_nix_get_module_info, .get_module_eeprom = otx2_nix_get_module_eeprom, + .fw_version_get = otx2_nix_fw_version_get, .flow_ctrl_get = otx2_nix_flow_ctrl_get, .flow_ctrl_set = otx2_nix_flow_ctrl_set, .timesync_enable = otx2_nix_timesync_enable, diff --git a/drivers/net/octeontx2/otx2_ethdev.h b/drivers/net/octeontx2/otx2_ethdev.h index 12db92257..e18483969 100644 --- a/drivers/net/octeontx2/otx2_ethdev.h +++ b/drivers/net/octeontx2/otx2_ethdev.h @@ -235,6 +235,7 @@ struct otx2_eth_dev { uint8_t lso_tsov4_idx; uint8_t lso_tsov6_idx; uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; + uint8_t mkex_pfl_name[MKEX_NAME_LEN]; uint8_t max_mac_entries; uint8_t lf_tx_stats; uint8_t lf_rx_stats; @@ -340,6 +341,8 @@ void otx2_nix_info_get(struct rte_eth_dev *eth_dev, int otx2_nix_dev_filter_ctrl(struct rte_eth_dev *eth_dev, enum rte_filter_type filter_type, enum rte_filter_op filter_op, void *arg); +int otx2_nix_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version, + size_t fw_size); int otx2_nix_get_module_info(struct rte_eth_dev *eth_dev, struct rte_eth_dev_module_info *modinfo); int otx2_nix_get_module_eeprom(struct rte_eth_dev *eth_dev, diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c b/drivers/net/octeontx2/otx2_ethdev_ops.c index 690d8ac0c..6a3048336 100644 --- a/drivers/net/octeontx2/otx2_ethdev_ops.c +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c @@ -210,6 +210,25 @@ otx2_nix_tx_done_cleanup(void *txq, uint32_t free_cnt) return 0; } +int +otx2_nix_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version, + size_t fw_size) +{ + struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); + int rc = (int)fw_size; + + if (fw_size > sizeof(dev->mkex_pfl_name)) + rc = sizeof(dev->mkex_pfl_name); + + rc = strlcpy(fw_version, (char *)dev->mkex_pfl_name, rc); + + rc += 1; /* Add the size of '\0' */ + if (fw_size < (uint32_t)rc) + return rc; + + return 0; +} + int otx2_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool) { diff --git a/drivers/net/octeontx2/otx2_flow.c b/drivers/net/octeontx2/otx2_flow.c index 94bd85161..3ddecfb23 100644 --- a/drivers/net/octeontx2/otx2_flow.c +++ b/drivers/net/octeontx2/otx2_flow.c @@ -770,6 +770,7 @@ flow_fetch_kex_cfg(struct otx2_eth_dev *dev) struct otx2_npc_flow_info *npc = &dev->npc_flow; struct npc_get_kex_cfg_rsp *kex_rsp; struct otx2_mbox *mbox = dev->mbox; + char mkex_pfl_name[MKEX_NAME_LEN]; struct otx2_idev_kex_cfg *idev; int rc = 0; @@ -791,6 +792,12 @@ flow_fetch_kex_cfg(struct otx2_eth_dev *dev) sizeof(struct npc_get_kex_cfg_rsp)); } + otx2_mbox_memcpy(mkex_pfl_name, + idev->kex_cfg.mkex_pfl_name, MKEX_NAME_LEN); + + strlcpy((char *)dev->mkex_pfl_name, + mkex_pfl_name, sizeof(dev->mkex_pfl_name)); + flow_process_mkex_cfg(npc, &idev->kex_cfg); done: -- 2.21.0