net/octeontx2: add FW version get operation
authorVamsi Attunuru <vattunuru@marvell.com>
Sat, 1 Jun 2019 18:47:13 +0000 (00:17 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 4 Jul 2019 23:52:02 +0000 (01:52 +0200)
Add firmware version get operation.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
doc/guides/nics/features/octeontx2.ini
doc/guides/nics/features/octeontx2_vec.ini
doc/guides/nics/features/octeontx2_vf.ini
drivers/net/octeontx2/otx2_ethdev.c
drivers/net/octeontx2/otx2_ethdev.h
drivers/net/octeontx2/otx2_ethdev_ops.c
drivers/net/octeontx2/otx2_flow.c

index 37b8029..211ff93 100644 (file)
@@ -33,6 +33,7 @@ Rx descriptor status = Y
 Basic stats          = Y
 Stats per queue      = Y
 Extended stats       = Y
 Basic stats          = Y
 Stats per queue      = Y
 Extended stats       = Y
+FW version           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
index ccedd13..967a375 100644 (file)
@@ -31,6 +31,7 @@ Rx descriptor status = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
+FW version           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
index 24df147..884167c 100644 (file)
@@ -26,6 +26,7 @@ Rx descriptor status = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
 Basic stats          = Y
 Extended stats       = Y
 Stats per queue      = Y
+FW version           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
 Module EEPROM dump   = Y
 Registers dump       = Y
 Linux VFIO           = Y
index 0b0e345..a2a3d14 100644 (file)
@@ -1355,6 +1355,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,
        .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,
        .flow_ctrl_get            = otx2_nix_flow_ctrl_get,
        .flow_ctrl_set            = otx2_nix_flow_ctrl_set,
        .timesync_enable          = otx2_nix_timesync_enable,
index 12db922..e184839 100644 (file)
@@ -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 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;
        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_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,
 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,
index 690d8ac..6a30483 100644 (file)
@@ -210,6 +210,25 @@ otx2_nix_tx_done_cleanup(void *txq, uint32_t free_cnt)
        return 0;
 }
 
        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)
 {
 int
 otx2_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool)
 {
index 94bd851..3ddecfb 100644 (file)
@@ -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;
        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;
 
        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));
        }
 
                       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:
        flow_process_mkex_cfg(npc, &idev->kex_cfg);
 
 done: