Skip to contentSkip to conversation

migrate threads to DPDK service framework

PATCH Superseded Serhii Iliushyk 3 participants 88 messages Sep 8, 2025 – Oct 28, 2025 Page 2 of 2

Subsystems (2)
lore
Share & tools
lore
#62 lore raw

PATCH 10/24 net/ntnic: remove unused functions

In reply to Serhii Iliushyk

Remove unused functions from various files in the ntnic PMD.

---
 drivers/net/ntnic/nthw/core/nthw_hif.c        | 90 -------------------
 drivers/net/ntnic/nthw/core/nthw_mac_pcs.c    | 11 ---
 drivers/net/ntnic/nthw/core/nthw_pcie3.c      | 87 ------------------
 .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c   |  5 --
 drivers/net/ntnic/nthw/core/nthw_rpf.c        | 14 ---
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c   |  6 --
 .../net/ntnic/nthw/model/nthw_fpga_model.c    | 86 ------------------
 drivers/net/ntnic/ntutil/nt_util.c            | 51 -----------
 8 files changed, 350 deletions(-)
drivers/net/ntnic/nthw/core/nthw_hif.c +0 -90
index 2899c3706b..015dee1bcf 100644
@@ -217,96 +217,6 @@ int nthw_hif_trigger_sample_time(nthw_hif_t *p)
 	return 0;
 }
 
-static int nthw_hif_get_stat(nthw_hif_t *p, uint32_t *p_rx_cnt, uint32_t *p_tx_cnt,
-	uint32_t *p_ref_clk_cnt, uint32_t *p_tg_unit_size, uint32_t *p_tg_ref_freq,
-	uint64_t *p_tags_in_use, uint64_t *p_rd_err, uint64_t *p_wr_err)
-{
-	*p_rx_cnt = nthw_field_get_updated(p->mp_fld_stat_rx_counter);
-	*p_tx_cnt = nthw_field_get_updated(p->mp_fld_stat_tx_counter);
-
-	*p_ref_clk_cnt = nthw_field_get_updated(p->mp_fld_stat_ref_clk_ref_clk);
-
-	*p_tg_unit_size = NTHW_TG_CNT_SIZE;
-	*p_tg_ref_freq = p->mn_fpga_hif_ref_clk_freq;
-
-	*p_tags_in_use = (p->mp_fld_status_tags_in_use
-			? nthw_field_get_updated(p->mp_fld_status_tags_in_use)
-			: 0);
-
-	*p_rd_err =
-		(p->mp_fld_status_rd_err ? nthw_field_get_updated(p->mp_fld_status_rd_err) : 0);
-	*p_wr_err =
-		(p->mp_fld_status_wr_err ? nthw_field_get_updated(p->mp_fld_status_wr_err) : 0);
-
-	return 0;
-}
-
-static int nthw_hif_get_stat_rate(nthw_hif_t *p, uint64_t *p_pci_rx_rate, uint64_t *p_pci_tx_rate,
-	uint64_t *p_ref_clk_cnt, uint64_t *p_tags_in_use,
-	uint64_t *p_rd_err_cnt, uint64_t *p_wr_err_cnt)
-{
-	uint32_t rx_cnt, tx_cnt, ref_clk_cnt, tg_unit_size, tg_ref_freq;
-	uint64_t n_tags_in_use, n_rd_err, n_wr_err;
-
-	nthw_hif_get_stat(p, &rx_cnt, &tx_cnt, &ref_clk_cnt, &tg_unit_size, &tg_ref_freq,
-		&n_tags_in_use, &n_rd_err, &n_wr_err);
-
-	*p_tags_in_use = n_tags_in_use;
-
-	if (n_rd_err)
-		(*p_rd_err_cnt)++;
-
-	if (n_wr_err)
-		(*p_wr_err_cnt)++;
-
-	if (ref_clk_cnt) {
-		uint64_t rx_rate;
-		uint64_t tx_rate;
-
-		*p_ref_clk_cnt = ref_clk_cnt;
-
-		rx_rate = ((uint64_t)rx_cnt * tg_unit_size * tg_ref_freq) / (uint64_t)ref_clk_cnt;
-		*p_pci_rx_rate = rx_rate;
-
-		tx_rate = ((uint64_t)tx_cnt * tg_unit_size * tg_ref_freq) / (uint64_t)ref_clk_cnt;
-		*p_pci_tx_rate = tx_rate;
-
-	} else {
-		*p_pci_rx_rate = 0;
-		*p_pci_tx_rate = 0;
-		*p_ref_clk_cnt = 0;
-	}
-
-	return 0;
-}
-
-static int nthw_hif_stat_req_enable(nthw_hif_t *p)
-{
-	nthw_field_set_all(p->mp_fld_stat_ctrl_ena);
-	nthw_field_set_all(p->mp_fld_stat_ctrl_req);
-	nthw_field_flush_register(p->mp_fld_stat_ctrl_req);
-	return 0;
-}
-
-static int nthw_hif_stat_req_disable(nthw_hif_t *p)
-{
-	nthw_field_clr_all(p->mp_fld_stat_ctrl_ena);
-	nthw_field_set_all(p->mp_fld_stat_ctrl_req);
-	nthw_field_flush_register(p->mp_fld_stat_ctrl_req);
-	return 0;
-}
-
-static int nthw_hif_end_point_cntrs_sample(nthw_hif_t *p, struct nthw_hif_end_point_counters *epc)
-{
-	RTE_ASSERT(epc);
-
-	/* Get stat rate and maintain rx/tx min/max */
-	nthw_hif_get_stat_rate(p, &epc->cur_tx, &epc->cur_rx, &epc->n_ref_clk_cnt,
-		&epc->n_tags_in_use, &epc->n_rd_err, &epc->n_wr_err);
-
-	return 0;
-}
-
 int nthw_hif_read_test_reg(nthw_hif_t *p, uint8_t test_reg, uint32_t *p_value)
 {
 	uint32_t data;
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +0 -11
index a8d66268ff..4a7b7b9549 100644
@@ -429,17 +429,6 @@ void nthw_mac_pcs_set_tx_sel_host(nthw_mac_pcs_t *p, bool enable)
 		nthw_field_clr_flush(p->mp_fld_phymac_misc_tx_sel_host);
 }
 
-static void nthw_mac_pcs_set_tx_sel_tfg(nthw_mac_pcs_t *p, bool enable)
-{
-	nthw_field_get_updated(p->mp_fld_phymac_misc_tx_sel_tfg);
-
-	if (enable)
-		nthw_field_set_flush(p->mp_fld_phymac_misc_tx_sel_tfg);
-
-	else
-		nthw_field_clr_flush(p->mp_fld_phymac_misc_tx_sel_tfg);
-}
-
 void nthw_mac_pcs_set_ts_eop(nthw_mac_pcs_t *p, bool enable)
 {
 	if (p->mp_fld_phymac_misc_ts_eop) {
drivers/net/ntnic/nthw/core/nthw_pcie3.c +0 -87

90 lines not on this page · raw message

drivers/net/ntnic/nthw/core/nthw_pcm_nt400dxx.c +0 -5
index 9004ebef06..e98378e154 100644
@@ -68,11 +68,6 @@ bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat(nthw_pcm_nt400dxx_t *p)
 	return nthw_field_get_updated(p->mp_fld_stat_ts_pll_locked) != 0;
 }
 
-static bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch(nthw_pcm_nt400dxx_t *p)
-{
-	return nthw_field_get_updated(p->mp_fld_latch_ts_pll_locked) != 0;
-}
-
 void nthw_pcm_nt400dxx_set_ts_pll_locked_latch(nthw_pcm_nt400dxx_t *p, uint32_t val)
 {
 	nthw_field_update_register(p->mp_fld_latch_ts_pll_locked);
drivers/net/ntnic/nthw/core/nthw_rpf.c +0 -14
index 6f06601de8..7184aedc04 100644
@@ -20,11 +20,6 @@ nthw_rpf_t *nthw_rpf_new(void)
 	return p;
 }
 
-static void nthw_rpf_delete(nthw_rpf_t *p)
-{
-	free(p);
-}
-
 int nthw_rpf_init(nthw_rpf_t *p, nthw_fpga_t *p_fpga, int n_instance)
 {
 	nthw_module_t *p_mod = nthw_fpga_query_module(p_fpga, MOD_RPF, n_instance);
@@ -67,15 +62,6 @@ int nthw_rpf_init(nthw_rpf_t *p, nthw_fpga_t *p_fpga, int n_instance)
 	return 0;
 }
 
-static void nthw_rpf_administrative_block(nthw_rpf_t *p)
-{
-	/* block all MAC ports */
-	nthw_register_update(p->mp_reg_control);
-	nthw_field_set_val_flush32(p->mp_fld_control_pen, 0);
-
-	p->m_administrative_block = true;
-}
-
 void nthw_rpf_block(nthw_rpf_t *p)
 {
 	nthw_register_update(p->mp_reg_control);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +0 -6
index d55adc6687..1862d77350 100644
@@ -402,12 +402,6 @@ static int hw_mod_tpe_ifr_counters_mod(struct flow_api_backend_s *be, enum hw_tp
 	return 0;
 }
 
-static int hw_mod_tpe_ifr_counters_set(struct flow_api_backend_s *be, enum hw_tpe_e field,
-	int index, uint32_t value)
-{
-	return hw_mod_tpe_ifr_counters_mod(be, field, index, &value, 0);
-}
-
 int hw_mod_tpe_ifr_counters_get(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t *value)
 {
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +0 -86

128 lines not on this page · raw message

drivers/net/ntnic/ntutil/nt_util.c +0 -51

63 lines not on this page · raw message

Signature · 1 line
2.45.0
#63 lore raw

PATCH 11/24 net/ntnic: move nthw to prefix part

In reply to Serhii Iliushyk

Move nthw_ from function names to a prefix to specify NapaTech Hardware-related functions.

---
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |    2 +-
 drivers/net/ntnic/nthw/core/nthw_fpga.c       |    2 +-
 .../nthw/flow_api/flow_backend/flow_backend.c | 1336 ++++++++---------
 .../ntnic/nthw/flow_filter/flow_nthw_cat.c    |  230 +--
 .../ntnic/nthw/flow_filter/flow_nthw_cat.h    |  230 +--
 .../ntnic/nthw/flow_filter/flow_nthw_csu.c    |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_csu.h    |   24 +-
 .../ntnic/nthw/flow_filter/flow_nthw_flm.c    |  278 ++--
 .../ntnic/nthw/flow_filter/flow_nthw_flm.h    |  278 ++--
 .../ntnic/nthw/flow_filter/flow_nthw_hfu.c    |   58 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hfu.h    |   58 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hsh.c    |   60 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hsh.h    |   60 +-
 .../ntnic/nthw/flow_filter/flow_nthw_ifr.c    |   30 +-
 .../ntnic/nthw/flow_filter/flow_nthw_ifr.h    |   30 +-
 .../ntnic/nthw/flow_filter/flow_nthw_info.c   |   88 +-
 .../ntnic/nthw/flow_filter/flow_nthw_info.h   |   88 +-
 .../net/ntnic/nthw/flow_filter/flow_nthw_km.c |  160 +-
 .../net/ntnic/nthw/flow_filter/flow_nthw_km.h |  162 +-
 .../ntnic/nthw/flow_filter/flow_nthw_pdb.c    |   54 +-
 .../ntnic/nthw/flow_filter/flow_nthw_pdb.h    |   56 +-
 .../ntnic/nthw/flow_filter/flow_nthw_qsl.c    |   68 +-
 .../ntnic/nthw/flow_filter/flow_nthw_qsl.h    |   68 +-
 .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c |   32 +-
 .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h |   32 +-
 .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c |   28 +-
 .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h |   28 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c |   20 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h |   20 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c |   42 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h |   46 +-
 .../net/ntnic/nthw/model/nthw_fpga_model.c    |   12 +-
 drivers/net/ntnic/nthw/nthw_platform.c        |    2 +-
 drivers/net/ntnic/nthw/nthw_platform_drv.h    |    2 +-
 .../nthw/supported/nthw_fpga_mod_str_map.c    |    2 +-
 .../nthw/supported/nthw_fpga_mod_str_map.h    |    2 +-
 38 files changed, 1877 insertions(+), 1877 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +1 -1
index de4e8707bf..98725879b9 100644
@@ -71,7 +71,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 	int res = -1;
 	nthw_fpga_t *p_fpga = NULL;
 
-	p_hw_info->n_nthw_adapter_id = nthw_platform_get_nthw_adapter_id(p_hw_info->pci_device_id);
+	p_hw_info->n_nthw_adapter_id = nthw_platform_get_adapter_id(p_hw_info->pci_device_id);
 
 	fpga_info->n_nthw_adapter_id = p_hw_info->n_nthw_adapter_id;
 	/* ref: DN-0060 section 9 */
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
index 9153b31cea..f9e8f90e8a 100644
@@ -388,7 +388,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)
 	p_fpga_mgr = nthw_fpga_mgr_new();
 	if (p_fpga_mgr) {
 		nthw_fpga_mgr_init(p_fpga_mgr, nthw_fpga_instances,
-			(const void *)sa_nthw_fpga_mod_str_map);
+			(const void *)nthw_sa_fpga_mod_str_map);
 		nthw_fpga_mgr_log_dump(p_fpga_mgr);
 		p_fpga = nthw_fpga_mgr_query_fpga(p_fpga_mgr, n_fpga_ident, p_fpga_info);
 		p_fpga_info->mp_fpga = p_fpga;
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +668 -668

2,138 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c +115 -115

727 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h +115 -115

119 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c +11 -11
index 4ad169b943..6054b611cd 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h +12 -12
index 91a0926318..0f94761d41 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c +139 -139

278 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h +139 -139

278 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c +29 -29

58 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h +29 -29

58 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c +30 -30

60 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h +30 -30

60 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c +15 -15
index 78835654dc..ee77e21694 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h +15 -15
index 4763333765..eaf955a25f 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c +44 -44

88 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h +44 -44

88 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c +80 -80

160 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h +81 -81

162 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c +27 -27

54 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h +28 -28

56 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c +34 -34

68 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h +34 -34

68 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c +16 -16
index 1bb69e740f..07e6d38731 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h +16 -16
index bdb2e5fa54..e68df10cc2 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c +14 -14
index f5030d1997..afe5597962 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h +14 -14
index 2eed32c022..6e8860d3dc 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c +11 -11
index bb7b9c2946..9841a9a7b8 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h +11 -11
index c1094c09a9..c3b3129fa5 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c +10 -10
index 2409875a5a..63ead6c925 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h +10 -10
index b87b9dcac3..b58f3d2e28 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c +21 -21

42 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h +23 -23

46 lines not on this page · raw message

drivers/net/ntnic/nthw/model/nthw_fpga_model.c +6 -6
index 0b8958c4c1..9e269eb69f 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/nthw_platform.c +1 -1
index 80063c9d25..6f2582d6fe 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/nthw_platform_drv.h +1 -1
index df54dcead0..db2bc05180 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/supported/nthw_fpga_mod_str_map.c +1 -1
index a0afa22579..816d4ff781 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/nthw/supported/nthw_fpga_mod_str_map.h +1 -1
index 9442bb2d20..a6da8912b1 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.45.0

Part of the diff is not shown here. View the raw message.

#64 lore raw

PATCH 12/24 net/ntnic: change prefix hw to prefix nthw

In reply to Serhii Iliushyk

Change all prefix hw_ to prefix nthw_ to specify that this is Napatech hardware module.

---
 drivers/net/ntnic/include/hw_mod_backend.h    | 266 +++----
 drivers/net/ntnic/nthw/flow_api/flow_api.c    |  26 +-
 .../net/ntnic/nthw/flow_api/flow_hsh_cfg.c    |  38 +-
 drivers/net/ntnic/nthw/flow_api/flow_km.c     | 118 +--
 .../nthw/flow_api/hw_mod/hw_mod_backend.c     |  18 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c   | 140 ++--
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c   |  70 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c   |  14 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c    |  40 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c   |  14 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c   |  32 +-
 .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c      |  14 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c   |  74 +-
 .../profile_inline/flow_api_hw_db_inline.c    | 675 +++++++++---------
 .../profile_inline/flow_api_hw_db_inline.h    |  46 +-
 .../profile_inline/flow_api_profile_inline.c  | 291 ++++----
 drivers/net/ntnic/ntnic_ethdev.c              |   2 +-
 drivers/net/ntnic/ntnic_mod_reg.h             |   2 +-
 18 files changed, 948 insertions(+), 932 deletions(-)
drivers/net/ntnic/include/hw_mod_backend.h +133 -133
index 455bc7236e..8d938084e9 100644
@@ -353,66 +353,66 @@ enum hw_cat_e {
 	/* 64 */ HW_CAT_CFN_ERR_TNL_TTL_EXP,
 };
 
-bool hw_mod_cat_present(struct flow_api_backend_s *be);
-int hw_mod_cat_alloc(struct flow_api_backend_s *be);
-void hw_mod_cat_free(struct flow_api_backend_s *be);
-int hw_mod_cat_reset(struct flow_api_backend_s *be);
-int hw_mod_cat_cfn_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_cat_cfn_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index, int word_off,
-	uint32_t value);
+bool nthw_mod_cat_present(struct flow_api_backend_s *be);
+int nthw_mod_cat_alloc(struct flow_api_backend_s *be);
+void nthw_mod_cat_free(struct flow_api_backend_s *be);
+int nthw_mod_cat_reset(struct flow_api_backend_s *be);
+int nthw_mod_cat_cfn_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_cat_cfn_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+	int index, int word_off, uint32_t value);
 /* KCE/KCS/FTE KM */
-int hw_mod_cat_kce_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_kce_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_kce_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kce_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_kce_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kce_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
-int hw_mod_cat_kcs_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_kcs_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_kcs_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kcs_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_kcs_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kcs_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
-int hw_mod_cat_fte_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_fte_km_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_fte_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_fte_km_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_fte_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_fte_km_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
 /* KCE/KCS/FTE FLM */
-int hw_mod_cat_kce_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_kce_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_kce_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kce_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_kce_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kce_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
-int hw_mod_cat_kcs_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_kcs_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_kcs_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kcs_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_kcs_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_kcs_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
-int hw_mod_cat_fte_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
+int nthw_mod_cat_fte_flm_flush(struct flow_api_backend_s *be, enum km_flm_if_select_e if_num,
 	int start_idx, int count);
-int hw_mod_cat_fte_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_fte_flm_set(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t value);
-int hw_mod_cat_fte_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
+int nthw_mod_cat_fte_flm_get(struct flow_api_backend_s *be, enum hw_cat_e field,
 	enum km_flm_if_select_e if_num, int index, uint32_t *value);
 
-int hw_mod_cat_cte_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_cat_cte_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
+int nthw_mod_cat_cte_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_cat_cte_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
 	uint32_t value);
-int hw_mod_cat_cte_get(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
+int nthw_mod_cat_cte_get(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
 	uint32_t *value);
 
-int hw_mod_cat_cts_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_cat_cts_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
+int nthw_mod_cat_cts_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_cat_cts_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
 	uint32_t value);
-int hw_mod_cat_cts_get(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
+int nthw_mod_cat_cts_get(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
 	uint32_t *value);
 
-int hw_mod_cat_cot_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_cat_cot_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
+int nthw_mod_cat_cot_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_cat_cot_set(struct flow_api_backend_s *be, enum hw_cat_e field, int index,
 	uint32_t value);
 
 struct km_func_s {
@@ -500,28 +500,28 @@ enum hw_km_e {
 	HW_KM_TCQ_BANK_MASK,
 	HW_KM_TCQ_QUAL
 };
-bool hw_mod_km_present(struct flow_api_backend_s *be);
-int hw_mod_km_alloc(struct flow_api_backend_s *be);
-void hw_mod_km_free(struct flow_api_backend_s *be);
-int hw_mod_km_reset(struct flow_api_backend_s *be);
-int hw_mod_km_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_km_rcp_set(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
+bool nthw_mod_km_present(struct flow_api_backend_s *be);
+int nthw_mod_km_alloc(struct flow_api_backend_s *be);
+void nthw_mod_km_free(struct flow_api_backend_s *be);
+int nthw_mod_km_reset(struct flow_api_backend_s *be);
+int nthw_mod_km_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_km_rcp_set(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
 	uint32_t value);
-int hw_mod_km_rcp_get(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
+int nthw_mod_km_rcp_get(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
 	uint32_t *value);
-int hw_mod_km_cam_flush(struct flow_api_backend_s *be, int start_bank, int start_record,
+int nthw_mod_km_cam_flush(struct flow_api_backend_s *be, int start_bank, int start_record,
 	int count);
-int hw_mod_km_cam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
+int nthw_mod_km_cam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
 	uint32_t value);
 
-int hw_mod_km_tcam_flush(struct flow_api_backend_s *be, int start_bank, int count);
-int hw_mod_km_tcam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
+int nthw_mod_km_tcam_flush(struct flow_api_backend_s *be, int start_bank, int count);
+int nthw_mod_km_tcam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
 	int byte_val, uint32_t *value_set);
-int hw_mod_km_tcam_get(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
+int nthw_mod_km_tcam_get(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
 	int byte_val, uint32_t *value_set);
-int hw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank, int start_record,
+int nthw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank, int start_record,
 	int count);
-int hw_mod_km_tci_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
+int nthw_mod_km_tci_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
 	uint32_t value);
 struct flm_func_s {
 	COMMON_FUNC_INFO_S;
@@ -641,55 +641,55 @@ enum hw_flm_e {
 	HW_FLM_SCRUB_INF,	/* module ver 0.24 */
 };
 
-bool hw_mod_flm_present(struct flow_api_backend_s *be);
-int hw_mod_flm_alloc(struct flow_api_backend_s *be);
-void hw_mod_flm_free(struct flow_api_backend_s *be);
-int hw_mod_flm_reset(struct flow_api_backend_s *be);
+bool nthw_mod_flm_present(struct flow_api_backend_s *be);
+int nthw_mod_flm_alloc(struct flow_api_backend_s *be);
+void nthw_mod_flm_free(struct flow_api_backend_s *be);
+int nthw_mod_flm_reset(struct flow_api_backend_s *be);
 
-int hw_mod_flm_control_flush(struct flow_api_backend_s *be);
-int hw_mod_flm_control_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
+int nthw_mod_flm_control_flush(struct flow_api_backend_s *be);
+int nthw_mod_flm_control_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
 
-int hw_mod_flm_status_update(struct flow_api_backend_s *be);
-int hw_mod_flm_status_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
+int nthw_mod_flm_status_update(struct flow_api_backend_s *be);
+int nthw_mod_flm_status_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
 
-int hw_mod_flm_scan_flush(struct flow_api_backend_s *be);
-int hw_mod_flm_scan_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
+int nthw_mod_flm_scan_flush(struct flow_api_backend_s *be);
+int nthw_mod_flm_scan_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
 
-int hw_mod_flm_load_bin_flush(struct flow_api_backend_s *be);
-int hw_mod_flm_load_bin_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
+int nthw_mod_flm_load_bin_flush(struct flow_api_backend_s *be);
+int nthw_mod_flm_load_bin_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
 
-int hw_mod_flm_prio_flush(struct flow_api_backend_s *be);
-int hw_mod_flm_prio_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
+int nthw_mod_flm_prio_flush(struct flow_api_backend_s *be);
+int nthw_mod_flm_prio_set(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t value);
 
-int hw_mod_flm_pst_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_flm_pst_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
+int nthw_mod_flm_pst_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_flm_pst_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
 	uint32_t value);
 
-int hw_mod_flm_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_flm_rcp_set_mask(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
+int nthw_mod_flm_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_flm_rcp_set_mask(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
 	uint32_t *value);
-int hw_mod_flm_rcp_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
+int nthw_mod_flm_rcp_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
 	uint32_t value);
 
-int hw_mod_flm_buf_ctrl_update(struct flow_api_backend_s *be);
-int hw_mod_flm_buf_ctrl_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
+int nthw_mod_flm_buf_ctrl_update(struct flow_api_backend_s *be);
+int nthw_mod_flm_buf_ctrl_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
 
-int hw_mod_flm_stat_update(struct flow_api_backend_s *be);
-int hw_mod_flm_stat_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
+int nthw_mod_flm_stat_update(struct flow_api_backend_s *be);
+int nthw_mod_flm_stat_get(struct flow_api_backend_s *be, enum hw_flm_e field, uint32_t *value);
 
-int hw_mod_flm_lrn_data_set_flush(struct flow_api_backend_s *be, enum hw_flm_e field,
+int nthw_mod_flm_lrn_data_set_flush(struct flow_api_backend_s *be, enum hw_flm_e field,
 	const uint32_t *value, uint32_t records,
 	uint32_t *handled_records, uint32_t *inf_word_cnt,
 	uint32_t *sta_word_cnt);
-int hw_mod_flm_inf_sta_data_update_get(struct flow_api_backend_s *be, enum hw_flm_e field,
+int nthw_mod_flm_inf_sta_data_update_get(struct flow_api_backend_s *be, enum hw_flm_e field,
 	uint32_t *inf_value, uint32_t inf_size,
 	uint32_t *inf_word_cnt, uint32_t *sta_value,
 	uint32_t sta_size, uint32_t *sta_word_cnt);
 
-uint32_t hw_mod_flm_scrub_timeout_decode(uint32_t t_enc);
-uint32_t hw_mod_flm_scrub_timeout_encode(uint32_t t);
-int hw_mod_flm_scrub_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_flm_scrub_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
+uint32_t nthw_mod_flm_scrub_timeout_decode(uint32_t t_enc);
+uint32_t nthw_mod_flm_scrub_timeout_encode(uint32_t t);
+int nthw_mod_flm_scrub_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_flm_scrub_set(struct flow_api_backend_s *be, enum hw_flm_e field, int index,
 	uint32_t value);
 
 struct hsh_func_s {
@@ -731,12 +731,12 @@ enum hw_hsh_e {
 	HW_HSH_RCP_K,
 	HW_HSH_RCP_AUTO_IPV4_MASK
 };
-bool hw_mod_hsh_present(struct flow_api_backend_s *be);
-int hw_mod_hsh_alloc(struct flow_api_backend_s *be);
-void hw_mod_hsh_free(struct flow_api_backend_s *be);
-int hw_mod_hsh_reset(struct flow_api_backend_s *be);
-int hw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_hsh_rcp_set(struct flow_api_backend_s *be, enum hw_hsh_e field, uint32_t index,
+bool nthw_mod_hsh_present(struct flow_api_backend_s *be);
+int nthw_mod_hsh_alloc(struct flow_api_backend_s *be);
+void nthw_mod_hsh_free(struct flow_api_backend_s *be);
+int nthw_mod_hsh_reset(struct flow_api_backend_s *be);
+int nthw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_hsh_rcp_set(struct flow_api_backend_s *be, enum hw_hsh_e field, uint32_t index,
 	uint32_t word_off, uint32_t value);
 
 struct qsl_func_s {
@@ -773,23 +773,23 @@ enum hw_qsl_e {
 	HW_QSL_UNMQ_DEST_QUEUE,
 	HW_QSL_UNMQ_EN,
 };
-bool hw_mod_qsl_present(struct flow_api_backend_s *be);
-int hw_mod_qsl_alloc(struct flow_api_backend_s *be);
-void hw_mod_qsl_free(struct flow_api_backend_s *be);
-int hw_mod_qsl_reset(struct flow_api_backend_s *be);
-int hw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+bool nthw_mod_qsl_present(struct flow_api_backend_s *be);
+int nthw_mod_qsl_alloc(struct flow_api_backend_s *be);
+void nthw_mod_qsl_free(struct flow_api_backend_s *be);
+int nthw_mod_qsl_reset(struct flow_api_backend_s *be);
+int nthw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value);
-int hw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value);
-int hw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value);
-int hw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t *value);
-int hw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_qsl_unmq_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_qsl_unmq_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value);
 
 struct slc_lr_func_s {
@@ -812,12 +812,12 @@ enum hw_slc_lr_e {
 	HW_SLC_LR_RCP_TAIL_OFS,
 	HW_SLC_LR_RCP_PCAP
 };
-bool hw_mod_slc_lr_present(struct flow_api_backend_s *be);
-int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be);
-void hw_mod_slc_lr_free(struct flow_api_backend_s *be);
-int hw_mod_slc_lr_reset(struct flow_api_backend_s *be);
-int hw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_slc_lr_rcp_set(struct flow_api_backend_s *be, enum hw_slc_lr_e field, uint32_t index,
+bool nthw_mod_slc_lr_present(struct flow_api_backend_s *be);
+int nthw_mod_slc_lr_alloc(struct flow_api_backend_s *be);
+void nthw_mod_slc_lr_free(struct flow_api_backend_s *be);
+int nthw_mod_slc_lr_reset(struct flow_api_backend_s *be);
+int nthw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_slc_lr_rcp_set(struct flow_api_backend_s *be, enum hw_slc_lr_e field, uint32_t index,
 	uint32_t value);
 
 struct pdb_func_s {
@@ -855,12 +855,12 @@ enum hw_pdb_e {
 	HW_PDB_CONFIG_TS_FORMAT,
 	HW_PDB_CONFIG_PORT_OFS,
 };
-bool hw_mod_pdb_present(struct flow_api_backend_s *be);
-int hw_mod_pdb_alloc(struct flow_api_backend_s *be);
-void hw_mod_pdb_free(struct flow_api_backend_s *be);
-int hw_mod_pdb_reset(struct flow_api_backend_s *be);
-int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint32_t index,
+bool nthw_mod_pdb_present(struct flow_api_backend_s *be);
+int nthw_mod_pdb_alloc(struct flow_api_backend_s *be);
+void nthw_mod_pdb_free(struct flow_api_backend_s *be);
+int nthw_mod_pdb_reset(struct flow_api_backend_s *be);
+int nthw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint32_t index,
 	uint32_t value);
 
 struct tpe_func_s {
@@ -930,53 +930,53 @@ enum hw_tpe_e {
 	HW_TPE_CSU_RCP_INNER_L3_CMD,
 	HW_TPE_CSU_RCP_INNER_L4_CMD,
 };
-bool hw_mod_tpe_present(struct flow_api_backend_s *be);
-int hw_mod_tpe_alloc(struct flow_api_backend_s *be);
-void hw_mod_tpe_free(struct flow_api_backend_s *be);
-int hw_mod_tpe_reset(struct flow_api_backend_s *be);
+bool nthw_mod_tpe_present(struct flow_api_backend_s *be);
+int nthw_mod_tpe_alloc(struct flow_api_backend_s *be);
+void nthw_mod_tpe_free(struct flow_api_backend_s *be);
+int nthw_mod_tpe_reset(struct flow_api_backend_s *be);
 
-int hw_mod_tpe_rpp_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_rpp_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_rpp_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_rpp_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_rpp_ifr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_rpp_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_rpp_ifr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_rpp_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_ifr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_ifr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_ifr_counters_update(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_ifr_counters_get(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_ifr_counters_update(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_ifr_counters_get(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t *value);
 
-int hw_mod_tpe_ins_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_ins_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_ins_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_ins_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_rpl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_rpl_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_rpl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_rpl_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_rpl_ext_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_rpl_ext_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_rpl_ext_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_rpl_ext_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_rpl_rpl_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_rpl_rpl_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_rpl_rpl_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_rpl_rpl_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t *value);
 
-int hw_mod_tpe_cpy_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_cpy_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_cpy_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_cpy_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_hfu_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_hfu_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_hfu_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_hfu_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
-int hw_mod_tpe_csu_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
-int hw_mod_tpe_csu_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
+int nthw_mod_tpe_csu_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count);
+int nthw_mod_tpe_csu_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, int index,
 	uint32_t value);
 
 enum debug_mode_e {
drivers/net/ntnic/nthw/flow_api/flow_api.c +13 -13
index 97594bd26d..dd25b51e14 100644
@@ -418,19 +418,19 @@ static int nthw_flow_delete_eth_dev(struct flow_eth_dev *eth_dev)
 	 * remove unmatched queue if setup in QSL
 	 * remove exception queue setting in QSL UNM
 	 */
-	hw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_DEST_QUEUE, eth_dev->port, 0);
-	hw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_EN, eth_dev->port, 0);
-	hw_mod_qsl_unmq_flush(&ndev->be, eth_dev->port, 1);
+	nthw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_DEST_QUEUE, eth_dev->port, 0);
+	nthw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_EN, eth_dev->port, 0);
+	nthw_mod_qsl_unmq_flush(&ndev->be, eth_dev->port, 1);
 
 	if (ndev->flow_profile == FLOW_ETH_DEV_PROFILE_INLINE) {
 		for (int i = 0; i < eth_dev->num_queues; ++i) {
 			uint32_t qen_value = 0;
 			uint32_t queue_id = (uint32_t)eth_dev->rx_queue[i].hw_id;
 
-			hw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value);
-			hw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4,
+			nthw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value);
+			nthw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4,
 				qen_value & ~(1U << (queue_id % 4)));
-			hw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1);
+			nthw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1);
 		}
 	}
 
@@ -678,14 +678,14 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no
 			 * Init QSL UNM - unmatched - redirects otherwise discarded
 			 * packets in QSL
 			 */
-			if (hw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_DEST_QUEUE, eth_dev->port,
+			if (nthw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_DEST_QUEUE, eth_dev->port,
 				eth_dev->rx_queue[0].hw_id) < 0)
 				goto err_exit0;
 
-			if (hw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_EN, eth_dev->port, 1) < 0)
+			if (nthw_mod_qsl_unmq_set(&ndev->be, HW_QSL_UNMQ_EN, eth_dev->port, 1) < 0)
 				goto err_exit0;
 
-			if (hw_mod_qsl_unmq_flush(&ndev->be, eth_dev->port, 1) < 0)
+			if (nthw_mod_qsl_unmq_flush(&ndev->be, eth_dev->port, 1) < 0)
 				goto err_exit0;
 		}
 
@@ -699,10 +699,10 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no
 			uint32_t qen_value = 0;
 			uint32_t queue_id = (uint32_t)eth_dev->rx_queue[i].hw_id;
 
-			hw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value);
-			hw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4,
+			nthw_mod_qsl_qen_get(&ndev->be, HW_QSL_QEN_EN, queue_id / 4, &qen_value);
+			nthw_mod_qsl_qen_set(&ndev->be, HW_QSL_QEN_EN, queue_id / 4,
 				qen_value | (1 << (queue_id % 4)));
-			hw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1);
+			nthw_mod_qsl_qen_flush(&ndev->be, queue_id / 4, 1);
 		}
 	}
 
@@ -1276,7 +1276,7 @@ static const struct flow_filter_ops ops = {
 	/*
 	 * Other
 	 */
-	 .hw_mod_hsh_rcp_flush = hw_mod_hsh_rcp_flush,
+	 .nthw_mod_hsh_rcp_flush = nthw_mod_hsh_rcp_flush,
 };
 
 void nthw_init_flow_filter(void)
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c +19 -19
index b53252662b..76ff79cbe1 100644
@@ -70,11 +70,11 @@ static int hsh_set_part(struct flow_nic_dev *ndev, int hsh_idx, struct hsh_words
 
 	words[word].free = false;
 
-	res |= hw_mod_hsh_rcp_set(&ndev->be, words[word].pe, hsh_idx, 0, pe);
-	NT_LOG(DBG, FILTER, "hw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32 ")",
+	res |= nthw_mod_hsh_rcp_set(&ndev->be, words[word].pe, hsh_idx, 0, pe);
+	NT_LOG(DBG, FILTER, "nthw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32 ")",
 		(int)words[word].pe, hsh_idx, pe);
-	res |= hw_mod_hsh_rcp_set(&ndev->be, words[word].ofs, hsh_idx, 0, ofs);
-	NT_LOG(DBG, FILTER, "hw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32 ")",
+	res |= nthw_mod_hsh_rcp_set(&ndev->be, words[word].ofs, hsh_idx, 0, ofs);
+	NT_LOG(DBG, FILTER, "nthw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32 ")",
 		(int)words[word].ofs, hsh_idx, ofs);
 
 
@@ -95,10 +95,10 @@ static int hsh_set_part(struct flow_nic_dev *ndev, int hsh_idx, struct hsh_words
 			mask = 0x0;
 		}
 		/* reorder QW words mask from little to big endian */
-		res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, hsh_idx,
+		res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, hsh_idx,
 			words[word].index + words_count - mask_off, mask);
 		NT_LOG(DBG, FILTER,
-			"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%08" PRIX32 ")",
+			"mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%08" PRIX32 ")",
 				hsh_idx, words[word].index + words_count - mask_off, mask);
 		toeplitz_mask[words[word].index + mask_off - 1] = mask;
 	}
@@ -166,33 +166,33 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 	};
 
 	int res = 0;
-	res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0);
+	res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0);
 	/* enable hashing */
-	res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_LOAD_DIST_TYPE, hsh_idx, 0, 2);
+	res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_LOAD_DIST_TYPE, hsh_idx, 0, 2);
 
 	/* configure selected hash function and its key */
 	bool toeplitz = false;
 	switch (rss_conf.algorithm) {
 	case RTE_ETH_HASH_FUNCTION_DEFAULT:
 		/* Use default NTH10 hashing algorithm */
-		res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TOEPLITZ, hsh_idx, 0, 0);
+		res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TOEPLITZ, hsh_idx, 0, 0);
 		/* Use 1st 32-bits from rss_key to configure NTH10 SEED */
-		res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_SEED, hsh_idx, 0,
+		res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_SEED, hsh_idx, 0,
 			rss_conf.rss_key[0] << 24 | rss_conf.rss_key[1] << 16 |
 				rss_conf.rss_key[2] << 8 | rss_conf.rss_key[3]);
 		break;
 	case RTE_ETH_HASH_FUNCTION_TOEPLITZ:
 		toeplitz = true;
-		res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TOEPLITZ, hsh_idx, 0, 1);
+		res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TOEPLITZ, hsh_idx, 0, 1);
 		uint8_t empty_key = 0;
 
 		/* Toeplitz key (always 40B) words have to be programmed in reverse order */
 		for (uint8_t i = 0; i <= (MAX_RSS_KEY_LEN - 4); i += 4) {
-			res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, hsh_idx, 9 - i / 4,
+			res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, hsh_idx, 9 - i / 4,
 				rss_conf.rss_key[i] << 24 | rss_conf.rss_key[i + 1] << 16 |
 				rss_conf.rss_key[i + 2] << 8 | rss_conf.rss_key[i + 3]);
 			NT_LOG(DBG, FILTER,
-				"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 ")",
+				"nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 ")",
 				hsh_idx, 9 - i / 4, rss_conf.rss_key[i] << 24 |
 				rss_conf.rss_key[i + 1] << 16 | rss_conf.rss_key[i + 2] << 8 |
 				rss_conf.rss_key[i + 3]);
@@ -432,7 +432,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 						0, 32, toeplitz);
 				}
 			}
-			res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_AUTO_IPV4_MASK,
+			res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_AUTO_IPV4_MASK,
 				hsh_idx, 0, 1);
 		} else {
 			/* IPv4 */
@@ -539,9 +539,9 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 					res |= hsh_set_part(ndev, hsh_idx, words, DYN_L3, 9, 8,
 						toeplitz);
 			} else {
-				res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_P_MASK,
+				res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_P_MASK,
 					hsh_idx, 0, 1);
-				res |= hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TNL_P,
+				res |= nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_TNL_P,
 					hsh_idx, 0, 0);
 			}
 		} else {
@@ -555,9 +555,9 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 						toeplitz);
 				}
 			} else {
-				res |= hw_mod_hsh_rcp_set(&ndev->be,
+				res |= nthw_mod_hsh_rcp_set(&ndev->be,
 					HW_HSH_RCP_P_MASK, hsh_idx, 0, 1);
-				res |= hw_mod_hsh_rcp_set(&ndev->be,
+				res |= nthw_mod_hsh_rcp_set(&ndev->be,
 					HW_HSH_RCP_TNL_P, hsh_idx, 0, 1);
 			}
 		}
@@ -644,7 +644,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 	}
 
 	if (fields || res != 0) {
-		hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0);
+		nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0);
 		if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", rss_conf.rss_hf) == 0) {
 			NT_LOG(ERR, FILTER, "RSS configuration%s is not supported for hash func %s.",
 				rss_buffer, (enum rte_eth_hash_function)toeplitz ?
drivers/net/ntnic/nthw/flow_api/flow_km.c +61 -57

316 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +9 -9
index 490ab2a45e..21aa49e952 100644
@@ -18,17 +18,17 @@ static const struct {
 	int (*reset)(struct flow_api_backend_s *be);
 	bool (*present)(struct flow_api_backend_s *be);
 } module[] = {
-	{ "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present },
-	{ "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present },
-	{ "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present },
-	{ "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present },
-	{ "QSL", hw_mod_qsl_alloc, hw_mod_qsl_free, hw_mod_qsl_reset, hw_mod_qsl_present },
+	{ "CAT", nthw_mod_cat_alloc, nthw_mod_cat_free, nthw_mod_cat_reset, nthw_mod_cat_present },
+	{ "KM", nthw_mod_km_alloc, nthw_mod_km_free, nthw_mod_km_reset, nthw_mod_km_present },
+	{ "FLM", nthw_mod_flm_alloc, nthw_mod_flm_free, nthw_mod_flm_reset, nthw_mod_flm_present },
+	{ "HSH", nthw_mod_hsh_alloc, nthw_mod_hsh_free, nthw_mod_hsh_reset, nthw_mod_hsh_present },
+	{ "QSL", nthw_mod_qsl_alloc, nthw_mod_qsl_free, nthw_mod_qsl_reset, nthw_mod_qsl_present },
 	{
-		"SLC LR", hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset,
-		hw_mod_slc_lr_present
+		"SLC LR", nthw_mod_slc_lr_alloc, nthw_mod_slc_lr_free, nthw_mod_slc_lr_reset,
+		nthw_mod_slc_lr_present
 	},
-	{ "PDB", hw_mod_pdb_alloc, hw_mod_pdb_free, hw_mod_pdb_reset, hw_mod_pdb_present },
-	{ "TPE", hw_mod_tpe_alloc, hw_mod_tpe_free, hw_mod_tpe_reset, hw_mod_tpe_present },
+	{ "PDB", nthw_mod_pdb_alloc, nthw_mod_pdb_free, nthw_mod_pdb_reset, nthw_mod_pdb_present },
+	{ "TPE", nthw_mod_tpe_alloc, nthw_mod_tpe_free, nthw_mod_tpe_reset, nthw_mod_tpe_present },
 };
 #define MOD_COUNT (ARRAY_SIZE(module))
 
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c +70 -70

345 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c +35 -35

237 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c +7 -7
index 9821247ebb..a76cec5cfd 100644
@@ -12,12 +12,12 @@
 #define _MOD_ "HSH"
 #define _VER_ be->hsh.ver
 
-bool hw_mod_hsh_present(struct flow_api_backend_s *be)
+bool nthw_mod_hsh_present(struct flow_api_backend_s *be)
 {
 	return be->iface->get_hsh_present(be->be_dev);
 }
 
-int hw_mod_hsh_alloc(struct flow_api_backend_s *be)
+int nthw_mod_hsh_alloc(struct flow_api_backend_s *be)
 {
 	int nb;
 	_VER_ = be->iface->get_hsh_version(be->be_dev);
@@ -60,7 +60,7 @@ int hw_mod_hsh_alloc(struct flow_api_backend_s *be)
 	return 0;
 }
 
-void hw_mod_hsh_free(struct flow_api_backend_s *be)
+void nthw_mod_hsh_free(struct flow_api_backend_s *be)
 {
 	if (be->hsh.base) {
 		free(be->hsh.base);
@@ -68,16 +68,16 @@ void hw_mod_hsh_free(struct flow_api_backend_s *be)
 	}
 }
 
-int hw_mod_hsh_reset(struct flow_api_backend_s *be)
+int nthw_mod_hsh_reset(struct flow_api_backend_s *be)
 {
 	/* Zero entire cache area */
 	nthw_zero_module_cache((struct common_func_s *)(&be->hsh));
 
 	NT_LOG(DBG, FILTER, "INIT HSH RCP");
-	return hw_mod_hsh_rcp_flush(be, 0, be->hsh.nb_rcp);
+	return nthw_mod_hsh_rcp_flush(be, 0, be->hsh.nb_rcp);
 }
 
-int hw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_hsh_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->hsh.nb_rcp;
@@ -278,7 +278,7 @@ static int hw_mod_hsh_rcp_mod(struct flow_api_backend_s *be, enum hw_hsh_e field
 	return 0;
 }
 
-int hw_mod_hsh_rcp_set(struct flow_api_backend_s *be, enum hw_hsh_e field, uint32_t index,
+int nthw_mod_hsh_rcp_set(struct flow_api_backend_s *be, enum hw_hsh_e field, uint32_t index,
 	uint32_t word_off, uint32_t value)
 {
 	return hw_mod_hsh_rcp_mod(be, field, index, word_off, &value, 0);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c +21 -19
index a1b9abae66..81de05253f 100644
@@ -17,12 +17,12 @@
 #define KM_RCP_MASK_D_A_SIZE 12	/* Mask for double size word extractors for DW8/DW10 */
 #define KM_RCP_MASK_B_SIZE 6
 
-bool hw_mod_km_present(struct flow_api_backend_s *be)
+bool nthw_mod_km_present(struct flow_api_backend_s *be)
 {
 	return be->iface->get_km_present(be->be_dev);
 }
 
-int hw_mod_km_alloc(struct flow_api_backend_s *be)
+int nthw_mod_km_alloc(struct flow_api_backend_s *be)
 {
 	int nb;
 	_VER_ = be->iface->get_km_version(be->be_dev);
@@ -106,7 +106,7 @@ int hw_mod_km_alloc(struct flow_api_backend_s *be)
 	return 0;
 }
 
-void hw_mod_km_free(struct flow_api_backend_s *be)
+void nthw_mod_km_free(struct flow_api_backend_s *be)
 {
 	if (be->km.base) {
 		free(be->km.base);
@@ -114,7 +114,7 @@ void hw_mod_km_free(struct flow_api_backend_s *be)
 	}
 }
 
-int hw_mod_km_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_km_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->km.nb_categories;
@@ -349,19 +349,20 @@ static int hw_mod_km_rcp_mod(struct flow_api_backend_s *be, enum hw_km_e field,
 	return 0;
 }
 
-int hw_mod_km_rcp_set(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
+int nthw_mod_km_rcp_set(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
 	uint32_t value)
 {
 	return hw_mod_km_rcp_mod(be, field, index, word_off, &value, 0);
 }
 
-int hw_mod_km_rcp_get(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
+int nthw_mod_km_rcp_get(struct flow_api_backend_s *be, enum hw_km_e field, int index, int word_off,
 	uint32_t *value)
 {
 	return hw_mod_km_rcp_mod(be, field, index, word_off, value, 1);
 }
 
-int hw_mod_km_cam_flush(struct flow_api_backend_s *be, int start_bank, int start_record, int count)
+int nthw_mod_km_cam_flush(struct flow_api_backend_s *be, int start_bank,
+	int start_record, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->km.nb_cam_records * be->km.nb_cam_banks;
@@ -467,13 +468,13 @@ static int hw_mod_km_cam_mod(struct flow_api_backend_s *be, enum hw_km_e field,
 	return 0;
 }
 
-int hw_mod_km_cam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
+int nthw_mod_km_cam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
 	uint32_t value)
 {
 	return hw_mod_km_cam_mod(be, field, bank, record, &value, 0);
 }
 
-int hw_mod_km_tcam_flush(struct flow_api_backend_s *be, int start_bank, int count)
+int nthw_mod_km_tcam_flush(struct flow_api_backend_s *be, int start_bank, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->km.nb_tcam_banks * 4 * 256;
@@ -560,19 +561,20 @@ static int hw_mod_km_tcam_mod(struct flow_api_backend_s *be, enum hw_km_e field,
 	return 0;
 }
 
-int hw_mod_km_tcam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
+int nthw_mod_km_tcam_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
 	int byte_val, uint32_t *value_set)
 {
 	return hw_mod_km_tcam_mod(be, field, bank, byte, byte_val, value_set, 0);
 }
 
-int hw_mod_km_tcam_get(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
+int nthw_mod_km_tcam_get(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int byte,
 	int byte_val, uint32_t *value_set)
 {
 	return hw_mod_km_tcam_mod(be, field, bank, byte, byte_val, value_set, 1);
 }
 
-int hw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank, int start_record, int count)
+int nthw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank,
+	int start_record, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->km.nb_tcam_banks * be->km.nb_tcam_bank_width;
@@ -624,7 +626,7 @@ static int hw_mod_km_tci_mod(struct flow_api_backend_s *be, enum hw_km_e field,
 	return 0;
 }
 
-int hw_mod_km_tci_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
+int nthw_mod_km_tci_set(struct flow_api_backend_s *be, enum hw_km_e field, int bank, int record,
 	uint32_t value)
 {
 	return hw_mod_km_tci_mod(be, field, bank, record, &value, 0);
@@ -646,7 +648,7 @@ static int hw_mod_km_tcq_flush(struct flow_api_backend_s *be, int start_bank,
 	return be->iface->km_tcq_flush(be->be_dev, &be->km, start_bank, start_record, count);
 }
 
-int hw_mod_km_reset(struct flow_api_backend_s *be)
+int nthw_mod_km_reset(struct flow_api_backend_s *be)
 {
 	uint32_t tcam_v_set[3] = { 0x00000000, 0x00000000, 0x00000000 };
 
@@ -654,11 +656,11 @@ int hw_mod_km_reset(struct flow_api_backend_s *be)
 	nthw_zero_module_cache((struct common_func_s *)(&be->km));
 
 	NT_LOG(DBG, FILTER, "INIT KM RCP");
-	hw_mod_km_rcp_flush(be, 0, ALL_ENTRIES);
+	nthw_mod_km_rcp_flush(be, 0, ALL_ENTRIES);
 
 	/* init CAM - all zero */
 	NT_LOG(DBG, FILTER, "INIT KM CAM");
-	hw_mod_km_cam_flush(be, 0, 0, ALL_ENTRIES);
+	nthw_mod_km_cam_flush(be, 0, 0, ALL_ENTRIES);
 
 	/* init TCAM - all zero */
 	NT_LOG(DBG, FILTER, "INIT KM TCAM");
@@ -667,14 +669,14 @@ int hw_mod_km_reset(struct flow_api_backend_s *be)
 		/* TCAM entries are cache controlled,
 		 * thus need to hard reset initially to sync cache with HW
 		 */
-		hw_mod_km_tcam_set(be, HW_KM_TCAM_BANK_RESET, i, 0, 0, tcam_v_set);
+		nthw_mod_km_tcam_set(be, HW_KM_TCAM_BANK_RESET, i, 0, 0, tcam_v_set);
 	}
 
-	hw_mod_km_tcam_flush(be, 0, ALL_ENTRIES);
+	nthw_mod_km_tcam_flush(be, 0, ALL_ENTRIES);
 
 	/* init TCI - all zero */
 	NT_LOG(DBG, FILTER, "INIT KM TCI");
-	hw_mod_km_tci_flush(be, 0, 0, ALL_ENTRIES);
+	nthw_mod_km_tci_flush(be, 0, 0, ALL_ENTRIES);
 
 	NT_LOG(DBG, FILTER, "INIT KM TCQ");
 
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c +7 -7
index c5357a98c5..8bfc5fa9a1 100644
@@ -12,12 +12,12 @@
 #define _MOD_ "PDB"
 #define _VER_ be->pdb.ver
 
-bool hw_mod_pdb_present(struct flow_api_backend_s *be)
+bool nthw_mod_pdb_present(struct flow_api_backend_s *be)
 {
 	return be->iface->get_pdb_present(be->be_dev);
 }
 
-int hw_mod_pdb_alloc(struct flow_api_backend_s *be)
+int nthw_mod_pdb_alloc(struct flow_api_backend_s *be)
 {
 	int nb;
 	_VER_ = be->iface->get_pdb_version(be->be_dev);
@@ -50,7 +50,7 @@ int hw_mod_pdb_alloc(struct flow_api_backend_s *be)
 	return 0;
 }
 
-void hw_mod_pdb_free(struct flow_api_backend_s *be)
+void nthw_mod_pdb_free(struct flow_api_backend_s *be)
 {
 	if (be->pdb.base) {
 		free(be->pdb.base);
@@ -58,7 +58,7 @@ void hw_mod_pdb_free(struct flow_api_backend_s *be)
 	}
 }
 
-int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->pdb.nb_pdb_rcp_categories;
@@ -223,7 +223,7 @@ static int hw_mod_pdb_rcp_mod(struct flow_api_backend_s *be, enum hw_pdb_e field
 	return 0;
 }
 
-int hw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint32_t index,
+int nthw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_pdb_rcp_mod(be, field, index, &value, 0);
@@ -234,14 +234,14 @@ static int hw_mod_pdb_config_flush(struct flow_api_backend_s *be)
 	return be->iface->pdb_config_flush(be->be_dev, &be->pdb);
 }
 
-int hw_mod_pdb_reset(struct flow_api_backend_s *be)
+int nthw_mod_pdb_reset(struct flow_api_backend_s *be)
 {
 	int err = 0;
 	/* Zero entire cache area */
 	nthw_zero_module_cache((struct common_func_s *)(&be->hsh));
 
 	NT_LOG(DBG, FILTER, "INIT PDB RCP");
-	err |= hw_mod_pdb_rcp_flush(be, 0, ALL_ENTRIES);
+	err |= nthw_mod_pdb_rcp_flush(be, 0, ALL_ENTRIES);
 
 	NT_LOG(DBG, FILTER, "INIT PDB CONFIG");
 	err |= hw_mod_pdb_config_flush(be);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c +16 -16
index 261cb84dc2..c7c56ef94f 100644
@@ -15,12 +15,12 @@
 #define QSL_QEN_ENTRIES 32
 #define QSL_QNMQ_ENTRIES 256
 
-bool hw_mod_qsl_present(struct flow_api_backend_s *be)
+bool nthw_mod_qsl_present(struct flow_api_backend_s *be)
 {
 	return be->iface->get_qsl_present(be->be_dev);
 }
 
-int hw_mod_qsl_alloc(struct flow_api_backend_s *be)
+int nthw_mod_qsl_alloc(struct flow_api_backend_s *be)
 {
 	int nb;
 	_VER_ = be->iface->get_qsl_version(be->be_dev);
@@ -64,7 +64,7 @@ int hw_mod_qsl_alloc(struct flow_api_backend_s *be)
 	return 0;
 }
 
-void hw_mod_qsl_free(struct flow_api_backend_s *be)
+void nthw_mod_qsl_free(struct flow_api_backend_s *be)
 {
 	if (be->qsl.base) {
 		free(be->qsl.base);
@@ -72,19 +72,19 @@ void hw_mod_qsl_free(struct flow_api_backend_s *be)
 	}
 }
 
-int hw_mod_qsl_reset(struct flow_api_backend_s *be)
+int nthw_mod_qsl_reset(struct flow_api_backend_s *be)
 {
 	/* Zero entire cache area */
 	nthw_zero_module_cache((struct common_func_s *)(&be->qsl));
 
 	NT_LOG(DBG, FILTER, "INIT QSL RCP");
-	hw_mod_qsl_rcp_flush(be, 0, ALL_ENTRIES);
+	nthw_mod_qsl_rcp_flush(be, 0, ALL_ENTRIES);
 
 	NT_LOG(DBG, FILTER, "INIT QSL QST");
-	hw_mod_qsl_qst_flush(be, 0, ALL_ENTRIES);
+	nthw_mod_qsl_qst_flush(be, 0, ALL_ENTRIES);
 
 	NT_LOG(DBG, FILTER, "INIT QSL QEN");
-	hw_mod_qsl_qen_flush(be, 0, ALL_ENTRIES);
+	nthw_mod_qsl_qen_flush(be, 0, ALL_ENTRIES);
 
 	NT_LOG(DBG, FILTER, "INIT QSL UNMQ");
 	be->iface->qsl_unmq_flush(be->be_dev, &be->qsl, 0, 256);
@@ -92,7 +92,7 @@ int hw_mod_qsl_reset(struct flow_api_backend_s *be)
 	return 0;
 }
 
-int hw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_qsl_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->qsl.nb_rcp_categories;
@@ -206,13 +206,13 @@ static int hw_mod_qsl_rcp_mod(struct flow_api_backend_s *be, enum hw_qsl_e field
 	return 0;
 }
 
-int hw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_rcp_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_qsl_rcp_mod(be, field, index, &value, 0);
 }
 
-int hw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_qsl_qst_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->qsl.nb_qst_entries;
@@ -286,13 +286,13 @@ static int hw_mod_qsl_qst_mod(struct flow_api_backend_s *be, enum hw_qsl_e field
 	return 0;
 }
 
-int hw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qst_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_qsl_qst_mod(be, field, index, &value, 0);
 }
 
-int hw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_qsl_qen_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = QSL_QEN_ENTRIES;
@@ -336,19 +336,19 @@ static int hw_mod_qsl_qen_mod(struct flow_api_backend_s *be, enum hw_qsl_e field
 	return 0;
 }
 
-int hw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qen_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_qsl_qen_mod(be, field, index, &value, 0);
 }
 
-int hw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_qen_get(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t *value)
 {
 	return hw_mod_qsl_qen_mod(be, field, index, value, 1);
 }
 
-int hw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_qsl_unmq_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = QSL_QNMQ_ENTRIES;
@@ -396,7 +396,7 @@ static int hw_mod_qsl_unmq_mod(struct flow_api_backend_s *be, enum hw_qsl_e fiel
 	return 0;
 }
 
-int hw_mod_qsl_unmq_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
+int nthw_mod_qsl_unmq_set(struct flow_api_backend_s *be, enum hw_qsl_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_qsl_unmq_mod(be, field, index, &value, 0);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c +7 -7
index 4741a2e310..20ce217614 100644
@@ -11,12 +11,12 @@
 #define _MOD_ "SLC_LR"
 #define _VER_ be->slc_lr.ver
 
-bool hw_mod_slc_lr_present(struct flow_api_backend_s *be)
+bool nthw_mod_slc_lr_present(struct flow_api_backend_s *be)
 {
 	return be->iface->get_slc_lr_present(be->be_dev);
 }
 
-int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be)
+int nthw_mod_slc_lr_alloc(struct flow_api_backend_s *be)
 {
 	_VER_ = be->iface->get_slc_lr_version(be->be_dev);
 	NT_LOG(DBG, FILTER, "SLC LR MODULE VERSION  %i.%i", VER_MAJOR(_VER_), VER_MINOR(_VER_));
@@ -37,7 +37,7 @@ int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be)
 	return 0;
 }
 
-void hw_mod_slc_lr_free(struct flow_api_backend_s *be)
+void nthw_mod_slc_lr_free(struct flow_api_backend_s *be)
 {
 	if (be->slc_lr.base) {
 		free(be->slc_lr.base);
@@ -45,16 +45,16 @@ void hw_mod_slc_lr_free(struct flow_api_backend_s *be)
 	}
 }
 
-int hw_mod_slc_lr_reset(struct flow_api_backend_s *be)
+int nthw_mod_slc_lr_reset(struct flow_api_backend_s *be)
 {
 	/* Zero entire cache area */
 	nthw_zero_module_cache((struct common_func_s *)(&be->slc_lr));
 
 	NT_LOG(DBG, FILTER, "INIT SLC LR RCP");
-	return hw_mod_slc_lr_rcp_flush(be, 0, be->max_categories);
+	return nthw_mod_slc_lr_rcp_flush(be, 0, be->max_categories);
 }
 
-int hw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
+int nthw_mod_slc_lr_rcp_flush(struct flow_api_backend_s *be, int start_idx, int count)
 {
 	if (count == ALL_ENTRIES)
 		count = be->max_categories;
@@ -161,7 +161,7 @@ static int hw_mod_slc_lr_rcp_mod(struct flow_api_backend_s *be, enum hw_slc_lr_e
 	return 0;
 }
 
-int hw_mod_slc_lr_rcp_set(struct flow_api_backend_s *be, enum hw_slc_lr_e field, uint32_t index,
+int nthw_mod_slc_lr_rcp_set(struct flow_api_backend_s *be, enum hw_slc_lr_e field, uint32_t index,
 	uint32_t value)
 {
 	return hw_mod_slc_lr_rcp_mod(be, field, index, &value, 0);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +37 -37

234 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +342 -333

878 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h +23 -23

46 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +146 -145

291 lines not on this page · raw message

drivers/net/ntnic/ntnic_ethdev.c +1 -1
index 58be82b2d2..276a2dc8e1 100644

Lines of this file are not shown. View the raw message.

drivers/net/ntnic/ntnic_mod_reg.h +1 -1
index 26efec1c65..2d5bebda2a 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.45.0

Part of the diff is not shown here. View the raw message.

#65 lore raw

PATCH 13/24 net/ntnic: modify prefix flow with prefix nthw

In reply to Serhii Iliushyk

Change the prefix flow_ with prefix nthw_flow to specify that the flow API belongs to the Napatech hardware (nthw).

---
 drivers/net/ntnic/nthw/flow_api/flow_api.c    |  54 +++++----
 .../nthw/flow_api/flow_backend/flow_backend.c |   4 +-
 .../profile_inline/flow_api_profile_inline.c  | 113 +++++++++---------
 .../profile_inline/flow_api_profile_inline.h  |  49 ++++----
 drivers/net/ntnic/ntnic_ethdev.c              |   2 +-
 drivers/net/ntnic/ntnic_mod_reg.c             |   2 +-
 drivers/net/ntnic/ntnic_mod_reg.h             |  46 +++----
 7 files changed, 141 insertions(+), 129 deletions(-)
drivers/net/ntnic/nthw/flow_api/flow_api.c +28 -26
index dd25b51e14..4c7bb4a60a 100644
@@ -299,7 +299,7 @@ static struct flow_handle *flow_create(struct flow_eth_dev *dev __rte_unused,
 		return NULL;
 	}
 
-	return profile_inline_ops->flow_create_profile_inline(dev, attr,
+	return profile_inline_ops->nthw_flow_create_profile_inline(dev, attr,
 		forced_vlan_vid, caller_id,  item, action, error);
 }
 
@@ -313,7 +313,7 @@ static int flow_destroy(struct flow_eth_dev *dev __rte_unused,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_destroy_profile_inline(dev, flow, error);
+	return profile_inline_ops->nthw_flow_destroy_profile_inline(dev, flow, error);
 }
 
 static int flow_flush(struct flow_eth_dev *dev, uint16_t caller_id, struct rte_flow_error *error)
@@ -325,7 +325,7 @@ static int flow_flush(struct flow_eth_dev *dev, uint16_t caller_id, struct rte_f
 		return -1;
 	}
 
-	return profile_inline_ops->flow_flush_profile_inline(dev, caller_id, error);
+	return profile_inline_ops->nthw_flow_flush_profile_inline(dev, caller_id, error);
 }
 
 static int flow_actions_update(struct flow_eth_dev *dev,
@@ -340,7 +340,8 @@ static int flow_actions_update(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_actions_update_profile_inline(dev, flow, action, error);
+	return profile_inline_ops->nthw_flow_actions_update_profile_inline(dev,
+		flow, action, error);
 }
 
 /*
@@ -405,7 +406,7 @@ static int nthw_flow_delete_eth_dev(struct flow_eth_dev *eth_dev)
 	while (flow) {
 		if (flow->dev == eth_dev) {
 			struct flow_handle *flow_next = flow->next;
-			profile_inline_ops->flow_destroy_locked_profile_inline(eth_dev, flow,
+			profile_inline_ops->nthw_flow_destroy_locked_profile_inline(eth_dev, flow,
 				NULL);
 			flow = flow_next;
 
@@ -471,11 +472,11 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev)
 			"ERROR : Flows still defined but all eth-ports deleted. Flow %p",
 			ndev->flow_base);
 
-		profile_inline_ops->flow_destroy_profile_inline(ndev->flow_base->dev,
+		profile_inline_ops->nthw_flow_destroy_profile_inline(ndev->flow_base->dev,
 			ndev->flow_base, NULL);
 	}
 
-	profile_inline_ops->done_flow_management_of_ndev_profile_inline(ndev);
+	profile_inline_ops->nthw_done_flow_mgmnt_of_ndev_profile_inline(ndev);
 
 	km_free_ndev_resource_management(&ndev->km_res_handle);
 	kcc_free_ndev_resource_management(&ndev->kcc_res_handle);
@@ -656,7 +657,7 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no
 
 		/* Initialize modules if needed - recipe 0 is used as no-match and must be setup */
 		if (profile_inline_ops != NULL &&
-			profile_inline_ops->initialize_flow_management_of_ndev_profile_inline(ndev))
+			profile_inline_ops->nthw_init_flow_mgmnt_of_ndev_profile_inline(ndev))
 			goto err_exit0;
 
 	} else {
@@ -1021,7 +1022,8 @@ static int flow_dev_dump(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_dev_dump_profile_inline(dev, flow, caller_id, file, error);
+	return profile_inline_ops->nthw_flow_dev_dump_profile_inline(dev,
+		flow, caller_id, file, error);
 }
 
 static int flow_get_aged_flows(struct flow_eth_dev *dev,
@@ -1043,7 +1045,7 @@ static int flow_get_aged_flows(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_get_aged_flows_profile_inline(dev, caller_id, context,
+	return profile_inline_ops->nthw_flow_get_aged_flows_profile_inline(dev, caller_id, context,
 			nb_contexts, error);
 }
 
@@ -1058,7 +1060,7 @@ static int flow_info_get(struct flow_eth_dev *dev, uint8_t caller_id,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_info_get_profile_inline(dev, caller_id, port_info,
+	return profile_inline_ops->nthw_flow_info_get_profile_inline(dev, caller_id, port_info,
 			queue_info, error);
 }
 
@@ -1073,7 +1075,7 @@ static int flow_configure(struct flow_eth_dev *dev, uint8_t caller_id,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_configure_profile_inline(dev, caller_id, port_attr,
+	return profile_inline_ops->nthw_flow_configure_profile_inline(dev, caller_id, port_attr,
 			nb_queue, queue_attr, error);
 }
 
@@ -1093,8 +1095,8 @@ flow_pattern_template_create(struct flow_eth_dev *dev,
 			return NULL;
 	}
 
-	return profile_inline_ops->flow_pattern_template_create_profile_inline(dev, template_attr,
-		caller_id, pattern, error);
+	return profile_inline_ops->nthw_flow_pattern_template_create_profile_inline(dev,
+		template_attr, caller_id, pattern, error);
 }
 
 static int flow_pattern_template_destroy(struct flow_eth_dev *dev,
@@ -1108,7 +1110,7 @@ static int flow_pattern_template_destroy(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_pattern_template_destroy_profile_inline(dev,
+	return profile_inline_ops->nthw_flow_pattern_template_destroy_profile_inline(dev,
 			pattern_template,
 			error);
 }
@@ -1126,8 +1128,8 @@ flow_actions_template_create(struct flow_eth_dev *dev,
 		return NULL;
 	}
 
-	return profile_inline_ops->flow_actions_template_create_profile_inline(dev, template_attr,
-		caller_id, actions, masks, error);
+	return profile_inline_ops->nthw_flow_actions_template_create_profile_inline(dev,
+		template_attr, caller_id, actions, masks, error);
 }
 
 static int flow_actions_template_destroy(struct flow_eth_dev *dev,
@@ -1141,7 +1143,7 @@ static int flow_actions_template_destroy(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_actions_template_destroy_profile_inline(dev,
+	return profile_inline_ops->nthw_flow_actions_template_destroy_profile_inline(dev,
 			actions_template,
 			error);
 }
@@ -1159,7 +1161,7 @@ static struct flow_template_table *flow_template_table_create(struct flow_eth_de
 		return NULL;
 	}
 
-	return profile_inline_ops->flow_template_table_create_profile_inline(dev, table_attr,
+	return profile_inline_ops->nthw_flow_template_table_create_profile_inline(dev, table_attr,
 		forced_vlan_vid, caller_id, pattern_templates, nb_pattern_templates,
 		actions_templates, nb_actions_templates, error);
 }
@@ -1175,8 +1177,8 @@ static int flow_template_table_destroy(struct flow_eth_dev *dev,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_template_table_destroy_profile_inline(dev, template_table,
-			error);
+	return profile_inline_ops->nthw_flow_template_table_destroy_profile_inline(dev,
+		template_table, error);
 }
 
 static struct flow_handle *
@@ -1193,7 +1195,7 @@ flow_async_create(struct flow_eth_dev *dev, uint32_t queue_id,
 		return NULL;
 	}
 
-	return profile_inline_ops->flow_async_create_profile_inline(dev, queue_id, op_attr,
+	return profile_inline_ops->nthw_flow_async_create_profile_inline(dev, queue_id, op_attr,
 			template_table, pattern, pattern_template_index, actions,
 			actions_template_index, user_data, error);
 }
@@ -1209,8 +1211,8 @@ static int flow_async_destroy(struct flow_eth_dev *dev, uint32_t queue_id,
 		return -1;
 	}
 
-	return profile_inline_ops->flow_async_destroy_profile_inline(dev, queue_id, op_attr, flow,
-			user_data, error);
+	return profile_inline_ops->nthw_flow_async_destroy_profile_inline(dev, queue_id,
+		op_attr, flow, user_data, error);
 }
 int nthw_flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t size)
 {
@@ -1220,7 +1222,7 @@ int nthw_flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_t
 		return -1;
 
 	if (ndev->flow_profile == FLOW_ETH_DEV_PROFILE_INLINE)
-		return profile_inline_ops->flow_get_flm_stats_profile_inline(ndev, data, size);
+		return profile_inline_ops->nthw_flow_get_flm_stats_profile_inline(ndev, data, size);
 
 	return -1;
 }
@@ -1233,7 +1235,7 @@ int nthw_flow_get_ifr_stats(struct flow_nic_dev *ndev, uint64_t *data, uint8_t p
 		return -1;
 
 	if (ndev->flow_profile == FLOW_ETH_DEV_PROFILE_INLINE) {
-		return profile_inline_ops->flow_get_ifr_stats_profile_inline(ndev, data,
+		return profile_inline_ops->nthw_flow_get_ifr_stats_profile_inline(ndev, data,
 				port_count);
 	}
 
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +2 -2
index cb6489b3ac..8144e25540 100644
@@ -1972,7 +1972,7 @@ static int free_rx_queue(void *be_dev, int hw_queue)
 	return 0;
 }
 
-const struct flow_api_backend_ops flow_be_iface = {
+const struct flow_api_backend_ops nthw_flow_be_iface = {
 	1,
 
 	set_debug_mode,
@@ -2248,7 +2248,7 @@ const struct flow_api_backend_ops *nthw_bin_flow_backend_init(nthw_fpga_t *p_fpg
 	be_devs[physical_adapter_no].adapter_no = physical_adapter_no;
 	*dev = (void *)&be_devs[physical_adapter_no];
 
-	return &flow_be_iface;
+	return &nthw_flow_be_iface;
 }
 
 static void bin_flow_backend_done(void *dev)
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +59 -54

297 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h +27 -22

135 lines not on this page · raw message

drivers/net/ntnic/ntnic_ethdev.c +1 -1
index 276a2dc8e1..6318a32e4b 100644
@@ -1192,7 +1192,7 @@ static int dev_set_mtu_inline(struct rte_eth_dev *eth_dev, uint16_t mtu)
 	int ret = -1;
 
 	if (internals->type == PORT_TYPE_PHYSICAL && mtu >= MIN_MTU_INLINE && mtu <= MAX_MTU)
-		ret = profile_inline_ops->flow_set_mtu_inline(flw_dev, internals->port, mtu);
+		ret = profile_inline_ops->nthw_flow_set_mtu_inline(flw_dev, internals->port, mtu);
 
 	return ret ? -EINVAL : 0;
 }
drivers/net/ntnic/ntnic_mod_reg.c +1 -1
index 8dc6e48182..36aee48818 100644
@@ -226,7 +226,7 @@ void register_profile_inline_ops(const struct profile_inline_ops *ops)
 const struct profile_inline_ops *get_profile_inline_ops(void)
 {
 	if (profile_inline_ops == NULL)
-		profile_inline_init();
+		nthw_profile_inline_init();
 
 	return profile_inline_ops;
 }
drivers/net/ntnic/ntnic_mod_reg.h +23 -23

144 lines not on this page · raw message

Signature · 1 line
2.45.0
#66 lore raw

PATCH 14/24 net/ntnic: change prefix flm to prefix nthw

In reply to Serhii Iliushyk

Change the prefix flm_ to prefix nthw_flm_ to specify that these functions and part of the ntwh (Napatech Hardware).

---
 .../flow_api/profile_inline/flm_age_queue.c   | 22 ++++----
 .../flow_api/profile_inline/flm_age_queue.h   | 20 +++----
 .../flow_api/profile_inline/flm_lrn_queue.c   | 12 ++--
 .../flow_api/profile_inline/flm_lrn_queue.h   | 12 ++--
 .../profile_inline/flow_api_profile_inline.c  | 55 ++++++++++---------
 drivers/net/ntnic/ntnic_ethdev.c              |  6 +-
 6 files changed, 64 insertions(+), 63 deletions(-)
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_age_queue.c +11 -11
index c7522516d1..87c1a5a29e 100644
@@ -13,22 +13,22 @@
 static struct rte_ring *age_queue[MAX_EVT_AGE_QUEUES];
 static RTE_ATOMIC(uint16_t) age_event[MAX_EVT_AGE_PORTS];
 
-__rte_always_inline int flm_age_event_get(uint8_t port)
+__rte_always_inline int nthw_flm_age_event_get(uint8_t port)
 {
 	return  rte_atomic_load_explicit(&age_event[port], rte_memory_order_seq_cst);
 }
 
-__rte_always_inline void flm_age_event_set(uint8_t port)
+__rte_always_inline void nthw_flm_age_event_set(uint8_t port)
 {
 	rte_atomic_store_explicit(&age_event[port], 1, rte_memory_order_seq_cst);
 }
 
-__rte_always_inline void flm_age_event_clear(uint8_t port)
+__rte_always_inline void nthw_flm_age_event_clear(uint8_t port)
 {
 	rte_atomic_store_explicit(&age_event[port], 0, rte_memory_order_seq_cst);
 }
 
-void flm_age_queue_free(uint8_t port, uint16_t caller_id)
+void nthw_flm_age_queue_free(uint8_t port, uint16_t caller_id)
 {
 	struct rte_ring *q = NULL;
 
@@ -43,17 +43,17 @@ void flm_age_queue_free(uint8_t port, uint16_t caller_id)
 	rte_ring_free(q);
 }
 
-void flm_age_queue_free_all(void)
+void nthw_flm_age_queue_free_all(void)
 {
 	int i;
 	int j;
 
 	for (i = 0; i < MAX_EVT_AGE_PORTS; i++)
 		for (j = 0; j < MAX_EVT_AGE_QUEUES; j++)
-			flm_age_queue_free(i, j);
+			nthw_flm_age_queue_free(i, j);
 }
 
-struct rte_ring *flm_age_queue_create(uint8_t port, uint16_t caller_id, unsigned int count)
+struct rte_ring *nthw_flm_age_queue_create(uint8_t port, uint16_t caller_id, unsigned int count)
 {
 	char name[20];
 	struct rte_ring *q = NULL;
@@ -112,7 +112,7 @@ struct rte_ring *flm_age_queue_create(uint8_t port, uint16_t caller_id, unsigned
 	return q;
 }
 
-void flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj)
+void nthw_flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj)
 {
 	int ret;
 
@@ -125,7 +125,7 @@ void flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj)
 	}
 }
 
-int flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj)
+int nthw_flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj)
 {
 	int ret;
 
@@ -142,7 +142,7 @@ int flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj)
 	return -ENOENT;
 }
 
-unsigned int flm_age_queue_count(uint16_t caller_id)
+unsigned int nthw_flm_age_queue_count(uint16_t caller_id)
 {
 	unsigned int ret = 0;
 
@@ -152,7 +152,7 @@ unsigned int flm_age_queue_count(uint16_t caller_id)
 	return ret;
 }
 
-unsigned int flm_age_queue_get_size(uint16_t caller_id)
+unsigned int nthw_flm_age_queue_get_size(uint16_t caller_id)
 {
 	unsigned int ret = 0;
 
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_age_queue.h +10 -10
index 55c410ac86..babf73fd7f 100644
@@ -28,15 +28,15 @@ struct flm_age_event_s {
 
 #define FLM_AGE_ELEM_SIZE sizeof(struct flm_age_event_s)
 
-int flm_age_event_get(uint8_t port);
-void flm_age_event_set(uint8_t port);
-void flm_age_event_clear(uint8_t port);
-void flm_age_queue_free(uint8_t port, uint16_t caller_id);
-void flm_age_queue_free_all(void);
-struct rte_ring *flm_age_queue_create(uint8_t port, uint16_t caller_id, unsigned int count);
-void flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj);
-int flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj);
-unsigned int flm_age_queue_count(uint16_t caller_id);
-unsigned int flm_age_queue_get_size(uint16_t caller_id);
+int nthw_flm_age_event_get(uint8_t port);
+void nthw_flm_age_event_set(uint8_t port);
+void nthw_flm_age_event_clear(uint8_t port);
+void nthw_flm_age_queue_free(uint8_t port, uint16_t caller_id);
+void nthw_flm_age_queue_free_all(void);
+struct rte_ring *nthw_flm_age_queue_create(uint8_t port, uint16_t caller_id, unsigned int count);
+void nthw_flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj);
+int nthw_flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj);
+unsigned int nthw_flm_age_queue_count(uint16_t caller_id);
+unsigned int nthw_flm_age_queue_get_size(uint16_t caller_id);
 
 #endif	/* _FLM_AGE_QUEUE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.c +6 -6
index f6cc09de9b..4f974a6e5b 100644
@@ -16,7 +16,7 @@
 
 #define ELEM_SIZE sizeof(struct flm_v25_lrn_data_s)
 
-void *flm_lrn_queue_create(void)
+void *nthw_flm_lrn_queue_create(void)
 {
 	static_assert((ELEM_SIZE & ~(size_t)3) == ELEM_SIZE, "FLM LEARN struct size");
 	struct rte_ring *q = rte_ring_create_elem("RFQ",
@@ -28,24 +28,24 @@ void *flm_lrn_queue_create(void)
 	return q;
 }
 
-void flm_lrn_queue_free(void *q)
+void nthw_flm_lrn_queue_free(void *q)
 {
 	rte_ring_free(q);
 }
 
-uint32_t *flm_lrn_queue_get_write_buffer(void *q)
+uint32_t *nthw_flm_lrn_queue_get_write_buffer(void *q)
 {
 	struct rte_ring_zc_data zcd;
 	unsigned int n = rte_ring_enqueue_zc_burst_elem_start(q, ELEM_SIZE, 1, &zcd, NULL);
 	return (n == 0) ? NULL : zcd.ptr1;
 }
 
-void flm_lrn_queue_release_write_buffer(void *q)
+void nthw_flm_lrn_queue_release_write_buffer(void *q)
 {
 	rte_ring_enqueue_zc_elem_finish(q, 1);
 }
 
-read_record flm_lrn_queue_get_read_buffer(void *q)
+read_record nthw_flm_lrn_queue_get_read_buffer(void *q)
 {
 	struct rte_ring_zc_data zcd;
 	read_record rr;
@@ -62,7 +62,7 @@ read_record flm_lrn_queue_get_read_buffer(void *q)
 	return rr;
 }
 
-void flm_lrn_queue_release_read_buffer(void *q, uint32_t num)
+void nthw_flm_lrn_queue_release_read_buffer(void *q, uint32_t num)
 {
 	rte_ring_dequeue_zc_elem_finish(q, num);
 }
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.h +6 -6
index 40558f4201..ee1e2a63eb 100644
@@ -13,13 +13,13 @@ typedef struct read_record {
 	uint32_t num;
 } read_record;
 
-void *flm_lrn_queue_create(void);
-void flm_lrn_queue_free(void *q);
+void *nthw_flm_lrn_queue_create(void);
+void nthw_flm_lrn_queue_free(void *q);
 
-uint32_t *flm_lrn_queue_get_write_buffer(void *q);
-void flm_lrn_queue_release_write_buffer(void *q);
+uint32_t *nthw_flm_lrn_queue_get_write_buffer(void *q);
+void nthw_flm_lrn_queue_release_write_buffer(void *q);
 
-read_record flm_lrn_queue_get_read_buffer(void *q);
-void flm_lrn_queue_release_read_buffer(void *q, uint32_t num);
+read_record nthw_flm_lrn_queue_get_read_buffer(void *q);
+void nthw_flm_lrn_queue_release_read_buffer(void *q, uint32_t num);
 
 #endif	/* _FLM_LRN_QUEUE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +28 -27

204 lines not on this page · raw message

drivers/net/ntnic/ntnic_ethdev.c +3 -3
index 6318a32e4b..c580684a84 100644
@@ -1547,7 +1547,7 @@ drv_deinit(struct drv_s *p_drv)
 		/* Free all remote flm event queues */
 		nthw_flm_inf_sta_queue_free_all(FLM_INFO_REMOTE);
 		/* Free all aged flow event queues */
-		flm_age_queue_free_all();
+		nthw_flm_age_queue_free_all();
 	}
 
 	/* stop adapter */
@@ -1981,7 +1981,7 @@ static int port_event_service(void *context)
 			/* Note: RTE_FLOW_PORT_FLAG_STRICT_QUEUE flag is not supported so
 			 * event is always generated
 			 */
-			int aged_event_count = flm_age_event_get(port_no);
+			int aged_event_count = nthw_flm_age_event_get(port_no);
 
 			if (aged_event_count > 0 &&
 				eth_dev[port_no] &&
@@ -1990,7 +1990,7 @@ static int port_event_service(void *context)
 				rte_eth_dev_callback_process(eth_dev[port_no],
 					RTE_ETH_EVENT_FLOW_AGED,
 					NULL);
-				flm_age_event_clear(port_no);
+				nthw_flm_age_event_clear(port_no);
 				do_wait = false;
 			}
 
Signature · 1 line
2.45.0
#67 lore raw

PATCH 15/24 net/ntnic: change prefix nt to prefix nthw

In reply to Serhii Iliushyk

change prefix nt_ to prefix nthw_ to specify that this is related to Napatech hardware.

---
 .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c |  2 +-
 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c |  2 +-
 .../link_mgmt/link_100g/nt4ga_link_100g.c     | 12 ++---
 .../link_agx_100g/nt4ga_agx_link_100g.c       | 16 +++----
 drivers/net/ntnic/nim/i2c_nim.c               |  4 +-
 .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c   |  2 +-
 .../core/nt400dxx/reset/nthw_fpga_rst9574.c   | 18 ++++----
 .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c   | 32 ++++++-------
 drivers/net/ntnic/nthw/core/nthw_fpga.c       |  2 +-
 drivers/net/ntnic/nthw/core/nthw_i2cm.c       |  4 +-
 drivers/net/ntnic/nthw/core/nthw_igam.c       |  4 +-
 drivers/net/ntnic/nthw/core/nthw_iic.c        |  2 +-
 drivers/net/ntnic/nthw/core/nthw_mac_pcs.c    |  6 +--
 drivers/net/ntnic/nthw/core/nthw_phy_tile.c   | 46 +++++++++----------
 .../net/ntnic/nthw/core/nthw_si5332_si5156.c  |  2 +-
 drivers/net/ntnic/nthw/core/nthw_si5340.c     |  4 +-
 drivers/net/ntnic/nthw/core/nthw_spi_v3.c     | 12 ++---
 .../profile_inline/flow_api_profile_inline.c  | 18 ++++----
 .../net/ntnic/nthw/model/nthw_fpga_model.c    |  2 +-
 drivers/net/ntnic/nthw/nthw_rac.c             |  8 ++--
 drivers/net/ntnic/ntnic_ethdev.c              | 42 +++++++++--------
 drivers/net/ntnic/ntnic_vfio.c                | 16 +++----
 drivers/net/ntnic/ntnic_vfio.h                | 10 ++--
 drivers/net/ntnic/ntutil/nt_util.c            | 22 ++++-----
 drivers/net/ntnic/ntutil/nt_util.h            | 18 ++++----
 25 files changed, 154 insertions(+), 152 deletions(-)
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
index ff83ba69f7..9d0d77dcc8 100644
@@ -128,7 +128,7 @@ static int nt4ga_stat_setup(struct adapter_info_s *p_adapter_info)
 		int numa_node = p_adapter_info->fpga_info.numa_node;
 
 		/* FPGA needs a 16K alignment on Statistics */
-		p_dma = nt_dma_alloc(n_stat_size, 0x4000, numa_node);
+		p_dma = nthw_dma_alloc(n_stat_size, 0x4000, numa_node);
 
 		if (!p_dma) {
 			NT_LOG_DBGX(ERR, NTNIC, "p_dma alloc failed");
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +1 -1
index 107fe91394..7b2e2e53fc 100644
@@ -485,7 +485,7 @@ static int dbs_wait_hw_queue_shutdown(struct nthw_virt_queue *vq, int rx)
 
 	if (err) {
 		if (err == -ENOTSUP) {
-			nt_os_wait_usec(200000);
+			nthw_os_wait_usec(200000);
 			return 0;
 		}
 
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +6 -6
index 21e95d84bd..2c7a88aed9 100644
@@ -50,9 +50,9 @@ static int _reset_rx(adapter_info_t *drv, nthw_mac_pcs_t *mac_pcs)
 	(void)drv;
 
 	nthw_mac_pcs_rx_path_rst(mac_pcs, true);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 	nthw_mac_pcs_rx_path_rst(mac_pcs, false);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 
 	return 0;
 }
@@ -110,7 +110,7 @@ static void _set_loopback(struct adapter_info_s *p_adapter_info,
 	/* After changing the loopback the system must be properly reset */
 	_reset_rx(p_adapter_info, mac_pcs);
 
-	nt_os_wait_usec(10000);	/* 10ms - arbitrary choice */
+	nthw_os_wait_usec(10000);	/* 10ms - arbitrary choice */
 
 	if (!nthw_mac_pcs_is_rx_path_rst(mac_pcs)) {
 		nthw_mac_pcs_reset_bip_counters(mac_pcs);
@@ -286,14 +286,14 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable)
 	 */
 	NT_LOG(DBG, NTNIC, "%s: Performing NIM reset", drv->mp_port_id_str[port]);
 	nthw_gpio_phy_set_reset(gpio_phy, (uint8_t)port, true);
-	nt_os_wait_usec(100000);/* pause 0.1s */
+	nthw_os_wait_usec(100000);/* pause 0.1s */
 	nthw_gpio_phy_set_reset(gpio_phy, (uint8_t)port, false);
 
 	/*
 	 * Wait a little after a module has been inserted before trying to access I2C
 	 * data, otherwise the module will not respond correctly.
 	 */
-	nt_os_wait_usec(1000000);	/* pause 1.0s */
+	nthw_os_wait_usec(1000000);	/* pause 1.0s */
 
 	if (!_nim_is_present(gpio_phy, (uint8_t)port)) {
 		NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!",
@@ -650,7 +650,7 @@ static int _common_ptp_nim_state_machine(void *data)
 	}	/* end-for */
 
 	if (rte_service_runstate_get(adapter_mon_srv->id))
-		nt_os_wait_usec(5 * 100000U);	/* 5 x 0.1s = 0.5s */
+		nthw_os_wait_usec(5 * 100000U);	/* 5 x 0.1s = 0.5s */
 
 	return 0;
 }
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +8 -8
index c8b7912e26..b700a9e76e 100644
@@ -93,17 +93,17 @@ static void phy_tx_path_rst(adapter_info_t *drv, int port, bool reset)
 static void phy_reset_rx(adapter_info_t *drv, int port)
 {
 	phy_rx_path_rst(drv, port, true);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 	phy_rx_path_rst(drv, port, false);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 }
 
 static void phy_reset_tx(adapter_info_t *drv, int port)
 {
 	phy_tx_path_rst(drv, port, true);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 	phy_tx_path_rst(drv, port, false);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 }
 
 static int phy_set_host_loopback(adapter_info_t *drv, int port, loopback_host_t loopback)
@@ -499,7 +499,7 @@ set_loopback(struct adapter_info_s *p_adapter_info, int port, uint32_t mode, uin
 	/* After changing the loopback the system must be properly reset */
 	phy_reset_rx(p_adapter_info, port);
 	phy_reset_tx(p_adapter_info, port);
-	nt_os_wait_usec(10000);	/* 10ms - arbitrary choice */
+	nthw_os_wait_usec(10000);	/* 10ms - arbitrary choice */
 }
 
 static void port_disable(adapter_info_t *drv, int port)
@@ -547,14 +547,14 @@ static int create_nim(adapter_info_t *drv, int port, bool enable)
 
 	NT_LOG(DBG, NTNIC, "%s: Performing NIM reset", drv->mp_port_id_str[port]);
 	nim_set_reset(nim_ctx, (uint8_t)port, true);
-	nt_os_wait_usec(100000);/*  pause 0.1s */
+	nthw_os_wait_usec(100000);/*  pause 0.1s */
 	nim_set_reset(nim_ctx, (uint8_t)port, false);
 
 	/*
 	 * Wait a little after a module has been inserted before trying to access I2C
 	 * data, otherwise the module will not respond correctly.
 	 */
-	nt_os_wait_usec(1000000);	/* pause 1.0s */
+	nthw_os_wait_usec(1000000);	/* pause 1.0s */
 
 	res = nthw_construct_and_preinit_nim(nim_ctx, NULL);
 
@@ -941,7 +941,7 @@ static int _common_ptp_nim_state_machine(void *data)
 	}
 
 	if (rte_service_runstate_get(adapter_mon_srv->id))
-		nt_os_wait_usec(5 * 100000U);	/*  5 x 0.1s = 0.5s */
+		nthw_os_wait_usec(5 * 100000U);	/*  5 x 0.1s = 0.5s */
 
 	return 0;
 }
drivers/net/ntnic/nim/i2c_nim.c +2 -2
index 4fd882b8c9..a394b4c5d4 100644
@@ -704,7 +704,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)
 	 * Probably because access to the paged address space is required.
 	 */
 	if (!init_complete_flag_present) {
-		nt_os_wait_usec(500000);
+		nthw_os_wait_usec(500000);
 		return;
 	}
 
@@ -724,7 +724,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)
 			break;
 		}
 
-		nt_os_wait_usec(100000);/* 100 ms */
+		nthw_os_wait_usec(100000);/* 100 ms */
 		count++;
 	}
 }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
index cc6f7d13b5..34527b0cca 100644
@@ -197,7 +197,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga,
 		 * reset DDR and perform calibration retry
 		 */
 		nthw_field_set_flush(p->mp_fld_rst_ddr4);	/* Reset DDR PLL */
-		nt_os_wait_usec(100);
+		nthw_os_wait_usec(100);
 		nthw_field_clr_flush(p->mp_fld_rst_ddr4);
 
 		n_retry_cnt++;
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +9 -9
index 8cad9fac5a..28769e3aa5 100644
@@ -150,7 +150,7 @@ static int nthw_fpga_rst9574_wait_ddr4_calibration_complete(struct fpga_info_s *
 		complete = nthw_fpga_rst9574_get_ddr4_calib_complete_stat(p_rst);
 
 		if (!complete)
-			nt_os_wait_usec(100);
+			nthw_os_wait_usec(100);
 
 		timeout--;
 
@@ -187,7 +187,7 @@ static int nthw_fpga_rst9574_wait_phy_ftile_rdy(struct fpga_info_s *p_fpga_info,
 		complete = nthw_fpga_rst9574_get_phy_ftile_rdy_stat(p_rst);
 
 		if (!complete) {
-			nt_os_wait_usec(100);
+			nthw_os_wait_usec(100);
 
 		} else {
 			NT_LOG(DBG, NTHW, "%s: PHY FTILE ready, margin to timeout %u",
@@ -221,7 +221,7 @@ static int nthw_fpga_rst9574_wait_phy_ftile_rst_done(struct fpga_info_s *p_fpga_
 		complete = nthw_fpga_rst9574_get_phy_ftile_rst_done_stat(p_rst);
 
 		if (!complete)
-			nt_os_wait_usec(100);
+			nthw_os_wait_usec(100);
 
 		timeout--;
 
@@ -251,7 +251,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 	/*
 	 * Wait a while before waiting for deasserting ddr4 reset
 	 */
-	nt_os_wait_usec(2000);
+	nthw_os_wait_usec(2000);
 
 	/* (1) De-RTE_ASSERT DDR4 reset: */
 	NT_LOG(DBG, NTHW, "%s: %s: De-asserting DDR4 reset", p_adapter_id_str, __func__);
@@ -261,7 +261,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 	 * Wait a while before waiting for calibration complete, since calibration complete
 	 * is true while ddr4 is in reset
 	 */
-	nt_os_wait_usec(2000);
+	nthw_os_wait_usec(2000);
 
 	/* (2) Wait until DDR4 calibration complete */
 	res = nthw_fpga_rst9574_wait_ddr4_calibration_complete(p_fpga_info, p_rst);
@@ -273,7 +273,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 	nthw_fpga_rst9574_set_ddr4_calib_complete_latch(p_rst, 1);
 
 	/* Wait for phy to settle.*/
-	nt_os_wait_usec(20000);
+	nthw_os_wait_usec(20000);
 
 	/* (4) Ensure all latched status bits are still set: */
 	if (!nthw_fpga_rst9574_get_ddr4_calib_complete_latch(p_rst)) {
@@ -301,7 +301,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 			__func__);
 		nthw_fpga_rst9574_phy_ftile_rst(p_rst, 0);
 
-		nt_os_wait_usec(10000);
+		nthw_os_wait_usec(10000);
 		/* (7) Wait until PHY_FTILE ready */
 		if (nthw_fpga_rst9574_wait_phy_ftile_rdy(p_fpga_info, p_rst) != -1) {
 			success = true;
@@ -331,7 +331,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 				int32_t count = 1000;
 
 				do {
-					nt_os_wait_usec(1000);
+					nthw_os_wait_usec(1000);
 				} while (!nthw_phy_tile_get_port_status_reset_ack(p_phy_tile, i) &&
 					(--count > 0));
 
@@ -343,7 +343,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,
 
 				/* Active low */
 				nthw_phy_tile_set_port_config_rst(p_phy_tile, i, 1);
-				nt_os_wait_usec(20000);
+				nthw_os_wait_usec(20000);
 			}
 		}
 
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +16 -16
index d9c4281eeb..d158135c17 100644
@@ -58,13 +58,13 @@ static int nthw_fpga_rst_nt400dxx_init(struct fpga_info_s *p_fpga_info)
 
 	/* (b1) Reset platform. It is released later */
 	nthw_prm_nt400dxx_platform_rst(p_fpga_info->mp_nthw_agx.p_prm, 1);
-	nt_os_wait_usec(10000);
+	nthw_os_wait_usec(10000);
 
 	/* (C) Reset peripherals and release the reset */
 	nthw_prm_nt400dxx_periph_rst(p_fpga_info->mp_nthw_agx.p_prm, 1);
-	nt_os_wait_usec(10000);
+	nthw_os_wait_usec(10000);
 	nthw_prm_nt400dxx_periph_rst(p_fpga_info->mp_nthw_agx.p_prm, 0);
-	nt_os_wait_usec(10000);
+	nthw_os_wait_usec(10000);
 
 	res = nthw_fpga_avr_probe(p_fpga, 0);
 
@@ -155,7 +155,7 @@ static int nthw_fpga_rst_nt400dxx_init(struct fpga_info_s *p_fpga_info)
 
 	/* Enable power supply to NIMs */
 	nthw_pcal6416a_write(p_fpga_info->mp_nthw_agx.p_io_nim, 8, 1);
-	nt_os_wait_usec(100000);/* 100ms */
+	nthw_os_wait_usec(100000);/* 100ms */
 
 	/* Check that power supply turned on. Warn if it didn't. */
 	uint8_t port_power_ok;
@@ -225,7 +225,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 
 			/* (F) Check that the system PLL is ready. */
 			for (int i = 1000; i >= 0; i--) {
-				nt_os_wait_usec(1000);
+				nthw_os_wait_usec(1000);
 				data = nthw_igam_read(p_igam, 0xffff4);
 
 				if (data == 0x80000000 || data == 0xA0000000) {
@@ -251,7 +251,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 			nthw_igam_set_ctrl_forward_rst(p_igam,
 				0);	/* Ensure that the Avalon bus is not */
 			/* reset at every driver re-load. */
-			nt_os_wait_usec(1000000);
+			nthw_os_wait_usec(1000000);
 			NT_LOG(DBG, NTHW, "%s: IGAM module not used.", p_adapter_id_str);
 		}
 
@@ -267,14 +267,14 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 
 	if (p_fpga_info->mp_nthw_agx.tcxo_present && p_fpga_info->mp_nthw_agx.tcxo_capable) {
 		nthw_pcm_nt400dxx_set_ts_pll_recal(p_pcm, 1);
-		nt_os_wait_usec(1000);
+		nthw_os_wait_usec(1000);
 		nthw_pcm_nt400dxx_set_ts_pll_recal(p_pcm, 0);
-		nt_os_wait_usec(1000);
+		nthw_os_wait_usec(1000);
 	}
 
 	/* (I) Wait for TS PLL locked. */
 	for (int i = 1000; i >= 0; i--) {
-		nt_os_wait_usec(1000);
+		nthw_os_wait_usec(1000);
 
 		if (nthw_pcm_nt400dxx_get_ts_pll_locked_stat(p_pcm))
 			break;
@@ -320,9 +320,9 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 	if (res == 0)
 		NT_LOG(DBG, NTHW, "%s: Hif module found", p_fpga_info->mp_adapter_id_str);
 
-	nt_os_wait_usec(1000);
+	nthw_os_wait_usec(1000);
 	nthw_hif_force_soft_reset(p_nthw_hif);
-	nt_os_wait_usec(1000);
+	nthw_os_wait_usec(1000);
 	nthw_hif_delete(p_nthw_hif);
 
 	/* (L) De-RTE_ASSERT platform reset. */
@@ -354,7 +354,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 
 		/* (F) Check that the system PLL is ready. */
 		for (int i = 1000; i >= 0; i--) {
-			nt_os_wait_usec(1000);
+			nthw_os_wait_usec(1000);
 
 			if (nthw_phy_tile_get_sys_pll_get_rdy(p_phy_tile) &&
 				nthw_phy_tile_get_sys_pll_system_pll_lock(p_phy_tile)) {
@@ -363,7 +363,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 
 			if (i == 500) {
 				nthw_phy_tile_set_sys_pll_force_rst(p_phy_tile, 1);
-				nt_os_wait_usec(1000);
+				nthw_os_wait_usec(1000);
 				nthw_phy_tile_set_sys_pll_force_rst(p_phy_tile, 0);
 				NT_LOG_DBGX(DBG,
 					NTHW,
@@ -380,13 +380,13 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 			}
 		}
 
-		nt_os_wait_usec(100000);/* 100 ms */
+		nthw_os_wait_usec(100000);/* 100 ms */
 
 		uint32_t fgt_enable = 0x0d;	/* FGT 0, 2 & 3 */
 		nthw_phy_tile_set_sys_pll_en_ref_clk_fgt(p_phy_tile, fgt_enable);
 
 		for (int i = 1000; i >= 0; i--) {
-			nt_os_wait_usec(1000);
+			nthw_os_wait_usec(1000);
 
 			if (nthw_phy_tile_get_sys_pll_ref_clk_fgt_enabled(p_phy_tile) ==
 				fgt_enable) {
@@ -395,7 +395,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)
 
 			if (i == 500) {
 				nthw_phy_tile_set_sys_pll_force_rst(p_phy_tile, 1);
-				nt_os_wait_usec(1000);
+				nthw_os_wait_usec(1000);
 				nthw_phy_tile_set_sys_pll_force_rst(p_phy_tile, 0);
 				NT_LOG_DBGX(DBG,
 					NTHW,
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
index f9e8f90e8a..f9ae466383 100644
@@ -537,7 +537,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)
 			NT_LOG(DBG, NTHW, "%s: TSM time: %016" PRIX64 " %016" PRIX64 "\n",
 				p_adapter_id_str, n_time, n_ts);
 
-			nt_os_wait_usec(1000);
+			nthw_os_wait_usec(1000);
 		}
 	}
 #endif
drivers/net/ntnic/nthw/core/nthw_i2cm.c +2 -2
index 353fb3f82a..1b98fa4ca3 100644
@@ -102,7 +102,7 @@ int nthw_i2cm_init(nthw_i2cm_t *p, nthw_fpga_t *p_fpga, int n_i2c_instance)
 		NT_I2C_CMD_STOP | NT_I2C_CMD_NACK);
 
 	NT_LOG(INF, NTHW, "%s: %s  init done", p_adapter_id_str, __PRETTY_FUNCTION__);
-	nt_os_wait_usec(10000);
+	nthw_os_wait_usec(10000);
 
 	/* Initialize mutex */
 	rte_spinlock_init(&p->i2cmmutex);
@@ -118,7 +118,7 @@ static bool nthw_i2cm_ready(nthw_i2cm_t *p, bool wait_for_ack)
 		uint32_t status = nthw_field_get_updated(p->mp_fld_cmd_status_cmd_status);
 		uint32_t ready = (status & flags) == 0U;
 		/* MUST have a short break to avoid time-outs, even if ready == true */
-		nt_os_wait_usec(SLEEP_USECS);
+		nthw_os_wait_usec(SLEEP_USECS);
 
 		if (ready)
 			return true;
drivers/net/ntnic/nthw/core/nthw_igam.c +2 -2
index 385282298a..4a672daeb3 100644
@@ -68,7 +68,7 @@ uint32_t nthw_igam_read(nthw_igam_t *p, uint32_t address)
 	nthw_field_set_val_flush32(p->mp_fld_base_ptr, address);
 
 	while (nthw_field_get_updated(p->mp_fld_base_busy) == 1)
-		nt_os_wait_usec(100);
+		nthw_os_wait_usec(100);
 
 	return nthw_field_get_updated(p->mp_fld_data_data);
 }
@@ -81,7 +81,7 @@ void nthw_igam_write(nthw_igam_t *p, uint32_t address, uint32_t data)
 	nthw_field_set_val_flush32(p->mp_fld_base_cmd, 1);
 
 	while (nthw_field_get_updated(p->mp_fld_base_busy) == 1)
-		nt_os_wait_usec(100);
+		nthw_os_wait_usec(100);
 }
 
 void nthw_igam_set_ctrl_forward_rst(nthw_igam_t *p, uint32_t value)
drivers/net/ntnic/nthw/core/nthw_iic.c +1 -1
index 7a2247e371..17b7c1a079 100644
@@ -14,7 +14,7 @@
 #define I2C_TRANSMIT_WR (0x00)
 #define I2C_TRANSMIT_RD (0x01)
 
-#define I2C_WAIT_US(x) nt_os_wait_usec(x)
+#define I2C_WAIT_US(x) nthw_os_wait_usec(x)
 
 /*
  * Minimum timing values for I2C for a Marvel 88E11111 Phy.
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +3 -3
index 4a7b7b9549..b6c1a9a702 100644
@@ -588,11 +588,11 @@ void nthw_mac_pcs_set_fec(nthw_mac_pcs_t *p, bool enable)
 	/* Both Rx and Tx must be reset for new FEC state to become active */
 	nthw_mac_pcs_rx_path_rst(p, true);
 	nthw_mac_pcs_tx_path_rst(p, true);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 
 	nthw_mac_pcs_rx_path_rst(p, false);
 	nthw_mac_pcs_tx_path_rst(p, false);
-	nt_os_wait_usec(10000);	/* 10ms */
+	nthw_os_wait_usec(10000);	/* 10ms */
 }
 
 bool nthw_mac_pcs_get_fec_bypass(nthw_mac_pcs_t *p)
@@ -740,7 +740,7 @@ void nthw_mac_pcs_set_receiver_equalization_mode(nthw_mac_pcs_t *p, uint8_t mode
 	nthw_field_set_val32(p->mp_field_gty_ctl_rx_equa_rst2, 1);
 	nthw_field_set_val_flush32(p->mp_field_gty_ctl_rx_equa_rst3, 1);
 
-	nt_os_wait_usec(1000);	/* 1ms */
+	nthw_os_wait_usec(1000);	/* 1ms */
 
 	nthw_field_set_val32(p->mp_field_gty_ctl_rx_equa_rst0, 0);
 	nthw_field_set_val32(p->mp_field_gty_ctl_rx_equa_rst1, 0);
drivers/net/ntnic/nthw/core/nthw_phy_tile.c +23 -23

164 lines not on this page · raw message

drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +1 -1
index 537d58afb7..22c2c74a4d 100644
@@ -42,7 +42,7 @@ int nthw_pca9849_set_channel(nthw_pca9849_t *p, uint8_t channel)
 			return res;
 
 		p->m_current_channel = channel;
-		nt_os_wait_usec(10000);
+		nthw_os_wait_usec(10000);
 	}
 
 	return 0;
drivers/net/ntnic/nthw/core/nthw_si5340.c +2 -2
index 27f8653c9b..02674c06f2 100644
@@ -121,7 +121,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,
 
 		if (addr == 0x0006) {
 			/* Wait 300ms before continuing. See NT200E3-2-PTP_U23_Si5340_adr0_v2.h */
-			nt_os_wait_usec(300000);
+			nthw_os_wait_usec(300000);
 		}
 
 		nthw_si5340_write(p, addr, value);
@@ -167,7 +167,7 @@ static int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cnt
 			break;
 		}
 
-		nt_os_wait_usec(1000000);	/* 1 sec */
+		nthw_os_wait_usec(1000000);	/* 1 sec */
 	}
 
 	if (!success) {
drivers/net/ntnic/nthw/core/nthw_spi_v3.c +6 -6
index a995b1fb6e..afa037756e 100644
@@ -39,10 +39,10 @@ static int wait_for_tx_data_sent(nthw_spim_t *p_spim_mod, uint64_t time_out)
 	bool empty;
 	uint64_t start_time;
 	uint64_t cur_time;
-	start_time = nt_os_get_time_monotonic_counter();
+	start_time = nthw_os_get_time_monotonic_counter();
 
 	while (true) {
-		nt_os_wait_usec(1000);	/* Every 1ms */
+		nthw_os_wait_usec(1000);	/* Every 1ms */
 
 		result = nthw_spim_get_tx_fifo_empty(p_spim_mod, &empty);
 
@@ -54,7 +54,7 @@ static int wait_for_tx_data_sent(nthw_spim_t *p_spim_mod, uint64_t time_out)
 		if (empty)
 			break;
 
-		cur_time = nt_os_get_time_monotonic_counter();
+		cur_time = nthw_os_get_time_monotonic_counter();
 
 		if ((cur_time - start_time) > time_out) {
 			NT_LOG(WRN, NTHW, "%s: Timed out", __func__);
@@ -74,11 +74,11 @@ static int wait_for_rx_data_ready(nthw_spis_t *p_spis_mod, uint64_t time_out)
 	bool empty;
 	uint64_t start_time;
 	uint64_t cur_time;
-	start_time = nt_os_get_time_monotonic_counter();
+	start_time = nthw_os_get_time_monotonic_counter();
 
 	/* Wait for data to become ready in the Rx FIFO */
 	while (true) {
-		nt_os_wait_usec(10000);	/* Every 10ms */
+		nthw_os_wait_usec(10000);	/* Every 10ms */
 
 		result = nthw_spis_get_rx_fifo_empty(p_spis_mod, &empty);
 
@@ -90,7 +90,7 @@ static int wait_for_rx_data_ready(nthw_spis_t *p_spis_mod, uint64_t time_out)
 		if (!empty)
 			break;
 
-		cur_time = nt_os_get_time_monotonic_counter();
+		cur_time = nthw_os_get_time_monotonic_counter();
 
 		if ((cur_time - start_time) > time_out) {
 			NT_LOG(WRN, NTHW, "%s: Timed out", __func__);
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +9 -9
index 1a78933b7f..6fc496e16a 100644
@@ -197,7 +197,7 @@ static int flow_mtr_create_meter(struct flow_eth_dev *dev,
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
 
 	while (learn_record == NULL) {
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 		learn_record =
 			(struct flm_v25_lrn_data_s *)
 				nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
@@ -255,7 +255,7 @@ static int flow_mtr_probe_meter(struct flow_eth_dev *dev, uint8_t caller_id, uin
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
 
 	while (learn_record == NULL) {
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 		learn_record =
 			(struct flm_v25_lrn_data_s *)
 				nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
@@ -295,7 +295,7 @@ static int flow_mtr_destroy_meter(struct flow_eth_dev *dev, uint8_t caller_id, u
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
 
 	while (learn_record == NULL) {
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 		learn_record =
 			(struct flm_v25_lrn_data_s *)
 				nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
@@ -348,7 +348,7 @@ static int flm_mtr_adjust_stats(struct flow_eth_dev *dev, uint8_t caller_id, uin
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
 
 	while (learn_record == NULL) {
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 		learn_record =
 			(struct flm_v25_lrn_data_s *)
 				nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
@@ -644,7 +644,7 @@ static int flm_sdram_calibrate(struct flow_nic_dev *ndev)
 		if (fail_value != 0)
 			break;
 
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 	}
 
 	if (!success) {
@@ -685,7 +685,7 @@ static int flm_sdram_reset(struct flow_nic_dev *ndev, int enable)
 			break;
 		}
 
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 	}
 
 	if (!success) {
@@ -709,7 +709,7 @@ static int flm_sdram_reset(struct flow_nic_dev *ndev, int enable)
 			break;
 		}
 
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 	}
 
 	if (!success) {
@@ -976,7 +976,7 @@ static int flm_flow_programming(struct flow_handle *fh, uint32_t flm_op)
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
 
 	while (learn_record == NULL) {
-		nt_os_wait_usec(1);
+		nthw_os_wait_usec(1);
 		learn_record =
 			(struct flm_v25_lrn_data_s *)
 			nthw_flm_lrn_queue_get_write_buffer(flm_lrn_queue_arr);
@@ -5274,7 +5274,7 @@ struct flow_handle *nthw_flow_async_create_profile_inline(struct flow_eth_dev *d
 
 		} else {
 			do {
-				nt_os_wait_usec(1);
+				nthw_os_wait_usec(1);
 				status = atomic_load(&pattern_action_pair->status);
 			} while (status == CELL_STATUS_INITIALIZING);
 
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +1 -1
index 9e269eb69f..b9d03b4982 100644
@@ -1060,7 +1060,7 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match e
 		if (n_poll_iterations <= 0)
 			return -1;
 
-		nt_os_wait_usec(n_poll_interval);
+		nthw_os_wait_usec(n_poll_interval);
 	}
 
 	return 0;
drivers/net/ntnic/nthw/nthw_rac.c +4 -4
index 33e0caa581..4845c2b0c9 100644
@@ -326,7 +326,7 @@ int nthw_rac_rab_setup(nthw_rac_t *p)
 
 	const struct fpga_info_s *const p_fpga_info = p->mp_fpga->p_fpga_info;
 	uint32_t n_dma_buf_size = 2L * RAB_DMA_BUF_CNT * sizeof(uint32_t);
-	const size_t align_size = nt_util_align_size(n_dma_buf_size);
+	const size_t align_size = nthw_util_align_size(n_dma_buf_size);
 	int numa_node = p_fpga_info->numa_node;
 	uint64_t dma_addr;
 	uint32_t buf;
@@ -334,10 +334,10 @@ int nthw_rac_rab_setup(nthw_rac_t *p)
 	if (!p->m_dma) {
 		struct nt_dma_s *vfio_dma;
 		/* FPGA needs Page alignment (4K) */
-		vfio_dma = nt_dma_alloc(align_size, 0x1000, numa_node);
+		vfio_dma = nthw_dma_alloc(align_size, 0x1000, numa_node);
 
 		if (vfio_dma == NULL) {
-			NT_LOG(ERR, NTNIC, "nt_dma_alloc failed");
+			NT_LOG(ERR, NTNIC, "nthw_dma_alloc failed");
 			return -1;
 		}
 
@@ -418,7 +418,7 @@ static int nthw_rac_rab_dma_wait(nthw_rac_t *p)
 	uint32_t i;
 
 	for (i = 0; i < RAB_DMA_WAIT; i++) {
-		nt_os_wait_usec_poll(1);
+		nthw_os_wait_usec_poll(1);
 
 		if ((p->m_dma_out_buf[p->m_dma_out_ptr_rd] & completion) == completion)
 			break;
drivers/net/ntnic/ntnic_ethdev.c +22 -20

159 lines not on this page · raw message

drivers/net/ntnic/ntnic_vfio.c +8 -8
index b1e807d6fa..187829d287 100644
@@ -47,7 +47,7 @@ vfio_get(int vf_num)
 
 /* External API */
 int
-nt_vfio_setup(struct rte_pci_device *dev)
+nthw_vfio_setup(struct rte_pci_device *dev)
 {
 	int ret;
 	char devname[RTE_DEV_NAME_MAX_LEN] = { 0 };
@@ -123,7 +123,7 @@ nt_vfio_setup(struct rte_pci_device *dev)
 }
 
 int
-nt_vfio_remove(int vf_num)
+nthw_vfio_remove(int vf_num)
 {
 	struct vfio_dev *vfio;
 
@@ -141,7 +141,7 @@ nt_vfio_remove(int vf_num)
 }
 
 int
-nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size)
+nthw_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size)
 {
 	uint64_t gp_virt_base;
 	uint64_t gp_offset;
@@ -189,7 +189,7 @@ nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size)
 }
 
 int
-nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size)
+nthw_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size)
 {
 	uint64_t gp_virt_base;
 	struct vfio_dev *vfio;
@@ -225,10 +225,10 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size
 }
 
 void
-nt_vfio_init(void)
+nthw_vfio_init(void)
 {
-	struct nt_util_vfio_impl s = { .vfio_dma_map = nt_vfio_dma_map,
-		       .vfio_dma_unmap = nt_vfio_dma_unmap
+	struct nt_util_vfio_impl s = { .vfio_dma_map = nthw_vfio_dma_map,
+		       .vfio_dma_unmap = nthw_vfio_dma_unmap
 	};
-	nt_util_vfio_init(&s);
+	nthw_util_vfio_init(&s);
 }
drivers/net/ntnic/ntnic_vfio.h +5 -5
index e070e9460c..72f8165a48 100644
@@ -11,17 +11,17 @@
 #include <ethdev_pci.h>
 
 void
-nt_vfio_init(void);
+nthw_vfio_init(void);
 
 int
-nt_vfio_setup(struct rte_pci_device *dev);
+nthw_vfio_setup(struct rte_pci_device *dev);
 int
-nt_vfio_remove(int vf_num);
+nthw_vfio_remove(int vf_num);
 
 int
-nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size);
+nthw_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size);
 int
-nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size);
+nthw_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size);
 
 /* Find device (PF/VF) number from device address */
 #endif	/* _NTNIC_VFIO_H_ */
drivers/net/ntnic/ntutil/nt_util.c +11 -11
index 18133570bb..2401aee3dc 100644
@@ -17,35 +17,35 @@
 static struct nt_util_vfio_impl vfio_cb;
 
 /* uses usleep which schedules out the calling service */
-void nt_os_wait_usec(int val)
+void nthw_os_wait_usec(int val)
 {
 	rte_delay_us_sleep(val);
 }
 
 /* spins in a waiting loop calling pause asm instruction uses RDTSC - precise wait */
-void nt_os_wait_usec_poll(int val)
+void nthw_os_wait_usec_poll(int val)
 {
 	rte_delay_us(val);
 }
 
-uint64_t nt_os_get_time_monotonic_counter(void)
+uint64_t nthw_os_get_time_monotonic_counter(void)
 {
 	return rte_get_timer_cycles();
 }
 
 /* Allocation size matching minimum alignment of specified size */
-uint64_t nt_util_align_size(uint64_t size)
+uint64_t nthw_util_align_size(uint64_t size)
 {
 	uint64_t alignment_size = 1ULL << rte_log2_u64(size);
 	return alignment_size;
 }
 
-void nt_util_vfio_init(struct nt_util_vfio_impl *impl)
+void nthw_util_vfio_init(struct nt_util_vfio_impl *impl)
 {
 	vfio_cb = *impl;
 }
 
-struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)
+struct nt_dma_s *nthw_dma_alloc(uint64_t size, uint64_t align, int numa)
 {
 	int res;
 	struct nt_dma_s *vfio_addr;
@@ -65,7 +65,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)
 		return NULL;
 	}
 
-	res = vfio_cb.vfio_dma_map(0, addr, &vfio_addr->iova, nt_util_align_size(size));
+	res = vfio_cb.vfio_dma_map(0, addr, &vfio_addr->iova, nthw_util_align_size(size));
 
 	if (res != 0) {
 		rte_free(addr);
@@ -75,7 +75,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)
 	}
 
 	vfio_addr->addr = (uint64_t)addr;
-	vfio_addr->size = nt_util_align_size(size);
+	vfio_addr->size = nthw_util_align_size(size);
 
 	NT_LOG(DBG, GENERAL,
 		"VFIO DMA alloc addr=%" PRIX64 ", iova=%" PRIX64
@@ -86,7 +86,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)
 }
 
 /* NOTE: please note the difference between RTE_ETH_SPEED_NUM_xxx and RTE_ETH_LINK_SPEED_xxx */
-int nt_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed)
+int nthw_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed)
 {
 	int eth_speed_num = RTE_ETH_SPEED_NUM_NONE;
 
@@ -131,7 +131,7 @@ int nt_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed)
 	return eth_speed_num;
 }
 
-uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa)
+uint32_t nthw_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa)
 {
 	uint32_t eth_speed_capa = 0;
 
@@ -162,7 +162,7 @@ uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa)
 	return eth_speed_capa;
 }
 
-int nt_link_duplex_to_eth_duplex(enum nt_link_duplex_e nt_link_duplex)
+int nthw_link_duplex_to_eth_duplex(enum nt_link_duplex_e nt_link_duplex)
 {
 	int eth_link_duplex = 0;
 
drivers/net/ntnic/ntutil/nt_util.h +9 -9
index 39a4956187..c889d07a10 100644
@@ -32,16 +32,16 @@
 #define PCIIDENT_PRINT_STR "%04x:%02x:%02x.%x"
 #define BDF_TO_PCIIDENT(dom, bus, dev, fnc) (((dom) << 16) | ((bus) << 8) | ((dev) << 3) | (fnc))
 
-uint64_t nt_os_get_time_monotonic_counter(void);
-void nt_os_wait_usec(int val);
-void nt_os_wait_usec_poll(int val);
+uint64_t nthw_os_get_time_monotonic_counter(void);
+void nthw_os_wait_usec(int val);
+void nthw_os_wait_usec_poll(int val);
 
 static inline int min(int a, int b)
 {
 	return (a < b) ? a : b;
 }
 
-uint64_t nt_util_align_size(uint64_t size);
+uint64_t nthw_util_align_size(uint64_t size);
 
 struct nt_dma_s {
 	uint64_t iova;
@@ -54,17 +54,17 @@ struct port_link_speed {
 	int link_speed;
 };
 
-struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa);
+struct nt_dma_s *nthw_dma_alloc(uint64_t size, uint64_t align, int numa);
 struct nt_util_vfio_impl {
 	int (*vfio_dma_map)(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size);
 	int (*vfio_dma_unmap)(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size);
 };
 
-void nt_util_vfio_init(struct nt_util_vfio_impl *impl);
+void nthw_util_vfio_init(struct nt_util_vfio_impl *impl);
 
-int nt_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed);
-uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa);
-int nt_link_duplex_to_eth_duplex(enum nt_link_duplex_e nt_link_duplex);
+int nthw_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed);
+uint32_t nthw_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa);
+int nthw_link_duplex_to_eth_duplex(enum nt_link_duplex_e nt_link_duplex);
 
 int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args);
 
Signature · 1 line
2.45.0
#68 lore raw

PATCH 16/24 net/ntnic: change prefix ntlog to prefix nthw

In reply to Serhii Iliushyk

Change prefix ntlog_ to prefix nthw_log for logging functions.

---
 .../net/ntnic/nthw/model/nthw_fpga_model.c    | 20 +++++++++----------
 drivers/net/ntnic/nthw/nthw_rac.c             | 20 +++++++++----------
 drivers/net/ntnic/ntlog/ntlog.c               |  6 +++---
 drivers/net/ntnic/ntlog/ntlog.h               |  6 +++---
 4 files changed, 26 insertions(+), 26 deletions(-)
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +10 -10
index b9d03b4982..1dc604fe65 100644
@@ -727,17 +727,17 @@ void nthw_register_update(const nthw_register_t *p)
 			uint32_t i = len;
 			uint32_t *ptr = p_data;
 			(void)ptr;
-			char *tmp_string = ntlog_helper_str_alloc("Register::read");
-			ntlog_helper_str_add(tmp_string,
+			char *tmp_string = nthw_log_helper_str_alloc("Register::read");
+			nthw_log_helper_str_add(tmp_string,
 				"(Dev: %s, Bus: %s, Addr: 0x%08X, Cnt: %d, Data:",
 				p_dev_name, p_bus_name, addr, len);
 
 			while (i--)
-				ntlog_helper_str_add(tmp_string, " 0x%08X", *ptr++);
+				nthw_log_helper_str_add(tmp_string, " 0x%08X", *ptr++);
 
-			ntlog_helper_str_add(tmp_string, ")");
+			nthw_log_helper_str_add(tmp_string, ")");
 			NT_LOG(DBG, NTHW, "%s", tmp_string);
-			ntlog_helper_str_free(tmp_string);
+			nthw_log_helper_str_free(tmp_string);
 		}
 	}
 }
@@ -780,18 +780,18 @@ void nthw_register_flush(const nthw_register_t *p, uint32_t cnt)
 		if (p->mn_debug_mode & NTHW_REG_DEBUG_ON_WRITE) {
 			uint32_t i = len * cnt;
 			uint32_t *ptr = p_data;
-			char *tmp_string = ntlog_helper_str_alloc("Register::write");
+			char *tmp_string = nthw_log_helper_str_alloc("Register::write");
 
-			ntlog_helper_str_add(tmp_string,
+			nthw_log_helper_str_add(tmp_string,
 				"(Dev: %s, Bus: %s, Addr: 0x%08X, Cnt: %d, Data:",
 				p_dev_name, p_bus_name, addr, i);
 
 			while (i--)
-				ntlog_helper_str_add(tmp_string, " 0x%08X", *ptr++);
+				nthw_log_helper_str_add(tmp_string, " 0x%08X", *ptr++);
 
-			ntlog_helper_str_add(tmp_string, ")");
+			nthw_log_helper_str_add(tmp_string, ")");
 			NT_LOG(DBG, NTHW, "%s", tmp_string);
-			ntlog_helper_str_free(tmp_string);
+			nthw_log_helper_str_free(tmp_string);
 		}
 
 		rc = nthw_register_write_data(p, cnt);
drivers/net/ntnic/nthw/nthw_rac.c +10 -10
index 4845c2b0c9..a2a96794da 100644
@@ -654,8 +654,8 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint
 			char *tmp_string;
 
 			if (trc) {
-				tmp_string = ntlog_helper_str_alloc("Register::write");
-				ntlog_helper_str_add(tmp_string,
+				tmp_string = nthw_log_helper_str_alloc("Register::write");
+				nthw_log_helper_str_add(tmp_string,
 					"(Dev: NA, Bus: RAB%u, Addr: 0x%08X, Cnt: %d, Data:",
 					bus_id, address, word_cnt);
 			}
@@ -669,13 +669,13 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint
 				}
 
 				if (trc)
-					ntlog_helper_str_add(tmp_string, " 0x%08X", data);
+					nthw_log_helper_str_add(tmp_string, " 0x%08X", data);
 			}
 
 			if (trc) {
-				ntlog_helper_str_add(tmp_string, ")");
+				nthw_log_helper_str_add(tmp_string, ")");
 				NT_LOG(DBG, NTHW, "%s", tmp_string);
-				ntlog_helper_str_free(tmp_string);
+				nthw_log_helper_str_free(tmp_string);
 			}
 		}
 
@@ -840,17 +840,17 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3
 			}
 
 			if (trc) {
-				char *tmp_string = ntlog_helper_str_alloc("Register::read");
-				ntlog_helper_str_add(tmp_string,
+				char *tmp_string = nthw_log_helper_str_alloc("Register::read");
+				nthw_log_helper_str_add(tmp_string,
 					"(Dev: NA, Bus: RAB%u, Addr: 0x%08X, Cnt: %d, Data:",
 					bus_id, address, word_cnt);
 
 				for (i = 0; i < word_cnt; i++)
-					ntlog_helper_str_add(tmp_string, " 0x%08X", p_data[i]);
+					nthw_log_helper_str_add(tmp_string, " 0x%08X", p_data[i]);
 
-				ntlog_helper_str_add(tmp_string, ")");
+				nthw_log_helper_str_add(tmp_string, ")");
 				NT_LOG(DBG, NTHW, "%s", tmp_string);
-				ntlog_helper_str_free(tmp_string);
+				nthw_log_helper_str_free(tmp_string);
 			}
 		}
 
drivers/net/ntnic/ntlog/ntlog.c +3 -3
index 7b7f583364..1ee0f40286 100644
@@ -16,7 +16,7 @@
 
 #define NTLOG_HELPER_STR_SIZE_MAX (1024)
 
-char *ntlog_helper_str_alloc(const char *sinit)
+char *nthw_log_helper_str_alloc(const char *sinit)
 {
 	char *s = malloc(NTLOG_HELPER_STR_SIZE_MAX);
 
@@ -33,7 +33,7 @@ char *ntlog_helper_str_alloc(const char *sinit)
 }
 
 __rte_format_printf(2, 0)
-void ntlog_helper_str_add(char *s, const char *format, ...)
+void nthw_log_helper_str_add(char *s, const char *format, ...)
 {
 	if (!s)
 		return;
@@ -45,7 +45,7 @@ void ntlog_helper_str_add(char *s, const char *format, ...)
 	va_end(args);
 }
 
-void ntlog_helper_str_free(char *s)
+void nthw_log_helper_str_free(char *s)
 {
 	free(s);
 }
drivers/net/ntnic/ntlog/ntlog.h +3 -3
index fd839e5cff..810b07efd0 100644
@@ -65,8 +65,8 @@ extern int nt_log_ntnic;
  * to use when one single function call to NT_LOG is not optimal - that is
  * you do not know the number of parameters at programming time or it is variable
  */
-char *ntlog_helper_str_alloc(const char *sinit);
-void ntlog_helper_str_add(char *s, const char *format, ...);
-void ntlog_helper_str_free(char *s);
+char *nthw_log_helper_str_alloc(const char *sinit);
+void nthw_log_helper_str_add(char *s, const char *format, ...);
+void nthw_log_helper_str_free(char *s);
 
 #endif	/* NTOSS_SYSTEM_NTLOG_H */
Signature · 1 line
2.45.0
#69 lore raw

PATCH 17/24 net/ntnic: change prefix km to prefix nthw

In reply to Serhii Iliushyk

Change prefix km_ (key matcher) to prefix nthw_km_ for flow_api module.

---
 drivers/net/ntnic/include/flow_api_engine.h   | 18 ++--
 drivers/net/ntnic/nthw/flow_api/flow_api.c    |  4 +-
 drivers/net/ntnic/nthw/flow_api/flow_kcc.c    |  2 +-
 drivers/net/ntnic/nthw/flow_api/flow_km.c     | 16 +--
 .../profile_inline/flow_api_profile_inline.c  | 99 ++++++++++---------
 5 files changed, 75 insertions(+), 64 deletions(-)
drivers/net/ntnic/include/flow_api_engine.h +9 -9
index 6401c79e3c..6a27ba8e12 100644
@@ -396,26 +396,26 @@ struct flow_template_table {
 	uint16_t caller_id;
 };
 
-void km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle);
-void km_free_ndev_resource_management(void **handle);
+void nthw_km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle);
+void nthw_km_free_ndev_resource_management(void **handle);
 
-int km_add_match_elem(struct km_flow_def_s *km, uint32_t e_word[4], uint32_t e_mask[4],
+int nthw_km_add_match_elem(struct km_flow_def_s *km, uint32_t e_word[4], uint32_t e_mask[4],
 	uint32_t word_len, enum frame_offs_e start, int8_t offset);
 
-int km_key_create(struct km_flow_def_s *km, uint32_t port_id);
+int nthw_km_key_create(struct km_flow_def_s *km, uint32_t port_id);
 /*
  * Compares 2 KM key definitions after first collect validate and optimization.
  * km is compared against an existing km1.
  * if identical, km1 flow_type is returned
  */
-int km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1);
+int nthw_km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1);
 
-int km_rcp_set(struct km_flow_def_s *km, int index);
+int nthw_km_rcp_set(struct km_flow_def_s *km, int index);
 
-int km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color);
-int km_clear_data_match_entry(struct km_flow_def_s *km);
+int nthw_km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color);
+int nthw_km_clear_data_match_entry(struct km_flow_def_s *km);
 
-void kcc_free_ndev_resource_management(void **handle);
+void nthw_kcc_free_ndev_resource_mgmnt(void **handle);
 
 /*
  * Group management
drivers/net/ntnic/nthw/flow_api/flow_api.c +2 -2
index 4c7bb4a60a..4d1c9c8d7c 100644
@@ -478,8 +478,8 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev)
 
 	profile_inline_ops->nthw_done_flow_mgmnt_of_ndev_profile_inline(ndev);
 
-	km_free_ndev_resource_management(&ndev->km_res_handle);
-	kcc_free_ndev_resource_management(&ndev->kcc_res_handle);
+	nthw_km_free_ndev_resource_management(&ndev->km_res_handle);
+	nthw_kcc_free_ndev_resource_mgmnt(&ndev->kcc_res_handle);
 
 	ndev->flow_unique_id_counter = 0;
 
drivers/net/ntnic/nthw/flow_api/flow_kcc.c +1 -1
index e99e63d9f1..47311729ea 100644
@@ -8,7 +8,7 @@
 #include "hw_mod_backend.h"
 #include "flow_api_engine.h"
 
-void kcc_free_ndev_resource_management(void **handle)
+void nthw_kcc_free_ndev_resource_mgmnt(void **handle)
 {
 	if (*handle) {
 		free(*handle);
drivers/net/ntnic/nthw/flow_api/flow_km.c +8 -8
index 1052773668..4ccd77895b 100644
@@ -73,7 +73,7 @@ struct tcam_distrib_s {
 
 static int tcam_find_mapping(struct km_flow_def_s *km);
 
-void km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle)
+void nthw_km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle)
 {
 	/*
 	 * KM entries occupied in CAM - to manage the cuckoo shuffling
@@ -100,7 +100,7 @@ void km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle)
 	nthw_init_hasher(km->hsh, km->be->km.nb_cam_banks, km->be->km.nb_cam_records);
 }
 
-void km_free_ndev_resource_management(void **handle)
+void nthw_km_free_ndev_resource_management(void **handle)
 {
 	if (*handle) {
 		free(*handle);
@@ -110,7 +110,7 @@ void km_free_ndev_resource_management(void **handle)
 	*handle = NULL;
 }
 
-int km_add_match_elem(struct km_flow_def_s *km, uint32_t e_word[4], uint32_t e_mask[4],
+int nthw_km_add_match_elem(struct km_flow_def_s *km, uint32_t e_word[4], uint32_t e_mask[4],
 	uint32_t word_len, enum frame_offs_e start_id, int8_t offset)
 {
 	/* valid word_len 1,2,4 */
@@ -173,7 +173,7 @@ static int get_word(struct km_flow_def_s *km, uint32_t size, int marked[])
 	return -1;
 }
 
-int km_key_create(struct km_flow_def_s *km, uint32_t port_id)
+int nthw_km_key_create(struct km_flow_def_s *km, uint32_t port_id)
 {
 	/*
 	 * Create combined extractor mappings
@@ -377,7 +377,7 @@ int km_key_create(struct km_flow_def_s *km, uint32_t port_id)
 	return 0;
 }
 
-int km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1)
+int nthw_km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1)
 {
 	if (km->target != km1->target || km->num_ftype_elem != km1->num_ftype_elem ||
 		km->key_word_size != km1->key_word_size || km->info_set != km1->info_set)
@@ -473,7 +473,7 @@ int km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1)
 	return km1->flow_type;
 }
 
-int km_rcp_set(struct km_flow_def_s *km, int index)
+int nthw_km_rcp_set(struct km_flow_def_s *km, int index)
 {
 	int qw = 0;
 	int sw = 0;
@@ -1101,7 +1101,7 @@ static int tcam_reset_entry(struct km_flow_def_s *km)
 	return err;
 }
 
-int km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color)
+int nthw_km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color)
 {
 	int res = -1;
 
@@ -1125,7 +1125,7 @@ int km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color)
 	return res;
 }
 
-int km_clear_data_match_entry(struct km_flow_def_s *km)
+int nthw_km_clear_data_match_entry(struct km_flow_def_s *km)
 {
 	int res = 0;
 
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +55 -44

297 lines not on this page · raw message

Signature · 1 line
2.45.0
#70 lore raw

PATCH 18/24 net/ntnic: change prefix set to prefix nthw

In reply to Serhii Iliushyk

Change setter functions prefix from set_ to nthw_set_ for DBS module

---
 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 50 +++++++++----------
 drivers/net/ntnic/include/ntnic_dbs.h         | 22 ++++----
 drivers/net/ntnic/nthw/dbs/nthw_dbs.c         | 22 ++++----
 3 files changed, 47 insertions(+), 47 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +25 -25
index 7b2e2e53fc..3257233545 100644
@@ -198,7 +198,7 @@ static void dbs_init_tx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t s
 		nthw_get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
 	} while (busy != 0);
 
-	set_tx_init(p_nthw_dbs, start_idx, start_ptr, INIT_QUEUE, queue);
+	nthw_set_tx_init(p_nthw_dbs, start_idx, start_ptr, INIT_QUEUE, queue);
 
 	do {
 		nthw_get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
@@ -221,14 +221,14 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)
 	if (p_nthw_dbs == NULL)
 		return -1;
 
-	res = dbs_init(NULL, p_fpga, 0);/* Check that DBS exists in FPGA */
+	res = nthw_dbs_init(NULL, p_fpga, 0);/* Check that DBS exists in FPGA */
 
 	if (res) {
 		free(p_nthw_dbs);
 		return res;
 	}
 
-	res = dbs_init(p_nthw_dbs, p_fpga, 0);	/* Create DBS module */
+	res = nthw_dbs_init(p_nthw_dbs, p_fpga, 0);	/* Create DBS module */
 
 	if (res) {
 		free(p_nthw_dbs);
@@ -242,7 +242,7 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)
 		txvq[i].usage = NTHW_VIRTQ_UNUSED;
 	}
 
-	dbs_reset(p_nthw_dbs);
+	nthw_dbs_reset(p_nthw_dbs);
 
 	for (i = 0; i < NT_DBS_RX_QUEUES_MAX; ++i)
 		dbs_init_rx_queue(p_nthw_dbs, i, 0, 0);
@@ -382,8 +382,8 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 * 3. Configure the DBS.RX_DR_DATA memory; good idea to initialize all
 	 * DBS_RX_QUEUES entries.
 	 */
-	if (set_rx_dr_data(p_nthw_dbs, index, (uint64_t)desc_struct_phys_addr, host_id, qs, header,
-			0) != 0) {
+	if (nthw_set_rx_dr_data(p_nthw_dbs, index, (uint64_t)desc_struct_phys_addr,
+		host_id, qs, header, 0) != 0) {
 		return NULL;
 	}
 
@@ -398,9 +398,9 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	int_enable = 0;
 	vec = 0;
 	istk = 0;
-	NT_LOG_DBGX(DBG, NTNIC, "set_rx_uw_data int=0 irq_vector=%i", irq_vector);
+	NT_LOG_DBGX(DBG, NTNIC, "nthw_set_rx_uw_data int=0 irq_vector=%i", irq_vector);
 
-	if (set_rx_uw_data(p_nthw_dbs, index,
+	if (nthw_set_rx_uw_data(p_nthw_dbs, index,
 			(uint64_t)used_struct_phys_addr,
 			host_id, qs, 0, int_enable, vec, istk) != 0) {
 		return NULL;
@@ -414,7 +414,7 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 *    at a later time (after we have enabled vfio interrupts in the kernel).
 	 */
 	if (irq_vector < 0) {
-		if (set_rx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr,
+		if (nthw_set_rx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr,
 				RX_AM_DISABLE, host_id, 0,
 				0) != 0) {
 			return NULL;
@@ -432,7 +432,7 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 *  good idea to initialize all DBS_RX_QUEUES entries.
 	 */
 	uint32_t enable = rx_deferred_start ? RX_AM_DISABLE : RX_AM_ENABLE;
-	if (set_rx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr, enable,
+	if (nthw_set_rx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr, enable,
 			host_id, 0, irq_vector >= 0 ? 1 : 0) != 0) {
 		return NULL;
 	}
@@ -520,7 +520,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)
 	/* Clear UW */
 	rxvq->used_struct_phys_addr = NULL;
 
-	if (set_rx_uw_data(p_nthw_dbs, rxvq->index, (uint64_t)rxvq->used_struct_phys_addr,
+	if (nthw_set_rx_uw_data(p_nthw_dbs, rxvq->index, (uint64_t)rxvq->used_struct_phys_addr,
 			rxvq->host_id, 0, PACKED(rxvq->vq_type), 0, 0, 0) != 0) {
 		return -1;
 	}
@@ -528,7 +528,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)
 	/* Disable AM */
 	rxvq->am_enable = RX_AM_DISABLE;
 
-	if (set_rx_am_data(p_nthw_dbs,
+	if (nthw_set_rx_am_data(p_nthw_dbs,
 			rxvq->index,
 			(uint64_t)rxvq->avail_struct_phys_addr,
 			rxvq->am_enable,
@@ -546,7 +546,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)
 	rxvq->avail_struct_phys_addr = NULL;
 	rxvq->host_id = 0;
 
-	if (set_rx_am_data(p_nthw_dbs,
+	if (nthw_set_rx_am_data(p_nthw_dbs,
 			rxvq->index,
 			(uint64_t)rxvq->avail_struct_phys_addr,
 			rxvq->am_enable,
@@ -558,7 +558,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)
 	/* Clear DR */
 	rxvq->desc_struct_phys_addr = NULL;
 
-	if (set_rx_dr_data(p_nthw_dbs,
+	if (nthw_set_rx_dr_data(p_nthw_dbs,
 			rxvq->index,
 			(uint64_t)rxvq->desc_struct_phys_addr,
 			rxvq->host_id,
@@ -602,7 +602,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)
 	/* Clear UW */
 	txvq->used_struct_phys_addr = NULL;
 
-	if (set_tx_uw_data(p_nthw_dbs, txvq->index, (uint64_t)txvq->used_struct_phys_addr,
+	if (nthw_set_tx_uw_data(p_nthw_dbs, txvq->index, (uint64_t)txvq->used_struct_phys_addr,
 			txvq->host_id, 0, PACKED(txvq->vq_type), 0, 0, 0,
 			txvq->in_order) != 0) {
 		return -1;
@@ -611,7 +611,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)
 	/* Disable AM */
 	txvq->am_enable = TX_AM_DISABLE;
 
-	if (set_tx_am_data(p_nthw_dbs,
+	if (nthw_set_tx_am_data(p_nthw_dbs,
 			txvq->index,
 			(uint64_t)txvq->avail_struct_phys_addr,
 			txvq->am_enable,
@@ -629,7 +629,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)
 	txvq->avail_struct_phys_addr = NULL;
 	txvq->host_id = 0;
 
-	if (set_tx_am_data(p_nthw_dbs,
+	if (nthw_set_tx_am_data(p_nthw_dbs,
 			txvq->index,
 			(uint64_t)txvq->avail_struct_phys_addr,
 			txvq->am_enable,
@@ -644,7 +644,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)
 	txvq->port = 0;
 	txvq->header = 0;
 
-	if (set_tx_dr_data(p_nthw_dbs,
+	if (nthw_set_tx_dr_data(p_nthw_dbs,
 			txvq->index,
 			(uint64_t)txvq->desc_struct_phys_addr,
 			txvq->host_id,
@@ -713,8 +713,8 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 * 3. Configure the DBS.TX_DR_DATA memory; good idea to initialize all
 	 *    DBS_TX_QUEUES entries.
 	 */
-	if (set_tx_dr_data(p_nthw_dbs, index, (uint64_t)desc_struct_phys_addr, host_id, qs, port,
-			header, 0) != 0) {
+	if (nthw_set_tx_dr_data(p_nthw_dbs, index, (uint64_t)desc_struct_phys_addr,
+			host_id, qs, port, header, 0) != 0) {
 		return NULL;
 	}
 
@@ -730,7 +730,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	vec = 0;
 	istk = 0;
 
-	if (set_tx_uw_data(p_nthw_dbs, index,
+	if (nthw_set_tx_uw_data(p_nthw_dbs, index,
 			(uint64_t)used_struct_phys_addr,
 			host_id, qs, 0, int_enable, vec, istk, in_order) != 0) {
 		return NULL;
@@ -740,7 +740,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 * 2. Configure the DBS.TX_AM_DATA memory and enable the queues you plan to use;
 	 *    good idea to initialize all DBS_TX_QUEUES entries.
 	 */
-	if (set_tx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr, TX_AM_DISABLE,
+	if (nthw_set_tx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr, TX_AM_DISABLE,
 			host_id, 0, irq_vector >= 0 ? 1 : 0) != 0) {
 		return NULL;
 	}
@@ -764,7 +764,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 	 */
 	if (irq_vector < 0) {
 		uint32_t enable = tx_deferred_start ? TX_AM_DISABLE : TX_AM_ENABLE;
-		if (set_tx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr,
+		if (nthw_set_tx_am_data(p_nthw_dbs, index, (uint64_t)avail_struct_phys_addr,
 				enable, host_id, 0, 0) != 0) {
 			return NULL;
 		}
@@ -1127,12 +1127,12 @@ nthw_setup_mngd_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,
 
 static int nthw_switch_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, uint32_t index, uint32_t enable)
 {
-	return set_rx_am_data_enable(p_nthw_dbs, index, enable);
+	return nthw_set_rx_am_data_enable(p_nthw_dbs, index, enable);
 }
 
 static int nthw_switch_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, uint32_t index, uint32_t enable)
 {
-	return set_tx_am_data_enable(p_nthw_dbs, index, enable);
+	return nthw_set_tx_am_data_enable(p_nthw_dbs, index, enable);
 }
 
 static uint16_t nthw_get_rx_packets(struct nthw_virt_queue *rxvq,
drivers/net/ntnic/include/ntnic_dbs.h +11 -11
index c35a7cb99b..3de7206ccb 100644
@@ -233,8 +233,8 @@ struct nthw_dbs_s {
 typedef struct nthw_dbs_s nthw_dbs_t;
 
 nthw_dbs_t *nthw_dbs_new(void);
-int dbs_init(nthw_dbs_t *p, nthw_fpga_t *p_fpga, int n_instance);
-void dbs_reset(nthw_dbs_t *p);
+int nthw_dbs_init(nthw_dbs_t *p, nthw_fpga_t *p_fpga, int n_instance);
+void nthw_dbs_reset(nthw_dbs_t *p);
 
 int nthw_set_rx_control(nthw_dbs_t *p,
 	uint32_t last_queue,
@@ -253,30 +253,30 @@ int nthw_set_tx_control(nthw_dbs_t *p,
 int nthw_set_rx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
 	uint32_t queue);
 int nthw_get_rx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
-int set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
+int nthw_set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
 	uint32_t queue);
 int nthw_get_tx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy);
 int nthw_set_rx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
 int nthw_get_rx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
 int nthw_set_tx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue);
 int nthw_get_tx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy);
-int set_rx_am_data(nthw_dbs_t *p,
+int nthw_set_rx_am_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t enable,
 	uint32_t host_id,
 	uint32_t packed,
 	uint32_t int_enable);
-int set_rx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable);
-int set_tx_am_data(nthw_dbs_t *p,
+int nthw_set_rx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable);
+int nthw_set_tx_am_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t enable,
 	uint32_t host_id,
 	uint32_t packed,
 	uint32_t int_enable);
-int set_tx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable);
-int set_rx_uw_data(nthw_dbs_t *p,
+int nthw_set_tx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable);
+int nthw_set_rx_uw_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
@@ -285,7 +285,7 @@ int set_rx_uw_data(nthw_dbs_t *p,
 	uint32_t int_enable,
 	uint32_t vec,
 	uint32_t istk);
-int set_tx_uw_data(nthw_dbs_t *p,
+int nthw_set_tx_uw_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
@@ -295,14 +295,14 @@ int set_tx_uw_data(nthw_dbs_t *p,
 	uint32_t vec,
 	uint32_t istk,
 	uint32_t in_order);
-int set_rx_dr_data(nthw_dbs_t *p,
+int nthw_set_rx_dr_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
 	uint32_t queue_size,
 	uint32_t header,
 	uint32_t packed);
-int set_tx_dr_data(nthw_dbs_t *p,
+int nthw_set_tx_dr_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +11 -11
index da64dbab48..25989d170b 100644
@@ -76,7 +76,7 @@ nthw_dbs_t *nthw_dbs_new(void)
 	return p;
 }
 
-int dbs_init(nthw_dbs_t *p, nthw_fpga_t *p_fpga, int n_instance)
+int nthw_dbs_init(nthw_dbs_t *p, nthw_fpga_t *p_fpga, int n_instance)
 {
 	nthw_module_t *mod = nthw_fpga_query_module(p_fpga, MOD_DBS, n_instance);
 
@@ -369,7 +369,7 @@ static int dbs_reset_tx_control(nthw_dbs_t *p)
 	return 0;
 }
 
-void dbs_reset(nthw_dbs_t *p)
+void nthw_dbs_reset(nthw_dbs_t *p)
 {
 	int i;
 	dbs_reset_rx_control(p);
@@ -462,7 +462,7 @@ int nthw_get_rx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *b
 	return 0;
 }
 
-int set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
+int nthw_set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_t init,
 	uint32_t queue)
 {
 	if (p->mp_reg_tx_init_val) {
@@ -601,7 +601,7 @@ static void flush_rx_am_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_rx_avail_monitor_data, 1);
 }
 
-int set_rx_am_data(nthw_dbs_t *p,
+int nthw_set_rx_am_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t enable,
@@ -618,7 +618,7 @@ int set_rx_am_data(nthw_dbs_t *p,
 	return 0;
 }
 
-int set_rx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable)
+int nthw_set_rx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable)
 {
 	if (!p->mp_reg_rx_avail_monitor_data)
 		return -ENOTSUP;
@@ -673,7 +673,7 @@ static void flush_tx_am_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_tx_avail_monitor_data, 1);
 }
 
-int set_tx_am_data(nthw_dbs_t *p,
+int nthw_set_tx_am_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t enable,
@@ -690,7 +690,7 @@ int set_tx_am_data(nthw_dbs_t *p,
 	return 0;
 }
 
-int set_tx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable)
+int nthw_set_tx_am_data_enable(nthw_dbs_t *p, uint32_t index, uint32_t enable)
 {
 	if (!p->mp_reg_tx_avail_monitor_data)
 		return -ENOTSUP;
@@ -796,7 +796,7 @@ static void flush_rx_uw_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_rx_used_writer_data, 1);
 }
 
-int set_rx_uw_data(nthw_dbs_t *p,
+int nthw_set_rx_uw_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
@@ -923,7 +923,7 @@ static void flush_tx_uw_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_tx_used_writer_data, 1);
 }
 
-int set_tx_uw_data(nthw_dbs_t *p,
+int nthw_set_tx_uw_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
@@ -1019,7 +1019,7 @@ static void flush_rx_dr_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_rx_descriptor_reader_data, 1);
 }
 
-int set_rx_dr_data(nthw_dbs_t *p,
+int nthw_set_rx_dr_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
@@ -1121,7 +1121,7 @@ static void flush_tx_dr_data(nthw_dbs_t *p, uint32_t index)
 	nthw_register_flush(p->mp_reg_tx_descriptor_reader_data, 1);
 }
 
-int set_tx_dr_data(nthw_dbs_t *p,
+int nthw_set_tx_dr_data(nthw_dbs_t *p,
 	uint32_t index,
 	uint64_t guest_physical_address,
 	uint32_t host_id,
Signature · 1 line
2.45.0
#71 lore raw

PATCH 19/24 net/ntnic: rename common hash and flow functions

In reply to Serhii Iliushyk

Rename common hash and flow functions to have consistent naming convention.

---
 drivers/net/ntnic/include/flow_api.h                 |  8 ++++----
 drivers/net/ntnic/nthw/flow_api/flow_api.c           | 12 ++++++------
 drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c       |  8 ++++----
 drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h       |  2 +-
 .../flow_api/profile_inline/flow_api_hw_db_inline.c  |  4 ++--
 .../profile_inline/flow_api_profile_inline.c         |  2 +-
 drivers/net/ntnic/ntnic_ethdev.c                     |  2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)
drivers/net/ntnic/include/flow_api.h +4 -4
index 582de3b281..869158258e 100644
@@ -56,7 +56,7 @@ struct nt_eth_rss_conf {
 	enum rte_eth_hash_function algorithm;
 };
 
-int sprint_nt_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask);
+int nthw_sprint_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask);
 
 struct flow_eth_dev {
 	/* NIC that owns this port device */
@@ -171,7 +171,7 @@ void nthw_flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error
  * Resources
  */
 
-extern const char *dbg_res_descr[];
+extern const char *nthw_dbg_res_descr[];
 
 #define flow_nic_set_bit(arr, x)                                                                  \
 	do {                                                                                      \
@@ -199,7 +199,7 @@ extern const char *dbg_res_descr[];
 		typeof(res_type) _temp_res_type = (res_type);                                     \
 		size_t _temp_index = (index);                                                     \
 		NT_LOG(DBG, FILTER, "mark resource used: %s idx %zu",                             \
-		       dbg_res_descr[_temp_res_type], _temp_index);                               \
+		       nthw_dbg_res_descr[_temp_res_type], _temp_index);                          \
 		RTE_ASSERT(flow_nic_is_bit_set(_temp_ndev->res[_temp_res_type].alloc_bm,          \
 					   _temp_index) == 0);                                    \
 		flow_nic_set_bit(_temp_ndev->res[_temp_res_type].alloc_bm, _temp_index);          \
@@ -210,7 +210,7 @@ extern const char *dbg_res_descr[];
 		typeof(res_type) _temp_res_type = (res_type);                                 \
 		size_t _temp_index = (index);                                                     \
 		NT_LOG(DBG, FILTER, "mark resource unused: %s idx %zu",                         \
-		       dbg_res_descr[_temp_res_type], _temp_index);                               \
+		       nthw_dbg_res_descr[_temp_res_type], _temp_index);                          \
 		flow_nic_unset_bit((_ndev)->res[_temp_res_type].alloc_bm, _temp_index);           \
 	} while (0)
 
drivers/net/ntnic/nthw/flow_api/flow_api.c +6 -6
index 4d1c9c8d7c..dee2ee137a 100644
@@ -18,7 +18,7 @@
 		name, #name   \
 	}
 
-const char *dbg_res_descr[] = {
+const char *nthw_dbg_res_descr[] = {
 	[RES_QUEUE] = "RES_QUEUE",
 	[RES_CAT_CFN] = "RES_CAT_CFN",
 	[RES_CAT_COT] = "RES_CAT_COT",
@@ -41,7 +41,7 @@ const char *dbg_res_descr[] = {
 	[RES_INVALID] = "RES_INVALID",
 };
 
-static_assert(RTE_DIM(dbg_res_descr) == RES_END,
+static_assert(RTE_DIM(nthw_dbg_res_descr) == RES_END,
 	"The list of debug descriptions is not fully completed");
 
 static struct flow_nic_dev *dev_base;
@@ -212,7 +212,7 @@ void nthw_flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_
 int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index)
 {
 	NT_LOG(DBG, FILTER, "Reference resource %s idx %i (before ref cnt %" PRIu32 ")",
-		dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);
+		nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);
 	RTE_ASSERT(flow_nic_is_resource_used(ndev, res_type, index));
 
 	if (ndev->res[res_type].ref[index] == (uint32_t)-1)
@@ -225,7 +225,7 @@ int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_ty
 int nthw_flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, int index)
 {
 	NT_LOG(DBG, FILTER, "De-reference resource %s idx %i (before ref cnt %" PRIu32 ")",
-		dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);
+		nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);
 	RTE_ASSERT(flow_nic_is_resource_used(ndev, res_type, index));
 	RTE_ASSERT(ndev->res[res_type].ref[index]);
 	/* deref */
@@ -494,7 +494,7 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev)
 
 	for (unsigned int i = 0; i < RES_COUNT; i++) {
 		int err = 0;
-		NT_LOG(DBG, FILTER, "RES state for: %s", dbg_res_descr[i]);
+		NT_LOG(DBG, FILTER, "RES state for: %s", nthw_dbg_res_descr[i]);
 
 		for (unsigned int ii = 0; ii < ndev->res[i].resource_count; ii++) {
 			int ref = ndev->res[i].ref[ii];
@@ -983,7 +983,7 @@ static struct rss_type_info rss_to_string[] = {
 	RSS_TO_STRING(RTE_ETH_RSS_L3_SRC_ONLY),
 };
 
-int sprint_nt_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask)
+int nthw_sprint_rss_mask(char *str, uint16_t str_len, const char *prefix, uint64_t hash_mask)
 {
 	if (str == NULL || str_len == 0)
 		return -1;
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c +4 -4
index 76ff79cbe1..9a7069194b 100644
@@ -130,7 +130,7 @@ static __rte_always_inline void unset_bits_and_log(uint64_t *hash_mask, uint64_t
 	char rss_buffer[4096];
 	uint16_t rss_buffer_len = sizeof(rss_buffer);
 
-	if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", *hash_mask & hash_bits) == 0)
+	if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", *hash_mask & hash_bits) == 0)
 		NT_LOG(DBG, FILTER, "Configured RSS types:%s", rss_buffer);
 	unset_bits(hash_mask, hash_bits);
 }
@@ -141,14 +141,14 @@ static __rte_always_inline void unset_bits_if_all_enabled(uint64_t *hash_mask, u
 		unset_bits(hash_mask, hash_bits);
 }
 
-int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_conf)
+int nthw_hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_conf)
 {
 	uint64_t fields = rss_conf.rss_hf;
 
 	char rss_buffer[4096];
 	uint16_t rss_buffer_len = sizeof(rss_buffer);
 
-	if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", fields) == 0)
+	if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", fields) == 0)
 		NT_LOG(DBG, FILTER, "Requested RSS types:%s", rss_buffer);
 
 	/*
@@ -645,7 +645,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c
 
 	if (fields || res != 0) {
 		nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_PRESET_ALL, hsh_idx, 0, 0);
-		if (sprint_nt_rss_mask(rss_buffer, rss_buffer_len, " ", rss_conf.rss_hf) == 0) {
+		if (nthw_sprint_rss_mask(rss_buffer, rss_buffer_len, " ", rss_conf.rss_hf) == 0) {
 			NT_LOG(ERR, FILTER, "RSS configuration%s is not supported for hash func %s.",
 				rss_buffer, (enum rte_eth_hash_function)toeplitz ?
 					"Toeplitz" : "NTH10");
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h +1 -1
index 38901b3e8a..124225c455 100644
@@ -11,7 +11,7 @@
 #include "hw_mod_backend.h"
 #include "flow_api.h"
 
-int hsh_set(struct flow_nic_dev *ndev, int hsh_idx,
+int nthw_hsh_set(struct flow_nic_dev *ndev, int hsh_idx,
 	struct nt_eth_rss_conf rss_conf);
 
 #endif /* _FLOW_HSH_CFG_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +2 -2
index b1a2d9dfa3..5de4f6bae7 100644
@@ -598,7 +598,7 @@ void nthw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const struc
 			fprintf(file, "      %016lx\n", data->hash_mask);
 
 			/* convert hash mask to human readable RTE_ETH_RSS_* form if possible */
-			if (sprint_nt_rss_mask(str_buffer, rss_buffer_len, "\n      ",
+			if (nthw_sprint_rss_mask(str_buffer, rss_buffer_len, "\n      ",
 					data->hash_mask) == 0) {
 				fprintf(file, "    Hash mask flags:%s\n", str_buffer);
 			}
@@ -2830,7 +2830,7 @@ struct hw_db_hsh_idx nthw_db_inline_hsh_add(struct flow_nic_dev *ndev, void *db_
 	tmp_rss_conf.rss_hf = data->hash_mask;
 	memcpy(tmp_rss_conf.rss_key, data->key, MAX_RSS_KEY_LEN);
 	tmp_rss_conf.algorithm = data->func;
-	int res = hsh_set(ndev, idx.ids, tmp_rss_conf);
+	int res = nthw_hsh_set(ndev, idx.ids, tmp_rss_conf);
 
 	if (res != 0) {
 		idx.error = 1;
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
index e0cdd12626..a1f9e3addf 100644
@@ -3977,7 +3977,7 @@ int nthw_init_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev)
 			.rss_hf = RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_PORT,
 			.algorithm = 0,
 		};
-		hsh_set(ndev, 0, hsh_5_tuple);
+		nthw_hsh_set(ndev, 0, hsh_5_tuple);
 		nthw_mod_hsh_rcp_flush(&ndev->be, 0, 1);
 
 		flow_nic_mark_resource_used(ndev, RES_HSH_RCP, 0);
drivers/net/ntnic/ntnic_ethdev.c +1 -1
index 1c26411da8..906e55de7c 100644
@@ -1770,7 +1770,7 @@ static int eth_dev_rss_hash_update(struct rte_eth_dev *eth_dev, struct rte_eth_r
 	tmp_rss_conf.algorithm = rss_conf->algorithm;
 
 	tmp_rss_conf.rss_hf = rss_conf->rss_hf;
-	int res = hsh_set(ndev, hsh_idx, tmp_rss_conf);
+	int res = nthw_hsh_set(ndev, hsh_idx, tmp_rss_conf);
 
 	if (res == 0) {
 		flow_filter_ops->nthw_mod_hsh_rcp_flush(&ndev->be, hsh_idx, 1);
Signature · 1 line
2.45.0
#72 lore raw

PATCH 20/24 net/ntnic: rename register ops function

In reply to Serhii Iliushyk

Add prefix nthw_ to register ops function to follow naming convention.

---
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |  2 +-
 .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c |  2 +-
 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c |  2 +-
 .../link_mgmt/link_100g/nt4ga_link_100g.c     |  2 +-
 .../link_agx_100g/nt4ga_agx_link_100g.c       |  2 +-
 drivers/net/ntnic/link_mgmt/nt4ga_link.c      |  2 +-
 .../net/ntnic/nthw/core/include/nthw_fpga.h   |  4 +-
 .../clock_profiles/nthw_fpga_clk9563.c        |  2 +-
 .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c   |  2 +-
 .../core/nt200a0x/reset/nthw_fpga_rst9563.c   |  2 +-
 .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c   |  2 +-
 .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c   |  2 +-
 .../core/nt400dxx/reset/nthw_fpga_rst9574.c   |  2 +-
 .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c   |  2 +-
 drivers/net/ntnic/nthw/core/nthw_fpga.c       |  4 +-
 drivers/net/ntnic/nthw/flow_api/flow_api.c    |  2 +-
 .../nthw/flow_api/flow_backend/flow_backend.c |  2 +-
 .../profile_inline/flow_api_profile_inline.c  |  2 +-
 .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c  |  2 +-
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c |  6 +--
 drivers/net/ntnic/ntnic_mod_reg.c             | 38 +++++++++----------
 drivers/net/ntnic/ntnic_mod_reg.h             | 38 +++++++++----------
 drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c |  2 +-
 23 files changed, 63 insertions(+), 63 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +1 -1
index 98725879b9..5295387fa8 100644
@@ -283,5 +283,5 @@ static const struct adapter_ops ops = {
 
 void nthw_adapter_init(void)
 {
-	register_adapter_ops(&ops);
+	nthw_reg_adapter_ops(&ops);
 }
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
index 9d0d77dcc8..aca88c6635 100644
@@ -596,5 +596,5 @@ static struct nt4ga_stat_ops ops = {
 void nt4ga_stat_ops_init(void)
 {
 	NT_LOG_DBGX(DBG, NTNIC, "Stat module was initialized");
-	register_nt4ga_stat_ops(&ops);
+	nthw_reg_nt4ga_stat_ops(&ops);
 }
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +1 -1
index 3257233545..0fa597d777 100644
@@ -1451,5 +1451,5 @@ static struct sg_ops_s sg_ops = {
 void nthw_sg_init(void)
 {
 	NT_LOG(INF, NTNIC, "SG ops initialized");
-	register_sg_ops(&sg_ops);
+	nthw_reg_sg_ops(&sg_ops);
 }
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +1 -1
index 2c7a88aed9..914d1c206c 100644
@@ -747,5 +747,5 @@ static struct link_ops_s link_100g_ops = {
 
 void nthw_link_100g_init(void)
 {
-	register_100g_link_ops(&link_100g_ops);
+	nthw_reg_100g_link_ops(&link_100g_ops);
 }
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
index b700a9e76e..1387bb4148 100644
@@ -37,7 +37,7 @@ static struct link_ops_s link_agx_100g_ops = {
 
 void link_agx_100g_init(void)
 {
-	register_agx_100g_link_ops(&link_agx_100g_ops);
+	nthw_reg_agx_100g_link_ops(&link_agx_100g_ops);
 }
 
 /*
drivers/net/ntnic/link_mgmt/nt4ga_link.c +1 -1
index 5ddbb9f1fd..5e6be42398 100644
@@ -210,5 +210,5 @@ static const struct port_ops ops = {
 
 void nthw_port_init(void)
 {
-	register_port_ops(&ops);
+	nthw_reg_port_ops(&ops);
 }
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
index fb47807a2f..b86865b24f 100644
@@ -32,7 +32,7 @@ struct nt200a0x_ops {
 	int (*nthw_fpga_nt200a0x_init)(struct fpga_info_s *p_fpga_info);
 };
 
-void register_nt200a0x_ops(struct nt200a0x_ops *ops);
+void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops);
 struct nt200a0x_ops *get_nt200a0x_ops(void);
 void nt200a0x_ops_init(void);
 
@@ -40,7 +40,7 @@ struct nt400dxx_ops {
 	int (*nthw_fpga_nt400dxx_init)(struct fpga_info_s *p_fpga_info);
 };
 
-void register_nt400dxx_ops(struct nt400dxx_ops *ops);
+void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops);
 struct nt400dxx_ops *get_nt400dxx_ops(void);
 void nt400dxx_ops_init(void);
 
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c +1 -1
index e50094c6fa..eeca816899 100644
@@ -35,7 +35,7 @@ static struct clk9563_ops ops = { .get_n_data_9563_si5340_nt200a02_u23_v5 =
 
 void clk9563_ops_init(void)
 {
-	register_clk9563_ops(&ops);
+	nthw_reg_clk9563_ops(&ops);
 }
 
 #undef si5340_revd_registers
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
index bf7a2760a4..739b1aab85 100644
@@ -72,5 +72,5 @@ static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga
 void nt200a0x_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "NT200A0X OPS INIT");
-	register_nt200a0x_ops(&nt200a0x_ops);
+	nthw_reg_nt200a0x_ops(&nt200a0x_ops);
 }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +1 -1
index 918ac71a43..a345f163bb 100644
@@ -236,5 +236,5 @@ static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rs
 void rst9563_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "RST9563 OPS INIT");
-	register_rst9563_ops(&rst9563_ops);
+	nthw_reg_rst9563_ops(&rst9563_ops);
 }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
index 34527b0cca..4a2fca5f19 100644
@@ -578,5 +578,5 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_init
 void rst_nt200a0x_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "RST NT200A0X OPS INIT");
-	register_rst_nt200a0x_ops(&rst_nt200a0x_ops);
+	nthw_reg_rst_nt200a0x_ops(&rst_nt200a0x_ops);
 }
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +1 -1
index e7c9fec10d..234da0da33 100644
@@ -215,5 +215,5 @@ static struct nt400dxx_ops nt400dxx_ops = { .nthw_fpga_nt400dxx_init = nthw_fpga
 
 void nt400dxx_ops_init(void)
 {
-	register_nt400dxx_ops(&nt400dxx_ops);
+	nthw_reg_nt400dxx_ops(&nt400dxx_ops);
 }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +1 -1
index 28769e3aa5..36d2c46fc6 100644
@@ -373,5 +373,5 @@ static struct rst9574_ops rst9574_ops = {
 
 void rst9574_ops_init(void)
 {
-	register_rst9574_ops(&rst9574_ops);
+	nthw_reg_rst9574_ops(&rst9574_ops);
 }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +1 -1
index d158135c17..67c562627d 100644
@@ -423,5 +423,5 @@ static struct rst_nt400dxx_ops rst_nt400dxx_ops = {
 
 void rst_nt400dxx_ops_init(void)
 {
-	register_rst_nt400dxx_ops(&rst_nt400dxx_ops);
+	nthw_reg_rst_nt400dxx_ops(&rst_nt400dxx_ops);
 }
drivers/net/ntnic/nthw/core/nthw_fpga.c +2 -2
index f9ae466383..f18069e492 100644
@@ -557,7 +557,7 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info)
 
 static struct nt200a0x_ops *nt200a0x_ops;
 
-void register_nt200a0x_ops(struct nt200a0x_ops *ops)
+void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops)
 {
 	nt200a0x_ops = ops;
 }
@@ -571,7 +571,7 @@ struct nt200a0x_ops *get_nt200a0x_ops(void)
 
 static struct nt400dxx_ops *nt400dxx_ops;
 
-void register_nt400dxx_ops(struct nt400dxx_ops *ops)
+void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops)
 {
 	nt400dxx_ops = ops;
 }
drivers/net/ntnic/nthw/flow_api/flow_api.c +1 -1
index dee2ee137a..b737589e14 100644
@@ -1283,5 +1283,5 @@ static const struct flow_filter_ops ops = {
 
 void nthw_init_flow_filter(void)
 {
-	register_flow_filter_ops(&ops);
+	nthw_reg_flow_filter_ops(&ops);
 }
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +1 -1
index 8144e25540..567b735f1e 100644
@@ -2277,5 +2277,5 @@ static const struct flow_backend_ops ops = {
 
 void nthw_flow_backend_init(void)
 {
-	register_flow_backend_ops(&ops);
+	nthw_reg_flow_backend_ops(&ops);
 }
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
index a1f9e3addf..3f80e0f945 100644
@@ -5446,5 +5446,5 @@ static const struct profile_inline_ops ops = {
 
 void nthw_profile_inline_init(void)
 {
-	register_profile_inline_ops(&ops);
+	nthw_reg_profile_inline_ops(&ops);
 }
drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +1 -1
index 303c2cd51a..a2c37774fe 100644
@@ -485,5 +485,5 @@ static struct meter_ops_s meter_ops = {
 void nthw_meter_init(void)
 {
 	NT_LOG(DBG, NTNIC, "Meter ops initialized");
-	register_meter_ops(&meter_ops);
+	nthw_reg_meter_ops(&meter_ops);
 }
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +3 -3
index f498551e8d..2d0d0ea54f 100644
@@ -1291,7 +1291,7 @@ static const struct ntnic_filter_ops ntnic_filter_ops = {
 
 void ntnic_filter_init(void)
 {
-	register_ntnic_filter_ops(&ntnic_filter_ops);
+	nthw_reg_filter_ops(&ntnic_filter_ops);
 }
 
 static const struct rte_flow_ops dev_flow_ops = {
@@ -1313,7 +1313,7 @@ static const struct rte_flow_ops dev_flow_ops = {
 
 void nthw_dev_flow_init(void)
 {
-	register_dev_flow_ops(&dev_flow_ops);
+	nthw_reg_dev_flow_ops(&dev_flow_ops);
 }
 
 static struct rte_flow_fp_ops async_dev_flow_ops = {
@@ -1323,5 +1323,5 @@ static struct rte_flow_fp_ops async_dev_flow_ops = {
 
 void nthw_dev_fp_flow_init(void)
 {
-	register_dev_fp_flow_ops(&async_dev_flow_ops);
+	nthw_reg_dev_fp_flow_ops(&async_dev_flow_ops);
 }
drivers/net/ntnic/ntnic_mod_reg.c +19 -19
index 36aee48818..be872aa090 100644
@@ -7,7 +7,7 @@
 
 static struct sg_ops_s *sg_ops;
 
-void register_sg_ops(struct sg_ops_s *ops)
+void nthw_reg_sg_ops(struct sg_ops_s *ops)
 {
 	sg_ops = ops;
 }
@@ -24,7 +24,7 @@ const struct sg_ops_s *get_sg_ops(void)
  */
 static struct meter_ops_s *meter_ops;
 
-void register_meter_ops(struct meter_ops_s *ops)
+void nthw_reg_meter_ops(struct meter_ops_s *ops)
 {
 	meter_ops = ops;
 }
@@ -42,7 +42,7 @@ const struct meter_ops_s *get_meter_ops(void)
  */
 static const struct ntnic_filter_ops *ntnic_filter_ops;
 
-void register_ntnic_filter_ops(const struct ntnic_filter_ops *ops)
+void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops)
 {
 	ntnic_filter_ops = ops;
 }
@@ -57,7 +57,7 @@ const struct ntnic_filter_ops *get_ntnic_filter_ops(void)
 
 static struct link_ops_s *link_100g_ops;
 
-void register_100g_link_ops(struct link_ops_s *ops)
+void nthw_reg_100g_link_ops(struct link_ops_s *ops)
 {
 	link_100g_ops = ops;
 }
@@ -74,7 +74,7 @@ const struct link_ops_s *get_100g_link_ops(void)
  */
 static struct link_ops_s *link_agx_100g_ops;
 
-void register_agx_100g_link_ops(struct link_ops_s *ops)
+void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops)
 {
 	link_agx_100g_ops = ops;
 }
@@ -88,7 +88,7 @@ const struct link_ops_s *get_agx_100g_link_ops(void)
 
 static const struct port_ops *port_ops;
 
-void register_port_ops(const struct port_ops *ops)
+void nthw_reg_port_ops(const struct port_ops *ops)
 {
 	port_ops = ops;
 }
@@ -102,7 +102,7 @@ const struct port_ops *get_port_ops(void)
 
 static const struct nt4ga_stat_ops *nt4ga_stat_ops;
 
-void register_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops)
+void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops)
 {
 	nt4ga_stat_ops = ops;
 }
@@ -117,7 +117,7 @@ const struct nt4ga_stat_ops *get_nt4ga_stat_ops(void)
 
 static const struct adapter_ops *adapter_ops;
 
-void register_adapter_ops(const struct adapter_ops *ops)
+void nthw_reg_adapter_ops(const struct adapter_ops *ops)
 {
 	adapter_ops = ops;
 }
@@ -131,7 +131,7 @@ const struct adapter_ops *get_adapter_ops(void)
 
 static struct clk9563_ops *clk9563_ops;
 
-void register_clk9563_ops(struct clk9563_ops *ops)
+void nthw_reg_clk9563_ops(struct clk9563_ops *ops)
 {
 	clk9563_ops = ops;
 }
@@ -145,7 +145,7 @@ struct clk9563_ops *get_clk9563_ops(void)
 
 static struct rst_nt200a0x_ops *rst_nt200a0x_ops;
 
-void register_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops)
+void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops)
 {
 	rst_nt200a0x_ops = ops;
 }
@@ -159,7 +159,7 @@ struct rst_nt200a0x_ops *get_rst_nt200a0x_ops(void)
 
 static struct rst9563_ops *rst9563_ops;
 
-void register_rst9563_ops(struct rst9563_ops *ops)
+void nthw_reg_rst9563_ops(struct rst9563_ops *ops)
 {
 	rst9563_ops = ops;
 }
@@ -173,14 +173,14 @@ struct rst9563_ops *get_rst9563_ops(void)
 
 static const struct flow_backend_ops *flow_backend_ops;
 
-void register_flow_backend_ops(const struct flow_backend_ops *ops)
+void nthw_reg_flow_backend_ops(const struct flow_backend_ops *ops)
 {
 	flow_backend_ops = ops;
 }
 
 static struct rst9574_ops *rst9574_ops;
 
-void register_rst9574_ops(struct rst9574_ops *ops)
+void nthw_reg_rst9574_ops(struct rst9574_ops *ops)
 {
 	rst9574_ops = ops;
 }
@@ -195,7 +195,7 @@ struct rst9574_ops *get_rst9574_ops(void)
 
 static struct rst_nt400dxx_ops *rst_nt400dxx_ops;
 
-void register_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops)
+void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops)
 {
 	rst_nt400dxx_ops = ops;
 }
@@ -218,7 +218,7 @@ const struct flow_backend_ops *get_flow_backend_ops(void)
 
 static const struct profile_inline_ops *profile_inline_ops;
 
-void register_profile_inline_ops(const struct profile_inline_ops *ops)
+void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops)
 {
 	profile_inline_ops = ops;
 }
@@ -233,7 +233,7 @@ const struct profile_inline_ops *get_profile_inline_ops(void)
 
 static const struct flow_filter_ops *flow_filter_ops;
 
-void register_flow_filter_ops(const struct flow_filter_ops *ops)
+void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops)
 {
 	flow_filter_ops = ops;
 }
@@ -248,7 +248,7 @@ const struct flow_filter_ops *get_flow_filter_ops(void)
 
 static const struct rte_flow_fp_ops *dev_fp_flow_ops;
 
-void register_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops)
+void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops)
 {
 	dev_fp_flow_ops = ops;
 }
@@ -263,7 +263,7 @@ const struct rte_flow_fp_ops *get_dev_fp_flow_ops(void)
 
 static const struct rte_flow_ops *dev_flow_ops;
 
-void register_dev_flow_ops(const struct rte_flow_ops *ops)
+void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops)
 {
 	dev_flow_ops = ops;
 }
@@ -278,7 +278,7 @@ const struct rte_flow_ops *get_dev_flow_ops(void)
 
 static struct ntnic_xstats_ops *ntnic_xstats_ops;
 
-void register_ntnic_xstats_ops(struct ntnic_xstats_ops *ops)
+void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops)
 {
 	ntnic_xstats_ops = ops;
 }
drivers/net/ntnic/ntnic_mod_reg.h +19 -19
index 59eb5ab69f..26c8723afa 100644
@@ -119,7 +119,7 @@ struct sg_ops_s {
 	int (*nthw_virt_queue_init)(struct fpga_info_s *p_fpga_info);
 };
 
-void register_sg_ops(struct sg_ops_s *ops);
+void nthw_reg_sg_ops(struct sg_ops_s *ops);
 const struct sg_ops_s *get_sg_ops(void);
 void nthw_sg_init(void);
 
@@ -128,7 +128,7 @@ struct meter_ops_s {
 	int (*eth_mtr_ops_get)(struct rte_eth_dev *eth_dev, void *ops);
 };
 
-void register_meter_ops(struct meter_ops_s *ops);
+void nthw_reg_meter_ops(struct meter_ops_s *ops);
 const struct meter_ops_s *get_meter_ops(void);
 void nthw_meter_init(void);
 
@@ -139,7 +139,7 @@ struct ntnic_filter_ops {
 	int (*poll_statistics)(struct pmd_internals *internals);
 };
 
-void register_ntnic_filter_ops(const struct ntnic_filter_ops *ops);
+void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops);
 const struct ntnic_filter_ops *get_ntnic_filter_ops(void);
 void ntnic_filter_init(void);
 
@@ -147,11 +147,11 @@ struct link_ops_s {
 	int (*link_init)(struct adapter_info_s *p_adapter_info, nthw_fpga_t *p_fpga);
 };
 
-void register_100g_link_ops(struct link_ops_s *ops);
+void nthw_reg_100g_link_ops(struct link_ops_s *ops);
 const struct link_ops_s *get_100g_link_ops(void);
 void nthw_link_100g_init(void);
 
-void register_agx_100g_link_ops(struct link_ops_s *ops);
+void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops);
 const struct link_ops_s *get_agx_100g_link_ops(void);
 void link_agx_100g_init(void);
 
@@ -207,7 +207,7 @@ struct port_ops {
 	int (*tx_power)(struct adapter_info_s *p, int port, bool disable);
 };
 
-void register_port_ops(const struct port_ops *ops);
+void nthw_reg_port_ops(const struct port_ops *ops);
 const struct port_ops *get_port_ops(void);
 void nthw_port_init(void);
 
@@ -218,7 +218,7 @@ struct nt4ga_stat_ops {
 		nt4ga_stat_t *p_nt4ga_stat);
 };
 
-void register_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops);
+void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops);
 const struct nt4ga_stat_ops *get_nt4ga_stat_ops(void);
 void nt4ga_stat_ops_init(void);
 
@@ -229,7 +229,7 @@ struct adapter_ops {
 	int (*show_info)(struct adapter_info_s *p_adapter_info, FILE *pfh);
 };
 
-void register_adapter_ops(const struct adapter_ops *ops);
+void nthw_reg_adapter_ops(const struct adapter_ops *ops);
 const struct adapter_ops *get_adapter_ops(void);
 void nthw_adapter_init(void);
 
@@ -238,7 +238,7 @@ struct clk9563_ops {
 	const clk_profile_data_fmt2_t *(*get_p_data_9563_si5340_nt200a02_u23_v5)(void);
 };
 
-void register_clk9563_ops(struct clk9563_ops *ops);
+void nthw_reg_clk9563_ops(struct clk9563_ops *ops);
 struct clk9563_ops *get_clk9563_ops(void);
 void clk9563_ops_init(void);
 
@@ -249,7 +249,7 @@ struct rst_nt200a0x_ops {
 		const struct nthw_fpga_rst_nt200a0x *p);
 };
 
-void register_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops);
+void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops);
 struct rst_nt200a0x_ops *get_rst_nt200a0x_ops(void);
 void rst_nt200a0x_ops_init(void);
 
@@ -258,7 +258,7 @@ struct rst9563_ops {
 		struct nthw_fpga_rst_nt200a0x *const p);
 };
 
-void register_rst9563_ops(struct rst9563_ops *ops);
+void nthw_reg_rst9563_ops(struct rst9563_ops *ops);
 struct rst9563_ops *get_rst9563_ops(void);
 void rst9563_ops_init(void);
 
@@ -269,7 +269,7 @@ struct rst9574_ops {
 		struct nthw_fpga_rst_nt400dxx *const p);
 };
 
-void register_rst9574_ops(struct rst9574_ops *ops);
+void nthw_reg_rst9574_ops(struct rst9574_ops *ops);
 struct rst9574_ops *get_rst9574_ops(void);
 void rst9574_ops_init(void);
 
@@ -278,7 +278,7 @@ struct rst_nt400dxx_ops {
 	int (*nthw_fpga_rst_nt400dxx_reset)(struct fpga_info_s *p_fpga_info);
 };
 
-void register_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops);
+void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops);
 struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void);
 void rst_nt400dxx_ops_init(void);
 
@@ -288,7 +288,7 @@ struct flow_backend_ops {
 	void (*bin_flow_backend_done)(void *be_dev);
 };
 
-void register_flow_backend_ops(const struct flow_backend_ops *ops);
+void nthw_reg_flow_backend_ops(const struct flow_backend_ops *ops);
 const struct flow_backend_ops *get_flow_backend_ops(void);
 void nthw_flow_backend_init(void);
 
@@ -446,7 +446,7 @@ struct profile_inline_ops {
 	int (*nthw_flow_set_mtu_inline)(struct flow_eth_dev *dev, uint32_t port, uint16_t mtu);
 };
 
-void register_profile_inline_ops(const struct profile_inline_ops *ops);
+void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops);
 const struct profile_inline_ops *get_profile_inline_ops(void);
 void nthw_profile_inline_init(void);
 
@@ -559,15 +559,15 @@ struct flow_filter_ops {
 		struct rte_flow_error *error);
 };
 
-void register_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops);
+void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops);
 const struct rte_flow_fp_ops *get_dev_fp_flow_ops(void);
 void nthw_dev_fp_flow_init(void);
 
-void register_dev_flow_ops(const struct rte_flow_ops *ops);
+void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops);
 const struct rte_flow_ops *get_dev_flow_ops(void);
 void nthw_dev_flow_init(void);
 
-void register_flow_filter_ops(const struct flow_filter_ops *ops);
+void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops);
 const struct flow_filter_ops *get_flow_filter_ops(void);
 void nthw_init_flow_filter(void);
 
@@ -591,7 +591,7 @@ struct ntnic_xstats_ops {
 		uint8_t port);
 };
 
-void register_ntnic_xstats_ops(struct ntnic_xstats_ops *ops);
+void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops);
 struct ntnic_xstats_ops *get_ntnic_xstats_ops(void);
 void ntnic_xstats_ops_init(void);
 
drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c +1 -1
index a26cf5a07a..1ebf1b8eb5 100644
@@ -822,5 +822,5 @@ static struct ntnic_xstats_ops ops = {
 void ntnic_xstats_ops_init(void)
 {
 	NT_LOG_DBGX(DBG, NTNIC, "xstats module was initialized");
-	register_ntnic_xstats_ops(&ops);
+	nthw_reg_xstats_ops(&ops);
 }
Signature · 1 line
2.45.0
#73 lore raw

PATCH 21/24 net/ntnic: rename get ops functions

In reply to Serhii Iliushyk

Add prefix nthw_ to get ops functions to follow naming convention.

---
 drivers/net/ntnic/adapter/nt4ga_adapter.c     | 10 ++--
 .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c |  4 +-
 .../net/ntnic/nthw/core/include/nthw_fpga.h   |  4 +-
 .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c   |  4 +-
 .../core/nt200a0x/reset/nthw_fpga_rst9563.c   |  4 +-
 .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c   |  4 +-
 drivers/net/ntnic/nthw/core/nthw_fpga.c       |  8 +--
 drivers/net/ntnic/nthw/flow_api/flow_api.c    | 42 +++++++--------
 drivers/net/ntnic/nthw/flow_api/flow_filter.c |  4 +-
 .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c  | 18 +++----
 drivers/net/ntnic/ntnic_ethdev.c              | 54 +++++++++----------
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 32 +++++------
 drivers/net/ntnic/ntnic_mod_reg.c             | 38 ++++++-------
 drivers/net/ntnic/ntnic_mod_reg.h             | 38 ++++++-------
 14 files changed, 132 insertions(+), 132 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +5 -5
index 5295387fa8..6d8547483f 100644
@@ -52,7 +52,7 @@ static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE *
 
 static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL)
 		NT_LOG(ERR, NTNIC, "%s: flow_filter module uninitialized", __func__);
@@ -162,7 +162,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 		switch (fpga_info->n_fpga_prod_id) {
 		/* NT200A01: 2x100G (Xilinx) */
 		case 9563:	/* NT200A02 (Cap) */
-			link_ops = get_100g_link_ops();
+			link_ops = nthw_get_100g_link_ops();
 
 			if (link_ops == NULL) {
 				NT_LOG(ERR, NTNIC, "NT200A02 100G link module uninitialized");
@@ -173,7 +173,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 			res = link_ops->link_init(p_adapter_info, p_fpga);
 			break;
 		case 9574: /* NT400D13 (Intel Agilex FPGA) */
-			link_ops = get_agx_100g_link_ops();
+			link_ops = nthw_get_agx_100g_link_ops();
 			if (link_ops == NULL) {
 				NT_LOG(ERR, NTNIC, "NT400D11 100G link module uninitialized");
 				res = -1;
@@ -197,7 +197,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 		}
 	}
 
-	const struct nt4ga_stat_ops *nt4ga_stat_ops = get_nt4ga_stat_ops();
+	const struct nt4ga_stat_ops *nt4ga_stat_ops = nthw_get_nt4ga_stat_ops();
 
 	if (nt4ga_stat_ops != NULL) {
 		/* Nt4ga Stat init/setup */
@@ -223,7 +223,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)
 
 static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL)
 		NT_LOG(ERR, NTNIC, "%s: flow_filter module uninitialized", __func__);
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +2 -2
index aca88c6635..0f7e1f2b00 100644
@@ -191,7 +191,7 @@ static int nt4ga_stat_setup(struct adapter_info_s *p_adapter_info)
 		return -1;
 	}
 
-	if (get_flow_filter_ops() != NULL) {
+	if (nthw_get_flow_filter_ops() != NULL) {
 		struct flow_nic_dev *ndev = p_adapter_info->nt4ga_filter.mp_flow_device;
 		p_nt4ga_stat->flm_stat_ver = ndev->be.flm.ver;
 		p_nt4ga_stat->mp_stat_structs_flm = calloc(1, sizeof(struct flm_counters_v1));
@@ -244,7 +244,7 @@ static int nt4ga_stat_collect_cap_v1_stats(struct adapter_info_s *p_adapter_info
 	uint32_t *p_stat_dma_virtual)
 {
 	(void)p_adapter_info;
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL || p_nt4ga_stat == NULL)
 		return -1;
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
index b86865b24f..9838ad3c07 100644
@@ -33,7 +33,7 @@ struct nt200a0x_ops {
 };
 
 void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops);
-struct nt200a0x_ops *get_nt200a0x_ops(void);
+struct nt200a0x_ops *nthw_get_nt200a0x_ops(void);
 void nt200a0x_ops_init(void);
 
 struct nt400dxx_ops {
@@ -41,7 +41,7 @@ struct nt400dxx_ops {
 };
 
 void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops);
-struct nt400dxx_ops *get_nt400dxx_ops(void);
+struct nt400dxx_ops *nthw_get_nt400dxx_ops(void);
 void nt400dxx_ops_init(void);
 
 #endif	/* __NTHW_FPGA_H__ */
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +2 -2
index 739b1aab85..371177c14f 100644
@@ -15,7 +15,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)
 	const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;
 	struct nthw_fpga_rst_nt200a0x rst;
 	int res = -1;
-	const struct rst_nt200a0x_ops *rst_nt200a0x_ops = get_rst_nt200a0x_ops();
+	const struct rst_nt200a0x_ops *rst_nt200a0x_ops = nthw_get_rst_nt200a0x_ops();
 
 	if (rst_nt200a0x_ops == NULL) {
 		NT_LOG(ERR, NTHW, "RST NT200A0X NOT INCLUDED");
@@ -32,7 +32,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)
 	}
 
 	bool included = true;
-	struct rst9563_ops *rst9563_ops = get_rst9563_ops();
+	struct rst9563_ops *rst9563_ops = nthw_get_rst9563_ops();
 
 	/* reset specific */
 	switch (p_fpga_info->n_fpga_prod_id) {
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +2 -2
index a345f163bb..f3a28e801e 100644
@@ -160,7 +160,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga,
 	const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;
 	const int n_fpga_product_id = p_fpga->mn_product_id;
 	int res;
-	const struct clk9563_ops *clk9563_ops = get_clk9563_ops();
+	const struct clk9563_ops *clk9563_ops = nthw_get_clk9563_ops();
 
 	if (clk9563_ops == NULL) {
 		NT_LOG(INF, NTNIC, "CLK9563 module not included");
@@ -220,7 +220,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info,
 		return res;
 	}
 
-	const struct rst_nt200a0x_ops *rst_ops = get_rst_nt200a0x_ops();
+	const struct rst_nt200a0x_ops *rst_ops = nthw_get_rst_nt200a0x_ops();
 	res = rst_ops != NULL ? rst_ops->nthw_fpga_rst_nt200a0x_reset(p_fpga, p_rst) : -1;
 
 	if (res) {
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +2 -2
index 234da0da33..1f87e36d08 100644
@@ -124,7 +124,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)
 
 	switch (p_fpga_info->n_fpga_prod_id) {
 	case 9574:
-		rst9574_ops = get_rst9574_ops();
+		rst9574_ops = nthw_get_rst9574_ops();
 
 		if (rst9574_ops == NULL) {
 			NT_LOG(ERR, NTHW, "%s: RST 9574 NOT INCLUDED", p_adapter_id_str);
@@ -148,7 +148,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)
 		return -1;
 	}
 
-	struct rst_nt400dxx_ops *rst_nt400dxx_ops = get_rst_nt400dxx_ops();
+	struct rst_nt400dxx_ops *rst_nt400dxx_ops = nthw_get_rst_nt400dxx_ops();
 
 	if (rst_nt400dxx_ops == NULL) {
 		NT_LOG(ERR, NTHW, "RST NT400DXX NOT INCLUDED");
drivers/net/ntnic/nthw/core/nthw_fpga.c +4 -4
index f18069e492..0e1f686b4f 100644
@@ -431,8 +431,8 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)
 	nthw_rac_rab_flush(p_nthw_rac);
 	p_fpga_info->mp_nthw_rac = p_nthw_rac;
 
-	struct nt200a0x_ops *nt200a0x_ops = get_nt200a0x_ops();
-	struct nt400dxx_ops *nt400dxx_ops = get_nt400dxx_ops();
+	struct nt200a0x_ops *nt200a0x_ops = nthw_get_nt200a0x_ops();
+	struct nt400dxx_ops *nt400dxx_ops = nthw_get_nt400dxx_ops();
 
 	switch (p_fpga_info->n_nthw_adapter_id) {
 	case NT_HW_ADAPTER_ID_NT200A02:
@@ -562,7 +562,7 @@ void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops)
 	nt200a0x_ops = ops;
 }
 
-struct nt200a0x_ops *get_nt200a0x_ops(void)
+struct nt200a0x_ops *nthw_get_nt200a0x_ops(void)
 {
 	if (nt200a0x_ops == NULL)
 		nt200a0x_ops_init();
@@ -576,7 +576,7 @@ void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops)
 	nt400dxx_ops = ops;
 }
 
-struct nt400dxx_ops *get_nt400dxx_ops(void)
+struct nt400dxx_ops *nthw_get_nt400dxx_ops(void)
 {
 	if (nt400dxx_ops == NULL)
 		nt400dxx_ops_init();
drivers/net/ntnic/nthw/flow_api/flow_api.c +21 -21

168 lines not on this page · raw message

drivers/net/ntnic/nthw/flow_api/flow_filter.c +2 -2
index a4a95746e8..9de3ed3b7a 100644
@@ -12,7 +12,7 @@ int nthw_flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_devi
 	void *be_dev = NULL;
 	struct flow_nic_dev *flow_nic;
 
-	const struct flow_backend_ops *flow_backend_ops = get_flow_backend_ops();
+	const struct flow_backend_ops *flow_backend_ops = nthw_get_flow_backend_ops();
 
 	if (flow_backend_ops == NULL) {
 		NT_LOG(ERR, FILTER, "%s: flow_backend module uninitialized", __func__);
@@ -41,7 +41,7 @@ int nthw_flow_filter_done(struct flow_nic_dev *dev)
 	int res = nthw_flow_api_done(dev);
 
 	if (be_dev) {
-		const struct flow_backend_ops *flow_backend_ops = get_flow_backend_ops();
+		const struct flow_backend_ops *flow_backend_ops = nthw_get_flow_backend_ops();
 
 		if (flow_backend_ops == NULL) {
 			NT_LOG(WRN, FILTER, "%s: flow_backend module uninitialized", __func__);
drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +9 -9
index a2c37774fe..95a875fc1a 100644
@@ -35,7 +35,7 @@ static int eth_mtr_capabilities_get_inline(struct rte_eth_dev *eth_dev,
 	struct rte_mtr_capabilities *cap,
 	struct rte_mtr_error *error)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -106,7 +106,7 @@ static int eth_mtr_meter_profile_add_inline(struct rte_eth_dev *eth_dev,
 	struct rte_mtr_meter_profile *profile,
 	struct rte_mtr_error *error __rte_unused)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -157,7 +157,7 @@ static int eth_mtr_meter_profile_delete_inline(struct rte_eth_dev *eth_dev,
 	uint32_t meter_profile_id,
 	struct rte_mtr_error *error __rte_unused)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -180,7 +180,7 @@ static int eth_mtr_meter_policy_add_inline(struct rte_eth_dev *eth_dev,
 	struct rte_mtr_meter_policy_params *policy,
 	struct rte_mtr_error *error)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -226,7 +226,7 @@ static int eth_mtr_meter_policy_delete_inline(struct rte_eth_dev *eth_dev __rte_
 	uint32_t policy_id,
 	struct rte_mtr_error *error __rte_unused)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -246,7 +246,7 @@ static int eth_mtr_create_inline(struct rte_eth_dev *eth_dev,
 	int shared,
 	struct rte_mtr_error *error)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -312,7 +312,7 @@ static int eth_mtr_destroy_inline(struct rte_eth_dev *eth_dev,
 	uint32_t mtr_id,
 	struct rte_mtr_error *error __rte_unused)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -342,7 +342,7 @@ static int eth_mtr_stats_adjust_inline(struct rte_eth_dev *eth_dev,
 	uint64_t adjust_value,
 	struct rte_mtr_error *error)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
@@ -405,7 +405,7 @@ static int eth_mtr_stats_read_inline(struct rte_eth_dev *eth_dev,
 	int clear,
 	struct rte_mtr_error *error)
 {
-	const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops();
+	const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();
 
 	if (profile_inline_ops == NULL) {
 		NT_LOG(ERR, NTHW, "profile_inline module uninitialized");
drivers/net/ntnic/ntnic_ethdev.c +27 -27

216 lines not on this page · raw message

drivers/net/ntnic/ntnic_filter/ntnic_filter.c +16 -16
index 2d0d0ea54f..5a0ef125be 100644
@@ -540,7 +540,7 @@ static int convert_flow(struct rte_eth_dev *eth_dev,
 static int
 eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -584,7 +584,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,
 	const struct rte_flow_action actions[],
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -667,7 +667,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,
 
 static int eth_flow_flush(struct rte_eth_dev *eth_dev, struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -708,7 +708,7 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev,
 	const struct rte_flow_action actions[],
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG(ERR, FILTER, "flow_filter module uninitialized");
@@ -770,7 +770,7 @@ static int eth_flow_dev_dump(struct rte_eth_dev *eth_dev,
 	FILE *file,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG(ERR, NTNIC, "%s: flow_filter module uninitialized", __func__);
@@ -797,7 +797,7 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev,
 	uint32_t nb_contexts,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, NTNIC, "flow_filter module uninitialized");
@@ -824,7 +824,7 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev,
 static int eth_flow_info_get(struct rte_eth_dev *dev, struct rte_flow_port_info *port_info,
 	struct rte_flow_queue_info *queue_info, struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -849,7 +849,7 @@ static int eth_flow_configure(struct rte_eth_dev *dev, const struct rte_flow_por
 	uint16_t nb_queue, const struct rte_flow_queue_attr *queue_attr[],
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -875,7 +875,7 @@ static struct rte_flow_pattern_template *eth_flow_pattern_template_create(struct
 	const struct rte_flow_pattern_template_attr *template_attr,
 	const struct rte_flow_item pattern[], struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -914,7 +914,7 @@ static int eth_flow_pattern_template_destroy(struct rte_eth_dev *dev,
 	struct rte_flow_pattern_template *pattern_template,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -939,7 +939,7 @@ static struct rte_flow_actions_template *eth_flow_actions_template_create(struct
 	const struct rte_flow_action actions[], const struct rte_flow_action masks[],
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -1000,7 +1000,7 @@ static int eth_flow_actions_template_destroy(struct rte_eth_dev *dev,
 	struct rte_flow_actions_template *actions_template,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, NTNIC, "flow_filter module uninitialized");
@@ -1026,7 +1026,7 @@ static struct rte_flow_template_table *eth_flow_template_table_create(struct rte
 	struct rte_flow_actions_template *actions_templates[], uint8_t nb_actions_templates,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -1065,7 +1065,7 @@ static int eth_flow_template_table_destroy(struct rte_eth_dev *dev,
 	struct rte_flow_template_table *template_table,
 	struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -1091,7 +1091,7 @@ static struct rte_flow *eth_flow_async_create(struct rte_eth_dev *dev, uint32_t
 	uint8_t pattern_template_index, const struct rte_flow_action actions[],
 	uint8_t actions_template_index, void *user_data, struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
@@ -1151,7 +1151,7 @@ static int eth_flow_async_destroy(struct rte_eth_dev *dev, uint32_t queue_id,
 	const struct rte_flow_op_attr *op_attr, struct rte_flow *flow,
 	void *user_data, struct rte_flow_error *error)
 {
-	const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops();
+	const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();
 
 	if (flow_filter_ops == NULL) {
 		NT_LOG_DBGX(ERR, FILTER, "flow_filter module uninitialized");
drivers/net/ntnic/ntnic_mod_reg.c +19 -19
index be872aa090..67ba694e25 100644
@@ -12,7 +12,7 @@ void nthw_reg_sg_ops(struct sg_ops_s *ops)
 	sg_ops = ops;
 }
 
-const struct sg_ops_s *get_sg_ops(void)
+const struct sg_ops_s *nthw_get_sg_ops(void)
 {
 	if (sg_ops == NULL)
 		nthw_sg_init();
@@ -29,7 +29,7 @@ void nthw_reg_meter_ops(struct meter_ops_s *ops)
 	meter_ops = ops;
 }
 
-const struct meter_ops_s *get_meter_ops(void)
+const struct meter_ops_s *nthw_get_meter_ops(void)
 {
 	if (meter_ops == NULL)
 		nthw_meter_init();
@@ -47,7 +47,7 @@ void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops)
 	ntnic_filter_ops = ops;
 }
 
-const struct ntnic_filter_ops *get_ntnic_filter_ops(void)
+const struct ntnic_filter_ops *nthw_get_filter_ops(void)
 {
 	if (ntnic_filter_ops == NULL)
 		ntnic_filter_init();
@@ -62,7 +62,7 @@ void nthw_reg_100g_link_ops(struct link_ops_s *ops)
 	link_100g_ops = ops;
 }
 
-const struct link_ops_s *get_100g_link_ops(void)
+const struct link_ops_s *nthw_get_100g_link_ops(void)
 {
 	if (link_100g_ops == NULL)
 		nthw_link_100g_init();
@@ -79,7 +79,7 @@ void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops)
 	link_agx_100g_ops = ops;
 }
 
-const struct link_ops_s *get_agx_100g_link_ops(void)
+const struct link_ops_s *nthw_get_agx_100g_link_ops(void)
 {
 	if (link_agx_100g_ops == NULL)
 		link_agx_100g_init();
@@ -93,7 +93,7 @@ void nthw_reg_port_ops(const struct port_ops *ops)
 	port_ops = ops;
 }
 
-const struct port_ops *get_port_ops(void)
+const struct port_ops *nthw_get_port_ops(void)
 {
 	if (port_ops == NULL)
 		nthw_port_init();
@@ -107,7 +107,7 @@ void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops)
 	nt4ga_stat_ops = ops;
 }
 
-const struct nt4ga_stat_ops *get_nt4ga_stat_ops(void)
+const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops(void)
 {
 	if (nt4ga_stat_ops == NULL)
 		nt4ga_stat_ops_init();
@@ -122,7 +122,7 @@ void nthw_reg_adapter_ops(const struct adapter_ops *ops)
 	adapter_ops = ops;
 }
 
-const struct adapter_ops *get_adapter_ops(void)
+const struct adapter_ops *nthw_get_adapter_ops(void)
 {
 	if (adapter_ops == NULL)
 		nthw_adapter_init();
@@ -136,7 +136,7 @@ void nthw_reg_clk9563_ops(struct clk9563_ops *ops)
 	clk9563_ops = ops;
 }
 
-struct clk9563_ops *get_clk9563_ops(void)
+struct clk9563_ops *nthw_get_clk9563_ops(void)
 {
 	if (clk9563_ops == NULL)
 		clk9563_ops_init();
@@ -150,7 +150,7 @@ void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops)
 	rst_nt200a0x_ops = ops;
 }
 
-struct rst_nt200a0x_ops *get_rst_nt200a0x_ops(void)
+struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops(void)
 {
 	if (rst_nt200a0x_ops == NULL)
 		rst_nt200a0x_ops_init();
@@ -164,7 +164,7 @@ void nthw_reg_rst9563_ops(struct rst9563_ops *ops)
 	rst9563_ops = ops;
 }
 
-struct rst9563_ops *get_rst9563_ops(void)
+struct rst9563_ops *nthw_get_rst9563_ops(void)
 {
 	if (rst9563_ops == NULL)
 		rst9563_ops_init();
@@ -185,7 +185,7 @@ void nthw_reg_rst9574_ops(struct rst9574_ops *ops)
 	rst9574_ops = ops;
 }
 
-struct rst9574_ops *get_rst9574_ops(void)
+struct rst9574_ops *nthw_get_rst9574_ops(void)
 {
 	if (rst9574_ops == NULL)
 		rst9574_ops_init();
@@ -200,7 +200,7 @@ void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops)
 	rst_nt400dxx_ops = ops;
 }
 
-struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void)
+struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops(void)
 {
 	if (rst_nt400dxx_ops == NULL)
 		rst_nt400dxx_ops_init();
@@ -208,7 +208,7 @@ struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void)
 	return rst_nt400dxx_ops;
 }
 
-const struct flow_backend_ops *get_flow_backend_ops(void)
+const struct flow_backend_ops *nthw_get_flow_backend_ops(void)
 {
 	if (flow_backend_ops == NULL)
 		nthw_flow_backend_init();
@@ -223,7 +223,7 @@ void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops)
 	profile_inline_ops = ops;
 }
 
-const struct profile_inline_ops *get_profile_inline_ops(void)
+const struct profile_inline_ops *nthw_get_profile_inline_ops(void)
 {
 	if (profile_inline_ops == NULL)
 		nthw_profile_inline_init();
@@ -238,7 +238,7 @@ void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops)
 	flow_filter_ops = ops;
 }
 
-const struct flow_filter_ops *get_flow_filter_ops(void)
+const struct flow_filter_ops *nthw_get_flow_filter_ops(void)
 {
 	if (flow_filter_ops == NULL)
 		nthw_init_flow_filter();
@@ -253,7 +253,7 @@ void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops)
 	dev_fp_flow_ops = ops;
 }
 
-const struct rte_flow_fp_ops *get_dev_fp_flow_ops(void)
+const struct rte_flow_fp_ops *nthw_get_dev_fp_flow_ops(void)
 {
 	if (dev_fp_flow_ops == NULL)
 		nthw_dev_fp_flow_init();
@@ -268,7 +268,7 @@ void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops)
 	dev_flow_ops = ops;
 }
 
-const struct rte_flow_ops *get_dev_flow_ops(void)
+const struct rte_flow_ops *nthw_get_dev_flow_ops(void)
 {
 	if (dev_flow_ops == NULL)
 		nthw_dev_flow_init();
@@ -283,7 +283,7 @@ void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops)
 	ntnic_xstats_ops = ops;
 }
 
-struct ntnic_xstats_ops *get_ntnic_xstats_ops(void)
+struct ntnic_xstats_ops *nthw_get_xstats_ops(void)
 {
 	if (ntnic_xstats_ops == NULL)
 		ntnic_xstats_ops_init();
drivers/net/ntnic/ntnic_mod_reg.h +19 -19
index 26c8723afa..2ed2286911 100644
@@ -120,7 +120,7 @@ struct sg_ops_s {
 };
 
 void nthw_reg_sg_ops(struct sg_ops_s *ops);
-const struct sg_ops_s *get_sg_ops(void);
+const struct sg_ops_s *nthw_get_sg_ops(void);
 void nthw_sg_init(void);
 
 /* Meter ops section */
@@ -129,7 +129,7 @@ struct meter_ops_s {
 };
 
 void nthw_reg_meter_ops(struct meter_ops_s *ops);
-const struct meter_ops_s *get_meter_ops(void);
+const struct meter_ops_s *nthw_get_meter_ops(void);
 void nthw_meter_init(void);
 
 /*
@@ -140,7 +140,7 @@ struct ntnic_filter_ops {
 };
 
 void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops);
-const struct ntnic_filter_ops *get_ntnic_filter_ops(void);
+const struct ntnic_filter_ops *nthw_get_filter_ops(void);
 void ntnic_filter_init(void);
 
 struct link_ops_s {
@@ -148,11 +148,11 @@ struct link_ops_s {
 };
 
 void nthw_reg_100g_link_ops(struct link_ops_s *ops);
-const struct link_ops_s *get_100g_link_ops(void);
+const struct link_ops_s *nthw_get_100g_link_ops(void);
 void nthw_link_100g_init(void);
 
 void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops);
-const struct link_ops_s *get_agx_100g_link_ops(void);
+const struct link_ops_s *nthw_get_agx_100g_link_ops(void);
 void link_agx_100g_init(void);
 
 struct port_ops {
@@ -208,7 +208,7 @@ struct port_ops {
 };
 
 void nthw_reg_port_ops(const struct port_ops *ops);
-const struct port_ops *get_port_ops(void);
+const struct port_ops *nthw_get_port_ops(void);
 void nthw_port_init(void);
 
 struct nt4ga_stat_ops {
@@ -219,7 +219,7 @@ struct nt4ga_stat_ops {
 };
 
 void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops);
-const struct nt4ga_stat_ops *get_nt4ga_stat_ops(void);
+const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops(void);
 void nt4ga_stat_ops_init(void);
 
 struct adapter_ops {
@@ -230,7 +230,7 @@ struct adapter_ops {
 };
 
 void nthw_reg_adapter_ops(const struct adapter_ops *ops);
-const struct adapter_ops *get_adapter_ops(void);
+const struct adapter_ops *nthw_get_adapter_ops(void);
 void nthw_adapter_init(void);
 
 struct clk9563_ops {
@@ -239,7 +239,7 @@ struct clk9563_ops {
 };
 
 void nthw_reg_clk9563_ops(struct clk9563_ops *ops);
-struct clk9563_ops *get_clk9563_ops(void);
+struct clk9563_ops *nthw_get_clk9563_ops(void);
 void clk9563_ops_init(void);
 
 struct rst_nt200a0x_ops {
@@ -250,7 +250,7 @@ struct rst_nt200a0x_ops {
 };
 
 void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops);
-struct rst_nt200a0x_ops *get_rst_nt200a0x_ops(void);
+struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops(void);
 void rst_nt200a0x_ops_init(void);
 
 struct rst9563_ops {
@@ -259,7 +259,7 @@ struct rst9563_ops {
 };
 
 void nthw_reg_rst9563_ops(struct rst9563_ops *ops);
-struct rst9563_ops *get_rst9563_ops(void);
+struct rst9563_ops *nthw_get_rst9563_ops(void);
 void rst9563_ops_init(void);
 
 struct rst9574_ops {
@@ -270,7 +270,7 @@ struct rst9574_ops {
 };
 
 void nthw_reg_rst9574_ops(struct rst9574_ops *ops);
-struct rst9574_ops *get_rst9574_ops(void);
+struct rst9574_ops *nthw_get_rst9574_ops(void);
 void rst9574_ops_init(void);
 
 struct rst_nt400dxx_ops {
@@ -279,7 +279,7 @@ struct rst_nt400dxx_ops {
 };
 
 void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops);
-struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void);
+struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops(void);
 void rst_nt400dxx_ops_init(void);
 
 struct flow_backend_ops {
@@ -289,7 +289,7 @@ struct flow_backend_ops {
 };
 
 void nthw_reg_flow_backend_ops(const struct flow_backend_ops *ops);
-const struct flow_backend_ops *get_flow_backend_ops(void);
+const struct flow_backend_ops *nthw_get_flow_backend_ops(void);
 void nthw_flow_backend_init(void);
 
 struct profile_inline_ops {
@@ -447,7 +447,7 @@ struct profile_inline_ops {
 };
 
 void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops);
-const struct profile_inline_ops *get_profile_inline_ops(void);
+const struct profile_inline_ops *nthw_get_profile_inline_ops(void);
 void nthw_profile_inline_init(void);
 
 struct flow_filter_ops {
@@ -560,15 +560,15 @@ struct flow_filter_ops {
 };
 
 void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops);
-const struct rte_flow_fp_ops *get_dev_fp_flow_ops(void);
+const struct rte_flow_fp_ops *nthw_get_dev_fp_flow_ops(void);
 void nthw_dev_fp_flow_init(void);
 
 void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops);
-const struct rte_flow_ops *get_dev_flow_ops(void);
+const struct rte_flow_ops *nthw_get_dev_flow_ops(void);
 void nthw_dev_flow_init(void);
 
 void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops);
-const struct flow_filter_ops *get_flow_filter_ops(void);
+const struct flow_filter_ops *nthw_get_flow_filter_ops(void);
 void nthw_init_flow_filter(void);
 
 struct ntnic_xstats_ops {
@@ -592,7 +592,7 @@ struct ntnic_xstats_ops {
 };
 
 void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops);
-struct ntnic_xstats_ops *get_ntnic_xstats_ops(void);
+struct ntnic_xstats_ops *nthw_get_xstats_ops(void);
 void ntnic_xstats_ops_init(void);
 
 #endif	/* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
#74 lore raw

PATCH 22/24 net/ntnic: rename ops init functions

In reply to Serhii Iliushyk

Add prefix nthw_ to ops init function to follow the naming convention.

---
 .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c  |  2 +-
 .../link_agx_100g/nt4ga_agx_link_100g.c        |  2 +-
 .../net/ntnic/nthw/core/include/nthw_fpga.h    |  4 ++--
 .../clock_profiles/nthw_fpga_clk9563.c         |  2 +-
 .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c    |  2 +-
 .../core/nt200a0x/reset/nthw_fpga_rst9563.c    |  2 +-
 .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c    |  2 +-
 .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c    |  2 +-
 .../core/nt400dxx/reset/nthw_fpga_rst9574.c    |  2 +-
 .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c    |  2 +-
 drivers/net/ntnic/nthw/core/nthw_fpga.c        |  4 ++--
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c  |  2 +-
 drivers/net/ntnic/ntnic_mod_reg.c              | 18 +++++++++---------
 drivers/net/ntnic/ntnic_mod_reg.h              | 18 +++++++++---------
 drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c  |  2 +-
 15 files changed, 33 insertions(+), 33 deletions(-)
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
index 0f7e1f2b00..57b5b147f8 100644
@@ -593,7 +593,7 @@ static struct nt4ga_stat_ops ops = {
 	.nt4ga_stat_collect = nt4ga_stat_collect
 };
 
-void nt4ga_stat_ops_init(void)
+void nthw_stat_ops_init(void)
 {
 	NT_LOG_DBGX(DBG, NTNIC, "Stat module was initialized");
 	nthw_reg_nt4ga_stat_ops(&ops);
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
index 1387bb4148..36ecf0d0ec 100644
@@ -35,7 +35,7 @@ static struct link_ops_s link_agx_100g_ops = {
 	.link_init = nt4ga_agx_link_100g_ports_init,
 };
 
-void link_agx_100g_init(void)
+void nthw_link_agx_100g_ops_init(void)
 {
 	nthw_reg_agx_100g_link_ops(&link_agx_100g_ops);
 }
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
index 9838ad3c07..532d19d6b8 100644
@@ -34,7 +34,7 @@ struct nt200a0x_ops {
 
 void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops);
 struct nt200a0x_ops *nthw_get_nt200a0x_ops(void);
-void nt200a0x_ops_init(void);
+void nthw_nt200a0x_ops_init(void);
 
 struct nt400dxx_ops {
 	int (*nthw_fpga_nt400dxx_init)(struct fpga_info_s *p_fpga_info);
@@ -42,6 +42,6 @@ struct nt400dxx_ops {
 
 void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops);
 struct nt400dxx_ops *nthw_get_nt400dxx_ops(void);
-void nt400dxx_ops_init(void);
+void nthw_nt400dxx_ops_init(void);
 
 #endif	/* __NTHW_FPGA_H__ */
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c +1 -1
index eeca816899..91c9795956 100644
@@ -33,7 +33,7 @@ static struct clk9563_ops ops = { .get_n_data_9563_si5340_nt200a02_u23_v5 =
 			get_p_data_9563_si5340_nt200a02_u23_v5
 };
 
-void clk9563_ops_init(void)
+void nthw_clk9563_ops_init(void)
 {
 	nthw_reg_clk9563_ops(&ops);
 }
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
index 371177c14f..20bacf8988 100644
@@ -69,7 +69,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)
 
 static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga_nt200a0x_init };
 
-void nt200a0x_ops_init(void)
+void nthw_nt200a0x_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "NT200A0X OPS INIT");
 	nthw_reg_nt200a0x_ops(&nt200a0x_ops);
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +1 -1
index f3a28e801e..c99c9ecbe6 100644
@@ -233,7 +233,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info,
 
 static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rst9563_init };
 
-void rst9563_ops_init(void)
+void nthw_rst9563_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "RST9563 OPS INIT");
 	nthw_reg_rst9563_ops(&rst9563_ops);
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
index 4a2fca5f19..39345369ef 100644
@@ -575,7 +575,7 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_init
 			nthw_fpga_rst_nt200a0x_reset
 };
 
-void rst_nt200a0x_ops_init(void)
+void nthw_rst_nt200a0x_ops_init(void)
 {
 	NT_LOG(DBG, NTHW, "RST NT200A0X OPS INIT");
 	nthw_reg_rst_nt200a0x_ops(&rst_nt200a0x_ops);
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +1 -1
index 1f87e36d08..cc4bee9d4d 100644
@@ -213,7 +213,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)
 
 static struct nt400dxx_ops nt400dxx_ops = { .nthw_fpga_nt400dxx_init = nthw_fpga_nt400dxx_init };
 
-void nt400dxx_ops_init(void)
+void nthw_nt400dxx_ops_init(void)
 {
 	nthw_reg_nt400dxx_ops(&nt400dxx_ops);
 }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +1 -1
index 36d2c46fc6..38614e9365 100644
@@ -371,7 +371,7 @@ static struct rst9574_ops rst9574_ops = {
 	.nthw_fpga_rst9574_setup = nthw_fpga_rst9574_setup,
 };
 
-void rst9574_ops_init(void)
+void nthw_rst9574_ops_init(void)
 {
 	nthw_reg_rst9574_ops(&rst9574_ops);
 }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +1 -1
index 67c562627d..90d0680b99 100644
@@ -421,7 +421,7 @@ static struct rst_nt400dxx_ops rst_nt400dxx_ops = {
 	.nthw_fpga_rst_nt400dxx_reset = nthw_fpga_rst_nt400dxx_reset
 };
 
-void rst_nt400dxx_ops_init(void)
+void nthw_rst_nt400dxx_ops_init(void)
 {
 	nthw_reg_rst_nt400dxx_ops(&rst_nt400dxx_ops);
 }
drivers/net/ntnic/nthw/core/nthw_fpga.c +2 -2
index 0e1f686b4f..24cfb6c284 100644
@@ -565,7 +565,7 @@ void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops)
 struct nt200a0x_ops *nthw_get_nt200a0x_ops(void)
 {
 	if (nt200a0x_ops == NULL)
-		nt200a0x_ops_init();
+		nthw_nt200a0x_ops_init();
 	return nt200a0x_ops;
 }
 
@@ -579,6 +579,6 @@ void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops)
 struct nt400dxx_ops *nthw_get_nt400dxx_ops(void)
 {
 	if (nt400dxx_ops == NULL)
-		nt400dxx_ops_init();
+		nthw_nt400dxx_ops_init();
 	return nt400dxx_ops;
 }
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +1 -1
index 5a0ef125be..813ac04481 100644
@@ -1289,7 +1289,7 @@ static const struct ntnic_filter_ops ntnic_filter_ops = {
 	.poll_statistics = poll_statistics,
 };
 
-void ntnic_filter_init(void)
+void nthw_filter_ops_init(void)
 {
 	nthw_reg_filter_ops(&ntnic_filter_ops);
 }
drivers/net/ntnic/ntnic_mod_reg.c +9 -9
index 67ba694e25..00eb07f848 100644
@@ -50,7 +50,7 @@ void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops)
 const struct ntnic_filter_ops *nthw_get_filter_ops(void)
 {
 	if (ntnic_filter_ops == NULL)
-		ntnic_filter_init();
+		nthw_filter_ops_init();
 
 	return ntnic_filter_ops;
 }
@@ -82,7 +82,7 @@ void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops)
 const struct link_ops_s *nthw_get_agx_100g_link_ops(void)
 {
 	if (link_agx_100g_ops == NULL)
-		link_agx_100g_init();
+		nthw_link_agx_100g_ops_init();
 	return link_agx_100g_ops;
 }
 
@@ -110,7 +110,7 @@ void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops)
 const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops(void)
 {
 	if (nt4ga_stat_ops == NULL)
-		nt4ga_stat_ops_init();
+		nthw_stat_ops_init();
 
 	return nt4ga_stat_ops;
 }
@@ -139,7 +139,7 @@ void nthw_reg_clk9563_ops(struct clk9563_ops *ops)
 struct clk9563_ops *nthw_get_clk9563_ops(void)
 {
 	if (clk9563_ops == NULL)
-		clk9563_ops_init();
+		nthw_clk9563_ops_init();
 	return clk9563_ops;
 }
 
@@ -153,7 +153,7 @@ void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops)
 struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops(void)
 {
 	if (rst_nt200a0x_ops == NULL)
-		rst_nt200a0x_ops_init();
+		nthw_rst_nt200a0x_ops_init();
 	return rst_nt200a0x_ops;
 }
 
@@ -167,7 +167,7 @@ void nthw_reg_rst9563_ops(struct rst9563_ops *ops)
 struct rst9563_ops *nthw_get_rst9563_ops(void)
 {
 	if (rst9563_ops == NULL)
-		rst9563_ops_init();
+		nthw_rst9563_ops_init();
 	return rst9563_ops;
 }
 
@@ -188,7 +188,7 @@ void nthw_reg_rst9574_ops(struct rst9574_ops *ops)
 struct rst9574_ops *nthw_get_rst9574_ops(void)
 {
 	if (rst9574_ops == NULL)
-		rst9574_ops_init();
+		nthw_rst9574_ops_init();
 
 	return rst9574_ops;
 }
@@ -203,7 +203,7 @@ void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops)
 struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops(void)
 {
 	if (rst_nt400dxx_ops == NULL)
-		rst_nt400dxx_ops_init();
+		nthw_rst_nt400dxx_ops_init();
 
 	return rst_nt400dxx_ops;
 }
@@ -286,7 +286,7 @@ void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops)
 struct ntnic_xstats_ops *nthw_get_xstats_ops(void)
 {
 	if (ntnic_xstats_ops == NULL)
-		ntnic_xstats_ops_init();
+		nthw_xstats_ops_init();
 
 	return ntnic_xstats_ops;
 }
drivers/net/ntnic/ntnic_mod_reg.h +9 -9
index 2ed2286911..b534b09234 100644
@@ -141,7 +141,7 @@ struct ntnic_filter_ops {
 
 void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops);
 const struct ntnic_filter_ops *nthw_get_filter_ops(void);
-void ntnic_filter_init(void);
+void nthw_filter_ops_init(void);
 
 struct link_ops_s {
 	int (*link_init)(struct adapter_info_s *p_adapter_info, nthw_fpga_t *p_fpga);
@@ -153,7 +153,7 @@ void nthw_link_100g_init(void);
 
 void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops);
 const struct link_ops_s *nthw_get_agx_100g_link_ops(void);
-void link_agx_100g_init(void);
+void nthw_link_agx_100g_ops_init(void);
 
 struct port_ops {
 	bool (*get_nim_present)(struct adapter_info_s *p, int port);
@@ -220,7 +220,7 @@ struct nt4ga_stat_ops {
 
 void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops);
 const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops(void);
-void nt4ga_stat_ops_init(void);
+void nthw_stat_ops_init(void);
 
 struct adapter_ops {
 	int (*init)(struct adapter_info_s *p_adapter_info);
@@ -240,7 +240,7 @@ struct clk9563_ops {
 
 void nthw_reg_clk9563_ops(struct clk9563_ops *ops);
 struct clk9563_ops *nthw_get_clk9563_ops(void);
-void clk9563_ops_init(void);
+void nthw_clk9563_ops_init(void);
 
 struct rst_nt200a0x_ops {
 	int (*nthw_fpga_rst_nt200a0x_init)(struct fpga_info_s *p_fpga_info,
@@ -251,7 +251,7 @@ struct rst_nt200a0x_ops {
 
 void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops);
 struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops(void);
-void rst_nt200a0x_ops_init(void);
+void nthw_rst_nt200a0x_ops_init(void);
 
 struct rst9563_ops {
 	int (*nthw_fpga_rst9563_init)(struct fpga_info_s *p_fpga_info,
@@ -260,7 +260,7 @@ struct rst9563_ops {
 
 void nthw_reg_rst9563_ops(struct rst9563_ops *ops);
 struct rst9563_ops *nthw_get_rst9563_ops(void);
-void rst9563_ops_init(void);
+void nthw_rst9563_ops_init(void);
 
 struct rst9574_ops {
 	int (*nthw_fpga_rst9574_init)(struct fpga_info_s *p_fpga_info,
@@ -271,7 +271,7 @@ struct rst9574_ops {
 
 void nthw_reg_rst9574_ops(struct rst9574_ops *ops);
 struct rst9574_ops *nthw_get_rst9574_ops(void);
-void rst9574_ops_init(void);
+void nthw_rst9574_ops_init(void);
 
 struct rst_nt400dxx_ops {
 	int (*nthw_fpga_rst_nt400dxx_init)(struct fpga_info_s *p_fpga_info);
@@ -280,7 +280,7 @@ struct rst_nt400dxx_ops {
 
 void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops);
 struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops(void);
-void rst_nt400dxx_ops_init(void);
+void nthw_rst_nt400dxx_ops_init(void);
 
 struct flow_backend_ops {
 	const struct flow_api_backend_ops *(*nthw_bin_flow_backend_init)(nthw_fpga_t *p_fpga,
@@ -593,6 +593,6 @@ struct ntnic_xstats_ops {
 
 void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops);
 struct ntnic_xstats_ops *nthw_get_xstats_ops(void);
-void ntnic_xstats_ops_init(void);
+void nthw_xstats_ops_init(void);
 
 #endif	/* __NTNIC_MOD_REG_H__ */
drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c +1 -1
index 1ebf1b8eb5..ab3f144fa2 100644
@@ -819,7 +819,7 @@ static struct ntnic_xstats_ops ops = {
 	.nthw_xstats_get_by_id = nthw_xstats_get_by_id
 };
 
-void ntnic_xstats_ops_init(void)
+void nthw_xstats_ops_init(void)
 {
 	NT_LOG_DBGX(DBG, NTNIC, "xstats module was initialized");
 	nthw_reg_xstats_ops(&ops);
Signature · 1 line
2.45.0
#75 lore raw

PATCH 23/24 net/ntnic: rename nim agx setup function

In reply to Serhii Iliushyk

Add prefix nthw_ to nim_agx_setup to follow naming convention.

---
 drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c | 2 +-
 drivers/net/ntnic/nim/i2c_nim.c                                 | 2 +-
 drivers/net/ntnic/nim/i2c_nim.h                                 | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
index 36ecf0d0ec..8bd6584b1d 100644
@@ -991,7 +991,7 @@ int nt4ga_agx_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nthw_f
 		for (i = 0; i < nb_ports; i++) {
 			/* 2 + adapter port number */
 			const uint8_t instance = (uint8_t)(2U + i);
-			nim_agx_setup(&nim_ctx[i], p_nthw_agx->p_io_nim, p_nthw_agx->p_i2cm,
+			nthw_nim_agx_setup(&nim_ctx[i], p_nthw_agx->p_io_nim, p_nthw_agx->p_i2cm,
 				p_nthw_agx->p_pca9849);
 			nim_ctx[i].hwagx.mux_channel = i;
 			nim_ctx[i].instance = instance;	/* not used */
drivers/net/ntnic/nim/i2c_nim.c +1 -1
index a394b4c5d4..9393467904 100644
@@ -881,7 +881,7 @@ bool nthw_qsfp28_set_fec_enable(nim_i2c_ctx_p ctx, bool media_side_fec, bool hos
 	return true;
 }
 
-void nim_agx_setup(struct nim_i2c_ctx *ctx, nthw_pcal6416a_t *p_io_nim, nthw_i2cm_t *p_nt_i2cm,
+void nthw_nim_agx_setup(struct nim_i2c_ctx *ctx, nthw_pcal6416a_t *p_io_nim, nthw_i2cm_t *p_nt_i2cm,
 	nthw_pca9849_t *p_ca9849)
 {
 	ctx->hwagx.p_nt_i2cm = p_nt_i2cm;
drivers/net/ntnic/nim/i2c_nim.h +1 -1
index 61dfedaa4f..2fdfd37a03 100644
@@ -36,7 +36,7 @@ int nthw_construct_and_preinit_nim(nim_i2c_ctx_p ctx, void *extra);
 void nthw_qsfp28_set_high_power(nim_i2c_ctx_p ctx);
 bool nthw_qsfp28_set_fec_enable(nim_i2c_ctx_p ctx, bool media_side_fec, bool host_side_fec);
 
-void nim_agx_setup(struct nim_i2c_ctx *ctx, nthw_pcal6416a_t *p_io_nim, nthw_i2cm_t *p_nt_i2cm,
+void nthw_nim_agx_setup(struct nim_i2c_ctx *ctx, nthw_pcal6416a_t *p_io_nim, nthw_i2cm_t *p_nt_i2cm,
 	nthw_pca9849_t *p_ca9849);
 
 #endif	/* I2C_NIM_H_ */
Signature · 1 line
2.45.0
#76 lore raw

PATCH 24/24 net/ntnic: rename table ID functions

In reply to Serhii Iliushyk

Extent table id functions with prefix nthw_.

---
 drivers/net/ntnic/nthw/flow_api/flow_id_table.c  | 10 +++++-----
 drivers/net/ntnic/nthw/flow_api/flow_id_table.h  | 10 +++++-----
 .../profile_inline/flow_api_profile_inline.c     | 16 ++++++++--------
 3 files changed, 18 insertions(+), 18 deletions(-)
drivers/net/ntnic/nthw/flow_api/flow_id_table.c +5 -5
index f22796597f..f7c983fb9f 100644
@@ -64,7 +64,7 @@ static inline uint32_t ntnic_id_table_array_pop_free_id(struct ntnic_id_table_da
 	return id;
 }
 
-void *ntnic_id_table_create(void)
+void *nthw_id_table_create(void)
 {
 	struct ntnic_id_table_data *handle = calloc(1, sizeof(struct ntnic_id_table_data));
 
@@ -74,7 +74,7 @@ void *ntnic_id_table_create(void)
 	return handle;
 }
 
-void ntnic_id_table_destroy(void *id_table)
+void nthw_id_table_destroy(void *id_table)
 {
 	struct ntnic_id_table_data *handle = id_table;
 
@@ -84,7 +84,7 @@ void ntnic_id_table_destroy(void *id_table)
 	free(id_table);
 }
 
-uint32_t ntnic_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_t caller_id,
+uint32_t nthw_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_t caller_id,
 	uint8_t type)
 {
 	struct ntnic_id_table_data *handle = id_table;
@@ -106,7 +106,7 @@ uint32_t ntnic_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_t
 	return new_id;
 }
 
-void ntnic_id_table_free_id(void *id_table, uint32_t id)
+void nthw_id_table_free_id(void *id_table, uint32_t id)
 {
 	struct ntnic_id_table_data *handle = id_table;
 
@@ -129,7 +129,7 @@ void ntnic_id_table_free_id(void *id_table, uint32_t id)
 	rte_spinlock_unlock(&handle->mtx);
 }
 
-void ntnic_id_table_find(void *id_table, uint32_t id, union flm_handles *flm_h, uint8_t *caller_id,
+void nthw_id_table_find(void *id_table, uint32_t id, union flm_handles *flm_h, uint8_t *caller_id,
 	uint8_t *type)
 {
 	struct ntnic_id_table_data *handle = id_table;
drivers/net/ntnic/nthw/flow_api/flow_id_table.h +5 -5
index edb4f42729..99789955bc 100644
@@ -13,14 +13,14 @@ union flm_handles {
 	void *p;
 };
 
-void *ntnic_id_table_create(void);
-void ntnic_id_table_destroy(void *id_table);
+void *nthw_id_table_create(void);
+void nthw_id_table_destroy(void *id_table);
 
-uint32_t ntnic_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_t caller_id,
+uint32_t nthw_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_t caller_id,
 	uint8_t type);
-void ntnic_id_table_free_id(void *id_table, uint32_t id);
+void nthw_id_table_free_id(void *id_table, uint32_t id);
 
-void ntnic_id_table_find(void *id_table, uint32_t id, union flm_handles *flm_h, uint8_t *caller_id,
+void nthw_id_table_find(void *id_table, uint32_t id, union flm_handles *flm_h, uint8_t *caller_id,
 	uint8_t *type);
 
 #endif	/* FLOW_ID_TABLE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +8 -8
index 3f80e0f945..d9c10a8eab 100644
@@ -211,7 +211,7 @@ static int flow_mtr_create_meter(struct flow_eth_dev *dev,
 
 	union flm_handles flm_h;
 	flm_h.idx = mtr_id;
-	uint32_t flm_id = ntnic_id_table_get_id(dev->ndev->id_table_handle, flm_h, caller_id, 2);
+	uint32_t flm_id = nthw_id_table_get_id(dev->ndev->id_table_handle, flm_h, caller_id, 2);
 
 	learn_record->sw9 = flm_id;
 	learn_record->kid = 1;
@@ -327,7 +327,7 @@ static int flow_mtr_destroy_meter(struct flow_eth_dev *dev, uint8_t caller_id, u
 	mtr_stat[mtr_id].n_pkt_base = 0;
 	mtr_stat[mtr_id].buckets = NULL;
 
-	ntnic_id_table_free_id(dev->ndev->id_table_handle, flm_id);
+	nthw_id_table_free_id(dev->ndev->id_table_handle, flm_id);
 
 	nthw_flm_lrn_queue_release_write_buffer(flm_lrn_queue_arr);
 
@@ -431,7 +431,7 @@ static void flm_mtr_read_inf_records(struct flow_eth_dev *dev, uint32_t *data, u
 		uint8_t caller_id;
 		uint8_t type;
 		union flm_handles flm_h;
-		ntnic_id_table_find(dev->ndev->id_table_handle, inf_data->id, &flm_h, &caller_id,
+		nthw_id_table_find(dev->ndev->id_table_handle, inf_data->id, &flm_h, &caller_id,
 			&type);
 
 		/* Check that received record hold valid meter statistics */
@@ -507,7 +507,7 @@ static void flm_mtr_read_sta_records(struct flow_eth_dev *dev, uint32_t *data, u
 		uint8_t caller_id;
 		uint8_t type;
 		union flm_handles flm_h;
-		ntnic_id_table_find(dev->ndev->id_table_handle, sta_data->id, &flm_h, &caller_id,
+		nthw_id_table_find(dev->ndev->id_table_handle, sta_data->id, &flm_h, &caller_id,
 			&type);
 
 		if (type == 1) {
@@ -958,14 +958,14 @@ static int flm_flow_programming(struct flow_handle *fh, uint32_t flm_op)
 	if (flm_op == NT_FLM_OP_LEARN) {
 		union flm_handles flm_h;
 		flm_h.p = fh;
-		fh->flm_id = ntnic_id_table_get_id(fh->dev->ndev->id_table_handle, flm_h,
+		fh->flm_id = nthw_id_table_get_id(fh->dev->ndev->id_table_handle, flm_h,
 			fh->caller_id, 1);
 	}
 
 	uint32_t flm_id = fh->flm_id;
 
 	if (flm_op == NT_FLM_OP_UNLEARN) {
-		ntnic_id_table_free_id(fh->dev->ndev->id_table_handle, flm_id);
+		nthw_id_table_free_id(fh->dev->ndev->id_table_handle, flm_id);
 
 		if (rte_atomic_load_explicit(&fh->learn_ignored, rte_memory_order_seq_cst) == 1)
 			return 0;
@@ -4057,7 +4057,7 @@ int nthw_init_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev)
 
 		nthw_mod_flm_pst_flush(&ndev->be, 0, ALL_ENTRIES);
 
-		ndev->id_table_handle = ntnic_id_table_create();
+		ndev->id_table_handle = nthw_id_table_create();
 
 		if (ndev->id_table_handle == NULL)
 			goto err_exit0;
@@ -4132,7 +4132,7 @@ int nthw_done_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev)
 		free(ndev->flm_mtr_handle);
 
 		nthw_flow_group_handle_destroy(&ndev->group_handle);
-		ntnic_id_table_destroy(ndev->id_table_handle);
+		nthw_id_table_destroy(ndev->id_table_handle);
 
 		nthw_mod_cat_cfn_set(&ndev->be, HW_CAT_CFN_PRESET_ALL, 0, 0, 0);
 		nthw_mod_cat_cfn_flush(&ndev->be, 0, 1);
Signature · 1 line
2.45.0
#77 lore raw

Re: [PATCH v1 00/24] Migrate threads to the DPDK service framework and refactor naming for exported symbols

In reply to Serhii Iliushyk
Quoted 22 lines · On Mon, 20 Oct 2025 18:35:51 +0200 Serhii Iliushyk <[email protected]> wrote:

This modification provides better resource (CPU) management for NTNIC PMD.

The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.

After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.

The service cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with a special API by the application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.

Quoted 3 lines

This patch series also includes aligning the naming of the exported symbols to avoid potential conflicts with other applications and libraries.
The main change is to add the prefix "nthw_".

I assume you meant v3 not v1 here.

#78 lore raw

Re: [PATCH v1 00/24] Migrate threads to the DPDK service framework and refactor naming for exported symbols

In reply to Serhii Iliushyk
Quoted 180 lines · On Mon, 20 Oct 2025 18:35:51 +0200 Serhii Iliushyk <[email protected]> wrote:

This modification provides better resource (CPU) management for NTNIC PMD.

The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.

After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.

The service cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with a special API by the application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.

This patch series also includes aligning the naming of the exported symbols to avoid potential conflicts with other applications and libraries.
The main change is to add the prefix "nthw_".

Serhii Iliushyk (24):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: avoid using thread API net/ntnic: fix potential format overflow net/ntnic: single file function as static net/ntnic: remove unused functions net/ntnic: move nthw to prefix part net/ntnic: change prefix hw to prefix nthw net/ntnic: modify prefix flow with prefix nthw net/ntnic: change prefix flm to prefix nthw net/ntnic: change prefix nt to prefix nthw net/ntnic: change prefix ntlog to prefix nthw net/ntnic: change prefix km to prefix nthw net/ntnic: change prefix set to prefix nthw net/ntnic: rename common hash and flow functions net/ntnic: rename register ops function net/ntnic: rename get ops functions net/ntnic: rename ops init functions net/ntnic: rename nim agx setup function net/ntnic: rename table ID functions

 doc/guides/nics/ntnic.rst                     |  112 ++
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |   41 +-
 .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c |   10 +-
 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c |   54 +-
 .../net/ntnic/include/common_adapter_defs.h   |   15 -
 drivers/net/ntnic/include/create_elements.h   |    9 -
 drivers/net/ntnic/include/flow_api.h          |   10 +-
 drivers/net/ntnic/include/flow_api_engine.h   |   18 +-
 drivers/net/ntnic/include/hw_mod_backend.h    |  281 ++--
 drivers/net/ntnic/include/nt4ga_adapter.h     |    4 -
 drivers/net/ntnic/include/ntdrv_4ga.h         |    4 -
 drivers/net/ntnic/include/ntnic_dbs.h         |   22 +-
 drivers/net/ntnic/include/ntnic_stat.h        |    2 +-
 drivers/net/ntnic/include/ntos_drv.h          |    4 +-
 .../link_mgmt/link_100g/nt4ga_link_100g.c     |  315 ++--
 .../link_agx_100g/nt4ga_agx_link_100g.c       |  326 ++--
 drivers/net/ntnic/link_mgmt/nt4ga_link.c      |    2 +-
 drivers/net/ntnic/meson.build                 |    2 +
 drivers/net/ntnic/nim/i2c_nim.c               |   10 +-
 drivers/net/ntnic/nim/i2c_nim.h               |    2 +-
 .../net/ntnic/nthw/core/include/nthw_fpga.h   |   14 +-
 .../net/ntnic/nthw/core/include/nthw_hif.h    |   12 -
 .../net/ntnic/nthw/core/include/nthw_iic.h    |    9 -
 .../ntnic/nthw/core/include/nthw_mac_pcs.h    |    9 -
 .../net/ntnic/nthw/core/include/nthw_pcie3.h  |   13 -
 .../nthw/core/include/nthw_pcm_nt400dxx.h     |    1 -
 .../ntnic/nthw/core/include/nthw_phy_tile.h   |    2 -
 .../net/ntnic/nthw/core/include/nthw_rpf.h    |    2 -
 .../net/ntnic/nthw/core/include/nthw_si5340.h |    2 -
 .../clock_profiles/nthw_fpga_clk9563.c        |    4 +-
 .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c   |    8 +-
 .../core/nt200a0x/reset/nthw_fpga_rst9563.c   |    8 +-
 .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c   |    6 +-
 .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c   |    8 +-
 .../core/nt400dxx/reset/nthw_fpga_rst9574.c   |   22 +-
 .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c   |   36 +-
 drivers/net/ntnic/nthw/core/nthw_fpga.c       |   22 +-
 drivers/net/ntnic/nthw/core/nthw_hif.c        |   90 --
 drivers/net/ntnic/nthw/core/nthw_i2cm.c       |    4 +-
 drivers/net/ntnic/nthw/core/nthw_igam.c       |    4 +-
 drivers/net/ntnic/nthw/core/nthw_iic.c        |  240 +--
 drivers/net/ntnic/nthw/core/nthw_mac_pcs.c    |   67 +-
 drivers/net/ntnic/nthw/core/nthw_pca9532.c    |    2 -
 drivers/net/ntnic/nthw/core/nthw_pcal6416a.c  |    1 -
 drivers/net/ntnic/nthw/core/nthw_pcie3.c      |   86 --
 .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c   |    5 -
 drivers/net/ntnic/nthw/core/nthw_phy_tile.c   |   51 +-
 drivers/net/ntnic/nthw/core/nthw_rpf.c        |   14 -
 .../net/ntnic/nthw/core/nthw_si5332_si5156.c  |    3 +-
 drivers/net/ntnic/nthw/core/nthw_si5340.c     |    6 +-
 drivers/net/ntnic/nthw/core/nthw_spi_v3.c     |   12 +-
 drivers/net/ntnic/nthw/dbs/nthw_dbs.c         |   22 +-
 drivers/net/ntnic/nthw/flow_api/flow_api.c    |  253 ++--
 .../nthw/flow_api/flow_backend/flow_backend.c | 1342 ++++++++---------
 drivers/net/ntnic/nthw/flow_api/flow_filter.c |    4 +-
 .../net/ntnic/nthw/flow_api/flow_hsh_cfg.c    |   46 +-
 .../net/ntnic/nthw/flow_api/flow_hsh_cfg.h    |    2 +-
 .../net/ntnic/nthw/flow_api/flow_id_table.c   |   10 +-
 .../net/ntnic/nthw/flow_api/flow_id_table.h   |   10 +-
 drivers/net/ntnic/nthw/flow_api/flow_kcc.c    |    2 +-
 drivers/net/ntnic/nthw/flow_api/flow_km.c     |  134 +-
 .../nthw/flow_api/hw_mod/hw_mod_backend.c     |   18 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c   |  356 ++---
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c   |   70 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c   |   14 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c    |  107 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c   |   40 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c   |   32 +-
 .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c      |   14 +-
 .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c   |   80 +-
 .../flow_api/profile_inline/flm_age_queue.c   |   22 +-
 .../flow_api/profile_inline/flm_age_queue.h   |   20 +-
 .../flow_api/profile_inline/flm_lrn_queue.c   |   12 +-
 .../flow_api/profile_inline/flm_lrn_queue.h   |   12 +-
 .../profile_inline/flow_api_hw_db_inline.c    | 1138 +++++++-------
 .../profile_inline/flow_api_hw_db_inline.h    |   99 +-
 .../profile_inline/flow_api_profile_inline.c  |  598 ++++----
 .../profile_inline/flow_api_profile_inline.h  |   49 +-
 .../ntnic/nthw/flow_filter/flow_nthw_cat.c    |  230 +--
 .../ntnic/nthw/flow_filter/flow_nthw_cat.h    |  230 +--
 .../ntnic/nthw/flow_filter/flow_nthw_csu.c    |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_csu.h    |   24 +-
 .../ntnic/nthw/flow_filter/flow_nthw_flm.c    |  278 ++--
 .../ntnic/nthw/flow_filter/flow_nthw_flm.h    |  278 ++--
 .../ntnic/nthw/flow_filter/flow_nthw_hfu.c    |   58 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hfu.h    |   58 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hsh.c    |   60 +-
 .../ntnic/nthw/flow_filter/flow_nthw_hsh.h    |   60 +-
 .../ntnic/nthw/flow_filter/flow_nthw_ifr.c    |   30 +-
 .../ntnic/nthw/flow_filter/flow_nthw_ifr.h    |   30 +-
 .../ntnic/nthw/flow_filter/flow_nthw_info.c   |   88 +-
 .../ntnic/nthw/flow_filter/flow_nthw_info.h   |   88 +-
 .../net/ntnic/nthw/flow_filter/flow_nthw_km.c |  160 +-
 .../net/ntnic/nthw/flow_filter/flow_nthw_km.h |  162 +-
 .../ntnic/nthw/flow_filter/flow_nthw_pdb.c    |   54 +-
 .../ntnic/nthw/flow_filter/flow_nthw_pdb.h    |   56 +-
 .../ntnic/nthw/flow_filter/flow_nthw_qsl.c    |   68 +-
 .../ntnic/nthw/flow_filter/flow_nthw_qsl.h    |   68 +-
 .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c |   32 +-
 .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h |   32 +-
 .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c |   28 +-
 .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h |   28 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h |   22 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c |   20 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h |   20 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c |   42 +-
 .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h |   46 +-
 .../net/ntnic/nthw/model/nthw_fpga_model.c    |  577 +++----
 .../net/ntnic/nthw/model/nthw_fpga_model.h    |   28 -
 drivers/net/ntnic/nthw/nthw_platform.c        |    2 +-
 drivers/net/ntnic/nthw/nthw_platform_drv.h    |    2 +-
 drivers/net/ntnic/nthw/nthw_rac.c             |   28 +-
 .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c  |   20 +-
 .../nthw/supported/nthw_fpga_mod_str_map.c    |    2 +-
 .../nthw/supported/nthw_fpga_mod_str_map.h    |    2 +-
 drivers/net/ntnic/ntlog/ntlog.c               |    6 +-
 drivers/net/ntnic/ntlog/ntlog.h               |    6 +-
 drivers/net/ntnic/ntnic_ethdev.c              |  617 ++++----
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c |   66 +-
 drivers/net/ntnic/ntnic_mod_reg.c             |   96 +-
 drivers/net/ntnic/ntnic_mod_reg.h             |  142 +-
 drivers/net/ntnic/ntnic_vfio.c                |   18 +-
 drivers/net/ntnic/ntnic_vfio.h                |   12 +-
 drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c |    4 +-
 drivers/net/ntnic/ntutil/nt_service.c         |  127 ++
 drivers/net/ntnic/ntutil/nt_service.h         |   62 +
 drivers/net/ntnic/ntutil/nt_util.c            |   75 +-
Quoted 8 lines
 drivers/net/ntnic/ntutil/nt_util.h            |   21 +-
 drivers/net/ntnic/rte_pmd_ntnic.c             |  104 ++
 drivers/net/ntnic/rte_pmd_ntnic.h             |   26 +
 131 files changed, 5500 insertions(+), 5449 deletions(-)
 delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
 create mode 100644 drivers/net/ntnic/ntutil/nt_service.c
 create mode 100644 drivers/net/ntnic/ntutil/nt_service.h
 create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c

Updated to this version in next-net

#79 lore raw

PATCH v2 2/7 net/ntnic: migrate flm update thread to service

In reply to Serhii Iliushyk

This commit adds the FLM update service to the NTNIC PMD. The service is responsible for handling creating/destroying flows.

---
 drivers/net/ntnic/include/ntdrv_4ga.h         |  1 -
 drivers/net/ntnic/ntnic_ethdev.c              | 67 ++++++++++++-------
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 +++++
 drivers/net/ntnic/ntutil/nt_service.c         |  4 +-
 drivers/net/ntnic/rte_pmd_ntnic.h             |  3 +-
 5 files changed, 62 insertions(+), 30 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
index 78cf10368a..35afcd546c 100644
@@ -15,7 +15,6 @@ typedef struct ntdrv_4ga_s {
 	char *p_drv_name;
 
 	volatile bool b_shutdown;
-	rte_thread_t flm_thread;
 	rte_spinlock_t stat_lck;
 	rte_thread_t stat_thread;
 	rte_thread_t port_event_thread;
drivers/net/ntnic/ntnic_ethdev.c +41 -26

102 lines not on this page · raw message

drivers/net/ntnic/ntnic_filter/ntnic_filter.c +17 -0
index fc06cf12c3..c6c448312f 100644
@@ -6,6 +6,7 @@
 #include <rte_flow_driver.h>
 #include <rte_pci.h>
 #include <rte_version.h>
+#include <rte_pmd_ntnic.h>
 
 #include "ntlog.h"
 #include "nt_util.h"
@@ -13,6 +14,8 @@
 #include "ntnic_mod_reg.h"
 #include "ntos_system.h"
 #include "ntos_drv.h"
+#include "nt_service.h"
+#include "rte_service.h"
 
 #define MAX_RTE_FLOWS 8192
 
@@ -543,6 +546,13 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_
 		return -1;
 	}
 
+	struct nt_service *srv = nthw_service_get_info(RTE_NTNIC_SERVICE_FLM_UPDATE);
+
+	if (!srv || !NT_SERVICE_GET_STATE(srv) || !rte_service_runstate_get(srv->id))	{
+		NT_LOG(ERR, FILTER, "flm update service is not started. Flow cannot be destroyed");
+		return -1;
+	}
+
 	struct pmd_internals *internals = eth_dev->data->dev_private;
 
 	error->type = RTE_FLOW_ERROR_TYPE_NONE;
@@ -580,6 +590,13 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,
 		return NULL;
 	}
 
+	struct nt_service *srv = nthw_service_get_info(RTE_NTNIC_SERVICE_FLM_UPDATE);
+
+	if (!srv || !NT_SERVICE_GET_STATE(srv) || !rte_service_runstate_get(srv->id))	{
+		NT_LOG(ERR, FILTER, "flm update service is not started. Flow cannot be created");
+		return NULL;
+	}
+
 	struct pmd_internals *internals = eth_dev->data->dev_private;
 
 	struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info;
drivers/net/ntnic/ntutil/nt_service.c +2 -2
index 4ef1233f12..86f709e401 100644
@@ -12,8 +12,8 @@
 #define NT_SERVICE_UNKNOWN_ID (-1)
 
 static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = {
-	[0] = {
-		.tag = RTE_NTNIC_SERVICE_MAX,
+	[RTE_NTNIC_SERVICE_FLM_UPDATE] = {
+		.tag = RTE_NTNIC_SERVICE_FLM_UPDATE,
 		.id = NT_SERVICE_UNKNOWN_ID,
 		.lcore = RTE_MAX_LCORE,
 		.initialized = false,
drivers/net/ntnic/rte_pmd_ntnic.h +2 -1
index 7a491319fa..d6236dae32 100644
@@ -41,7 +41,8 @@ enum rte_ntnic_event_type {
 };
 
 enum rte_ntnic_service_tag {
-	RTE_NTNIC_SERVICE_MAX = 1
+	RTE_NTNIC_SERVICE_FLM_UPDATE = 0,
+	RTE_NTNIC_SERVICE_MAX
 };
 
 /**
Signature · 1 line
2.45.0
#80 lore raw

PATCH v2 3/7 net/ntnic: migrate statistic thread to service

In reply to Serhii Iliushyk

The statistic service is responsible for collecting statistics.

---
 drivers/net/ntnic/include/ntdrv_4ga.h |   1 -
 drivers/net/ntnic/ntnic_ethdev.c      | 146 ++++++++++++++------------
 drivers/net/ntnic/ntutil/nt_service.c |   6 ++
 drivers/net/ntnic/rte_pmd_ntnic.h     |   1 +
 4 files changed, 84 insertions(+), 70 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
index 35afcd546c..c143c0c2b6 100644
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {
 
 	volatile bool b_shutdown;
 	rte_spinlock_t stat_lck;
-	rte_thread_t stat_thread;
 	rte_thread_t port_event_thread;
 } ntdrv_4ga_t;
 
drivers/net/ntnic/ntnic_ethdev.c +77 -69

179 lines not on this page · raw message

drivers/net/ntnic/ntutil/nt_service.c +6 -0
index 86f709e401..c109b44483 100644
@@ -18,6 +18,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = {
 		.lcore = RTE_MAX_LCORE,
 		.initialized = false,
 	},
+	[RTE_NTNIC_SERVICE_STAT] = {
+		.tag = RTE_NTNIC_SERVICE_STAT,
+		.id = NT_SERVICE_UNKNOWN_ID,
+		.lcore = RTE_MAX_LCORE,
+		.initialized = false,
+	},
 };
 
 inline struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
index d6236dae32..6fe6541984 100644
@@ -42,6 +42,7 @@ enum rte_ntnic_event_type {
 
 enum rte_ntnic_service_tag {
 	RTE_NTNIC_SERVICE_FLM_UPDATE = 0,
+	RTE_NTNIC_SERVICE_STAT = 1,
 	RTE_NTNIC_SERVICE_MAX
 };
 
Signature · 1 line
2.45.0
#81 lore raw

PATCH v2 4/7 net/ntnic: migrate port event thread to service

In reply to Serhii Iliushyk

The port event service is responsible for handling port events.

---
 drivers/net/ntnic/include/ntdrv_4ga.h |   1 -
 drivers/net/ntnic/include/ntos_drv.h  |   2 +-
 drivers/net/ntnic/ntnic_ethdev.c      | 271 +++++++++++++++-----------
 drivers/net/ntnic/ntutil/nt_service.c |  12 ++
 drivers/net/ntnic/rte_pmd_ntnic.h     |   2 +
 5 files changed, 174 insertions(+), 114 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
index c143c0c2b6..ee0e66c4d4 100644
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {
 
 	volatile bool b_shutdown;
 	rte_spinlock_t stat_lck;
-	rte_thread_t port_event_thread;
 } ntdrv_4ga_t;
 
 #endif	/* __NTDRV_4GA_H__ */
drivers/net/ntnic/include/ntos_drv.h +1 -1
index 047c077057..e6e46f8cc1 100644
@@ -21,7 +21,7 @@
 #define NUM_MULTICAST_ADDRS_PER_PORT (16U)
 
 #define NUM_ADAPTER_MAX (8)
-#define NUM_ADAPTER_PORTS_MAX (128)
+#define NUM_ADAPTER_PORTS_MAX (2)
 
 
 /* Max RSS queues */
drivers/net/ntnic/ntnic_ethdev.c +159 -112

311 lines not on this page · raw message

drivers/net/ntnic/ntutil/nt_service.c +12 -0
index c109b44483..9f22ee2bba 100644
@@ -24,6 +24,18 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = {
 		.lcore = RTE_MAX_LCORE,
 		.initialized = false,
 	},
+	[RTE_NTNIC_SERVICE_PORT_0_EVENT] = {
+		.tag = RTE_NTNIC_SERVICE_PORT_0_EVENT,
+		.id = NT_SERVICE_UNKNOWN_ID,
+		.lcore = RTE_MAX_LCORE,
+		.initialized = false,
+	},
+	[RTE_NTNIC_SERVICE_PORT_1_EVENT] = {
+		.tag = RTE_NTNIC_SERVICE_PORT_1_EVENT,
+		.id = NT_SERVICE_UNKNOWN_ID,
+		.lcore = RTE_MAX_LCORE,
+		.initialized = false,
+	},
 };
 
 inline struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +2 -0
index 6fe6541984..1a68cb8e37 100644
@@ -43,6 +43,8 @@ enum rte_ntnic_event_type {
 enum rte_ntnic_service_tag {
 	RTE_NTNIC_SERVICE_FLM_UPDATE = 0,
 	RTE_NTNIC_SERVICE_STAT = 1,
+	RTE_NTNIC_SERVICE_PORT_0_EVENT = 2,
+	RTE_NTNIC_SERVICE_PORT_1_EVENT = 3,
 	RTE_NTNIC_SERVICE_MAX
 };
 
Signature · 1 line
2.45.0
#82 lore raw

PATCH v2 5/7 net/ntnic: migrate adapter mon thread to service

In reply to Serhii Iliushyk

The adapter monitor service is responsible for link state management.

---
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |  25 +-
 .../net/ntnic/include/common_adapter_defs.h   |  15 -
 drivers/net/ntnic/include/nt4ga_adapter.h     |   3 -
 drivers/net/ntnic/include/ntnic_stat.h        |   2 +-
 drivers/net/ntnic/include/ntos_drv.h          |   2 +-
 .../link_mgmt/link_100g/nt4ga_link_100g.c     | 303 +++++++++--------
 .../link_agx_100g/nt4ga_agx_link_100g.c       | 306 ++++++++++--------
 drivers/net/ntnic/ntutil/nt_service.c         |   6 +
 drivers/net/ntnic/rte_pmd_ntnic.h             |   1 +
 9 files changed, 334 insertions(+), 329 deletions(-)
 delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
drivers/net/ntnic/adapter/nt4ga_adapter.c +2 -23
index 526ecc8089..363874c85f 100644
@@ -5,6 +5,7 @@
 
 #include <rte_thread.h>
 
+#include "nt_service.h"
 #include "ntlog.h"
 #include "nthw_fpga.h"
 #include "ntnic_mod_reg.h"
@@ -12,28 +13,6 @@
 /*
  * Global variables shared by NT adapter types
  */
-rte_thread_t monitor_tasks[NUM_ADAPTER_MAX];
-volatile int monitor_task_is_running[NUM_ADAPTER_MAX];
-
-/*
- * Signal-handler to stop all monitor threads
- */
-static void stop_monitor_tasks(int signum)
-{
-	const size_t N = ARRAY_SIZE(monitor_task_is_running);
-	size_t i;
-
-	/* Stop all monitor tasks */
-	for (i = 0; i < N; i++) {
-		const int is_running = monitor_task_is_running[i];
-		monitor_task_is_running[i] = 0;
-
-		if (signum == -1 && is_running != 0) {
-			rte_thread_join(monitor_tasks[i], NULL);
-			memset(&monitor_tasks[i], 0, sizeof(monitor_tasks[0]));
-		}
-	}
-}
 
 static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE *pfh)
 {
@@ -255,7 +234,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)
 	int i;
 	int res = -1;
 
-	stop_monitor_tasks(-1);
+	nthw_service_del(RTE_NTNIC_SERVICE_ADAPTER_MON);
 
 	/* Nt4ga Deinit Filter */
 	nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
drivers/net/ntnic/include/common_adapter_defs.h deleted +0 -15
deleted file mode 100644
index 6ed9121f0f..0000000000
@@ -1,15 +0,0 @@
-/*
- * SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2023 Napatech A/S
- */
-
-#ifndef _COMMON_ADAPTER_DEFS_H_
-#define _COMMON_ADAPTER_DEFS_H_
-
-/*
- * Declarations shared by NT adapter types.
- */
-#define NUM_ADAPTER_MAX (8)
-#define NUM_ADAPTER_PORTS_MAX (128)
-
-#endif	/* _COMMON_ADAPTER_DEFS_H_ */
drivers/net/ntnic/include/nt4ga_adapter.h +0 -3
index 7396b8ab65..6c701b601f 100644
@@ -47,8 +47,5 @@ typedef struct adapter_info_s {
 	int n_tx_host_buffers;
 } adapter_info_t;
 
-extern rte_thread_t monitor_tasks[NUM_ADAPTER_MAX];
-extern volatile int monitor_task_is_running[NUM_ADAPTER_MAX];
-
 
 #endif	/* _NT4GA_ADAPTER_H_ */
drivers/net/ntnic/include/ntnic_stat.h +1 -1
index 1b53f6c347..928c629fb2 100644
@@ -6,7 +6,7 @@
 #ifndef NTNIC_STAT_H_
 #define NTNIC_STAT_H_
 
-#include "common_adapter_defs.h"
+#include "ntos_drv.h"
 #include "nthw_rmc.h"
 #include "nthw_rpf.h"
 #include "nthw_fpga_model.h"
drivers/net/ntnic/include/ntos_drv.h +1 -1
index e6e46f8cc1..f353a5eca8 100644
@@ -20,7 +20,7 @@
 #define NUM_MAC_ADDRS_PER_PORT (16U)
 #define NUM_MULTICAST_ADDRS_PER_PORT (16U)
 
-#define NUM_ADAPTER_MAX (8)
+#define NUM_ADAPTER_MAX (1)
 #define NUM_ADAPTER_PORTS_MAX (2)
 
 
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +160 -143

358 lines not on this page · raw message

drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +163 -143

360 lines not on this page · raw message

drivers/net/ntnic/ntutil/nt_service.c +6 -0
index 9f22ee2bba..c39771acc2 100644
@@ -36,6 +36,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = {
 		.lcore = RTE_MAX_LCORE,
 		.initialized = false,
 	},
+	[RTE_NTNIC_SERVICE_ADAPTER_MON] = {
+		.tag = RTE_NTNIC_SERVICE_ADAPTER_MON,
+		.id = NT_SERVICE_UNKNOWN_ID,
+		.lcore = RTE_MAX_LCORE,
+		.initialized = false,
+	},
 };
 
 inline struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
index 1a68cb8e37..08e7958acd 100644
@@ -45,6 +45,7 @@ enum rte_ntnic_service_tag {
 	RTE_NTNIC_SERVICE_STAT = 1,
 	RTE_NTNIC_SERVICE_PORT_0_EVENT = 2,
 	RTE_NTNIC_SERVICE_PORT_1_EVENT = 3,
+	RTE_NTNIC_SERVICE_ADAPTER_MON = 4,
 	RTE_NTNIC_SERVICE_MAX
 };
 
Signature · 1 line
2.45.0
#83 lore raw

PATCH v2 6/7 net/ntnic: add warning about service cores

In reply to Serhii Iliushyk

This commit adds a warning message if the service cores are not available. This warning notifies a user about potential issues with ntnic services. There in no error because the service cores may be added
by application itself after the pcie_probe.

---
 drivers/net/ntnic/ntnic_ethdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/ntnic/ntnic_ethdev.c +8 -0
index 7ec1c94a14..664112f67e 100644
@@ -2607,6 +2607,14 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		}
 	}
 
+	uint32_t cores[RTE_MAX_LCORE] = {0};
+	int32_t lcore_count = rte_service_lcore_list(cores, RTE_MAX_LCORE);
+
+	if (lcore_count <= 0) {
+		NT_LOG(WRN, NTNIC, "No service cores available. "
+			"Please check if all NTNIC services are started");
+	}
+
 	return 0;
 }
 
Signature · 1 line
2.45.0
#84 lore raw

PATCH v2 7/7 net/ntnic: cleanup using pthreads and rte_thread

In reply to Serhii Iliushyk

This patch cleans up the code to use pthreads and rte_thread APIs.

---
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |  2 --
 drivers/net/ntnic/include/nt4ga_adapter.h     |  1 -
 drivers/net/ntnic/include/ntdrv_4ga.h         |  1 -
 drivers/net/ntnic/nthw/core/nthw_pca9532.c    |  2 --
 drivers/net/ntnic/nthw/core/nthw_pcal6416a.c  |  1 -
 .../net/ntnic/nthw/core/nthw_si5332_si5156.c  |  1 -
 .../profile_inline/flow_api_profile_inline.c  |  2 +-
 drivers/net/ntnic/ntnic_ethdev.c              | 22 +++++--------------
 drivers/net/ntnic/ntutil/nt_util.c            |  2 +-
 9 files changed, 7 insertions(+), 27 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +0 -2
index 363874c85f..de4e8707bf 100644
@@ -3,8 +3,6 @@
  * Copyright(c) 2023 Napatech A/S
  */
 
-#include <rte_thread.h>
-
 #include "nt_service.h"
 #include "ntlog.h"
 #include "nthw_fpga.h"
drivers/net/ntnic/include/nt4ga_adapter.h +0 -1
index 6c701b601f..0598e62b7b 100644
@@ -40,7 +40,6 @@ typedef struct adapter_info_s {
 	char *mp_port_id_str[NUM_ADAPTER_PORTS_MAX];
 	char *mp_adapter_id_str;
 	char *p_dev_name;
-	volatile bool *pb_shutdown;
 
 	int adapter_no;
 	int n_rx_host_buffers;
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
index ee0e66c4d4..4ff1f115f4 100644
@@ -14,7 +14,6 @@ typedef struct ntdrv_4ga_s {
 	struct adapter_info_s adapter_info;
 	char *p_drv_name;
 
-	volatile bool b_shutdown;
 	rte_spinlock_t stat_lck;
 } ntdrv_4ga_t;
 
drivers/net/ntnic/nthw/core/nthw_pca9532.c +0 -2
index af14cd6d06..805e0275e8 100644
@@ -3,8 +3,6 @@
  * Copyright(c) 2023 Napatech A/S
  */
 
-#include <pthread.h>
-
 #include "nt_util.h"
 #include "ntlog.h"
 
drivers/net/ntnic/nthw/core/nthw_pcal6416a.c +0 -1
index 2fca469497..f7efc196f4 100644
@@ -2,7 +2,6 @@
  * SPDX-License-Identifier: BSD-3-Clause
  * Copyright(c) 2023 Napatech A/S
  */
-#include <pthread.h>
 
 #include "nt_util.h"
 #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +0 -1
index eb11ebc67a..537d58afb7 100644
@@ -3,7 +3,6 @@
  * Copyright(c) 2023 Napatech A/S
  */
 
-#include <pthread.h>
 #include "generic/rte_spinlock.h"
 #include "nt_util.h"
 #include "ntlog.h"
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
index eaaf681ac6..2291642ca9 100644
@@ -5276,7 +5276,7 @@ struct flow_handle *flow_async_create_profile_inline(struct flow_eth_dev *dev,
 			} while (status == CELL_STATUS_INITIALIZING);
 
 			/* error handling in case that create_flow_filter() will fail in the other
-			 * thread
+			 * service
 			 */
 			if (status == CELL_STATUS_UNINITIALIZED)
 				goto err_exit;
drivers/net/ntnic/ntnic_ethdev.c +5 -17
index 664112f67e..0f70462f3d 100644
@@ -6,8 +6,6 @@
 #include <stdint.h>
 #include <stdarg.h>
 
-#include <signal.h>
-
 #include <rte_eal.h>
 #include <rte_dev.h>
 #include <rte_vfio.h>
@@ -33,12 +31,6 @@
 #include "rte_pmd_ntnic.h"
 #include "nt_service.h"
 
-const rte_thread_attr_t thread_attr = { .priority = RTE_THREAD_PRIORITY_NORMAL };
-#define THREAD_CREATE(a, b, c) rte_thread_create(a, &thread_attr, b, c)
-#define THREAD_CTRL_CREATE(a, b, c, d) rte_thread_create_internal_control(a, b, c, d)
-#define THREAD_JOIN(a) rte_thread_join(a, NULL)
-#define THREAD_FUNC static uint32_t
-#define THREAD_RETURN (0)
 #define HW_MAX_PKT_LEN (10000)
 #define MAX_MTU (HW_MAX_PKT_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN)
 #define MIN_MTU_INLINE 512
@@ -1536,14 +1528,13 @@ drv_deinit(struct drv_s *p_drv)
 	fpga_info_t *fpga_info = &p_nt_drv->adapter_info.fpga_info;
 
 	/*
-	 * Mark the global pdrv for cleared. Used by some threads to terminate.
-	 * 1 second to give the threads a chance to see the termonation.
+	 * Mark the global pdrv for cleared. Used by some services to terminate.
+	 * 1 second to give the services a chance to see the termonation.
 	 */
 	clear_pdrv(p_drv);
 	nt_os_wait_usec(1000000);
 
 	/* stop statistics service */
-	p_drv->ntdrv.b_shutdown = true;
 	nthw_service_del(RTE_NTNIC_SERVICE_STAT);
 
 	if (fpga_info->profile == FPGA_INFO_PROFILE_INLINE) {
@@ -2323,9 +2314,6 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		p_nt_drv->adapter_info.hw_info.pci_sub_vendor_id,
 		p_nt_drv->adapter_info.hw_info.pci_sub_device_id);
 
-	p_nt_drv->b_shutdown = false;
-	p_nt_drv->adapter_info.pb_shutdown = &p_nt_drv->b_shutdown;
-
 	/* store context */
 	store_pdrv(p_drv);
 
@@ -2366,7 +2354,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
 		NT_LOG_DBGX(DBG, NTNIC, "SG module is not initialized");
 	}
 
-	/* Start ctrl, monitor, stat thread only for primary process. */
+	/* Start ctrl, monitor, stat service only for primary process. */
 	if (err == 0) {
 		/* mp_adapter_id_str is initialized after nt4ga_adapter_init(p_nt_drv) */
 		const char *const p_adapter_id_str = p_nt_drv->adapter_info.mp_adapter_id_str;
@@ -2631,7 +2619,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)
 	fpga_info_t *fpga_info = &p_ntdrv->adapter_info.fpga_info;
 	const int n_phy_ports = fpga_info->n_phy_ports;
 
-	/* let running threads end Rx and Tx activity */
+	/* let running services end Rx and Tx activity */
 	if (sg_ops != NULL) {
 		nt_os_wait_usec(1 * 1000 * 1000);
 
@@ -2706,7 +2694,7 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	/*
 	 * 1 time calculation of 1 sec stat update rtc cycles to prevent stat poll
-	 * flooding by OVS from multiple virtual port threads - no need to be precise
+	 * flooding by OVS from multiple virtual port services - no need to be precise
 	 */
 	uint64_t now_rtc = rte_get_tsc_cycles();
 	nt_os_wait_usec(10 * 1000);
drivers/net/ntnic/ntutil/nt_util.c +1 -1
index df382e7a24..a4d30d8ca4 100644
@@ -16,7 +16,7 @@
 
 static struct nt_util_vfio_impl vfio_cb;
 
-/* uses usleep which schedules out the calling thread */
+/* uses usleep which schedules out the calling service */
 void nt_os_wait_usec(int val)
 {
 	rte_delay_us_sleep(val);
Signature · 1 line
2.45.0
#85 lore raw
In reply to Serhii Iliushyk
Quoted 49 lines · On Mon, 8 Sep 2025 16:17:32 +0200 Serhii Iliushyk <[email protected]> wrote:

This modification provides better resource (CPU) management for NTNIC PMD.

The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.

After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.

The sercvice cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with special API by application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.

Serhii Iliushyk (7):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: cleanup using pthreads and rte_thread

 doc/guides/nics/ntnic.rst                     | 112 ++++
 drivers/net/ntnic/adapter/nt4ga_adapter.c     |  27 +-
 .../net/ntnic/include/common_adapter_defs.h   |  15 -
 drivers/net/ntnic/include/nt4ga_adapter.h     |   4 -
 drivers/net/ntnic/include/ntdrv_4ga.h         |   4 -
 drivers/net/ntnic/include/ntnic_stat.h        |   2 +-
 drivers/net/ntnic/include/ntos_drv.h          |   4 +-
 .../link_mgmt/link_100g/nt4ga_link_100g.c     | 303 +++++-----
 .../link_agx_100g/nt4ga_agx_link_100g.c       | 306 ++++++-----
 drivers/net/ntnic/meson.build                 |   2 +
 drivers/net/ntnic/nthw/core/nthw_pca9532.c    |   2 -
 drivers/net/ntnic/nthw/core/nthw_pcal6416a.c  |   1 -
 .../net/ntnic/nthw/core/nthw_si5332_si5156.c  |   1 -
 .../profile_inline/flow_api_profile_inline.c  |   2 +-
 drivers/net/ntnic/ntnic_ethdev.c              | 520 ++++++++++--------
 drivers/net/ntnic/ntnic_filter/ntnic_filter.c |  17 +
 drivers/net/ntnic/ntutil/nt_service.c         | 127 +++++
 drivers/net/ntnic/ntutil/nt_service.h         |  62 +++
Quoted 9 lines
 drivers/net/ntnic/ntutil/nt_util.c            |   2 +-
 drivers/net/ntnic/rte_pmd_ntnic.c             | 104 ++++
 drivers/net/ntnic/rte_pmd_ntnic.h             |  26 +
 21 files changed, 1073 insertions(+), 570 deletions(-)
 delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
 create mode 100644 drivers/net/ntnic/ntutil/nt_service.c
 create mode 100644 drivers/net/ntnic/ntutil/nt_service.h
 create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c

I got a report from Raslan about format overflow from sprintf() so dropping this from next-net for now.

Please consider resubmitting with a fix for that. Something like this (untested) change to not use sprintf at all

drivers/net/ntnic/ntnic_ethdev.c +4 -4
index 3edf7796f7..18dab16f6b 100644
@@ -2580,7 +2580,8 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
                                .callback_userdata = internals
                        };
 
-                       sprintf(port_event_spec.name, "ntnic-port_%d_event_service", n_intf_no);
+                       snprintf(port_event_spec.name, RTE_SERVICE_NAME_MAX,
+                                "ntnic-%d_event", n_intf_no);
 
                        const int port_srv_tag[2] = {
                                RTE_NTNIC_SERVICE_PORT_0_EVENT,
@@ -2612,9 +2613,8 @@ static int
 nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)
 {
        NT_LOG_DBGX(DBG, NTNIC, "PCI device deinitialization");
-
        int i;
-       char name[32];
+       char name[RTE_ETH_NAME_MAX_LEN];
 
        struct pmd_internals *internals = eth_dev->data->dev_private;
        ntdrv_4ga_t *p_ntdrv = &internals->p_drv->ntdrv;
@@ -2641,7 +2641,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)
        }
 
        for (i = 0; i < n_phy_ports; i++) {
-               sprintf(name, "ntnic%d", i);
+               snprintf(name, sizeof(name), "ntnic%d", i);
                eth_dev = rte_eth_dev_allocated(name);
                if (eth_dev == NULL)
                        continue; /* port already released */
#86 lore raw
In reply to Serhii Iliushyk
Quoted 11 lines · On Mon, 8 Sep 2025 13:04:38 +0200 Serhii Iliushyk <[email protected]> wrote:

This modification provides better resource (CPU) management for NTNIC PMD.

The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.

Quoted 3 lines

After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.

I was concerned with excessive control thread usage before, and this seems to be worse not better.

There are conflicting use cases here:
1. The original DPDK goal was to make effective use of multiple cores with no locking. Intel customers often had idle lcore's and some CPU's had lots of inactive lcores that could be used to get more work done. Dedicating some to service tasks etc was a natural outcome.

2. DPDK applications (OVS, Grout, VPP) usually want to know about lcores at least in the documentation and examples. They don't cover the case of service lcores.

3. Dedicated low core count smart NIC's using DPDK. In this case it makes sense to be frugal with lcores since the point of the smart NIC is to be able to run other control services. For example, the MS NIC had hard limit on the DPDK part (via cgroups) of only 4 + main lcores.

Granted NTNIC is likely only being used for a specific application on a specific set of hardware.

The ideal would be to have better control event management in EAL. Something like "libevent" style API. This would reduce control core needs, and avoid any potential resource conflict overlap between control threads.

#87 lore raw

From: Stephen Hemminger <[email protected]>
Sent: 08 September 2025 23:08
To: Serhii Iliushyk <[email protected]>
Cc: [email protected] <[email protected]>; Mykola Kostenok <[email protected]>; Christian Koue Muf <[email protected]>
Subject: Re: [PATCH v1 0/7] migrate threads to DPDK service framework

Quoted 11 lines · On Mon, 8 Sep 2025 13:04:38 +0200 Serhii Iliushyk <[email protected]> wrote:

This modification provides better resource (CPU) management for NTNIC PMD.

The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.

Quoted 3 lines

After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.

I was concerned with excessive control thread usage before, and this seems to be worse not better.

There are conflicting use cases here:
1. The original DPDK goal was to make effective use of multiple cores with no locking. Intel customers often had idle lcore's and some CPU's had lots of inactive lcores that could be used to get more work done. Dedicating some to service tasks etc was a natural outcome.

2. DPDK applications (OVS, Grout, VPP) usually want to know about lcores at least in the documentation and examples. They don't cover the case of service lcores.

3. Dedicated low core count smart NIC's using DPDK. In this case it makes sense to be frugal with lcores since the point of the smart NIC is to be able to run other control services. For example, the MS NIC had hard limit on the DPDK part (via cgroups) of only 4 + main lcores.

Granted NTNIC is likely only being used for a specific application on a specific set of hardware.

The ideal would be to have better control event management in EAL. Something like "libevent" style API. This would reduce control core needs, and avoid any potential resource conflict overlap between control threads.

Hi Stephen!

Thanks for the detailed feedback.

The migration of the rte_service actually improves the performance of the ntnic. That is an obvious result, since we dedicate the entire core to a single service when the default (1-to-1) mapping is used. A similar performance and stability can be achieved by using threads and mutexes (The rte_spinlocks introduce instability when used with threads)

The ntnic service API provided with this patch series enables users to map NTNIC services to lcores as necessary.

All NTNIC services can be mapped to separate lcores or to a single lcore; however, this approach has a significant impact on performance.

The mapping of all services to a single lcore is similar to a "libevent" style API. However, there are no events; instead, there are continuous calling services in a predefined order.

The one core cannot process all the services due to a negative performance impact. Following this approach, we have to spawn a thread (or start the service by looking for a free lcore) every time an event occurs. If you have any other vision about it, please share your opinion.

In the scope of complex DPDK-based applications (OVS, Grout, VPP), we still have options to use (1-to-1) mapping by passing raw EAL options -(s SERVICE COREMASK or -S SERVICE CORELIST).

Thanks,
Serhii