bugfixes and cleanup
cover bugfixes and cleanup
This patchset contains bugfixes and cleanup for the ntnic PMD
* add SPDX tag
* rename clock registers file
* replace assert with RTE assert
* check result of malloc
* add 'nthw' prefix function names
Serhii Iliushyk (5):
net/ntnic: add SPDX tag
net/ntnic: rename clock registers file
net/ntnic: replace assert with RTE assert
net/ntnic: check result of malloc
net/ntnic: add nthw prefix function names
drivers/net/ntnic/adapter/nt4ga_adapter.c | 20 +-
.../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 6 +-
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 48 +--
drivers/net/ntnic/include/create_elements.h | 8 +-
drivers/net/ntnic/include/flow_api.h | 20 +-
drivers/net/ntnic/include/flow_api_engine.h | 10 +-
drivers/net/ntnic/include/flow_filter.h | 6 +-
drivers/net/ntnic/include/hw_mod_backend.h | 10 +-
drivers/net/ntnic/include/ntnic_dbs.h | 18 +-
.../link_mgmt/link_100g/nt4ga_link_100g.c | 45 +--
.../link_agx_100g/nt4ga_agx_link_100g.c | 51 +--
drivers/net/ntnic/link_mgmt/nt4ga_link.c | 4 +-
drivers/net/ntnic/nim/i2c_nim.c | 22 +-
drivers/net/ntnic/nim/i2c_nim.h | 12 +-
...0d13_u62_si5332_gm2_revd_1_v5_registers.h} | 5 +
...> nt200a02_u23_si5340_adr0_v5_registers.h} | 0
.../clock_profiles/nthw_fpga_clk9563.c | 2 +-
.../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +-
.../core/nt200a0x/reset/nthw_fpga_rst9563.c | 6 +-
.../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 12 +-
.../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 6 +-
.../core/nt400dxx/reset/nthw_fpga_rst9574.c | 18 +-
.../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 8 +-
drivers/net/ntnic/nthw/core/nthw_fpga.c | 8 +-
drivers/net/ntnic/nthw/core/nthw_gfg.c | 4 +-
drivers/net/ntnic/nthw/core/nthw_gpio_phy.c | 6 +-
drivers/net/ntnic/nthw/core/nthw_hif.c | 6 +-
drivers/net/ntnic/nthw/core/nthw_iic.c | 6 +-
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 4 +-
drivers/net/ntnic/nthw/core/nthw_pcie3.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_spim.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_spis.c | 4 +-
drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 18 +-
drivers/net/ntnic/nthw/flow_api/flow_api.c | 64 ++--
.../ntnic/nthw/flow_api/flow_api_nic_setup.h | 8 +-
.../nthw/flow_api/flow_backend/flow_backend.c | 10 +-
drivers/net/ntnic/nthw/flow_api/flow_filter.c | 12 +-
drivers/net/ntnic/nthw/flow_api/flow_group.c | 10 +-
drivers/net/ntnic/nthw/flow_api/flow_hasher.c | 4 +-
drivers/net/ntnic/nthw/flow_api/flow_hasher.h | 4 +-
drivers/net/ntnic/nthw/flow_api/flow_km.c | 35 +--
.../nthw/flow_api/hw_mod/hw_mod_backend.c | 17 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 6 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 5 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 4 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 4 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 4 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 4 +-
.../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 4 +-
.../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 4 +-
.../flow_api/profile_inline/flm_evt_queue.c | 13 +-
.../flow_api/profile_inline/flm_evt_queue.h | 8 +-
.../flow_api/profile_inline/flm_lrn_queue.c | 3 +-
.../profile_inline/flow_api_hw_db_inline.c | 24 +-
.../profile_inline/flow_api_profile_inline.c | 290 +++++++++---------
.../ntnic/nthw/flow_filter/flow_nthw_cat.c | 40 +--
.../ntnic/nthw/flow_filter/flow_nthw_csu.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_flm.c | 93 +++---
.../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 18 +-
.../ntnic/nthw/flow_filter/flow_nthw_info.c | 2 +-
.../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 22 +-
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 16 +-
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 2 +-
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 4 +-
.../net/ntnic/nthw/model/nthw_fpga_model.c | 58 ++--
drivers/net/ntnic/nthw/nthw_rac.c | 21 +-
.../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 2 +-
drivers/net/ntnic/nthw/stat/nthw_stat.c | 4 +-
drivers/net/ntnic/ntnic_ethdev.c | 30 +-
drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 46 +--
drivers/net/ntnic/ntnic_mod_reg.c | 18 +-
drivers/net/ntnic/ntnic_mod_reg.h | 29 +-
drivers/net/ntnic/ntutil/nt_util.c | 5 +-
drivers/net/ntnic/ntutil/nt_util.h | 4 +-
80 files changed, 700 insertions(+), 664 deletions(-)
rename drivers/net/ntnic/nthw/core/include/{NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h => nt400d13_u62_si5332_gm2_revd_1_v5_registers.h} (99%)
rename drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/{NT200A02_U23_Si5340_adr0_v5-Registers.h => nt200a02_u23_si5340_adr0_v5_registers.h} (100%)Signature · 1 line
2.45.0
PATCH 1/5 net/ntnic: add SPDX tag
Add missed SPDX tag
--- .../include/NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ntnic/nthw/core/include/NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h +5 -0
@@ -1,3 +1,8 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ +/* * Si5332-GM2 Rev D Configuration Register Export Header File *
Signature · 1 line
2.45.0
PATCH 2/5 net/ntnic: rename clock registers file
In reply to Serhii IliushykRename this files to align the file naming
---
...egisters.h => nt400d13_u62_si5332_gm2_revd_1_v5_registers.h} | 0
...0_v5-Registers.h => nt200a02_u23_si5340_adr0_v5_registers.h} | 0
.../ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c | 2 +-
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 2 +-
4 files changed, 2 insertions(+), 2 deletions(-)
rename drivers/net/ntnic/nthw/core/include/{NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h => nt400d13_u62_si5332_gm2_revd_1_v5_registers.h} (100%)
rename drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/{NT200A02_U23_Si5340_adr0_v5-Registers.h => nt200a02_u23_si5340_adr0_v5_registers.h} (100%)drivers/net/ntnic/nthw/core/include/nt400d13_u62_si5332_gm2_revd_1_v5_registers.h renamed from drivers/net/ntnic/nthw/core/include/NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h +0 -0
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nt200a02_u23_si5340_adr0_v5_registers.h renamed from drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/NT200A02_U23_Si5340_adr0_v5-Registers.h +0 -0
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c +1 -1
@@ -10,7 +10,7 @@*/ #define si5340_revd_register_t type_9563_si5340_nt200a02_u23_v5#define si5340_revd_registers data_9563_si5340_nt200a02_u23_v5 -#include "NT200A02_U23_Si5340_adr0_v5-Registers.h" +#include "nt200a02_u23_si5340_adr0_v5_registers.h" static_assert (sizeof (type_9563_si5340_nt200a02_u23_v5) ==sizeof (clk_profile_data_fmt2_t), clk_profile_size_error_msg);static const int n_data_9563_si5340_nt200a02_u23_v5 =SI5340_REVD_REG_CONFIG_NUM_REGS ;
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +1 -1
@@ -5,7 +5,7 @@#include "ntlog.h" #include "nthw_fpga.h" #include "ntnic_mod_reg.h" -#include "NT400D13_U62_Si5332-GM2-RevD-1_V5-Registers.h" +#include "nt400d13_u62_si5332_gm2_revd_1_v5_registers.h" static int nthw_fpga_nt400dxx_init_clock_synthesizers (struct fpga_info_s *p_fpga_info) {
Signature · 1 line
2.45.0
PATCH 3/5 net/ntnic: replace assert with RTE assert
In reply to Serhii IliushykUse RTE_ASSERT instead of direct calling asserts
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 14 ++- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 6 +- drivers/net/ntnic/include/flow_api.h | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 22 ++--- .../link_agx_100g/nt4ga_agx_link_100g.c | 20 ++-- drivers/net/ntnic/nim/i2c_nim.c | 6 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 6 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 12 +-- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 4 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 18 ++-- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 8 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 8 +- drivers/net/ntnic/nthw/core/nthw_gfg.c | 4 +- drivers/net/ntnic/nthw/core/nthw_gpio_phy.c | 6 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 6 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 6 +- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 4 +- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 2 +- drivers/net/ntnic/nthw/core/nthw_spim.c | 2 +- drivers/net/ntnic/nthw/core/nthw_spis.c | 4 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 16 ++-- .../nthw/flow_api/flow_backend/flow_backend.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 31 +++---- .../nthw/flow_api/hw_mod/hw_mod_backend.c | 7 +- .../flow_api/profile_inline/flm_evt_queue.c | 1 - .../flow_api/profile_inline/flm_lrn_queue.c | 3 +- .../profile_inline/flow_api_profile_inline.c | 22 ++--- .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 40 ++++---- .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 93 ++++++++++--------- .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 18 ++-- .../ntnic/nthw/flow_filter/flow_nthw_info.c | 2 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 22 ++--- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 16 ++-- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 2 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 4 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 58 ++++++------ drivers/net/ntnic/nthw/nthw_rac.c | 16 ++-- drivers/net/ntnic/nthw/stat/nthw_stat.c | 4 +- drivers/net/ntnic/ntnic_ethdev.c | 18 ++-- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 2 +- drivers/net/ntnic/ntutil/nt_util.c | 1 - 49 files changed, 279 insertions(+), 275 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +9 -5
@@ -89,8 +89,10 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)* IMPORTANT: Most variables cannot be determined before nthw fpga model is instantiated * (nthw_fpga_init()) */ +#ifdef RTE_ENABLE_ASSERT int n_phy_ports =-1 ;int n_nim_ports =-1 ; +#endif int res =-1 ;nthw_fpga_t *p_fpga =NULL ;
@@ -152,13 +154,15 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)return res; } -assert (fpga_info); +#ifdef RTE_ENABLE_ASSERT +RTE_ASSERT (fpga_info); p_fpga = fpga_info->mp_fpga; -assert (p_fpga); +RTE_ASSERT (p_fpga); n_phy_ports = fpga_info->n_phy_ports; -assert (n_phy_ports >=1 ); +RTE_ASSERT (n_phy_ports >=1 ); n_nim_ports = fpga_info->n_nims; -assert (n_nim_ports >=1 ); +RTE_ASSERT (n_nim_ports >=1 ); +#endif /* Nt4ga Init Filter */ nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
@@ -176,7 +180,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) {int i;const struct link_ops_s *link_ops =NULL ; -assert (fpga_info->n_fpga_prod_id >0 ); +RTE_ASSERT (fpga_info->n_fpga_prod_id >0 );for (i =0 ; i <NUM_ADAPTER_PORTS_MAX ; i++) {/* Disable all ports. Must be enabled later */
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +3 -3
@@ -207,7 +207,7 @@ static void dbs_init_tx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t sstatic int nthw_virt_queue_init (struct fpga_info_s *p_fpga_info) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);nthw_fpga_t *const p_fpga = p_fpga_info->mp_fpga;nthw_dbs_t *p_nthw_dbs;
@@ -906,8 +906,8 @@ static int nthw_setup_managed_virt_queue_packed(struct nthw_virt_queue *vq, int rx) {/* page aligned */ -assert (((uintptr_t )p_virt_struct_area->phys_addr &0xfff ) ==0 ); -assert (p_packet_buffers); +RTE_ASSERT (((uintptr_t )p_virt_struct_area->phys_addr &0xfff ) ==0 ); +RTE_ASSERT (p_packet_buffers);/* clean canvas */ memset(p_virt_struct_area->virt_addr, 0,
drivers/net/ntnic/include/flow_api.h +1 -1
@@ -202,7 +202,7 @@ extern const char *dbg_res_descr[];size_t _temp_index = (index); \NT_LOG (DBG ,FILTER ,"mark resource used: %s idx %zu" , \ dbg_res_descr[_temp_res_type], _temp_index); \ -assert (flow_nic_is_bit_set (_temp_ndev->res[_temp_res_type].alloc_bm, \ +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); \ }while (0 )
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +11 -11
@@ -144,7 +144,7 @@ static int _link_state_build(adapter_info_t *drv, nthw_mac_pcs_t *mac_pcs, &lh_remote_fault, &lh_internal_local_fault, &lh_received_local_fault); -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); state->nim_present =nthw_gpio_phy_is_module_present (gpio_phy, (uint8_t )port); state->lh_nim_absent = !state->nim_present; state->link_up = phy_link_state ? true : false;
@@ -177,7 +177,7 @@ static int _link_state_build(adapter_info_t *drv, nthw_mac_pcs_t *mac_pcs,*/ static bool _nim_is_present (nthw_gpio_phy_t *gpio_phy,uint8_t if_no) { -assert (if_no <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (if_no <NUM_ADAPTER_PORTS_MAX );return nthw_gpio_phy_is_module_present (gpio_phy, if_no); }
@@ -258,8 +258,8 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable)nt4ga_link_t *link_info = &drv->nt4ga_link;nthw_mac_pcs_t *mac_pcs = &link_info->u.var100g.mac_pcs100g[port]; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (link_info->variables_initialized); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (link_info->variables_initialized); gpio_phy = &link_info->u.var100g.gpio_phy[port]; nim_ctx = &link_info->u.var100g.nim_ctx[port];
@@ -355,8 +355,8 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port)nthw_mac_pcs_t *mac_pcs; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (link_info->variables_initialized); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (link_info->variables_initialized);if (fpga && fpga->p_fpga_info) { adapter_id = fpga->p_fpga_info->n_nthw_adapter_id;
@@ -444,7 +444,7 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port) }else {NT_LOG (ERR ,NTNIC ,"Unhandled AdapterId/HwId: %02x_hwid%d" , adapter_id, hw_id); -assert (0 ); +RTE_ASSERT (0 ); }_reset_rx (drv, mac_pcs);
@@ -494,7 +494,7 @@ static int _common_ptp_nim_state_machine(void *data) goto NT4GA_LINK_100G_MON_EXIT; } -assert (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX ); +RTE_ASSERT (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX ); nim_ctx = link_info->u.var100g.nim_ctx; link_state = link_info->link_state; mac_pcs = link_info->u.var100g.mac_pcs100g;
@@ -521,7 +521,7 @@ static int _common_ptp_nim_state_machine(void *data)break ;/* Has the administrative port state changed? */ -assert (!(disable_port && enable_port)); +RTE_ASSERT (!(disable_port && enable_port));if (disable_port) {memset (&link_state[i],0 ,sizeof (link_state[i]));
@@ -603,7 +603,7 @@ static int _common_ptp_nim_state_machine(void *data)continue ; } -assert (new_state.br);/* Cannot be zero if NIM is present */ +RTE_ASSERT (new_state.br);/* Cannot be zero if NIM is present */ NT_LOG(DBG, NTNIC, "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'", drv->mp_port_id_str[i], nim_ctx->nim_id,
@@ -669,7 +669,7 @@ static int nt4ga_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nth/* * Initialize global variables */ -assert (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX ); +RTE_ASSERT (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX );if (res ==0 && !p_adapter_info->nt4ga_link.variables_initialized) {nthw_mac_pcs_t *mac_pcs = p_adapter_info->nt4ga_link.u.var100g.mac_pcs100g;
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +10 -10
@@ -78,14 +78,14 @@ static void phy_get_link_state(adapter_info_t *drv,static void phy_rx_path_rst (adapter_info_t *drv,int port,bool reset) {nthw_phy_tile_t *p = drv->fpga_info.mp_nthw_agx.p_phy_tile; -NT_LOG (DBG ,NTNIC ,"Port %d: %s" , port, reset ?"assert" :"deassert" ); +NT_LOG (DBG ,NTNIC ,"Port %d: %s" , port, reset ?"RTE_ASSERT" :"deassert" );nthw_phy_tile_set_rx_reset (p, port, reset); }static void phy_tx_path_rst (adapter_info_t *drv,int port,bool reset) {nthw_phy_tile_t *p = drv->fpga_info.mp_nthw_agx.p_phy_tile; -NT_LOG (DBG ,NTNIC ,"Port %d: %s" , port, reset ?"assert" :"deassert" ); +NT_LOG (DBG ,NTNIC ,"Port %d: %s" , port, reset ?"RTE_ASSERT" :"deassert" );nthw_phy_tile_set_tx_reset (p, port, reset); }
@@ -246,7 +246,7 @@ static void nim_set_reset(struct nim_i2c_ctx *ctx, uint8_t nim_idx, bool reset)static bool nim_is_present (nim_i2c_ctx_p ctx,uint8_t nim_idx) { -assert (nim_idx <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (nim_idx <NUM_ADAPTER_PORTS_MAX );nthw_pcal6416a_t *p = ctx->hwagx.p_io_nim;uint8_t data =0 ;
@@ -521,8 +521,8 @@ static int create_nim(adapter_info_t *drv, int port, bool enable)nt4ga_link_t *link_info = &drv->nt4ga_link;nim_i2c_ctx_t *nim_ctx = &link_info->u.nim_ctx[port]; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (link_info->variables_initialized); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (link_info->variables_initialized);if (!enable) {phy_reset_rx (drv, port);
@@ -722,8 +722,8 @@ static int _port_init(adapter_info_t *p_info, nthw_fpga_t *fpga, int port)nthw_phy_tile_t *p_phy_tile = p_info->fpga_info.mp_nthw_agx.p_phy_tile;nthw_rpf_t *p_rpf = p_info->fpga_info.mp_nthw_agx.p_rpf; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (link_info->variables_initialized); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (link_info->variables_initialized); link_info->link_info[port].link_speed =NT_LINK_SPEED_100G ; link_info->link_info[port].link_duplex =NT_LINK_DUPLEX_FULL ;
@@ -794,7 +794,7 @@ static void *_common_ptp_nim_state_machine(void *data) goto NT4GA_LINK_100G_MON_EXIT; } -assert (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX ); +RTE_ASSERT (adapter_no >=0 && adapter_no <NUM_ADAPTER_MAX ); monitor_task_is_running[adapter_no] =1 ;memset (last_lpbk_mode,0 ,sizeof (last_lpbk_mode));
@@ -828,7 +828,7 @@ static void *_common_ptp_nim_state_machine(void *data)/* * Has the administrative port state changed? */ -assert (!(disable_port && enable_port)); +RTE_ASSERT (!(disable_port && enable_port));if (disable_port) {memset (&link_state[i],0 ,sizeof (link_state[i]));
@@ -912,7 +912,7 @@ static void *_common_ptp_nim_state_machine(void *data)continue ; } -assert (new_state.br);/* Cannot be zero if NIM is present */ +RTE_ASSERT (new_state.br);/* Cannot be zero if NIM is present */ NT_LOG(DBG, NTNIC, "%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'", drv->mp_port_id_str[i], nim_ctx->nim_id,
drivers/net/ntnic/nim/i2c_nim.c +3 -3
@@ -302,8 +302,8 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state) {int res =0 ;/* unused due to no readings from HW */ -assert (ctx && state); -assert (ctx->nim_id !=NT_NIM_UNKNOWN &&"Nim is not initialized" ); +RTE_ASSERT (ctx && state); +RTE_ASSERT (ctx->nim_id !=NT_NIM_UNKNOWN &&"Nim is not initialized" ); (void )memset (state,0 ,sizeof (*state));
@@ -628,7 +628,7 @@ static void qsfpplus_set_speed_mask(nim_i2c_ctx_p ctx)static void qsfpplus_construct (nim_i2c_ctx_p ctx,int8_t lane_idx) { -assert (lane_idx <4 ); +RTE_ASSERT (lane_idx <4 ); ctx->specific_u.qsfp.qsfp28 = false; ctx->lane_idx = lane_idx; ctx->lane_count =4 ;
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
@@ -10,7 +10,7 @@static int nthw_fpga_nt200a0x_init (struct fpga_info_s *p_fpga_info) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;struct nthw_fpga_rst_nt200a0x rst;
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +3 -3
@@ -21,7 +21,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2nthw_module_t *p_mod_rst;nthw_register_t *p_curr_reg; -assert (p); +RTE_ASSERT (p); p->mn_fpga_product_id = n_fpga_product_id; p->mn_fpga_version = n_fpga_version; p->mn_fpga_revision = n_fpga_revision;
@@ -195,8 +195,8 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga,static int nthw_fpga_rst9563_init (struct fpga_info_s *p_fpga_info,struct nthw_fpga_rst_nt200a0x *p_rst) { -assert (p_fpga_info); -assert (p_rst); +RTE_ASSERT (p_fpga_info); +RTE_ASSERT (p_rst);const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str; (void )p_adapter_id_str;
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +6 -6
@@ -224,7 +224,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,NT_LOG_DBGX (DBG ,NTHW ,"%s: FPGA reset sequence: FPGA %04d-%02d-%02d @ HWId%d" , p_adapter_id_str, n_fpga_product_id, n_fpga_version, n_fpga_revision, n_hw_id); -assert (n_fpga_product_id == p_fpga->mn_product_id); +RTE_ASSERT (n_fpga_product_id == p_fpga->mn_product_id);/* * Reset all domains / modules except peripherals
@@ -296,7 +296,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,nthw_field_update_register (p->mp_fld_ctrl_ts_clk_sel);nthw_field_set_flush (p->mp_fld_ctrl_ts_clk_sel); -/* 4: De-assert sys reset, CORE and SYS MMCM resets */ +/* 4: De-RTE_ASSERT sys reset, CORE and SYS MMCM resets */ NT_LOG (DBG ,NTHW ,"%s: De-asserting SYS, CORE and SYS MMCM resets" , p_adapter_id_str);nthw_field_update_register (p->mp_fld_rst_sys);nthw_field_clr_flush (p->mp_fld_rst_sys);
@@ -353,7 +353,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,nthw_field_clr_flush (p->mp_fld_rst_phy);/* -* 8: De-assert reset for remaining domains/modules resets except +* 8: De-RTE_ASSERT reset for remaining domains/modules resets except * TS, PTP, PTP_MMCM and TS_MMCM */ NT_LOG (DBG ,NTHW ,"%s: De-asserting TMC RST" , p_adapter_id_str);
@@ -408,7 +408,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,/* * Timesync/PTP reset sequence -* De-assert TS_MMCM reset +* De-RTE_ASSERT TS_MMCM reset */ NT_LOG (DBG ,NTHW ,"%s: De-asserting TS MMCM RST" , p_adapter_id_str);nthw_field_clr_flush (p->mp_fld_rst_ts_mmcm);
@@ -437,7 +437,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,if (p->mp_fld_sticky_pci_sys_mmcm_unlocked)nthw_field_set_flush (p->mp_fld_sticky_pci_sys_mmcm_unlocked); -/* De-assert TS reset bit */ +/* De-RTE_ASSERT TS reset bit */ NT_LOG (DBG ,NTHW ,"%s: De-asserting TS RST" , p_adapter_id_str);nthw_field_clr_flush (p->mp_fld_rst_ts);
@@ -513,7 +513,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,static int nthw_fpga_rst_nt200a0x_init (struct fpga_info_s *p_fpga_info,struct nthw_fpga_rst_nt200a0x *p_rst) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;int res =-1 ;
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +2 -2
@@ -112,7 +112,7 @@ static int nthw_fpga_nt400dxx_init_sub_systems(struct fpga_info_s *p_fpga_info)static int nthw_fpga_nt400dxx_init (struct fpga_info_s *p_fpga_info) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);struct rst9574_ops *rst9574_ops =NULL ;const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;
@@ -120,7 +120,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)int res =-1 ;nthw_fpga_t *p_fpga = p_fpga_info->mp_fpga; -assert (p_fpga); +RTE_ASSERT (p_fpga);switch (p_fpga_info->n_fpga_prod_id) {case 9574 :
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +9 -9
@@ -11,8 +11,8 @@static int nthw_fpga_rst9574_setup (nthw_fpga_t *p_fpga,struct nthw_fpga_rst_nt400dxx *const p) { -assert (p_fpga); -assert (p); +RTE_ASSERT (p_fpga); +RTE_ASSERT (p);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;
@@ -238,8 +238,8 @@ static int nthw_fpga_rst9574_wait_phy_ftile_rst_done(struct fpga_info_s *p_fpga_static int nthw_fpga_rst9574_product_reset (struct fpga_info_s *p_fpga_info,struct nthw_fpga_rst_nt400dxx *p_rst) { -assert (p_fpga_info); -assert (p_rst); +RTE_ASSERT (p_fpga_info); +RTE_ASSERT (p_rst);const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;int res =-1 ;
@@ -253,7 +253,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,*/ nt_os_wait_usec (2000 ); -/* (1) De-assert DDR4 reset: */ +/* (1) De-RTE_ASSERT DDR4 reset: */ NT_LOG (DBG ,NTHW ,"%s: %s: De-asserting DDR4 reset" , p_adapter_id_str, __func__);nthw_fpga_rst9574_ddr4_rst (p_rst,0 );
@@ -296,7 +296,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,return res; } -/* (6) De-assert PHY_FTILE reset: */ +/* (6) De-RTE_ASSERT PHY_FTILE reset: */ NT_LOG (DBG ,NTHW ,"%s: %s: De-asserting PHY_FTILE reset" , p_adapter_id_str, __func__);nthw_fpga_rst9574_phy_ftile_rst (p_rst,0 );
@@ -349,7 +349,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info, }while (!success); -/* (8) De-assert SYS reset: */ +/* (8) De-RTE_ASSERT SYS reset: */ NT_LOG (DBG ,NTHW ,"%s: %s: De-asserting SYS reset" , p_adapter_id_str, __func__);nthw_fpga_rst9574_sys_rst (p_rst,0 );
@@ -359,8 +359,8 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,static int nthw_fpga_rst9574_init (struct fpga_info_s *p_fpga_info,struct nthw_fpga_rst_nt400dxx *p_rst) { -assert (p_fpga_info); -assert (p_rst); +RTE_ASSERT (p_fpga_info); +RTE_ASSERT (p_rst);int res =nthw_fpga_rst9574_product_reset (p_fpga_info, p_rst);return res;
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +4 -4
@@ -13,7 +13,7 @@static int nthw_fpga_rst_nt400dxx_init (struct fpga_info_s *p_fpga_info) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);int res =-1 ;nthw_fpga_t *p_fpga =NULL ;
@@ -191,7 +191,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)nthw_pcm_nt400dxx_t *p_pcm = p_fpga_info->mp_nthw_agx.p_pcm;nthw_prm_nt400dxx_t *p_prm = p_fpga_info->mp_nthw_agx.p_prm; -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);NT_LOG (DBG ,NTHW ,"%s: %s: BEGIN" , p_adapter_id_str, __PRETTY_FUNCTION__);
@@ -310,7 +310,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)/* * At this point all system clocks and TS clocks are running. * Last thing to do before proceeding to product reset is to -* de-assert the platform reset and enable the RAB buses. +* de-RTE_ASSERT the platform reset and enable the RAB buses. */ /* (K1) Force HIF soft reset. */
@@ -325,7 +325,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)nt_os_wait_usec (1000 );nthw_hif_delete (p_nthw_hif); -/* (L) De-assert platform reset. */ +/* (L) De-RTE_ASSERT platform reset. */ nthw_prm_nt400dxx_platform_rst (p_prm,0 );/*
drivers/net/ntnic/nthw/core/nthw_fpga.c +4 -4
@@ -75,7 +75,7 @@ int nthw_fpga_iic_scan(nthw_fpga_t *p_fpga, const int n_instance_no_begin, {int i; -assert (n_instance_no_begin <= n_instance_no_end); +RTE_ASSERT (n_instance_no_begin <= n_instance_no_end);for (i = n_instance_no_begin; i <= n_instance_no_end; i++) {nthw_iic_t *p_nthw_iic =nthw_iic_new ();
@@ -606,8 +606,8 @@ int nthw_fpga_si5340_clock_synth_init_fmt2(nthw_fpga_t *p_fpga, const uint8_t n_nthw_iic_t *p_nthw_iic =nthw_iic_new ();nthw_si5340_t *p_nthw_si5340 =nthw_si5340_new (); -assert (p_nthw_iic); -assert (p_nthw_si5340); +RTE_ASSERT (p_nthw_iic); +RTE_ASSERT (p_nthw_si5340);nthw_iic_init (p_nthw_iic, p_fpga,0 ,8 );/* I2C cycle time 125Mhz ~ 8ns */ nthw_si5340_init (p_nthw_si5340, p_nthw_iic, n_iic_addr);/* si5340_u23_i2c_addr_7bit */
@@ -636,7 +636,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)int res =0 ; -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info); {const uint64_t n_fpga_ident =nthw_fpga_read_ident (p_fpga_info);
drivers/net/ntnic/nthw/core/nthw_gfg.c +2 -2
@@ -304,7 +304,7 @@ static int nthw_gfg_setup(nthw_gfg_t *p, (size_t)n_intf_no >= ARRAY_SIZE(p->mpa_fld_ctrl_size) || n_intf_no >= ARRAY_SIZE(p->mpa_fld_stream_id_val) || (size_t)n_intf_no >= ARRAY_SIZE(p->mpa_fld_burst_size_val)) { -assert (false); +RTE_ASSERT (false);return -1 ; }
@@ -312,7 +312,7 @@ static int nthw_gfg_setup(nthw_gfg_t *p, p->mpa_fld_ctrl_size[n_intf_no] == NULL || p->mpa_fld_stream_id_val[n_intf_no] == NULL || p->mpa_fld_burst_size_val[n_intf_no] == NULL) { -assert (false); +RTE_ASSERT (false);return -1 ; }
drivers/net/ntnic/nthw/core/nthw_gpio_phy.c +3 -3
@@ -104,7 +104,7 @@ int nthw_gpio_phy_init(nthw_gpio_phy_t *p, nthw_fpga_t *p_fpga, int n_instance)bool nthw_gpio_phy_is_module_present (nthw_gpio_phy_t *p,uint8_t if_no) {if (if_no >=ARRAY_SIZE (p->mpa_fields)) { -assert (false); +RTE_ASSERT (false);return false; }
@@ -115,7 +115,7 @@ bool nthw_gpio_phy_is_module_present(nthw_gpio_phy_t *p, uint8_t if_no)void nthw_gpio_phy_set_low_power (nthw_gpio_phy_t *p,uint8_t if_no,bool enable) {if (if_no >=ARRAY_SIZE (p->mpa_fields)) { -assert (false); +RTE_ASSERT (false);return ; }
@@ -131,7 +131,7 @@ void nthw_gpio_phy_set_low_power(nthw_gpio_phy_t *p, uint8_t if_no, bool enable)void nthw_gpio_phy_set_reset (nthw_gpio_phy_t *p,uint8_t if_no,bool enable) {if (if_no >=ARRAY_SIZE (p->mpa_fields)) { -assert (false); +RTE_ASSERT (false);return ; }
drivers/net/ntnic/nthw/core/nthw_hif.c +3 -3
@@ -300,7 +300,7 @@ int nthw_hif_stat_req_disable(nthw_hif_t *p)int nthw_hif_end_point_counters_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) { -assert (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,
@@ -341,7 +341,7 @@ int nthw_hif_read_test_reg(nthw_hif_t *p, uint8_t test_reg, uint32_t *p_value)break ;default : -assert (false); +RTE_ASSERT (false);return -1 ; }
@@ -384,7 +384,7 @@ int nthw_hif_write_test_reg(nthw_hif_t *p, uint8_t test_reg, uint32_t value)break ;default : -assert (false); +RTE_ASSERT (false);return -1 ; }
drivers/net/ntnic/nthw/core/nthw_iic.c +3 -3
@@ -66,7 +66,7 @@ static int nthw_iic_reg_tx_fifo_write(nthw_iic_t *p, uint32_t data, bool start,static int nthw_iic_reg_read_i2c_rx_fifo (nthw_iic_t *p,uint8_t *p_data) { -assert (p_data); +RTE_ASSERT (p_data); *p_data = (uint8_t )nthw_field_get_updated (p->mp_fld_rx_fifo_rxdata);
@@ -91,7 +91,7 @@ static int nthw_iic_reg_enable(nthw_iic_t *p)static int nthw_iic_reg_busbusy (nthw_iic_t *p,bool *pb_flag) { -assert (pb_flag); +RTE_ASSERT (pb_flag); *pb_flag =nthw_field_get_updated (p->mp_fld_sr_bb) ? true : false;
@@ -100,7 +100,7 @@ static int nthw_iic_reg_busbusy(nthw_iic_t *p, bool *pb_flag)static int nthw_iic_reg_rxfifo_empty (nthw_iic_t *p,bool *pb_flag) { -assert (pb_flag); +RTE_ASSERT (pb_flag); *pb_flag =nthw_field_get_updated (p->mp_fld_sr_rxfifo_empty) ? true : false;
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +2 -2
@@ -44,7 +44,7 @@ int nthw_mac_pcs_init(nthw_mac_pcs_t *p, nthw_fpga_t *p_fpga, int n_instance) p->mn_instance = n_instance; p->mp_mod_mac_pcs = mod; -assert (n_instance >=0 && n_instance <=255 ); +RTE_ASSERT (n_instance >=0 && n_instance <=255 );nthw_mac_pcs_set_port_no (p, (uint8_t )n_instance); {
@@ -131,7 +131,7 @@ int nthw_mac_pcs_init(nthw_mac_pcs_t *p, nthw_fpga_t *p_fpga, int n_instance) }else {/* Remember to add new product_ids */ -assert (0 ); +RTE_ASSERT (0 ); } p_reg_pcs_config =
drivers/net/ntnic/nthw/core/nthw_pcie3.c +1 -1
@@ -251,7 +251,7 @@ int nthw_pcie3_end_point_counters_sample_post(nthw_pcie3_t *p, struct nthw_hif_end_point_counters *epc) {NT_LOG_DBGX (DBG ,NTHW ); -assert (epc); +RTE_ASSERT (epc);nthw_pcie3_get_stat_rate (p, &epc->cur_tx, &epc->cur_rx, &epc->n_ref_clk_cnt, &epc->n_tags_in_use, &epc->cur_pci_nt_util, &epc->cur_pci_xil_util);
drivers/net/ntnic/nthw/core/nthw_spim.c +1 -1
@@ -105,7 +105,7 @@ uint32_t nthw_spim_write_tx_fifo(nthw_spim_t *p, uint32_t n_data)uint32_t nthw_spim_get_tx_fifo_empty (nthw_spim_t *p,bool *pb_empty) { -assert (pb_empty); +RTE_ASSERT (pb_empty); *pb_empty =nthw_field_get_updated (p->mp_fld_sr_txempty) ? true : false;
drivers/net/ntnic/nthw/core/nthw_spis.c +2 -2
@@ -104,7 +104,7 @@ uint32_t nthw_spis_enable(nthw_spis_t *p, bool b_enable)uint32_t nthw_spis_get_rx_fifo_empty (nthw_spis_t *p,bool *pb_empty) { -assert (pb_empty); +RTE_ASSERT (pb_empty); *pb_empty =nthw_field_get_updated (p->mp_fld_sr_rxempty) ? true : false;
@@ -113,7 +113,7 @@ uint32_t nthw_spis_get_rx_fifo_empty(nthw_spis_t *p, bool *pb_empty)uint32_t nthw_spis_read_rx_fifo (nthw_spis_t *p,uint32_t *p_data) { -assert (p_data); +RTE_ASSERT (p_data); *p_data =nthw_field_get_updated (p->mp_fld_drr_drr);
drivers/net/ntnic/nthw/flow_api/flow_api.c +8 -8
@@ -149,7 +149,7 @@ static_assert(RTE_DIM(err_msg) == ERR_MSG_END,void flow_nic_set_error (enum flow_nic_err_msg_e msg,struct rte_flow_error *error) { -assert (msg <ERR_MSG_NO_MSG ); +RTE_ASSERT (msg <ERR_MSG_NO_MSG );if (error) { error->message = err_msg[msg].message;
@@ -213,7 +213,7 @@ int flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, i {NT_LOG (DBG ,FILTER ,"Reference resource %s idx %i (before ref cnt %i)" , dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); -assert (flow_nic_is_resource_used (ndev, res_type, index)); +RTE_ASSERT (flow_nic_is_resource_used (ndev, res_type, index));if (ndev->res[res_type].ref[index] == (uint32_t )-1 )return -1 ;
@@ -226,8 +226,8 @@ int flow_nic_deref_resource(struct flow_nic_dev *ndev, enum res_type_e res_type, {NT_LOG (DBG ,FILTER ,"De-reference resource %s idx %i (before ref cnt %i)" , dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); -assert (flow_nic_is_resource_used (ndev, res_type, index)); -assert (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 */ ndev->res[res_type].ref[index]--;
@@ -520,7 +520,7 @@ int flow_delete_eth_dev(struct flow_eth_dev *eth_dev)static int init_resource_elements (struct flow_nic_dev *ndev,enum res_type_e res_type,uint32_t count) { -assert (ndev->res[res_type].alloc_bm ==NULL ); +RTE_ASSERT (ndev->res[res_type].alloc_bm ==NULL );/* allocate bitmap and ref counter */ ndev->res[res_type].alloc_bm =calloc (1 ,BIT_CONTAINER_8_ALIGN (count) + count *sizeof (uint32_t ));
@@ -537,7 +537,7 @@ static int init_resource_elements(struct flow_nic_dev *ndev, enum res_type_e resstatic void done_resource_elements (struct flow_nic_dev *ndev,enum res_type_e res_type) { -assert (ndev); +RTE_ASSERT (ndev);free (ndev->res[res_type].alloc_bm); }
@@ -598,7 +598,7 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no adapter_no, port_no, port_id, alloc_rx_queues, flow_profile);if (MAX_OUTPUT_DEST <FLOW_MAX_QUEUES ) { -assert (0 ); +RTE_ASSERT (0 );NT_LOG (ERR ,FILTER ,"ERROR: Internal array for multiple queues too small for API" ); }
@@ -821,7 +821,7 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_b/* check all defined has been initialized */ for (int i =0 ; i <RES_COUNT ; i++) -assert (ndev->res[i].alloc_bm); +RTE_ASSERT (ndev->res[i].alloc_bm);rte_spinlock_init (&ndev->mtx);list_insert_flow_nic (ndev);
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +1 -1
@@ -1632,7 +1632,7 @@ static uint32_t tpe_get_version(void *be_dev)return 3 ; } -assert (false); +RTE_ASSERT (false);return 0 ; }
drivers/net/ntnic/nthw/flow_api/flow_km.c +15 -16
@@ -3,7 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <assert.h> #include <stdlib.h> #include "hw_mod_backend.h"
@@ -118,7 +117,7 @@ int km_add_match_elem(struct km_flow_def_s *km, uint32_t e_word[4], uint32_t e_m }if (word_len <1 || word_len >4 ) { -assert (0 ); +RTE_ASSERT (0 );return -1 ; }
@@ -284,7 +283,7 @@ int km_key_create(struct km_flow_def_s *km, uint32_t port_id) } } -assert (next == km->num_ftype_elem); +RTE_ASSERT (next == km->num_ftype_elem); km->key_word_size = idx; km->port_id = port_id;
@@ -670,7 +669,7 @@ int km_rcp_set(struct km_flow_def_s *km, int index)return -1 ; } -assert ((uint32_t )(km->tcam_start_bank + km->key_word_size) <= +RTE_ASSERT ((uint32_t )(km->tcam_start_bank + km->key_word_size) <= km->be->km.nb_tcam_banks);for (int i =0 ; i < km->key_word_size; i++) {
@@ -705,7 +704,7 @@ static int cam_populate(struct km_flow_def_s *km, int bank) km->cam_dist[CAM_KM_DIST_IDX (bank)].km_owner = km;if (cnt) { -assert (km->cam_paired); +RTE_ASSERT (km->cam_paired);for (uint32_t i =0 ; i < km->be->km.nb_cam_record_words && cnt; i++, cnt--) { res |= hw_mod_km_cam_set(km->be, HW_KM_CAM_W0 + i, bank,
@@ -738,7 +737,7 @@ static int cam_reset_entry(struct km_flow_def_s *km, int bank) km->cam_dist[CAM_KM_DIST_IDX (bank)].km_owner =NULL ;if (cnt) { -assert (km->cam_paired); +RTE_ASSERT (km->cam_paired);for (uint32_t i =0 ; i < km->be->km.nb_cam_record_words && cnt; i++, cnt--) { res |= hw_mod_km_cam_set(km->be, HW_KM_CAM_W0 + i, bank,
@@ -756,7 +755,7 @@ static int cam_reset_entry(struct km_flow_def_s *km, int bank)static int move_cuckoo_index (struct km_flow_def_s *km) { -assert (km->cam_dist[CAM_KM_DIST_IDX (km->bank_used)].km_owner); +RTE_ASSERT (km->cam_dist[CAM_KM_DIST_IDX (km->bank_used)].km_owner);for (uint32_t bank =0 ; bank < km->be->km.nb_cam_banks; bank++) {/* It will not select itself */
@@ -806,7 +805,7 @@ static int move_cuckoo_index_level(struct km_flow_def_s *km_parent, int bank_idx {struct km_flow_def_s *km = km_parent->cam_dist[bank_idx].km_owner; -assert (levels <=CUCKOO_MOVE_MAX_DEPTH ); +RTE_ASSERT (levels <=CUCKOO_MOVE_MAX_DEPTH );/* * Only move if same pairness
@@ -821,7 +820,7 @@ static int move_cuckoo_index_level(struct km_flow_def_s *km_parent, int bank_idxif (levels <=1 )return 0 ; -assert (cam_adr_list_len <CUCKOO_MOVE_MAX_DEPTH ); +RTE_ASSERT (cam_adr_list_len <CUCKOO_MOVE_MAX_DEPTH ); cam_addr_reserved_stack[cam_adr_list_len++] = bank_idx;
@@ -845,7 +844,7 @@ static int move_cuckoo_index_level(struct km_flow_def_s *km_parent, int bank_idxif (move_cuckoo_index (km))return 1 ; -assert (0 ); +RTE_ASSERT (0 ); } }
@@ -856,8 +855,8 @@ static int km_write_data_to_cam(struct km_flow_def_s *km) {int res =0 ;int val[MAX_BANKS ]; -assert (km->be->km.nb_cam_banks <=MAX_BANKS ); -assert (km->cam_dist); +RTE_ASSERT (km->be->km.nb_cam_banks <=MAX_BANKS ); +RTE_ASSERT (km->cam_dist);/* word list without info set */ gethash (km->hsh, km->entry_word, val);
@@ -967,7 +966,7 @@ static int tcam_write_word(struct km_flow_def_s *km, int bank, int record, uint3int rec_bit_shft = record %32 ;uint32_t rec_bit = (1 << rec_bit_shft); -assert ((km->be->km.nb_tcam_bank_width +31 ) /32 <=3 ); +RTE_ASSERT ((km->be->km.nb_tcam_bank_width +31 ) /32 <=3 );for (int byte =0 ; byte <4 ; byte++) {uint8_t a = (uint8_t )((word >> (24 - (byte *8 ))) &0xff );
@@ -994,7 +993,7 @@ static int tcam_write_word(struct km_flow_def_s *km, int bank, int record, uint3 err |=hw_mod_km_tcam_flush (km->be, bank,ALL_BANK_ENTRIES );if (err ==0 ) { -assert (km->tcam_dist[TCAM_DIST_IDX (bank, record)].km_owner ==NULL ); +RTE_ASSERT (km->tcam_dist[TCAM_DIST_IDX (bank, record)].km_owner ==NULL ); km->tcam_dist[TCAM_DIST_IDX (bank, record)].km_owner = km; }
@@ -1044,7 +1043,7 @@ static int tcam_reset_bank(struct km_flow_def_s *km, int bank, int record)int rec_bit_shft = record %32 ;uint32_t rec_bit = (1 << rec_bit_shft); -assert ((km->be->km.nb_tcam_bank_width +31 ) /32 <=3 ); +RTE_ASSERT ((km->be->km.nb_tcam_bank_width +31 ) /32 <=3 );for (int byte =0 ; byte <4 ; byte++) {for (int val =0 ; val <256 ; val++) {
@@ -1141,7 +1140,7 @@ int km_clear_data_match_entry(struct km_flow_def_s *km) km->cam_dist[CAM_KM_DIST_IDX (km->bank_used)].km_owner = km->reference;if (km->key_word_size + !!km->info_set >1 ) { -assert (km->cam_paired); +RTE_ASSERT (km->cam_paired); km->cam_dist[CAM_KM_DIST_IDX (km->bank_used) +1 ].km_owner = km->reference; }
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +4 -3
@@ -4,6 +4,7 @@*/ #include "hw_mod_backend.h" +#include "rte_debug.h" #include <stdlib.h> #include <string.h>
@@ -41,8 +42,8 @@ void *callocate_mod(struct common_func_s *mod, int sets, ...)unsigned int total_bytes =0 ;int cnt, elem_size; -assert (sets <=MAX_SETS ); -assert (sets >0 ); +RTE_ASSERT (sets <=MAX_SETS ); +RTE_ASSERT (sets >0 );va_list args;va_start (args, sets);
@@ -92,7 +93,7 @@ int flow_api_backend_init(struct flow_api_backend_s *dev,const struct flow_api_backend_ops *iface, void *be_dev) { -assert (dev ); +RTE_ASSERT (dev ); dev->iface = iface; dev->be_dev = be_dev; dev->num_phy_ports = iface->get_nb_phy_port (be_dev);
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_evt_queue.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2024 Napatech A/S */ -#include <assert.h> #include <stdlib.h> #include <string.h>
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.c +1 -2
@@ -3,7 +3,6 @@* Copyright(c) 2024 Napatech A/S */ -#include <assert.h> #include <stdlib.h> #include <string.h>
@@ -25,7 +24,7 @@ void *flm_lrn_queue_create(void)QUEUE_SIZE ,SOCKET_ID_ANY , RING_F_MP_HTS_ENQ | RING_F_SC_DEQ); -assert (q !=NULL ); +RTE_ASSERT (q !=NULL );return q; }
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +11 -11
@@ -386,7 +386,7 @@ static int flm_mtr_adjust_stats(struct flow_eth_dev *dev, uint8_t caller_id, uinstatic void flm_setup_queues (void ) { flm_lrn_queue_arr =flm_lrn_queue_create (); -assert (flm_lrn_queue_arr !=NULL ); +RTE_ASSERT (flm_lrn_queue_arr !=NULL ); }static void flm_free_queues (void )
@@ -774,7 +774,7 @@ struct flm_flow_key_def_s {static inline void set_key_def_qw (struct flm_flow_key_def_s *key_def,unsigned int qw,unsigned int dyn,unsigned int ofs) { -assert (qw <2 ); +RTE_ASSERT (qw <2 );if (qw ==0 ) { key_def->qw0_dyn = dyn &0x7f ;
@@ -789,7 +789,7 @@ static inline void set_key_def_qw(struct flm_flow_key_def_s *key_def, unsigned istatic inline void set_key_def_sw (struct flm_flow_key_def_s *key_def,unsigned int sw,unsigned int dyn,unsigned int ofs) { -assert (sw <2 ); +RTE_ASSERT (sw <2 );if (sw ==0 ) { key_def->sw8_dyn = dyn &0x7f ;
@@ -3188,7 +3188,7 @@ static void setup_db_qsl_data(struct nic_flow_def *fd, struct hw_db_inline_qsl_d qsl_data->drop =1 ; }else { -assert (fd->dst_num_avail <HW_DB_INLINE_MAX_QST_PER_QSL ); +RTE_ASSERT (fd->dst_num_avail <HW_DB_INLINE_MAX_QST_PER_QSL );uint32_t ports[fd->dst_num_avail];uint32_t queues[fd->dst_num_avail];
@@ -3314,7 +3314,7 @@ static int setup_flow_flm_actions(struct flow_eth_dev *dev,/* Setup TPE EXT */ if (fd->tun_hdr.len >0 ) { -assert (fd->tun_hdr.len <=HW_DB_INLINE_MAX_ENCAP_SIZE ); +RTE_ASSERT (fd->tun_hdr.len <=HW_DB_INLINE_MAX_ENCAP_SIZE );struct hw_db_inline_tpe_ext_data tpe_ext_data = { .size = fd->tun_hdr.len,
@@ -3339,7 +3339,7 @@ static int setup_flow_flm_actions(struct flow_eth_dev *dev, }/* Setup TPE */ -assert (fd->modify_field_count <=6 ); +RTE_ASSERT (fd->modify_field_count <=6 );struct hw_db_inline_tpe_data tpe_data = { .insert_len = fd->tun_hdr.len,
@@ -3882,7 +3882,7 @@ int initialize_flow_management_of_ndev_profile_inline(struct flow_nic_dev *ndev) {if (!ndev->flow_mgnt_prepared) {/* Check static arrays are big enough */ -assert (ndev->be.tpe.nb_cpy_writers <=MAX_CPY_WRITERS_SUPPORTED ); +RTE_ASSERT (ndev->be.tpe.nb_cpy_writers <=MAX_CPY_WRITERS_SUPPORTED );/* KM Flow Type 0 is reserved */ flow_nic_mark_resource_used (ndev,RES_KM_FLOW_TYPE ,0 );flow_nic_mark_resource_used (ndev,RES_KM_CATEGORY ,0 );
@@ -4250,8 +4250,8 @@ int flow_destroy_locked_profile_inline(struct flow_eth_dev *dev,struct flow_handle *fh, struct rte_flow_error *error) { -assert (dev ); -assert (fh); +RTE_ASSERT (dev ); +RTE_ASSERT (fh);int err =0 ;
@@ -4386,8 +4386,8 @@ int flow_actions_update_profile_inline(struct flow_eth_dev *dev,const struct rte_flow_action action[], struct rte_flow_error *error) { -assert (dev ); -assert (flow); +RTE_ASSERT (dev ); +RTE_ASSERT (flow);uint32_t num_dest_port =0 ;uint32_t num_queues =0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c +20 -20
@@ -41,7 +41,7 @@ int cat_nthw_init(struct cat_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_CAT , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
@@ -401,43 +401,43 @@ void cat_nthw_cfn_ptc_tnl_l4(const struct cat_nthw *p, uint32_t val)void cat_nthw_cfn_ptc_cfp (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_ptc_cfp); +RTE_ASSERT (p->mp_cfn_data_ptc_cfp);nthw_field_set_val32 (p->mp_cfn_data_ptc_cfp, val); }void cat_nthw_cfn_err_l3_cs (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_l3_cs); +RTE_ASSERT (p->mp_cfn_data_err_l3_cs);nthw_field_set_val32 (p->mp_cfn_data_err_l3_cs, val); }void cat_nthw_cfn_err_l4_cs (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_l4_cs); +RTE_ASSERT (p->mp_cfn_data_err_l4_cs);nthw_field_set_val32 (p->mp_cfn_data_err_l4_cs, val); }void cat_nthw_cfn_err_tnl_l3_cs (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_tnl_l3_cs); +RTE_ASSERT (p->mp_cfn_data_err_tnl_l3_cs);nthw_field_set_val32 (p->mp_cfn_data_err_tnl_l3_cs, val); }void cat_nthw_cfn_err_tnl_l4_cs (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_tnl_l4_cs); +RTE_ASSERT (p->mp_cfn_data_err_tnl_l4_cs);nthw_field_set_val32 (p->mp_cfn_data_err_tnl_l4_cs, val); }void cat_nthw_cfn_err_ttl_exp (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_ttl_exp); +RTE_ASSERT (p->mp_cfn_data_err_ttl_exp);nthw_field_set_val32 (p->mp_cfn_data_err_ttl_exp, val); }void cat_nthw_cfn_err_tnl_ttl_exp (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_err_tnl_ttl_exp); +RTE_ASSERT (p->mp_cfn_data_err_tnl_ttl_exp);nthw_field_set_val32 (p->mp_cfn_data_err_tnl_ttl_exp, val); }
@@ -518,7 +518,7 @@ void cat_nthw_cfn_km0_or(const struct cat_nthw *p, uint32_t val)void cat_nthw_cfn_km1_or (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cfn_data_km1_or); +RTE_ASSERT (p->mp_cfn_data_km1_or);nthw_field_set_val32 (p->mp_cfn_data_km1_or, val); }
@@ -638,25 +638,25 @@ void cat_nthw_cte_enable_pdb(const struct cat_nthw *p, uint32_t val)void cat_nthw_cte_enable_msk (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cte_data_msk); +RTE_ASSERT (p->mp_cte_data_msk);nthw_field_set_val32 (p->mp_cte_data_msk, val); }void cat_nthw_cte_enable_hst (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cte_data_hst); +RTE_ASSERT (p->mp_cte_data_hst);nthw_field_set_val32 (p->mp_cte_data_hst, val); }void cat_nthw_cte_enable_epp (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cte_data_epp); +RTE_ASSERT (p->mp_cte_data_epp);nthw_field_set_val32 (p->mp_cte_data_epp, val); }void cat_nthw_cte_enable_tpe (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_cte_data_tpe); +RTE_ASSERT (p->mp_cte_data_tpe);nthw_field_set_val32 (p->mp_cte_data_tpe, val); }
@@ -835,38 +835,38 @@ void cat_nthw_len_flush(const struct cat_nthw *p)void cat_nthw_kcc_select (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_kcc_addr); +RTE_ASSERT (p->mp_kcc_addr);nthw_field_set_val32 (p->mp_kcc_addr, val); }void cat_nthw_kcc_cnt (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_kcc_cnt); +RTE_ASSERT (p->mp_kcc_cnt);nthw_field_set_val32 (p->mp_kcc_cnt, val); }void cat_nthw_kcc_key (const struct cat_nthw *p,uint32_t *val) { -assert (p->mp_kcc_data_key); +RTE_ASSERT (p->mp_kcc_data_key);nthw_field_set_val (p->mp_kcc_data_key, val,2 ); }void cat_nthw_kcc_category (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_kcc_data_category); +RTE_ASSERT (p->mp_kcc_data_category);nthw_field_set_val32 (p->mp_kcc_data_category, val); }void cat_nthw_kcc_id (const struct cat_nthw *p,uint32_t val) { -assert (p->mp_kcc_data_id); +RTE_ASSERT (p->mp_kcc_data_id);nthw_field_set_val32 (p->mp_kcc_data_id, val); }void cat_nthw_kcc_flush (const struct cat_nthw *p) { -assert (p->mp_kcc_ctrl); -assert (p->mp_kcc_data); +RTE_ASSERT (p->mp_kcc_ctrl); +RTE_ASSERT (p->mp_kcc_data);nthw_register_flush (p->mp_kcc_ctrl,1 );nthw_register_flush (p->mp_kcc_data,1 ); }
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c +1 -1
@@ -40,7 +40,7 @@ int csu_nthw_init(struct csu_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_CSU , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c +48 -45
331 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c +1 -1
@@ -40,7 +40,7 @@ int hfu_nthw_init(struct hfu_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_HFU , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c +1 -1
@@ -40,7 +40,7 @@ int hsh_nthw_init(struct hsh_nthw *p, nthw_fpga_t *p_fpga, int n_instance) {const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_HSH , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c +9 -9
@@ -32,7 +32,7 @@ int ifr_nthw_init(struct ifr_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_IFR , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
@@ -81,13 +81,13 @@ int ifr_nthw_init(struct ifr_nthw *p, nthw_fpga_t *p_fpga, int n_instance)void ifr_nthw_rcp_select (const struct ifr_nthw *p,uint32_t val) { -assert (p->mp_rcp_addr); +RTE_ASSERT (p->mp_rcp_addr);nthw_field_set_val32 (p->mp_rcp_addr, val); }void ifr_nthw_rcp_cnt (const struct ifr_nthw *p,uint32_t val) { -assert (p->mp_rcp_cnt); +RTE_ASSERT (p->mp_rcp_cnt);nthw_field_set_val32 (p->mp_rcp_cnt, val); }
@@ -117,27 +117,27 @@ void ifr_nthw_rcp_ipv6_drop(const struct ifr_nthw *p, uint32_t val)void ifr_nthw_rcp_mtu (const struct ifr_nthw *p,uint32_t val) { -assert (p->mp_rcp_data_mtu); +RTE_ASSERT (p->mp_rcp_data_mtu);nthw_field_set_val32 (p->mp_rcp_data_mtu, val); }void ifr_nthw_rcp_flush (const struct ifr_nthw *p) { -assert (p->mp_rcp_ctrl); -assert (p->mp_rcp_data); +RTE_ASSERT (p->mp_rcp_ctrl); +RTE_ASSERT (p->mp_rcp_data);nthw_register_flush (p->mp_rcp_ctrl,1 );nthw_register_flush (p->mp_rcp_data,1 ); }void ifr_nthw_counters_select (const struct ifr_nthw *p,uint32_t val) { -assert (p->mp_counters_addr); +RTE_ASSERT (p->mp_counters_addr);nthw_field_set_val32 (p->mp_counters_addr, val); }void ifr_nthw_counters_cnt (const struct ifr_nthw *p,uint32_t val) { -assert (p->mp_counters_cnt); +RTE_ASSERT (p->mp_counters_cnt);nthw_field_set_val32 (p->mp_counters_cnt, val); }
@@ -149,7 +149,7 @@ void ifr_nthw_counters_drop(const struct ifr_nthw *p, uint32_t *val, int get)void ifr_nthw_counters_update (const struct ifr_nthw *p) { -assert (p->mp_counters_data); +RTE_ASSERT (p->mp_counters_data);nthw_register_flush (p->mp_counters_ctrl,1 );nthw_register_update (p->mp_counters_data); }
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c +1 -1
@@ -38,7 +38,7 @@ void info_nthw_delete(struct info_nthw *p)int info_nthw_init (struct info_nthw *p,nthw_fpga_t *p_fpga,int n_instance) { -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 ); p->mp_fpga = p_fpga; p->m_physical_adapter_no = (uint8_t )n_instance;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c +1 -1
@@ -50,7 +50,7 @@ int km_nthw_init(struct km_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_KM , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c +1 -1
@@ -40,7 +40,7 @@ int pdb_nthw_init(struct pdb_nthw *p, nthw_fpga_t *p_fpga, int n_instance) {const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_PDB , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c +1 -1
@@ -41,7 +41,7 @@ int qsl_nthw_init(struct qsl_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_QSL , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c +11 -11
@@ -40,7 +40,7 @@ int rpp_lr_nthw_init(struct rpp_lr_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_RPP_LR , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
@@ -84,39 +84,39 @@ int rpp_lr_nthw_init(struct rpp_lr_nthw *p, nthw_fpga_t *p_fpga, int n_instance)void rpp_lr_nthw_rcp_select (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_rcp_addr); +RTE_ASSERT (p->mp_rcp_addr);nthw_field_set_val32 (p->mp_rcp_addr, val); }void rpp_lr_nthw_rcp_cnt (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_rcp_cnt); +RTE_ASSERT (p->mp_rcp_cnt);nthw_field_set_val32 (p->mp_rcp_cnt, val); }void rpp_lr_nthw_rcp_exp (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_rcp_data_exp); +RTE_ASSERT (p->mp_rcp_data_exp);nthw_field_set_val32 (p->mp_rcp_data_exp, val); }void rpp_lr_nthw_rcp_flush (const struct rpp_lr_nthw *p) { -assert (p->mp_rcp_ctrl); -assert (p->mp_rcp_data); +RTE_ASSERT (p->mp_rcp_ctrl); +RTE_ASSERT (p->mp_rcp_data);nthw_register_flush (p->mp_rcp_ctrl,1 );nthw_register_flush (p->mp_rcp_data,1 ); }void rpp_lr_nthw_ifr_rcp_select (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_ifr_rcp_addr); +RTE_ASSERT (p->mp_ifr_rcp_addr);nthw_field_set_val32 (p->mp_ifr_rcp_addr, val); }void rpp_lr_nthw_ifr_rcp_cnt (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_ifr_rcp_cnt); +RTE_ASSERT (p->mp_ifr_rcp_cnt);nthw_field_set_val32 (p->mp_ifr_rcp_cnt, val); }
@@ -146,14 +146,14 @@ void rpp_lr_nthw_ifr_rcp_ipv6_drop(const struct rpp_lr_nthw *p, uint32_t val)void rpp_lr_nthw_ifr_rcp_mtu (const struct rpp_lr_nthw *p,uint32_t val) { -assert (p->mp_ifr_rcp_data_mtu); +RTE_ASSERT (p->mp_ifr_rcp_data_mtu);nthw_field_set_val32 (p->mp_ifr_rcp_data_mtu, val); }void rpp_lr_nthw_ifr_rcp_flush (const struct rpp_lr_nthw *p) { -assert (p->mp_ifr_rcp_ctrl); -assert (p->mp_ifr_rcp_data); +RTE_ASSERT (p->mp_ifr_rcp_ctrl); +RTE_ASSERT (p->mp_ifr_rcp_data);nthw_register_flush (p->mp_ifr_rcp_ctrl,1 );nthw_register_flush (p->mp_ifr_rcp_data,1 ); }
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c +1 -1
@@ -41,7 +41,7 @@ int slc_lr_nthw_init(struct slc_lr_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_SLC_LR , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c +8 -8
@@ -41,7 +41,7 @@ int tx_cpy_nthw_init(struct tx_cpy_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_TX_CPY , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
@@ -345,44 +345,44 @@ int tx_cpy_nthw_init(struct tx_cpy_nthw *p, nthw_fpga_t *p_fpga, int n_instance)void tx_cpy_nthw_writer_select (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_ctrl_addr, val); }void tx_cpy_nthw_writer_cnt (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_ctrl_cnt, val); }void tx_cpy_nthw_writer_reader_select (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_data_reader_select, val); }void tx_cpy_nthw_writer_dyn (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_data_dyn, val); }void tx_cpy_nthw_writer_ofs (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_data_ofs, val); }void tx_cpy_nthw_writer_len (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_field_set_val32 (p->m_writers[index].mp_writer_data_len, val); }void tx_cpy_nthw_writer_flush (const struct tx_cpy_nthw *p,unsigned int index) { -assert (index < p->m_writers_cnt); +RTE_ASSERT (index < p->m_writers_cnt);nthw_register_flush (p->m_writers[index].mp_writer_ctrl,1 );nthw_register_flush (p->m_writers[index].mp_writer_data,1 ); }
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c +1 -1
@@ -40,7 +40,7 @@ int tx_ins_nthw_init(struct tx_ins_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_TX_INS , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c +2 -2
@@ -40,7 +40,7 @@ int tx_rpl_nthw_init(struct tx_rpl_nthw *p, nthw_fpga_t *p_fpga, int n_instance)const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_TX_RPL , n_instance); -assert (n_instance >=0 && n_instance <256 ); +RTE_ASSERT (n_instance >=0 && n_instance <256 );if (p ==NULL )return p_mod ==NULL ?-1 :0 ;
@@ -119,7 +119,7 @@ void tx_rpl_nthw_rcp_ext_prio(const struct tx_rpl_nthw *p, uint32_t val)void tx_rpl_nthw_rcp_eth_type_wr (const struct tx_rpl_nthw *p,uint32_t val) { -assert (p->mp_rcp_data_eth_type_wr); +RTE_ASSERT (p->mp_rcp_data_eth_type_wr);nthw_field_set_val32 (p->mp_rcp_data_eth_type_wr, val); }
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +29 -29
172 lines not on this page · raw message
drivers/net/ntnic/nthw/nthw_rac.c +8 -8
@@ -37,7 +37,7 @@ nthw_rac_t *nthw_rac_new(void)int nthw_rac_init (nthw_rac_t *p,nthw_fpga_t *p_fpga,struct fpga_info_s *p_fpga_info) { -assert (p_fpga_info); +RTE_ASSERT (p_fpga_info);const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_RAC ,0 );
@@ -74,8 +74,8 @@ int nthw_rac_init(nthw_rac_t *p, nthw_fpga_t *p_fpga, struct fpga_info_s *p_fpga p->mn_fld_rab_init_mask =nthw_field_get_mask (p->mp_fld_rab_init);/* RAC_RAB_INIT_RAB reg/field sanity checks: */ -assert (p->mn_fld_rab_init_mask == ((1UL << p->mn_fld_rab_init_bw) -1 )); -assert (p->mn_fld_rab_init_bw == p->mn_param_rac_rab_interfaces); +RTE_ASSERT (p->mn_fld_rab_init_mask == ((1UL << p->mn_fld_rab_init_bw) -1 )); +RTE_ASSERT (p->mn_fld_rab_init_bw == p->mn_param_rac_rab_interfaces); p->mp_reg_dbg_ctrl =nthw_module_query_register (p->mp_mod_rac,RAC_DBG_CTRL );
@@ -309,8 +309,8 @@ int nthw_rac_rab_reset(nthw_rac_t *p)NT_LOG (DBG ,NTHW ,"%s: NT_RAC_RAB_INTERFACES=%d (0x%02X)" , p_adapter_id_str, n_rac_rab_bus_count, n_rac_rab_bus_mask); -assert (n_rac_rab_bus_count); -assert (n_rac_rab_bus_mask); +RTE_ASSERT (n_rac_rab_bus_count); +RTE_ASSERT (n_rac_rab_bus_mask);/* RAC RAB bus "flip/flip" reset first stage - new impl (ref RMT#37020) */ nthw_rac_rab_init (p,0 );
@@ -452,7 +452,7 @@ uint32_t nthw_rac_rab_get_free(nthw_rac_t *p) {if (!p->m_dma_active) {/* Expecting mutex not to be locked! */ -assert (0 );/* alert developer that something is wrong */ +RTE_ASSERT (0 );/* alert developer that something is wrong */ return -1 ; }
@@ -469,7 +469,7 @@ int nthw_rac_rab_write32_dma(nthw_rac_t *p, nthw_rab_bus_id_t bus_id, uint32_t aNT_LOG (ERR ,NTHW ,"%s: Failed rab dma write length check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X" , p_adapter_id_str, bus_id, address, word_cnt, p->m_in_free); -assert (0 );/* alert developer that something is wrong */ +RTE_ASSERT (0 );/* alert developer that something is wrong */ return -1 ; }
@@ -508,7 +508,7 @@ int nthw_rac_rab_read32_dma(nthw_rac_t *p, nthw_rab_bus_id_t bus_id, uint32_t adNT_LOG (ERR ,NTHW ,"%s: Failed rab dma read length check - bus: %d addr: 0x%08X wordcount: %d - inBufFree: 0x%08X" , p_adapter_id_str, bus_id, address, word_cnt, p->m_in_free); -assert (0 );/* alert developer that something is wrong */ +RTE_ASSERT (0 );/* alert developer that something is wrong */ return -1 ; }
drivers/net/ntnic/nthw/stat/nthw_stat.c +2 -2
@@ -259,7 +259,7 @@ int nthw_stat_init(nthw_stat_t *p, nthw_fpga_t *p_fpga, int n_instance) p_adapter_id_str, n_module_version_packed64, p->mn_stat_layout_version); } -assert (p->mn_stat_layout_version); +RTE_ASSERT (p->mn_stat_layout_version);/* STA module 0.2+ adds IPF counters per port (Rx feature) */ if (n_module_version_packed64 >=VERSION_PACKED64 (0 ,2 ))
@@ -332,7 +332,7 @@ int nthw_stat_init(nthw_stat_t *p, nthw_fpga_t *p_fpga, int n_instance)int nthw_stat_set_dma_address (nthw_stat_t *p,uint64_t stat_dma_physical,uint32_t *p_stat_dma_virtual) { -assert (p_stat_dma_virtual); +RTE_ASSERT (p_stat_dma_virtual); p->mp_timestamp =NULL ; p->m_stat_dma_physical = stat_dma_physical;
drivers/net/ntnic/ntnic_ethdev.c +9 -9
@@ -1197,7 +1197,7 @@ eth_mac_addr_add(struct rte_eth_dev *eth_dev, {struct rte_ether_addr *const eth_addrs = eth_dev->data->mac_addrs; -assert (index <NUM_MAC_ADDRS_PER_PORT ); +RTE_ASSERT (index <NUM_MAC_ADDRS_PER_PORT );if (index >=NUM_MAC_ADDRS_PER_PORT ) { const struct pmd_internals *const internals =
@@ -1366,8 +1366,8 @@ eth_dev_set_link_up(struct rte_eth_dev *eth_dev)if (internals->type ==PORT_TYPE_VIRTUAL || internals->type ==PORT_TYPE_OVERRIDE )return 0 ; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (port == internals->n_intf_no); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (port == internals->n_intf_no); port_ops->set_adm_state (p_adapter_info, port, true);
@@ -1392,8 +1392,8 @@ eth_dev_set_link_down(struct rte_eth_dev *eth_dev)if (internals->type ==PORT_TYPE_VIRTUAL || internals->type ==PORT_TYPE_OVERRIDE )return 0 ; -assert (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); -assert (port == internals->n_intf_no); +RTE_ASSERT (port >=0 && port <NUM_ADAPTER_PORTS_MAX ); +RTE_ASSERT (port == internals->n_intf_no); port_ops->set_link_status (p_adapter_info, port, false);
@@ -1930,7 +1930,7 @@ THREAD_FUNC adapter_stat_thread_fn(void *context)NT_LOG_DBGX (DBG ,NTNIC ,"%s: begin" , p_adapter_id_str); -assert (p_nthw_stat); +RTE_ASSERT (p_nthw_stat);while (!p_drv->ntdrv.b_shutdown) {nt_os_wait_usec (10 *1000 );
@@ -2071,7 +2071,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) kvargs_count =rte_kvargs_count (kvlist,ETH_DEV_NTHW_RXQUEUES_ARG );if (kvargs_count !=0 ) { -assert (kvargs_count ==1 ); +RTE_ASSERT (kvargs_count ==1 ); res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_RXQUEUES_ARG , &string_to_u32, &nb_rx_queues);
@@ -2095,7 +2095,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) kvargs_count =rte_kvargs_count (kvlist,ETH_DEV_NTHW_TXQUEUES_ARG );if (kvargs_count !=0 ) { -assert (kvargs_count ==1 ); +RTE_ASSERT (kvargs_count ==1 ); res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_TXQUEUES_ARG , &string_to_u32, &nb_tx_queues);
@@ -2401,7 +2401,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)if (get_flow_filter_ops () !=NULL ) {if (fpga_info->profile ==FPGA_INFO_PROFILE_INLINE && internals->flw_dev->ndev->be.tpe.ver >=2 ) { -assert (nthw_eth_dev_ops.mtu_set == dev_set_mtu_inline || +RTE_ASSERT (nthw_eth_dev_ops.mtu_set == dev_set_mtu_inline || nthw_eth_dev_ops.mtu_set ==NULL ); nthw_eth_dev_ops.mtu_set = dev_set_mtu_inline;dev_set_mtu_inline (eth_dev,MTUINITVAL );
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +1 -1
@@ -1159,7 +1159,7 @@ static int poll_statistics(struct pmd_internals *internals)if (!p_nt4ga_stat || if_index <0 || if_index >=NUM_ADAPTER_PORTS_MAX )return -1 ; -assert (rte_tsc_freq >0 ); +RTE_ASSERT (rte_tsc_freq >0 );rte_spinlock_lock (&hwlock);
drivers/net/ntnic/ntutil/nt_util.c +0 -1
@@ -7,7 +7,6 @@#include <stdlib.h> #include <stdint.h> #include <inttypes.h> -#include <assert.h> #include <rte_ethdev.h> #include <rte_malloc.h>
Signature · 1 line
2.45.0
PATCH 4/5 net/ntnic: check result of malloc
In reply to Serhii IliushykCheck return value from the malloc code
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 10 ++++++---- drivers/net/ntnic/nthw/nthw_rac.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +6 -4
@@ -822,8 +822,9 @@ nthw_setup_mngd_rx_virt_queue_split(nthw_dbs_t *p_nthw_dbs,if (p_packet_buffers) { rxvq[index].p_virtual_addr =malloc (queue_size *sizeof (*p_packet_buffers)); -memcpy (rxvq[index].p_virtual_addr, p_packet_buffers, - queue_size *sizeof (*p_packet_buffers)); +if (rxvq[index].p_virtual_addr) +memcpy (rxvq[index].p_virtual_addr, p_packet_buffers, + queue_size *sizeof (*p_packet_buffers)); } nthw_setup_rx_virt_queue(p_nthw_dbs, index, 0, 0, (void *)p_virt_struct_area->phys_addr,
@@ -878,8 +879,9 @@ nthw_setup_mngd_tx_virt_queue_split(nthw_dbs_t *p_nthw_dbs,if (p_packet_buffers) { txvq[index].p_virtual_addr =malloc (queue_size *sizeof (*p_packet_buffers)); -memcpy (txvq[index].p_virtual_addr, p_packet_buffers, - queue_size *sizeof (*p_packet_buffers)); +if (txvq[index].p_virtual_addr) +memcpy (txvq[index].p_virtual_addr, p_packet_buffers, + queue_size *sizeof (*p_packet_buffers)); } nthw_setup_tx_virt_queue(p_nthw_dbs, index, 0, 0, (void *)p_virt_struct_area->phys_addr,
drivers/net/ntnic/nthw/nthw_rac.c +4 -1
@@ -31,7 +31,10 @@nthw_rac_t *nthw_rac_new (void ) {nthw_rac_t *p =malloc (sizeof (nthw_rac_t)); -memset (p,0 ,sizeof (nthw_rac_t)); + +if (p) +memset (p,0 ,sizeof (nthw_rac_t)); +return p; }
Signature · 1 line
2.45.0
PATCH 5/5 net/ntnic: add nthw prefix function names
In reply to Serhii IliushykAdd nthw prefix to functions with abstract names
to avoid exposing global symbols
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 6 +- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 6 +- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 32 +-- drivers/net/ntnic/include/create_elements.h | 8 +- drivers/net/ntnic/include/flow_api.h | 18 +- drivers/net/ntnic/include/flow_api_engine.h | 10 +- drivers/net/ntnic/include/flow_filter.h | 6 +- drivers/net/ntnic/include/hw_mod_backend.h | 10 +- drivers/net/ntnic/include/ntnic_dbs.h | 18 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 23 +- .../link_agx_100g/nt4ga_agx_link_100g.c | 31 +- drivers/net/ntnic/link_mgmt/nt4ga_link.c | 4 +- drivers/net/ntnic/nim/i2c_nim.c | 16 +- drivers/net/ntnic/nim/i2c_nim.h | 12 +- drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 18 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 48 ++-- .../ntnic/nthw/flow_api/flow_api_nic_setup.h | 8 +- .../nthw/flow_api/flow_backend/flow_backend.c | 8 +- drivers/net/ntnic/nthw/flow_api/flow_filter.c | 12 +- drivers/net/ntnic/nthw/flow_api/flow_group.c | 10 +- drivers/net/ntnic/nthw/flow_api/flow_hasher.c | 4 +- drivers/net/ntnic/nthw/flow_api/flow_hasher.h | 4 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 4 +- .../nthw/flow_api/hw_mod/hw_mod_backend.c | 10 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 6 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 5 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 4 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 4 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 4 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 4 +- .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 4 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 4 +- .../flow_api/profile_inline/flm_evt_queue.c | 12 +- .../flow_api/profile_inline/flm_evt_queue.h | 8 +- .../profile_inline/flow_api_hw_db_inline.c | 24 +- .../profile_inline/flow_api_profile_inline.c | 268 +++++++++--------- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 12 +- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 44 +-- drivers/net/ntnic/ntnic_mod_reg.c | 18 +- drivers/net/ntnic/ntnic_mod_reg.h | 29 +- drivers/net/ntnic/ntutil/nt_util.c | 4 +- drivers/net/ntnic/ntutil/nt_util.h | 4 +- 43 files changed, 404 insertions(+), 382 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +3 -3
@@ -168,7 +168,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;if (flow_filter_ops !=NULL ) { - res = flow_filter_ops->flow_filter_init (p_fpga, &p_filter->mp_flow_device, + res = flow_filter_ops->nthw_flow_filter_init (p_fpga, &p_filter->mp_flow_device, p_adapter_info->adapter_no);if (res !=0 ) {
@@ -266,7 +266,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;if (flow_filter_ops !=NULL ) { - res = flow_filter_ops->flow_filter_done (p_filter->mp_flow_device); + res = flow_filter_ops->nthw_flow_filter_done (p_filter->mp_flow_device);if (res !=0 ) {NT_LOG (ERR ,NTNIC ,"Cannot deinitialize filter" );
@@ -309,7 +309,7 @@ static const struct adapter_ops ops = { .show_info = nt4ga_adapter_show_info, }; -void adapter_init (void ) +void nthw_adapter_init (void ) {register_adapter_ops (&ops); }
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +4 -2
@@ -558,11 +558,13 @@ static int nt4ga_stat_collect_cap_v1_stats(struct adapter_info_s *p_adapter_info }/* Update and get FLM stats */ - flow_filter_ops->flow_get_flm_stats (ndev, (uint64_t *)p_nt4ga_stat->mp_stat_structs_flm, + flow_filter_ops->nthw_flow_get_flm_stats (ndev, + (uint64_t *)p_nt4ga_stat->mp_stat_structs_flm,sizeof (struct flm_counters_v1 ) /sizeof (uint64_t ));/* Update and get IFR stats */ - flow_filter_ops->flow_get_ifr_stats (ndev, (uint64_t *)p_nt4ga_stat->mp_stat_structs_ifr, + flow_filter_ops->nthw_flow_get_ifr_stats (ndev, + (uint64_t *)p_nt4ga_stat->mp_stat_structs_ifr, p_nt4ga_stat->mn_ifr_counters -1 );/*
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +16 -16
@@ -177,13 +177,13 @@ static void dbs_init_rx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t suint32_t dummy;do { -get_rx_init (p_nthw_dbs, &init, &dummy, &busy); +nthw_get_rx_init (p_nthw_dbs, &init, &dummy, &busy); }while (busy !=0 ); -set_rx_init (p_nthw_dbs, start_idx, start_ptr,INIT_QUEUE , queue); +nthw_set_rx_init (p_nthw_dbs, start_idx, start_ptr,INIT_QUEUE , queue);do { -get_rx_init (p_nthw_dbs, &init, &dummy, &busy); +nthw_get_rx_init (p_nthw_dbs, &init, &dummy, &busy); }while (busy !=0 ); }
@@ -195,13 +195,13 @@ static void dbs_init_tx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t suint32_t dummy;do { -get_tx_init (p_nthw_dbs, &init, &dummy, &busy); +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);do { -get_tx_init (p_nthw_dbs, &init, &dummy, &busy); +nthw_get_tx_init (p_nthw_dbs, &init, &dummy, &busy); }while (busy !=0 ); }
@@ -250,18 +250,18 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)for (i =0 ; i <NT_DBS_TX_QUEUES_MAX ; ++i)dbs_init_tx_queue (p_nthw_dbs, i,0 ,0 ); -set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_DISABLE ,RX_AM_POLL_SPEED ,RX_UW_DISABLE , +nthw_set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_DISABLE ,RX_AM_POLL_SPEED ,RX_UW_DISABLE ,RX_UW_POLL_SPEED ,RX_Q_DISABLE ); -set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_ENABLE ,RX_AM_POLL_SPEED ,RX_UW_ENABLE , +nthw_set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_ENABLE ,RX_AM_POLL_SPEED ,RX_UW_ENABLE ,RX_UW_POLL_SPEED ,RX_Q_DISABLE ); -set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_ENABLE ,RX_AM_POLL_SPEED ,RX_UW_ENABLE , +nthw_set_rx_control (p_nthw_dbs,LAST_QUEUE ,RX_AM_ENABLE ,RX_AM_POLL_SPEED ,RX_UW_ENABLE ,RX_UW_POLL_SPEED ,RX_Q_ENABLE ); -set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_DISABLE ,TX_AM_POLL_SPEED ,TX_UW_DISABLE , +nthw_set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_DISABLE ,TX_AM_POLL_SPEED ,TX_UW_DISABLE ,TX_UW_POLL_SPEED ,TX_Q_DISABLE ); -set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_ENABLE ,TX_AM_POLL_SPEED ,TX_UW_ENABLE , +nthw_set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_ENABLE ,TX_AM_POLL_SPEED ,TX_UW_ENABLE ,TX_UW_POLL_SPEED ,TX_Q_DISABLE ); -set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_ENABLE ,TX_AM_POLL_SPEED ,TX_UW_ENABLE , +nthw_set_tx_control (p_nthw_dbs,LAST_QUEUE ,TX_AM_ENABLE ,TX_AM_POLL_SPEED ,TX_UW_ENABLE ,TX_UW_POLL_SPEED ,TX_Q_ENABLE );return 0 ;
@@ -464,10 +464,10 @@ static int dbs_wait_on_busy(struct nthw_virt_queue *vq, uint32_t *idle, int rx)do {if (rx) - err =get_rx_idle (p_nthw_dbs, idle, &queue, &busy); + err =nthw_get_rx_idle (p_nthw_dbs, idle, &queue, &busy);else - err =get_tx_idle (p_nthw_dbs, idle, &queue, &busy); + err =nthw_get_tx_idle (p_nthw_dbs, idle, &queue, &busy); }while (!err && busy);return err;
@@ -492,10 +492,10 @@ static int dbs_wait_hw_queue_shutdown(struct nthw_virt_queue *vq, int rx) do { if (rx) - err = set_rx_idle(p_nthw_dbs, 1, vq->index); + err = nthw_set_rx_idle(p_nthw_dbs, 1, vq->index); else - err = set_tx_idle(p_nthw_dbs, 1, vq->index); + err = nthw_set_tx_idle(p_nthw_dbs, 1, vq->index); if (err) return -1;
@@ -1424,7 +1424,7 @@ static struct sg_ops_s sg_ops = { .nthw_virt_queue_init = nthw_virt_queue_init }; -void sg_init (void ) +void nthw_sg_init (void ) {NT_LOG (INF ,NTNIC ,"SG ops initialized" );register_sg_ops (&sg_ops);
drivers/net/ntnic/include/create_elements.h +4 -4
@@ -60,11 +60,11 @@ enum nt_rte_flow_item_type {extern rte_spinlock_t flow_lock; -int interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out); -int create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr); -int create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[], +int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out); +int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr); +int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[],int max_elem); -int create_action_elements_inline (struct cnv_action_s *action, +int nthw_create_action_elements_inline (struct cnv_action_s *action,const struct rte_flow_action actions[],int max_elem,uint32_t queue_offset);
drivers/net/ntnic/include/flow_api.h +9 -9
@@ -27,7 +27,7 @@ struct hw_mod_resource_s {/* * Device Management API */ -int flow_delete_eth_dev (struct flow_eth_dev *eth_dev); +int nthw_flow_delete_eth_dev (struct flow_eth_dev *eth_dev);/** * A structure used to configure the Receive Side Scaling (RSS) feature
@@ -167,7 +167,7 @@ enum flow_nic_err_msg_e { ERR_MSG_END }; -void flow_nic_set_error (enum flow_nic_err_msg_e msg,struct rte_flow_error *error); +void nthw_flow_nic_set_error (enum flow_nic_err_msg_e msg,struct rte_flow_error *error);/* * Resources
@@ -219,17 +219,17 @@ extern const char *dbg_res_descr[];#define flow_nic_is_resource_used (_ndev, res_type, index) \ (!!flow_nic_is_bit_set((_ndev)->res[res_type].alloc_bm, index)) -int flow_nic_alloc_resource (struct flow_nic_dev *ndev,enum res_type_e res_type, +int nthw_flow_nic_alloc_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,uint32_t alignment); -int flow_nic_alloc_resource_config (struct flow_nic_dev *ndev,enum res_type_e res_type, +int nthw_flow_nic_alloc_resource_config (struct flow_nic_dev *ndev,enum res_type_e res_type,unsigned int num,uint32_t alignment); -void flow_nic_free_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int idx); +void nthw_flow_nic_free_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int idx); -int flow_nic_ref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index); -int flow_nic_deref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index); +int nthw_flow_nic_ref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index); +int nthw_flow_nic_deref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index); -int flow_get_flm_stats (struct flow_nic_dev *ndev,uint64_t *data,uint64_t size); -int flow_get_ifr_stats (struct flow_nic_dev *ndev,uint64_t *data,uint8_t port_count); +int nthw_flow_get_flm_stats (struct flow_nic_dev *ndev,uint64_t *data,uint64_t size); +int nthw_flow_get_ifr_stats (struct flow_nic_dev *ndev,uint64_t *data,uint8_t port_count);#endif
drivers/net/ntnic/include/flow_api_engine.h +5 -5
@@ -420,12 +420,12 @@ void kcc_free_ndev_resource_management(void **handle);/* * Group management */ -int flow_group_handle_create (void **handle,uint32_t group_count); -int flow_group_handle_destroy (void **handle); +int nthw_flow_group_handle_create (void **handle,uint32_t group_count); +int nthw_flow_group_handle_destroy (void **handle); -int flow_group_translate_get (void *handle,uint8_t owner_id,uint8_t port_id,uint32_t group_in, -uint32_t *group_out); -int flow_group_translate_get_orig_group (void *handle,uint32_t translated_group, +int nthw_flow_group_translate_get (void *handle,uint8_t owner_id,uint8_t port_id, +uint32_t group_in,uint32_t *group_out); +int nthw_flow_group_translate_get_orig_group (void *handle,uint32_t translated_group,uint32_t *group_orig);#endif /* _FLOW_API_ENGINE_H_ */
drivers/net/ntnic/include/flow_filter.h +3 -3
@@ -9,8 +9,8 @@#include "flow_api.h" #include "nthw_fpga_model.h" -int flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no); -int flow_filter_done (struct flow_nic_dev *dev); -int flow_get_flm_stats (struct flow_nic_dev *ndev,uint64_t *data,uint64_t size); +int nthw_flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no); +int nthw_flow_filter_done (struct flow_nic_dev *dev); +int nthw_flow_get_flm_stats (struct flow_nic_dev *ndev,uint64_t *data,uint64_t size);#endif /* __FLOW_FILTER_HPP__ */
drivers/net/ntnic/include/hw_mod_backend.h +5 -5
@@ -29,8 +29,8 @@struct flow_api_backend_s ;struct common_func_s ; -void *callocate_mod (struct common_func_s *mod,int sets, ...); -void zero_module_cache (struct common_func_s *mod); +void *nthw_callocate_mod (struct common_func_s *mod,int sets, ...); +void nthw_zero_module_cache (struct common_func_s *mod);#define ALL_ENTRIES -1000#define ALL_BANK_ENTRIES -1001
@@ -1164,8 +1164,8 @@ struct flow_api_backend_s { unsigned int max_queues; }; -int flow_api_backend_init (struct flow_api_backend_s *dev,const struct flow_api_backend_ops *iface, -void *be_dev); -int flow_api_backend_done (struct flow_api_backend_s *dev); +int nthw_flow_api_backend_init (struct flow_api_backend_s *dev, +const struct flow_api_backend_ops *iface,void *be_dev); +int nthw_flow_api_backend_done (struct flow_api_backend_s *dev);#endif /* _HW_MOD_BACKEND_H_ */
drivers/net/ntnic/include/ntnic_dbs.h +9 -9
@@ -236,30 +236,30 @@ 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 set_rx_control (nthw_dbs_t *p, +int nthw_set_rx_control (nthw_dbs_t *p,uint32_t last_queue,uint32_t avail_monitor_enable,uint32_t avail_monitor_speed,uint32_t used_write_enable,uint32_t used_write_speed,uint32_t rx_queue_enable); -int set_tx_control (nthw_dbs_t *p, +int nthw_set_tx_control (nthw_dbs_t *p,uint32_t last_queue,uint32_t avail_monitor_enable,uint32_t avail_monitor_speed,uint32_t used_write_enable,uint32_t used_write_speed,uint32_t tx_queue_enable); -int set_rx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init, +int nthw_set_rx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init,uint32_t queue); -int get_rx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy); +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,uint32_t queue); -int get_tx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy); -int set_rx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue); -int get_rx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy); -int set_tx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue); -int get_tx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy); +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, uint32_t index, uint64_t guest_physical_address,
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +12 -11
@@ -304,28 +304,28 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable)return -1 ; } - res =construct_and_preinit_nim (nim_ctx,NULL ); + res =nthw_construct_and_preinit_nim (nim_ctx,NULL );if (res)return res; - res =nim_state_build (nim_ctx, &nim); + res =nthw_nim_state_build (nim_ctx, &nim);if (res)return res;NT_LOG (DBG ,NTHW ,"%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'" , - drv->mp_port_id_str[port], nim_ctx->nim_id,nim_id_to_text (nim_ctx->nim_id), nim.br, - nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); + drv->mp_port_id_str[port], nim_ctx->nim_id,nthw_nim_id_to_text (nim_ctx->nim_id), + nim.br, nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no);/* * Does the driver support the NIM module type? */ if (nim_ctx->nim_id != valid_nim_id) {NT_LOG (ERR ,NTHW ,"%s: The driver does not support the NIM module type %s" , - drv->mp_port_id_str[port],nim_id_to_text (nim_ctx->nim_id)); + drv->mp_port_id_str[port],nthw_nim_id_to_text (nim_ctx->nim_id));NT_LOG (DBG ,NTHW ,"%s: The driver supports the NIM module type %s" , - drv->mp_port_id_str[port],nim_id_to_text (valid_nim_id)); + drv->mp_port_id_str[port],nthw_nim_id_to_text (valid_nim_id));return -1 ; }
@@ -371,7 +371,7 @@ static int _port_init(adapter_info_t *drv, nthw_fpga_t *fpga, int port)/* * Phase 1. Pre-state machine (`port init` functions) -* 1.1) nt4ga_adapter::port_init() +* 1.1) nt4ga_adapter::nthw_port_init() */ /* No adapter set-up here, only state variables */
@@ -597,7 +597,7 @@ static int _common_ptp_nim_state_machine(void *data)continue ; } -if (nim_state_build (&nim_ctx[i], &new_state)) { +if (nthw_nim_state_build (&nim_ctx[i], &new_state)) {NT_LOG (ERR ,NTNIC ,"%s: Cannot read basic NIM data" , drv->mp_port_id_str[i]);continue ;
@@ -607,8 +607,9 @@ static int _common_ptp_nim_state_machine(void *data)NT_LOG (DBG ,NTNIC ,"%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'" , drv->mp_port_id_str[i], nim_ctx->nim_id, -nim_id_to_text (nim_ctx->nim_id), (unsigned int )new_state.br, - nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); +nthw_nim_id_to_text (nim_ctx->nim_id), + (unsigned int )new_state.br, nim_ctx->vendor_name, + nim_ctx->prod_no, nim_ctx->serial_no); (void )_link_state_build (drv, &mac_pcs[i], &gpio_phy[i], i, &link_state[i], is_port_disabled);
@@ -725,7 +726,7 @@ static struct link_ops_s link_100g_ops = { .link_init = nt4ga_link_100g_ports_init, }; -void link_100g_init (void ) +void nthw_link_100g_init (void ) {register_100g_link_ops (&link_100g_ops); }
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +16 -15
@@ -554,12 +554,12 @@ static int create_nim(adapter_info_t *drv, int port, bool enable)*/ nt_os_wait_usec (1000000 );/* pause 1.0s */ - res =construct_and_preinit_nim (nim_ctx,NULL ); + res =nthw_construct_and_preinit_nim (nim_ctx,NULL );if (res)return res; - res =nim_state_build (nim_ctx, &nim); + res =nthw_nim_state_build (nim_ctx, &nim);if (res)return res;
@@ -568,17 +568,17 @@ static int create_nim(adapter_info_t *drv, int port, bool enable) nim_ctx->specific_u.qsfp.specific_u.qsfp28.media_side_fec_ena = true;NT_LOG (DBG ,NTHW ,"%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'" , - drv->mp_port_id_str[port], nim_ctx->nim_id,nim_id_to_text (nim_ctx->nim_id), nim.br, - nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); + drv->mp_port_id_str[port], nim_ctx->nim_id,nthw_nim_id_to_text (nim_ctx->nim_id), + nim.br, nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no);/* * Does the driver support the NIM module type? */ if (nim_ctx->nim_id != valid_nim_id) {NT_LOG (ERR ,NTHW ,"%s: The driver does not support the NIM module type %s" , - drv->mp_port_id_str[port],nim_id_to_text (nim_ctx->nim_id)); + drv->mp_port_id_str[port],nthw_nim_id_to_text (nim_ctx->nim_id));NT_LOG (DBG ,NTHW ,"%s: The driver supports the NIM module type %s" , - drv->mp_port_id_str[port],nim_id_to_text (valid_nim_id)); + drv->mp_port_id_str[port],nthw_nim_id_to_text (valid_nim_id));return -1 ; }
@@ -612,13 +612,13 @@ static int nim_ready_100_gb(adapter_info_t *p_info, int port)/* Adjust NIM power level */ if (nim_ctx->pwr_level_req >4 ) { -qsfp28_set_high_power (nim_ctx); +nthw_qsfp28_set_high_power (nim_ctx); nim_ctx->pwr_level_cur = nim_ctx->pwr_level_req; }/* enable_fec is what the end result should be, now find out if it's possible */ if (enable_fec) { -if (qsfp28_set_fec_enable (nim_ctx, true, false)) { +if (nthw_qsfp28_set_fec_enable (nim_ctx, true, false)) {/* Prefer NIM media FEC since the NIM is assumed to know the right FEC */ NT_LOG (DBG ,NTNIC ,"Port %s: NIM media FEC enabled" , p_info->mp_port_id_str[port]);
@@ -635,7 +635,7 @@ static int nim_ready_100_gb(adapter_info_t *p_info, int port)return 1 ; } - }else if (qsfp28_set_fec_enable (nim_ctx, false, false)) { + }else if (nthw_qsfp28_set_fec_enable (nim_ctx, false, false)) {/* The NIM does not support FEC at all so turn FPGA FEC on instead */ /* This is relevant to SR4 modules */ NT_LOG (DBG ,NTNIC ,"Port %s: No NIM FEC" , p_info->mp_port_id_str[port]);
@@ -643,7 +643,7 @@ static int nim_ready_100_gb(adapter_info_t *p_info, int port)NT_LOG (DBG ,NTNIC ,"Port %s: FPGA FEC enabled" , p_info->mp_port_id_str[port]); - }else if (qsfp28_set_fec_enable (nim_ctx, true, true)) { + }else if (nthw_qsfp28_set_fec_enable (nim_ctx, true, true)) {/* This probably not a likely scenario */ nthw_phy_tile_configure_fec (p_phy_tile, port, false); NT_LOG(DBG, NTNIC, "Port %s: FPGA FEC enabled",
@@ -657,7 +657,7 @@ static int nim_ready_100_gb(adapter_info_t *p_info, int port)return 1 ; } - }else if (qsfp28_set_fec_enable (nim_ctx, false, false)) { + }else if (nthw_qsfp28_set_fec_enable (nim_ctx, false, false)) {/* The NIM does not support FEC at all - this is relevant to LR4 modules */ NT_LOG (DBG ,NTNIC ,"Port %s: No NIM FEC" , p_info->mp_port_id_str[port]);
@@ -671,7 +671,7 @@ static int nim_ready_100_gb(adapter_info_t *p_info, int port)return 1 ; } - }else if (qsfp28_set_fec_enable (nim_ctx, false, true)) { + }else if (nthw_qsfp28_set_fec_enable (nim_ctx, false, true)) {nthw_phy_tile_configure_fec (p_phy_tile, port, false);/* This probably not a likely scenario */ NT_LOG (DBG ,NTNIC ,"Port %s: FPGA FEC enabled" , p_info->mp_port_id_str[port]);
@@ -906,7 +906,7 @@ static void *_common_ptp_nim_state_machine(void *data)continue ; } -if (nim_state_build (&nim_ctx[i], &new_state)) { +if (nthw_nim_state_build (&nim_ctx[i], &new_state)) {NT_LOG (ERR ,NTNIC ,"%s: Cannot read basic NIM data" , drv->mp_port_id_str[i]);continue ;
@@ -916,8 +916,9 @@ static void *_common_ptp_nim_state_machine(void *data)NT_LOG (DBG ,NTNIC ,"%s: NIM id = %u (%s), br = %u, vendor = '%s', pn = '%s', sn='%s'" , drv->mp_port_id_str[i], nim_ctx->nim_id, -nim_id_to_text (nim_ctx->nim_id), (unsigned int )new_state.br, - nim_ctx->vendor_name, nim_ctx->prod_no, nim_ctx->serial_no); +nthw_nim_id_to_text (nim_ctx->nim_id), + (unsigned int )new_state.br, nim_ctx->vendor_name, + nim_ctx->prod_no, nim_ctx->serial_no); link_state[i].lh_nim_absent = false;NT_LOG (DBG ,NTNIC ,"%s: NIM module initialized" , drv->mp_port_id_str[i]);
drivers/net/ntnic/link_mgmt/nt4ga_link.c +2 -2
@@ -153,7 +153,7 @@ static int nt4ga_port_tx_power(struct adapter_info_s *p, int port, bool disable)nim_i2c_ctx_t *nim_ctx = &link_info->u.var100g.nim_ctx[port];if (!nim_ctx->specific_u.qsfp.rx_only) { -if (nim_qsfp_plus_nim_set_tx_laser_disable (nim_ctx, disable,-1 ) !=0 ) +if (nthw_nim_qsfp_plus_nim_set_tx_laser_disable (nim_ctx, disable,-1 ) !=0 )return 1 ; } }
@@ -208,7 +208,7 @@ static const struct port_ops ops = { .tx_power = nt4ga_port_tx_power, }; -void port_init (void ) +void nthw_port_init (void ) {register_port_ops (&ops); }
drivers/net/ntnic/nim/i2c_nim.c +8 -8
@@ -328,12 +328,12 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state)return res; } -int nim_state_build (nim_i2c_ctx_t *ctx,sfp_nim_state_t *state) +int nthw_nim_state_build (nim_i2c_ctx_t *ctx,sfp_nim_state_t *state) {return qsfp_nim_state_build (ctx, state); } -const char *nim_id_to_text (uint8_t nim_id) +const char *nthw_nim_id_to_text (uint8_t nim_id) {switch (nim_id) {case 0x0 :
@@ -356,7 +356,7 @@ const char *nim_id_to_text(uint8_t nim_id)/* * Disable laser for specific lane or all lanes */ -int nim_qsfp_plus_nim_set_tx_laser_disable (nim_i2c_ctx_p ctx,bool disable,int lane_idx) +int nthw_nim_qsfp_plus_nim_set_tx_laser_disable (nim_i2c_ctx_p ctx,bool disable,int lane_idx) {uint8_t value;uint8_t mask;
@@ -419,7 +419,7 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx)const char *yes_no[2 ] = {"No" ,"Yes" }; (void )yes_no;NT_LOG (DBG ,NTNIC ,"Instance %d: NIM id: %s (%d)" , ctx->instance, -nim_id_to_text (ctx->nim_id), ctx->nim_id); +nthw_nim_id_to_text (ctx->nim_id), ctx->nim_id);/* Read DMI options */ if (nim_read_write_data_lin(ctx, pg_addr, QSFP_DMI_OPTION_LIN_ADDR, sizeof(options),
@@ -788,7 +788,7 @@ static int qsfp28_preinit(nim_i2c_ctx_p ctx, int8_t lane_idx)return res; } -int construct_and_preinit_nim (nim_i2c_ctx_p ctx,void *extra) +int nthw_construct_and_preinit_nim (nim_i2c_ctx_p ctx,void *extra) {int res =i2c_nim_common_construct (ctx);
@@ -803,7 +803,7 @@ int construct_and_preinit_nim(nim_i2c_ctx_p ctx, void *extra)default : res =1 ; -NT_LOG (ERR ,NTHW ,"NIM type %s is not supported." ,nim_id_to_text (ctx->nim_id)); +NT_LOG (ERR ,NTHW ,"NIM type %s is not supported" ,nthw_nim_id_to_text (ctx->nim_id)); }return res;
@@ -815,7 +815,7 @@ int construct_and_preinit_nim(nim_i2c_ctx_p ctx, void *extra)* When cleared (= 0b), modules with power classes 5 to 7 must dissipate less * than 3.5W (but are not required to be fully functional). Default 0. */ -void qsfp28_set_high_power (nim_i2c_ctx_p ctx) +void nthw_qsfp28_set_high_power (nim_i2c_ctx_p ctx) {const uint16_t addr =93 ;uint8_t data;
@@ -834,7 +834,7 @@ void qsfp28_set_high_power(nim_i2c_ctx_p ctx)* register must be avoided as this introduces I2C errors on NT200A01. */ -bool qsfp28_set_fec_enable (nim_i2c_ctx_p ctx,bool media_side_fec,bool host_side_fec) +bool nthw_qsfp28_set_fec_enable (nim_i2c_ctx_p ctx,bool media_side_fec,bool host_side_fec) {/* * If the current FEC state does not match the wanted and the FEC cannot be
drivers/net/ntnic/nim/i2c_nim.h +6 -6
@@ -16,25 +16,25 @@ typedef struct sfp_nim_state {* Builds an nim state for the port implied by `ctx`, returns zero * if successful, and non-zero otherwise. SFP and QSFP nims are supported */ -int nim_state_build (nim_i2c_ctx_t *ctx,sfp_nim_state_t *state); +int nthw_nim_state_build (nim_i2c_ctx_t *ctx,sfp_nim_state_t *state);/* * Returns a type name such as "SFP/SFP+" for a given NIM type identifier, * or the string "ILLEGAL!". */ -const char *nim_id_to_text (uint8_t nim_id); +const char *nthw_nim_id_to_text (uint8_t nim_id); -int nim_qsfp_plus_nim_set_tx_laser_disable (nim_i2c_ctx_t *ctx,bool disable,int lane_idx); +int nthw_nim_qsfp_plus_nim_set_tx_laser_disable (nim_i2c_ctx_t *ctx,bool disable,int lane_idx);/* * This function tries to classify NIM based on it's ID and some register reads * and collects information into ctx structure. The @extra parameter could contain * the initialization argument for specific type of NIMS. */ -int construct_and_preinit_nim (nim_i2c_ctx_p ctx,void *extra); +int nthw_construct_and_preinit_nim (nim_i2c_ctx_p ctx,void *extra); -void qsfp28_set_high_power (nim_i2c_ctx_p ctx); -bool qsfp28_set_fec_enable (nim_i2c_ctx_p ctx,bool media_side_fec,bool host_side_fec); +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,nthw_pca9849_t *p_ca9849);
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +9 -9
@@ -403,7 +403,7 @@ void dbs_reset(nthw_dbs_t *p) } } -int set_rx_control(nthw_dbs_t *p, +int nthw_set_rx_control(nthw_dbs_t *p, uint32_t last_queue, uint32_t avail_monitor_enable, uint32_t avail_monitor_speed,
@@ -421,7 +421,7 @@ int set_rx_control(nthw_dbs_t *p,return 0 ; } -int set_tx_control(nthw_dbs_t *p, +int nthw_set_tx_control(nthw_dbs_t *p, uint32_t last_queue, uint32_t avail_monitor_enable, uint32_t avail_monitor_speed,
@@ -439,7 +439,7 @@ int set_tx_control(nthw_dbs_t *p,return 0 ; } -int set_rx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init, +int nthw_set_rx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init,uint32_t queue) {if (p->mp_reg_rx_init_val) {
@@ -454,7 +454,7 @@ int set_rx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_treturn 0 ; } -int get_rx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy) +int nthw_get_rx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy) { *init =nthw_field_get_val32 (p->mp_fld_rx_init_init); *queue =nthw_field_get_val32 (p->mp_fld_rx_init_queue);
@@ -477,7 +477,7 @@ int set_tx_init(nthw_dbs_t *p, uint32_t start_idx, uint32_t start_ptr, uint32_treturn 0 ; } -int get_tx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy) +int nthw_get_tx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy) { *init =nthw_field_get_val32 (p->mp_fld_tx_init_init); *queue =nthw_field_get_val32 (p->mp_fld_tx_init_queue);
@@ -485,7 +485,7 @@ int get_tx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *busy)return 0 ; } -int set_rx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue) +int nthw_set_rx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue) {if (!p->mp_reg_rx_idle)return -ENOTSUP ;
@@ -496,7 +496,7 @@ int set_rx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue)return 0 ; } -int get_rx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy) +int nthw_get_rx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy) {if (!p->mp_reg_rx_idle)return -ENOTSUP ;
@@ -507,7 +507,7 @@ int get_rx_idle(nthw_dbs_t *p, uint32_t *idle, uint32_t *queue, uint32_t *busy)return 0 ; } -int set_tx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue) +int nthw_set_tx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue) {if (!p->mp_reg_tx_idle)return -ENOTSUP ;
@@ -518,7 +518,7 @@ int set_tx_idle(nthw_dbs_t *p, uint32_t idle, uint32_t queue)return 0 ; } -int get_tx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy) +int nthw_get_tx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy) {if (!p->mp_reg_tx_idle)return -ENOTSUP ;
drivers/net/ntnic/nthw/flow_api/flow_api.c +24 -24
171 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h +4 -4
@@ -12,9 +12,9 @@/* * Flow capable NIC backend - creating flow api instance for adapter nr (backend) */ -struct flow_nic_dev *flow_api_create (uint8_t adapter_no,const struct flow_api_backend_ops *be_if, -void *be_dev); -int flow_api_done (struct flow_nic_dev *dev); -void *flow_api_get_be_dev (struct flow_nic_dev *dev); +struct flow_nic_dev *nthw_flow_api_create (uint8_t adapter_no, +const struct flow_api_backend_ops *be_if,void *be_dev); +int nthw_flow_api_done (struct flow_nic_dev *dev); +void *nthw_flow_api_get_be_dev (struct flow_nic_dev *dev);#endif /* __FLOW_API_NIC_SETUP_H__ */
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +4 -4
@@ -65,7 +65,7 @@ static struct backend_dev_s { mod##_nthw_set_debug_mode((inst), 0); \ }while (0 ) -const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, void **be_dev); +const struct flow_api_backend_ops *nthw_bin_flow_backend_init(nthw_fpga_t *p_fpga, void **be_dev);static void bin_flow_backend_done (void *be_dev);static int set_debug_mode (void *be_dev,enum debug_mode_e mode)
@@ -2097,7 +2097,7 @@ const struct flow_api_backend_ops flow_be_iface = { tpe_csu_rcp_flush, }; -const struct flow_api_backend_ops *bin_flow_backend_init (nthw_fpga_t *p_fpga,void **dev) +const struct flow_api_backend_ops *nthw_bin_flow_backend_init (nthw_fpga_t *p_fpga,void **dev) {uint8_t physical_adapter_no = (uint8_t )p_fpga->p_fpga_info->adapter_no;
@@ -2271,11 +2271,11 @@ static void bin_flow_backend_done(void *dev) }static const struct flow_backend_ops ops = { - .bin_flow_backend_init = bin_flow_backend_init, + .nthw_bin_flow_backend_init = nthw_bin_flow_backend_init, .bin_flow_backend_done = bin_flow_backend_done, }; -void flow_backend_init (void ) +void nthw_flow_backend_init (void ) {register_flow_backend_ops (&ops); }
drivers/net/ntnic/nthw/flow_api/flow_filter.c +6 -6
@@ -7,7 +7,7 @@#include "ntnic_mod_reg.h" #include "flow_api_nic_setup.h" -int flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no) +int nthw_flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no) {void *be_dev =NULL ;struct flow_nic_dev *flow_nic;
@@ -21,9 +21,9 @@ int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, iNT_LOG (DBG ,FILTER ,"Initializing flow filter api" );const struct flow_api_backend_ops *iface = - flow_backend_ops->bin_flow_backend_init (p_fpga, &be_dev); + flow_backend_ops->nthw_bin_flow_backend_init (p_fpga, &be_dev); - flow_nic =flow_api_create ((uint8_t )adapter_no, iface, be_dev); + flow_nic =nthw_flow_api_create ((uint8_t )adapter_no, iface, be_dev);if (!flow_nic) { *p_flow_device =NULL ;
@@ -34,11 +34,11 @@ int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, ireturn 0 ; } -int flow_filter_done (struct flow_nic_dev *dev) +int nthw_flow_filter_done (struct flow_nic_dev *dev) { -void *be_dev =flow_api_get_be_dev (dev); +void *be_dev =nthw_flow_api_get_be_dev (dev); -int res =flow_api_done (dev); +int res =nthw_flow_api_done (dev);if (be_dev) {const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops ();
drivers/net/ntnic/nthw/flow_api/flow_group.c +5 -5
@@ -25,7 +25,7 @@ struct group_handle_s {struct group_lookup_entry_s *lookup_entries; }; -int flow_group_handle_create (void **handle,uint32_t group_count) +int nthw_flow_group_handle_create (void **handle,uint32_t group_count) {struct group_handle_s *group_handle;
@@ -40,7 +40,7 @@ int flow_group_handle_create(void **handle, uint32_t group_count)return *handle !=NULL ?0 :-1 ; } -int flow_group_handle_destroy (void **handle) +int nthw_flow_group_handle_destroy (void **handle) {if (*handle) {struct group_handle_s *group_handle = (struct group_handle_s *)*handle;
@@ -55,8 +55,8 @@ int flow_group_handle_destroy(void **handle)return 0 ; } -int flow_group_translate_get (void *handle,uint8_t owner_id,uint8_t port_id,uint32_t group_in, -uint32_t *group_out) +int nthw_flow_group_translate_get (void *handle,uint8_t owner_id,uint8_t port_id, +uint32_t group_in,uint32_t *group_out) {struct group_handle_s *group_handle = (struct group_handle_s *)handle;uint32_t *table_ptr;
@@ -100,7 +100,7 @@ int flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id, uireturn 0 ; } -int flow_group_translate_get_orig_group (void *handle,uint32_t translated_group, +int nthw_flow_group_translate_get_orig_group (void *handle,uint32_t translated_group,uint32_t *group_orig) {struct group_handle_s *group_handle = (struct group_handle_s *)handle;
drivers/net/ntnic/nthw/flow_api/flow_hasher.c +2 -2
@@ -126,7 +126,7 @@ static uint32_t calc16(const uint32_t key[16])return x; } -uint32_t gethash (struct hasher_s *hsh,const uint32_t key[16 ],int *result) +uint32_t nthw_gethash (struct hasher_s *hsh,const uint32_t key[16 ],int *result) {uint64_t val;uint32_t res;
@@ -145,7 +145,7 @@ uint32_t gethash(struct hasher_s *hsh, const uint32_t key[16], int *result)return res; } -int init_hasher (struct hasher_s *hsh,int banks,int nb_records) +int nthw_init_hasher (struct hasher_s *hsh,int banks,int nb_records) { hsh->banks = banks; hsh->cam_records_bw = (int )(log2 (nb_records -1 ) +1 );
drivers/net/ntnic/nthw/flow_api/flow_hasher.h +2 -2
@@ -15,7 +15,7 @@ struct hasher_s { int cam_bw; }; -int init_hasher (struct hasher_s *hsh,int _banks,int nb_records); -uint32_t gethash (struct hasher_s *hsh,const uint32_t key[16 ],int *result); +int nthw_init_hasher (struct hasher_s *hsh,int _banks,int nb_records); +uint32_t nthw_gethash (struct hasher_s *hsh,const uint32_t key[16 ],int *result);#endif /* _FLOW_HASHER_H_ */
drivers/net/ntnic/nthw/flow_api/flow_km.c +2 -2
@@ -93,7 +93,7 @@ void km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle) (struct tcam_distrib_s *)((char *)km->cam_dist +CAM_ENTRIES +sizeof (uint32_t )); km->hsh = (struct hasher_s *)((char *)km->tcam_dist +TCAM_ENTRIES ); -init_hasher (km->hsh, km->be->km.nb_cam_banks, km->be->km.nb_cam_records); +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)
@@ -859,7 +859,7 @@ static int km_write_data_to_cam(struct km_flow_def_s *km)RTE_ASSERT (km->cam_dist);/* word list without info set */ -gethash (km->hsh, km->entry_word, val); +nthw_gethash (km->hsh, km->entry_word, val);for (uint32_t i =0 ; i < km->be->km.nb_cam_banks; i++) {/* if paired we start always on an even address - reset bit 0 */
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +5 -5
@@ -32,7 +32,7 @@ static const struct { };#define MOD_COUNT (ARRAY_SIZE(module)) -void *callocate_mod (struct common_func_s *mod,int sets, ...) +void *nthw_callocate_mod (struct common_func_s *mod,int sets, ...) {#define MAX_SETS 38void *base =NULL ;
@@ -84,12 +84,12 @@ void *callocate_mod(struct common_func_s *mod, int sets, ...)return base; } -void zero_module_cache (struct common_func_s *mod) +void nthw_zero_module_cache (struct common_func_s *mod) {memset (mod->base,0 , mod->alloced_size); } -int flow_api_backend_init (struct flow_api_backend_s *dev, +int nthw_flow_api_backend_init (struct flow_api_backend_s *dev,const struct flow_api_backend_ops *iface,void *be_dev) {
@@ -121,7 +121,7 @@ int flow_api_backend_init(struct flow_api_backend_s *dev,FILTER ,"ERROR: Initialization of NIC module failed : [ %s ]" , module[mod].name); -flow_api_backend_done (dev); +nthw_flow_api_backend_done (dev);NT_LOG (ERR ,FILTER ,"*************** Failed to create Binary Flow API *******************" );
@@ -137,7 +137,7 @@ int flow_api_backend_init(struct flow_api_backend_s *dev,return 0 ; } -int flow_api_backend_done (struct flow_api_backend_s *dev) +int nthw_flow_api_backend_done (struct flow_api_backend_s *dev) {for (unsigned int mod =0 ; mod <MOD_COUNT ; mod++) module[mod].free (dev);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c +3 -3
@@ -110,7 +110,7 @@ int hw_mod_cat_alloc(struct flow_api_backend_s *be)case 18 : be->cat.cts_num =11 ; - if (!callocate_mod((struct common_func_s *)&be->cat, 12, &be->cat.v18.cfn, + if (!nthw_callocate_mod((struct common_func_s *)&be->cat, 12, &be->cat.v18.cfn, be->cat.nb_cat_funcs, sizeof(struct cat_v18_cfn_s), &be->cat.v18.kce, (be->cat.nb_cat_funcs / 8), sizeof(struct cat_v18_kce_s), &be->cat.v18.kcs,
@@ -140,7 +140,7 @@ int hw_mod_cat_alloc(struct flow_api_backend_s *be)case 21 : be->cat.cts_num =11 ; - if (!callocate_mod((struct common_func_s *)&be->cat, 12, &be->cat.v21.cfn, + if (!nthw_callocate_mod((struct common_func_s *)&be->cat, 12, &be->cat.v21.cfn, be->cat.nb_cat_funcs, sizeof(struct cat_v21_cfn_s), &be->cat.v21.kce, (be->cat.nb_cat_funcs / 8), sizeof(struct cat_v21_kce_s), &be->cat.v21.kcs,
@@ -233,7 +233,7 @@ static int cfn_reset(struct flow_api_backend_s *be, int i)int hw_mod_cat_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->cat)); +nthw_zero_module_cache ((struct common_func_s *)(&be->cat));NT_LOG (DBG ,FILTER ,"INIT CAT CFN" );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c +3 -2
@@ -106,7 +106,8 @@ int hw_mod_flm_alloc(struct flow_api_backend_s *be) switch (_VER_) { case 25: - if (!callocate_mod((struct common_func_s *)&be->flm, 38, &be->flm.v25.control, 1, + if (!nthw_callocate_mod((struct common_func_s *)&be->flm, 38, + &be->flm.v25.control, 1, sizeof(struct flm_v25_control_s), &be->flm.v25.status, 1, sizeof(struct flm_v25_status_s), &be->flm.v25.load_bin, 1, sizeof(struct flm_v25_load_bin_s), &be->flm.v25.load_pps, 1,
@@ -175,7 +176,7 @@ void hw_mod_flm_free(struct flow_api_backend_s *be)int hw_mod_flm_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->flm)); +nthw_zero_module_cache ((struct common_func_s *)(&be->flm));NT_LOG (DBG ,FILTER ,"INIT FLM" );hw_mod_flm_control_set (be,HW_FLM_CONTROL_SPLIT_SDRAM_USAGE ,0x10 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c +2 -2
@@ -45,7 +45,7 @@ int hw_mod_hsh_alloc(struct flow_api_backend_s *be)switch (_VER_) {case 5 : -if (!callocate_mod ((struct common_func_s *)&be->hsh,1 , &be->hsh.v5.rcp, +if (!nthw_callocate_mod ((struct common_func_s *)&be->hsh,1 , &be->hsh.v5.rcp, be->hsh.nb_rcp,sizeof (struct hsh_v5_rcp_s )))return -1 ;
@@ -71,7 +71,7 @@ void hw_mod_hsh_free(struct flow_api_backend_s *be)int hw_mod_hsh_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->hsh)); +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);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c +2 -2
@@ -84,7 +84,7 @@ int hw_mod_km_alloc(struct flow_api_backend_s *be) be->km.nb_km_rcp_mask_a_word_size =12 ; be->km.nb_km_rcp_mask_b_word_size =6 ; - if (!callocate_mod((struct common_func_s *)&be->km, 5, &be->km.v7.rcp, + if (!nthw_callocate_mod((struct common_func_s *)&be->km, 5, &be->km.v7.rcp, be->km.nb_categories, sizeof(struct km_v7_rcp_s), &be->km.v7.cam, be->km.nb_cam_banks * be->km.nb_cam_records, sizeof(struct km_v7_cam_s), &be->km.v7.tcam,
@@ -119,7 +119,7 @@ int hw_mod_km_reset(struct flow_api_backend_s *be)uint32_t tcam_v_set[3 ] = {0x00000000 ,0x00000000 ,0x00000000 };/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->km)); +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 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c +2 -2
@@ -34,7 +34,7 @@ int hw_mod_pdb_alloc(struct flow_api_backend_s *be)switch (_VER_) {case 9 : -if (!callocate_mod ((struct common_func_s *)&be->pdb,2 , &be->pdb.v9.rcp, +if (!nthw_callocate_mod ((struct common_func_s *)&be->pdb,2 , &be->pdb.v9.rcp, be->pdb.nb_pdb_rcp_categories,sizeof (struct pdb_v9_rcp_s ), &be->pdb.v9.config,1 ,sizeof (struct pdb_v9_config_s )))return -1 ;
@@ -62,7 +62,7 @@ int hw_mod_pdb_reset(struct flow_api_backend_s *be) {int err =0 ;/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->hsh)); +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 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c +2 -2
@@ -45,7 +45,7 @@ int hw_mod_qsl_alloc(struct flow_api_backend_s *be) switch (_VER_) { case 7: - if (!callocate_mod((struct common_func_s *)&be->qsl, 4, &be->qsl.v7.rcp, + if (!nthw_callocate_mod((struct common_func_s *)&be->qsl, 4, &be->qsl.v7.rcp, be->qsl.nb_rcp_categories, sizeof(struct qsl_v7_rcp_s), &be->qsl.v7.qst, be->qsl.nb_qst_entries, sizeof(struct qsl_v7_qst_s), &be->qsl.v7.qen, QSL_QEN_ENTRIES,
@@ -75,7 +75,7 @@ void hw_mod_qsl_free(struct flow_api_backend_s *be)int hw_mod_qsl_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->qsl)); +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 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c +2 -2
@@ -23,7 +23,7 @@ int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be)switch (_VER_) {case 2 : -if (!callocate_mod ((struct common_func_s *)&be->slc_lr,1 , &be->slc_lr.v2.rcp, +if (!nthw_callocate_mod ((struct common_func_s *)&be->slc_lr,1 , &be->slc_lr.v2.rcp, be->max_categories,sizeof (struct slc_lr_v2_rcp_s )))return -1 ;
@@ -48,7 +48,7 @@ void hw_mod_slc_lr_free(struct flow_api_backend_s *be)int hw_mod_slc_lr_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->slc_lr)); +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);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +2 -2
@@ -69,7 +69,7 @@ int hw_mod_tpe_alloc(struct flow_api_backend_s *be) switch (_VER_) { case 3: - if (!callocate_mod((struct common_func_s *)&be->tpe, 11, &be->tpe.v3.rpp_rcp, + if (!nthw_callocate_mod((struct common_func_s *)&be->tpe, 11, &be->tpe.v3.rpp_rcp, be->tpe.nb_rcp_categories, sizeof(struct tpe_v1_rpp_v0_rcp_s), &be->tpe.v3.rpp_ifr_rcp, be->tpe.nb_ifr_categories, sizeof(struct tpe_v2_rpp_v1_ifr_rcp_s), &be->tpe.v3.ifr_rcp,
@@ -120,7 +120,7 @@ int hw_mod_tpe_reset(struct flow_api_backend_s *be)int err =0 ;/* Zero entire cache area */ -zero_module_cache ((struct common_func_s *)(&be->tpe)); +nthw_zero_module_cache ((struct common_func_s *)(&be->tpe));NT_LOG (DBG ,FILTER ,"INIT TPE" ); err |=hw_mod_tpe_rpp_rcp_flush (be,0 ,ALL_ENTRIES );
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_evt_queue.c +6 -6
@@ -70,7 +70,7 @@ static void flm_inf_sta_queue_free(uint8_t port, uint8_t caller)rte_ring_free (q); } -void flm_inf_sta_queue_free_all (uint8_t caller) +void nthw_flm_inf_sta_queue_free_all (uint8_t caller) {int count =0 ;
@@ -212,7 +212,7 @@ static struct rte_ring *flm_evt_queue_create(uint8_t port, uint8_t caller)return q; } -int flm_sta_queue_put (uint8_t port,bool remote,struct flm_status_event_s *obj) +int nthw_flm_sta_queue_put (uint8_t port,bool remote,struct flm_status_event_s *obj) {struct rte_ring **stat_q = remote ? stat_q_remote : stat_q_local;
@@ -232,7 +232,7 @@ int flm_sta_queue_put(uint8_t port, bool remote, struct flm_status_event_s *obj)return 0 ; } -void flm_inf_queue_put (uint8_t port,bool remote,struct flm_info_event_s *obj) +void nthw_flm_inf_queue_put (uint8_t port,bool remote,struct flm_info_event_s *obj) {int ret;
@@ -253,7 +253,7 @@ void flm_inf_queue_put(uint8_t port, bool remote, struct flm_info_event_s *obj) } } -int flm_inf_queue_get (uint8_t port,bool remote,struct flm_info_event_s *obj) +int nthw_flm_inf_queue_get (uint8_t port,bool remote,struct flm_info_event_s *obj) {int ret;
@@ -269,7 +269,7 @@ int flm_inf_queue_get(uint8_t port, bool remote, struct flm_info_event_s *obj)if (flm_evt_queue_create (port,FLM_INFO_LOCAL ) !=NULL ) {/* Recursive call to get data */ -return flm_inf_queue_get (port, remote, obj); +return nthw_flm_inf_queue_get (port, remote, obj); } }
@@ -283,7 +283,7 @@ int flm_inf_queue_get(uint8_t port, bool remote, struct flm_info_event_s *obj)if (flm_evt_queue_create (port,FLM_INFO_REMOTE ) !=NULL ) {/* Recursive call to get data */ -return flm_inf_queue_get (port, remote, obj); +return nthw_flm_inf_queue_get (port, remote, obj); } }
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_evt_queue.h +4 -4
@@ -47,9 +47,9 @@ enum {#define FLM_EVT_ELEM_SIZE sizeof(struct flm_info_event_s)#define FLM_STAT_ELEM_SIZE sizeof(struct flm_status_event_s) -void flm_inf_sta_queue_free_all (uint8_t caller); -void flm_inf_queue_put (uint8_t port,bool remote,struct flm_info_event_s *obj); -int flm_inf_queue_get (uint8_t port,bool remote,struct flm_info_event_s *obj); -int flm_sta_queue_put (uint8_t port,bool remote,struct flm_status_event_s *obj); +void nthw_flm_inf_sta_queue_free_all (uint8_t caller); +void nthw_flm_inf_queue_put (uint8_t port,bool remote,struct flm_info_event_s *obj); +int nthw_flm_inf_queue_get (uint8_t port,bool remote,struct flm_info_event_s *obj); +int nthw_flm_sta_queue_put (uint8_t port,bool remote,struct flm_status_event_s *obj);#endif /* _FLM_EVT_QUEUE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +12 -12
@@ -431,7 +431,7 @@ void hw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const structif (data->jump) {uint32_t group_orig =0 ; -if (flow_group_translate_get_orig_group (ndev->group_handle, +if (nthw_flow_group_translate_get_orig_group (ndev->group_handle, data->jump, &group_orig) <0 )fprintf (file," Jumps to %d (encoded)\n" , data->jump);else
@@ -447,7 +447,7 @@ void hw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const structif (data->contains_jump) {uint32_t group_orig =0 ; -if (flow_group_translate_get_orig_group (ndev->group_handle, +if (nthw_flow_group_translate_get_orig_group (ndev->group_handle, data->jump, &group_orig) <0 )fprintf (file," Jumps to %d (encoded)\n" , data->jump);
@@ -1795,7 +1795,7 @@ struct hw_db_qsl_idx hw_db_inline_qsl_add(struct flow_nic_dev *ndev, void *db_ha } } - res =flow_nic_alloc_resource (ndev,RES_QSL_RCP ,1 ); + res =nthw_flow_nic_alloc_resource (ndev,RES_QSL_RCP ,1 );if (res <0 ) { qsl_idx.error =1 ;
@@ -1805,10 +1805,10 @@ struct hw_db_qsl_idx hw_db_inline_qsl_add(struct flow_nic_dev *ndev, void *db_ha qsl_idx.ids = res &0xff ;if (data->table_size >0 ) { - res =flow_nic_alloc_resource_config (ndev,RES_QSL_QST , data->table_size,1 ); + res =nthw_flow_nic_alloc_resource_config (ndev,RES_QSL_QST , data->table_size,1 );if (res <0 ) { -flow_nic_deref_resource (ndev,RES_QSL_RCP , qsl_idx.ids); +nthw_flow_nic_deref_resource (ndev,RES_QSL_RCP , qsl_idx.ids); qsl_idx.error =1 ;return qsl_idx; }
@@ -1870,7 +1870,7 @@ void hw_db_inline_qsl_ref(struct flow_nic_dev *ndev, void *db_handle, struct hw_ (void )db_handle;if (!idx.error && idx.ids !=0 ) -flow_nic_ref_resource (ndev,RES_QSL_RCP , idx.ids); +nthw_flow_nic_ref_resource (ndev,RES_QSL_RCP , idx.ids); }void hw_db_inline_qsl_deref (struct flow_nic_dev *ndev,void *db_handle,struct hw_db_qsl_idx idx)
@@ -1880,7 +1880,7 @@ void hw_db_inline_qsl_deref(struct flow_nic_dev *ndev, void *db_handle, struct hif (idx.error || idx.ids ==0 )return ; -if (flow_nic_deref_resource (ndev,RES_QSL_RCP , idx.ids) ==0 ) { +if (nthw_flow_nic_deref_resource (ndev,RES_QSL_RCP , idx.ids) ==0 ) {const int table_size = (int )db->qsl[idx.ids].data.table_size;hw_mod_qsl_rcp_set (&ndev->be,HW_QSL_RCP_PRESET_ALL , idx.ids,0x0 );
@@ -1892,7 +1892,7 @@ void hw_db_inline_qsl_deref(struct flow_nic_dev *ndev, void *db_handle, struct hfor (int i =0 ; i < (int )table_size; ++i) {hw_mod_qsl_qst_set (&ndev->be,HW_QSL_QST_PRESET_ALL , table_start + i,0x0 ); -flow_nic_free_resource (ndev,RES_QSL_QST , table_start + i); +nthw_flow_nic_free_resource (ndev,RES_QSL_QST , table_start + i); }hw_mod_qsl_qst_flush (&ndev->be, table_start, table_size);
@@ -2245,7 +2245,7 @@ struct hw_db_tpe_ext_idx hw_db_inline_tpe_ext_add(struct flow_nic_dev *ndev, voireturn idx; } - rpl_rpl_index =flow_nic_alloc_resource_config (ndev,RES_TPE_RPL , rpl_rpl_length,1 ); + rpl_rpl_index =nthw_flow_nic_alloc_resource_config (ndev,RES_TPE_RPL , rpl_rpl_length,1 );if (rpl_rpl_index <0 ) { idx.error =1 ;
@@ -2303,7 +2303,7 @@ void hw_db_inline_tpe_ext_deref(struct flow_nic_dev *ndev, void *db_handle,uint32_t rpl_zero[] = {0 ,0 ,0 ,0 };hw_mod_tpe_rpl_rpl_set (&ndev->be,HW_TPE_RPL_RPL_VALUE , rpl_rpl_index + i, rpl_zero); -flow_nic_free_resource (ndev,RES_TPE_RPL , rpl_rpl_index + i); +nthw_flow_nic_free_resource (ndev,RES_TPE_RPL , rpl_rpl_index + i); }hw_mod_tpe_rpl_rpl_flush (&ndev->be, rpl_rpl_index, rpl_rpl_length);
@@ -2900,7 +2900,7 @@ void hw_db_inline_hsh_deref(struct flow_nic_dev *ndev, void *db_handle, struct hhw_mod_hsh_rcp_flush (&ndev->be, idx.ids,1 );memset (&db->hsh[idx.ids].data,0x0 ,sizeof (struct hw_db_inline_hsh_data )); -flow_nic_free_resource (ndev,RES_HSH_RCP , idx.ids); +nthw_flow_nic_free_resource (ndev,RES_HSH_RCP , idx.ids); } db->hsh[idx.ids].ref =0 ;
@@ -3003,7 +3003,7 @@ void hw_db_inline_scrub_deref(struct flow_nic_dev *ndev, void *db_handle,memset (&db->scrub[idx.ids].data,0x0 ,sizeof (struct hw_db_inline_scrub_data )); -flow_nic_free_resource (ndev,RES_SCRUB_RCP , idx.ids); +nthw_flow_nic_free_resource (ndev,RES_SCRUB_RCP , idx.ids); } db->scrub[idx.ids].ref =0 ;
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +140 -128
965 lines not on this page · raw message
drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +1 -1
@@ -476,7 +476,7 @@ static struct meter_ops_s meter_ops = { .eth_mtr_ops_get = eth_mtr_ops_get, }; -void meter_init (void ) +void nthw_meter_init (void ) {NT_LOG (DBG ,NTNIC ,"Meter ops initialized" );register_meter_ops (&meter_ops);
drivers/net/ntnic/ntnic_ethdev.c +7 -5
@@ -1439,9 +1439,9 @@ drv_deinit(struct drv_s *p_drv) profile_inline_ops->flm_free_queues ();THREAD_JOIN (p_nt_drv->port_event_thread);/* Free all local flm event queues */ -flm_inf_sta_queue_free_all (FLM_INFO_LOCAL ); +nthw_flm_inf_sta_queue_free_all (FLM_INFO_LOCAL );/* Free all remote flm event queues */ -flm_inf_sta_queue_free_all (FLM_INFO_REMOTE ); +nthw_flm_inf_sta_queue_free_all (FLM_INFO_REMOTE );/* Free all aged flow event queues */ flm_age_queue_free_all (); }
@@ -1824,7 +1824,7 @@ THREAD_FUNC port_event_thread_fn(void *context)/* Local FLM statistic events */ struct flm_info_event_s data; -if (flm_inf_queue_get (port_no,FLM_INFO_LOCAL , &data) ==0 ) { +if (nthw_flm_inf_queue_get (port_no,FLM_INFO_LOCAL , &data) ==0 ) {if (eth_dev && eth_dev->data && eth_dev->data->dev_private) {struct ntnic_flm_statistic_s event_data;
@@ -2072,7 +2072,8 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)if (kvargs_count !=0 ) {RTE_ASSERT (kvargs_count ==1 ); - res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_RXQUEUES_ARG , &string_to_u32, + res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_RXQUEUES_ARG , + &nthw_string_to_u32, &nb_rx_queues);if (res <0 ) {
@@ -2096,7 +2097,8 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)if (kvargs_count !=0 ) {RTE_ASSERT (kvargs_count ==1 ); - res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_TXQUEUES_ARG , &string_to_u32, + res =rte_kvargs_process (kvlist,ETH_DEV_NTHW_TXQUEUES_ARG , + &nthw_string_to_u32, &nb_tx_queues);if (res <0 ) {
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +23 -21
143 lines not on this page · raw message
drivers/net/ntnic/ntnic_mod_reg.c +9 -9
@@ -15,7 +15,7 @@ void register_sg_ops(struct sg_ops_s *ops)const struct sg_ops_s *get_sg_ops (void ) {if (sg_ops ==NULL ) -sg_init (); +nthw_sg_init ();return sg_ops; }
@@ -32,7 +32,7 @@ void register_meter_ops(struct meter_ops_s *ops)const struct meter_ops_s *get_meter_ops (void ) {if (meter_ops ==NULL ) -meter_init (); +nthw_meter_init ();return meter_ops; }
@@ -65,7 +65,7 @@ void register_100g_link_ops(struct link_ops_s *ops)const struct link_ops_s *get_100g_link_ops (void ) {if (link_100g_ops ==NULL ) -link_100g_init (); +nthw_link_100g_init ();return link_100g_ops; }
@@ -96,7 +96,7 @@ void register_port_ops(const struct port_ops *ops)const struct port_ops *get_port_ops (void ) {if (port_ops ==NULL ) -port_init (); +nthw_port_init ();return port_ops; }
@@ -125,7 +125,7 @@ void register_adapter_ops(const struct adapter_ops *ops)const struct adapter_ops *get_adapter_ops (void ) {if (adapter_ops ==NULL ) -adapter_init (); +nthw_adapter_init ();return adapter_ops; }
@@ -211,7 +211,7 @@ struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void)const struct flow_backend_ops *get_flow_backend_ops (void ) {if (flow_backend_ops ==NULL ) -flow_backend_init (); +nthw_flow_backend_init ();return flow_backend_ops; }
@@ -241,7 +241,7 @@ void register_flow_filter_ops(const struct flow_filter_ops *ops)const struct flow_filter_ops *get_flow_filter_ops (void ) {if (flow_filter_ops ==NULL ) -init_flow_filter (); +nthw_init_flow_filter ();return flow_filter_ops; }
@@ -256,7 +256,7 @@ void register_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops)const struct rte_flow_fp_ops *get_dev_fp_flow_ops (void ) {if (dev_fp_flow_ops ==NULL ) -dev_fp_flow_init (); +nthw_dev_fp_flow_init ();return dev_fp_flow_ops; }
@@ -271,7 +271,7 @@ void register_dev_flow_ops(const struct rte_flow_ops *ops)const struct rte_flow_ops *get_dev_flow_ops (void ) {if (dev_flow_ops ==NULL ) -dev_flow_init (); +nthw_dev_flow_init ();return dev_flow_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +15 -14
@@ -115,7 +115,7 @@ struct sg_ops_s {void register_sg_ops (struct sg_ops_s *ops);const struct sg_ops_s *get_sg_ops (void ); -void sg_init (void ); +void nthw_sg_init (void );/* Meter ops section */ struct meter_ops_s {
@@ -124,7 +124,7 @@ struct meter_ops_s {void register_meter_ops (struct meter_ops_s *ops);const struct meter_ops_s *get_meter_ops (void ); -void meter_init (void ); +void nthw_meter_init (void );/* *
@@ -143,7 +143,7 @@ struct link_ops_s {void register_100g_link_ops (struct link_ops_s *ops);const struct link_ops_s *get_100g_link_ops (void ); -void link_100g_init (void ); +void nthw_link_100g_init (void );void register_agx_100g_link_ops (struct link_ops_s *ops);const struct link_ops_s *get_agx_100g_link_ops (void );
@@ -203,7 +203,7 @@ struct port_ops {void register_port_ops (const struct port_ops *ops);const struct port_ops *get_port_ops (void ); -void port_init (void ); +void nthw_port_init (void );struct nt4ga_stat_ops {int (*nt4ga_stat_init)(struct adapter_info_s *p_adapter_info);
@@ -225,7 +225,7 @@ struct adapter_ops {void register_adapter_ops (const struct adapter_ops *ops);const struct adapter_ops *get_adapter_ops (void ); -void adapter_init (void ); +void nthw_adapter_init (void );struct clk9563_ops {const int *(*get_n_data_9563_si5340_nt200a02_u23_v5)(void );
@@ -277,14 +277,14 @@ struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void);void rst_nt400dxx_ops_init (void );struct flow_backend_ops { -const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga, +const struct flow_api_backend_ops *(*nthw_bin_flow_backend_init)(nthw_fpga_t *p_fpga,void **be_dev);void (*bin_flow_backend_done)(void *be_dev); };void register_flow_backend_ops (const struct flow_backend_ops *ops);const struct flow_backend_ops *get_flow_backend_ops (void ); -void flow_backend_init (void ); +void nthw_flow_backend_init (void );struct profile_inline_ops {/*
@@ -445,9 +445,9 @@ const struct profile_inline_ops *get_profile_inline_ops(void);void profile_inline_init (void );struct flow_filter_ops { -int (*flow_filter_init)(nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device, +int (*nthw_flow_filter_init)(nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no); -int (*flow_filter_done)(struct flow_nic_dev *dev); +int (*nthw_flow_filter_done)(struct flow_nic_dev *dev);/* * Device Management API */
@@ -487,8 +487,9 @@ struct flow_filter_ops {const struct rte_flow_action action[], struct rte_flow_error *error); -int (*flow_get_flm_stats)(struct flow_nic_dev *ndev,uint64_t *data,uint64_t size); -int (*flow_get_ifr_stats)(struct flow_nic_dev *ndev,uint64_t *data,uint8_t port_count); +int (*nthw_flow_get_flm_stats)(struct flow_nic_dev *ndev,uint64_t *data,uint64_t size); +int (*nthw_flow_get_ifr_stats)(struct flow_nic_dev *ndev,uint64_t *data, +uint8_t port_count);/* * Other
@@ -554,15 +555,15 @@ struct flow_filter_ops {void register_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops);const struct rte_flow_fp_ops *get_dev_fp_flow_ops (void ); -void dev_fp_flow_init (void ); +void nthw_dev_fp_flow_init (void );void register_dev_flow_ops (const struct rte_flow_ops *ops);const struct rte_flow_ops *get_dev_flow_ops (void ); -void dev_flow_init (void ); +void nthw_dev_flow_init (void );void register_flow_filter_ops (const struct flow_filter_ops *ops);const struct flow_filter_ops *get_flow_filter_ops (void ); -void init_flow_filter (void ); +void nthw_init_flow_filter (void );struct ntnic_xstats_ops { int (*nthw_xstats_get_names)(nt4ga_stat_t *p_nt4ga_stat,
drivers/net/ntnic/ntutil/nt_util.c +2 -2
@@ -181,7 +181,7 @@ uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa) }/* Converts link speed provided in Mbps to NT specific definitions.*/ -nt_link_speed_t convert_link_speed (int link_speed_mbps) +nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps) {switch (link_speed_mbps) {case 10 :
@@ -234,7 +234,7 @@ int nt_link_duplex_to_eth_duplex(enum nt_link_duplex_e nt_link_duplex)return eth_link_duplex; } -int string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args) +int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args) {if (!value_str || !extra_args)return -1 ;
drivers/net/ntnic/ntutil/nt_util.h +2 -2
@@ -66,9 +66,9 @@ void nt_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); -nt_link_speed_t convert_link_speed (int link_speed_mbps); +nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps);int nt_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex); -int string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args); +int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args);#endif /* NTOSS_SYSTEM_NT_UTIL_H */
Signature · 1 line
2.45.0