Skip to contentSkip to conversation

raw/cnxk_bphy: extend pffunc address access

PATCH Applied [email protected] 3 participants 3 messages Oct 14, 2022 – Oct 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw/cnxk_bphy: extend pffunc address access

From: Jakub Palider <[email protected]>

Allows retrieval of SSO and NPA pffunc addresses without device ownership and initialization.

---
 drivers/raw/cnxk_bphy/cnxk_bphy.c    | 16 ++++++++++++++++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 23 +++++++++++++++++++++++
 2 files changed, 39 insertions(+)
drivers/raw/cnxk_bphy/cnxk_bphy.c +16 -0
index 349d551839..62d138110a 100644
@@ -41,6 +41,22 @@ bphy_test_handler_fn(int irq_num, void *isr_data)
 	test[irq_num].handled_data = *((int *)isr_data);
 }
 
+int
+rte_pmd_bphy_npa_pf_func_get_rmt(uint16_t *pf_func)
+{
+	*pf_func = roc_bphy_npa_pf_func_get();
+
+	return 0;
+}
+
+int
+rte_pmd_bphy_sso_pf_func_get_rmt(uint16_t *pf_func)
+{
+	*pf_func = roc_bphy_sso_pf_func_get();
+
+	return 0;
+}
+
 static int
 bphy_rawdev_selftest(uint16_t dev_id)
 {
drivers/raw/cnxk_bphy/rte_pmd_bphy.h +23 -0
index 643fd9945f..b5c01811ea 100644
@@ -864,6 +864,29 @@ rte_pmd_bphy_cgx_cpri_mode_misc(uint16_t dev_id, uint16_t lmac,
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
 }
 
+/**
+ * Obtain NPA PF func
+ *
+ * @param pf_func
+ *   Address of an NPA PF and function for NPA free pointer
+ *   requests to obtain
+ *
+ * @return
+ *   Returns 0 on success, negative error code otherwise
+ */
+int rte_pmd_bphy_npa_pf_func_get_rmt(uint16_t *pf_func);
+
+/**
+ * Obtain SSO PF func
+ *
+ * @param pf_func
+ *   Address SSO PF and function for SSO add-work requests to obtain
+ *
+ * @return
+ *   Returns 0 on success, negative error code otherwise
+ */
+int rte_pmd_bphy_sso_pf_func_get_rmt(uint16_t *pf_func);
+
 #ifdef __cplusplus
 }
 #endif
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 75 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, October 14, 2022 9:46 PM
To: Jakub Palider <[email protected]>; Tomasz Duszynski <[email protected]>
Cc: [email protected]
Subject: [PATCH] raw/cnxk_bphy: extend pffunc address access

From: Jakub Palider <[email protected]>

Allows retrieval of SSO and NPA pffunc addresses without device ownership and initialization.

---
 drivers/raw/cnxk_bphy/cnxk_bphy.c    | 16 ++++++++++++++++
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h | 23 +++++++++++++++++++++++
 2 files changed, 39 insertions(+)
drivers/raw/cnxk_bphy/cnxk_bphy.c +14 -0
index 349d551839..62d138110a 100644
@@ -41,6 +41,22 @@ bphy_test_handler_fn(int irq_num, void *isr_data)
 	test[irq_num].handled_data = *((int *)isr_data);  }
 
+int
+rte_pmd_bphy_npa_pf_func_get_rmt(uint16_t *pf_func) {
+	*pf_func = roc_bphy_npa_pf_func_get();
+
+	return 0;
+}
+
+int
+rte_pmd_bphy_sso_pf_func_get_rmt(uint16_t *pf_func) {
+	*pf_func = roc_bphy_sso_pf_func_get();
+
+	return 0;
+}
+
 static int
 bphy_rawdev_selftest(uint16_t dev_id)
 {
drivers/raw/cnxk_bphy/rte_pmd_bphy.h +23 -1
index 643fd9945f..b5c01811ea 100644
@@ -864,6 +864,29 @@ rte_pmd_bphy_cgx_cpri_mode_misc(uint16_t dev_id, uint16_t lmac,
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);  }
 
+/**
+ * Obtain NPA PF func
+ *
+ * @param pf_func
+ *   Address of an NPA PF and function for NPA free pointer
+ *   requests to obtain
+ *
+ * @return
+ *   Returns 0 on success, negative error code otherwise
+ */
+int rte_pmd_bphy_npa_pf_func_get_rmt(uint16_t *pf_func);
+
+/**
+ * Obtain SSO PF func
+ *
+ * @param pf_func
+ *   Address SSO PF and function for SSO add-work requests to obtain
+ *
+ * @return
+ *   Returns 0 on success, negative error code otherwise
+ */
+int rte_pmd_bphy_sso_pf_func_get_rmt(uint16_t *pf_func);
+
 #ifdef __cplusplus
 }
 #endif
--
Quoted 1 line

2.25.1

Looks good.