[33/33] net/cnxk: add PMD API to retrieve the model string
Checks
Commit Message
From: Srujana Challa <schalla@marvell.com>
This patch adds PMD API to retrieve the model string. This API
allows applications to get the HW model string directly.
Signed-off-by: Srujana Challa <schalla@marvell.com>
---
drivers/net/cnxk/cnxk_ethdev.c | 7 +++++++
drivers/net/cnxk/rte_pmd_cnxk.h | 9 +++++++++
drivers/net/cnxk/version.map | 1 +
3 files changed, 17 insertions(+)
@@ -4,11 +4,18 @@
#include <cnxk_ethdev.h>
#include <rte_eventdev.h>
+#include <rte_pmd_cnxk.h>
#define CNXK_NIX_CQ_INL_CLAMP_MAX (64UL * 1024UL)
#define NIX_TM_DFLT_RR_WT 71
+const char *
+rte_pmd_cnxk_model_str_get(void)
+{
+ return roc_model->name;
+}
+
static inline uint64_t
nix_get_rx_offload_capa(struct cnxk_eth_dev *dev)
{
@@ -680,4 +680,13 @@ int rte_pmd_cnxk_cpt_q_stats_get(uint16_t portid, enum rte_pmd_cnxk_cpt_q_stats_
*/
__rte_experimental
void rte_pmd_cnxk_hw_inline_inb_cfg_set(uint16_t portid, struct rte_pmd_cnxk_ipsec_inb_cfg *cfg);
+
+/**
+ * Retrieves model name on which it is running as a string.
+ *
+ * @return
+ * Returns model string, ex."cn10ka_a1"
+ */
+__rte_experimental
+const char *rte_pmd_cnxk_model_str_get(void);
#endif /* _PMD_CNXK_H_ */
@@ -16,6 +16,7 @@ EXPERIMENTAL {
rte_pmd_cnxk_inl_dev_qptr_get;
rte_pmd_cnxk_inl_dev_submit;
rte_pmd_cnxk_inl_ipsec_res;
+ rte_pmd_cnxk_model_str_get;
rte_pmd_cnxk_sa_flush;
};