Provide: flow filter init API, Enable virtual queues, fix ntnic issues for release 24.07
Subsystems (2)
cover Provide: flow filter init API, Enable virtual queues, fix ntnic issues for release 24.07
*** BLURB HERE ***
Danylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packets
Oleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core module
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBS
.mailmap | 1 +
doc/guides/nics/features/ntnic.ini | 2 +
doc/guides/nics/ntnic.rst | 73 +
drivers/net/ntnic/adapter/nt4ga_adapter.c | 49 +
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 1428 +++++++++++
drivers/net/ntnic/include/flow_api.h | 104 +
drivers/net/ntnic/include/flow_api_engine.h | 48 +
drivers/net/ntnic/include/flow_filter.h | 15 +
drivers/net/ntnic/include/hw_mod_backend.h | 910 +++++++
drivers/net/ntnic/include/hw_mod_cat_v18.h | 141 ++
drivers/net/ntnic/include/hw_mod_cat_v21.h | 91 +
drivers/net/ntnic/include/hw_mod_flm_v25.h | 342 +++
drivers/net/ntnic/include/hw_mod_hsh_v5.h | 46 +
drivers/net/ntnic/include/hw_mod_km_v7.h | 96 +
drivers/net/ntnic/include/hw_mod_pdb_v9.h | 42 +
drivers/net/ntnic/include/hw_mod_qsl_v7.h | 48 +
drivers/net/ntnic/include/hw_mod_slc_lr_v2.h | 25 +
drivers/net/ntnic/include/hw_mod_tpe_v3.h | 126 +
drivers/net/ntnic/include/nt4ga_adapter.h | 7 +
drivers/net/ntnic/include/nt4ga_filter.h | 13 +
drivers/net/ntnic/include/ntnic_dbs.h | 313 +++
drivers/net/ntnic/include/ntnic_stat.h | 11 +
drivers/net/ntnic/include/ntnic_virt_queue.h | 146 ++
drivers/net/ntnic/include/ntos_drv.h | 70 +
.../ntnic/include/stream_binary_flow_api.h | 22 +
drivers/net/ntnic/meson.build | 35 +-
drivers/net/ntnic/nim/i2c_nim.c | 16 +-
.../net/ntnic/nthw/core/include/nthw_rmc.h | 49 +
.../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +-
.../core/nt200a0x/reset/nthw_fpga_rst9563.c | 12 +-
.../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 12 +-
drivers/net/ntnic/nthw/core/nthw_fpga.c | 24 +-
drivers/net/ntnic/nthw/core/nthw_hif.c | 18 +-
drivers/net/ntnic/nthw/core/nthw_iic.c | 6 +-
drivers/net/ntnic/nthw/core/nthw_pcie3.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_rmc.c | 90 +
drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 1157 +++++++++
drivers/net/ntnic/nthw/flow_api/flow_api.c | 391 +++
.../ntnic/nthw/flow_api/flow_api_nic_setup.h | 20 +
.../nthw/flow_api/flow_backend/flow_backend.c | 2255 +++++++++++++++++
drivers/net/ntnic/nthw/flow_api/flow_filter.c | 55 +
drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 19 +
drivers/net/ntnic/nthw/flow_api/flow_km.c | 19 +
.../nthw/flow_api/hw_mod/hw_mod_backend.c | 145 ++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 985 +++++++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 300 +++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 84 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 278 ++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 86 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 170 ++
.../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 65 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 277 ++
.../ntnic/nthw/flow_filter/flow_nthw_cat.c | 872 +++++++
.../ntnic/nthw/flow_filter/flow_nthw_cat.h | 291 +++
.../ntnic/nthw/flow_filter/flow_nthw_csu.c | 141 ++
.../ntnic/nthw/flow_filter/flow_nthw_csu.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_flm.c | 1225 +++++++++
.../ntnic/nthw/flow_filter/flow_nthw_flm.h | 433 ++++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 230 ++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 84 +
.../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 260 ++
.../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 87 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 123 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_info.c | 341 +++
.../ntnic/nthw/flow_filter/flow_nthw_info.h | 110 +
.../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 610 +++++
.../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 214 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 210 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 85 +
.../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 295 +++
.../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 113 +
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 157 ++
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 61 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 126 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 388 +++
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 59 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 98 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 172 ++
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 74 +
.../net/ntnic/nthw/model/nthw_fpga_model.c | 75 +-
drivers/net/ntnic/nthw/nthw_drv.h | 5 +
drivers/net/ntnic/nthw/nthw_helper.h | 11 +
drivers/net/ntnic/nthw/nthw_rac.c | 181 ++
drivers/net/ntnic/nthw/nthw_rac.h | 9 +
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 727 +++++-
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
.../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 16 +
.../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 20 +
.../nthw/supported/nthw_fpga_reg_defs_cat.h | 238 ++
.../nthw/supported/nthw_fpga_reg_defs_cpy.h | 113 +
.../nthw/supported/nthw_fpga_reg_defs_csu.h | 31 +
.../nthw/supported/nthw_fpga_reg_defs_dbs.h | 144 ++
.../nthw/supported/nthw_fpga_reg_defs_flm.h | 242 ++
.../nthw/supported/nthw_fpga_reg_defs_hfu.h | 49 +
.../nthw/supported/nthw_fpga_reg_defs_hsh.h | 50 +
.../nthw/supported/nthw_fpga_reg_defs_ifr.h | 42 +
.../nthw/supported/nthw_fpga_reg_defs_ins.h | 30 +
.../nthw/supported/nthw_fpga_reg_defs_km.h | 126 +
.../nthw/supported/nthw_fpga_reg_defs_pdb.h | 48 +
.../nthw/supported/nthw_fpga_reg_defs_qsl.h | 66 +
.../nthw/supported/nthw_fpga_reg_defs_rmc.h | 36 +
.../nthw/supported/nthw_fpga_reg_defs_rpl.h | 43 +
.../supported/nthw_fpga_reg_defs_rpp_lr.h | 37 +
.../nthw/supported/nthw_fpga_reg_defs_slc.h | 34 +
.../supported/nthw_fpga_reg_defs_slc_lr.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_cpy.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_ins.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_rpl.h | 23 +
drivers/net/ntnic/ntlog/ntlog.c | 2 -
drivers/net/ntnic/ntlog/ntlog.h | 63 +-
drivers/net/ntnic/ntnic_ethdev.c | 1126 +++++++-
drivers/net/ntnic/ntnic_mod_reg.c | 44 +
drivers/net/ntnic/ntnic_mod_reg.h | 116 +
drivers/net/ntnic/ntnic_vfio.c | 5 +-
drivers/net/ntnic/ntutil/nt_util.c | 19 +-
drivers/net/ntnic/ntutil/nt_util.h | 8 +
120 files changed, 21489 insertions(+), 159 deletions(-)
create mode 100644 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c
create mode 100644 drivers/net/ntnic/include/flow_api.h
create mode 100644 drivers/net/ntnic/include/flow_api_engine.h
create mode 100644 drivers/net/ntnic/include/flow_filter.h
create mode 100644 drivers/net/ntnic/include/hw_mod_backend.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v18.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v21.h
create mode 100644 drivers/net/ntnic/include/hw_mod_flm_v25.h
create mode 100644 drivers/net/ntnic/include/hw_mod_hsh_v5.h
create mode 100644 drivers/net/ntnic/include/hw_mod_km_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_pdb_v9.h
create mode 100644 drivers/net/ntnic/include/hw_mod_qsl_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_slc_lr_v2.h
create mode 100644 drivers/net/ntnic/include/hw_mod_tpe_v3.h
create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h
create mode 100644 drivers/net/ntnic/include/ntnic_dbs.h
create mode 100644 drivers/net/ntnic/include/ntnic_stat.h
create mode 100644 drivers/net/ntnic/include/ntnic_virt_queue.h
create mode 100644 drivers/net/ntnic/include/stream_binary_flow_api.h
create mode 100644 drivers/net/ntnic/nthw/core/include/nthw_rmc.h
create mode 100644 drivers/net/ntnic/nthw/core/nthw_rmc.c
create mode 100644 drivers/net/ntnic/nthw/dbs/nthw_dbs.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_kcc.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h
create mode 100644 drivers/net/ntnic/nthw/nthw_helper.h
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (60%)
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cat.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_csu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_flm.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hfu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hsh.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ifr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_km.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_pdb.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_qsl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.hSignature · 1 line
2.45.0
PATCH 1/50 net/ntnic: update NT NiC PMD driver with FPGA version
From: Oleksandr Kolomeiets <[email protected]>
Update base FPGA files to the new version(39->49)
Fix code style problems
---
drivers/net/ntnic/meson.build | 2 +-
.../net/ntnic/nthw/model/nthw_fpga_model.c | 11 +++---
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 34 +++++++++----------
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
5 files changed, 25 insertions(+), 26 deletions(-)
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (98%)drivers/net/ntnic/meson.build +1 -1
@@ -26,7 +26,7 @@ sources = files( 'link_mgmt/link_100g/nt4ga_link_100g.c', 'link_mgmt/nt4ga_link.c', 'nim/i2c_nim.c', - 'nthw/supported/nthw_fpga_9563_055_039_0000.c', + 'nthw/supported/nthw_fpga_9563_055_049_0000.c', 'nthw/supported/nthw_fpga_instances.c', 'nthw/supported/nthw_fpga_mod_str_map.c', 'nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c',
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +5 -6
@@ -31,8 +31,7 @@ static const char *get_bus_name(int n_bus_type_id)if (n_bus_type_id >=1 && n_bus_type_id <= (int )ARRAY_SIZE (sa_nthw_fpga_bus_type_str))return sa_nthw_fpga_bus_type_str[n_bus_type_id]; -else -return "ERR" ; +return "ERR" ; }/*
@@ -1146,16 +1145,16 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match ewhile (true) {uint32_t val =nthw_field_get_updated (p); -if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 ) { +if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask) { +if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask)return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) {uint32_t mask =nthw_field_get_mask (p);if (val != mask)
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c renamed from drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_039_0000.c +17 -17
@@ -179,7 +179,7 @@ static nthw_fpga_register_init_s gpio_phy_registers[] = { };static nthw_fpga_field_init_s hif_build_time_fields[] = { - {HIF_BUILD_TIME_TIME ,32 ,0 ,1713859545 }, + {HIF_BUILD_TIME_TIME ,32 ,0 ,1726740521 }, };static nthw_fpga_field_init_s hif_config_fields[] = {
@@ -202,7 +202,7 @@ static nthw_fpga_field_init_s hif_prod_id_ex_fields[] = {static nthw_fpga_field_init_s hif_prod_id_lsb_fields[] = { {HIF_PROD_ID_LSB_GROUP_ID ,16 ,16 ,9563 }, - {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,39 }, + {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,49 }, {HIF_PROD_ID_LSB_VER_ID ,8 ,8 ,55 }, };
@@ -247,27 +247,27 @@ static nthw_fpga_field_init_s hif_test1_fields[] = { };static nthw_fpga_field_init_s hif_uuid0_fields[] = { - {HIF_UUID0_UUID0 ,32 ,0 ,1237800326 }, + {HIF_UUID0_UUID0 ,32 ,0 ,1021928912 }, };static nthw_fpga_field_init_s hif_uuid1_fields[] = { - {HIF_UUID1_UUID1 ,32 ,0 ,3057550372 }, + {HIF_UUID1_UUID1 ,32 ,0 ,2998983545 }, };static nthw_fpga_field_init_s hif_uuid2_fields[] = { - {HIF_UUID2_UUID2 ,32 ,0 ,2445752330 }, + {HIF_UUID2_UUID2 ,32 ,0 ,827210969 }, };static nthw_fpga_field_init_s hif_uuid3_fields[] = { - {HIF_UUID3_UUID3 ,32 ,0 ,1864147557 }, + {HIF_UUID3_UUID3 ,32 ,0 ,462142918 }, };static nthw_fpga_register_init_s hif_registers[] = { - {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1713859545 ,1 , hif_build_time_fields }, + {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1726740521 ,1 , hif_build_time_fields }, {HIF_CONFIG ,24 ,7 ,NTHW_FPGA_REG_TYPE_RW ,0 ,3 , hif_config_fields }, {HIF_CONTROL ,40 ,13 ,NTHW_FPGA_REG_TYPE_MIXED ,4097 ,3 , hif_control_fields }, {HIF_PROD_ID_EX ,112 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1 ,3 , hif_prod_id_ex_fields }, - {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734887 ,3 , hif_prod_id_lsb_fields }, + {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734897 ,3 , hif_prod_id_lsb_fields }, {HIF_PROD_ID_MSB ,8 ,22 ,NTHW_FPGA_REG_TYPE_RO ,200 ,2 , hif_prod_id_msb_fields }, {HIF_SAMPLE_TIME ,96 ,1 ,NTHW_FPGA_REG_TYPE_WO ,0 ,1 , hif_sample_time_fields }, {HIF_STATUS ,32 ,10 ,NTHW_FPGA_REG_TYPE_MIXED ,0 ,3 , hif_status_fields },
@@ -277,10 +277,10 @@ static nthw_fpga_register_init_s hif_registers[] = { { HIF_STAT_TX, 80, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, hif_stat_tx_fields }, { HIF_TEST0, 48, 32, NTHW_FPGA_REG_TYPE_RW, 287454020, 1, hif_test0_fields }, { HIF_TEST1, 56, 32, NTHW_FPGA_REG_TYPE_RW, 2864434397, 1, hif_test1_fields }, - { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1237800326, 1, hif_uuid0_fields }, - { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 3057550372, 1, hif_uuid1_fields }, - { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 2445752330, 1, hif_uuid2_fields }, - { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 1864147557, 1, hif_uuid3_fields }, + { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1021928912, 1, hif_uuid0_fields }, + { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 2998983545, 1, hif_uuid1_fields }, + { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 827210969, 1, hif_uuid2_fields }, + { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 462142918, 1, hif_uuid3_fields }, }; static nthw_fpga_field_init_s iic_adr_fields[] = {
@@ -1071,7 +1071,7 @@ static nthw_fpga_module_init_s fpga_modules[] = {static nthw_fpga_prod_param_s product_parameters[] = { {NT_BUILD_NUMBER ,0 }, - {NT_BUILD_TIME ,1713859545 }, + {NT_BUILD_TIME ,1726740521 }, {NT_CATEGORIES ,64 }, {NT_CAT_DCT_PRESENT ,0 }, {NT_CAT_END_OFS_SUPPORT ,0 },
@@ -1101,7 +1101,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_FLM_CACHE, 1 }, { NT_FLM_CATEGORIES, 32 }, { NT_FLM_ENTRY_SIZE, 64 }, - { NT_FLM_LOAD_APS_MAX, 260000000 }, + { NT_FLM_LOAD_APS_MAX, 270000000 }, { NT_FLM_LOAD_LPS_MAX, 300000000 }, { NT_FLM_PRESENT, 1 }, { NT_FLM_PRIOS, 4 },
@@ -1176,7 +1176,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_QUEUES, 128 }, { NT_RAC_RAB_INTERFACES, 3 }, { NT_RAC_RAB_OB_UPDATE, 0 }, - { NT_REVISION_ID, 39 }, + { NT_REVISION_ID, 49 }, { NT_RMC_LAG_GROUPS, 1 }, { NT_RMC_PRESENT, 1 }, { NT_ROA_CATEGORIES, 1024 },
@@ -1225,6 +1225,6 @@ static nthw_fpga_prod_param_s product_parameters[] = { { 0, -1 }, /* END */ }; -nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000 = { -200 ,9563 ,55 ,39 ,0 ,0 ,1713859545 ,152 , product_parameters,15 , fpga_modules, +nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,15 , fpga_modules, };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.c +1 -1
@@ -5,4 +5,4 @@#include "nthw_fpga_instances.h" -nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_039_0000,NULL }; +nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_049_0000,NULL };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.h +1 -1
@@ -6,4 +6,4 @@#include "fpga_model.h" extern nthw_fpga_prod_init_s *nthw_fpga_instances[]; -extern nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000; +extern nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000;
Signature · 1 line
2.45.0
v2 cover Provide: flow filter init API, Enable virtual queues, fix ntnic issues for release 24.07
The list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentation
Danylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packets
Oleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core module
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBS
.mailmap | 1 +
doc/guides/nics/features/ntnic.ini | 2 +
doc/guides/nics/ntnic.rst | 73 +
doc/guides/rel_notes/release_24_11.rst | 10 +
drivers/net/ntnic/adapter/nt4ga_adapter.c | 49 +
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 1428 +++++++++++
drivers/net/ntnic/include/flow_api.h | 104 +
drivers/net/ntnic/include/flow_api_engine.h | 48 +
drivers/net/ntnic/include/flow_filter.h | 15 +
drivers/net/ntnic/include/hw_mod_backend.h | 910 +++++++
drivers/net/ntnic/include/hw_mod_cat_v18.h | 141 ++
drivers/net/ntnic/include/hw_mod_cat_v21.h | 91 +
drivers/net/ntnic/include/hw_mod_flm_v25.h | 342 +++
drivers/net/ntnic/include/hw_mod_hsh_v5.h | 46 +
drivers/net/ntnic/include/hw_mod_km_v7.h | 96 +
drivers/net/ntnic/include/hw_mod_pdb_v9.h | 42 +
drivers/net/ntnic/include/hw_mod_qsl_v7.h | 48 +
drivers/net/ntnic/include/hw_mod_slc_lr_v2.h | 25 +
drivers/net/ntnic/include/hw_mod_tpe_v3.h | 126 +
drivers/net/ntnic/include/nt4ga_adapter.h | 7 +
drivers/net/ntnic/include/nt4ga_filter.h | 13 +
drivers/net/ntnic/include/ntnic_dbs.h | 313 +++
drivers/net/ntnic/include/ntnic_stat.h | 11 +
drivers/net/ntnic/include/ntnic_virt_queue.h | 146 ++
drivers/net/ntnic/include/ntos_drv.h | 70 +
.../ntnic/include/stream_binary_flow_api.h | 22 +
drivers/net/ntnic/meson.build | 35 +-
drivers/net/ntnic/nim/i2c_nim.c | 16 +-
.../net/ntnic/nthw/core/include/nthw_rmc.h | 49 +
.../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +-
.../core/nt200a0x/reset/nthw_fpga_rst9563.c | 12 +-
.../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 12 +-
drivers/net/ntnic/nthw/core/nthw_fpga.c | 24 +-
drivers/net/ntnic/nthw/core/nthw_hif.c | 18 +-
drivers/net/ntnic/nthw/core/nthw_iic.c | 6 +-
drivers/net/ntnic/nthw/core/nthw_pcie3.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_rmc.c | 90 +
drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 1157 +++++++++
drivers/net/ntnic/nthw/flow_api/flow_api.c | 391 +++
.../ntnic/nthw/flow_api/flow_api_nic_setup.h | 20 +
.../nthw/flow_api/flow_backend/flow_backend.c | 2255 +++++++++++++++++
drivers/net/ntnic/nthw/flow_api/flow_filter.c | 55 +
drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 19 +
drivers/net/ntnic/nthw/flow_api/flow_km.c | 19 +
.../nthw/flow_api/hw_mod/hw_mod_backend.c | 145 ++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 985 +++++++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 300 +++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 84 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 278 ++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 86 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 170 ++
.../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 65 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 277 ++
.../ntnic/nthw/flow_filter/flow_nthw_cat.c | 872 +++++++
.../ntnic/nthw/flow_filter/flow_nthw_cat.h | 291 +++
.../ntnic/nthw/flow_filter/flow_nthw_csu.c | 141 ++
.../ntnic/nthw/flow_filter/flow_nthw_csu.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_flm.c | 1225 +++++++++
.../ntnic/nthw/flow_filter/flow_nthw_flm.h | 433 ++++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 230 ++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 84 +
.../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 260 ++
.../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 87 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 123 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_info.c | 341 +++
.../ntnic/nthw/flow_filter/flow_nthw_info.h | 110 +
.../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 610 +++++
.../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 214 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 210 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 85 +
.../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 295 +++
.../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 113 +
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 157 ++
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 61 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 126 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 388 +++
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 59 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 98 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 172 ++
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 74 +
.../net/ntnic/nthw/model/nthw_fpga_model.c | 75 +-
drivers/net/ntnic/nthw/nthw_drv.h | 5 +
drivers/net/ntnic/nthw/nthw_helper.h | 11 +
drivers/net/ntnic/nthw/nthw_rac.c | 181 ++
drivers/net/ntnic/nthw/nthw_rac.h | 9 +
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 727 +++++-
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
.../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 16 +
.../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 20 +
.../nthw/supported/nthw_fpga_reg_defs_cat.h | 238 ++
.../nthw/supported/nthw_fpga_reg_defs_cpy.h | 113 +
.../nthw/supported/nthw_fpga_reg_defs_csu.h | 31 +
.../nthw/supported/nthw_fpga_reg_defs_dbs.h | 144 ++
.../nthw/supported/nthw_fpga_reg_defs_flm.h | 242 ++
.../nthw/supported/nthw_fpga_reg_defs_hfu.h | 49 +
.../nthw/supported/nthw_fpga_reg_defs_hsh.h | 50 +
.../nthw/supported/nthw_fpga_reg_defs_ifr.h | 42 +
.../nthw/supported/nthw_fpga_reg_defs_ins.h | 30 +
.../nthw/supported/nthw_fpga_reg_defs_km.h | 126 +
.../nthw/supported/nthw_fpga_reg_defs_pdb.h | 48 +
.../nthw/supported/nthw_fpga_reg_defs_qsl.h | 66 +
.../nthw/supported/nthw_fpga_reg_defs_rmc.h | 36 +
.../nthw/supported/nthw_fpga_reg_defs_rpl.h | 43 +
.../supported/nthw_fpga_reg_defs_rpp_lr.h | 37 +
.../nthw/supported/nthw_fpga_reg_defs_slc.h | 34 +
.../supported/nthw_fpga_reg_defs_slc_lr.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_cpy.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_ins.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_rpl.h | 23 +
drivers/net/ntnic/ntlog/ntlog.c | 2 -
drivers/net/ntnic/ntlog/ntlog.h | 63 +-
drivers/net/ntnic/ntnic_ethdev.c | 1126 +++++++-
drivers/net/ntnic/ntnic_mod_reg.c | 44 +
drivers/net/ntnic/ntnic_mod_reg.h | 116 +
drivers/net/ntnic/ntnic_vfio.c | 5 +-
drivers/net/ntnic/ntutil/nt_util.c | 19 +-
drivers/net/ntnic/ntutil/nt_util.h | 8 +
121 files changed, 21499 insertions(+), 159 deletions(-)
create mode 100644 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c
create mode 100644 drivers/net/ntnic/include/flow_api.h
create mode 100644 drivers/net/ntnic/include/flow_api_engine.h
create mode 100644 drivers/net/ntnic/include/flow_filter.h
create mode 100644 drivers/net/ntnic/include/hw_mod_backend.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v18.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v21.h
create mode 100644 drivers/net/ntnic/include/hw_mod_flm_v25.h
create mode 100644 drivers/net/ntnic/include/hw_mod_hsh_v5.h
create mode 100644 drivers/net/ntnic/include/hw_mod_km_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_pdb_v9.h
create mode 100644 drivers/net/ntnic/include/hw_mod_qsl_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_slc_lr_v2.h
create mode 100644 drivers/net/ntnic/include/hw_mod_tpe_v3.h
create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h
create mode 100644 drivers/net/ntnic/include/ntnic_dbs.h
create mode 100644 drivers/net/ntnic/include/ntnic_stat.h
create mode 100644 drivers/net/ntnic/include/ntnic_virt_queue.h
create mode 100644 drivers/net/ntnic/include/stream_binary_flow_api.h
create mode 100644 drivers/net/ntnic/nthw/core/include/nthw_rmc.h
create mode 100644 drivers/net/ntnic/nthw/core/nthw_rmc.c
create mode 100644 drivers/net/ntnic/nthw/dbs/nthw_dbs.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_kcc.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h
create mode 100644 drivers/net/ntnic/nthw/nthw_helper.h
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (60%)
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cat.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_csu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_flm.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hfu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hsh.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ifr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_km.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_pdb.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_qsl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.hSignature · 1 line
2.45.0
PATCH v2 1/50 net/ntnic: update NT NiC PMD driver with FPGA version
From: Oleksandr Kolomeiets <[email protected]>
Update base FPGA files to the new version(39->49)
Fix code style problems
Update documentation
---
v2
* Update release notes
---
doc/guides/rel_notes/release_24_11.rst | 3 ++
drivers/net/ntnic/meson.build | 2 +-
.../net/ntnic/nthw/model/nthw_fpga_model.c | 11 +++---
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 34 +++++++++----------
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
6 files changed, 28 insertions(+), 26 deletions(-)
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (98%)doc/guides/rel_notes/release_24_11.rst +3 -0
@@ -98,6 +98,9 @@ New Features * Added SR-IOV VF support. * Added recent 1400/14000 and 15000 models to the supported list. +* **Update Napatech ntnic net driver [EXPERIMENTAL].** + + * Update supported version of the FPGA to 9563.55.49 Removed Items -------------
drivers/net/ntnic/meson.build +1 -1
@@ -26,7 +26,7 @@ sources = files( 'link_mgmt/link_100g/nt4ga_link_100g.c', 'link_mgmt/nt4ga_link.c', 'nim/i2c_nim.c', - 'nthw/supported/nthw_fpga_9563_055_039_0000.c', + 'nthw/supported/nthw_fpga_9563_055_049_0000.c', 'nthw/supported/nthw_fpga_instances.c', 'nthw/supported/nthw_fpga_mod_str_map.c', 'nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c',
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +5 -6
@@ -31,8 +31,7 @@ static const char *get_bus_name(int n_bus_type_id)if (n_bus_type_id >=1 && n_bus_type_id <= (int )ARRAY_SIZE (sa_nthw_fpga_bus_type_str))return sa_nthw_fpga_bus_type_str[n_bus_type_id]; -else -return "ERR" ; +return "ERR" ; }/*
@@ -1146,16 +1145,16 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match ewhile (true) {uint32_t val =nthw_field_get_updated (p); -if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 ) { +if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask) { +if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask)return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) {uint32_t mask =nthw_field_get_mask (p);if (val != mask)
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c renamed from drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_039_0000.c +17 -17
@@ -179,7 +179,7 @@ static nthw_fpga_register_init_s gpio_phy_registers[] = { };static nthw_fpga_field_init_s hif_build_time_fields[] = { - {HIF_BUILD_TIME_TIME ,32 ,0 ,1713859545 }, + {HIF_BUILD_TIME_TIME ,32 ,0 ,1726740521 }, };static nthw_fpga_field_init_s hif_config_fields[] = {
@@ -202,7 +202,7 @@ static nthw_fpga_field_init_s hif_prod_id_ex_fields[] = {static nthw_fpga_field_init_s hif_prod_id_lsb_fields[] = { {HIF_PROD_ID_LSB_GROUP_ID ,16 ,16 ,9563 }, - {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,39 }, + {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,49 }, {HIF_PROD_ID_LSB_VER_ID ,8 ,8 ,55 }, };
@@ -247,27 +247,27 @@ static nthw_fpga_field_init_s hif_test1_fields[] = { };static nthw_fpga_field_init_s hif_uuid0_fields[] = { - {HIF_UUID0_UUID0 ,32 ,0 ,1237800326 }, + {HIF_UUID0_UUID0 ,32 ,0 ,1021928912 }, };static nthw_fpga_field_init_s hif_uuid1_fields[] = { - {HIF_UUID1_UUID1 ,32 ,0 ,3057550372 }, + {HIF_UUID1_UUID1 ,32 ,0 ,2998983545 }, };static nthw_fpga_field_init_s hif_uuid2_fields[] = { - {HIF_UUID2_UUID2 ,32 ,0 ,2445752330 }, + {HIF_UUID2_UUID2 ,32 ,0 ,827210969 }, };static nthw_fpga_field_init_s hif_uuid3_fields[] = { - {HIF_UUID3_UUID3 ,32 ,0 ,1864147557 }, + {HIF_UUID3_UUID3 ,32 ,0 ,462142918 }, };static nthw_fpga_register_init_s hif_registers[] = { - {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1713859545 ,1 , hif_build_time_fields }, + {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1726740521 ,1 , hif_build_time_fields }, {HIF_CONFIG ,24 ,7 ,NTHW_FPGA_REG_TYPE_RW ,0 ,3 , hif_config_fields }, {HIF_CONTROL ,40 ,13 ,NTHW_FPGA_REG_TYPE_MIXED ,4097 ,3 , hif_control_fields }, {HIF_PROD_ID_EX ,112 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1 ,3 , hif_prod_id_ex_fields }, - {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734887 ,3 , hif_prod_id_lsb_fields }, + {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734897 ,3 , hif_prod_id_lsb_fields }, {HIF_PROD_ID_MSB ,8 ,22 ,NTHW_FPGA_REG_TYPE_RO ,200 ,2 , hif_prod_id_msb_fields }, {HIF_SAMPLE_TIME ,96 ,1 ,NTHW_FPGA_REG_TYPE_WO ,0 ,1 , hif_sample_time_fields }, {HIF_STATUS ,32 ,10 ,NTHW_FPGA_REG_TYPE_MIXED ,0 ,3 , hif_status_fields },
@@ -277,10 +277,10 @@ static nthw_fpga_register_init_s hif_registers[] = { { HIF_STAT_TX, 80, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, hif_stat_tx_fields }, { HIF_TEST0, 48, 32, NTHW_FPGA_REG_TYPE_RW, 287454020, 1, hif_test0_fields }, { HIF_TEST1, 56, 32, NTHW_FPGA_REG_TYPE_RW, 2864434397, 1, hif_test1_fields }, - { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1237800326, 1, hif_uuid0_fields }, - { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 3057550372, 1, hif_uuid1_fields }, - { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 2445752330, 1, hif_uuid2_fields }, - { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 1864147557, 1, hif_uuid3_fields }, + { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1021928912, 1, hif_uuid0_fields }, + { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 2998983545, 1, hif_uuid1_fields }, + { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 827210969, 1, hif_uuid2_fields }, + { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 462142918, 1, hif_uuid3_fields }, }; static nthw_fpga_field_init_s iic_adr_fields[] = {
@@ -1071,7 +1071,7 @@ static nthw_fpga_module_init_s fpga_modules[] = {static nthw_fpga_prod_param_s product_parameters[] = { {NT_BUILD_NUMBER ,0 }, - {NT_BUILD_TIME ,1713859545 }, + {NT_BUILD_TIME ,1726740521 }, {NT_CATEGORIES ,64 }, {NT_CAT_DCT_PRESENT ,0 }, {NT_CAT_END_OFS_SUPPORT ,0 },
@@ -1101,7 +1101,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_FLM_CACHE, 1 }, { NT_FLM_CATEGORIES, 32 }, { NT_FLM_ENTRY_SIZE, 64 }, - { NT_FLM_LOAD_APS_MAX, 260000000 }, + { NT_FLM_LOAD_APS_MAX, 270000000 }, { NT_FLM_LOAD_LPS_MAX, 300000000 }, { NT_FLM_PRESENT, 1 }, { NT_FLM_PRIOS, 4 },
@@ -1176,7 +1176,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_QUEUES, 128 }, { NT_RAC_RAB_INTERFACES, 3 }, { NT_RAC_RAB_OB_UPDATE, 0 }, - { NT_REVISION_ID, 39 }, + { NT_REVISION_ID, 49 }, { NT_RMC_LAG_GROUPS, 1 }, { NT_RMC_PRESENT, 1 }, { NT_ROA_CATEGORIES, 1024 },
@@ -1225,6 +1225,6 @@ static nthw_fpga_prod_param_s product_parameters[] = { { 0, -1 }, /* END */ }; -nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000 = { -200 ,9563 ,55 ,39 ,0 ,0 ,1713859545 ,152 , product_parameters,15 , fpga_modules, +nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,15 , fpga_modules, };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.c +1 -1
@@ -5,4 +5,4 @@#include "nthw_fpga_instances.h" -nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_039_0000,NULL }; +nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_049_0000,NULL };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.h +1 -1
@@ -6,4 +6,4 @@#include "fpga_model.h" extern nthw_fpga_prod_init_s *nthw_fpga_instances[]; -extern nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000; +extern nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000;
Signature · 1 line
2.45.0
PATCH v2 2/50 net/ntnic: fix coverity issues:
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
CI founc couple coverity problems which were fixed in this commit.
CID 440550, 440551, 440545, 440553, 440552, 440547:
Null pointer dereferences (REVERSE_INULL)
These issues were fixed by reworking variable NULL checking and adding NULL checking before var using.
CID 440543: Incorrect expression (IDENTICAL_BRANCHES) This issue was fixed by removing useless if statements from the code.
CID 440548: Null pointer dereferences (FORWARD_NULL) This issue was fixed by adding NULL checking before mp_fld_rst_serdes_rx var using.
CID 440546: Resource leaks (RESOURCE_LEAK)
This issue was fixed by moving NULL checking before var using.
CID 440540: Error handling issues (CHECKED_RETURN) This issue was fixed with return value checking adding.
CID 440549: (OVERRUN)
This issue was fixed with array edge values fixing.
Coverity issue: 440550
---
v2
* Update release notes
--- .mailmap | 1 + doc/guides/rel_notes/release_24_11.rst | 1 + .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 2 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 24 ++++---- drivers/net/ntnic/nthw/core/nthw_hif.c | 18 +----- .../net/ntnic/nthw/model/nthw_fpga_model.c | 58 ++++++++++--------- drivers/net/ntnic/ntnic_ethdev.c | 21 +++---- drivers/net/ntnic/ntnic_vfio.c | 5 +- drivers/net/ntnic/ntutil/nt_util.c | 3 +- 9 files changed, 67 insertions(+), 66 deletions(-)
.mailmap +1 -0
@@ -295,6 +295,7 @@ Dan Nowlin <[email protected]> Danny Patel <[email protected]> Danny Zhou <[email protected]> Dan Wei <[email protected]> +Danylo Vodopianov <[email protected]> Dapeng Yu <[email protected]> Darek Stojaczyk <[email protected]> Daria Kolistratova <[email protected]>
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -101,6 +101,7 @@ New Features * **Update Napatech ntnic net driver [EXPERIMENTAL].** * Update supported version of the FPGA to 9563.55.49 + * Fix Coverity issues Removed Items -------------
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
@@ -263,7 +263,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,if (p->mp_fld_rst_serdes_rx)nthw_field_set_flush (p->mp_fld_rst_serdes_rx);/* 0x03 2 ports */ -if (p->mp_fld_rst_serdes_rx_datapath) { +if (p->mp_fld_rst_serdes_rx_datapath && p->mp_fld_rst_serdes_rx) {nthw_field_set_flush (p->mp_fld_rst_serdes_rx_datapath);nthw_field_clr_flush (p->mp_fld_rst_serdes_rx); }
drivers/net/ntnic/nthw/core/nthw_fpga.c +12 -12
@@ -217,19 +217,19 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) n_fpga_ident = p_fpga_info->n_fpga_ident; p_fpga_mgr =nthw_fpga_mgr_new (); -nthw_fpga_mgr_init (p_fpga_mgr, nthw_fpga_instances, - (const void *)sa_nthw_fpga_mod_str_map); -nthw_fpga_mgr_log_dump (p_fpga_mgr); - p_fpga =nthw_fpga_mgr_query_fpga (p_fpga_mgr, n_fpga_ident, p_fpga_info); - p_fpga_info->mp_fpga = p_fpga; - -if (p_fpga ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)\n" , p_adapter_id_str, - s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); -return -1 ; - } -if (p_fpga_mgr) { +nthw_fpga_mgr_init (p_fpga_mgr, nthw_fpga_instances, + (const void *)sa_nthw_fpga_mod_str_map); +nthw_fpga_mgr_log_dump (p_fpga_mgr); + p_fpga =nthw_fpga_mgr_query_fpga (p_fpga_mgr, n_fpga_ident, p_fpga_info); + p_fpga_info->mp_fpga = p_fpga; + +if (p_fpga ==NULL ) { +NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)\n" , p_adapter_id_str, + s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); +return -1 ; + } +nthw_fpga_mgr_delete (p_fpga_mgr); p_fpga_mgr =NULL ; }
drivers/net/ntnic/nthw/core/nthw_hif.c +3 -15
@@ -83,23 +83,11 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance) p->mn_instance, p->mn_fpga_hif_ref_clk_freq, p->mn_fpga_param_hif_per_ps); p->mp_reg_build_seed =NULL ;/* Reg/Fld not present on HIF */ - -if (p->mp_reg_build_seed) - p->mp_fld_build_seed =NULL ;/* Reg/Fld not present on HIF */ -else - p->mp_fld_build_seed =NULL ; + p->mp_fld_build_seed =NULL ;/* Reg/Fld not present on HIF */ p->mp_reg_core_speed =NULL ;/* Reg/Fld not present on HIF */ - -if (p->mp_reg_core_speed) { - p->mp_fld_core_speed =NULL ;/* Reg/Fld not present on HIF */ - p->mp_fld_ddr3_speed =NULL ;/* Reg/Fld not present on HIF */ - - }else { - p->mp_reg_core_speed =NULL ; - p->mp_fld_core_speed =NULL ; - p->mp_fld_ddr3_speed =NULL ; - } + p->mp_fld_core_speed =NULL ;/* Reg/Fld not present on HIF */ + p->mp_fld_ddr3_speed =NULL ;/* Reg/Fld not present on HIF */ /* Optional registers since: 2018-04-25 */ p->mp_reg_int_mask =NULL ;/* Reg/Fld not present on HIF */
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +32 -26
84 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +11 -10
@@ -42,7 +42,7 @@ static struct drv_s *_g_p_drv[NUM_ADAPTER_MAX] = { NULL };static void store_pdrv (struct drv_s *p_drv) { -if (p_drv->adapter_no >NUM_ADAPTER_MAX ) { +if (p_drv->adapter_no >=NUM_ADAPTER_MAX ) {NT_LOG (ERR ,NTNIC ,"Internal error adapter number %u out of range. Max number of adapters: %u\n" , p_drv->adapter_no,NUM_ADAPTER_MAX );
@@ -384,16 +384,17 @@ eth_dev_close(struct rte_eth_dev *eth_dev) internals->p_drv =NULL ;rte_eth_dev_release_port (eth_dev); +if (p_drv) { +/* decrease initialized ethernet devices */ + p_drv->n_eth_dev_init_count--; -/* decrease initialized ethernet devices */ - p_drv->n_eth_dev_init_count--; - -/* -* rte_pci_dev has no private member for p_drv -* wait until all rte_eth_dev's are closed - then close adapters via p_drv -*/ -if (!p_drv->n_eth_dev_init_count && p_drv) -drv_deinit (p_drv); +/* +* rte_pci_dev has no private member for p_drv +* wait until all rte_eth_dev's are closed - then close adapters via p_drv +*/ +if (!p_drv->n_eth_dev_init_count) +drv_deinit (p_drv); + }return 0 ; }
drivers/net/ntnic/ntnic_vfio.c +4 -1
@@ -49,6 +49,7 @@ vfio_get(int vf_num)int nt_vfio_setup (struct rte_pci_device *dev) { +int ret;char devname[RTE_DEV_NAME_MAX_LEN ] = {0 };int iommu_group_num;int vf_num;
@@ -71,7 +72,9 @@ nt_vfio_setup(struct rte_pci_device *dev) vfio->iova_addr =START_VF_IOVA ;rte_pci_device_name (&dev->addr, devname,RTE_DEV_NAME_MAX_LEN ); -rte_vfio_get_group_num (rte_pci_get_sysfs_path (), devname, &iommu_group_num); + ret =rte_vfio_get_group_num (rte_pci_get_sysfs_path (), devname, &iommu_group_num); +if (ret <=0 ) +return -1 ;if (vf_num ==0 ) {/* use default container for pf0 */
drivers/net/ntnic/ntutil/nt_util.c +2 -1
@@ -31,7 +31,8 @@ uint64_t nt_os_get_time_monotonic_counter(void)/* Allocation size matching minimum alignment of specified size */ uint64_t nt_util_align_size (uint64_t size) { -return 1 <<rte_log2_u64 (size); +uint64_t alignment_size =1ULL <<rte_log2_u64 (size); +return alignment_size; }void nt_util_vfio_init (struct nt_util_vfio_impl *impl)
Signature · 1 line
2.45.0
PATCH v2 3/50 net/ntnic: update documentation
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add forgotten feature to the documentation (ntnic.ini)
--- doc/guides/nics/features/ntnic.ini | 1 + 1 file changed, 1 insertion(+)
doc/guides/nics/features/ntnic.ini +1 -0
@@ -6,6 +6,7 @@ [Features] FW version = Y Speed capabilities = Y +Link status = Y Unicast MAC filter = Y Multicast MAC filter = Y Linux = Y
Signature · 1 line
2.45.0
PATCH v2 4/50 net/ntnic: remove extra calling of the API for release port
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
During rte_eth_dev_close execution, eth_dev_close function exported by ntnic is called, followed by a call to rte_eth_dev_release_port.
Since there is no possible returns between the calls, calling rte_eth_dev_release_port from eth_dev_close is redundant and error-prone.
---
v2
* Update release notes
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/ntnic_ethdev.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -102,6 +102,7 @@ New Features * Update supported version of the FPGA to 9563.55.49 * Fix Coverity issues + * Fix issues related to release 24.07 Removed Items -------------
drivers/net/ntnic/ntnic_ethdev.c +0 -1
@@ -383,7 +383,6 @@ eth_dev_close(struct rte_eth_dev *eth_dev) internals->p_drv =NULL ; -rte_eth_dev_release_port (eth_dev);if (p_drv) {/* decrease initialized ethernet devices */ p_drv->n_eth_dev_init_count--;
Signature · 1 line
2.45.0
PATCH v2 5/50 net/ntnic: extend and fix logging implementation
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Add suffixes logging
Fix the issue with the configuration log level for a specific module Fix extended debug logging
3-letter abbreviation for log type
Update documentation
new log modules were added
Log level in functions that initialize feature operations was updated from INFO to DEBUG to avoid noisy traces during driver startup.
log level for ops init was changed
nim and PMD modules was replaced with NTNIC
NIM module was replaced with NTNIC according to the ntnic log convention.
---
v2
* Update release notes
--- doc/guides/nics/ntnic.rst | 29 +++++++++ doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/nim/i2c_nim.c | 16 ++--- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 12 ++-- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 10 +-- drivers/net/ntnic/nthw/core/nthw_iic.c | 6 +- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 2 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 6 +- drivers/net/ntnic/ntlog/ntlog.c | 2 - drivers/net/ntnic/ntlog/ntlog.h | 63 +++++++++++++------ drivers/net/ntnic/ntnic_ethdev.c | 41 ++++++------ 12 files changed, 124 insertions(+), 66 deletions(-)
doc/guides/nics/ntnic.rst +29 -0
@@ -49,3 +49,32 @@ which is required for the PMD to use vfio-pci on the PF. This support has been back-ported to older Linux distributions and they are also supported. If vfio-pci is not required, kernel version 4.18 is supported. + + +Logging and Debugging +--------------------- + +NTNIC supports several groups of logging that can be enabled with ``--log-level`` +parameter: + +- NTNIC. + + Logging info from the main PMD code. i.e. code that is related to DPDK:: + + --log-level=pmd.net.ntnic.ntnic,8 + +- NTHW. + + Logging info from NTHW. i.e. code that is related to the FPGA and the Adapter:: + + --log-level=pmd.net.ntnic.nthw,8 + +- FILTER. + + Logging info from filter. i.e. code that is related to the binary filter:: + + --log-level=pmd.net.ntnic.filter,8 + +To enable logging on all levels use wildcard in the following way:: + + --log-level=pmd.net.ntnic.*,8
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -103,6 +103,7 @@ New Features * Update supported version of the FPGA to 9563.55.49 * Fix Coverity issues * Fix issues related to release 24.07 + * Extended and fixed the implementation of the logging Removed Items -------------
drivers/net/ntnic/nim/i2c_nim.c +8 -8
@@ -219,7 +219,7 @@ static int i2c_nim_common_construct(nim_i2c_ctx_p ctx) res =-1 ;if (res) { -NT_LOG (ERR ,PMD ,"Can't read NIM id." ); +NT_LOG (ERR ,NTNIC ,"Can't read NIM id." );return res; }
@@ -308,7 +308,7 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state)break ;default : -NT_LOG (INF ,NIM ,"nim_id = %u is not an QSFP/QSFP+/QSFP28 module\n" , ctx->nim_id); +NT_LOG (INF ,NTNIC ,"nim_id = %u is not an QSFP/QSFP+/QSFP28 module\n" , ctx->nim_id); res =-1 ; }
@@ -419,7 +419,7 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx) yes_no[ctx->avg_pwr]);qsfp_read_vendor_info (ctx); -NT_LOG (DBG ,PMD , +NT_LOG (DBG ,NTNIC ,"Instance %d: NIM info: (Vendor: %s, PN: %s, SN: %s, Date: %s, Rev: %s)\n" , ctx->instance, ctx->vendor_name, ctx->prod_no, ctx->serial_no, ctx->date, ctx->rev);
@@ -540,7 +540,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx) (read_byte (ctx, enh_options_reg_addr) >>2 ) &0x03 ;/* bit 3..2 */ if (rate_select_type !=2 ) { -NT_LOG (DBG ,PMD ,"NIM has unhandled rate select type (%d)" , rate_select_type); +NT_LOG (DBG ,NTNIC ,"NIM has unhandled rate select type (%d)" , rate_select_type);return false; }
@@ -548,7 +548,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx)read_byte (ctx, ext_rate_select_compl_reg_addr) &0x03 ;/* bit 1..0 */ if (ext_rate_select_ver !=0x02 ) { -NT_LOG (DBG ,PMD ,"NIM has unhandled extended rate select version (%d)" , +NT_LOG (DBG ,NTNIC ,"NIM has unhandled extended rate select version (%d)" , ext_rate_select_ver);return false; }
@@ -669,7 +669,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)*/ read_data_lin (ctx,1 ,sizeof (ctx->specific_u.qsfp.specific_u.qsfp28.rev_compliance), &ctx->specific_u.qsfp.specific_u.qsfp28.rev_compliance); -NT_LOG (DBG ,NTHW ,"NIM RevCompliance = %d" , +NT_LOG (DBG ,NTHW ,"NIM RevCompliance = %d\n" , ctx->specific_u.qsfp.specific_u.qsfp28.rev_compliance);/* Wait if lane_idx == -1 (all lanes are used) or lane_idx == 0 (the first lane) */
@@ -682,7 +682,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx) init_complete_flag_present = (data & (1 <<4 )) !=0 ; } -NT_LOG (DBG ,NTHW ,"NIM InitCompleteFlagPresent = %d" , init_complete_flag_present); +NT_LOG (DBG ,NTHW ,"NIM InitCompleteFlagPresent = %d\n" , init_complete_flag_present);/* * If the init complete flag is not present then wait 500ms that together with 500ms
@@ -708,7 +708,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)read_data_lin (ctx,6 ,sizeof (data), &data);if (data &0x01 ) { -NT_LOG (DBG ,NTHW ,"Module ready after %dms" , count *100 ); +NT_LOG (DBG ,NTHW ,"Module ready after %dms\n" , count *100 );break ; }
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
@@ -71,6 +71,6 @@ static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpgavoid nt200a0x_ops_init (void ) { -NT_LOG (INF ,NTHW ,"NT200A0X OPS INIT\n" ); +NT_LOG (DBG ,NTHW ,"NT200A0X OPS INIT\n" );register_nt200a0x_ops (&nt200a0x_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +6 -6
@@ -26,7 +26,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mn_fpga_version = n_fpga_version; p->mn_fpga_revision = n_fpga_revision; -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: FPGA reset setup: FPGA %04d-%02d-%02d\n" , p_adapter_id_str, +NT_LOG_DBGX (DBG ,NTHW ,"%s: FPGA reset setup: FPGA %04d-%02d-%02d\n" , p_adapter_id_str, n_fpga_product_id, n_fpga_version, n_fpga_revision); p_mod_rst =nthw_fpga_query_module (p_fpga,MOD_RST9563 ,0 );
@@ -212,7 +212,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res =nthw_fpga_rst9563_periph_reset (p_fpga);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res);return res; }
@@ -220,14 +220,14 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, n_si_labs_clock_synth_i2c_addr);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res);return res; } res =nthw_fpga_rst9563_setup (p_fpga, p_rst);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res);return res; }
@@ -235,7 +235,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res = rst_ops !=NULL ? rst_ops->nthw_fpga_rst_nt200a0x_reset (p_fpga, p_rst) :-1 ;if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res);return res; }
@@ -246,6 +246,6 @@ static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rsvoid rst9563_ops_init (void ) { -NT_LOG (INF ,NTHW ,"RST9563 OPS INIT\n" ); +NT_LOG (DBG ,NTHW ,"RST9563 OPS INIT\n" );register_rst9563_ops (&rst9563_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +5 -5
@@ -221,7 +221,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,int locked;int res =-1 ; -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: FPGA reset sequence: FPGA %04d-%02d-%02d @ HWId%d\n" , +NT_LOG_DBGX (DBG ,NTHW ,"%s: FPGA reset sequence: FPGA %04d-%02d-%02d @ HWId%d\n" , 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);
@@ -505,7 +505,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,nthw_field_clr_flush (p->mp_fld_power_pu_nseb);/* NSEB power down */ } -NT_LOG_DBGX (DEBUG ,NTHW ,"%s END\n" , p_adapter_id_str); +NT_LOG_DBGX (DBG ,NTHW ,"%s END\n" , p_adapter_id_str);return 0 ; }
@@ -523,7 +523,7 @@ static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info, p_fpga = p_fpga_info->mp_fpga; -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: RAB init/reset\n" , p_adapter_id_str); +NT_LOG_DBGX (DBG ,NTHW ,"%s: RAB init/reset\n" , p_adapter_id_str);nthw_rac_rab_reset (p_fpga_info->mp_nthw_rac);nthw_rac_rab_setup (p_fpga_info->mp_nthw_rac);
@@ -554,7 +554,7 @@ static int nthw_fpga_rst_nt200a0x_init(struct fpga_info_s *p_fpga_info, p_rst->mn_si_labs_clock_synth_model = n_si_labs_clock_synth_model; p_rst->mn_si_labs_clock_synth_i2c_addr = n_si_labs_clock_synth_i2c_addr; p_rst->mn_hw_id = p_fpga_info->nthw_hw_info.hw_id; -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: Si%04d @ 0x%02x\n" , p_adapter_id_str, +NT_LOG_DBGX (DBG ,NTHW ,"%s: Si%04d @ 0x%02x\n" , p_adapter_id_str, p_rst->mn_si_labs_clock_synth_model, p_rst->mn_si_labs_clock_synth_i2c_addr);return res;
@@ -568,6 +568,6 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_initvoid rst_nt200a0x_ops_init (void ) { -NT_LOG (INF ,NTHW ,"RST NT200A0X OPS INIT\n" ); +NT_LOG (DBG ,NTHW ,"RST NT200A0X OPS INIT\n" );register_rst_nt200a0x_ops (&rst_nt200a0x_ops); }
drivers/net/ntnic/nthw/core/nthw_iic.c +3 -3
@@ -422,11 +422,11 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintnthw_iic_reg_tx_fifo_write (p, *p_byte,0 ,1 );if (!nthw_iic_bus_ready (p)) { -NT_LOG_DBGX (WARNING ,NTHW ,"%s: warn: !busReady\n" , p_adapter_id_str); +NT_LOG_DBGX (WRN ,NTHW ,"%s: warn: !busReady\n" , p_adapter_id_str);while (true)if (nthw_iic_bus_ready (p)) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: info: busReady\n" , +NT_LOG_DBGX (DBG ,NTHW ,"%s: info: busReady\n" , p_adapter_id_str);break ; }
@@ -435,7 +435,7 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintreturn 0 ; }else { -NT_LOG_DBGX (WARNING ,NTHW ,"%s\n" , p_adapter_id_str); +NT_LOG_DBGX (WRN ,NTHW ,"%s\n" , p_adapter_id_str);return -1 ; } }
drivers/net/ntnic/nthw/core/nthw_pcie3.c +1 -1
@@ -250,7 +250,7 @@ int nthw_pcie3_get_stat_rate(nthw_pcie3_t *p, uint64_t *p_pci_rx_rate, uint64_tint nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p,struct nthw_hif_end_point_counters *epc) { -NT_LOG_DBGX (DEBUG ,NTHW ); +NT_LOG_DBGX (DBG ,NTHW );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,
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +3 -3
@@ -250,12 +250,12 @@ void nthw_fpga_mgr_log_dump(nthw_fpga_mgr_t *p) {int i; -NT_LOG_DBGX (DEBUG ,NTHW ,"fpgas=%d\n" , p->mn_fpgas); +NT_LOG_DBGX (DBG ,NTHW ,"fpgas=%d\n" , p->mn_fpgas);for (i =0 ; i < p->mn_fpgas; i++) {nthw_fpga_prod_init_s *p_init = p->mpa_fpga_prod_init[i]; (void )p_init; -NT_LOG_DBGX (DEBUG ,NTHW ,"fpga=%d/%d: %04d-%02d-%02d\n" , i, p->mn_fpgas, +NT_LOG_DBGX (DBG ,NTHW ,"fpga=%d/%d: %04d-%02d-%02d\n" , i, p->mn_fpgas, p_init->fpga_product_id, p_init->fpga_version, p_init->fpga_revision); } }
@@ -903,7 +903,7 @@ void nthw_field_init(nthw_field_t *p, nthw_register_t *p_reg, const nthw_fpga_fi p->mn_tail_mask = (1 << bits_remaining) -1 ;if (p->mn_debug_mode >=0x100 ) { - NT_LOG_DBGX(DEBUG, NTHW, + NT_LOG_DBGX(DBG, NTHW, "fldid=%08d: [%08d:%08d] %08d/%08d: (%08d,%08d) (0x%08X,%08d,0x%08X)\n", p_init->id, p_init->low, (p_init->low + p_init->bw), p_init->bw, ((p_init->bw + 31) / 32), p->mn_first_word,
drivers/net/ntnic/ntlog/ntlog.c +0 -2
@@ -16,8 +16,6 @@#define NTLOG_HELPER_STR_SIZE_MAX (1024) -RTE_LOG_REGISTER_DEFAULT(nt_logtype, NOTICE) -char *ntlog_helper_str_alloc (const char *sinit) {char *s =malloc (NTLOG_HELPER_STR_SIZE_MAX );
drivers/net/ntnic/ntlog/ntlog.h +44 -19
83 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +23 -18
137 lines not on this page · raw message
Signature · 1 line
2.45.0
Re: [PATCH v2 05/50] net/ntnic: extend and fix logging implementation
drivers/net/ntnic/nim/i2c_nim.c static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx) · line 686
Quoted 7 lines · Serhii Iliushyk
drivers/net/ntnic/nim/i2c_nim.c +1
-1@@ -682,7 +682,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx) init_complete_flag_present = (data & (1 <<4 )) !=0 ; } -NT_LOG (DBG ,NTHW ,"NIM InitCompleteFlagPresent = %d" , init_complete_flag_present); +NT_LOG (DBG ,NTHW ,"NIM InitCompleteFlagPresent = %d\n" , init_complete_flag_present);
There is a commit that standardizes not having '\n' [1], please follow the same.
[1]
https://git.dpdk.org/next/dpdk-next-net/commit/?id=f665790a5dbad7b645ff46f31d65e977324e7bfc
PATCH v2 6/50 net/ntnic: add flow filter init API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the initialization of the flow filter.
---
v2
* Update release notes
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 18 ++++++++++++++++++ drivers/net/ntnic/include/flow_api.h | 12 ++++++++++++ drivers/net/ntnic/include/nt4ga_adapter.h | 6 ++++++ drivers/net/ntnic/include/nt4ga_filter.h | 13 +++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 7 +++++++ drivers/net/ntnic/ntnic_mod_reg.h | 8 ++++++++ 7 files changed, 65 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_api.h create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -104,6 +104,7 @@ New Features * Fix Coverity issues * Fix issues related to release 24.07 * Extended and fixed the implementation of the logging + * Added NT flow filter init API Removed Items -------------
drivers/net/ntnic/adapter/nt4ga_adapter.c +18 -0
@@ -75,6 +75,11 @@ static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE *static int nt4ga_adapter_init (struct adapter_info_s *p_adapter_info) { +const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); + +if (flow_filter_ops ==NULL ) +NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized\n" , __func__); +char *const p_dev_name =malloc (24 );char *const p_adapter_id_str =malloc (24 );fpga_info_t *fpga_info = &p_adapter_info->fpga_info;
@@ -155,6 +160,19 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) n_nim_ports = fpga_info->n_nims;assert (n_nim_ports >=1 ); +/* Nt4ga Init Filter */ +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, + p_adapter_info->adapter_no); + +if (res !=0 ) { +NT_LOG (ERR ,NTNIC ,"%s: Cannot initialize filter\n" , p_adapter_id_str); +return res; + } + } + {int i;const struct link_ops_s *link_ops =NULL ;
drivers/net/ntnic/include/flow_api.h new file +12 -0
@@ -0,0 +1,12 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _FLOW_API_H_ +#define _FLOW_API_H_ + +/* registered NIC backends */ +struct flow_nic_dev ; + +#endif
drivers/net/ntnic/include/nt4ga_adapter.h +6 -0
@@ -23,7 +23,13 @@ typedef struct hw_info_s {int hw_reserved1; } hw_info_t; +/* +* Services provided by the adapter module +*/ +#include "nt4ga_filter.h" + typedef struct adapter_info_s { + struct nt4ga_filter_s nt4ga_filter; struct nt4ga_link_s nt4ga_link; struct hw_info_s hw_info;
drivers/net/ntnic/include/nt4ga_filter.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef NT4GA_FILTER_H_ +#define NT4GA_FILTER_H_ + +typedef struct nt4ga_filter_s { +struct flow_nic_dev *mp_flow_device; +}nt4ga_filter_t ; + +#endif /* NT4GA_FILTER_H_ */
drivers/net/ntnic/ntnic_mod_reg.c +7 -0
@@ -88,3 +88,10 @@ struct rst9563_ops *get_rst9563_ops(void)rst9563_ops_init ();return rst9563_ops; } + +static const struct flow_filter_ops *flow_filter_ops; + +const struct flow_filter_ops *get_flow_filter_ops (void ) +{ +return flow_filter_ops; +}
drivers/net/ntnic/ntnic_mod_reg.h +8 -0
@@ -7,6 +7,7 @@#define __NTNIC_MOD_REG_H__#include <stdint.h> +#include "flow_api.h" #include "nthw_fpga_model.h" #include "nthw_platform_drv.h" #include "nthw_drv.h"
@@ -117,4 +118,11 @@ void register_rst9563_ops(struct rst9563_ops *ops);struct rst9563_ops *get_rst9563_ops (void );void rst9563_ops_init (void ); +struct flow_filter_ops { +int (*flow_filter_init)(nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device, +int adapter_no); +}; + +const struct flow_filter_ops *get_flow_filter_ops (void ); +#endif /* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
PATCH v2 7/50 net/ntnic: add flow filter deinitialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the deinitialization of the flow filter.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 17 +++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 1 + 2 files changed, 18 insertions(+)
drivers/net/ntnic/adapter/nt4ga_adapter.c +17 -0
@@ -217,12 +217,29 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)static int nt4ga_adapter_deinit (struct adapter_info_s *p_adapter_info) { +const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); + +if (flow_filter_ops ==NULL ) +NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized\n" , __func__); +fpga_info_t *fpga_info = &p_adapter_info->fpga_info;int i;int res =-1 ;stop_monitor_tasks (-1 ); +/* Nt4ga Deinit Filter */ +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); + +if (res !=0 ) { +NT_LOG (ERR ,NTNIC ,"Cannot deinitialize filter\n" ); +return res; + } + } +nthw_fpga_shutdown (&p_adapter_info->fpga_info);/* Rac rab reset flip flop */
drivers/net/ntnic/ntnic_mod_reg.h +1 -0
@@ -121,6 +121,7 @@ void rst9563_ops_init(void);struct flow_filter_ops {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); };const struct flow_filter_ops *get_flow_filter_ops (void );
Signature · 1 line
2.45.0
PATCH v2 8/50 net/ntnic: add flow backend initialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the initialization of the backend.
---
v2
* Update release notes
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/include/flow_api.h | 2 ++ drivers/net/ntnic/include/flow_filter.h | 14 ++++++++++ drivers/net/ntnic/meson.build | 2 ++ drivers/net/ntnic/nthw/flow_api/flow_api.c | 17 ++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_filter.c | 27 +++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 15 +++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 9 +++++++ 8 files changed, 87 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_filter.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -105,6 +105,7 @@ New Features * Fix issues related to release 24.07 * Extended and fixed the implementation of the logging * Added NT flow filter init API + * Added NT flow backend initialization API Removed Items -------------
drivers/net/ntnic/include/flow_api.h +2 -0
@@ -6,6 +6,8 @@#ifndef _FLOW_API_H_#define _FLOW_API_H_ +#include "ntlog.h" +/* registered NIC backends */ struct flow_nic_dev ;
drivers/net/ntnic/include/flow_filter.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __FLOW_FILTER_HPP__ +#define __FLOW_FILTER_HPP__ + +#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); + +#endif /* __FLOW_FILTER_HPP__ */
drivers/net/ntnic/meson.build +2 -0
@@ -42,6 +42,8 @@ sources = files( 'nthw/core/nthw_pcie3.c', 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', + 'nthw/flow_api/flow_api.c', + 'nthw/flow_api/flow_filter.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c new file +17 -0
@@ -0,0 +1,17 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include "ntnic_mod_reg.h" + +#include "flow_filter.h" + +static const struct flow_filter_ops ops = { + .flow_filter_init = flow_filter_init, +}; + +void init_flow_filter (void ) +{ +register_flow_filter_ops (&ops); +}
drivers/net/ntnic/nthw/flow_api/flow_filter.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include "flow_filter.h" +#include "ntnic_mod_reg.h" + +int flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no) +{ + (void )p_flow_device; + (void )adapter_no; + +void *be_dev =NULL ; + +const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); + +if (flow_backend_ops ==NULL ) { +NT_LOG (ERR ,FILTER ,"%s: flow_backend module uninitialized\n" , __func__); +return -1 ; + } + +NT_LOG (DBG ,FILTER ,"Initializing flow filter api\n" ); + flow_backend_ops->bin_flow_backend_init (p_fpga, &be_dev); + +return 0 ; +}
drivers/net/ntnic/ntnic_mod_reg.c +15 -0
@@ -89,9 +89,24 @@ struct rst9563_ops *get_rst9563_ops(void)return rst9563_ops; } +static const struct flow_backend_ops *flow_backend_ops; + +const struct flow_backend_ops *get_flow_backend_ops (void ) +{ +return flow_backend_ops; +} +static const struct flow_filter_ops *flow_filter_ops; +void register_flow_filter_ops (const struct flow_filter_ops *ops) +{ + flow_filter_ops = ops; +} +const struct flow_filter_ops *get_flow_filter_ops (void ) { +if (flow_filter_ops ==NULL ) +init_flow_filter (); +return flow_filter_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +9 -0
@@ -118,12 +118,21 @@ void register_rst9563_ops(struct rst9563_ops *ops);struct rst9563_ops *get_rst9563_ops (void );void rst9563_ops_init (void ); +struct flow_backend_ops { +const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga, +void **be_dev); +}; + +const struct flow_backend_ops *get_flow_backend_ops (void ); +struct flow_filter_ops {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); }; +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 );#endif /* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
PATCH v2 9/50 net/ntnic: add flow backend deinitialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the deinitialization of the backend.
--- drivers/net/ntnic/include/flow_api.h | 7 ++++++- drivers/net/ntnic/include/flow_filter.h | 1 + drivers/net/ntnic/include/hw_mod_backend.h | 13 ++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_api.c | 12 +++++++++++ .../ntnic/nthw/flow_api/flow_api_nic_setup.h | 14 +++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_filter.c | 21 +++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 1 + 7 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/include/hw_mod_backend.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h
drivers/net/ntnic/include/flow_api.h +6 -1
@@ -8,7 +8,12 @@#include "ntlog.h" +#include "hw_mod_backend.h" +/* registered NIC backends */ -struct flow_nic_dev ; +struct flow_nic_dev { +/* NIC backend API */ +struct flow_api_backend_s be; +};#endif
drivers/net/ntnic/include/flow_filter.h +1 -0
@@ -10,5 +10,6 @@#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);#endif /* __FLOW_FILTER_HPP__ */
drivers/net/ntnic/include/hw_mod_backend.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _HW_MOD_BACKEND_H_ +#define _HW_MOD_BACKEND_H_ + +struct flow_api_backend_s { +void *be_dev; +}; + +#endif /* _HW_MOD_BACKEND_H_ */
drivers/net/ntnic/nthw/flow_api/flow_api.c +12 -0
@@ -3,12 +3,24 @@* Copyright(c) 2023 Napatech A/S */ +#include "flow_api_nic_setup.h" #include "ntnic_mod_reg.h" #include "flow_filter.h" +void *flow_api_get_be_dev (struct flow_nic_dev *ndev) +{ +if (!ndev) { +NT_LOG (DBG ,FILTER ,"ERR: %s\n" , __func__); +return NULL ; + } + +return ndev->be.be_dev; +} +static const struct flow_filter_ops ops = { .flow_filter_init = flow_filter_init, + .flow_filter_done = flow_filter_done, };void init_flow_filter (void )
drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __FLOW_API_NIC_SETUP_H__ +#define __FLOW_API_NIC_SETUP_H__ + +#include "hw_mod_backend.h" +#include "flow_api.h" + +void *flow_api_get_be_dev (struct flow_nic_dev *dev); + +#endif /* __FLOW_API_NIC_SETUP_H__ */
drivers/net/ntnic/nthw/flow_api/flow_filter.c +21 -0
@@ -5,6 +5,7 @@#include "flow_filter.h" #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) {
@@ -25,3 +26,23 @@ 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) +{ +void *be_dev =flow_api_get_be_dev (dev); + +int res =0 ; + +if (be_dev) { +const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); + +if (flow_backend_ops ==NULL ) { +NT_LOG (WRN ,FILTER ,"%s: flow_backend module uninitialized\n" , __func__); +return res; + } + + flow_backend_ops->bin_flow_backend_done (be_dev); + } + +return res; +}
drivers/net/ntnic/ntnic_mod_reg.h +1 -0
@@ -121,6 +121,7 @@ void rst9563_ops_init(void);struct flow_backend_ops {const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga,void **be_dev); +void (*bin_flow_backend_done)(void *be_dev); };const struct flow_backend_ops *get_flow_backend_ops (void );
Signature · 1 line
2.45.0
PATCH v2 10/50 net/ntnic: add INFO flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The info module keeps track of the hardcoded parameters of the FPGA and provides an abstraction that can support if parameter is unsupported for a given FPGA.
--- drivers/net/ntnic/include/hw_mod_backend.h | 57 +++ drivers/net/ntnic/meson.build | 3 + .../nthw/flow_api/flow_backend/flow_backend.c | 384 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_info.c | 341 ++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_info.h | 110 +++++ drivers/net/ntnic/nthw/nthw_drv.h | 2 + drivers/net/ntnic/nthw/nthw_helper.h | 11 + drivers/net/ntnic/ntnic_mod_reg.c | 8 + drivers/net/ntnic/ntnic_mod_reg.h | 2 + drivers/net/ntnic/ntutil/nt_util.h | 5 + 10 files changed, 923 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h create mode 100644 drivers/net/ntnic/nthw/nthw_helper.h
drivers/net/ntnic/include/hw_mod_backend.h +57 -0
@@ -6,6 +6,63 @@#ifndef _HW_MOD_BACKEND_H_#define _HW_MOD_BACKEND_H_ +#define MAX_PHYS_ADAPTERS 8 + +enum debug_mode_e { +FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 , +FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001 +}; + +struct flow_api_backend_ops { +int version; +int (*set_debug_mode)(void *dev,enum debug_mode_e mode); +int (*get_nb_phy_port)(void *dev); +int (*get_nb_rx_port)(void *dev); +int (*get_ltx_avail)(void *dev); +int (*get_nb_cat_funcs)(void *dev); +int (*get_nb_categories)(void *dev); +int (*get_nb_cat_km_if_cnt)(void *dev); +int (*get_nb_cat_km_if_m0)(void *dev); +int (*get_nb_cat_km_if_m1)(void *dev); + +int (*get_nb_queues)(void *dev); +int (*get_nb_km_flow_types)(void *dev); +int (*get_nb_pm_ext)(void *dev); +int (*get_nb_len)(void *dev); +int (*get_kcc_size)(void *dev); +int (*get_kcc_banks)(void *dev); +int (*get_nb_km_categories)(void *dev); +int (*get_nb_km_cam_banks)(void *dev); +int (*get_nb_km_cam_record_words)(void *dev); +int (*get_nb_km_cam_records)(void *dev); +int (*get_nb_km_tcam_banks)(void *dev); +int (*get_nb_km_tcam_bank_width)(void *dev); +int (*get_nb_flm_categories)(void *dev); +int (*get_nb_flm_size_mb)(void *dev); +int (*get_nb_flm_entry_size)(void *dev); +int (*get_nb_flm_variant)(void *dev); +int (*get_nb_flm_prios)(void *dev); +int (*get_nb_flm_pst_profiles)(void *dev); +int (*get_nb_flm_scrub_profiles)(void *dev); +int (*get_nb_flm_load_aps_max)(void *dev); +int (*get_nb_qsl_categories)(void *dev); +int (*get_nb_qsl_qst_entries)(void *dev); +int (*get_nb_pdb_categories)(void *dev); +int (*get_nb_roa_categories)(void *dev); +int (*get_nb_tpe_categories)(void *dev); +int (*get_nb_tx_cpy_writers)(void *dev); +int (*get_nb_tx_cpy_mask_mem)(void *dev); +int (*get_nb_tx_rpl_depth)(void *dev); +int (*get_nb_tx_rpl_ext_categories)(void *dev); +int (*get_nb_tpe_ifr_categories)(void *dev); +int (*get_nb_rpp_per_ps)(void *dev); +int (*get_nb_hsh_categories)(void *dev); +int (*get_nb_hsh_toeplitz)(void *dev); + +int (*alloc_rx_queue)(void *dev,int queue_id); +int (*free_rx_queue)(void *dev,int hw_queue); +}; +struct flow_api_backend_s {void *be_dev; };
drivers/net/ntnic/meson.build +3 -0
@@ -17,6 +17,7 @@ includes = [ include_directories('nthw'), include_directories('nthw/supported'), include_directories('nthw/model'), + include_directories('nthw/flow_filter'), include_directories('nim/'), ]
@@ -43,7 +44,9 @@ sources = files( 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', 'nthw/flow_api/flow_api.c', + 'nthw/flow_api/flow_backend/flow_backend.c', 'nthw/flow_api/flow_filter.c', + 'nthw/flow_filter/flow_nthw_info.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c new file +384 -0
384 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c new file +341 -0
341 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h new file +110 -0
110 lines not on this page · raw message
drivers/net/ntnic/nthw/nthw_drv.h +2 -0
@@ -14,6 +14,8 @@ typedef enum nt_meta_port_type_e {PORT_TYPE_OVERRIDE , } nt_meta_port_type_t; +#include "nthw_helper.h" +enum fpga_info_profile {FPGA_INFO_PROFILE_UNKNOWN =0 , FPGA_INFO_PROFILE_VSWITCH = 1,
drivers/net/ntnic/nthw/nthw_helper.h new file +11 -0
@@ -0,0 +1,11 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __NTHW_HELPER_H__ +#define __NTHW_HELPER_H__ + +#include <assert.h> + +#endif /* __NTHW_HELPER_H__ */
drivers/net/ntnic/ntnic_mod_reg.c +8 -0
@@ -91,8 +91,16 @@ struct rst9563_ops *get_rst9563_ops(void)static const struct flow_backend_ops *flow_backend_ops; +void register_flow_backend_ops (const struct flow_backend_ops *ops) +{ + flow_backend_ops = ops; +} +const struct flow_backend_ops *get_flow_backend_ops (void ) { +if (flow_backend_ops ==NULL ) +flow_backend_init (); +return flow_backend_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +2 -0
@@ -124,7 +124,9 @@ struct flow_backend_ops {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 );struct flow_filter_ops { int (*flow_filter_init)(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device,
drivers/net/ntnic/ntutil/nt_util.h +5 -0
@@ -23,6 +23,11 @@uint64_t nt_os_get_time_monotonic_counter (void );void nt_os_wait_usec (int val); +static inline int min (int a,int b) +{ +return (a < b) ? a : b; +} +uint64_t nt_util_align_size (uint64_t size);struct nt_dma_s {
Signature · 1 line
2.45.0
PATCH v2 11/50 net/ntnic: add categorizer (CAT) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Categorizer module’s main purpose is to select the behavior of other modules in the FPGA pipeline, depending on a protocol check.
--- drivers/net/ntnic/include/hw_mod_backend.h | 51 + drivers/net/ntnic/include/hw_mod_cat_v18.h | 141 +++ drivers/net/ntnic/include/hw_mod_cat_v21.h | 91 ++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 465 ++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 872 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_cat.h | 291 ++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_cat.h | 238 +++++ 10 files changed, 2152 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v18.h create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v21.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cat.h
drivers/net/ntnic/include/hw_mod_backend.h +51 -0
@@ -6,8 +6,40 @@#ifndef _HW_MOD_BACKEND_H_#define _HW_MOD_BACKEND_H_ +#include <stdbool.h> + +#include "hw_mod_cat_v18.h" +#include "hw_mod_cat_v21.h" +#define MAX_PHYS_ADAPTERS 8 +#define COMMON_FUNC_INFO_S \ + int ver; \ + void *base; \ + unsigned int alloced_size; \ + int debug + +struct cat_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_cat_funcs; +uint32_t nb_flow_types; +uint32_t nb_pm_ext; +uint32_t nb_len; +uint32_t kcc_size; +uint32_t cts_num; +uint32_t kcc_banks; +uint32_t kcc_id_bit_size; +uint32_t kcc_records; +uint32_t km_if_count; +int32_t km_if_m0; +int32_t km_if_m1; + +union { +struct hw_mod_cat_v18_s v18; +struct hw_mod_cat_v21_s v21; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 , FLOW_BACKEND_DEBUG_MODE_WRITE = 0x0001
@@ -61,6 +93,25 @@ struct flow_api_backend_ops {int (*alloc_rx_queue)(void *dev,int queue_id);int (*free_rx_queue)(void *dev,int hw_queue); + +/* CAT */ +bool (*get_cat_present)(void *dev); +uint32_t (*get_cat_version)(void *dev); +int (*cat_cfn_flush)(void *dev,const struct cat_func_s *cat,int cat_func,int cnt); +int (*cat_kce_flush)(void *dev,const struct cat_func_s *cat,int km_if_idx,int index, +int cnt); +int (*cat_kcs_flush)(void *dev,const struct cat_func_s *cat,int km_if_idx,int cat_func, +int cnt); +int (*cat_fte_flush)(void *dev,const struct cat_func_s *cat,int km_if_idx,int index, +int cnt); +int (*cat_cte_flush)(void *dev,const struct cat_func_s *cat,int cat_func,int cnt); +int (*cat_cts_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); +int (*cat_cot_flush)(void *dev,const struct cat_func_s *cat,int cat_func,int cnt); +int (*cat_cct_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); +int (*cat_exo_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); +int (*cat_rck_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); +int (*cat_len_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); +int (*cat_kcc_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_cat_v18.h new file +141 -0
141 lines not on this page · raw message
drivers/net/ntnic/include/hw_mod_cat_v21.h new file +91 -0
91 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -46,6 +46,7 @@ sources = files( 'nthw/flow_api/flow_api.c', 'nthw/flow_api/flow_backend/flow_backend.c', 'nthw/flow_api/flow_filter.c', + 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +465 -0
503 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c new file +872 -0
872 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h new file +291 -0
291 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -14,6 +14,7 @@#define _NTHW_FPGA_MOD_DEFS_H_#define MOD_UNKNOWN (0L)/* Unknown/uninitialized - keep this as the first element */ +#define MOD_CAT (0x30b447c2UL)#define MOD_GFG (0xfc423807UL)#define MOD_GMF (0x68b1d15aUL)#define MOD_GPIO_PHY (0xbbe81659UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -13,6 +13,7 @@#ifndef _NTHW_FPGA_REG_DEFS_#define _NTHW_FPGA_REG_DEFS_ +#include "nthw_fpga_reg_defs_cat.h" #include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h" #include "nthw_fpga_reg_defs_gpio_phy.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cat.h new file +238 -0
238 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 12/50 net/ntnic: add key match (KM) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Key Matcher module checks the values of individual fields of a packet. It supports both exact match which is implemented with a CAM, and wildcards which is implemented with a TCAM.
--- drivers/net/ntnic/include/hw_mod_backend.h | 28 + drivers/net/ntnic/include/hw_mod_km_v7.h | 96 +++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 206 ++++++ .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 610 ++++++++++++++++++ .../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 214 ++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_km.h | 126 ++++ 9 files changed, 1283 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_km_v7.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_km.h
drivers/net/ntnic/include/hw_mod_backend.h +28 -0
@@ -10,6 +10,7 @@#include "hw_mod_cat_v18.h" #include "hw_mod_cat_v21.h" +#include "hw_mod_km_v7.h" #define MAX_PHYS_ADAPTERS 8
@@ -40,6 +41,23 @@ struct cat_func_s { }; }; +struct km_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_categories; +uint32_t nb_cam_banks; +uint32_t nb_cam_record_words; +uint32_t nb_cam_records; +uint32_t nb_tcam_banks; +uint32_t nb_tcam_bank_width; +/* not read from backend, but rather set using version */ +uint32_t nb_km_rcp_mask_a_word_size; +/* --- || --- */ +uint32_t nb_km_rcp_mask_b_word_size; +union { +struct hw_mod_km_v7_s v7; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -112,6 +130,16 @@ struct flow_api_backend_ops {int (*cat_rck_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt);int (*cat_len_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt);int (*cat_kcc_flush)(void *dev,const struct cat_func_s *cat,int index,int cnt); + +/* KM */ +bool (*get_km_present)(void *dev); +uint32_t (*get_km_version)(void *dev); +int (*km_rcp_flush)(void *dev,const struct km_func_s *km,int category,int cnt); +int (*km_cam_flush)(void *dev,const struct km_func_s *km,int bank,int record,int cnt); +int (*km_tcam_flush)(void *dev,const struct km_func_s *km,int bank,int byte,int value, +int cnt); +int (*km_tci_flush)(void *dev,const struct km_func_s *km,int bank,int record,int cnt); +int (*km_tcq_flush)(void *dev,const struct km_func_s *km,int bank,int record,int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_km_v7.h new file +96 -0
96 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -48,6 +48,7 @@ sources = files( 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_info.c', + 'nthw/flow_filter/flow_nthw_km.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +206 -0
242 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c new file +610 -0
610 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h new file +214 -0
214 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -21,6 +21,7 @@#define MOD_HIF (0x7815363UL)#define MOD_I2CM (0x93bc7780UL)#define MOD_IIC (0x7629cddbUL) +#define MOD_KM (0xcfbd9dbeUL)#define MOD_MAC_PCS (0x7abe24c7UL)#define MOD_PCIE3 (0xfbc48c18UL)#define MOD_PCI_RD_TG (0x9ad9eed2UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -20,6 +20,7 @@#include "nthw_fpga_reg_defs_hif.h" #include "nthw_fpga_reg_defs_i2cm.h" #include "nthw_fpga_reg_defs_iic.h" +#include "nthw_fpga_reg_defs_km.h" #include "nthw_fpga_reg_defs_mac_pcs.h" #include "nthw_fpga_reg_defs_pcie3.h" #include "nthw_fpga_reg_defs_pci_rd_tg.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_km.h new file +126 -0
126 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 13/50 net/ntnic: add flow matcher (FLM) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Flow Matcher module is a high-performance stateful SDRAM lookup and programming engine which supported exact match lookup in line-rate of up to hundreds of millions of flows.
--- drivers/net/ntnic/include/hw_mod_backend.h | 40 + drivers/net/ntnic/include/hw_mod_flm_v25.h | 342 +++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 378 +++++ .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 1225 +++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_flm.h | 433 ++++++ drivers/net/ntnic/nthw/nthw_rac.c | 181 +++ drivers/net/ntnic/nthw/nthw_rac.h | 9 + .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_flm.h | 242 ++++ drivers/net/ntnic/ntutil/nt_util.c | 6 + drivers/net/ntnic/ntutil/nt_util.h | 1 + 13 files changed, 2860 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_flm_v25.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_flm.h
drivers/net/ntnic/include/hw_mod_backend.h +40 -0
@@ -10,6 +10,7 @@#include "hw_mod_cat_v18.h" #include "hw_mod_cat_v21.h" +#include "hw_mod_flm_v25.h" #include "hw_mod_km_v7.h" #define MAX_PHYS_ADAPTERS 8
@@ -58,6 +59,22 @@ struct km_func_s { }; }; +struct flm_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_categories; +uint32_t nb_size_mb; +uint32_t nb_entry_size; +uint32_t nb_variant; +uint32_t nb_prios; +uint32_t nb_pst_profiles; +uint32_t nb_scrub_profiles; +uint32_t nb_rpp_clock_in_ps; +uint32_t nb_load_aps_max; +union { +struct hw_mod_flm_v25_s v25; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -140,6 +157,29 @@ struct flow_api_backend_ops { int cnt);int (*km_tci_flush)(void *dev,const struct km_func_s *km,int bank,int record,int cnt);int (*km_tcq_flush)(void *dev,const struct km_func_s *km,int bank,int record,int cnt); + +/* FLM */ +bool (*get_flm_present)(void *dev); +uint32_t (*get_flm_version)(void *dev); +int (*flm_control_flush)(void *dev,const struct flm_func_s *flm); +int (*flm_status_flush)(void *dev,const struct flm_func_s *flm); +int (*flm_status_update)(void *dev,const struct flm_func_s *flm); +int (*flm_scan_flush)(void *dev,const struct flm_func_s *flm); +int (*flm_load_bin_flush)(void *dev,const struct flm_func_s *flm); +int (*flm_prio_flush)(void *dev,const struct flm_func_s *flm); +int (*flm_pst_flush)(void *dev,const struct flm_func_s *flm,int index,int cnt); +int (*flm_rcp_flush)(void *dev,const struct flm_func_s *flm,int index,int cnt); +int (*flm_scrub_flush)(void *dev,const struct flm_func_s *flm,int index,int cnt); +int (*flm_buf_ctrl_update)(void *dev,const struct flm_func_s *flm); +int (*flm_stat_update)(void *dev,const struct flm_func_s *flm); +int (*flm_lrn_data_flush)(void *be_dev,const struct flm_func_s *flm, +const uint32_t *lrn_data,uint32_t records, +uint32_t *handled_records,uint32_t words_per_record, +uint32_t *inf_word_cnt,uint32_t *sta_word_cnt); +int (*flm_inf_sta_data_update)(void *be_dev,const struct flm_func_s *flm, +uint32_t *inf_data,uint32_t inf_size, +uint32_t *inf_word_cnt,uint32_t *sta_data, +uint32_t sta_size,uint32_t *sta_word_cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_flm_v25.h new file +342 -0
342 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -47,6 +47,7 @@ sources = files( 'nthw/flow_api/flow_backend/flow_backend.c', 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', + 'nthw/flow_filter/flow_nthw_flm.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c', 'nthw/model/nthw_fpga_model.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +378 -0
414 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c new file +1225 -0
1,225 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h new file +433 -0
433 lines not on this page · raw message
drivers/net/ntnic/nthw/nthw_rac.c +181 -0
193 lines not on this page · raw message
drivers/net/ntnic/nthw/nthw_rac.h +9 -0
@@ -140,11 +140,20 @@ int nthw_rac_rab_reset(nthw_rac_t *p);int nthw_rac_rab_write32 (nthw_rac_t *p,bool trc,nthw_rab_bus_id_t bus_id,uint32_t address,uint32_t word_cnt,const uint32_t *p_data); +int nthw_rac_rab_write32_dma (nthw_rac_t *p,nthw_rab_bus_id_t bus_id,uint32_t address, +uint32_t word_cnt,const uint32_t *p_data);int nthw_rac_rab_read32 (nthw_rac_t *p,bool trc,nthw_rab_bus_id_t bus_id,uint32_t address,uint32_t word_cnt,uint32_t *p_data); +int nthw_rac_rab_read32_dma (nthw_rac_t *p,nthw_rab_bus_id_t bus_id,uint32_t address, +uint32_t word_cnt,struct dma_buf_ptr *buf_ptr); + +uint32_t nthw_rac_rab_get_free (nthw_rac_t *p);int nthw_rac_rab_flush (nthw_rac_t *p); +int nthw_rac_rab_dma_begin (nthw_rac_t *p); +int nthw_rac_rab_dma_commit (nthw_rac_t *p); +void nthw_rac_bar0_read32 (const struct fpga_info_s *p_fpga_info,uint32_t reg_addr,uint32_t word_cnt,uint32_t *p_data); void nthw_rac_bar0_write32(const struct fpga_info_s *p_fpga_info, uint32_t reg_addr,
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -15,6 +15,7 @@#define MOD_UNKNOWN (0L)/* Unknown/uninitialized - keep this as the first element */ #define MOD_CAT (0x30b447c2UL) +#define MOD_FLM (0xe7ba53a4UL)#define MOD_GFG (0xfc423807UL)#define MOD_GMF (0x68b1d15aUL)#define MOD_GPIO_PHY (0xbbe81659UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -14,6 +14,7 @@#define _NTHW_FPGA_REG_DEFS_#include "nthw_fpga_reg_defs_cat.h" +#include "nthw_fpga_reg_defs_flm.h" #include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h" #include "nthw_fpga_reg_defs_gpio_phy.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_flm.h new file +242 -0
242 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_util.c +6 -0
@@ -23,6 +23,12 @@ void nt_os_wait_usec(int val)rte_delay_us_sleep (val); } +/* spins in a waiting loop calling pause asm instruction uses RDTSC - precise wait */ +void nt_os_wait_usec_poll (int val) +{ +rte_delay_us (val); +} +uint64_t nt_os_get_time_monotonic_counter (void ) {return rte_get_timer_cycles ();
drivers/net/ntnic/ntutil/nt_util.h +1 -0
@@ -22,6 +22,7 @@uint64_t nt_os_get_time_monotonic_counter (void );void nt_os_wait_usec (int val); +void nt_os_wait_usec_poll (int val);static inline int min (int a,int b) {
Signature · 1 line
2.45.0
PATCH v2 14/50 net/ntnic: add IP fragmenter (IFR) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The IP Fragmenter module can fragment outgoing packets based on a programmable MTU.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 12 ++++ .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 68 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 43 ++++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_ifr.h | 42 ++++++++++++ 7 files changed, 168 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ifr.h
drivers/net/ntnic/meson.build +1 -0
@@ -48,6 +48,7 @@ sources = files( 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_flm.c', + 'nthw/flow_filter/flow_nthw_ifr.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c', 'nthw/model/nthw_fpga_model.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +12 -0
@@ -6,6 +6,7 @@#include <stdint.h> #include "flow_nthw_info.h" +#include "flow_nthw_ifr.h" #include "flow_nthw_cat.h" #include "flow_nthw_km.h" #include "flow_nthw_flm.h"
@@ -27,6 +28,7 @@ static struct backend_dev_s {struct cat_nthw *p_cat_nthw;struct km_nthw *p_km_nthw;struct flm_nthw *p_flm_nthw; +struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];#define CHECK_DEBUG_ON (be, mod, inst) \
@@ -1407,6 +1409,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_flm_nthw =NULL ; } +/* Init nthw IFR */ +if (ifr_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct ifr_nthw *ifrnthw =ifr_nthw_new (); +ifr_nthw_init (ifrnthw, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_ifr_nthw = ifrnthw; + + }else { + be_devs[physical_adapter_no].p_ifr_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c new file +68 -0
68 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h new file +43 -0
43 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -21,6 +21,7 @@#define MOD_GPIO_PHY (0xbbe81659UL)#define MOD_HIF (0x7815363UL)#define MOD_I2CM (0x93bc7780UL) +#define MOD_IFR (0x9b01f1e6UL)#define MOD_IIC (0x7629cddbUL)#define MOD_KM (0xcfbd9dbeUL)#define MOD_MAC_PCS (0x7abe24c7UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -20,6 +20,7 @@#include "nthw_fpga_reg_defs_gpio_phy.h" #include "nthw_fpga_reg_defs_hif.h" #include "nthw_fpga_reg_defs_i2cm.h" +#include "nthw_fpga_reg_defs_ifr.h" #include "nthw_fpga_reg_defs_iic.h" #include "nthw_fpga_reg_defs_km.h" #include "nthw_fpga_reg_defs_mac_pcs.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ifr.h new file +42 -0
42 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 15/50 net/ntnic: add hasher (HSH) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Hasher module calculates a configurable hash value to be used internally by the FPGA.
The module support both Toeplitz and NT-hash.
--- drivers/net/ntnic/include/hw_mod_backend.h | 16 ++ drivers/net/ntnic/include/hw_mod_hsh_v5.h | 46 ++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 80 ++++++ .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 260 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 87 ++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_hsh.h | 50 ++++ 9 files changed, 542 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_hsh_v5.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hsh.h
drivers/net/ntnic/include/hw_mod_backend.h +16 -0
@@ -12,6 +12,7 @@#include "hw_mod_cat_v21.h" #include "hw_mod_flm_v25.h" #include "hw_mod_km_v7.h" +#include "hw_mod_hsh_v5.h" #define MAX_PHYS_ADAPTERS 8
@@ -75,6 +76,16 @@ struct flm_func_s { }; }; +struct hsh_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_rcp;/* number of HSH recipes supported by FPGA */ +/* indication if Toeplitz is supported by FPGA, i.e. 0 - unsupported, 1 - supported */ +uint32_t toeplitz; +union { +struct hw_mod_hsh_v5_s v5; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -180,6 +191,11 @@ struct flow_api_backend_ops { uint32_t *inf_data, uint32_t inf_size, uint32_t *inf_word_cnt, uint32_t *sta_data, uint32_t sta_size, uint32_t *sta_word_cnt); + +/* HSH */ +bool (*get_hsh_present)(void *dev); +uint32_t (*get_hsh_version)(void *dev); +int (*hsh_rcp_flush)(void *dev,const struct hsh_func_s *hsh,int category,int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_hsh_v5.h new file +46 -0
46 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -48,6 +48,7 @@ sources = files( 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_flm.c', + 'nthw/flow_filter/flow_nthw_hsh.c', 'nthw/flow_filter/flow_nthw_ifr.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +80 -0
116 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c new file +260 -0
260 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h new file +87 -0
87 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -20,6 +20,7 @@#define MOD_GMF (0x68b1d15aUL)#define MOD_GPIO_PHY (0xbbe81659UL)#define MOD_HIF (0x7815363UL) +#define MOD_HSH (0x501484bfUL)#define MOD_I2CM (0x93bc7780UL)#define MOD_IFR (0x9b01f1e6UL)#define MOD_IIC (0x7629cddbUL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -19,6 +19,7 @@#include "nthw_fpga_reg_defs_gmf.h" #include "nthw_fpga_reg_defs_gpio_phy.h" #include "nthw_fpga_reg_defs_hif.h" +#include "nthw_fpga_reg_defs_hsh.h" #include "nthw_fpga_reg_defs_i2cm.h" #include "nthw_fpga_reg_defs_ifr.h" #include "nthw_fpga_reg_defs_iic.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hsh.h new file +50 -0
50 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 16/50 net/ntnic: add queue select (QSL) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Queue Selector module directs packets to a given destination which includes host queues, physical ports, exceptions paths, and discard.
--- drivers/net/ntnic/include/hw_mod_backend.h | 18 ++ drivers/net/ntnic/include/hw_mod_qsl_v7.h | 48 +++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 129 ++++++++ .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 295 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 113 +++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_qsl.h | 66 ++++ 9 files changed, 672 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_qsl_v7.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_qsl.h
drivers/net/ntnic/include/hw_mod_backend.h +18 -0
@@ -12,6 +12,7 @@#include "hw_mod_cat_v21.h" #include "hw_mod_flm_v25.h" #include "hw_mod_km_v7.h" +#include "hw_mod_qsl_v7.h" #include "hw_mod_hsh_v5.h" #define MAX_PHYS_ADAPTERS 8
@@ -86,6 +87,15 @@ struct hsh_func_s { }; }; +struct qsl_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_rcp_categories; +uint32_t nb_qst_entries; +union { +struct hw_mod_qsl_v7_s v7; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -196,6 +206,14 @@ struct flow_api_backend_ops {bool (*get_hsh_present)(void *dev);uint32_t (*get_hsh_version)(void *dev);int (*hsh_rcp_flush)(void *dev,const struct hsh_func_s *hsh,int category,int cnt); + +/* QSL */ +bool (*get_qsl_present)(void *dev); +uint32_t (*get_qsl_version)(void *dev); +int (*qsl_rcp_flush)(void *dev,const struct qsl_func_s *qsl,int category,int cnt); +int (*qsl_qst_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt); +int (*qsl_qen_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt); +int (*qsl_unmq_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_qsl_v7.h new file +48 -0
48 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -52,6 +52,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_ifr.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c', + 'nthw/flow_filter/flow_nthw_qsl.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +129 -0
165 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c new file +295 -0
295 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h new file +113 -0
113 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -29,6 +29,7 @@#define MOD_PCIE3 (0xfbc48c18UL)#define MOD_PCI_RD_TG (0x9ad9eed2UL)#define MOD_PCI_WR_TG (0x274b69e1UL) +#define MOD_QSL (0x448ed859UL)#define MOD_RAC (0xae830b42UL)#define MOD_RST9563 (0x385d6d1dUL)#define MOD_SDC (0xd2369530UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -28,6 +28,7 @@#include "nthw_fpga_reg_defs_pcie3.h" #include "nthw_fpga_reg_defs_pci_rd_tg.h" #include "nthw_fpga_reg_defs_pci_wr_tg.h" +#include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" #include "nthw_fpga_reg_defs_rst9563.h" #include "nthw_fpga_reg_defs_sdc.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_qsl.h new file +66 -0
66 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 17/50 net/ntnic: add slicer (SLC LR) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Slicer for Local Retransmit module can cut of the head a packet before the packet leaves the FPGA RX pipeline.
This is used when the TX pipeline is configured
to add a new head in the packet.
--- drivers/net/ntnic/include/hw_mod_backend.h | 14 ++ drivers/net/ntnic/include/hw_mod_slc_lr_v2.h | 25 ++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 66 +++++++++ .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 126 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 54 ++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 2 + .../nthw/supported/nthw_fpga_reg_defs_slc.h | 34 +++++ .../supported/nthw_fpga_reg_defs_slc_lr.h | 23 ++++ 10 files changed, 346 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_slc_lr_v2.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc_lr.h
drivers/net/ntnic/include/hw_mod_backend.h +14 -0
@@ -13,6 +13,7 @@#include "hw_mod_flm_v25.h" #include "hw_mod_km_v7.h" #include "hw_mod_qsl_v7.h" +#include "hw_mod_slc_lr_v2.h" #include "hw_mod_hsh_v5.h" #define MAX_PHYS_ADAPTERS 8
@@ -96,6 +97,13 @@ struct qsl_func_s { }; }; +struct slc_lr_func_s { +COMMON_FUNC_INFO_S ; +union { +struct hw_mod_slc_lr_v2_s v2; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -214,6 +222,12 @@ struct flow_api_backend_ops {int (*qsl_qst_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt);int (*qsl_qen_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt);int (*qsl_unmq_flush)(void *dev,const struct qsl_func_s *qsl,int entry,int cnt); + +/* SLC LR */ +bool (*get_slc_lr_present)(void *dev); +uint32_t (*get_slc_lr_version)(void *dev); +int (*slc_lr_rcp_flush)(void *dev,const struct slc_lr_func_s *slc_lr,int category, +int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_slc_lr_v2.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _HW_MOD_SLC_LR_V2_H_ +#define _HW_MOD_SLC_LR_V2_H_ + +#include <stdint.h> + +struct slc_lr_v2_rcp_s { +uint32_t head_slc_en; +uint32_t head_dyn; +int32_t head_ofs; +uint32_t tail_slc_en; +uint32_t tail_dyn; +int32_t tail_ofs; +uint32_t pcap; +}; + +struct hw_mod_slc_lr_v2_s { +struct slc_lr_v2_rcp_s *rcp; +}; + +#endif /* _HW_MOD_SLC_V2_H_ */
drivers/net/ntnic/meson.build +1 -0
@@ -53,6 +53,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c', 'nthw/flow_filter/flow_nthw_qsl.c', + 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +66 -0
102 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c new file +126 -0
126 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h new file +54 -0
54 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -33,6 +33,7 @@#define MOD_RAC (0xae830b42UL)#define MOD_RST9563 (0x385d6d1dUL)#define MOD_SDC (0xd2369530UL) +#define MOD_SLC_LR (0x969fc50bUL)#define MOD_IDX_COUNT (14)/* aliases - only aliases go below this point */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +2 -0
@@ -32,6 +32,8 @@#include "nthw_fpga_reg_defs_rac.h" #include "nthw_fpga_reg_defs_rst9563.h" #include "nthw_fpga_reg_defs_sdc.h" +#include "nthw_fpga_reg_defs_slc.h" +#include "nthw_fpga_reg_defs_slc_lr.h" /* aliases */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_slc.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_SLC_ +#define _NTHW_FPGA_REG_DEFS_SLC_ + +/* SLC */ +#define NTHW_MOD_SLC (0x1aef1f38UL) +#define SLC_RCP_CTRL (0xa3373b1UL) +#define SLC_RCP_CTRL_ADR (0xe64629e7UL) +#define SLC_RCP_CTRL_CNT (0xf64eb036UL) +#define SLC_RCP_DATA (0xa5e2f1a8UL) +#define SLC_RCP_DATA_HEAD_DYN (0x86b55a78UL) +#define SLC_RCP_DATA_HEAD_OFS (0x24bcd7deUL) +#define SLC_RCP_DATA_HEAD_SLC_EN (0x61cf5ef7UL) +#define SLC_RCP_DATA_PCAP (0x84909c04UL) +#define SLC_RCP_DATA_TAIL_DYN (0x85cd93a3UL) +#define SLC_RCP_DATA_TAIL_OFS (0x27c41e05UL) +#define SLC_RCP_DATA_TAIL_SLC_EN (0xa4f5112cUL) + +#endif /* _NTHW_FPGA_REG_DEFS_SLC_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc_lr.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_slc_lr.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_SLC_LR_ +#define _NTHW_FPGA_REG_DEFS_SLC_LR_ + +/* SLC_LR */ +#define NTHW_MOD_SLC_LR (0x969fc50bUL) + +#endif /* _NTHW_FPGA_REG_DEFS_SLC_LR_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 18/50 net/ntnic: add packet descriptor builder (PDB) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Packet Description Builder module creates packet meta-data for example virtio-net headers.
--- drivers/net/ntnic/include/hw_mod_backend.h | 16 ++ drivers/net/ntnic/include/hw_mod_pdb_v9.h | 42 ++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 93 ++++++++ .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 210 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 85 +++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_pdb.h | 48 ++++ 9 files changed, 497 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_pdb_v9.h create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_pdb.h
drivers/net/ntnic/include/hw_mod_backend.h +16 -0
@@ -13,6 +13,7 @@#include "hw_mod_flm_v25.h" #include "hw_mod_km_v7.h" #include "hw_mod_qsl_v7.h" +#include "hw_mod_pdb_v9.h" #include "hw_mod_slc_lr_v2.h" #include "hw_mod_hsh_v5.h"
@@ -104,6 +105,15 @@ struct slc_lr_func_s { }; }; +struct pdb_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_pdb_rcp_categories; + +union { +struct hw_mod_pdb_v9_s v9; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -228,6 +238,12 @@ struct flow_api_backend_ops {uint32_t (*get_slc_lr_version)(void *dev);int (*slc_lr_rcp_flush)(void *dev,const struct slc_lr_func_s *slc_lr,int category,int cnt); + +/* PDB */ +bool (*get_pdb_present)(void *dev); +uint32_t (*get_pdb_version)(void *dev); +int (*pdb_rcp_flush)(void *dev,const struct pdb_func_s *pdb,int category,int cnt); +int (*pdb_config_flush)(void *dev,const struct pdb_func_s *pdb); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_pdb_v9.h new file +42 -0
42 lines not on this page · raw message
drivers/net/ntnic/meson.build +1 -0
@@ -52,6 +52,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_ifr.c', 'nthw/flow_filter/flow_nthw_info.c', 'nthw/flow_filter/flow_nthw_km.c', + 'nthw/flow_filter/flow_nthw_pdb.c', 'nthw/flow_filter/flow_nthw_qsl.c', 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/model/nthw_fpga_model.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +93 -0
129 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c new file +210 -0
210 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h new file +85 -0
85 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -29,6 +29,7 @@#define MOD_PCIE3 (0xfbc48c18UL)#define MOD_PCI_RD_TG (0x9ad9eed2UL)#define MOD_PCI_WR_TG (0x274b69e1UL) +#define MOD_PDB (0xa7771bffUL)#define MOD_QSL (0x448ed859UL)#define MOD_RAC (0xae830b42UL)#define MOD_RST9563 (0x385d6d1dUL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -28,6 +28,7 @@#include "nthw_fpga_reg_defs_pcie3.h" #include "nthw_fpga_reg_defs_pci_rd_tg.h" #include "nthw_fpga_reg_defs_pci_wr_tg.h" +#include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" #include "nthw_fpga_reg_defs_rst9563.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_pdb.h new file +48 -0
48 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 19/50 net/ntnic: add header field update (HFU) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Header Field Update module updates protocol fields if the packets have been changed,
for example length fields and next protocol fields.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 +++ .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 99 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 54 ++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_hfu.h | 49 +++++++++ 7 files changed, 218 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hfu.h
drivers/net/ntnic/meson.build +1 -0
@@ -48,6 +48,7 @@ sources = files( 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_flm.c', + 'nthw/flow_filter/flow_nthw_hfu.c', 'nthw/flow_filter/flow_nthw_hsh.c', 'nthw/flow_filter/flow_nthw_ifr.c', 'nthw/flow_filter/flow_nthw_info.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -10,6 +10,7 @@#include "flow_nthw_cat.h" #include "flow_nthw_km.h" #include "flow_nthw_flm.h" +#include "flow_nthw_hfu.h" #include "flow_nthw_hsh.h" #include "flow_nthw_qsl.h" #include "flow_nthw_slc_lr.h"
@@ -36,6 +37,7 @@ static struct backend_dev_s {struct qsl_nthw *p_qsl_nthw;struct slc_lr_nthw *p_slc_lr_nthw;struct pdb_nthw *p_pdb_nthw; +struct hfu_nthw *p_hfu_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1783,6 +1785,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_pdb_nthw =NULL ; } +/* Init nthw HFU */ +if (hfu_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct hfu_nthw *ptr =hfu_nthw_new (); +hfu_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_hfu_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_hfu_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1800,6 +1812,7 @@ static void bin_flow_backend_done(void *dev)qsl_nthw_delete (be_dev->p_qsl_nthw);slc_lr_nthw_delete (be_dev->p_slc_lr_nthw);pdb_nthw_delete (be_dev->p_pdb_nthw); +hfu_nthw_delete (be_dev->p_hfu_nthw); }static const struct flow_backend_ops ops = {
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c new file +99 -0
99 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h new file +54 -0
54 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -19,6 +19,7 @@#define MOD_GFG (0xfc423807UL)#define MOD_GMF (0x68b1d15aUL)#define MOD_GPIO_PHY (0xbbe81659UL) +#define MOD_HFU (0x4a70e72UL)#define MOD_HIF (0x7815363UL)#define MOD_HSH (0x501484bfUL)#define MOD_I2CM (0x93bc7780UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -18,6 +18,7 @@#include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h" #include "nthw_fpga_reg_defs_gpio_phy.h" +#include "nthw_fpga_reg_defs_hfu.h" #include "nthw_fpga_reg_defs_hif.h" #include "nthw_fpga_reg_defs_hsh.h" #include "nthw_fpga_reg_defs_i2cm.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hfu.h new file +49 -0
49 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 20/50 net/ntnic: add RPP local retransmit (RPP LR) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The RX Packet Process for Local Retransmit module can add bytes in the FPGA TX pipeline, which is needed when the packet increases in size. Note, this makes room for packet expansion,
but the actual expansion is done by the modules.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 ++++ .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 76 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 44 +++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../supported/nthw_fpga_reg_defs_rpp_lr.h | 37 +++++++++ 7 files changed, 173 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpp_lr.h
drivers/net/ntnic/meson.build +1 -0
@@ -55,6 +55,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_km.c', 'nthw/flow_filter/flow_nthw_pdb.c', 'nthw/flow_filter/flow_nthw_qsl.c', + 'nthw/flow_filter/flow_nthw_rpp_lr.c', 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -15,6 +15,7 @@#include "flow_nthw_qsl.h" #include "flow_nthw_slc_lr.h" #include "flow_nthw_pdb.h" +#include "flow_nthw_rpp_lr.h" #include "ntnic_mod_reg.h" #include "nthw_fpga_model.h" #include "hw_mod_backend.h"
@@ -38,6 +39,7 @@ static struct backend_dev_s {struct slc_lr_nthw *p_slc_lr_nthw;struct pdb_nthw *p_pdb_nthw;struct hfu_nthw *p_hfu_nthw;/* TPE module */ +struct rpp_lr_nthw *p_rpp_lr_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1795,6 +1797,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_hfu_nthw =NULL ; } +/* Init nthw RPP_LR */ +if (rpp_lr_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct rpp_lr_nthw *ptr =rpp_lr_nthw_new (); +rpp_lr_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_rpp_lr_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_rpp_lr_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1813,6 +1825,7 @@ static void bin_flow_backend_done(void *dev)slc_lr_nthw_delete (be_dev->p_slc_lr_nthw);pdb_nthw_delete (be_dev->p_pdb_nthw);hfu_nthw_delete (be_dev->p_hfu_nthw); +rpp_lr_nthw_delete (be_dev->p_rpp_lr_nthw); }static const struct flow_backend_ops ops = {
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c new file +76 -0
76 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h new file +44 -0
44 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -33,6 +33,7 @@#define MOD_PDB (0xa7771bffUL)#define MOD_QSL (0x448ed859UL)#define MOD_RAC (0xae830b42UL) +#define MOD_RPP_LR (0xba7f945cUL)#define MOD_RST9563 (0x385d6d1dUL)#define MOD_SDC (0xd2369530UL)#define MOD_SLC_LR (0x969fc50bUL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -32,6 +32,7 @@#include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" +#include "nthw_fpga_reg_defs_rpp_lr.h" #include "nthw_fpga_reg_defs_rst9563.h" #include "nthw_fpga_reg_defs_sdc.h" #include "nthw_fpga_reg_defs_slc.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpp_lr.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_rpp_lr.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_RPP_LR_ +#define _NTHW_FPGA_REG_DEFS_RPP_LR_ + +/* RPP_LR */ +#define NTHW_MOD_RPP_LR (0xba7f945cUL) +#define RPP_LR_IFR_RCP_CTRL (0xce88594UL) +#define RPP_LR_IFR_RCP_CTRL_ADR (0x4b4cc068UL) +#define RPP_LR_IFR_RCP_CTRL_CNT (0x5b4459b9UL) +#define RPP_LR_IFR_RCP_DATA (0xa339078dUL) +#define RPP_LR_IFR_RCP_DATA_IPV4_DF_DROP (0xee1d681fUL) +#define RPP_LR_IFR_RCP_DATA_IPV4_EN (0xfe386131UL) +#define RPP_LR_IFR_RCP_DATA_IPV6_DROP (0x41f324ffUL) +#define RPP_LR_IFR_RCP_DATA_IPV6_EN (0x5431a9baUL) +#define RPP_LR_IFR_RCP_DATA_MTU (0x871a2322UL) +#define RPP_LR_RCP_CTRL (0xf3395d47UL) +#define RPP_LR_RCP_CTRL_ADR (0x4916a944UL) +#define RPP_LR_RCP_CTRL_CNT (0x591e3095UL) +#define RPP_LR_RCP_DATA (0x5ce8df5eUL) +#define RPP_LR_RCP_DATA_EXP (0x578ca035UL) + +#endif /* _NTHW_FPGA_REG_DEFS_RPP_LR_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 21/50 net/ntnic: add copier (Tx CPY) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The TX Copy module writes data to packet fields based on the lookup performed by the FLM module.
This is used for NAT and can support other actions
based on the RTE action MODIFY_FIELD.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 + .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 339 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 49 +++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 2 + .../nthw/supported/nthw_fpga_reg_defs_cpy.h | 113 ++++++ .../supported/nthw_fpga_reg_defs_tx_cpy.h | 23 ++ 8 files changed, 541 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cpy.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_cpy.h
drivers/net/ntnic/meson.build +1 -0
@@ -57,6 +57,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_qsl.c', 'nthw/flow_filter/flow_nthw_rpp_lr.c', 'nthw/flow_filter/flow_nthw_slc_lr.c', + 'nthw/flow_filter/flow_nthw_tx_cpy.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -16,6 +16,7 @@#include "flow_nthw_slc_lr.h" #include "flow_nthw_pdb.h" #include "flow_nthw_rpp_lr.h" +#include "flow_nthw_tx_cpy.h" #include "ntnic_mod_reg.h" #include "nthw_fpga_model.h" #include "hw_mod_backend.h"
@@ -40,6 +41,7 @@ static struct backend_dev_s {struct pdb_nthw *p_pdb_nthw;struct hfu_nthw *p_hfu_nthw;/* TPE module */ struct rpp_lr_nthw *p_rpp_lr_nthw;/* TPE module */ +struct tx_cpy_nthw *p_tx_cpy_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1807,6 +1809,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_rpp_lr_nthw =NULL ; } +/* Init nthw TX_CPY */ +if (tx_cpy_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct tx_cpy_nthw *ptr =tx_cpy_nthw_new (); +tx_cpy_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_tx_cpy_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_tx_cpy_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1826,6 +1838,7 @@ static void bin_flow_backend_done(void *dev)pdb_nthw_delete (be_dev->p_pdb_nthw);hfu_nthw_delete (be_dev->p_hfu_nthw);rpp_lr_nthw_delete (be_dev->p_rpp_lr_nthw); +tx_cpy_nthw_delete (be_dev->p_tx_cpy_nthw); }static const struct flow_backend_ops ops = {
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c new file +339 -0
339 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h new file +49 -0
49 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -37,6 +37,7 @@#define MOD_RST9563 (0x385d6d1dUL)#define MOD_SDC (0xd2369530UL)#define MOD_SLC_LR (0x969fc50bUL) +#define MOD_TX_CPY (0x60acf217UL)#define MOD_IDX_COUNT (14)/* aliases - only aliases go below this point */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +2 -0
@@ -14,6 +14,7 @@#define _NTHW_FPGA_REG_DEFS_#include "nthw_fpga_reg_defs_cat.h" +#include "nthw_fpga_reg_defs_cpy.h" #include "nthw_fpga_reg_defs_flm.h" #include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h"
@@ -37,6 +38,7 @@#include "nthw_fpga_reg_defs_sdc.h" #include "nthw_fpga_reg_defs_slc.h" #include "nthw_fpga_reg_defs_slc_lr.h" +#include "nthw_fpga_reg_defs_tx_cpy.h" /* aliases */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cpy.h new file +113 -0
113 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_cpy.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_tx_cpy.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_TX_CPY_ +#define _NTHW_FPGA_REG_DEFS_TX_CPY_ + +/* TX_CPY */ +#define NTHW_MOD_TX_CPY (0x60acf217UL) + +#endif /* _NTHW_FPGA_REG_DEFS_TX_CPY_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 22/50 net/ntnic: add checksum update (CSU) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Checksum Update module updates the checksums of packets that has been modified in any way.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 ++++ .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 62 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_csu.h | 35 +++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_csu.h | 31 ++++++++++ 7 files changed, 144 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_csu.h
drivers/net/ntnic/meson.build +1 -0
@@ -47,6 +47,7 @@ sources = files( 'nthw/flow_api/flow_backend/flow_backend.c', 'nthw/flow_api/flow_filter.c', 'nthw/flow_filter/flow_nthw_cat.c', + 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c', 'nthw/flow_filter/flow_nthw_hfu.c', 'nthw/flow_filter/flow_nthw_hsh.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -8,6 +8,7 @@#include "flow_nthw_info.h" #include "flow_nthw_ifr.h" #include "flow_nthw_cat.h" +#include "flow_nthw_csu.h" #include "flow_nthw_km.h" #include "flow_nthw_flm.h" #include "flow_nthw_hfu.h"
@@ -42,6 +43,7 @@ static struct backend_dev_s {struct hfu_nthw *p_hfu_nthw;/* TPE module */ struct rpp_lr_nthw *p_rpp_lr_nthw;/* TPE module */ struct tx_cpy_nthw *p_tx_cpy_nthw;/* TPE module */ +struct csu_nthw *p_csu_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1819,6 +1821,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_tx_cpy_nthw =NULL ; } +/* Init nthw CSU */ +if (csu_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct csu_nthw *ptr =csu_nthw_new (); +csu_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_csu_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_csu_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1836,6 +1848,7 @@ static void bin_flow_backend_done(void *dev)qsl_nthw_delete (be_dev->p_qsl_nthw);slc_lr_nthw_delete (be_dev->p_slc_lr_nthw);pdb_nthw_delete (be_dev->p_pdb_nthw); +csu_nthw_delete (be_dev->p_csu_nthw);hfu_nthw_delete (be_dev->p_hfu_nthw);rpp_lr_nthw_delete (be_dev->p_rpp_lr_nthw);tx_cpy_nthw_delete (be_dev->p_tx_cpy_nthw);
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _FLOW_NTHW_CSU_H_ +#define _FLOW_NTHW_CSU_H_ + +#include <stdint.h> + +#include "nthw_fpga_model.h" + +struct csu_nthw { +uint8_t m_physical_adapter_no; +nthw_fpga_t *mp_fpga; + +nthw_module_t *m_csu; + +nthw_register_t *mp_rcp_ctrl; +nthw_field_t *mp_rcp_ctrl_adr; +nthw_field_t *mp_rcp_ctrl_cnt; +nthw_register_t *mp_rcp_data; +nthw_field_t *mp_rcp_data_ol3_cmd; +nthw_field_t *mp_rcp_data_ol4_cmd; +nthw_field_t *mp_rcp_data_il3_cmd; +nthw_field_t *mp_rcp_data_il4_cmd; +}; + +struct csu_nthw *csu_nthw_new (void ); +void csu_nthw_delete (struct csu_nthw *p); +int csu_nthw_init (struct csu_nthw *p,nthw_fpga_t *p_fpga,int n_instance); + +int csu_nthw_setup (struct csu_nthw *p,int n_idx,int n_idx_cnt); + +#endif /* _FLOW_NTHW_CSU_H_ */
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -15,6 +15,7 @@#define MOD_UNKNOWN (0L)/* Unknown/uninitialized - keep this as the first element */ #define MOD_CAT (0x30b447c2UL) +#define MOD_CSU (0x3f470787UL)#define MOD_FLM (0xe7ba53a4UL)#define MOD_GFG (0xfc423807UL)#define MOD_GMF (0x68b1d15aUL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -15,6 +15,7 @@#include "nthw_fpga_reg_defs_cat.h" #include "nthw_fpga_reg_defs_cpy.h" +#include "nthw_fpga_reg_defs_csu.h" #include "nthw_fpga_reg_defs_flm.h" #include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_csu.h new file +31 -0
@@ -0,0 +1,31 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_csu.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_CSU_ +#define _NTHW_FPGA_REG_DEFS_CSU_ + +/* CSU */ +#define NTHW_MOD_CSU (0x3f470787UL) +#define CSU_RCP_CTRL (0x11955fefUL) +#define CSU_RCP_CTRL_ADR (0x8efb3c71UL) +#define CSU_RCP_CTRL_CNT (0x9ef3a5a0UL) +#define CSU_RCP_DATA (0xbe44ddf6UL) +#define CSU_RCP_DATA_IL3_CMD (0xdbac8e0dUL) +#define CSU_RCP_DATA_IL4_CMD (0x698c521dUL) +#define CSU_RCP_DATA_OL3_CMD (0xb87cbb37UL) +#define CSU_RCP_DATA_OL4_CMD (0xa5c6727UL) + +#endif /* _NTHW_FPGA_REG_DEFS_CSU_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 23/50 net/ntnic: add insert (Tx INS) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
he TX Inserter module injects zeros into an offset of a packet, effectively expanding the packet.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 ++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 62 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 35 +++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 2 + .../nthw/supported/nthw_fpga_reg_defs_ins.h | 30 +++++++++ .../supported/nthw_fpga_reg_defs_tx_ins.h | 23 +++++++ 8 files changed, 167 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ins.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_ins.h
drivers/net/ntnic/meson.build +1 -0
@@ -59,6 +59,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_rpp_lr.c', 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/flow_filter/flow_nthw_tx_cpy.c', + 'nthw/flow_filter/flow_nthw_tx_ins.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -18,6 +18,7 @@#include "flow_nthw_pdb.h" #include "flow_nthw_rpp_lr.h" #include "flow_nthw_tx_cpy.h" +#include "flow_nthw_tx_ins.h" #include "ntnic_mod_reg.h" #include "nthw_fpga_model.h" #include "hw_mod_backend.h"
@@ -43,6 +44,7 @@ static struct backend_dev_s {struct hfu_nthw *p_hfu_nthw;/* TPE module */ struct rpp_lr_nthw *p_rpp_lr_nthw;/* TPE module */ struct tx_cpy_nthw *p_tx_cpy_nthw;/* TPE module */ +struct tx_ins_nthw *p_tx_ins_nthw;/* TPE module */ struct csu_nthw *p_csu_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1831,6 +1833,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_csu_nthw =NULL ; } +/* Init nthw TX_INS */ +if (tx_ins_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct tx_ins_nthw *ptr =tx_ins_nthw_new (); +tx_ins_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_tx_ins_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_tx_ins_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1852,6 +1864,7 @@ static void bin_flow_backend_done(void *dev)hfu_nthw_delete (be_dev->p_hfu_nthw);rpp_lr_nthw_delete (be_dev->p_rpp_lr_nthw);tx_cpy_nthw_delete (be_dev->p_tx_cpy_nthw); +tx_ins_nthw_delete (be_dev->p_tx_ins_nthw); }static const struct flow_backend_ops ops = {
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __FLOW_NTHW_TX_INS_H__ +#define __FLOW_NTHW_TX_INS_H__ + +#include <stdint.h> + +#include "nthw_fpga_model.h" + +struct tx_ins_nthw { +uint8_t m_physical_adapter_no; +nthw_fpga_t *mp_fpga; + +nthw_module_t *m_tx_ins; + +nthw_register_t *mp_rcp_ctrl; +nthw_field_t *mp_rcp_addr; +nthw_field_t *mp_rcp_cnt; + +nthw_register_t *mp_rcp_data; +nthw_field_t *mp_rcp_data_dyn; +nthw_field_t *mp_rcp_data_ofs; +nthw_field_t *mp_rcp_data_len; +}; + +struct tx_ins_nthw *tx_ins_nthw_new (void ); +void tx_ins_nthw_delete (struct tx_ins_nthw *p); +int tx_ins_nthw_init (struct tx_ins_nthw *p,nthw_fpga_t *p_fpga,int n_instance); + +int tx_ins_nthw_setup (struct tx_ins_nthw *p,int n_idx,int n_idx_cnt); + +#endif /* __FLOW_NTHW_TX_INS_H__ */
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -39,6 +39,7 @@#define MOD_SDC (0xd2369530UL)#define MOD_SLC_LR (0x969fc50bUL)#define MOD_TX_CPY (0x60acf217UL) +#define MOD_TX_INS (0x59afa100UL)#define MOD_IDX_COUNT (14)/* aliases - only aliases go below this point */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +2 -0
@@ -26,6 +26,7 @@#include "nthw_fpga_reg_defs_i2cm.h" #include "nthw_fpga_reg_defs_ifr.h" #include "nthw_fpga_reg_defs_iic.h" +#include "nthw_fpga_reg_defs_ins.h" #include "nthw_fpga_reg_defs_km.h" #include "nthw_fpga_reg_defs_mac_pcs.h" #include "nthw_fpga_reg_defs_pcie3.h"
@@ -40,6 +41,7 @@#include "nthw_fpga_reg_defs_slc.h" #include "nthw_fpga_reg_defs_slc_lr.h" #include "nthw_fpga_reg_defs_tx_cpy.h" +#include "nthw_fpga_reg_defs_tx_ins.h" /* aliases */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ins.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_ins.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_INS_ +#define _NTHW_FPGA_REG_DEFS_INS_ + +/* INS */ +#define NTHW_MOD_INS (0x24df4b78UL) +#define INS_RCP_CTRL (0x93de4e05UL) +#define INS_RCP_CTRL_ADR (0x3ae620a8UL) +#define INS_RCP_CTRL_CNT (0x2aeeb979UL) +#define INS_RCP_DATA (0x3c0fcc1cUL) +#define INS_RCP_DATA_DYN (0xc6aa4fccUL) +#define INS_RCP_DATA_LEN (0x2ece4329UL) +#define INS_RCP_DATA_OFS (0x64a3c26aUL) + +#endif /* _NTHW_FPGA_REG_DEFS_INS_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_ins.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_tx_ins.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_TX_INS_ +#define _NTHW_FPGA_REG_DEFS_TX_INS_ + +/* TX_INS */ +#define NTHW_MOD_TX_INS (0x59afa100UL) + +#endif /* _NTHW_FPGA_REG_DEFS_TX_INS_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 24/50 net/ntnic: add replacer (Tx RPL) flow module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The TX Replacer module can replace a range of bytes in a packet. The replacing data is stored in a table in the module and will often contain tunnel data.
--- drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/flow_backend/flow_backend.c | 13 ++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 78 +++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 52 +++++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 2 + .../nthw/supported/nthw_fpga_reg_defs_rpl.h | 43 ++++++++++ .../supported/nthw_fpga_reg_defs_tx_rpl.h | 23 ++++++ 8 files changed, 213 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h
drivers/net/ntnic/meson.build +1 -0
@@ -60,6 +60,7 @@ sources = files( 'nthw/flow_filter/flow_nthw_slc_lr.c', 'nthw/flow_filter/flow_nthw_tx_cpy.c', 'nthw/flow_filter/flow_nthw_tx_ins.c', + 'nthw/flow_filter/flow_nthw_tx_rpl.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +13 -0
@@ -19,6 +19,7 @@#include "flow_nthw_rpp_lr.h" #include "flow_nthw_tx_cpy.h" #include "flow_nthw_tx_ins.h" +#include "flow_nthw_tx_rpl.h" #include "ntnic_mod_reg.h" #include "nthw_fpga_model.h" #include "hw_mod_backend.h"
@@ -45,6 +46,7 @@ static struct backend_dev_s {struct rpp_lr_nthw *p_rpp_lr_nthw;/* TPE module */ struct tx_cpy_nthw *p_tx_cpy_nthw;/* TPE module */ struct tx_ins_nthw *p_tx_ins_nthw;/* TPE module */ +struct tx_rpl_nthw *p_tx_rpl_nthw;/* TPE module */ struct csu_nthw *p_csu_nthw;/* TPE module */ struct ifr_nthw *p_ifr_nthw;/* TPE module */ } be_devs[MAX_PHYS_ADAPTERS ];
@@ -1843,6 +1845,16 @@ const struct flow_api_backend_ops *bin_flow_backend_init(nthw_fpga_t *p_fpga, vo be_devs[physical_adapter_no].p_tx_ins_nthw =NULL ; } +/* Init nthw TX_RPL */ +if (tx_rpl_nthw_init (NULL , p_fpga, physical_adapter_no) ==0 ) { +struct tx_rpl_nthw *ptr =tx_rpl_nthw_new (); +tx_rpl_nthw_init (ptr, p_fpga, physical_adapter_no); + be_devs[physical_adapter_no].p_tx_rpl_nthw = ptr; + + }else { + be_devs[physical_adapter_no].p_tx_rpl_nthw =NULL ; + } + be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no];
@@ -1865,6 +1877,7 @@ static void bin_flow_backend_done(void *dev)rpp_lr_nthw_delete (be_dev->p_rpp_lr_nthw);tx_cpy_nthw_delete (be_dev->p_tx_cpy_nthw);tx_ins_nthw_delete (be_dev->p_tx_ins_nthw); +tx_rpl_nthw_delete (be_dev->p_tx_rpl_nthw); }static const struct flow_backend_ops ops = {
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c new file +78 -0
78 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h new file +52 -0
52 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -40,6 +40,7 @@#define MOD_SLC_LR (0x969fc50bUL)#define MOD_TX_CPY (0x60acf217UL)#define MOD_TX_INS (0x59afa100UL) +#define MOD_TX_RPL (0x1095dfbbUL)#define MOD_IDX_COUNT (14)/* aliases - only aliases go below this point */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +2 -0
@@ -35,6 +35,7 @@#include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" +#include "nthw_fpga_reg_defs_rpl.h" #include "nthw_fpga_reg_defs_rpp_lr.h" #include "nthw_fpga_reg_defs_rst9563.h" #include "nthw_fpga_reg_defs_sdc.h"
@@ -42,6 +43,7 @@#include "nthw_fpga_reg_defs_slc_lr.h" #include "nthw_fpga_reg_defs_tx_cpy.h" #include "nthw_fpga_reg_defs_tx_ins.h" +#include "nthw_fpga_reg_defs_tx_rpl.h" /* aliases */
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h new file +43 -0
43 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.h new file +23 -0
@@ -0,0 +1,23 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_tx_rpl.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_TX_RPL_ +#define _NTHW_FPGA_REG_DEFS_TX_RPL_ + +/* TX_RPL */ +#define NTHW_MOD_TX_RPL (0x1095dfbbUL) + +#endif /* _NTHW_FPGA_REG_DEFS_TX_RPL_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 25/50 net/ntnic: add Tx Packet Editor (TPE) flow module
In reply to Serhii IliushykThe TX Packet Editor is a software abstraction module, that keeps track of the handful of FPGA modules that are used to edit packets in the TX pipeline.
--- drivers/net/ntnic/include/hw_mod_backend.h | 27 ++ drivers/net/ntnic/include/hw_mod_tpe_v3.h | 126 ++++++ .../nthw/flow_api/flow_backend/flow_backend.c | 364 ++++++++++++++++++ .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 79 ++++ .../ntnic/nthw/flow_filter/flow_nthw_csu.h | 9 + .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 131 +++++++ .../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 30 ++ .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 55 +++ .../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 11 + .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 81 ++++ .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 17 + .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 49 +++ .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 10 + .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 36 ++ .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 9 + .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 94 +++++ .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 22 ++ 17 files changed, 1150 insertions(+) create mode 100644 drivers/net/ntnic/include/hw_mod_tpe_v3.h
drivers/net/ntnic/include/hw_mod_backend.h +27 -0
@@ -16,6 +16,7 @@#include "hw_mod_pdb_v9.h" #include "hw_mod_slc_lr_v2.h" #include "hw_mod_hsh_v5.h" +#include "hw_mod_tpe_v3.h" #define MAX_PHYS_ADAPTERS 8
@@ -114,6 +115,18 @@ struct pdb_func_s { }; }; +struct tpe_func_s { +COMMON_FUNC_INFO_S ; +uint32_t nb_rcp_categories; +uint32_t nb_ifr_categories; +uint32_t nb_cpy_writers; +uint32_t nb_rpl_depth; +uint32_t nb_rpl_ext_categories; +union { +struct hw_mod_tpe_v3_s v3; + }; +}; +enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,FLOW_BACKEND_DEBUG_MODE_WRITE =0x0001
@@ -244,6 +257,20 @@ struct flow_api_backend_ops {uint32_t (*get_pdb_version)(void *dev);int (*pdb_rcp_flush)(void *dev,const struct pdb_func_s *pdb,int category,int cnt);int (*pdb_config_flush)(void *dev,const struct pdb_func_s *pdb); + +/* TPE */ +bool (*get_tpe_present)(void *dev); +uint32_t (*get_tpe_version)(void *dev); +int (*tpe_rpp_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_rpp_ifr_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_ifr_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_ins_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_rpl_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_rpl_ext_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_rpl_rpl_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_cpy_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_hfu_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); +int (*tpe_csu_rcp_flush)(void *dev,const struct tpe_func_s *tpe,int index,int cnt); };struct flow_api_backend_s {
drivers/net/ntnic/include/hw_mod_tpe_v3.h new file +126 -0
126 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +364 -0
376 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c +79 -0
88 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h +9 -0
@@ -31,5 +31,14 @@ void csu_nthw_delete(struct csu_nthw *p);int csu_nthw_init (struct csu_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int csu_nthw_setup (struct csu_nthw *p,int n_idx,int n_idx_cnt); +void csu_nthw_set_debug_mode (struct csu_nthw *p,unsigned int n_debug_mode); + +void csu_nthw_rcp_select (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_cnt (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_outer_l3_cmd (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_outer_l4_cmd (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_inner_l3_cmd (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_inner_l4_cmd (const struct csu_nthw *p,uint32_t val); +void csu_nthw_rcp_flush (const struct csu_nthw *p);#endif /* _FLOW_NTHW_CSU_H_ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c +131 -0
140 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h +30 -0
@@ -50,5 +50,35 @@ void hfu_nthw_delete(struct hfu_nthw *p);int hfu_nthw_init (struct hfu_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int hfu_nthw_setup (struct hfu_nthw *p,int n_idx,int n_idx_cnt); +void hfu_nthw_set_debug_mode (struct hfu_nthw *p,unsigned int n_debug_mode); + +/* RCP */ +void hfu_nthw_rcp_select (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_cnt (const struct hfu_nthw *p,uint32_t val); + +void hfu_nthw_rcp_len_a_wr (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_ol4len (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_pos_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_pos_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_add_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_add_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_a_sub_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_wr (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_pos_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_pos_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_add_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_add_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_b_sub_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_wr (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_pos_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_pos_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_add_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_add_ofs (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_len_c_sub_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_ttl_wr (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_ttl_pos_dyn (const struct hfu_nthw *p,uint32_t val); +void hfu_nthw_rcp_ttl_pos_ofs (const struct hfu_nthw *p,uint32_t val); + +void hfu_nthw_rcp_flush (const struct hfu_nthw *p);#endif /* __FLOW_NTHW_HFU_H__ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c +55 -0
64 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h +11 -0
@@ -39,5 +39,16 @@ struct ifr_nthw *ifr_nthw_new(void);int ifr_nthw_init (struct ifr_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int ifr_nthw_setup (struct ifr_nthw *p,int n_idx,int n_idx_cnt); +void ifr_nthw_set_debug_mode (struct ifr_nthw *p,unsigned int n_debug_mode); + +/* IFR */ +void ifr_nthw_rcp_select (const struct ifr_nthw *p,uint32_t val); +void ifr_nthw_rcp_cnt (const struct ifr_nthw *p,uint32_t val); +void ifr_nthw_rcp_ipv4_en (const struct ifr_nthw *p,uint32_t val); +void ifr_nthw_rcp_ipv4_df_drop (const struct ifr_nthw *p,uint32_t val); +void ifr_nthw_rcp_ipv6_en (const struct ifr_nthw *p,uint32_t val); +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); +void ifr_nthw_rcp_flush (const struct ifr_nthw *p);#endif /* __FLOW_NTHW_IFR_H__ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c +81 -0
90 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h +17 -0
@@ -40,5 +40,22 @@ void rpp_lr_nthw_delete(struct rpp_lr_nthw *p);int rpp_lr_nthw_init (struct rpp_lr_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int rpp_lr_nthw_setup (struct rpp_lr_nthw *p,int n_idx,int n_idx_cnt); +void rpp_lr_nthw_set_debug_mode (struct rpp_lr_nthw *p,unsigned int n_debug_mode); + +/* RCP */ +void rpp_lr_nthw_rcp_select (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_rcp_cnt (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_rcp_exp (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_rcp_flush (const struct rpp_lr_nthw *p); + +/* RCP IFR */ +void rpp_lr_nthw_ifr_rcp_select (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_ifr_rcp_cnt (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_ifr_rcp_ipv4_en (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_ifr_rcp_ipv4_df_drop (const struct rpp_lr_nthw *p,uint32_t val); +void rpp_lr_nthw_ifr_rcp_ipv6_en (const struct rpp_lr_nthw *p,uint32_t val); +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); +void rpp_lr_nthw_ifr_rcp_flush (const struct rpp_lr_nthw *p);#endif /* __FLOW_NTHW_RPP_LR_H__ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c +49 -0
58 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h +10 -0
@@ -45,5 +45,15 @@ void tx_cpy_nthw_delete(struct tx_cpy_nthw *p);int tx_cpy_nthw_init (struct tx_cpy_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int tx_cpy_nthw_setup (struct tx_cpy_nthw *p,int n_idx,int n_idx_cnt); +void tx_cpy_nthw_set_debug_mode (struct tx_cpy_nthw *p,unsigned int n_debug_mode); + +void tx_cpy_nthw_writer_select (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val); +void tx_cpy_nthw_writer_cnt (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val); +void tx_cpy_nthw_writer_reader_select (const struct tx_cpy_nthw *p,unsigned int index, +uint32_t val); +void tx_cpy_nthw_writer_dyn (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val); +void tx_cpy_nthw_writer_ofs (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val); +void tx_cpy_nthw_writer_len (const struct tx_cpy_nthw *p,unsigned int index,uint32_t val); +void tx_cpy_nthw_writer_flush (const struct tx_cpy_nthw *p,unsigned int index);#endif /* __FLOW_NTHW_TX_CPY_H__ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c +36 -0
@@ -12,6 +12,11 @@#include "flow_nthw_tx_ins.h" +void tx_ins_nthw_set_debug_mode (struct tx_ins_nthw *p,unsigned int n_debug_mode) +{ +nthw_module_set_debug_mode (p->m_tx_ins, n_debug_mode); +} +struct tx_ins_nthw *tx_ins_nthw_new (void ) {struct tx_ins_nthw *p =malloc (sizeof (struct tx_ins_nthw ));
@@ -60,3 +65,34 @@ int tx_ins_nthw_init(struct tx_ins_nthw *p, nthw_fpga_t *p_fpga, int n_instance)return 0 ; } + +void tx_ins_nthw_rcp_select (const struct tx_ins_nthw *p,uint32_t val) +{ +nthw_field_set_val32 (p->mp_rcp_addr, val); +} + +void tx_ins_nthw_rcp_cnt (const struct tx_ins_nthw *p,uint32_t val) +{ +nthw_field_set_val32 (p->mp_rcp_cnt, val); +} + +void tx_ins_nthw_rcp_dyn (const struct tx_ins_nthw *p,uint32_t val) +{ +nthw_field_set_val32 (p->mp_rcp_data_dyn, val); +} + +void tx_ins_nthw_rcp_ofs (const struct tx_ins_nthw *p,uint32_t val) +{ +nthw_field_set_val32 (p->mp_rcp_data_ofs, val); +} + +void tx_ins_nthw_rcp_len (const struct tx_ins_nthw *p,uint32_t val) +{ +nthw_field_set_val32 (p->mp_rcp_data_len, val); +} + +void tx_ins_nthw_rcp_flush (const struct tx_ins_nthw *p) +{ +nthw_register_flush (p->mp_rcp_ctrl,1 ); +nthw_register_flush (p->mp_rcp_data,1 ); +}
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h +9 -0
@@ -31,5 +31,14 @@ void tx_ins_nthw_delete(struct tx_ins_nthw *p);int tx_ins_nthw_init (struct tx_ins_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int tx_ins_nthw_setup (struct tx_ins_nthw *p,int n_idx,int n_idx_cnt); +void tx_ins_nthw_set_debug_mode (struct tx_ins_nthw *p,unsigned int n_debug_mode); + +/* RCP */ +void tx_ins_nthw_rcp_select (const struct tx_ins_nthw *p,uint32_t val); +void tx_ins_nthw_rcp_cnt (const struct tx_ins_nthw *p,uint32_t val); +void tx_ins_nthw_rcp_dyn (const struct tx_ins_nthw *p,uint32_t val); +void tx_ins_nthw_rcp_ofs (const struct tx_ins_nthw *p,uint32_t val); +void tx_ins_nthw_rcp_len (const struct tx_ins_nthw *p,uint32_t val); +void tx_ins_nthw_rcp_flush (const struct tx_ins_nthw *p);#endif /* __FLOW_NTHW_TX_INS_H__ */
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c +94 -0
103 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h +22 -0
@@ -48,5 +48,27 @@ void tx_rpl_nthw_delete(struct tx_rpl_nthw *p);int tx_rpl_nthw_init (struct tx_rpl_nthw *p,nthw_fpga_t *p_fpga,int n_instance);int tx_rpl_nthw_setup (struct tx_rpl_nthw *p,int n_idx,int n_idx_cnt); +void tx_rpl_nthw_set_debug_mode (struct tx_rpl_nthw *p,unsigned int n_debug_mode); + +/* RCP */ +void tx_rpl_nthw_rcp_select (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rcp_cnt (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rcp_dyn (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rcp_ofs (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rcp_len (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rcp_rpl_ptr (const struct tx_rpl_nthw *p,uint32_t val); +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); +void tx_rpl_nthw_rcp_flush (const struct tx_rpl_nthw *p); + +void tx_rpl_nthw_ext_select (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_ext_cnt (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_ext_rpl_ptr (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_ext_flush (const struct tx_rpl_nthw *p); + +void tx_rpl_nthw_rpl_select (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rpl_cnt (const struct tx_rpl_nthw *p,uint32_t val); +void tx_rpl_nthw_rpl_value (const struct tx_rpl_nthw *p,const uint32_t *val); +void tx_rpl_nthw_rpl_flush (const struct tx_rpl_nthw *p);#endif /* __FLOW_NTHW_TX_RPL_H__ */
Signature · 1 line
2.45.0
PATCH v2 26/50 net/ntnic: add base init and deinit of the NT flow API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add basic API for initialization resources required by flow filter API
--- drivers/net/ntnic/include/flow_api.h | 82 ++++++ drivers/net/ntnic/include/flow_api_engine.h | 43 +++ drivers/net/ntnic/include/hw_mod_backend.h | 3 + .../ntnic/include/stream_binary_flow_api.h | 22 ++ drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 245 ++++++++++++++++++ .../ntnic/nthw/flow_api/flow_api_nic_setup.h | 6 + drivers/net/ntnic/nthw/flow_api/flow_filter.c | 17 +- drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 19 ++ drivers/net/ntnic/nthw/flow_api/flow_km.c | 19 ++ 10 files changed, 453 insertions(+), 5 deletions(-) create mode 100644 drivers/net/ntnic/include/flow_api_engine.h create mode 100644 drivers/net/ntnic/include/stream_binary_flow_api.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_kcc.c create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_km.c
drivers/net/ntnic/include/flow_api.h +82 -0
@@ -6,14 +6,96 @@#ifndef _FLOW_API_H_#define _FLOW_API_H_ +#include <pthread.h> +#include "ntlog.h" +#include "flow_api_engine.h" #include "hw_mod_backend.h" +#include "stream_binary_flow_api.h" + +/* +* Flow NIC and Eth port device management +*/ + +struct hw_mod_resource_s { +uint8_t *alloc_bm;/* allocation bitmap */ +uint32_t *ref;/* reference counter for each resource element */ +uint32_t resource_count;/* number of total available entries */ +}; + +/* +* Device Management API +*/ +int flow_delete_eth_dev (struct flow_eth_dev *eth_dev); + +struct flow_eth_dev { +/* NIC that owns this port device */ +struct flow_nic_dev *ndev; +/* NIC port id */ +uint8_t port; + +/* 0th for exception */ +struct flow_queue_id_s rx_queue[FLOW_MAX_QUEUES +1 ]; + +/* VSWITCH has exceptions sent on queue 0 per design */ +int num_queues; + +struct flow_eth_dev *next; +};/* registered NIC backends */ struct flow_nic_dev { +struct hw_mod_resource_s res[RES_COUNT ];/* raw NIC resource allocation table */ +void *km_res_handle; +void *kcc_res_handle; + +uint32_t flow_unique_id_counter; +/* linked list of all flows created on this NIC */ +struct flow_handle *flow_base; +/* NIC backend API */ struct flow_api_backend_s be; +/* linked list of created eth-port devices on this NIC */ +struct flow_eth_dev *eth_base; +pthread_mutex_t mtx; + +/* next NIC linked list */ +struct flow_nic_dev *next; }; +/* +* Resources +*/ + +extern const char *dbg_res_descr[]; + +#define flow_nic_unset_bit (arr, x) \ + do { \ + size_t _temp_x = (x); \ + arr[_temp_x / 8] &= (uint8_t)(~(1 << (_temp_x % 8))); \ + } while (0) + +#define flow_nic_is_bit_set (arr, x) \ + ({ \ + size_t _temp_x = (x); \ + (arr[_temp_x / 8] & (uint8_t)(1 << (_temp_x % 8))); \ + }) + +#define flow_nic_mark_resource_unused (_ndev, res_type, index) \ + do { \ + typeof(res_type) _temp_res_type = (res_type); \ + size_t _temp_index = (index); \ + NT_LOG(DBG, FILTER, "mark resource unused: %s idx %zu\n", \ + dbg_res_descr[_temp_res_type], _temp_index); \ + flow_nic_unset_bit((_ndev)->res[_temp_res_type].alloc_bm, _temp_index); \ + } while (0) + +#define flow_nic_is_resource_used (_ndev, res_type, index) \ + (!!flow_nic_is_bit_set((_ndev)->res[res_type].alloc_bm, index)) + +void flow_nic_free_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int idx); + +int flow_nic_deref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index); +#endif
drivers/net/ntnic/include/flow_api_engine.h new file +43 -0
43 lines not on this page · raw message
drivers/net/ntnic/include/hw_mod_backend.h +3 -0
@@ -8,6 +8,8 @@#include <stdbool.h> +#include "ntlog.h" +#include "hw_mod_cat_v18.h" #include "hw_mod_cat_v21.h" #include "hw_mod_flm_v25.h"
@@ -275,6 +277,7 @@ struct flow_api_backend_ops {struct flow_api_backend_s {void *be_dev; +const struct flow_api_backend_ops *iface; };#endif /* _HW_MOD_BACKEND_H_ */
drivers/net/ntnic/include/stream_binary_flow_api.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _STREAM_BINARY_FLOW_API_H_ +#define _STREAM_BINARY_FLOW_API_H_ + +/* +* Flow frontend for binary programming interface +*/ + +#define FLOW_MAX_QUEUES 128 + +struct flow_queue_id_s { +int id; +int hw_id; +}; + +struct flow_eth_dev ;/* port device */ + +#endif /* _STREAM_BINARY_FLOW_API_H_ */
drivers/net/ntnic/meson.build +2 -0
@@ -46,6 +46,8 @@ sources = files( 'nthw/flow_api/flow_api.c', 'nthw/flow_api/flow_backend/flow_backend.c', 'nthw/flow_api/flow_filter.c', + 'nthw/flow_api/flow_kcc.c', + 'nthw/flow_api/flow_km.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +245 -0
256 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h +6 -0
@@ -9,6 +9,12 @@#include "hw_mod_backend.h" #include "flow_api.h" +/* +* 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);#endif /* __FLOW_API_NIC_SETUP_H__ */
drivers/net/ntnic/nthw/flow_api/flow_filter.c +12 -5
@@ -9,10 +9,8 @@int flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no) { - (void )p_flow_device; - (void )adapter_no; -void *be_dev =NULL ; +struct flow_nic_dev *flow_nic;const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops ();
@@ -22,8 +20,17 @@ int flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_device, i }NT_LOG (DBG ,FILTER ,"Initializing flow filter api\n" ); - flow_backend_ops->bin_flow_backend_init (p_fpga, &be_dev); +const struct flow_api_backend_ops *iface = + flow_backend_ops->bin_flow_backend_init (p_fpga, &be_dev); + + flow_nic =flow_api_create ((uint8_t )adapter_no, iface, be_dev); + +if (!flow_nic) { + *p_flow_device =NULL ; +return -1 ; + } + *p_flow_device = flow_nic;return 0 ; }
@@ -31,7 +38,7 @@ int flow_filter_done(struct flow_nic_dev *dev) {void *be_dev =flow_api_get_be_dev (dev); -int res =0 ; +int res =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_kcc.c new file +19 -0
@@ -0,0 +1,19 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include <stdlib.h> + +#include "hw_mod_backend.h" +#include "flow_api_engine.h" + +void kcc_free_ndev_resource_management (void **handle) +{ +if (*handle) { +free (*handle); +NT_LOG (DBG ,FILTER ,"Free NIC DEV KCC-CAM record manager\n" ); + } + + *handle =NULL ; +}
drivers/net/ntnic/nthw/flow_api/flow_km.c new file +19 -0
@@ -0,0 +1,19 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include <stdlib.h> + +#include "hw_mod_backend.h" +#include "flow_api_engine.h" + +void km_free_ndev_resource_management (void **handle) +{ +if (*handle) { +free (*handle); +NT_LOG (DBG ,FILTER ,"Free NIC DEV CAM and TCAM record manager\n" ); + } + + *handle =NULL ; +}
Signature · 1 line
2.45.0
PATCH v2 27/50 net/ntnic: add base init and deinit the NT flow backend
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add basic implementation of the NT flow backend API
--- drivers/net/ntnic/include/flow_api.h | 3 + drivers/net/ntnic/include/flow_api_engine.h | 5 ++ drivers/net/ntnic/include/hw_mod_backend.h | 12 ++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 64 +++++++++++++++++++ .../nthw/flow_api/hw_mod/hw_mod_backend.c | 28 ++++++++ 6 files changed, 113 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c
drivers/net/ntnic/include/flow_api.h +3 -0
@@ -46,6 +46,9 @@ struct flow_eth_dev {/* registered NIC backends */ struct flow_nic_dev { +uint8_t adapter_no;/* physical adapter no in the host system */ +uint16_t ports;/* number of in-ports addressable on this NIC */ +struct hw_mod_resource_s res[RES_COUNT ];/* raw NIC resource allocation table */ void *km_res_handle;void *kcc_res_handle;
drivers/net/ntnic/include/flow_api_engine.h +5 -0
@@ -6,6 +6,11 @@#ifndef _FLOW_API_ENGINE_H_#define _FLOW_API_ENGINE_H_ +/* +* Resource management +*/ +#define BIT_CONTAINER_8_ALIGN (x) (((x) + 7) / 8) +/* * Resource management * These are free resources in FPGA
drivers/net/ntnic/include/hw_mod_backend.h +12 -0
@@ -278,6 +278,18 @@ struct flow_api_backend_ops {struct flow_api_backend_s {void *be_dev;const struct flow_api_backend_ops *iface; + +/* NIC attributes */ +unsigned int num_phy_ports; +unsigned int num_rx_ports; + +/* flow filter resource capacities */ +unsigned int max_categories; +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); +#endif /* _HW_MOD_BACKEND_H_ */
drivers/net/ntnic/meson.build +1 -0
@@ -48,6 +48,7 @@ sources = files( 'nthw/flow_api/flow_filter.c', 'nthw/flow_api/flow_kcc.c', 'nthw/flow_api/flow_km.c', + 'nthw/flow_api/hw_mod/hw_mod_backend.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +64 -0
89 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c new file +28 -0
@@ -0,0 +1,28 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include "hw_mod_backend.h" + +int flow_api_backend_init (struct flow_api_backend_s *dev, +const struct flow_api_backend_ops *iface, +void *be_dev) +{ +assert (dev); + dev->iface = iface; + dev->be_dev = be_dev; + dev->num_phy_ports = iface->get_nb_phy_port (be_dev); + dev->num_rx_ports = iface->get_nb_rx_port (be_dev); + dev->max_categories = iface->get_nb_categories (be_dev); + dev->max_queues = iface->get_nb_queues (be_dev); + +return 0 ; +} + +int flow_api_backend_done (struct flow_api_backend_s *dev) +{ + (void )dev; + +return 0 ; +}
Signature · 1 line
2.45.0
PATCH v2 28/50 net/ntnic: add categorizer (CAT) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Categorizer module’s main purpose is to is select the behavior of other modules in the FPGA pipeline depending on a protocol check.
--- drivers/net/ntnic/include/hw_mod_backend.h | 205 ++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 15 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 109 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 985 ++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 264 ++++- 6 files changed, 1577 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c
drivers/net/ntnic/include/hw_mod_backend.h +205 -0
@@ -22,12 +22,116 @@#define MAX_PHYS_ADAPTERS 8 +#define VER_MAJOR (ver) (((ver) >> 16) & 0xffff) +#define VER_MINOR (ver) ((ver) & 0xffff) + +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); + +#define ALL_ENTRIES -1000 + +#define INDEX_TOO_LARGE (NT_LOG(INF, FILTER, "ERROR:%s: Index too large\n", __func__), -2) + +#define WORD_OFF_TOO_LARGE (NT_LOG(INF, FILTER, "ERROR:%s: Word offset too large\n", __func__), -3) + +#define UNSUP_FIELD \ + (NT_LOG(INF, FILTER, "ERROR:%s: Unsupported field in NIC module\n", __func__), -5) + +#define UNSUP_VER \ + (NT_LOG(INF, FILTER, "ERROR:%s: Unsupported NIC module: %s ver %i.%i\n", __func__, _MOD_, \ + VER_MAJOR(_VER_), VER_MINOR(_VER_)), \ + -4) + +#define COUNT_ERROR (_RESOURCE_) \ + (NT_LOG(INF, FILTER, \ + "ERROR:%s: Insufficient resource [ %s ] : NIC module: %s ver %i.%i\n", __func__, \ + #_RESOURCE_, _MOD_, VER_MAJOR(_VER_), VER_MINOR(_VER_)), \ + -4) + +#define NOT_FOUND 0xffffffff + +enum { +EXTRA_INDEXES +}; + +#define GET (cached_val, val) ({ *(val) = *(cached_val); }) + +#define SET (cached_val, val) ({ *(cached_val) = *(val); }) + +#define GET_SET (cached_val, val) \ + do { \ + uint32_t *temp_val = (val); \ + typeof(cached_val) *temp_cached_val = &(cached_val); \ + if (get) \ + GET(temp_cached_val, temp_val); \ + else \ + SET(temp_cached_val, temp_val); \ + } while (0) + +#define GET_SIGNED (cached_val, val) ({ *(val) = (uint32_t)(*(cached_val)); }) + +#define SET_SIGNED (cached_val, val) ({ *(cached_val) = (int32_t)(*(val)); }) + +#define GET_SET_SIGNED (cached_val, val) \ + do { \ + uint32_t *temp_val = (val); \ + typeof(cached_val) *temp_cached_val = &(cached_val); \ + if (get) \ + GET_SIGNED(temp_cached_val, temp_val); \ + else \ + SET_SIGNED(temp_cached_val, temp_val); \ + } while (0) + +#define FIND_EQUAL_INDEX (be_module_reg, type, idx, start, nb_elements) \ + do { \ + typeof(be_module_reg) *temp_be_module = \ + (typeof(be_module_reg) *)be_module_reg; \ + typeof(idx) tmp_idx = (idx); \ + typeof(nb_elements) tmp_nb_elements = (nb_elements); \ + unsigned int start_idx = (unsigned int)(start); \ + *value = NOT_FOUND; \ + for (unsigned int i = start_idx; i < tmp_nb_elements; i++) { \ + if ((unsigned int)(tmp_idx) == i) \ + continue; \ + if (memcmp(&temp_be_module[tmp_idx], &temp_be_module[i], sizeof(type)) == \ + 0) { \ + *value = i; \ + break; \ + } \ + } \ + } while (0) + +#define DO_COMPARE_INDEXS (be_module_reg, type, idx, cmp_idx) \ + do { \ + typeof(be_module_reg) *temp_be_module = &(be_module_reg); \ + typeof(idx) tmp_idx = (idx); \ + typeof(cmp_idx) tmp_cmp_idx = (cmp_idx); \ + if ((unsigned int)(tmp_idx) != (unsigned int)(tmp_cmp_idx)) { \ + (void)memcmp(temp_be_module + tmp_idx, &temp_be_module[tmp_cmp_idx], \ + sizeof(type)); \ + } \ + } while (0) + +enum km_flm_if_select_e { +KM_FLM_IF_FIRST =0 , +KM_FLM_IF_SECOND =1 +}; + +#define FIELD_START_INDEX 100 +#define COMMON_FUNC_INFO_S \ int ver; \ void *base; \ unsigned int alloced_size; \ int debug +struct common_func_s { +COMMON_FUNC_INFO_S ; +}; +struct cat_func_s {COMMON_FUNC_INFO_S ;uint32_t nb_cat_funcs;
@@ -48,6 +152,104 @@ struct cat_func_s {struct hw_mod_cat_v21_s v21; }; }; +enum hw_cat_e { +/* +* functions initial CAT v18 +*/ +/* 00 */ HW_CAT_CFN_SET_ALL_DEFAULTS =0 , +/* 01 */ HW_CAT_CFN_PRESET_ALL , +/* 02 */ HW_CAT_CFN_COMPARE , +/* 03 */ HW_CAT_CFN_FIND , +/* 04 */ HW_CAT_CFN_COPY_FROM , +/* 05 */ HW_CAT_COT_PRESET_ALL , +/* 06 */ HW_CAT_COT_COMPARE , +/* 07 */ HW_CAT_COT_FIND , +/* 08 */ HW_CAT_COT_COPY_FROM , +/* fields */ +/* 00 */ HW_CAT_CFN_ENABLE =FIELD_START_INDEX , +/* 01 */ HW_CAT_CFN_INV , +/* 02 */ HW_CAT_CFN_PTC_INV , +/* 03 */ HW_CAT_CFN_PTC_ISL , +/* 04 */ HW_CAT_CFN_PTC_CFP , +/* 05 */ HW_CAT_CFN_PTC_MAC , +/* 06 */ HW_CAT_CFN_PTC_L2 , +/* 07 */ HW_CAT_CFN_PTC_VNTAG , +/* 08 */ HW_CAT_CFN_PTC_VLAN , +/* 09 */ HW_CAT_CFN_PTC_MPLS , +/* 10 */ HW_CAT_CFN_PTC_L3 , +/* 11 */ HW_CAT_CFN_PTC_FRAG , +/* 12 */ HW_CAT_CFN_PTC_IP_PROT , +/* 13 */ HW_CAT_CFN_PTC_L4 , +/* 14 */ HW_CAT_CFN_PTC_TUNNEL , +/* 15 */ HW_CAT_CFN_PTC_TNL_L2 , +/* 16 */ HW_CAT_CFN_PTC_TNL_VLAN , +/* 17 */ HW_CAT_CFN_PTC_TNL_MPLS , +/* 18 */ HW_CAT_CFN_PTC_TNL_L3 , +/* 19 */ HW_CAT_CFN_PTC_TNL_FRAG , +/* 20 */ HW_CAT_CFN_PTC_TNL_IP_PROT , +/* 21 */ HW_CAT_CFN_PTC_TNL_L4 , +/* 22 */ HW_CAT_CFN_ERR_INV , +/* 23 */ HW_CAT_CFN_ERR_CV , +/* 24 */ HW_CAT_CFN_ERR_FCS , +/* 25 */ HW_CAT_CFN_ERR_TRUNC , +/* 26 */ HW_CAT_CFN_ERR_L3_CS , +/* 27 */ HW_CAT_CFN_ERR_L4_CS , +/* 28 */ HW_CAT_CFN_MAC_PORT , +/* 29 */ HW_CAT_CFN_PM_CMP , +/* 30 */ HW_CAT_CFN_PM_DCT , +/* 31 */ HW_CAT_CFN_PM_EXT_INV , +/* 32 */ HW_CAT_CFN_PM_CMB , +/* 33 */ HW_CAT_CFN_PM_AND_INV , +/* 34 */ HW_CAT_CFN_PM_OR_INV , +/* 35 */ HW_CAT_CFN_PM_INV , +/* 36 */ HW_CAT_CFN_LC , +/* 37 */ HW_CAT_CFN_LC_INV , +/* 38 */ HW_CAT_CFN_KM0_OR , +/* 39 */ HW_CAT_CFN_KM1_OR , +/* 40 */ HW_CAT_KCE_ENABLE_BM , +/* 41 */ HW_CAT_KCS_CATEGORY , +/* 42 */ HW_CAT_FTE_ENABLE_BM , +/* 43 */ HW_CAT_CTE_ENABLE_BM , +/* 44 */ HW_CAT_CTS_CAT_A , +/* 45 */ HW_CAT_CTS_CAT_B , +/* 46 */ HW_CAT_COT_COLOR , +/* 47 */ HW_CAT_COT_KM , +/* 48 */ HW_CAT_CCT_COLOR , +/* 49 */ HW_CAT_CCT_KM , +/* 50 */ HW_CAT_KCC_KEY , +/* 51 */ HW_CAT_KCC_CATEGORY , +/* 52 */ HW_CAT_KCC_ID , +/* 53 */ HW_CAT_EXO_DYN , +/* 54 */ HW_CAT_EXO_OFS , +/* 55 */ HW_CAT_RCK_DATA , +/* 56 */ HW_CAT_LEN_LOWER , +/* 57 */ HW_CAT_LEN_UPPER , +/* 58 */ HW_CAT_LEN_DYN1 , +/* 59 */ HW_CAT_LEN_DYN2 , +/* 60 */ HW_CAT_LEN_INV , +/* 61 */ HW_CAT_CFN_ERR_TNL_L3_CS , +/* 62 */ HW_CAT_CFN_ERR_TNL_L4_CS , +/* 63 */ HW_CAT_CFN_ERR_TTL_EXP , +/* 64 */ HW_CAT_CFN_ERR_TNL_TTL_EXP , +}; + +bool hw_mod_cat_present (struct flow_api_backend_s *be); +int hw_mod_cat_alloc (struct flow_api_backend_s *be); +void hw_mod_cat_free (struct flow_api_backend_s *be); +int hw_mod_cat_reset (struct flow_api_backend_s *be); +int hw_mod_cat_cfn_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_cfn_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,int word_off, +uint32_t value); + +int hw_mod_cat_cte_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_cts_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_cot_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_cct_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_kcc_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_cat_exo_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_rck_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_cat_len_flush (struct flow_api_backend_s *be,int start_idx,int count);struct km_func_s {COMMON_FUNC_INFO_S ;
@@ -279,6 +481,9 @@ struct flow_api_backend_s {void *be_dev;const struct flow_api_backend_ops *iface; +/* flow filter FPGA modules */ +struct cat_func_s cat; +/* NIC attributes */ unsigned int num_phy_ports;unsigned int num_rx_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -49,6 +49,7 @@ sources = files( 'nthw/flow_api/flow_kcc.c', 'nthw/flow_api/flow_km.c', 'nthw/flow_api/hw_mod/hw_mod_backend.c', + 'nthw/flow_api/hw_mod/hw_mod_cat.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +15 -0
@@ -272,12 +272,27 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_QUEUE , ndev->be.max_queues)) goto err_exit; +if (init_resource_elements (ndev,RES_CAT_CFN , ndev->be.cat.nb_cat_funcs)) + goto err_exit; +if (init_resource_elements (ndev,RES_CAT_COT , ndev->be.max_categories)) goto err_exit; +if (init_resource_elements (ndev,RES_CAT_EXO , ndev->be.cat.nb_pm_ext)) + goto err_exit; + +if (init_resource_elements (ndev,RES_CAT_LEN , ndev->be.cat.nb_len)) + goto err_exit; + +if (init_resource_elements (ndev,RES_KM_FLOW_TYPE , ndev->be.cat.nb_flow_types)) + goto err_exit; +if (init_resource_elements (ndev,RES_SLC_LR_RCP , ndev->be.max_categories)) goto err_exit; +if (init_resource_elements (ndev,RES_FLM_FLOW_TYPE , ndev->be.cat.nb_flow_types)) + goto err_exit; +/* may need IPF, COR */ /* check all defined has been initialized */
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +108 -1
126 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c new file +985 -0
985 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +263 -1
280 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 29/50 net/ntnic: add key match (KM) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Key Matcher module checks the values of individual fields of a packet. It supports both exact match which is implemented with a CAM, and wildcards which is implemented with a TCAM.
--- drivers/net/ntnic/include/hw_mod_backend.h | 85 ++++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 278 ++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 94 +++++- 6 files changed, 461 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c
drivers/net/ntnic/include/hw_mod_backend.h +85 -0
@@ -32,6 +32,7 @@ void *callocate_mod(struct common_func_s *mod, int sets, ...);void zero_module_cache (struct common_func_s *mod);#define ALL_ENTRIES -1000 +#define ALL_BANK_ENTRIES -1001#define INDEX_TOO_LARGE (NT_LOG(INF, FILTER, "ERROR:%s: Index too large\n", __func__), -2)
@@ -267,6 +268,89 @@ struct km_func_s {struct hw_mod_km_v7_s v7; }; }; +enum hw_km_e { +/* functions */ +HW_KM_RCP_PRESET_ALL =0 , +HW_KM_CAM_PRESET_ALL , +/* to sync and reset hw with cache - force write all entries in a bank */ +HW_KM_TCAM_BANK_RESET , +/* fields */ +HW_KM_RCP_QW0_DYN =FIELD_START_INDEX , +HW_KM_RCP_QW0_OFS , +HW_KM_RCP_QW0_SEL_A , +HW_KM_RCP_QW0_SEL_B , +HW_KM_RCP_QW4_DYN , +HW_KM_RCP_QW4_OFS , +HW_KM_RCP_QW4_SEL_A , +HW_KM_RCP_QW4_SEL_B , +HW_KM_RCP_DW8_DYN , +HW_KM_RCP_DW8_OFS , +HW_KM_RCP_DW8_SEL_A , +HW_KM_RCP_DW8_SEL_B , +HW_KM_RCP_DW10_DYN , +HW_KM_RCP_DW10_OFS , +HW_KM_RCP_DW10_SEL_A , +HW_KM_RCP_DW10_SEL_B , +HW_KM_RCP_SWX_CCH , +HW_KM_RCP_SWX_SEL_A , +HW_KM_RCP_SWX_SEL_B , +HW_KM_RCP_MASK_A , +HW_KM_RCP_MASK_B , +HW_KM_RCP_DUAL , +HW_KM_RCP_PAIRED , +HW_KM_RCP_EL_A , +HW_KM_RCP_EL_B , +HW_KM_RCP_INFO_A , +HW_KM_RCP_INFO_B , +HW_KM_RCP_FTM_A , +HW_KM_RCP_FTM_B , +HW_KM_RCP_BANK_A , +HW_KM_RCP_BANK_B , +HW_KM_RCP_KL_A , +HW_KM_RCP_KL_B , +HW_KM_RCP_KEYWAY_A , +HW_KM_RCP_KEYWAY_B , +HW_KM_RCP_SYNERGY_MODE , +HW_KM_RCP_DW0_B_DYN , +HW_KM_RCP_DW0_B_OFS , +HW_KM_RCP_DW2_B_DYN , +HW_KM_RCP_DW2_B_OFS , +HW_KM_RCP_SW4_B_DYN , +HW_KM_RCP_SW4_B_OFS , +HW_KM_RCP_SW5_B_DYN , +HW_KM_RCP_SW5_B_OFS , +HW_KM_CAM_W0 , +HW_KM_CAM_W1 , +HW_KM_CAM_W2 , +HW_KM_CAM_W3 , +HW_KM_CAM_W4 , +HW_KM_CAM_W5 , +HW_KM_CAM_FT0 , +HW_KM_CAM_FT1 , +HW_KM_CAM_FT2 , +HW_KM_CAM_FT3 , +HW_KM_CAM_FT4 , +HW_KM_CAM_FT5 , +HW_KM_TCAM_T , +HW_KM_TCI_COLOR , +HW_KM_TCI_FT , +HW_KM_TCQ_BANK_MASK , +HW_KM_TCQ_QUAL +}; +bool hw_mod_km_present (struct flow_api_backend_s *be); +int hw_mod_km_alloc (struct flow_api_backend_s *be); +void hw_mod_km_free (struct flow_api_backend_s *be); +int hw_mod_km_reset (struct flow_api_backend_s *be); +int hw_mod_km_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_km_cam_flush (struct flow_api_backend_s *be,int start_bank,int start_record, +int count); +int hw_mod_km_tcam_flush (struct flow_api_backend_s *be,int start_bank,int count); +int hw_mod_km_tcam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte, +int byte_val,uint32_t *value_set); +int hw_mod_km_tci_flush (struct flow_api_backend_s *be,int start_bank,int start_record, +int count); +int hw_mod_km_tcq_flush (struct flow_api_backend_s *be,int start_bank,int start_record, +int count);struct flm_func_s {COMMON_FUNC_INFO_S ;
@@ -483,6 +567,7 @@ struct flow_api_backend_s {/* flow filter FPGA modules */ struct cat_func_s cat; +struct km_func_s km;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -50,6 +50,7 @@ sources = files( 'nthw/flow_api/flow_km.c', 'nthw/flow_api/hw_mod/hw_mod_backend.c', 'nthw/flow_api/hw_mod/hw_mod_cat.c', + 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +3 -0
@@ -287,6 +287,9 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_KM_FLOW_TYPE , ndev->be.cat.nb_flow_types)) goto err_exit; +if (init_resource_elements (ndev,RES_KM_CATEGORY , ndev->be.km.nb_categories)) + goto err_exit; +if (init_resource_elements (ndev,RES_SLC_LR_RCP , ndev->be.max_categories)) goto err_exit;
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -18,6 +18,7 @@ static const struct {bool (*present)(struct flow_api_backend_s *be); } module[] = { { "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present }, + { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, }; #define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c new file +278 -0
278 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +93 -1
110 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 30/50 net/ntnic: add flow matcher (FLM) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Flow Matcher module is a high-performance stateful SDRAM lookup and programming engine which supported exact match lookup in line-rate of up to hundreds of millions of flows.
--- drivers/net/ntnic/include/hw_mod_backend.h | 117 +++++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 6 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 300 ++++++++++++++++++ 5 files changed, 425 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c
drivers/net/ntnic/include/hw_mod_backend.h +117 -0
@@ -367,6 +367,122 @@ struct flm_func_s {struct hw_mod_flm_v25_s v25; }; }; +enum hw_flm_e { +/* functions */ +HW_FLM_CONTROL_PRESET_ALL =0 , +HW_FLM_RCP_PRESET_ALL , +HW_FLM_FLOW_LRN_DATA , +HW_FLM_FLOW_INF_STA_DATA , +/* Control fields */ +HW_FLM_CONTROL_ENABLE =FIELD_START_INDEX , +HW_FLM_CONTROL_INIT , +HW_FLM_CONTROL_LDS , +HW_FLM_CONTROL_LFS , +HW_FLM_CONTROL_LIS , +HW_FLM_CONTROL_UDS , +HW_FLM_CONTROL_UIS , +HW_FLM_CONTROL_RDS , +HW_FLM_CONTROL_RIS , +HW_FLM_CONTROL_PDS , +HW_FLM_CONTROL_PIS , +HW_FLM_CONTROL_CRCWR , +HW_FLM_CONTROL_CRCRD , +HW_FLM_CONTROL_RBL , +HW_FLM_CONTROL_EAB , +HW_FLM_CONTROL_SPLIT_SDRAM_USAGE , +HW_FLM_STATUS_CALIB_SUCCESS , +HW_FLM_STATUS_CALIB_FAIL , +HW_FLM_STATUS_INITDONE , +HW_FLM_STATUS_IDLE , +HW_FLM_STATUS_CRITICAL , +HW_FLM_STATUS_PANIC , +HW_FLM_STATUS_CRCERR , +HW_FLM_STATUS_EFT_BP , +HW_FLM_STATUS_CACHE_BUFFER_CRITICAL , +HW_FLM_LOAD_BIN , +HW_FLM_LOAD_LPS , +HW_FLM_LOAD_APS , +HW_FLM_PRIO_LIMIT0 , +HW_FLM_PRIO_FT0 , +HW_FLM_PRIO_LIMIT1 , +HW_FLM_PRIO_FT1 , +HW_FLM_PRIO_LIMIT2 , +HW_FLM_PRIO_FT2 , +HW_FLM_PRIO_LIMIT3 , +HW_FLM_PRIO_FT3 , +HW_FLM_PST_PRESET_ALL , +HW_FLM_PST_BP , +HW_FLM_PST_PP , +HW_FLM_PST_TP , +HW_FLM_RCP_LOOKUP , +HW_FLM_RCP_QW0_DYN , +HW_FLM_RCP_QW0_OFS , +HW_FLM_RCP_QW0_SEL , +HW_FLM_RCP_QW4_DYN , +HW_FLM_RCP_QW4_OFS , +HW_FLM_RCP_SW8_DYN , +HW_FLM_RCP_SW8_OFS , +HW_FLM_RCP_SW8_SEL , +HW_FLM_RCP_SW9_DYN , +HW_FLM_RCP_SW9_OFS , +HW_FLM_RCP_MASK , +HW_FLM_RCP_KID , +HW_FLM_RCP_OPN , +HW_FLM_RCP_IPN , +HW_FLM_RCP_BYT_DYN , +HW_FLM_RCP_BYT_OFS , +HW_FLM_RCP_TXPLM , +HW_FLM_RCP_AUTO_IPV4_MASK , +HW_FLM_BUF_CTRL_LRN_FREE , +HW_FLM_BUF_CTRL_INF_AVAIL , +HW_FLM_BUF_CTRL_STA_AVAIL , +HW_FLM_STAT_LRN_DONE , +HW_FLM_STAT_LRN_IGNORE , +HW_FLM_STAT_LRN_FAIL , +HW_FLM_STAT_UNL_DONE , +HW_FLM_STAT_UNL_IGNORE , +HW_FLM_STAT_REL_DONE , +HW_FLM_STAT_REL_IGNORE , +HW_FLM_STAT_PRB_DONE , +HW_FLM_STAT_PRB_IGNORE , +HW_FLM_STAT_AUL_DONE , +HW_FLM_STAT_AUL_IGNORE , +HW_FLM_STAT_AUL_FAIL , +HW_FLM_STAT_TUL_DONE , +HW_FLM_STAT_FLOWS , +HW_FLM_STAT_STA_DONE ,/* module ver 0.20 */ +HW_FLM_STAT_INF_DONE ,/* module ver 0.20 */ +HW_FLM_STAT_INF_SKIP ,/* module ver 0.20 */ +HW_FLM_STAT_PCK_HIT ,/* module ver 0.20 */ +HW_FLM_STAT_PCK_MISS ,/* module ver 0.20 */ +HW_FLM_STAT_PCK_UNH ,/* module ver 0.20 */ +HW_FLM_STAT_PCK_DIS ,/* module ver 0.20 */ +HW_FLM_STAT_CSH_HIT ,/* module ver 0.20 */ +HW_FLM_STAT_CSH_MISS ,/* module ver 0.20 */ +HW_FLM_STAT_CSH_UNH ,/* module ver 0.20 */ +HW_FLM_STAT_CUC_START ,/* module ver 0.20 */ +HW_FLM_STAT_CUC_MOVE ,/* module ver 0.20 */ +HW_FLM_SCAN_I ,/* module ver 0.22 */ +HW_FLM_SCRUB_PRESET_ALL , +HW_FLM_SCRUB_T ,/* module ver 0.22 */ +HW_FLM_SCRUB_R ,/* module ver 0.24 */ +HW_FLM_SCRUB_DEL ,/* module ver 0.24 */ +HW_FLM_SCRUB_INF ,/* module ver 0.24 */ +}; + +bool hw_mod_flm_present (struct flow_api_backend_s *be); +int hw_mod_flm_alloc (struct flow_api_backend_s *be); +void hw_mod_flm_free (struct flow_api_backend_s *be); +int hw_mod_flm_reset (struct flow_api_backend_s *be); + +int hw_mod_flm_control_flush (struct flow_api_backend_s *be); +int hw_mod_flm_control_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); + +int hw_mod_flm_scan_flush (struct flow_api_backend_s *be); + +int hw_mod_flm_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_flm_scrub_flush (struct flow_api_backend_s *be,int start_idx,int count);struct hsh_func_s {COMMON_FUNC_INFO_S ;
@@ -568,6 +684,7 @@ struct flow_api_backend_s {/* flow filter FPGA modules */ struct cat_func_s cat;struct km_func_s km; +struct flm_func_s flm;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -50,6 +50,7 @@ sources = files( 'nthw/flow_api/flow_km.c', 'nthw/flow_api/hw_mod/hw_mod_backend.c', 'nthw/flow_api/hw_mod/hw_mod_cat.c', + 'nthw/flow_api/hw_mod/hw_mod_flm.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +6 -0
@@ -296,6 +296,12 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_FLM_FLOW_TYPE , ndev->be.cat.nb_flow_types)) goto err_exit; +if (init_resource_elements (ndev,RES_FLM_RCP , ndev->be.flm.nb_categories)) + goto err_exit; + +if (init_resource_elements (ndev,RES_SCRUB_RCP , ndev->be.flm.nb_scrub_profiles)) + goto err_exit; +/* may need IPF, COR */ /* check all defined has been initialized */
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -19,6 +19,7 @@ static const struct { } module[] = { { "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present }, { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, + { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, }; #define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c new file +300 -0
300 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 31/50 net/ntnic: add hasher (HSH) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Hasher module calculates a configurable hash value to be used internally by the FPGA.
The module support both Toeplitz and NT-hash.
--- drivers/net/ntnic/include/hw_mod_backend.h | 36 ++++++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 84 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 39 ++++++++- 6 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
drivers/net/ntnic/include/hw_mod_backend.h +36 -0
@@ -493,6 +493,41 @@ struct hsh_func_s {struct hw_mod_hsh_v5_s v5; }; }; +enum hw_hsh_e { +/* functions */ +HW_HSH_RCP_PRESET_ALL =0 , +HW_HSH_RCP_COMPARE , +HW_HSH_RCP_FIND , +/* fields */ +HW_HSH_RCP_LOAD_DIST_TYPE =FIELD_START_INDEX , +HW_HSH_RCP_MAC_PORT_MASK , +HW_HSH_RCP_SORT , +HW_HSH_RCP_QW0_PE , +HW_HSH_RCP_QW0_OFS , +HW_HSH_RCP_QW4_PE , +HW_HSH_RCP_QW4_OFS , +HW_HSH_RCP_W8_PE , +HW_HSH_RCP_W8_OFS , +HW_HSH_RCP_W8_SORT , +HW_HSH_RCP_W9_PE , +HW_HSH_RCP_W9_OFS , +HW_HSH_RCP_W9_SORT , +HW_HSH_RCP_W9_P , +HW_HSH_RCP_P_MASK , +HW_HSH_RCP_WORD_MASK , +HW_HSH_RCP_SEED , +HW_HSH_RCP_TNL_P , +HW_HSH_RCP_HSH_VALID , +HW_HSH_RCP_HSH_TYPE , +HW_HSH_RCP_TOEPLITZ , +HW_HSH_RCP_K , +HW_HSH_RCP_AUTO_IPV4_MASK +}; +bool hw_mod_hsh_present (struct flow_api_backend_s *be); +int hw_mod_hsh_alloc (struct flow_api_backend_s *be); +void hw_mod_hsh_free (struct flow_api_backend_s *be); +int hw_mod_hsh_reset (struct flow_api_backend_s *be); +int hw_mod_hsh_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count);struct qsl_func_s {COMMON_FUNC_INFO_S ;
@@ -685,6 +720,7 @@ struct flow_api_backend_s {struct cat_func_s cat;struct km_func_s km;struct flm_func_s flm; +struct hsh_func_s hsh;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -51,6 +51,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_backend.c', 'nthw/flow_api/hw_mod/hw_mod_cat.c', 'nthw/flow_api/hw_mod/hw_mod_flm.c', + 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +3 -0
@@ -290,6 +290,9 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_KM_CATEGORY , ndev->be.km.nb_categories)) goto err_exit; +if (init_resource_elements (ndev,RES_HSH_RCP , ndev->be.hsh.nb_rcp)) + goto err_exit; +if (init_resource_elements (ndev,RES_SLC_LR_RCP , ndev->be.max_categories)) goto err_exit;
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -20,6 +20,7 @@ static const struct { { "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present }, { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, + { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, };#define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c new file +84 -0
84 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +38 -1
@@ -544,6 +544,42 @@ static nthw_fpga_register_init_s hif_registers[] = { { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 462142918, 1, hif_uuid3_fields }, }; +static nthw_fpga_field_init_s hsh_rcp_ctrl_fields[] = { + {HSH_RCP_CTRL_ADR ,4 ,0 ,0x0000 }, + {HSH_RCP_CTRL_CNT ,16 ,16 ,0x0000 }, +}; + +static nthw_fpga_field_init_s hsh_rcp_data_fields[] = { + {HSH_RCP_DATA_AUTO_IPV4_MASK ,1 ,742 ,0x0000 }, + {HSH_RCP_DATA_HSH_TYPE ,5 ,416 ,0x0000 }, + {HSH_RCP_DATA_HSH_VALID ,1 ,415 ,0x0000 }, + {HSH_RCP_DATA_K ,320 ,422 ,0x0000 }, + {HSH_RCP_DATA_LOAD_DIST_TYPE ,2 ,0 ,0x0000 }, + {HSH_RCP_DATA_MAC_PORT_MASK ,2 ,2 ,0x0000 }, + {HSH_RCP_DATA_P_MASK ,1 ,61 ,0x0000 }, + {HSH_RCP_DATA_QW0_OFS ,8 ,11 ,0x0000 }, + {HSH_RCP_DATA_QW0_PE ,5 ,6 ,0x0000 }, + {HSH_RCP_DATA_QW4_OFS ,8 ,24 ,0x0000 }, + {HSH_RCP_DATA_QW4_PE ,5 ,19 ,0x0000 }, + {HSH_RCP_DATA_SEED ,32 ,382 ,0x0000 }, + {HSH_RCP_DATA_SORT ,2 ,4 ,0x0000 }, + {HSH_RCP_DATA_TNL_P ,1 ,414 ,0x0000 }, + {HSH_RCP_DATA_TOEPLITZ ,1 ,421 ,0x0000 }, + {HSH_RCP_DATA_W8_OFS ,8 ,37 ,0x0000 }, + {HSH_RCP_DATA_W8_PE ,5 ,32 ,0x0000 }, + {HSH_RCP_DATA_W8_SORT ,1 ,45 ,0x0000 }, + {HSH_RCP_DATA_W9_OFS ,8 ,51 ,0x0000 }, + {HSH_RCP_DATA_W9_P ,1 ,60 ,0x0000 }, + {HSH_RCP_DATA_W9_PE ,5 ,46 ,0x0000 }, + {HSH_RCP_DATA_W9_SORT ,1 ,59 ,0x0000 }, + {HSH_RCP_DATA_WORD_MASK ,320 ,62 ,0x0000 }, +}; + +static nthw_fpga_register_init_s hsh_registers[] = { + {HSH_RCP_CTRL ,0 ,32 ,NTHW_FPGA_REG_TYPE_WO ,0 ,2 , hsh_rcp_ctrl_fields }, + {HSH_RCP_DATA ,1 ,743 ,NTHW_FPGA_REG_TYPE_WO ,0 ,23 , hsh_rcp_data_fields }, +}; +static nthw_fpga_field_init_s iic_adr_fields[] = { {IIC_ADR_SLV_ADR ,7 ,1 ,0 }, };
@@ -1398,6 +1434,7 @@ static nthw_fpga_module_init_s fpga_modules[] = { gpio_phy_registers }, { MOD_HIF, 0, MOD_HIF, 0, 0, NTHW_FPGA_BUS_TYPE_PCI, 0, 18, hif_registers }, + { MOD_HSH, 0, MOD_HSH, 0, 5, NTHW_FPGA_BUS_TYPE_RAB1, 1536, 2, hsh_registers }, { MOD_IIC, 0, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 768, 22, iic_registers }, { MOD_IIC, 1, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 896, 22, iic_registers }, { MOD_IIC, 2, MOD_IIC, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 24832, 22, iic_registers },
@@ -1580,5 +1617,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { };nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { -200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,17 , fpga_modules, +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,18 , fpga_modules, };
Signature · 1 line
2.45.0
PATCH v2 32/50 net/ntnic: add queue select (QSL) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Queue Selector module directs packets to a given destination which includes host queues, physical ports, exceptions paths, and discard.
--- drivers/net/ntnic/include/hw_mod_backend.h | 37 ++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 14 ++ .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 170 ++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 57 +++++- 6 files changed, 279 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c
drivers/net/ntnic/include/hw_mod_backend.h +37 -0
@@ -537,6 +537,42 @@ struct qsl_func_s {struct hw_mod_qsl_v7_s v7; }; }; +enum hw_qsl_e { +/* functions */ +HW_QSL_RCP_PRESET_ALL =0 , +HW_QSL_RCP_COMPARE , +HW_QSL_RCP_FIND , +HW_QSL_QST_PRESET_ALL , +/* fields */ +HW_QSL_RCP_DISCARD =FIELD_START_INDEX , +HW_QSL_RCP_DROP , +HW_QSL_RCP_TBL_LO , +HW_QSL_RCP_TBL_HI , +HW_QSL_RCP_TBL_IDX , +HW_QSL_RCP_TBL_MSK , +HW_QSL_RCP_LR , +HW_QSL_RCP_TSA , +HW_QSL_RCP_VLI , +HW_QSL_QST_QUEUE , +HW_QSL_QST_EN ,/* Alias: HW_QSL_QST_QEN */ +HW_QSL_QST_TX_PORT , +HW_QSL_QST_LRE , +HW_QSL_QST_TCI , +HW_QSL_QST_VEN , +HW_QSL_QEN_EN , +HW_QSL_UNMQ_DEST_QUEUE , +HW_QSL_UNMQ_EN , +}; +bool hw_mod_qsl_present (struct flow_api_backend_s *be); +int hw_mod_qsl_alloc (struct flow_api_backend_s *be); +void hw_mod_qsl_free (struct flow_api_backend_s *be); +int hw_mod_qsl_reset (struct flow_api_backend_s *be); +int hw_mod_qsl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_qsl_qst_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_qsl_qen_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_qsl_unmq_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_qsl_unmq_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +uint32_t value);struct slc_lr_func_s {COMMON_FUNC_INFO_S ;
@@ -721,6 +757,7 @@ struct flow_api_backend_s {struct km_func_s km;struct flm_func_s flm;struct hsh_func_s hsh; +struct qsl_func_s qsl;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -53,6 +53,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_flm.c', 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', + 'nthw/flow_api/hw_mod/hw_mod_qsl.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +14 -0
@@ -144,6 +144,14 @@ int flow_delete_eth_dev(struct flow_eth_dev *eth_dev)/* delete all created flows from this device */ pthread_mutex_lock (&ndev->mtx); +/* +* remove unmatched queue if setup in QSL +* remove exception queue setting in QSL UNM +*/ +hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_DEST_QUEUE , eth_dev->port,0 ); +hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_EN , eth_dev->port,0 ); +hw_mod_qsl_unmq_flush (&ndev->be, eth_dev->port,1 ); +#ifdef FLOW_DEBUG ndev->be.iface->set_debug_mode (ndev->be.be_dev,FLOW_BACKEND_DEBUG_MODE_NONE );#endif
@@ -293,6 +301,12 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_HSH_RCP , ndev->be.hsh.nb_rcp)) goto err_exit; +if (init_resource_elements (ndev,RES_QSL_RCP , ndev->be.qsl.nb_rcp_categories)) + goto err_exit; + +if (init_resource_elements (ndev,RES_QSL_QST , ndev->be.qsl.nb_qst_entries)) + goto err_exit; +if (init_resource_elements (ndev,RES_SLC_LR_RCP , ndev->be.max_categories)) goto err_exit;
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -21,6 +21,7 @@ static const struct { { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, + { "QSL", hw_mod_qsl_alloc, hw_mod_qsl_free, hw_mod_qsl_reset, hw_mod_qsl_present }, };#define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c new file +170 -0
170 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +56 -1
73 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 33/50 net/ntnic: add slicer (SLC LR) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Slicer for Local Retransmit module can cut of the head a packet before the packet leaves the FPGA RX pipeline.
This is used when the TX pipeline is configured
to add a new head in the packet.
--- drivers/net/ntnic/include/hw_mod_backend.h | 21 ++++++ drivers/net/ntnic/meson.build | 1 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 4 ++ .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 65 +++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c
drivers/net/ntnic/include/hw_mod_backend.h +21 -0
@@ -7,6 +7,7 @@#define _HW_MOD_BACKEND_H_#include <stdbool.h> +#include <string.h> #include "ntlog.h"
@@ -580,6 +581,25 @@ struct slc_lr_func_s {struct hw_mod_slc_lr_v2_s v2; }; }; +enum hw_slc_lr_e { +/* functions */ +HW_SLC_LR_RCP_PRESET_ALL =0 , +HW_SLC_LR_RCP_COMPARE , +HW_SLC_LR_RCP_FIND , +/* fields */ +HW_SLC_LR_RCP_HEAD_SLC_EN =FIELD_START_INDEX , +HW_SLC_LR_RCP_HEAD_DYN , +HW_SLC_LR_RCP_HEAD_OFS , +HW_SLC_LR_RCP_TAIL_SLC_EN , +HW_SLC_LR_RCP_TAIL_DYN , +HW_SLC_LR_RCP_TAIL_OFS , +HW_SLC_LR_RCP_PCAP +}; +bool hw_mod_slc_lr_present (struct flow_api_backend_s *be); +int hw_mod_slc_lr_alloc (struct flow_api_backend_s *be); +void hw_mod_slc_lr_free (struct flow_api_backend_s *be); +int hw_mod_slc_lr_reset (struct flow_api_backend_s *be); +int hw_mod_slc_lr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count);struct pdb_func_s {COMMON_FUNC_INFO_S ;
@@ -758,6 +778,7 @@ struct flow_api_backend_s {struct flm_func_s flm;struct hsh_func_s hsh;struct qsl_func_s qsl; +struct slc_lr_func_s slc_lr;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -54,6 +54,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', 'nthw/flow_api/hw_mod/hw_mod_qsl.c', + 'nthw/flow_api/hw_mod/hw_mod_slc_lr.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +4 -0
@@ -22,6 +22,10 @@ static const struct { { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, { "QSL", hw_mod_qsl_alloc, hw_mod_qsl_free, hw_mod_qsl_reset, hw_mod_qsl_present }, + { +"SLC LR" , hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset, + hw_mod_slc_lr_present + }, };#define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 34/50 net/ntnic: add packet descriptor builder (PDB) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The Packet Description Builder module creates packet meta-data for example virtio-net headers.
--- drivers/net/ntnic/include/hw_mod_backend.h | 34 ++++++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 3 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 86 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 40 ++++++++- 6 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c
drivers/net/ntnic/include/hw_mod_backend.h +34 -0
@@ -609,6 +609,39 @@ struct pdb_func_s {struct hw_mod_pdb_v9_s v9; }; }; +enum hw_pdb_e { +/* functions */ +HW_PDB_RCP_PRESET_ALL =0 , +HW_PDB_RCP_COMPARE , +HW_PDB_RCP_FIND , +/* fields */ +HW_PDB_RCP_DESCRIPTOR =FIELD_START_INDEX , +HW_PDB_RCP_DESC_LEN , +HW_PDB_RCP_TX_PORT , +HW_PDB_RCP_TX_IGNORE , +HW_PDB_RCP_TX_NOW , +HW_PDB_RCP_CRC_OVERWRITE , +HW_PDB_RCP_ALIGN , +HW_PDB_RCP_OFS0_DYN , +HW_PDB_RCP_OFS0_REL , +HW_PDB_RCP_OFS1_DYN , +HW_PDB_RCP_OFS1_REL , +HW_PDB_RCP_OFS2_DYN , +HW_PDB_RCP_OFS2_REL , +HW_PDB_RCP_IP_PROT_TNL , +HW_PDB_RCP_PPC_HSH , +HW_PDB_RCP_DUPLICATE_EN , +HW_PDB_RCP_DUPLICATE_BIT , +HW_PDB_RCP_PCAP_KEEP_FCS , +HW_PDB_CONFIG_TS_FORMAT , +HW_PDB_CONFIG_PORT_OFS , +}; +bool hw_mod_pdb_present (struct flow_api_backend_s *be); +int hw_mod_pdb_alloc (struct flow_api_backend_s *be); +void hw_mod_pdb_free (struct flow_api_backend_s *be); +int hw_mod_pdb_reset (struct flow_api_backend_s *be); +int hw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int hw_mod_pdb_config_flush (struct flow_api_backend_s *be);struct tpe_func_s {COMMON_FUNC_INFO_S ;
@@ -779,6 +812,7 @@ struct flow_api_backend_s {struct hsh_func_s hsh;struct qsl_func_s qsl;struct slc_lr_func_s slc_lr; +struct pdb_func_s pdb;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -53,6 +53,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_flm.c', 'nthw/flow_api/hw_mod/hw_mod_hsh.c', 'nthw/flow_api/hw_mod/hw_mod_km.c', + 'nthw/flow_api/hw_mod/hw_mod_pdb.c', 'nthw/flow_api/hw_mod/hw_mod_qsl.c', 'nthw/flow_api/hw_mod/hw_mod_slc_lr.c', 'nthw/flow_filter/flow_nthw_cat.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +3 -0
@@ -301,6 +301,9 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_HSH_RCP , ndev->be.hsh.nb_rcp)) goto err_exit; +if (init_resource_elements (ndev,RES_PDB_RCP , ndev->be.pdb.nb_pdb_rcp_categories)) + goto err_exit; +if (init_resource_elements (ndev,RES_QSL_RCP , ndev->be.qsl.nb_rcp_categories)) goto err_exit;
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -26,6 +26,7 @@ static const struct { "SLC LR", hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset, hw_mod_slc_lr_present }, + { "PDB", hw_mod_pdb_alloc, hw_mod_pdb_free, hw_mod_pdb_reset, hw_mod_pdb_present }, };#define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c new file +86 -0
86 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +39 -1
@@ -1297,6 +1297,43 @@ static nthw_fpga_register_init_s pci_wr_tg_registers[] = { { PCI_WR_TG_TG_WR_RUN, 4, 16, NTHW_FPGA_REG_TYPE_WO, 0, 1, pci_wr_tg_tg_wr_run_fields }, }; +static nthw_fpga_field_init_s pdb_config_fields[] = { + {PDB_CONFIG_PORT_OFS ,6 ,3 ,0 }, + {PDB_CONFIG_TS_FORMAT ,3 ,0 ,0 }, +}; + +static nthw_fpga_field_init_s pdb_rcp_ctrl_fields[] = { + {PDB_RCP_CTRL_ADR ,4 ,0 ,0x0000 }, + {PDB_RCP_CTRL_CNT ,16 ,16 ,0x0000 }, +}; + +static nthw_fpga_field_init_s pdb_rcp_data_fields[] = { + {PDB_RCP_DATA_ALIGN ,1 ,17 ,0x0000 }, + {PDB_RCP_DATA_CRC_OVERWRITE ,1 ,16 ,0x0000 }, + {PDB_RCP_DATA_DESCRIPTOR ,4 ,0 ,0x0000 }, + {PDB_RCP_DATA_DESC_LEN ,5 ,4 ,0 }, + {PDB_RCP_DATA_DUPLICATE_BIT ,5 ,61 ,0x0000 }, + {PDB_RCP_DATA_DUPLICATE_EN ,1 ,60 ,0x0000 }, + {PDB_RCP_DATA_IP_PROT_TNL ,1 ,57 ,0x0000 }, + {PDB_RCP_DATA_OFS0_DYN ,5 ,18 ,0x0000 }, + {PDB_RCP_DATA_OFS0_REL ,8 ,23 ,0x0000 }, + {PDB_RCP_DATA_OFS1_DYN ,5 ,31 ,0x0000 }, + {PDB_RCP_DATA_OFS1_REL ,8 ,36 ,0x0000 }, + {PDB_RCP_DATA_OFS2_DYN ,5 ,44 ,0x0000 }, + {PDB_RCP_DATA_OFS2_REL ,8 ,49 ,0x0000 }, + {PDB_RCP_DATA_PCAP_KEEP_FCS ,1 ,66 ,0x0000 }, + {PDB_RCP_DATA_PPC_HSH ,2 ,58 ,0x0000 }, + {PDB_RCP_DATA_TX_IGNORE ,1 ,14 ,0x0000 }, + {PDB_RCP_DATA_TX_NOW ,1 ,15 ,0x0000 }, + {PDB_RCP_DATA_TX_PORT ,5 ,9 ,0x0000 }, +}; + +static nthw_fpga_register_init_s pdb_registers[] = { + {PDB_CONFIG ,2 ,10 ,NTHW_FPGA_REG_TYPE_WO ,0 ,2 , pdb_config_fields }, + {PDB_RCP_CTRL ,0 ,32 ,NTHW_FPGA_REG_TYPE_WO ,0 ,2 , pdb_rcp_ctrl_fields }, + {PDB_RCP_DATA ,1 ,67 ,NTHW_FPGA_REG_TYPE_WO ,0 ,18 , pdb_rcp_data_fields }, +}; +static nthw_fpga_field_init_s qsl_qen_ctrl_fields[] = { {QSL_QEN_CTRL_ADR ,5 ,0 ,0x0000 }, { QSL_QEN_CTRL_CNT, 16, 16, 0x0000 },
@@ -1510,6 +1547,7 @@ static nthw_fpga_module_init_s fpga_modules[] = {MOD_PCI_WR_TG ,0 ,MOD_PCI_WR_TG ,0 ,1 ,NTHW_FPGA_BUS_TYPE_RAB0 ,2304 ,7 , pci_wr_tg_registers }, + { MOD_PDB, 0, MOD_PDB, 0, 9, NTHW_FPGA_BUS_TYPE_RAB1, 2560, 3, pdb_registers }, { MOD_QSL, 0, MOD_QSL, 0, 7, NTHW_FPGA_BUS_TYPE_RAB1, 1792, 8, qsl_registers }, { MOD_RAC, 0, MOD_RAC, 3, 0, NTHW_FPGA_BUS_TYPE_PCI, 8192, 14, rac_registers }, { MOD_RST9563, 0, MOD_RST9563, 0, 5, NTHW_FPGA_BUS_TYPE_RAB0, 1024, 5, rst9563_registers },
@@ -1672,5 +1710,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { };nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { -200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,19 , fpga_modules, +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,20 , fpga_modules, };
Signature · 1 line
2.45.0
PATCH v2 35/50 net/ntnic: add Tx Packet Editor (TPE) FPGA module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The TX Packet Editor is a software abstraction module, that keeps track of the handful of FPGA modules that are used to edit packets in the TX pipeline.
--- drivers/net/ntnic/include/hw_mod_backend.h | 80 +++++ drivers/net/ntnic/meson.build | 1 + drivers/net/ntnic/nthw/flow_api/flow_api.c | 9 + .../nthw/flow_api/hw_mod/hw_mod_backend.c | 1 + .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 277 ++++++++++++++++++ 5 files changed, 368 insertions(+) create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c
drivers/net/ntnic/include/hw_mod_backend.h +80 -0
@@ -654,6 +654,85 @@ struct tpe_func_s {struct hw_mod_tpe_v3_s v3; }; }; +enum hw_tpe_e { +/* functions */ +HW_TPE_PRESET_ALL =0 , +HW_TPE_FIND , +HW_TPE_COMPARE , +/* Control fields */ +HW_TPE_RPP_RCP_EXP =FIELD_START_INDEX , +HW_TPE_IFR_RCP_IPV4_EN , +HW_TPE_IFR_RCP_IPV4_DF_DROP , +HW_TPE_IFR_RCP_IPV6_EN , +HW_TPE_IFR_RCP_IPV6_DROP , +HW_TPE_IFR_RCP_MTU , +HW_TPE_INS_RCP_DYN , +HW_TPE_INS_RCP_OFS , +HW_TPE_INS_RCP_LEN , +HW_TPE_RPL_RCP_DYN , +HW_TPE_RPL_RCP_OFS , +HW_TPE_RPL_RCP_LEN , +HW_TPE_RPL_RCP_RPL_PTR , +HW_TPE_RPL_RCP_EXT_PRIO , +HW_TPE_RPL_RCP_ETH_TYPE_WR , +HW_TPE_RPL_EXT_RPL_PTR , +HW_TPE_RPL_EXT_META_RPL_LEN ,/* SW only */ +HW_TPE_RPL_RPL_VALUE , +HW_TPE_CPY_RCP_READER_SELECT , +HW_TPE_CPY_RCP_DYN , +HW_TPE_CPY_RCP_OFS , +HW_TPE_CPY_RCP_LEN , +HW_TPE_HFU_RCP_LEN_A_WR , +HW_TPE_HFU_RCP_LEN_A_OUTER_L4_LEN , +HW_TPE_HFU_RCP_LEN_A_POS_DYN , +HW_TPE_HFU_RCP_LEN_A_POS_OFS , +HW_TPE_HFU_RCP_LEN_A_ADD_DYN , +HW_TPE_HFU_RCP_LEN_A_ADD_OFS , +HW_TPE_HFU_RCP_LEN_A_SUB_DYN , +HW_TPE_HFU_RCP_LEN_B_WR , +HW_TPE_HFU_RCP_LEN_B_POS_DYN , +HW_TPE_HFU_RCP_LEN_B_POS_OFS , +HW_TPE_HFU_RCP_LEN_B_ADD_DYN , +HW_TPE_HFU_RCP_LEN_B_ADD_OFS , +HW_TPE_HFU_RCP_LEN_B_SUB_DYN , +HW_TPE_HFU_RCP_LEN_C_WR , +HW_TPE_HFU_RCP_LEN_C_POS_DYN , +HW_TPE_HFU_RCP_LEN_C_POS_OFS , +HW_TPE_HFU_RCP_LEN_C_ADD_DYN , +HW_TPE_HFU_RCP_LEN_C_ADD_OFS , +HW_TPE_HFU_RCP_LEN_C_SUB_DYN , +HW_TPE_HFU_RCP_TTL_WR , +HW_TPE_HFU_RCP_TTL_POS_DYN , +HW_TPE_HFU_RCP_TTL_POS_OFS , +HW_TPE_CSU_RCP_OUTER_L3_CMD , +HW_TPE_CSU_RCP_OUTER_L4_CMD , +HW_TPE_CSU_RCP_INNER_L3_CMD , +HW_TPE_CSU_RCP_INNER_L4_CMD , +}; +bool hw_mod_tpe_present (struct flow_api_backend_s *be); +int hw_mod_tpe_alloc (struct flow_api_backend_s *be); +void hw_mod_tpe_free (struct flow_api_backend_s *be); +int hw_mod_tpe_reset (struct flow_api_backend_s *be); + +int hw_mod_tpe_rpp_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_rpp_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_ins_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_rpl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_rpl_ext_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_rpl_rpl_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_cpy_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_hfu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); + +int hw_mod_tpe_csu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count);enum debug_mode_e {FLOW_BACKEND_DEBUG_MODE_NONE =0x0000 ,
@@ -813,6 +892,7 @@ struct flow_api_backend_s {struct qsl_func_s qsl;struct slc_lr_func_s slc_lr;struct pdb_func_s pdb; +struct tpe_func_s tpe;/* NIC attributes */ unsigned int num_phy_ports;
drivers/net/ntnic/meson.build +1 -0
@@ -56,6 +56,7 @@ sources = files( 'nthw/flow_api/hw_mod/hw_mod_pdb.c', 'nthw/flow_api/hw_mod/hw_mod_qsl.c', 'nthw/flow_api/hw_mod/hw_mod_slc_lr.c', + 'nthw/flow_api/hw_mod/hw_mod_tpe.c', 'nthw/flow_filter/flow_nthw_cat.c', 'nthw/flow_filter/flow_nthw_csu.c', 'nthw/flow_filter/flow_nthw_flm.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c +9 -0
@@ -319,6 +319,15 @@ struct flow_nic_dev *flow_api_create(uint8_t adapter_no, const struct flow_api_bif (init_resource_elements (ndev,RES_FLM_RCP , ndev->be.flm.nb_categories)) goto err_exit; +if (init_resource_elements (ndev,RES_TPE_RCP , ndev->be.tpe.nb_rcp_categories)) + goto err_exit; + +if (init_resource_elements (ndev,RES_TPE_EXT , ndev->be.tpe.nb_rpl_ext_categories)) + goto err_exit; + +if (init_resource_elements (ndev,RES_TPE_RPL , ndev->be.tpe.nb_rpl_depth)) + goto err_exit; +if (init_resource_elements (ndev,RES_SCRUB_RCP , ndev->be.flm.nb_scrub_profiles)) goto err_exit;
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +1 -0
@@ -27,6 +27,7 @@ static const struct { hw_mod_slc_lr_present }, { "PDB", hw_mod_pdb_alloc, hw_mod_pdb_free, hw_mod_pdb_reset, hw_mod_pdb_present }, + { "TPE", hw_mod_tpe_alloc, hw_mod_tpe_free, hw_mod_tpe_reset, hw_mod_tpe_present }, };#define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c new file +277 -0
277 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 36/50 net/ntnic: add receive MAC converter (RMC) core module
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
The RX MAC Converter module is part of the control mechanism of the physical ports.
---
v2
* Fix Typo/Spelling
* Update release notes
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 14 +++ drivers/net/ntnic/include/nt4ga_adapter.h | 1 + drivers/net/ntnic/include/ntnic_stat.h | 11 +++ drivers/net/ntnic/meson.build | 1 + .../net/ntnic/nthw/core/include/nthw_rmc.h | 49 ++++++++++ drivers/net/ntnic/nthw/core/nthw_rmc.c | 90 +++++++++++++++++++ .../supported/nthw_fpga_9563_055_049_0000.c | 29 +++++- .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_rmc.h | 36 ++++++++ 11 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/include/ntnic_stat.h create mode 100644 drivers/net/ntnic/nthw/core/include/nthw_rmc.h create mode 100644 drivers/net/ntnic/nthw/core/nthw_rmc.c create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -106,6 +106,7 @@ New Features * Extended and fixed the implementation of the logging * Added NT flow filter init API * Added NT flow backend initialization API + * Added initialization of FPGA modules related to flow HW offload Removed Items -------------
drivers/net/ntnic/adapter/nt4ga_adapter.c +14 -0
@@ -212,6 +212,20 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) } } +nthw_rmc_t *p_nthw_rmc =nthw_rmc_new (); +if (p_nthw_rmc ==NULL ) { +NT_LOG (ERR ,NTNIC ,"Failed to allocate memory for RMC module\n" ); +return -1 ; + } + + res =nthw_rmc_init (p_nthw_rmc, p_fpga,0 ); +if (res) { +NT_LOG (ERR ,NTNIC ,"Failed to initialize RMC module\n" ); +return -1 ; + } + +nthw_rmc_unblock (p_nthw_rmc, false); +return 0 ; }
drivers/net/ntnic/include/nt4ga_adapter.h +1 -0
@@ -27,6 +27,7 @@ typedef struct hw_info_s {* Services provided by the adapter module */ #include "nt4ga_filter.h" +#include "ntnic_stat.h" typedef struct adapter_info_s { struct nt4ga_filter_s nt4ga_filter;
drivers/net/ntnic/include/ntnic_stat.h new file +11 -0
@@ -0,0 +1,11 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef NTNIC_STAT_H_ +#define NTNIC_STAT_H_ + +#include "nthw_rmc.h" + +#endif /* NTNIC_STAT_H_ */
drivers/net/ntnic/meson.build +1 -0
@@ -41,6 +41,7 @@ sources = files( 'nthw/core/nthw_iic.c', 'nthw/core/nthw_mac_pcs.c', 'nthw/core/nthw_pcie3.c', + 'nthw/core/nthw_rmc.c', 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', 'nthw/flow_api/flow_api.c',
drivers/net/ntnic/nthw/core/include/nthw_rmc.h new file +49 -0
49 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_rmc.c new file +90 -0
90 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +28 -1
@@ -1468,6 +1468,32 @@ static nthw_fpga_register_init_s rac_registers[] = { { RAC_RAB_OB_DATA, 4168, 32, NTHW_FPGA_REG_TYPE_RC1, 0, 1, rac_rab_ob_data_fields }, }; +static nthw_fpga_field_init_s rmc_ctrl_fields[] = { + {RMC_CTRL_BLOCK_KEEPA ,1 ,1 ,1 }, {RMC_CTRL_BLOCK_MAC_PORT ,2 ,8 ,3 }, + {RMC_CTRL_BLOCK_RPP_SLICE ,8 ,10 ,0 }, {RMC_CTRL_BLOCK_STATT ,1 ,0 ,1 }, + {RMC_CTRL_LAG_PHY_ODD_EVEN ,1 ,24 ,0 }, +}; + +static nthw_fpga_field_init_s rmc_dbg_fields[] = { + {RMC_DBG_MERGE ,31 ,0 ,0 }, +}; + +static nthw_fpga_field_init_s rmc_mac_if_fields[] = { + {RMC_MAC_IF_ERR ,31 ,0 ,0 }, +}; + +static nthw_fpga_field_init_s rmc_status_fields[] = { + {RMC_STATUS_DESCR_FIFO_OF ,1 ,16 ,0 }, + {RMC_STATUS_SF_RAM_OF ,1 ,0 ,0 }, +}; + +static nthw_fpga_register_init_s rmc_registers[] = { + {RMC_CTRL ,0 ,25 ,NTHW_FPGA_REG_TYPE_RW ,771 ,5 , rmc_ctrl_fields }, + {RMC_DBG ,2 ,31 ,NTHW_FPGA_REG_TYPE_RO ,0 ,1 , rmc_dbg_fields }, + {RMC_MAC_IF ,3 ,31 ,NTHW_FPGA_REG_TYPE_RO ,0 ,1 , rmc_mac_if_fields }, + {RMC_STATUS ,1 ,17 ,NTHW_FPGA_REG_TYPE_RO ,0 ,2 , rmc_status_fields }, +}; +static nthw_fpga_field_init_s rst9563_ctrl_fields[] = { {RST9563_CTRL_PTP_MMCM_CLKSEL ,1 ,2 ,1 }, { RST9563_CTRL_TS_CLKSEL, 1, 1, 1 },
@@ -1550,6 +1576,7 @@ static nthw_fpga_module_init_s fpga_modules[] = { { MOD_PDB, 0, MOD_PDB, 0, 9, NTHW_FPGA_BUS_TYPE_RAB1, 2560, 3, pdb_registers }, { MOD_QSL, 0, MOD_QSL, 0, 7, NTHW_FPGA_BUS_TYPE_RAB1, 1792, 8, qsl_registers }, { MOD_RAC, 0, MOD_RAC, 3, 0, NTHW_FPGA_BUS_TYPE_PCI, 8192, 14, rac_registers }, + { MOD_RMC, 0, MOD_RMC, 1, 3, NTHW_FPGA_BUS_TYPE_RAB0, 12288, 4, rmc_registers }, { MOD_RST9563, 0, MOD_RST9563, 0, 5, NTHW_FPGA_BUS_TYPE_RAB0, 1024, 5, rst9563_registers }, };
@@ -1710,5 +1737,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { };nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { -200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,20 , fpga_modules, +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,21 , fpga_modules, };
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -34,6 +34,7 @@#define MOD_PDB (0xa7771bffUL)#define MOD_QSL (0x448ed859UL)#define MOD_RAC (0xae830b42UL) +#define MOD_RMC (0x236444eUL)#define MOD_RPP_LR (0xba7f945cUL)#define MOD_RST9563 (0x385d6d1dUL)#define MOD_SDC (0xd2369530UL)
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -35,6 +35,7 @@#include "nthw_fpga_reg_defs_pdb.h" #include "nthw_fpga_reg_defs_qsl.h" #include "nthw_fpga_reg_defs_rac.h" +#include "nthw_fpga_reg_defs_rmc.h" #include "nthw_fpga_reg_defs_rpl.h" #include "nthw_fpga_reg_defs_rpp_lr.h" #include "nthw_fpga_reg_defs_rst9563.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2024 Napatech A/S +*/ + +/* +* nthw_fpga_reg_defs_rmc.h +* +* Auto-generated file - do *NOT* edit +* +*/ + +#ifndef _NTHW_FPGA_REG_DEFS_RMC_ +#define _NTHW_FPGA_REG_DEFS_RMC_ + +/* RMC */ +#define NTHW_MOD_RMC (0x236444eUL) +#define RMC_CTRL (0x4c45f748UL) +#define RMC_CTRL_BLOCK_KEEPA (0x5e036c8UL) +#define RMC_CTRL_BLOCK_MAC_PORT (0x582a6486UL) +#define RMC_CTRL_BLOCK_RPP_SLICE (0x58c719cUL) +#define RMC_CTRL_BLOCK_STATT (0xb36d5342UL) +#define RMC_CTRL_LAG_PHY_ODD_EVEN (0xf4613c9UL) +#define RMC_DBG (0x578721f2UL) +#define RMC_DBG_MERGE (0xebfd6f00UL) +#define RMC_MAC_IF (0x806bb8b0UL) +#define RMC_MAC_IF_ERR (0xa79e974aUL) +#define RMC_STATUS (0x3c415d75UL) +#define RMC_STATUS_DESCR_FIFO_OF (0x7be968baUL) +#define RMC_STATUS_SF_RAM_OF (0x1832173dUL) + +#endif /* _NTHW_FPGA_REG_DEFS_RMC_ */ + +/* +* Auto-generated file - do *NOT* edit +*/
Signature · 1 line
2.45.0
PATCH v2 37/50 net/ntnic: add basic queue operations
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Adds support for queue configure, start, stop, release. The internal macro and functions of ntnic were also added and initialized.
--- doc/guides/nics/features/ntnic.ini | 1 + drivers/net/ntnic/include/ntos_drv.h | 34 +++++ drivers/net/ntnic/ntnic_ethdev.c | 208 +++++++++++++++++++++++++++ drivers/net/ntnic/ntutil/nt_util.c | 10 ++ drivers/net/ntnic/ntutil/nt_util.h | 2 + 5 files changed, 255 insertions(+)
doc/guides/nics/features/ntnic.ini +1 -0
@@ -7,6 +7,7 @@ FW version = Y Speed capabilities = Y Link status = Y +Queue start/stop = Y Unicast MAC filter = Y Multicast MAC filter = Y Linux = Y
drivers/net/ntnic/include/ntos_drv.h +34 -0
@@ -13,6 +13,7 @@#include <rte_ether.h> +#include "stream_binary_flow_api.h" #include "nthw_drv.h" #define NUM_MAC_ADDRS_PER_PORT (16U)
@@ -21,6 +22,32 @@#define NUM_ADAPTER_MAX (8)#define NUM_ADAPTER_PORTS_MAX (128) + +/* Max RSS queues */ +#define MAX_QUEUES 125 + +/* Structs: */ +struct __rte_cache_aligned ntnic_rx_queue { +struct flow_queue_id_s queue;/* queue info - user id and hw queue index */ +struct rte_mempool *mb_pool;/* mbuf memory pool */ +uint16_t buf_size;/* Size of data area in mbuf */ +int enabled;/* Enabling/disabling of this queue */ + +nt_meta_port_type_t type; +uint32_t port;/* Rx port for this queue */ +enum fpga_info_profile profile;/* Inline / Capture */ + +}; + +struct __rte_cache_aligned ntnic_tx_queue { +struct flow_queue_id_s queue;/* queue info - user id and hw queue index */ +nt_meta_port_type_t type; + +uint32_t port;/* Tx port for this queue */ +int enabled;/* Enabling/disabling of this queue */ +enum fpga_info_profile profile;/* Inline / Capture */ +}; +struct pmd_internals {const struct rte_pci_device *pci_dev;char name[20 ];
@@ -30,7 +57,14 @@ struct pmd_internals {unsigned int nb_tx_queues;/* Offset of the VF from the PF */ uint8_t vf_offset; +uint32_t port;nt_meta_port_type_t type; +struct flow_queue_id_s vpq[MAX_QUEUES ]; +unsigned int vpq_nb_vq; +/* Array of Rx queues */ +struct ntnic_rx_queue rxq_scg[MAX_QUEUES ]; +/* Array of Tx queues */ +struct ntnic_tx_queue txq_scg[MAX_QUEUES ];struct drv_s *p_drv;/* Ethernet (MAC) addresses. Element number zero denotes default address. */ struct rte_ether_addr eth_addrs[NUM_MAC_ADDRS_PER_PORT ];
drivers/net/ntnic/ntnic_ethdev.c +208 -0
286 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_util.c +10 -0
@@ -234,3 +234,13 @@ 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) +{ +if (!value_str || !extra_args) +return -1 ; + +const uint32_t value =strtol (value_str,NULL ,0 ); + *(uint32_t *)extra_args = value; +return 0 ; +}
drivers/net/ntnic/ntutil/nt_util.h +2 -0
@@ -57,4 +57,6 @@ 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);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); +#endif /* NTOSS_SYSTEM_NT_UTIL_H */
Signature · 1 line
2.45.0
PATCH v2 38/50 net/ntnic: enhance Ethernet device configuration
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Added eth_dev_close function to handle closing of Ethernet devices. It releases managed RX/TX virtual queues.
Initialized scatter-gather queue system.
Defined constants and macros for hardware RX/TX descriptors and packet buffer sizes.
Defined structures for RX and TX packet headers including fields for packet length, descriptors, and color types.
--- drivers/net/ntnic/include/ntnic_dbs.h | 19 ++++ drivers/net/ntnic/include/ntnic_virt_queue.h | 22 +++++ drivers/net/ntnic/include/ntos_drv.h | 15 ++++ drivers/net/ntnic/nthw/nthw_drv.h | 1 + drivers/net/ntnic/ntnic_ethdev.c | 67 ++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 5 ++ drivers/net/ntnic/ntnic_mod_reg.h | 93 ++++++++++++++++++++ 7 files changed, 222 insertions(+) create mode 100644 drivers/net/ntnic/include/ntnic_dbs.h create mode 100644 drivers/net/ntnic/include/ntnic_virt_queue.h
drivers/net/ntnic/include/ntnic_dbs.h new file +19 -0
@@ -0,0 +1,19 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _NTNIC_DBS_H_ +#define _NTNIC_DBS_H_ + +#include "nthw_fpga_model.h" + +/* +* Struct for implementation of memory bank shadows +*/ + +struct nthw_dbs_s ; + +typedef struct nthw_dbs_s nthw_dbs_t ; + +#endif /* _NTNIC_DBS_H_ */
drivers/net/ntnic/include/ntnic_virt_queue.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __NTOSS_VIRT_QUEUE_H__ +#define __NTOSS_VIRT_QUEUE_H__ + +#include <stdint.h> +#include <stdalign.h> + +#include <rte_memory.h> + +struct nthw_virt_queue ; + +struct nthw_virtq_desc_buf ; + +struct nthw_cvirtq_desc ; + +struct nthw_received_packets ; + +#endif /* __NTOSS_VIRT_QUEUE_H__ */
drivers/net/ntnic/include/ntos_drv.h +15 -0
@@ -27,12 +27,25 @@#define MAX_QUEUES 125/* Structs: */ +struct nthw_memory_descriptor { +void *virt_addr; +uint32_t len; +}; + +struct hwq_s { +int vf_num; +struct nthw_memory_descriptor virt_queues_ctrl; +struct nthw_memory_descriptor *pkt_buffers; +}; +struct __rte_cache_aligned ntnic_rx_queue {struct flow_queue_id_s queue;/* queue info - user id and hw queue index */ struct rte_mempool *mb_pool;/* mbuf memory pool */ uint16_t buf_size;/* Size of data area in mbuf */ int enabled;/* Enabling/disabling of this queue */ +struct hwq_s hwq; +struct nthw_virt_queue *vq;nt_meta_port_type_t type;uint32_t port;/* Rx port for this queue */ enum fpga_info_profile profile;/* Inline / Capture */
@@ -41,6 +54,8 @@ struct __rte_cache_aligned ntnic_rx_queue {struct __rte_cache_aligned ntnic_tx_queue {struct flow_queue_id_s queue;/* queue info - user id and hw queue index */ +struct hwq_s hwq; +struct nthw_virt_queue *vq;nt_meta_port_type_t type;uint32_t port;/* Tx port for this queue */
drivers/net/ntnic/nthw/nthw_drv.h +1 -0
@@ -7,6 +7,7 @@#define __NTHW_DRV_H__#include "nthw_core.h" +#include "ntnic_dbs.h" typedef enum nt_meta_port_type_e { PORT_TYPE_PHYSICAL,
drivers/net/ntnic/ntnic_ethdev.c +67 -0
97 lines not on this page · raw message
drivers/net/ntnic/ntnic_mod_reg.c +5 -0
@@ -5,6 +5,11 @@#include "ntnic_mod_reg.h" +const struct sg_ops_s *get_sg_ops (void ) +{ +return NULL ; +} +static struct link_ops_s *link_100g_ops;void register_100g_link_ops (struct link_ops_s *ops)
drivers/net/ntnic/ntnic_mod_reg.h +93 -0
99 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 39/50 net/ntnic: add scatter-gather HW deallocation
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Deallocates memory for hardware Virtio queues and unmaps VFIO resources.
Updated eth_tx_queue_release and eth_rx_queue_release. Released hardware Virtio queues for TX and RX.
--- drivers/net/ntnic/include/ntos_drv.h | 1 + drivers/net/ntnic/ntnic_ethdev.c | 32 ++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-)
drivers/net/ntnic/include/ntos_drv.h +1 -0
@@ -28,6 +28,7 @@/* Structs: */ struct nthw_memory_descriptor { +void *phys_addr;void *virt_addr;uint32_t len; };
drivers/net/ntnic/ntnic_ethdev.c +28 -4
@@ -34,6 +34,8 @@/* Max RSS queues */ #define MAX_QUEUES 125 +#define ONE_G_SIZE 0x40000000 +#define ETH_DEV_NTNIC_HELP_ARG "help"#define ETH_DEV_NTHW_RXQUEUES_ARG "rxqs"#define ETH_DEV_NTHW_TXQUEUES_ARG "txqs"
@@ -193,16 +195,38 @@ static void release_hw_virtio_queues(struct hwq_s *hwq) hwq->vf_num =0 ; } +static int deallocate_hw_virtio_queues (struct hwq_s *hwq) +{ +int vf_num = hwq->vf_num; + +void *virt = hwq->virt_queues_ctrl.virt_addr; + +int res =nt_vfio_dma_unmap (vf_num, hwq->virt_queues_ctrl.virt_addr, + (uint64_t )hwq->virt_queues_ctrl.phys_addr,ONE_G_SIZE ); + +if (res !=0 ) { +NT_LOG (ERR ,NTNIC ,"VFIO UNMMAP FAILED! res %i, vf_num %i\n" , res, vf_num); +return -1 ; + } + +release_hw_virtio_queues (hwq); +rte_free (hwq->pkt_buffers); +rte_free (virt); +return 0 ; +} +static void eth_tx_queue_release (struct rte_eth_dev *eth_dev,uint16_t queue_id) { - (void )eth_dev; - (void )queue_id; +struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; +struct ntnic_tx_queue *tx_q = &internals->txq_scg[queue_id]; +deallocate_hw_virtio_queues (&tx_q->hwq); }static void eth_rx_queue_release (struct rte_eth_dev *eth_dev,uint16_t queue_id) { - (void )eth_dev; - (void )queue_id; +struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; +struct ntnic_rx_queue *rx_q = &internals->rxq_scg[queue_id]; +deallocate_hw_virtio_queues (&rx_q->hwq); }static int num_queues_alloced;
Signature · 1 line
2.45.0
PATCH v2 40/50 net/ntnic: add queue setup operations
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Added TX and RX queue setup. Handles memory allocation and hardware Virtio queue setup.
Allocates and configures memory for hardware Virtio queues, including handling IOMMU and VFIO mappings.
--- drivers/net/ntnic/include/ntnic_virt_queue.h | 3 +- drivers/net/ntnic/include/ntos_drv.h | 6 + drivers/net/ntnic/nthw/nthw_drv.h | 2 + drivers/net/ntnic/ntnic_ethdev.c | 323 +++++++++++++++++++ 4 files changed, 333 insertions(+), 1 deletion(-)
drivers/net/ntnic/include/ntnic_virt_queue.h +2 -1
@@ -13,7 +13,8 @@struct nthw_virt_queue ; -struct nthw_virtq_desc_buf ; +#define SPLIT_RING 0 +#define IN_ORDER 1struct nthw_cvirtq_desc ;
drivers/net/ntnic/include/ntos_drv.h +6 -0
@@ -47,6 +47,7 @@ struct __rte_cache_aligned ntnic_rx_queue {struct hwq_s hwq;struct nthw_virt_queue *vq; +int nb_hw_rx_descr;nt_meta_port_type_t type;uint32_t port;/* Rx port for this queue */ enum fpga_info_profile profile;/* Inline / Capture */
@@ -57,7 +58,12 @@ struct __rte_cache_aligned ntnic_tx_queue {struct flow_queue_id_s queue;/* queue info - user id and hw queue index */ struct hwq_s hwq;struct nthw_virt_queue *vq; +int nb_hw_tx_descr; +/* Used for bypass in NTDVIO0 header on Tx - pre calculated */ +int target_id;nt_meta_port_type_t type; +/* only used for exception tx queue from OVS SW switching */ +int rss_target_id;uint32_t port;/* Tx port for this queue */ int enabled;/* Enabling/disabling of this queue */
drivers/net/ntnic/nthw/nthw_drv.h +2 -0
@@ -71,6 +71,8 @@ typedef struct fpga_info_s {struct nthw_pcie3 *mp_nthw_pcie3;struct nthw_tsm *mp_nthw_tsm; +nthw_dbs_t *mp_nthw_dbs; +uint8_t *bar0_addr;/* Needed for register read/write */ size_t bar0_size;
drivers/net/ntnic/ntnic_ethdev.c +323 -0
354 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 41/50 net/ntnic: add packet handler for virtio queues
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Added functionality to handles the copying of segmented queue data into a rte_mbuf and vice versa.
Added functionality to manages packet transmission for a specified TX and RX queues.
--- drivers/net/ntnic/include/ntnic_virt_queue.h | 87 +++- drivers/net/ntnic/include/ntos_drv.h | 14 + drivers/net/ntnic/ntnic_ethdev.c | 441 +++++++++++++++++++ 3 files changed, 540 insertions(+), 2 deletions(-)
drivers/net/ntnic/include/ntnic_virt_queue.h +85 -2
@@ -14,10 +14,93 @@struct nthw_virt_queue ;#define SPLIT_RING 0 +#define PACKED_RING 1#define IN_ORDER 1 -struct nthw_cvirtq_desc ; +/* +* SPLIT : This marks a buffer as continuing via the next field. +* PACKED: This marks a buffer as continuing. (packed does not have a next field, so must be +* contiguous) In Used descriptors it must be ignored +*/ +#define VIRTQ_DESC_F_NEXT 1 + +/* +* Split Ring virtq Descriptor +*/ +struct __rte_aligned(8) virtq_desc { +/* Address (guest-physical). */ +uint64_t addr; +/* Length. */ +uint32_t len; +/* The flags as indicated above. */ +uint16_t flags; +/* Next field if flags & NEXT */ +uint16_t next; +}; + +/* descr phys address must be 16 byte aligned */ +struct __rte_aligned(16) pvirtq_desc { +/* Buffer Address. */ +uint64_t addr; +/* Buffer Length. */ +uint32_t len; +/* Buffer ID. */ +uint16_t id; +/* The flags depending on descriptor type. */ +uint16_t flags; +}; + +/* +* Common virtq descr +*/ +#define vq_set_next (vq, index, nxt) \ +do { \ + struct nthw_cvirtq_desc *temp_vq = (vq); \ + if (temp_vq->vq_type == SPLIT_RING) \ + temp_vq->s[index].next = nxt; \ +} while (0) + +#define vq_add_flags (vq, index, flgs) \ +do { \ + struct nthw_cvirtq_desc *temp_vq = (vq); \ + uint16_t tmp_index = (index); \ + typeof(flgs) tmp_flgs = (flgs); \ + if (temp_vq->vq_type == SPLIT_RING) \ + temp_vq->s[tmp_index].flags |= tmp_flgs; \ + else if (temp_vq->vq_type == PACKED_RING) \ + temp_vq->p[tmp_index].flags |= tmp_flgs; \ +} while (0) + +#define vq_set_flags (vq, index, flgs) \ +do { \ + struct nthw_cvirtq_desc *temp_vq = (vq); \ + uint32_t temp_flags = (flgs); \ + uint32_t temp_index = (index); \ + if ((temp_vq)->vq_type == SPLIT_RING) \ + (temp_vq)->s[temp_index].flags = temp_flags; \ + else if ((temp_vq)->vq_type == PACKED_RING) \ + (temp_vq)->p[temp_index].flags = temp_flags; \ +} while (0) + +struct nthw_virtq_desc_buf { +/* Address (guest-physical). */ + alignas(16 )uint64_t addr; +/* Length. */ +uint32_t len; +}; + +struct nthw_cvirtq_desc { +union { +struct nthw_virtq_desc_buf *b;/* buffer part as is common */ +struct virtq_desc *s;/* SPLIT */ +struct pvirtq_desc *p;/* PACKED */ + }; +uint16_t vq_type; +}; -struct nthw_received_packets ; +struct nthw_received_packets { +void *addr; +uint32_t len; +};#endif /* __NTOSS_VIRT_QUEUE_H__ */
drivers/net/ntnic/include/ntos_drv.h +14 -0
@@ -27,6 +27,20 @@#define MAX_QUEUES 125/* Structs: */ +#define SG_HDR_SIZE 12 + +struct _pkt_hdr_rx { +uint32_t cap_len:14 ; +uint32_t fid:10 ; +uint32_t ofs1:8 ; +uint32_t ip_prot:8 ; +uint32_t port:13 ; +uint32_t descr:8 ; +uint32_t descr_12b:1 ; +uint32_t color_type:2 ; +uint32_t color:32 ; +}; +struct nthw_memory_descriptor {void *phys_addr;void *virt_addr;
drivers/net/ntnic/ntnic_ethdev.c +441 -0
462 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 42/50 net/ntnic: add init for virt queues in the DBS
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
DBS (DVIO Buffer System) module controls the scatter-gather buffer system that let's the host CPU interact with packets.
Macros and Definitions: Defined constants for queue management and polling speeds.
Data Structures: Added structures and arrays for RX and TX queue management.
Procedures: Implemented initialization routines for setting up queues and configuring Direct Buffer Storage (DBS) in FPGA.
Main Initialization: Allocates DBS modules, resets, and configures RX and TX queues.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 154 ++++++++++++++++++ drivers/net/ntnic/include/ntnic_dbs.h | 71 +++++++- drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 135 +++++++++++++++ .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 1 + drivers/net/ntnic/ntnic_mod_reg.c | 11 +- drivers/net/ntnic/ntnic_mod_reg.h | 2 + 7 files changed, 374 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c create mode 100644 drivers/net/ntnic/nthw/dbs/nthw_dbs.c
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c new file +154 -0
@@ -0,0 +1,154 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include <unistd.h> + +#include "ntos_drv.h" +#include "ntnic_virt_queue.h" +#include "ntnic_mod_reg.h" +#include "ntlog.h" + +#define MAX_VIRT_QUEUES 128 + +#define LAST_QUEUE 127 +#define DISABLE 0 +#define ENABLE 1 +#define RX_AM_DISABLE DISABLE +#define RX_AM_ENABLE ENABLE +#define RX_UW_DISABLE DISABLE +#define RX_UW_ENABLE ENABLE +#define RX_Q_DISABLE DISABLE +#define RX_Q_ENABLE ENABLE +#define RX_AM_POLL_SPEED 5 +#define RX_UW_POLL_SPEED 9 +#define INIT_QUEUE 1 + +#define TX_AM_DISABLE DISABLE +#define TX_AM_ENABLE ENABLE +#define TX_UW_DISABLE DISABLE +#define TX_UW_ENABLE ENABLE +#define TX_Q_DISABLE DISABLE +#define TX_Q_ENABLE ENABLE +#define TX_AM_POLL_SPEED 5 +#define TX_UW_POLL_SPEED 8 + +enum nthw_virt_queue_usage { +NTHW_VIRTQ_UNUSED =0 +}; + +struct nthw_virt_queue { +enum nthw_virt_queue_usage usage; +}; + +static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES ]; +static struct nthw_virt_queue txvq[MAX_VIRT_QUEUES ]; + +static void dbs_init_rx_queue (nthw_dbs_t *p_nthw_dbs,uint32_t queue,uint32_t start_idx, +uint32_t start_ptr) +{ +uint32_t busy; +uint32_t init; +uint32_t dummy; + +do { +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); + +do { +get_rx_init (p_nthw_dbs, &init, &dummy, &busy); + }while (busy !=0 ); +} + +static void dbs_init_tx_queue (nthw_dbs_t *p_nthw_dbs,uint32_t queue,uint32_t start_idx, +uint32_t start_ptr) +{ +uint32_t busy; +uint32_t init; +uint32_t dummy; + +do { +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); + }while (busy !=0 ); +} + +static int nthw_virt_queue_init (struct fpga_info_s *p_fpga_info) +{ +assert (p_fpga_info); + +nthw_fpga_t *const p_fpga = p_fpga_info->mp_fpga; +nthw_dbs_t *p_nthw_dbs; +int res =0 ; +uint32_t i; + + p_fpga_info->mp_nthw_dbs =NULL ; + + p_nthw_dbs =nthw_dbs_new (); + +if (p_nthw_dbs ==NULL ) +return -1 ; + + res =dbs_init (NULL , p_fpga,0 );/* Check that DBS exists in FPGA */ + +if (res) { +free (p_nthw_dbs); +return res; + } + + res =dbs_init (p_nthw_dbs, p_fpga,0 );/* Create DBS module */ + +if (res) { +free (p_nthw_dbs); +return res; + } + + p_fpga_info->mp_nthw_dbs = p_nthw_dbs; + +for (i =0 ; i <MAX_VIRT_QUEUES ; ++i) { + rxvq[i].usage =NTHW_VIRTQ_UNUSED ; + txvq[i].usage =NTHW_VIRTQ_UNUSED ; + } + +dbs_reset (p_nthw_dbs); + +for (i =0 ; i <NT_DBS_RX_QUEUES_MAX ; ++i) +dbs_init_rx_queue (p_nthw_dbs, i,0 ,0 ); + +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 , +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 , +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 , +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 , +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 , +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 , +TX_UW_POLL_SPEED ,TX_Q_ENABLE ); + +return 0 ; +} + +static struct sg_ops_s sg_ops = { + .nthw_virt_queue_init = nthw_virt_queue_init +}; + +void sg_init (void ) +{ +NT_LOG (INF ,NTNIC ,"SG ops initialized\n" ); +register_sg_ops (&sg_ops); +}
drivers/net/ntnic/include/ntnic_dbs.h +70 -1
82 lines not on this page · raw message
drivers/net/ntnic/meson.build +2 -0
@@ -24,9 +24,11 @@ includes = [ # all sources sources = files( 'adapter/nt4ga_adapter.c', + 'dbsconfig/ntnic_dbsconfig.c', 'link_mgmt/link_100g/nt4ga_link_100g.c', 'link_mgmt/nt4ga_link.c', 'nim/i2c_nim.c', + 'nthw/dbs/nthw_dbs.c', 'nthw/supported/nthw_fpga_9563_055_049_0000.c', 'nthw/supported/nthw_fpga_instances.c', 'nthw/supported/nthw_fpga_mod_str_map.c',
drivers/net/ntnic/nthw/dbs/nthw_dbs.c new file +135 -0
135 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +1 -0
@@ -16,6 +16,7 @@#define MOD_UNKNOWN (0L)/* Unknown/uninitialized - keep this as the first element */ #define MOD_CAT (0x30b447c2UL)#define MOD_CSU (0x3f470787UL) +#define MOD_DBS (0x80b29727UL)#define MOD_FLM (0xe7ba53a4UL)#define MOD_GFG (0xfc423807UL)#define MOD_GMF (0x68b1d15aUL)
drivers/net/ntnic/ntnic_mod_reg.c +10 -1
@@ -5,9 +5,18 @@#include "ntnic_mod_reg.h" +static struct sg_ops_s *sg_ops; + +void register_sg_ops (struct sg_ops_s *ops) +{ + sg_ops = ops; +} +const struct sg_ops_s *get_sg_ops (void ) { -return NULL ; +if (sg_ops ==NULL ) +sg_init (); +return sg_ops; }static struct link_ops_s *link_100g_ops;
drivers/net/ntnic/ntnic_mod_reg.h +2 -0
@@ -105,7 +105,9 @@ struct sg_ops_s {int (*nthw_virt_queue_init)(struct fpga_info_s *p_fpga_info); }; +void register_sg_ops (struct sg_ops_s *ops);const struct sg_ops_s *get_sg_ops (void ); +void sg_init (void );struct link_ops_s {int (*link_init)(struct adapter_info_s *p_adapter_info,nthw_fpga_t *p_fpga);
Signature · 1 line
2.45.0
PATCH v2 43/50 net/ntnic: add split-queue support
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Split-queue support was added.
Internal structures were enhanced with additional managmnet fields.
Implement a managed virtual queue function based on the queue type and configuration parameters.
DBS control registers were added.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 411 +++++++++++++++++- drivers/net/ntnic/include/ntnic_dbs.h | 19 + drivers/net/ntnic/include/ntnic_virt_queue.h | 7 + drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 125 +++++- .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../nthw/supported/nthw_fpga_reg_defs_dbs.h | 79 ++++ 6 files changed, 640 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +410 -1
@@ -10,6 +10,7 @@#include "ntnic_mod_reg.h" #include "ntlog.h" +#define STRUCT_ALIGNMENT (4 * 1024LU)#define MAX_VIRT_QUEUES 128#define LAST_QUEUE 127
@@ -34,12 +35,79 @@#define TX_AM_POLL_SPEED 5#define TX_UW_POLL_SPEED 8 +#define VIRTQ_AVAIL_F_NO_INTERRUPT 1 + +struct __rte_aligned(8) virtq_avail { +uint16_t flags; +uint16_t idx; +uint16_t ring[];/* Queue Size */ +}; + +struct __rte_aligned(8) virtq_used_elem { +/* Index of start of used descriptor chain. */ +uint32_t id; +/* Total length of the descriptor chain which was used (written to) */ +uint32_t len; +}; + +struct __rte_aligned(8) virtq_used { +uint16_t flags; +uint16_t idx; +struct virtq_used_elem ring[];/* Queue Size */ +}; + +struct virtq_struct_layout_s { +size_t used_offset; +size_t desc_offset; +}; +enum nthw_virt_queue_usage { -NTHW_VIRTQ_UNUSED =0 +NTHW_VIRTQ_UNUSED =0 , +NTHW_VIRTQ_UNMANAGED , +NTHW_VIRTQ_MANAGED };struct nthw_virt_queue { +/* Pointers to virt-queue structs */ +struct { +/* SPLIT virtqueue */ +struct virtq_avail *p_avail; +struct virtq_used *p_used; +struct virtq_desc *p_desc; +/* Control variables for virt-queue structs */ +uint16_t am_idx; +uint16_t used_idx; +uint16_t cached_idx; +uint16_t tx_descr_avail_idx; + }; + +/* Array with packet buffers */ +struct nthw_memory_descriptor *p_virtual_addr; + +/* Queue configuration info */ +nthw_dbs_t *mp_nthw_dbs; +enum nthw_virt_queue_usage usage; +uint16_t irq_vector; +uint16_t vq_type; +uint16_t in_order; + +uint16_t queue_size; +uint32_t index; +uint32_t am_enable; +uint32_t host_id; +uint32_t port;/* Only used by TX queues */ +uint32_t virtual_port;/* Only used by TX queues */ +/* +* Only used by TX queues: +* 0: VirtIO-Net header (12 bytes). +* 1: Napatech DVIO0 descriptor (12 bytes). +*/ +}; + +struct pvirtq_struct_layout_s { +size_t driver_event_offset; +size_t device_event_offset; };static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES ];
@@ -143,7 +211,348 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)return 0 ; } +static struct virtq_struct_layout_s dbs_calc_struct_layout (uint32_t queue_size) +{ +/* + sizeof(uint16_t); ("avail->used_event" is not used) */ +size_t avail_mem =sizeof (struct virtq_avail ) + queue_size *sizeof (uint16_t ); +size_t avail_mem_aligned = ((avail_mem %STRUCT_ALIGNMENT ) ==0 ) + ? avail_mem + :STRUCT_ALIGNMENT * (avail_mem /STRUCT_ALIGNMENT +1 ); + +/* + sizeof(uint16_t); ("used->avail_event" is not used) */ +size_t used_mem =sizeof (struct virtq_used ) + queue_size *sizeof (struct virtq_used_elem ); +size_t used_mem_aligned = ((used_mem %STRUCT_ALIGNMENT ) ==0 ) + ? used_mem + :STRUCT_ALIGNMENT * (used_mem /STRUCT_ALIGNMENT +1 ); + +struct virtq_struct_layout_s virtq_layout; + virtq_layout.used_offset = avail_mem_aligned; + virtq_layout.desc_offset = avail_mem_aligned + used_mem_aligned; + +return virtq_layout; +} + +static void dbs_initialize_avail_struct (void *addr,uint16_t queue_size, +uint16_t initial_avail_idx) +{ +uint16_t i; +struct virtq_avail *p_avail = (struct virtq_avail *)addr; + + p_avail->flags =VIRTQ_AVAIL_F_NO_INTERRUPT ; + p_avail->idx = initial_avail_idx; + +for (i =0 ; i < queue_size; ++i) + p_avail->ring[i] = i; +} + +static void dbs_initialize_used_struct (void *addr,uint16_t queue_size) +{ +int i; +struct virtq_used *p_used = (struct virtq_used *)addr; + + p_used->flags =1 ; + p_used->idx =0 ; + +for (i =0 ; i < queue_size; ++i) { + p_used->ring[i].id =0 ; + p_used->ring[i].len =0 ; + } +} + +static void +dbs_initialize_descriptor_struct (void *addr, +struct nthw_memory_descriptor *packet_buffer_descriptors, +uint16_t queue_size,uint16_t flgs) +{ +if (packet_buffer_descriptors) { +int i; +struct virtq_desc *p_desc = (struct virtq_desc *)addr; + +for (i =0 ; i < queue_size; ++i) { + p_desc[i].addr = (uint64_t )packet_buffer_descriptors[i].phys_addr; + p_desc[i].len = packet_buffer_descriptors[i].len; + p_desc[i].flags = flgs; + p_desc[i].next =0 ; + } + } +} + +static void +dbs_initialize_virt_queue_structs (void *avail_struct_addr,void *used_struct_addr, +void *desc_struct_addr, +struct nthw_memory_descriptor *packet_buffer_descriptors, +uint16_t queue_size,uint16_t initial_avail_idx,uint16_t flgs) +{ +dbs_initialize_avail_struct (avail_struct_addr, queue_size, initial_avail_idx); +dbs_initialize_used_struct (used_struct_addr, queue_size); +dbs_initialize_descriptor_struct (desc_struct_addr, packet_buffer_descriptors, queue_size, + flgs); +} + +static struct nthw_virt_queue *nthw_setup_rx_virt_queue (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint16_t start_idx, +uint16_t start_ptr, +void *avail_struct_phys_addr, +void *used_struct_phys_addr, +void *desc_struct_phys_addr, +uint16_t queue_size, +uint32_t host_id, +uint32_t header, +uint32_t vq_type, +int irq_vector) +{ + (void )header; + (void )desc_struct_phys_addr; + (void )avail_struct_phys_addr; + (void )used_struct_phys_addr; + + +/* +* 5. Initialize all RX queues (all DBS_RX_QUEUES of them) using the +* DBS.RX_INIT register. +*/ +dbs_init_rx_queue (p_nthw_dbs, index, start_idx, start_ptr); + +/* Save queue state */ + rxvq[index].usage =NTHW_VIRTQ_UNMANAGED ; + rxvq[index].mp_nthw_dbs = p_nthw_dbs; + rxvq[index].index = index; + rxvq[index].queue_size = queue_size; + rxvq[index].am_enable = (irq_vector <0 ) ?RX_AM_ENABLE :RX_AM_DISABLE ; + rxvq[index].host_id = host_id; + rxvq[index].vq_type = vq_type; + rxvq[index].in_order =0 ;/* not used */ + rxvq[index].irq_vector = irq_vector; + +/* Return queue handle */ +return &rxvq[index]; +} + +static struct nthw_virt_queue *nthw_setup_tx_virt_queue (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint16_t start_idx, +uint16_t start_ptr, +void *avail_struct_phys_addr, +void *used_struct_phys_addr, +void *desc_struct_phys_addr, +uint16_t queue_size, +uint32_t host_id, +uint32_t port, +uint32_t virtual_port, +uint32_t header, +uint32_t vq_type, +int irq_vector, +uint32_t in_order) +{ + (void )header; + (void )desc_struct_phys_addr; + (void )avail_struct_phys_addr; + (void )used_struct_phys_addr; + +/* +* 5. Initialize all TX queues (all DBS_TX_QUEUES of them) using the +* DBS.TX_INIT register. +*/ +dbs_init_tx_queue (p_nthw_dbs, index, start_idx, start_ptr); + +/* Save queue state */ + txvq[index].usage =NTHW_VIRTQ_UNMANAGED ; + txvq[index].mp_nthw_dbs = p_nthw_dbs; + txvq[index].index = index; + txvq[index].queue_size = queue_size; + txvq[index].am_enable = (irq_vector <0 ) ?TX_AM_ENABLE :TX_AM_DISABLE ; + txvq[index].host_id = host_id; + txvq[index].port = port; + txvq[index].virtual_port = virtual_port; + txvq[index].vq_type = vq_type; + txvq[index].in_order = in_order; + txvq[index].irq_vector = irq_vector; + +/* Return queue handle */ +return &txvq[index]; +} + +static struct nthw_virt_queue * +nthw_setup_mngd_rx_virt_queue_split (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t header, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers, +int irq_vector) +{ +struct virtq_struct_layout_s virtq_struct_layout =dbs_calc_struct_layout (queue_size); + +dbs_initialize_virt_queue_structs (p_virt_struct_area->virt_addr, + (char *)p_virt_struct_area->virt_addr + + virtq_struct_layout.used_offset, + (char *)p_virt_struct_area->virt_addr + + virtq_struct_layout.desc_offset, + p_packet_buffers, + (uint16_t )queue_size, + p_packet_buffers ? (uint16_t )queue_size :0 , +VIRTQ_DESC_F_WRITE /* Rx */ ); + + rxvq[index].p_avail = p_virt_struct_area->virt_addr; + rxvq[index].p_used = + (void *)((char *)p_virt_struct_area->virt_addr + virtq_struct_layout.used_offset); + rxvq[index].p_desc = + (void *)((char *)p_virt_struct_area->virt_addr + virtq_struct_layout.desc_offset); + + rxvq[index].am_idx = p_packet_buffers ? (uint16_t )queue_size :0 ; + rxvq[index].used_idx =0 ; + rxvq[index].cached_idx =0 ; + rxvq[index].p_virtual_addr =NULL ; + +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)); + } + +nthw_setup_rx_virt_queue (p_nthw_dbs, index,0 ,0 , (void *)p_virt_struct_area->phys_addr, + (char *)p_virt_struct_area->phys_addr + + virtq_struct_layout.used_offset, + (char *)p_virt_struct_area->phys_addr + + virtq_struct_layout.desc_offset, + (uint16_t )queue_size, host_id, header,SPLIT_RING , irq_vector); + + rxvq[index].usage =NTHW_VIRTQ_MANAGED ; + +return &rxvq[index]; +} + +static struct nthw_virt_queue * +nthw_setup_mngd_tx_virt_queue_split (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t port, +uint32_t virtual_port, +uint32_t header, +int irq_vector, +uint32_t in_order, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers) +{ +struct virtq_struct_layout_s virtq_struct_layout =dbs_calc_struct_layout (queue_size); + +dbs_initialize_virt_queue_structs (p_virt_struct_area->virt_addr, + (char *)p_virt_struct_area->virt_addr + + virtq_struct_layout.used_offset, + (char *)p_virt_struct_area->virt_addr + + virtq_struct_layout.desc_offset, + p_packet_buffers, + (uint16_t )queue_size, +0 , +0 /* Tx */ ); + + txvq[index].p_avail = p_virt_struct_area->virt_addr; + txvq[index].p_used = + (void *)((char *)p_virt_struct_area->virt_addr + virtq_struct_layout.used_offset); + txvq[index].p_desc = + (void *)((char *)p_virt_struct_area->virt_addr + virtq_struct_layout.desc_offset); + txvq[index].queue_size = (uint16_t )queue_size; + txvq[index].am_idx =0 ; + txvq[index].used_idx =0 ; + txvq[index].cached_idx =0 ; + txvq[index].p_virtual_addr =NULL ; + + txvq[index].tx_descr_avail_idx =0 ; + +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)); + } + +nthw_setup_tx_virt_queue (p_nthw_dbs, index,0 ,0 , (void *)p_virt_struct_area->phys_addr, + (char *)p_virt_struct_area->phys_addr + + virtq_struct_layout.used_offset, + (char *)p_virt_struct_area->phys_addr + + virtq_struct_layout.desc_offset, + (uint16_t )queue_size, host_id, port, virtual_port, header, +SPLIT_RING , irq_vector, in_order); + + txvq[index].usage =NTHW_VIRTQ_MANAGED ; + +return &txvq[index]; +} + +/* +* Create a Managed Rx Virt Queue +* +* Notice: The queue will be created with interrupts disabled. +* If interrupts are required, make sure to call nthw_enable_rx_virt_queue() +* afterwards. +*/ +static struct nthw_virt_queue * +nthw_setup_mngd_rx_virt_queue (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t header, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers, +uint32_t vq_type, +int irq_vector) +{ +switch (vq_type) { +case SPLIT_RING : +return nthw_setup_mngd_rx_virt_queue_split (p_nthw_dbs, index, queue_size, + host_id, header, p_virt_struct_area, + p_packet_buffers, irq_vector); + +default : +break ; + } + +return NULL ; +} + +/* +* Create a Managed Tx Virt Queue +* +* Notice: The queue will be created with interrupts disabled. +* If interrupts are required, make sure to call nthw_enable_tx_virt_queue() +* afterwards. +*/ +static struct nthw_virt_queue * +nthw_setup_mngd_tx_virt_queue (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t port, +uint32_t virtual_port, +uint32_t header, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers, +uint32_t vq_type, +int irq_vector, +uint32_t in_order) +{ +switch (vq_type) { +case SPLIT_RING : +return nthw_setup_mngd_tx_virt_queue_split (p_nthw_dbs, index, queue_size, + host_id, port, virtual_port, header, + irq_vector, in_order, + p_virt_struct_area, + p_packet_buffers); + +default : +break ; + } + +return NULL ; +} +static struct sg_ops_s sg_ops = { + .nthw_setup_rx_virt_queue = nthw_setup_rx_virt_queue, + .nthw_setup_tx_virt_queue = nthw_setup_tx_virt_queue, + .nthw_setup_mngd_rx_virt_queue = nthw_setup_mngd_rx_virt_queue, + .nthw_setup_mngd_tx_virt_queue = nthw_setup_mngd_tx_virt_queue, .nthw_virt_queue_init = nthw_virt_queue_init };
drivers/net/ntnic/include/ntnic_dbs.h +19 -0
@@ -47,6 +47,11 @@ struct nthw_dbs_s {nthw_field_t *mp_fld_rx_init_val_idx;nthw_field_t *mp_fld_rx_init_val_ptr; +nthw_register_t *mp_reg_rx_ptr; +nthw_field_t *mp_fld_rx_ptr_ptr; +nthw_field_t *mp_fld_rx_ptr_queue; +nthw_field_t *mp_fld_rx_ptr_valid; +nthw_register_t *mp_reg_tx_init;nthw_field_t *mp_fld_tx_init_init;nthw_field_t *mp_fld_tx_init_queue;
@@ -56,6 +61,20 @@ struct nthw_dbs_s {nthw_field_t *mp_fld_tx_init_val_idx;nthw_field_t *mp_fld_tx_init_val_ptr; +nthw_register_t *mp_reg_tx_ptr; +nthw_field_t *mp_fld_tx_ptr_ptr; +nthw_field_t *mp_fld_tx_ptr_queue; +nthw_field_t *mp_fld_tx_ptr_valid; + +nthw_register_t *mp_reg_rx_idle; +nthw_field_t *mp_fld_rx_idle_idle; +nthw_field_t *mp_fld_rx_idle_queue; +nthw_field_t *mp_fld_rx_idle_busy; + +nthw_register_t *mp_reg_tx_idle; +nthw_field_t *mp_fld_tx_idle_idle; +nthw_field_t *mp_fld_tx_idle_queue; +nthw_field_t *mp_fld_tx_idle_busy; };typedef struct nthw_dbs_s nthw_dbs_t ;
drivers/net/ntnic/include/ntnic_virt_queue.h +7 -0
@@ -23,6 +23,13 @@ struct nthw_virt_queue;* contiguous) In Used descriptors it must be ignored */ #define VIRTQ_DESC_F_NEXT 1 +/* +* SPLIT : This marks a buffer as device write-only (otherwise device read-only). +* PACKED: This marks a descriptor as device write-only (otherwise device read-only). +* PACKED: In a used descriptor, this bit is used to specify whether any data has been written by +* the device into any parts of the buffer. +*/ +#define VIRTQ_DESC_F_WRITE 2/* * Split Ring virtq Descriptor
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +124 -1
136 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +1 -0
@@ -16,6 +16,7 @@#include "nthw_fpga_reg_defs_cat.h" #include "nthw_fpga_reg_defs_cpy.h" #include "nthw_fpga_reg_defs_csu.h" +#include "nthw_fpga_reg_defs_dbs.h" #include "nthw_fpga_reg_defs_flm.h" #include "nthw_fpga_reg_defs_gfg.h" #include "nthw_fpga_reg_defs_gmf.h"
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h new file +79 -0
79 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 44/50 net/ntnic: add functions for availability monitor management
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Implemented functions to configure and manage availability monitor data.
Added functions to set and flush availability monitor data.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 61 +++- drivers/net/ntnic/include/ntnic_dbs.h | 72 +++++ drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 271 ++++++++++++++++++ .../nthw/supported/nthw_fpga_reg_defs_dbs.h | 23 ++ 4 files changed, 420 insertions(+), 7 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +54 -7
@@ -103,11 +103,7 @@ struct nthw_virt_queue {* 0: VirtIO-Net header (12 bytes). * 1: Napatech DVIO0 descriptor (12 bytes). */ -}; - -struct pvirtq_struct_layout_s { -size_t driver_event_offset; -size_t device_event_offset; +void *avail_struct_phys_addr; };static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES ];
@@ -304,9 +300,22 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, { (void )header; (void )desc_struct_phys_addr; - (void )avail_struct_phys_addr; (void )used_struct_phys_addr; +/* +* 2. Configure the DBS.RX_AM_DATA memory and enable the queues you plan to use; +* good idea to initialize all DBS_RX_QUEUES entries. +* Notice: We do this only for queues that don't require interrupts (i.e. if +* irq_vector < 0). Queues that require interrupts will have RX_AM_DATA enabled +* at a later time (after we have enabled vfio interrupts in the kernel). +*/ +if (irq_vector <0 ) { +if (set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, +RX_AM_DISABLE , host_id,0 , + irq_vector >=0 ?1 :0 ) !=0 ) { +return NULL ; + } + }/* * 5. Initialize all RX queues (all DBS_RX_QUEUES of them) using the
@@ -314,6 +323,15 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,*/ dbs_init_rx_queue (p_nthw_dbs, index, start_idx, start_ptr); +/* +* 2. Configure the DBS.RX_AM_DATA memory and enable the queues you plan to use; +* good idea to initialize all DBS_RX_QUEUES entries. +*/ +if (set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr,RX_AM_ENABLE , + host_id,0 , irq_vector >=0 ?1 :0 ) !=0 ) { +return NULL ; + } +/* Save queue state */ rxvq[index].usage =NTHW_VIRTQ_UNMANAGED ; rxvq[index].mp_nthw_dbs = p_nthw_dbs;
@@ -321,6 +339,7 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, rxvq[index].queue_size = queue_size; rxvq[index].am_enable = (irq_vector <0 ) ?RX_AM_ENABLE :RX_AM_DISABLE ; rxvq[index].host_id = host_id; + rxvq[index].avail_struct_phys_addr = avail_struct_phys_addr; rxvq[index].vq_type = vq_type; rxvq[index].in_order =0 ;/* not used */ rxvq[index].irq_vector = irq_vector;
@@ -347,15 +366,42 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, { (void )header; (void )desc_struct_phys_addr; - (void )avail_struct_phys_addr; (void )used_struct_phys_addr; +/* +* 2. Configure the DBS.TX_AM_DATA memory and enable the queues you plan to use; +* good idea to initialize all DBS_TX_QUEUES entries. +*/ +if (set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr,TX_AM_DISABLE , + host_id,0 , irq_vector >=0 ?1 :0 ) !=0 ) { +return NULL ; + } +/* * 5. Initialize all TX queues (all DBS_TX_QUEUES of them) using the * DBS.TX_INIT register. */ dbs_init_tx_queue (p_nthw_dbs, index, start_idx, start_ptr); +if (nthw_dbs_set_tx_qp_data (p_nthw_dbs, index, virtual_port) !=0 ) +return NULL ; + +/* +* 2. Configure the DBS.TX_AM_DATA memory and enable the queues you plan to use; +* good idea to initialize all DBS_TX_QUEUES entries. +* Notice: We do this only for queues that don't require interrupts (i.e. if +* irq_vector < 0). Queues that require interrupts will have TX_AM_DATA +* enabled at a later time (after we have enabled vfio interrupts in the +* kernel). +*/ +if (irq_vector <0 ) { +if (set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, +TX_AM_ENABLE , host_id,0 , + irq_vector >=0 ?1 :0 ) !=0 ) { +return NULL ; + } + } +/* Save queue state */ txvq[index].usage =NTHW_VIRTQ_UNMANAGED ; txvq[index].mp_nthw_dbs = p_nthw_dbs;
@@ -365,6 +411,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, txvq[index].host_id = host_id; txvq[index].port = port; txvq[index].virtual_port = virtual_port; + txvq[index].avail_struct_phys_addr = avail_struct_phys_addr; txvq[index].vq_type = vq_type; txvq[index].in_order = in_order; txvq[index].irq_vector = irq_vector;
drivers/net/ntnic/include/ntnic_dbs.h +72 -0
89 lines not on this page · raw message
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +271 -0
294 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h +23 -0
@@ -14,6 +14,15 @@#define _NTHW_FPGA_REG_DEFS_DBS_/* DBS */ +#define DBS_RX_AM_CTRL (0x7359feUL) +#define DBS_RX_AM_CTRL_ADR (0x4704a1UL) +#define DBS_RX_AM_CTRL_CNT (0x104f9d70UL) +#define DBS_RX_AM_DATA (0xafa2dbe7UL) +#define DBS_RX_AM_DATA_ENABLE (0x11658278UL) +#define DBS_RX_AM_DATA_GPA (0xbf307344UL) +#define DBS_RX_AM_DATA_HID (0x5f0669eeUL) +#define DBS_RX_AM_DATA_INT (0xc32857aUL) +#define DBS_RX_AM_DATA_PCKED (0x7d840fb4UL)#define DBS_RX_CONTROL (0xb18b2866UL)#define DBS_RX_CONTROL_AME (0x1f9219acUL)#define DBS_RX_CONTROL_AMS (0xeb46acfdUL)
@@ -38,6 +47,15 @@#define DBS_RX_PTR_VALID (0xbcc5ec4dUL)#define DBS_STATUS (0xb5f35220UL)#define DBS_STATUS_OK (0xcf09a30fUL) +#define DBS_TX_AM_CTRL (0xd6d29b9UL) +#define DBS_TX_AM_CTRL_ADR (0xf8854f17UL) +#define DBS_TX_AM_CTRL_CNT (0xe88dd6c6UL) +#define DBS_TX_AM_DATA (0xa2bcaba0UL) +#define DBS_TX_AM_DATA_ENABLE (0xb6513570UL) +#define DBS_TX_AM_DATA_GPA (0x47f238f2UL) +#define DBS_TX_AM_DATA_HID (0xa7c42258UL) +#define DBS_TX_AM_DATA_INT (0xf4f0ceccUL) +#define DBS_TX_AM_DATA_PCKED (0x2e156650UL)#define DBS_TX_CONTROL (0xbc955821UL)#define DBS_TX_CONTROL_AME (0xe750521aUL)#define DBS_TX_CONTROL_AMS (0x1384e74bUL)
@@ -71,6 +89,11 @@#define DBS_TX_QOS_RATE (0xe6e27cc5UL)#define DBS_TX_QOS_RATE_DIV (0x8cd07ba3UL)#define DBS_TX_QOS_RATE_MUL (0x9814e40bUL) +#define DBS_TX_QP_CTRL (0xd5fba432UL) +#define DBS_TX_QP_CTRL_ADR (0x84238184UL) +#define DBS_TX_QP_CTRL_CNT (0x942b1855UL) +#define DBS_TX_QP_DATA (0x7a2a262bUL) +#define DBS_TX_QP_DATA_VPORT (0xda741d67UL)#endif /* _NTHW_FPGA_REG_DEFS_DBS_ */
Signature · 1 line
2.45.0
PATCH v2 45/50 net/ntnic: used writer data handling functions
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Introduced functions to set and flush RX and TX used writer data.
Added support for setting shadow data with functions for guest physical address, host ID, queue size, packed, interrupt enable, vector, and ISTK for RX and TX.
Implemented set_rx_used_writer_data and set_tx_used_writer_data to configure and flush data based on updated shadow structures.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 60 +++- drivers/net/ntnic/include/ntnic_dbs.h | 71 ++++ drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 316 ++++++++++++++++++ .../nthw/supported/nthw_fpga_reg_defs_dbs.h | 23 ++ 4 files changed, 468 insertions(+), 2 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +58 -2
@@ -285,6 +285,19 @@ dbs_initialize_virt_queue_structs(void *avail_struct_addr, void *used_struct_add flgs); } +static uint16_t dbs_qsize_log2 (uint16_t qsize) +{ +uint32_t qs =0 ; + +while (qsize) { + qsize = qsize >>1 ; + ++qs; + } + + --qs; +return qs; +} + static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, uint32_t index, uint16_t start_idx,
@@ -300,7 +313,29 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, { (void )header; (void )desc_struct_phys_addr; - (void )used_struct_phys_addr; +uint32_t qs =dbs_qsize_log2 (queue_size); +uint32_t int_enable; +uint32_t vec; +uint32_t istk; + +/* +* 4. Configure the DBS.RX_UW_DATA memory; good idea to initialize all +* DBS_RX_QUEUES entries. +* Notice: We always start out with interrupts disabled (by setting the +* "irq_vector" argument to -1). Queues that require interrupts will have +* it enabled at a later time (after we have enabled vfio interrupts in +* the kernel). +*/ + int_enable =0 ; + vec =0 ; + istk =0 ; +NT_LOG_DBGX (DBG ,NTNIC ,"set_rx_uw_data int=0 irq_vector=%u\n" , irq_vector); + +if (set_rx_uw_data (p_nthw_dbs, index, + (uint64_t )used_struct_phys_addr, + host_id, qs,0 , int_enable, vec, istk) !=0 ) { +return NULL ; + }/* * 2. Configure the DBS.RX_AM_DATA memory and enable the queues you plan to use;
@@ -366,7 +401,28 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, { (void )header; (void )desc_struct_phys_addr; - (void )used_struct_phys_addr; +uint32_t int_enable; +uint32_t vec; +uint32_t istk; +uint32_t qs =dbs_qsize_log2 (queue_size); + +/* +* 4. Configure the DBS.TX_UW_DATA memory; good idea to initialize all +* DBS_TX_QUEUES entries. +* Notice: We always start out with interrupts disabled (by setting the +* "irq_vector" argument to -1). Queues that require interrupts will have +* it enabled at a later time (after we have enabled vfio interrupts in the +* kernel). +*/ + int_enable =0 ; + vec =0 ; + istk =0 ; + +if (set_tx_uw_data (p_nthw_dbs, index, + (uint64_t )used_struct_phys_addr, + host_id, qs,0 , int_enable, vec, istk, in_order) !=0 ) { +return NULL ; + }/* * 2. Configure the DBS.TX_AM_DATA memory and enable the queues you plan to use;
drivers/net/ntnic/include/ntnic_dbs.h +71 -0
97 lines not on this page · raw message
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +316 -0
346 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h +23 -0
@@ -45,6 +45,17 @@#define DBS_RX_PTR_PTR (0x7f834481UL)#define DBS_RX_PTR_QUEUE (0x4f3fa6d1UL)#define DBS_RX_PTR_VALID (0xbcc5ec4dUL) +#define DBS_RX_UW_CTRL (0x31afc0deUL) +#define DBS_RX_UW_CTRL_ADR (0x2ee4a2c9UL) +#define DBS_RX_UW_CTRL_CNT (0x3eec3b18UL) +#define DBS_RX_UW_DATA (0x9e7e42c7UL) +#define DBS_RX_UW_DATA_GPA (0x9193d52cUL) +#define DBS_RX_UW_DATA_HID (0x71a5cf86UL) +#define DBS_RX_UW_DATA_INT (0x22912312UL) +#define DBS_RX_UW_DATA_ISTK (0xd469a7ddUL) +#define DBS_RX_UW_DATA_PCKED (0xef15c665UL) +#define DBS_RX_UW_DATA_QS (0x7d422f44UL) +#define DBS_RX_UW_DATA_VEC (0x55cc9b53UL)#define DBS_STATUS (0xb5f35220UL)#define DBS_STATUS_OK (0xcf09a30fUL)#define DBS_TX_AM_CTRL (0xd6d29b9UL)
@@ -94,6 +105,18 @@#define DBS_TX_QP_CTRL_CNT (0x942b1855UL)#define DBS_TX_QP_DATA (0x7a2a262bUL)#define DBS_TX_QP_DATA_VPORT (0xda741d67UL) +#define DBS_TX_UW_CTRL (0x3cb1b099UL) +#define DBS_TX_UW_CTRL_ADR (0xd626e97fUL) +#define DBS_TX_UW_CTRL_CNT (0xc62e70aeUL) +#define DBS_TX_UW_DATA (0x93603280UL) +#define DBS_TX_UW_DATA_GPA (0x69519e9aUL) +#define DBS_TX_UW_DATA_HID (0x89678430UL) +#define DBS_TX_UW_DATA_INO (0x5036a148UL) +#define DBS_TX_UW_DATA_INT (0xda5368a4UL) +#define DBS_TX_UW_DATA_ISTK (0xf693732fUL) +#define DBS_TX_UW_DATA_PCKED (0xbc84af81UL) +#define DBS_TX_UW_DATA_QS (0xdda7f099UL) +#define DBS_TX_UW_DATA_VEC (0xad0ed0e5UL)#endif /* _NTHW_FPGA_REG_DEFS_DBS_ */
Signature · 1 line
2.45.0
PATCH v2 46/50 net/ntnic: add descriptor reader data handling functions
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Added functions for setting and flushing RX and TX descriptor reader data.
Implemented internal strcutres to update shadow structures with guest physical address, host ID, queue size, header, and packed status.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 30 +- drivers/net/ntnic/include/ntnic_dbs.h | 59 ++++ drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 267 ++++++++++++++++++ .../nthw/supported/nthw_fpga_reg_defs_dbs.h | 19 ++ 4 files changed, 371 insertions(+), 4 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +26 -4
@@ -104,6 +104,8 @@ struct nthw_virt_queue {* 1: Napatech DVIO0 descriptor (12 bytes). */ void *avail_struct_phys_addr; +void *used_struct_phys_addr; +void *desc_struct_phys_addr; };static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES ];
@@ -311,13 +313,21 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,uint32_t vq_type, int irq_vector) { - (void)header; - (void)desc_struct_phys_addr; uint32_t qs = dbs_qsize_log2(queue_size);uint32_t int_enable;uint32_t vec;uint32_t istk; +/* +* Setup DBS module - DSF00094 +* 3. Configure the DBS.RX_DR_DATA memory; good idea to initialize all +* DBS_RX_QUEUES entries. +*/ +if (set_rx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, host_id, qs, header, +0 ) !=0 ) { +return NULL ; + } +/* * 4. Configure the DBS.RX_UW_DATA memory; good idea to initialize all * DBS_RX_QUEUES entries.
@@ -375,6 +385,8 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, rxvq[index].am_enable = (irq_vector <0 ) ?RX_AM_ENABLE :RX_AM_DISABLE ; rxvq[index].host_id = host_id; rxvq[index].avail_struct_phys_addr = avail_struct_phys_addr; + rxvq[index].used_struct_phys_addr = used_struct_phys_addr; + rxvq[index].desc_struct_phys_addr = desc_struct_phys_addr; rxvq[index].vq_type = vq_type; rxvq[index].in_order =0 ;/* not used */ rxvq[index].irq_vector = irq_vector;
@@ -399,13 +411,21 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,int irq_vector, uint32_t in_order) { - (void)header; - (void)desc_struct_phys_addr; uint32_t int_enable;uint32_t vec;uint32_t istk;uint32_t qs =dbs_qsize_log2 (queue_size); +/* +* Setup DBS module - DSF00094 +* 3. Configure the DBS.TX_DR_DATA memory; good idea to initialize all +* DBS_TX_QUEUES entries. +*/ +if (set_tx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, host_id, qs, port, + header,0 ) !=0 ) { +return NULL ; + } +/* * 4. Configure the DBS.TX_UW_DATA memory; good idea to initialize all * DBS_TX_QUEUES entries.
@@ -468,6 +488,8 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, txvq[index].port = port; txvq[index].virtual_port = virtual_port; txvq[index].avail_struct_phys_addr = avail_struct_phys_addr; + txvq[index].used_struct_phys_addr = used_struct_phys_addr; + txvq[index].desc_struct_phys_addr = desc_struct_phys_addr; txvq[index].vq_type = vq_type; txvq[index].in_order = in_order; txvq[index].irq_vector = irq_vector;
drivers/net/ntnic/include/ntnic_dbs.h +59 -0
86 lines not on this page · raw message
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +267 -0
297 lines not on this page · raw message
drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h +19 -0
@@ -30,6 +30,15 @@#define DBS_RX_CONTROL_QE (0x3e928d3UL)#define DBS_RX_CONTROL_UWE (0xb490e8dbUL)#define DBS_RX_CONTROL_UWS (0x40445d8aUL) +#define DBS_RX_DR_CTRL (0xa0cbc617UL) +#define DBS_RX_DR_CTRL_ADR (0xa7b57286UL) +#define DBS_RX_DR_CTRL_CNT (0xb7bdeb57UL) +#define DBS_RX_DR_DATA (0xf1a440eUL) +#define DBS_RX_DR_DATA_GPA (0x18c20563UL) +#define DBS_RX_DR_DATA_HDR (0xb98ed4d5UL) +#define DBS_RX_DR_DATA_HID (0xf8f41fc9UL) +#define DBS_RX_DR_DATA_PCKED (0x1e27ce2aUL) +#define DBS_RX_DR_DATA_QS (0xffb980ddUL)#define DBS_RX_IDLE (0x93c723bfUL)#define DBS_RX_IDLE_BUSY (0x8e043b5bUL)#define DBS_RX_IDLE_IDLE (0x9dba27ccUL)
@@ -74,6 +83,16 @@#define DBS_TX_CONTROL_QE (0xa30cf70eUL)#define DBS_TX_CONTROL_UWE (0x4c52a36dUL)#define DBS_TX_CONTROL_UWS (0xb886163cUL) +#define DBS_TX_DR_CTRL (0xadd5b650UL) +#define DBS_TX_DR_CTRL_ADR (0x5f773930UL) +#define DBS_TX_DR_CTRL_CNT (0x4f7fa0e1UL) +#define DBS_TX_DR_DATA (0x2043449UL) +#define DBS_TX_DR_DATA_GPA (0xe0004ed5UL) +#define DBS_TX_DR_DATA_HDR (0x414c9f63UL) +#define DBS_TX_DR_DATA_HID (0x36547fUL) +#define DBS_TX_DR_DATA_PCKED (0x4db6a7ceUL) +#define DBS_TX_DR_DATA_PORT (0xf306968cUL) +#define DBS_TX_DR_DATA_QS (0x5f5c5f00UL)#define DBS_TX_IDLE (0xf0171685UL)#define DBS_TX_IDLE_BUSY (0x61399ebbUL)#define DBS_TX_IDLE_IDLE (0x7287822cUL)
Signature · 1 line
2.45.0
PATCH v2 47/50 net/ntnic: update FPGA registeris related to DBS
In reply to Serhii IliushykDBS - DVIO Buffer System
--- .../supported/nthw_fpga_9563_055_049_0000.c | 184 +++++++++++++++++- 1 file changed, 183 insertions(+), 1 deletion(-)
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +183 -1
@@ -1541,10 +1541,192 @@ static nthw_fpga_register_init_s rst9563_registers[] = { { RST9563_STICKY, 3, 6, NTHW_FPGA_REG_TYPE_RC1, 0, 6, rst9563_sticky_fields }, }; +static nthw_fpga_field_init_s dbs_rx_am_ctrl_fields[] = { + { DBS_RX_AM_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_RX_AM_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_am_data_fields[] = { + { DBS_RX_AM_DATA_ENABLE, 1, 72, 0x0000 }, { DBS_RX_AM_DATA_GPA, 64, 0, 0x0000 }, + { DBS_RX_AM_DATA_HID, 8, 64, 0x0000 }, { DBS_RX_AM_DATA_INT, 1, 74, 0x0000 }, + { DBS_RX_AM_DATA_PCKED, 1, 73, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_control_fields[] = { + { DBS_RX_CONTROL_AME, 1, 7, 0 }, { DBS_RX_CONTROL_AMS, 4, 8, 8 }, + { DBS_RX_CONTROL_LQ, 7, 0, 0 }, { DBS_RX_CONTROL_QE, 1, 17, 0 }, + { DBS_RX_CONTROL_UWE, 1, 12, 0 }, { DBS_RX_CONTROL_UWS, 4, 13, 5 }, +}; + +static nthw_fpga_field_init_s dbs_rx_dr_ctrl_fields[] = { + { DBS_RX_DR_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_RX_DR_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_dr_data_fields[] = { + { DBS_RX_DR_DATA_GPA, 64, 0, 0x0000 }, { DBS_RX_DR_DATA_HDR, 1, 88, 0x0000 }, + { DBS_RX_DR_DATA_HID, 8, 64, 0x0000 }, { DBS_RX_DR_DATA_PCKED, 1, 87, 0x0000 }, + { DBS_RX_DR_DATA_QS, 15, 72, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_idle_fields[] = { + { DBS_RX_IDLE_BUSY, 1, 8, 0 }, + { DBS_RX_IDLE_IDLE, 1, 0, 0x0000 }, + { DBS_RX_IDLE_QUEUE, 7, 1, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_init_fields[] = { + { DBS_RX_INIT_BUSY, 1, 8, 0 }, + { DBS_RX_INIT_INIT, 1, 0, 0x0000 }, + { DBS_RX_INIT_QUEUE, 7, 1, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_init_val_fields[] = { + { DBS_RX_INIT_VAL_IDX, 16, 0, 0x0000 }, + { DBS_RX_INIT_VAL_PTR, 15, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_ptr_fields[] = { + { DBS_RX_PTR_PTR, 16, 0, 0x0000 }, + { DBS_RX_PTR_QUEUE, 7, 16, 0x0000 }, + { DBS_RX_PTR_VALID, 1, 23, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_uw_ctrl_fields[] = { + { DBS_RX_UW_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_RX_UW_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_rx_uw_data_fields[] = { + { DBS_RX_UW_DATA_GPA, 64, 0, 0x0000 }, { DBS_RX_UW_DATA_HID, 8, 64, 0x0000 }, + { DBS_RX_UW_DATA_INT, 1, 88, 0x0000 }, { DBS_RX_UW_DATA_ISTK, 1, 92, 0x0000 }, + { DBS_RX_UW_DATA_PCKED, 1, 87, 0x0000 }, { DBS_RX_UW_DATA_QS, 15, 72, 0x0000 }, + { DBS_RX_UW_DATA_VEC, 3, 89, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_am_ctrl_fields[] = { + { DBS_TX_AM_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_TX_AM_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_am_data_fields[] = { + { DBS_TX_AM_DATA_ENABLE, 1, 72, 0x0000 }, { DBS_TX_AM_DATA_GPA, 64, 0, 0x0000 }, + { DBS_TX_AM_DATA_HID, 8, 64, 0x0000 }, { DBS_TX_AM_DATA_INT, 1, 74, 0x0000 }, + { DBS_TX_AM_DATA_PCKED, 1, 73, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_control_fields[] = { + { DBS_TX_CONTROL_AME, 1, 7, 0 }, { DBS_TX_CONTROL_AMS, 4, 8, 5 }, + { DBS_TX_CONTROL_LQ, 7, 0, 0 }, { DBS_TX_CONTROL_QE, 1, 17, 0 }, + { DBS_TX_CONTROL_UWE, 1, 12, 0 }, { DBS_TX_CONTROL_UWS, 4, 13, 8 }, +}; + +static nthw_fpga_field_init_s dbs_tx_dr_ctrl_fields[] = { + { DBS_TX_DR_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_TX_DR_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_dr_data_fields[] = { + { DBS_TX_DR_DATA_GPA, 64, 0, 0x0000 }, { DBS_TX_DR_DATA_HDR, 1, 88, 0x0000 }, + { DBS_TX_DR_DATA_HID, 8, 64, 0x0000 }, { DBS_TX_DR_DATA_PCKED, 1, 87, 0x0000 }, + { DBS_TX_DR_DATA_PORT, 1, 89, 0x0000 }, { DBS_TX_DR_DATA_QS, 15, 72, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_idle_fields[] = { + { DBS_TX_IDLE_BUSY, 1, 8, 0 }, + { DBS_TX_IDLE_IDLE, 1, 0, 0x0000 }, + { DBS_TX_IDLE_QUEUE, 7, 1, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_init_fields[] = { + { DBS_TX_INIT_BUSY, 1, 8, 0 }, + { DBS_TX_INIT_INIT, 1, 0, 0x0000 }, + { DBS_TX_INIT_QUEUE, 7, 1, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_init_val_fields[] = { + { DBS_TX_INIT_VAL_IDX, 16, 0, 0x0000 }, + { DBS_TX_INIT_VAL_PTR, 15, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_ptr_fields[] = { + { DBS_TX_PTR_PTR, 16, 0, 0x0000 }, + { DBS_TX_PTR_QUEUE, 7, 16, 0x0000 }, + { DBS_TX_PTR_VALID, 1, 23, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_qos_ctrl_fields[] = { + { DBS_TX_QOS_CTRL_ADR, 1, 0, 0x0000 }, + { DBS_TX_QOS_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_qos_data_fields[] = { + { DBS_TX_QOS_DATA_BS, 27, 17, 0x0000 }, + { DBS_TX_QOS_DATA_EN, 1, 0, 0x0000 }, + { DBS_TX_QOS_DATA_IR, 16, 1, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_qos_rate_fields[] = { + { DBS_TX_QOS_RATE_DIV, 19, 16, 2 }, + { DBS_TX_QOS_RATE_MUL, 16, 0, 1 }, +}; + +static nthw_fpga_field_init_s dbs_tx_qp_ctrl_fields[] = { + { DBS_TX_QP_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_TX_QP_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_qp_data_fields[] = { + { DBS_TX_QP_DATA_VPORT, 1, 0, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_uw_ctrl_fields[] = { + { DBS_TX_UW_CTRL_ADR, 7, 0, 0x0000 }, + { DBS_TX_UW_CTRL_CNT, 16, 16, 0x0000 }, +}; + +static nthw_fpga_field_init_s dbs_tx_uw_data_fields[] = { + { DBS_TX_UW_DATA_GPA, 64, 0, 0x0000 }, { DBS_TX_UW_DATA_HID, 8, 64, 0x0000 }, + { DBS_TX_UW_DATA_INO, 1, 93, 0x0000 }, { DBS_TX_UW_DATA_INT, 1, 88, 0x0000 }, + { DBS_TX_UW_DATA_ISTK, 1, 92, 0x0000 }, { DBS_TX_UW_DATA_PCKED, 1, 87, 0x0000 }, + { DBS_TX_UW_DATA_QS, 15, 72, 0x0000 }, { DBS_TX_UW_DATA_VEC, 3, 89, 0x0000 }, +}; + +static nthw_fpga_register_init_s dbs_registers[] = { + { DBS_RX_AM_CTRL, 10, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_rx_am_ctrl_fields }, + { DBS_RX_AM_DATA, 11, 75, NTHW_FPGA_REG_TYPE_WO, 0, 5, dbs_rx_am_data_fields }, + { DBS_RX_CONTROL, 0, 18, NTHW_FPGA_REG_TYPE_RW, 43008, 6, dbs_rx_control_fields }, + { DBS_RX_DR_CTRL, 18, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_rx_dr_ctrl_fields }, + { DBS_RX_DR_DATA, 19, 89, NTHW_FPGA_REG_TYPE_WO, 0, 5, dbs_rx_dr_data_fields }, + { DBS_RX_IDLE, 8, 9, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_rx_idle_fields }, + { DBS_RX_INIT, 2, 9, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_rx_init_fields }, + { DBS_RX_INIT_VAL, 3, 31, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_rx_init_val_fields }, + { DBS_RX_PTR, 4, 24, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_rx_ptr_fields }, + { DBS_RX_UW_CTRL, 14, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_rx_uw_ctrl_fields }, + { DBS_RX_UW_DATA, 15, 93, NTHW_FPGA_REG_TYPE_WO, 0, 7, dbs_rx_uw_data_fields }, + { DBS_TX_AM_CTRL, 12, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_am_ctrl_fields }, + { DBS_TX_AM_DATA, 13, 75, NTHW_FPGA_REG_TYPE_WO, 0, 5, dbs_tx_am_data_fields }, + { DBS_TX_CONTROL, 1, 18, NTHW_FPGA_REG_TYPE_RW, 66816, 6, dbs_tx_control_fields }, + { DBS_TX_DR_CTRL, 20, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_dr_ctrl_fields }, + { DBS_TX_DR_DATA, 21, 90, NTHW_FPGA_REG_TYPE_WO, 0, 6, dbs_tx_dr_data_fields }, + { DBS_TX_IDLE, 9, 9, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_tx_idle_fields }, + { DBS_TX_INIT, 5, 9, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_tx_init_fields }, + { DBS_TX_INIT_VAL, 6, 31, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_init_val_fields }, + { DBS_TX_PTR, 7, 24, NTHW_FPGA_REG_TYPE_MIXED, 0, 3, dbs_tx_ptr_fields }, + { DBS_TX_QOS_CTRL, 24, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_qos_ctrl_fields }, + { DBS_TX_QOS_DATA, 25, 44, NTHW_FPGA_REG_TYPE_WO, 0, 3, dbs_tx_qos_data_fields }, + { DBS_TX_QOS_RATE, 26, 35, NTHW_FPGA_REG_TYPE_RW, 131073, 2, dbs_tx_qos_rate_fields }, + { DBS_TX_QP_CTRL, 22, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_qp_ctrl_fields }, + { DBS_TX_QP_DATA, 23, 1, NTHW_FPGA_REG_TYPE_WO, 0, 1, dbs_tx_qp_data_fields }, + { DBS_TX_UW_CTRL, 16, 32, NTHW_FPGA_REG_TYPE_WO, 0, 2, dbs_tx_uw_ctrl_fields }, + { DBS_TX_UW_DATA, 17, 94, NTHW_FPGA_REG_TYPE_WO, 0, 8, dbs_tx_uw_data_fields }, +}; + static nthw_fpga_module_init_s fpga_modules[] = { { MOD_CAT, 0, MOD_CAT, 0, 21, NTHW_FPGA_BUS_TYPE_RAB1, 768, 34, cat_registers }, { MOD_GFG, 0, MOD_GFG, 1, 1, NTHW_FPGA_BUS_TYPE_RAB2, 8704, 10, gfg_registers }, { MOD_GMF, 0, MOD_GMF, 2, 5, NTHW_FPGA_BUS_TYPE_RAB2, 9216, 12, gmf_registers }, + { MOD_DBS, 0, MOD_DBS, 0, 11, NTHW_FPGA_BUS_TYPE_RAB2, 12832, 27, dbs_registers}, { MOD_GMF, 1, MOD_GMF, 2, 5, NTHW_FPGA_BUS_TYPE_RAB2, 9728, 12, gmf_registers }, { MOD_GPIO_PHY, 0, MOD_GPIO_PHY, 1, 0, NTHW_FPGA_BUS_TYPE_RAB0, 16386, 2,
@@ -1737,5 +1919,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { };nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { -200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,21 , fpga_modules, +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,22 , fpga_modules, };
Signature · 1 line
2.45.0
PATCH v2 48/50 net/ntnic: virtqueue setup managed packed-ring was added
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Structures were enhanced with PACKED virtqueue fields. Managed function was extended with packed ring configuration and initialization support.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 191 +++++++++++++++++- drivers/net/ntnic/include/ntnic_virt_queue.h | 27 +++ 2 files changed, 208 insertions(+), 10 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +181 -10
@@ -69,16 +69,33 @@ enum nthw_virt_queue_usage {struct nthw_virt_queue {/* Pointers to virt-queue structs */ -struct { -/* SPLIT virtqueue */ -struct virtq_avail *p_avail; -struct virtq_used *p_used; -struct virtq_desc *p_desc; -/* Control variables for virt-queue structs */ -uint16_t am_idx; -uint16_t used_idx; -uint16_t cached_idx; -uint16_t tx_descr_avail_idx; +union { +struct { +/* SPLIT virtqueue */ +struct virtq_avail *p_avail; +struct virtq_used *p_used; +struct virtq_desc *p_desc; +/* Control variables for virt-queue structs */ +uint16_t am_idx; +uint16_t used_idx; +uint16_t cached_idx; +uint16_t tx_descr_avail_idx; + }; +struct { +/* PACKED virtqueue */ +struct pvirtq_event_suppress *driver_event; +struct pvirtq_event_suppress *device_event; +struct pvirtq_desc *desc; +/* +* when in-order release used Tx packets from FPGA it may collapse +* into a batch. When getting new Tx buffers we may only need +* partial +*/ +uint16_t next_avail; +uint16_t next_used; +uint16_t avail_wrap_count; +uint16_t used_wrap_count; + }; };/* Array with packet buffers */
@@ -108,6 +125,11 @@ struct nthw_virt_queue {void *desc_struct_phys_addr; }; +struct pvirtq_struct_layout_s { +size_t driver_event_offset; +size_t device_event_offset; +}; +static struct nthw_virt_queue rxvq[MAX_VIRT_QUEUES ];static struct nthw_virt_queue txvq[MAX_VIRT_QUEUES ];
@@ -606,6 +628,143 @@ nthw_setup_mngd_tx_virt_queue_split(nthw_dbs_t *p_nthw_dbs,return &txvq[index]; } +/* +* Packed Ring +*/ +static int nthw_setup_managed_virt_queue_packed (struct nthw_virt_queue *vq, +struct pvirtq_struct_layout_s *pvirtq_layout, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers, +uint16_t flags, +int rx) +{ +/* page aligned */ +assert (((uintptr_t )p_virt_struct_area->phys_addr &0xfff ) ==0 ); +assert (p_packet_buffers); + +/* clean canvas */ +memset (p_virt_struct_area->virt_addr,0 , +sizeof (struct pvirtq_desc ) * vq->queue_size + +sizeof (struct pvirtq_event_suppress ) *2 +sizeof (int ) * vq->queue_size); + + pvirtq_layout->device_event_offset =sizeof (struct pvirtq_desc ) * vq->queue_size; + pvirtq_layout->driver_event_offset = + pvirtq_layout->device_event_offset +sizeof (struct pvirtq_event_suppress ); + + vq->desc = p_virt_struct_area->virt_addr; + vq->device_event = (void *)((uintptr_t )vq->desc + pvirtq_layout->device_event_offset); + vq->driver_event = (void *)((uintptr_t )vq->desc + pvirtq_layout->driver_event_offset); + + vq->next_avail =0 ; + vq->next_used =0 ; + vq->avail_wrap_count =1 ; + vq->used_wrap_count =1 ; + +/* +* Only possible if FPGA always delivers in-order +* Buffer ID used is the index in the p_packet_buffers array +*/ +unsigned int i; +struct pvirtq_desc *p_desc = vq->desc; + +for (i =0 ; i < vq->queue_size; i++) { +if (rx) { + p_desc[i].addr = (uint64_t )p_packet_buffers[i].phys_addr; + p_desc[i].len = p_packet_buffers[i].len; + } + + p_desc[i].id = i; + p_desc[i].flags = flags; + } + +if (rx) + vq->avail_wrap_count ^=1 ;/* filled up available buffers for Rx */ +else + vq->used_wrap_count ^=1 ;/* pre-fill free buffer IDs */ + +if (vq->queue_size ==0 ) +return -1 ;/* don't allocate memory with size of 0 bytes */ + + vq->p_virtual_addr =malloc (vq->queue_size *sizeof (*p_packet_buffers)); + +if (vq->p_virtual_addr ==NULL ) +return -1 ; + +memcpy (vq->p_virtual_addr, p_packet_buffers, vq->queue_size *sizeof (*p_packet_buffers)); + +/* Not used yet by FPGA - make sure we disable */ + vq->device_event->flags =RING_EVENT_FLAGS_DISABLE ; + +return 0 ; +} + +static struct nthw_virt_queue * +nthw_setup_managed_rx_virt_queue_packed (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t header, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers, +int irq_vector) +{ +struct pvirtq_struct_layout_s pvirtq_layout; +struct nthw_virt_queue *vq = &rxvq[index]; +/* Set size and setup packed vq ring */ + vq->queue_size = queue_size; + +/* Use Avail flag bit == 1 because wrap bit is initially set to 1 - and Used is inverse */ +if (nthw_setup_managed_virt_queue_packed (vq, &pvirtq_layout, p_virt_struct_area, + p_packet_buffers, +VIRTQ_DESC_F_WRITE |VIRTQ_DESC_F_AVAIL ,1 ) !=0 ) +return NULL ; + +nthw_setup_rx_virt_queue (p_nthw_dbs, index,0x8000 ,0 ,/* start wrap ring counter as 1 */ + (void *)((uintptr_t )p_virt_struct_area->phys_addr + + pvirtq_layout.driver_event_offset), + (void *)((uintptr_t )p_virt_struct_area->phys_addr + + pvirtq_layout.device_event_offset), + p_virt_struct_area->phys_addr, (uint16_t )queue_size, host_id, + header,PACKED_RING , irq_vector); + + vq->usage =NTHW_VIRTQ_MANAGED ; +return vq; +} + +static struct nthw_virt_queue * +nthw_setup_managed_tx_virt_queue_packed (nthw_dbs_t *p_nthw_dbs, +uint32_t index, +uint32_t queue_size, +uint32_t host_id, +uint32_t port, +uint32_t virtual_port, +uint32_t header, +int irq_vector, +uint32_t in_order, +struct nthw_memory_descriptor *p_virt_struct_area, +struct nthw_memory_descriptor *p_packet_buffers) +{ +struct pvirtq_struct_layout_s pvirtq_layout; +struct nthw_virt_queue *vq = &txvq[index]; +/* Set size and setup packed vq ring */ + vq->queue_size = queue_size; + +if (nthw_setup_managed_virt_queue_packed (vq, &pvirtq_layout, p_virt_struct_area, + p_packet_buffers,0 ,0 ) !=0 ) +return NULL ; + +nthw_setup_tx_virt_queue (p_nthw_dbs, index,0x8000 ,0 ,/* start wrap ring counter as 1 */ + (void *)((uintptr_t )p_virt_struct_area->phys_addr + + pvirtq_layout.driver_event_offset), + (void *)((uintptr_t )p_virt_struct_area->phys_addr + + pvirtq_layout.device_event_offset), + p_virt_struct_area->phys_addr, (uint16_t )queue_size, host_id, + port, virtual_port, header,PACKED_RING , irq_vector, in_order); + + vq->usage =NTHW_VIRTQ_MANAGED ; +return vq; +} +/* * Create a Managed Rx Virt Queue *
@@ -630,6 +789,11 @@ nthw_setup_mngd_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, host_id, header, p_virt_struct_area, p_packet_buffers, irq_vector); +case PACKED_RING : +return nthw_setup_managed_rx_virt_queue_packed (p_nthw_dbs, index, queue_size, + host_id, header, p_virt_struct_area, + p_packet_buffers, irq_vector); +default :break ; }
@@ -666,6 +830,13 @@ nthw_setup_mngd_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, p_virt_struct_area, p_packet_buffers); +case PACKED_RING : +return nthw_setup_managed_tx_virt_queue_packed (p_nthw_dbs, index, queue_size, + host_id, port, virtual_port, header, + irq_vector, in_order, + p_virt_struct_area, + p_packet_buffers); +default :break ; }
drivers/net/ntnic/include/ntnic_virt_queue.h +27 -0
@@ -45,6 +45,9 @@ struct __rte_aligned(8) virtq_desc {uint16_t next; }; +/* additional packed ring flags */ +#define VIRTQ_DESC_F_AVAIL (1 << 7) +/* descr phys address must be 16 byte aligned */ struct __rte_aligned(16) pvirtq_desc {/* Buffer Address. */
@@ -57,6 +60,30 @@ struct __rte_aligned(16) pvirtq_desc {uint16_t flags; }; +/* Disable events */ +#define RING_EVENT_FLAGS_DISABLE 0x1 + +struct __rte_aligned(16) pvirtq_event_suppress { +union { +struct { +/* Descriptor Ring Change Event Offset */ +uint16_t desc_event_off :15 ; +/* Descriptor Ring Change Event Wrap Counter */ +uint16_t desc_event_wrap :1 ; + }; +/* If desc_event_flags set to RING_EVENT_FLAGS_DESC */ +uint16_t desc; + }; + +union { +struct { +uint16_t desc_event_flags :2 ;/* Descriptor Ring Change Event Flags */ +uint16_t reserved :14 ;/* Reserved, set to 0 */ + }; +uint16_t flags; + }; +}; +/* * Common virtq descr */
Signature · 1 line
2.45.0
PATCH v2 49/50 net/ntnic: add functions for releasing virt queues
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Implemented handler busy states and shutdowns of hardware queues.
Added functionality for releasing RX and TX virtual queue resources, managed and releasing packets back into the availability ring.
Updated sg_ops structure to include new queue management functions.
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 353 ++++++++++++++++++ drivers/net/ntnic/include/ntnic_dbs.h | 4 + drivers/net/ntnic/include/ntnic_virt_queue.h | 6 + drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 45 +++ 4 files changed, 408 insertions(+)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +353 -0
@@ -6,6 +6,7 @@#include <unistd.h> #include "ntos_drv.h" +#include "nt_util.h" #include "ntnic_virt_queue.h" #include "ntnic_mod_reg.h" #include "ntlog.h"
@@ -37,6 +38,26 @@#define VIRTQ_AVAIL_F_NO_INTERRUPT 1 +#define vq_log_arg (vq, format, ...) + +/* +* Packed Ring helper macros +*/ +#define PACKED (vq_type) ((vq_type) == PACKED_RING ? 1 : 0) + +#define avail_flag (vq) ((vq)->avail_wrap_count ? VIRTQ_DESC_F_AVAIL : 0) +#define used_flag_inv (vq) ((vq)->avail_wrap_count ? 0 : VIRTQ_DESC_F_USED) + +#define inc_avail (vq, num) \ + do { \ + struct nthw_virt_queue *temp_vq = (vq); \ + temp_vq->next_avail += (num); \ + if (temp_vq->next_avail >= temp_vq->queue_size) { \ + temp_vq->next_avail -= temp_vq->queue_size; \ + temp_vq->avail_wrap_count ^= 1; \ + } \ + } while (0) + struct __rte_aligned(8) virtq_avail {uint16_t flags;uint16_t idx;
@@ -115,6 +136,7 @@ struct nthw_virt_queue {uint32_t host_id;uint32_t port;/* Only used by TX queues */ uint32_t virtual_port;/* Only used by TX queues */ +uint32_t header;/* * Only used by TX queues: * 0: VirtIO-Net header (12 bytes).
@@ -417,6 +439,237 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,return &rxvq[index]; } +static int dbs_wait_hw_queue_shutdown (struct nthw_virt_queue *vq,int rx); + +static int dbs_wait_on_busy (struct nthw_virt_queue *vq,uint32_t *idle,int rx) +{ +uint32_t busy; +uint32_t queue; +int err =0 ; +nthw_dbs_t *p_nthw_dbs = vq->mp_nthw_dbs; + +do { +if (rx) + err =get_rx_idle (p_nthw_dbs, idle, &queue, &busy); + +else + err =get_tx_idle (p_nthw_dbs, idle, &queue, &busy); + }while (!err && busy); + +return err; +} + +static int dbs_wait_hw_queue_shutdown (struct nthw_virt_queue *vq,int rx) +{ +int err =0 ; +uint32_t idle =0 ; +nthw_dbs_t *p_nthw_dbs = vq->mp_nthw_dbs; + + err =dbs_wait_on_busy (vq, &idle, rx); + +if (err) { +if (err == -ENOTSUP ) { +nt_os_wait_usec (200000 ); +return 0 ; + } + +return -1 ; + } + +do { +if (rx) + err =set_rx_idle (p_nthw_dbs,1 , vq->index); + +else + err =set_tx_idle (p_nthw_dbs,1 , vq->index); + +if (err) +return -1 ; + +if (dbs_wait_on_busy (vq, &idle, rx) !=0 ) +return -1 ; + + }while (idle ==0 ); + +return 0 ; +} + +static int dbs_internal_release_rx_virt_queue (struct nthw_virt_queue *rxvq) +{ +nthw_dbs_t *p_nthw_dbs = rxvq->mp_nthw_dbs; + +if (rxvq ==NULL ) +return -1 ; + +/* Clear UW */ + rxvq->used_struct_phys_addr =NULL ; + +if (set_rx_uw_data (p_nthw_dbs, rxvq->index, (uint64_t )rxvq->used_struct_phys_addr, + rxvq->host_id,0 ,PACKED (rxvq->vq_type),0 ,0 ,0 ) !=0 ) { +return -1 ; + } + +/* Disable AM */ + rxvq->am_enable =RX_AM_DISABLE ; + +if (set_rx_am_data (p_nthw_dbs, + rxvq->index, + (uint64_t )rxvq->avail_struct_phys_addr, + rxvq->am_enable, + rxvq->host_id, +PACKED (rxvq->vq_type), +0 ) !=0 ) { +return -1 ; + } + +/* Let the FPGA finish packet processing */ +if (dbs_wait_hw_queue_shutdown (rxvq,1 ) !=0 ) +return -1 ; + +/* Clear rest of AM */ + rxvq->avail_struct_phys_addr =NULL ; + rxvq->host_id =0 ; + +if (set_rx_am_data (p_nthw_dbs, + rxvq->index, + (uint64_t )rxvq->avail_struct_phys_addr, + rxvq->am_enable, + rxvq->host_id, +PACKED (rxvq->vq_type), +0 ) !=0 ) +return -1 ; + +/* Clear DR */ + rxvq->desc_struct_phys_addr =NULL ; + +if (set_rx_dr_data (p_nthw_dbs, + rxvq->index, + (uint64_t )rxvq->desc_struct_phys_addr, + rxvq->host_id, +0 , + rxvq->header, +PACKED (rxvq->vq_type)) !=0 ) +return -1 ; + +/* Initialize queue */ +dbs_init_rx_queue (p_nthw_dbs, rxvq->index,0 ,0 ); + +/* Reset queue state */ + rxvq->usage =NTHW_VIRTQ_UNUSED ; + rxvq->mp_nthw_dbs = p_nthw_dbs; + rxvq->index =0 ; + rxvq->queue_size =0 ; + +return 0 ; +} + +static int nthw_release_mngd_rx_virt_queue (struct nthw_virt_queue *rxvq) +{ +if (rxvq ==NULL || rxvq->usage !=NTHW_VIRTQ_MANAGED ) +return -1 ; + +if (rxvq->p_virtual_addr) { +free (rxvq->p_virtual_addr); + rxvq->p_virtual_addr =NULL ; + } + +return dbs_internal_release_rx_virt_queue (rxvq); +} + +static int dbs_internal_release_tx_virt_queue (struct nthw_virt_queue *txvq) +{ +nthw_dbs_t *p_nthw_dbs = txvq->mp_nthw_dbs; + +if (txvq ==NULL ) +return -1 ; + +/* Clear UW */ + txvq->used_struct_phys_addr =NULL ; + +if (set_tx_uw_data (p_nthw_dbs, txvq->index, (uint64_t )txvq->used_struct_phys_addr, + txvq->host_id,0 ,PACKED (txvq->vq_type),0 ,0 ,0 , + txvq->in_order) !=0 ) { +return -1 ; + } + +/* Disable AM */ + txvq->am_enable =TX_AM_DISABLE ; + +if (set_tx_am_data (p_nthw_dbs, + txvq->index, + (uint64_t )txvq->avail_struct_phys_addr, + txvq->am_enable, + txvq->host_id, +PACKED (txvq->vq_type), +0 ) !=0 ) { +return -1 ; + } + +/* Let the FPGA finish packet processing */ +if (dbs_wait_hw_queue_shutdown (txvq,0 ) !=0 ) +return -1 ; + +/* Clear rest of AM */ + txvq->avail_struct_phys_addr =NULL ; + txvq->host_id =0 ; + +if (set_tx_am_data (p_nthw_dbs, + txvq->index, + (uint64_t )txvq->avail_struct_phys_addr, + txvq->am_enable, + txvq->host_id, +PACKED (txvq->vq_type), +0 ) !=0 ) { +return -1 ; + } + +/* Clear DR */ + txvq->desc_struct_phys_addr =NULL ; + txvq->port =0 ; + txvq->header =0 ; + +if (set_tx_dr_data (p_nthw_dbs, + txvq->index, + (uint64_t )txvq->desc_struct_phys_addr, + txvq->host_id, +0 , + txvq->port, + txvq->header, +PACKED (txvq->vq_type)) !=0 ) { +return -1 ; + } + +/* Clear QP */ + txvq->virtual_port =0 ; + +if (nthw_dbs_set_tx_qp_data (p_nthw_dbs, txvq->index, txvq->virtual_port) !=0 ) +return -1 ; + +/* Initialize queue */ +dbs_init_tx_queue (p_nthw_dbs, txvq->index,0 ,0 ); + +/* Reset queue state */ + txvq->usage =NTHW_VIRTQ_UNUSED ; + txvq->mp_nthw_dbs = p_nthw_dbs; + txvq->index =0 ; + txvq->queue_size =0 ; + +return 0 ; +} + +static int nthw_release_mngd_tx_virt_queue (struct nthw_virt_queue *txvq) +{ +if (txvq ==NULL || txvq->usage !=NTHW_VIRTQ_MANAGED ) +return -1 ; + +if (txvq->p_virtual_addr) { +free (txvq->p_virtual_addr); + txvq->p_virtual_addr =NULL ; + } + +return dbs_internal_release_tx_virt_queue (txvq); +} + static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, uint32_t index, uint16_t start_idx,
@@ -844,11 +1097,111 @@ nthw_setup_mngd_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,return NULL ; } +/* +* Put buffers back into Avail Ring +*/ +static void nthw_release_rx_packets (struct nthw_virt_queue *rxvq,uint16_t n) +{ +if (rxvq->vq_type ==SPLIT_RING ) { + rxvq->am_idx = (uint16_t )(rxvq->am_idx + n); + rxvq->p_avail->idx = rxvq->am_idx; + + }else if (rxvq->vq_type ==PACKED_RING ) { +int i; +/* +* Defer flags update on first segment - due to serialization towards HW and +* when jumbo segments are added +*/ + +uint16_t first_flags =VIRTQ_DESC_F_WRITE |avail_flag (rxvq) |used_flag_inv (rxvq); +struct pvirtq_desc *first_desc = &rxvq->desc[rxvq->next_avail]; + +uint32_t len = rxvq->p_virtual_addr[0 ].len;/* all same size */ + +/* Optimization point: use in-order release */ + +for (i =0 ; i < n; i++) { +struct pvirtq_desc *desc = &rxvq->desc[rxvq->next_avail]; + + desc->id = rxvq->next_avail; + desc->addr = (uint64_t )rxvq->p_virtual_addr[desc->id].phys_addr; + desc->len = len; + +if (i) + desc->flags =VIRTQ_DESC_F_WRITE |avail_flag (rxvq) | +used_flag_inv (rxvq); + +inc_avail (rxvq,1 ); + } + +rte_rmb (); + first_desc->flags = first_flags; + } +} + +static void nthw_release_tx_packets (struct nthw_virt_queue *txvq,uint16_t n,uint16_t n_segs[]) +{ +int i; + +if (txvq->vq_type ==SPLIT_RING ) { +/* Valid because queue_size is always 2^n */ +uint16_t queue_mask = (uint16_t )(txvq->queue_size -1 ); + +vq_log_arg (txvq,"pkts %i, avail idx %i, start at %i\n" , n, txvq->am_idx, + txvq->tx_descr_avail_idx); + +for (i =0 ; i < n; i++) { +int idx = txvq->am_idx & queue_mask; + txvq->p_avail->ring[idx] = txvq->tx_descr_avail_idx; + txvq->tx_descr_avail_idx = + (txvq->tx_descr_avail_idx + n_segs[i]) & queue_mask; + txvq->am_idx++; + } + +/* Make sure the ring has been updated before HW reads index update */ +rte_mb (); + txvq->p_avail->idx = txvq->am_idx; +vq_log_arg (txvq,"new avail idx %i, descr_idx %i\n" , txvq->p_avail->idx, + txvq->tx_descr_avail_idx); + + }else if (txvq->vq_type ==PACKED_RING ) { +/* +* Defer flags update on first segment - due to serialization towards HW and +* when jumbo segments are added +*/ + +uint16_t first_flags =avail_flag (txvq) |used_flag_inv (txvq); +struct pvirtq_desc *first_desc = &txvq->desc[txvq->next_avail]; + +for (i =0 ; i < n; i++) { +struct pvirtq_desc *desc = &txvq->desc[txvq->next_avail]; + + desc->id = txvq->next_avail; + desc->addr = (uint64_t )txvq->p_virtual_addr[desc->id].phys_addr; + +if (i) +/* bitwise-or here because next flags may already have been setup +*/ + desc->flags |=avail_flag (txvq) |used_flag_inv (txvq); + +inc_avail (txvq,1 ); + } + +/* Proper read barrier before FPGA may see first flags */ +rte_rmb (); + first_desc->flags = first_flags; + } +} +static struct sg_ops_s sg_ops = { .nthw_setup_rx_virt_queue = nthw_setup_rx_virt_queue, .nthw_setup_tx_virt_queue = nthw_setup_tx_virt_queue, .nthw_setup_mngd_rx_virt_queue = nthw_setup_mngd_rx_virt_queue, + .nthw_release_mngd_rx_virt_queue = nthw_release_mngd_rx_virt_queue, .nthw_setup_mngd_tx_virt_queue = nthw_setup_mngd_tx_virt_queue, + .nthw_release_mngd_tx_virt_queue = nthw_release_mngd_tx_virt_queue, + .nthw_release_rx_packets = nthw_release_rx_packets, + .nthw_release_tx_packets = nthw_release_tx_packets, .nthw_virt_queue_init = nthw_virt_queue_init };
drivers/net/ntnic/include/ntnic_dbs.h +4 -0
@@ -256,6 +256,10 @@ int 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 set_rx_am_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address,
drivers/net/ntnic/include/ntnic_virt_queue.h +6 -0
@@ -45,8 +45,14 @@ struct __rte_aligned(8) virtq_desc {uint16_t next; }; + +/* +* Packed Ring special structures and defines +*/ +/* additional packed ring flags */ #define VIRTQ_DESC_F_AVAIL (1 << 7) +#define VIRTQ_DESC_F_USED (1 << 15)/* descr phys address must be 16 byte aligned */ struct __rte_aligned(16) pvirtq_desc {
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +45 -0
51 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH v2 50/50 net/ntnic: add functions for retrieving and managing packets
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Implemented functionality for retrieving received packets from virtual queues, supporting both SPLIT_RING and PACKED_RING types.
Updated sg_ops structure to include the new packet retrieval functions.
---
v2
* fix issue(Title underline too short) for RST file
* Update release notes
--- doc/guides/nics/ntnic.rst | 44 ++++ doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 216 ++++++++++++++++++ 3 files changed, 261 insertions(+)
doc/guides/nics/ntnic.rst +44 -0
@@ -51,6 +51,50 @@ and they are also supported. If vfio-pci is not required, kernel version 4.18 is supported. +Configuration +------------- + +Command line arguments +~~~~~~~~~~~~~~~~~~~~~~ + +Following standard DPDK command line arguments are used by the PMD: + + -a: Used to specifically define the NT adapter by PCI ID. + --iova-mode: Must be set to ‘pa’ for Physical Address mode. + +NTNIC specific arguments can be passed to the PMD in the PCI device parameter list:: + + <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] + +The NTNIC specific argument format is:: + + <object>.<attribute>=[<object-ids>:]<value> + +Multiple arguments for the same device are separated by ‘,’ comma. +<object-ids> can be a single value or a range. + + +- ``rxqs`` parameter [int] + + Specify number of RX queues to use. + + To specify number of RX queues:: + + -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + + By default, the value is set to 1. + +- ``txqs`` parameter [int] + + Specify number of TX queues to use. + + To specify number of TX queues:: + + -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + + By default, the value is set to 1. + + Logging and Debugging ---------------------
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -107,6 +107,7 @@ New Features * Added NT flow filter init API * Added NT flow backend initialization API * Added initialization of FPGA modules related to flow HW offload + * Added basic handling of the virtual queues Removed Items -------------
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +216 -0
247 lines not on this page · raw message
Signature · 1 line
2.45.0
Quoted 63 lines · Serhii Iliushyk
The list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentationDanylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packetsOleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core module
Quoted 4 lines
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBS
Hi Serhii,
What is the status of the driver after this patches, does Rx/Tx works?
Quoted 70 lines · Ferruh Yigit
Quoted 63 lines · Serhii Iliushyk
The list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentationDanylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packetsOleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module
net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module
net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core moduleQuoted 4 lines
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBS
Quoted 5 lines
Hi Serhii,
What is the status of the driver after this patches, does Rx/Tx works?
Hi Ferruh,
These patches provide only the initialization of a SmartNiC and prepare it for the Tx/Rx.
The NapaTech Smart NiC requires an already-created flow to receive and transmit packets. (with hardware offload or processed by software) The next patch set we prepare allows create flow. So, with the next patch set, Tx/Rx will work.
BR,
Serhii
Quoted 74 lines · Serhii Iliushyk
Quoted 73 lines · Ferruh Yigit
Quoted 63 lines · Serhii Iliushyk
The list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentationDanylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packetsOleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module
net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module
net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core moduleQuoted 4 lines
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBSHi Serhii,
Quoted 9 lines
Quoted 2 lines
What is the status of the driver after this patches, does Rx/Tx works?
Hi Ferruh,
These patches provide only the initialization of a SmartNiC and prepare it for the Tx/Rx.
The NapaTech Smart NiC requires an already-created flow to receive and transmit packets. (with hardware offload or processed by software) The next patch set we prepare allows create flow. So, with the next patch set, Tx/Rx will work.
Thanks Serhii.
Change request on this patch series is only in the logging related one [1], is it OK if I merge this series without that patch and have log patch later?
Although I am not sure if I can just drop that patch without impacting rest, but I can try.
[1]
net/ntnic: extend and fix logging implementation
Quoted 97 lines · Ferruh Yigit
Quoted 74 lines · Serhii Iliushyk
Quoted 73 lines · Ferruh Yigit
Quoted 63 lines · Serhii Iliushyk
The list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentationDanylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packetsOleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module
net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module
net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core moduleQuoted 4 lines
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBSHi Serhii,
Quoted 9 lines
Quoted 2 lines
What is the status of the driver after this patches, does Rx/Tx works?
Hi Ferruh,
These patches provide only the initialization of a SmartNiC and prepare it for the Tx/Rx.
The NapaTech Smart NiC requires an already-created flow to receive and transmit packets. (with hardware offload or processed by software) The next patch set we prepare allows create flow. So, with the next patch set, Tx/Rx will work.Thanks Serhii.
Change request on this patch series is only in the logging related one [1], is it OK if I merge this series without that patch and have log patch later?
Although I am not sure if I can just drop that patch without impacting rest, but I can try.
Quoted 2 lines
[1]
net/ntnic: extend and fix logging implementation
The fix for logging is ready.
I'm going to send it in couple minutes.
Please wait for it.
BR,
Serhii
v3 cover Provide: flow filter init API, Enable virtual queues, fix ntnic issues for release 24.07
In reply to Serhii IliushykThe list of updates provided by the patchset:
* Update the supported version of the FPGA to 9563.55.49
* Fix Coverity issues
* Fix issues related to release 24.07
* Extended and fixed the implementation of the logging
* Added NT flow filter init API
* Added NT flow backend initialization API
* Added initialization of FPGA modules related to flow HW offload
* Added basic handling of the virtual queues
* Update documentation
* Fix logging according to the requirement to not have '\n'
Danylo Vodopianov (15):
net/ntnic: fix coverity issues:
net/ntnic: extend and fix logging implementation net/ntnic: add basic queue operations
net/ntnic: enhance Ethernet device configuration net/ntnic: add scatter-gather HW deallocation net/ntnic: add queue setup operations
net/ntnic: add packet handler for virtio queues net/ntnic: add init for virt queues in the DBS net/ntnic: add split-queue support
net/ntnic: add functions for availability monitor management net/ntnic: used writer data handling functions net/ntnic: add descriptor reader data handling functions net/ntnic: virtqueue setup managed packed-ring was added net/ntnic: add functions for releasing virt queues net/ntnic: add functions for retrieving and managing packets
Oleksandr Kolomeiets (33):
net/ntnic: update NT NiC PMD driver with FPGA version net/ntnic: update documentation
net/ntnic: remove extra calling of the API for release port net/ntnic: add flow filter init API
net/ntnic: add flow filter deinitialization API net/ntnic: add flow backend initialization API net/ntnic: add flow backend deinitialization API net/ntnic: add INFO flow module
net/ntnic: add categorizer (CAT) flow module net/ntnic: add key match (KM) flow module net/ntnic: add flow matcher (FLM) flow module net/ntnic: add IP fragmenter (IFR) flow module net/ntnic: add hasher (HSH) flow module net/ntnic: add queue select (QSL) flow module net/ntnic: add slicer (SLC LR) flow module net/ntnic: add packet descriptor builder (PDB) flow module net/ntnic: add header field update (HFU) flow module net/ntnic: add RPP local retransmit (RPP LR) flow module net/ntnic: add copier (Tx CPY) flow module net/ntnic: add checksum update (CSU) flow module net/ntnic: add insert (Tx INS) flow module net/ntnic: add replacer (Tx RPL) flow module net/ntnic: add base init and deinit of the NT flow API net/ntnic: add base init and deinit the NT flow backend net/ntnic: add categorizer (CAT) FPGA module net/ntnic: add key match (KM) FPGA module net/ntnic: add flow matcher (FLM) FPGA module net/ntnic: add hasher (HSH) FPGA module net/ntnic: add queue select (QSL) FPGA module net/ntnic: add slicer (SLC LR) FPGA module net/ntnic: add packet descriptor builder (PDB) FPGA module net/ntnic: add Tx Packet Editor (TPE) FPGA module net/ntnic: add receive MAC converter (RMC) core module
Serhii Iliushyk (2):
net/ntnic: add Tx Packet Editor (TPE) flow module net/ntnic: update FPGA registeris related to DBS
.mailmap | 1 +
doc/guides/nics/features/ntnic.ini | 2 +
doc/guides/nics/ntnic.rst | 73 +
doc/guides/rel_notes/release_24_11.rst | 10 +
drivers/net/ntnic/adapter/nt4ga_adapter.c | 61 +-
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 1428 +++++++++++
drivers/net/ntnic/include/flow_api.h | 104 +
drivers/net/ntnic/include/flow_api_engine.h | 48 +
drivers/net/ntnic/include/flow_filter.h | 15 +
drivers/net/ntnic/include/hw_mod_backend.h | 913 +++++++
drivers/net/ntnic/include/hw_mod_cat_v18.h | 141 ++
drivers/net/ntnic/include/hw_mod_cat_v21.h | 91 +
drivers/net/ntnic/include/hw_mod_flm_v25.h | 342 +++
drivers/net/ntnic/include/hw_mod_hsh_v5.h | 46 +
drivers/net/ntnic/include/hw_mod_km_v7.h | 96 +
drivers/net/ntnic/include/hw_mod_pdb_v9.h | 42 +
drivers/net/ntnic/include/hw_mod_qsl_v7.h | 48 +
drivers/net/ntnic/include/hw_mod_slc_lr_v2.h | 25 +
drivers/net/ntnic/include/hw_mod_tpe_v3.h | 126 +
drivers/net/ntnic/include/nt4ga_adapter.h | 7 +
drivers/net/ntnic/include/nt4ga_filter.h | 13 +
drivers/net/ntnic/include/ntnic_dbs.h | 313 +++
drivers/net/ntnic/include/ntnic_stat.h | 11 +
drivers/net/ntnic/include/ntnic_virt_queue.h | 146 ++
drivers/net/ntnic/include/ntos_drv.h | 70 +
.../ntnic/include/stream_binary_flow_api.h | 22 +
.../link_mgmt/link_100g/nt4ga_link_100g.c | 68 +-
drivers/net/ntnic/meson.build | 35 +-
drivers/net/ntnic/nim/i2c_nim.c | 24 +-
.../net/ntnic/nthw/core/include/nthw_rmc.h | 49 +
.../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 12 +-
.../core/nt200a0x/reset/nthw_fpga_rst9563.c | 30 +-
.../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 122 +-
drivers/net/ntnic/nthw/core/nthw_fpga.c | 58 +-
drivers/net/ntnic/nthw/core/nthw_gpio_phy.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_hif.c | 24 +-
drivers/net/ntnic/nthw/core/nthw_iic.c | 28 +-
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 16 +-
drivers/net/ntnic/nthw/core/nthw_pcie3.c | 4 +-
drivers/net/ntnic/nthw/core/nthw_rmc.c | 90 +
drivers/net/ntnic/nthw/core/nthw_sdc.c | 2 +-
drivers/net/ntnic/nthw/core/nthw_si5340.c | 10 +-
drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 1157 +++++++++
drivers/net/ntnic/nthw/flow_api/flow_api.c | 391 +++
.../ntnic/nthw/flow_api/flow_api_nic_setup.h | 20 +
.../nthw/flow_api/flow_backend/flow_backend.c | 2255 +++++++++++++++++
drivers/net/ntnic/nthw/flow_api/flow_filter.c | 55 +
drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 19 +
drivers/net/ntnic/nthw/flow_api/flow_km.c | 19 +
.../nthw/flow_api/hw_mod/hw_mod_backend.c | 145 ++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 1058 ++++++++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 324 +++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 91 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 304 +++
.../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 91 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 185 ++
.../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 68 +
.../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 308 +++
.../ntnic/nthw/flow_filter/flow_nthw_cat.c | 872 +++++++
.../ntnic/nthw/flow_filter/flow_nthw_cat.h | 291 +++
.../ntnic/nthw/flow_filter/flow_nthw_csu.c | 141 ++
.../ntnic/nthw/flow_filter/flow_nthw_csu.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_flm.c | 1225 +++++++++
.../ntnic/nthw/flow_filter/flow_nthw_flm.h | 433 ++++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 230 ++
.../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 84 +
.../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 260 ++
.../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 87 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 123 +
.../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_info.c | 341 +++
.../ntnic/nthw/flow_filter/flow_nthw_info.h | 110 +
.../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 610 +++++
.../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 214 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 210 ++
.../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 85 +
.../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 295 +++
.../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 113 +
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 157 ++
.../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 61 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 126 +
.../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 54 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 388 +++
.../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 59 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 98 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 44 +
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 172 ++
.../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 74 +
.../net/ntnic/nthw/model/nthw_fpga_model.c | 91 +-
drivers/net/ntnic/nthw/nthw_drv.h | 5 +
drivers/net/ntnic/nthw/nthw_helper.h | 11 +
drivers/net/ntnic/nthw/nthw_rac.c | 229 +-
drivers/net/ntnic/nthw/nthw_rac.h | 9 +
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 727 +++++-
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
.../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 16 +
.../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 20 +
.../nthw/supported/nthw_fpga_reg_defs_cat.h | 238 ++
.../nthw/supported/nthw_fpga_reg_defs_cpy.h | 113 +
.../nthw/supported/nthw_fpga_reg_defs_csu.h | 31 +
.../nthw/supported/nthw_fpga_reg_defs_dbs.h | 144 ++
.../nthw/supported/nthw_fpga_reg_defs_flm.h | 242 ++
.../nthw/supported/nthw_fpga_reg_defs_hfu.h | 49 +
.../nthw/supported/nthw_fpga_reg_defs_hsh.h | 50 +
.../nthw/supported/nthw_fpga_reg_defs_ifr.h | 42 +
.../nthw/supported/nthw_fpga_reg_defs_ins.h | 30 +
.../nthw/supported/nthw_fpga_reg_defs_km.h | 126 +
.../nthw/supported/nthw_fpga_reg_defs_pdb.h | 48 +
.../nthw/supported/nthw_fpga_reg_defs_qsl.h | 66 +
.../nthw/supported/nthw_fpga_reg_defs_rmc.h | 36 +
.../nthw/supported/nthw_fpga_reg_defs_rpl.h | 43 +
.../supported/nthw_fpga_reg_defs_rpp_lr.h | 37 +
.../nthw/supported/nthw_fpga_reg_defs_slc.h | 34 +
.../supported/nthw_fpga_reg_defs_slc_lr.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_cpy.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_ins.h | 23 +
.../supported/nthw_fpga_reg_defs_tx_rpl.h | 23 +
drivers/net/ntnic/ntlog/ntlog.c | 2 -
drivers/net/ntnic/ntlog/ntlog.h | 61 +-
drivers/net/ntnic/ntnic_ethdev.c | 1178 ++++++++-
drivers/net/ntnic/ntnic_mod_reg.c | 44 +
drivers/net/ntnic/ntnic_mod_reg.h | 116 +
drivers/net/ntnic/ntnic_vfio.c | 33 +-
drivers/net/ntnic/ntutil/nt_util.c | 31 +-
drivers/net/ntnic/ntutil/nt_util.h | 8 +
126 files changed, 21922 insertions(+), 397 deletions(-)
create mode 100644 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c
create mode 100644 drivers/net/ntnic/include/flow_api.h
create mode 100644 drivers/net/ntnic/include/flow_api_engine.h
create mode 100644 drivers/net/ntnic/include/flow_filter.h
create mode 100644 drivers/net/ntnic/include/hw_mod_backend.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v18.h
create mode 100644 drivers/net/ntnic/include/hw_mod_cat_v21.h
create mode 100644 drivers/net/ntnic/include/hw_mod_flm_v25.h
create mode 100644 drivers/net/ntnic/include/hw_mod_hsh_v5.h
create mode 100644 drivers/net/ntnic/include/hw_mod_km_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_pdb_v9.h
create mode 100644 drivers/net/ntnic/include/hw_mod_qsl_v7.h
create mode 100644 drivers/net/ntnic/include/hw_mod_slc_lr_v2.h
create mode 100644 drivers/net/ntnic/include/hw_mod_tpe_v3.h
create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h
create mode 100644 drivers/net/ntnic/include/ntnic_dbs.h
create mode 100644 drivers/net/ntnic/include/ntnic_stat.h
create mode 100644 drivers/net/ntnic/include/ntnic_virt_queue.h
create mode 100644 drivers/net/ntnic/include/stream_binary_flow_api.h
create mode 100644 drivers/net/ntnic/nthw/core/include/nthw_rmc.h
create mode 100644 drivers/net/ntnic/nthw/core/nthw_rmc.c
create mode 100644 drivers/net/ntnic/nthw/dbs/nthw_dbs.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_kcc.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c
create mode 100644 drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h
create mode 100644 drivers/net/ntnic/nthw/nthw_helper.h
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (60%)
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cat.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_csu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_dbs.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_flm.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hfu.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_hsh.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ifr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_km.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_pdb.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_qsl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rmc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpl.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_rpp_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_slc_lr.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_cpy.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_ins.h
create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_tx_rpl.hSignature · 1 line
2.45.0
PATCH v3 1/50 net/ntnic: update NT NiC PMD driver with FPGA version
From: Oleksandr Kolomeiets <[email protected]>
Update base FPGA files to the new version(39->49)
Fix code style problems
Update documentation
---
v2
* Update release notes
---
doc/guides/rel_notes/release_24_11.rst | 3 ++
drivers/net/ntnic/meson.build | 2 +-
.../net/ntnic/nthw/model/nthw_fpga_model.c | 11 +++---
...9_0000.c => nthw_fpga_9563_055_049_0000.c} | 34 +++++++++----------
.../nthw/supported/nthw_fpga_instances.c | 2 +-
.../nthw/supported/nthw_fpga_instances.h | 2 +-
6 files changed, 28 insertions(+), 26 deletions(-)
rename drivers/net/ntnic/nthw/supported/{nthw_fpga_9563_055_039_0000.c => nthw_fpga_9563_055_049_0000.c} (98%)doc/guides/rel_notes/release_24_11.rst +3 -0
@@ -98,6 +98,9 @@ New Features * Added SR-IOV VF support. * Added recent 1400/14000 and 15000 models to the supported list. +* **Update Napatech ntnic net driver [EXPERIMENTAL].** + + * Update supported version of the FPGA to 9563.55.49 Removed Items -------------
drivers/net/ntnic/meson.build +1 -1
@@ -26,7 +26,7 @@ sources = files( 'link_mgmt/link_100g/nt4ga_link_100g.c', 'link_mgmt/nt4ga_link.c', 'nim/i2c_nim.c', - 'nthw/supported/nthw_fpga_9563_055_039_0000.c', + 'nthw/supported/nthw_fpga_9563_055_049_0000.c', 'nthw/supported/nthw_fpga_instances.c', 'nthw/supported/nthw_fpga_mod_str_map.c', 'nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c',
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +5 -6
@@ -31,8 +31,7 @@ static const char *get_bus_name(int n_bus_type_id)if (n_bus_type_id >=1 && n_bus_type_id <= (int )ARRAY_SIZE (sa_nthw_fpga_bus_type_str))return sa_nthw_fpga_bus_type_str[n_bus_type_id]; -else -return "ERR" ; +return "ERR" ; }/*
@@ -1146,16 +1145,16 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match ewhile (true) {uint32_t val =nthw_field_get_updated (p); -if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 ) { +if (e_match ==NTHW_FIELD_MATCH_SET_ANY && val !=0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask) { +if (e_match ==NTHW_FIELD_MATCH_SET_ALL && val == n_mask)return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ALL && val ==0 )return 0 ; - }else if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) { +if (e_match ==NTHW_FIELD_MATCH_CLR_ANY ) {uint32_t mask =nthw_field_get_mask (p);if (val != mask)
drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c renamed from drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_039_0000.c +17 -17
@@ -179,7 +179,7 @@ static nthw_fpga_register_init_s gpio_phy_registers[] = { };static nthw_fpga_field_init_s hif_build_time_fields[] = { - {HIF_BUILD_TIME_TIME ,32 ,0 ,1713859545 }, + {HIF_BUILD_TIME_TIME ,32 ,0 ,1726740521 }, };static nthw_fpga_field_init_s hif_config_fields[] = {
@@ -202,7 +202,7 @@ static nthw_fpga_field_init_s hif_prod_id_ex_fields[] = {static nthw_fpga_field_init_s hif_prod_id_lsb_fields[] = { {HIF_PROD_ID_LSB_GROUP_ID ,16 ,16 ,9563 }, - {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,39 }, + {HIF_PROD_ID_LSB_REV_ID ,8 ,0 ,49 }, {HIF_PROD_ID_LSB_VER_ID ,8 ,8 ,55 }, };
@@ -247,27 +247,27 @@ static nthw_fpga_field_init_s hif_test1_fields[] = { };static nthw_fpga_field_init_s hif_uuid0_fields[] = { - {HIF_UUID0_UUID0 ,32 ,0 ,1237800326 }, + {HIF_UUID0_UUID0 ,32 ,0 ,1021928912 }, };static nthw_fpga_field_init_s hif_uuid1_fields[] = { - {HIF_UUID1_UUID1 ,32 ,0 ,3057550372 }, + {HIF_UUID1_UUID1 ,32 ,0 ,2998983545 }, };static nthw_fpga_field_init_s hif_uuid2_fields[] = { - {HIF_UUID2_UUID2 ,32 ,0 ,2445752330 }, + {HIF_UUID2_UUID2 ,32 ,0 ,827210969 }, };static nthw_fpga_field_init_s hif_uuid3_fields[] = { - {HIF_UUID3_UUID3 ,32 ,0 ,1864147557 }, + {HIF_UUID3_UUID3 ,32 ,0 ,462142918 }, };static nthw_fpga_register_init_s hif_registers[] = { - {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1713859545 ,1 , hif_build_time_fields }, + {HIF_BUILD_TIME ,16 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1726740521 ,1 , hif_build_time_fields }, {HIF_CONFIG ,24 ,7 ,NTHW_FPGA_REG_TYPE_RW ,0 ,3 , hif_config_fields }, {HIF_CONTROL ,40 ,13 ,NTHW_FPGA_REG_TYPE_MIXED ,4097 ,3 , hif_control_fields }, {HIF_PROD_ID_EX ,112 ,32 ,NTHW_FPGA_REG_TYPE_RO ,1 ,3 , hif_prod_id_ex_fields }, - {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734887 ,3 , hif_prod_id_lsb_fields }, + {HIF_PROD_ID_LSB ,0 ,32 ,NTHW_FPGA_REG_TYPE_RO ,626734897 ,3 , hif_prod_id_lsb_fields }, {HIF_PROD_ID_MSB ,8 ,22 ,NTHW_FPGA_REG_TYPE_RO ,200 ,2 , hif_prod_id_msb_fields }, {HIF_SAMPLE_TIME ,96 ,1 ,NTHW_FPGA_REG_TYPE_WO ,0 ,1 , hif_sample_time_fields }, {HIF_STATUS ,32 ,10 ,NTHW_FPGA_REG_TYPE_MIXED ,0 ,3 , hif_status_fields },
@@ -277,10 +277,10 @@ static nthw_fpga_register_init_s hif_registers[] = { { HIF_STAT_TX, 80, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, hif_stat_tx_fields }, { HIF_TEST0, 48, 32, NTHW_FPGA_REG_TYPE_RW, 287454020, 1, hif_test0_fields }, { HIF_TEST1, 56, 32, NTHW_FPGA_REG_TYPE_RW, 2864434397, 1, hif_test1_fields }, - { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1237800326, 1, hif_uuid0_fields }, - { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 3057550372, 1, hif_uuid1_fields }, - { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 2445752330, 1, hif_uuid2_fields }, - { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 1864147557, 1, hif_uuid3_fields }, + { HIF_UUID0, 128, 32, NTHW_FPGA_REG_TYPE_RO, 1021928912, 1, hif_uuid0_fields }, + { HIF_UUID1, 144, 32, NTHW_FPGA_REG_TYPE_RO, 2998983545, 1, hif_uuid1_fields }, + { HIF_UUID2, 160, 32, NTHW_FPGA_REG_TYPE_RO, 827210969, 1, hif_uuid2_fields }, + { HIF_UUID3, 176, 32, NTHW_FPGA_REG_TYPE_RO, 462142918, 1, hif_uuid3_fields }, }; static nthw_fpga_field_init_s iic_adr_fields[] = {
@@ -1071,7 +1071,7 @@ static nthw_fpga_module_init_s fpga_modules[] = {static nthw_fpga_prod_param_s product_parameters[] = { {NT_BUILD_NUMBER ,0 }, - {NT_BUILD_TIME ,1713859545 }, + {NT_BUILD_TIME ,1726740521 }, {NT_CATEGORIES ,64 }, {NT_CAT_DCT_PRESENT ,0 }, {NT_CAT_END_OFS_SUPPORT ,0 },
@@ -1101,7 +1101,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_FLM_CACHE, 1 }, { NT_FLM_CATEGORIES, 32 }, { NT_FLM_ENTRY_SIZE, 64 }, - { NT_FLM_LOAD_APS_MAX, 260000000 }, + { NT_FLM_LOAD_APS_MAX, 270000000 }, { NT_FLM_LOAD_LPS_MAX, 300000000 }, { NT_FLM_PRESENT, 1 }, { NT_FLM_PRIOS, 4 },
@@ -1176,7 +1176,7 @@ static nthw_fpga_prod_param_s product_parameters[] = { { NT_QUEUES, 128 }, { NT_RAC_RAB_INTERFACES, 3 }, { NT_RAC_RAB_OB_UPDATE, 0 }, - { NT_REVISION_ID, 39 }, + { NT_REVISION_ID, 49 }, { NT_RMC_LAG_GROUPS, 1 }, { NT_RMC_PRESENT, 1 }, { NT_ROA_CATEGORIES, 1024 },
@@ -1225,6 +1225,6 @@ static nthw_fpga_prod_param_s product_parameters[] = { { 0, -1 }, /* END */ }; -nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000 = { -200 ,9563 ,55 ,39 ,0 ,0 ,1713859545 ,152 , product_parameters,15 , fpga_modules, +nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { +200 ,9563 ,55 ,49 ,0 ,0 ,1726740521 ,152 , product_parameters,15 , fpga_modules, };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.c +1 -1
@@ -5,4 +5,4 @@#include "nthw_fpga_instances.h" -nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_039_0000,NULL }; +nthw_fpga_prod_init_s *nthw_fpga_instances[] = { &nthw_fpga_9563_055_049_0000,NULL };
drivers/net/ntnic/nthw/supported/nthw_fpga_instances.h +1 -1
@@ -6,4 +6,4 @@#include "fpga_model.h" extern nthw_fpga_prod_init_s *nthw_fpga_instances[]; -extern nthw_fpga_prod_init_s nthw_fpga_9563_055_039_0000; +extern nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000;
Signature · 1 line
2.45.0
PATCH v3 2/50 net/ntnic: fix coverity issues:
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
CI founc couple coverity problems which were fixed in this commit.
CID 440550, 440551, 440545, 440553, 440552, 440547:
Null pointer dereferences (REVERSE_INULL)
These issues were fixed by reworking variable NULL checking and adding NULL checking before var using.
CID 440543: Incorrect expression (IDENTICAL_BRANCHES) This issue was fixed by removing useless if statements from the code.
CID 440548: Null pointer dereferences (FORWARD_NULL) This issue was fixed by adding NULL checking before mp_fld_rst_serdes_rx var using.
CID 440546: Resource leaks (RESOURCE_LEAK)
This issue was fixed by moving NULL checking before var using.
CID 440540: Error handling issues (CHECKED_RETURN) This issue was fixed with return value checking adding.
CID 440549: (OVERRUN)
This issue was fixed with array edge values fixing.
Coverity issue: 440550
---
v2
* Update release notes
--- .mailmap | 1 + doc/guides/rel_notes/release_24_11.rst | 1 + .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 2 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 24 ++++---- drivers/net/ntnic/nthw/core/nthw_hif.c | 18 +----- .../net/ntnic/nthw/model/nthw_fpga_model.c | 58 ++++++++++--------- drivers/net/ntnic/ntnic_ethdev.c | 21 +++---- drivers/net/ntnic/ntnic_vfio.c | 5 +- drivers/net/ntnic/ntutil/nt_util.c | 3 +- 9 files changed, 67 insertions(+), 66 deletions(-)
.mailmap +1 -0
@@ -295,6 +295,7 @@ Dan Nowlin <[email protected]> Danny Patel <[email protected]> Danny Zhou <[email protected]> Dan Wei <[email protected]> +Danylo Vodopianov <[email protected]> Dapeng Yu <[email protected]> Darek Stojaczyk <[email protected]> Daria Kolistratova <[email protected]>
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -101,6 +101,7 @@ New Features * **Update Napatech ntnic net driver [EXPERIMENTAL].** * Update supported version of the FPGA to 9563.55.49 + * Fix Coverity issues Removed Items -------------
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
@@ -263,7 +263,7 @@ static int nthw_fpga_rst_nt200a0x_reset(nthw_fpga_t *p_fpga,if (p->mp_fld_rst_serdes_rx)nthw_field_set_flush (p->mp_fld_rst_serdes_rx);/* 0x03 2 ports */ -if (p->mp_fld_rst_serdes_rx_datapath) { +if (p->mp_fld_rst_serdes_rx_datapath && p->mp_fld_rst_serdes_rx) {nthw_field_set_flush (p->mp_fld_rst_serdes_rx_datapath);nthw_field_clr_flush (p->mp_fld_rst_serdes_rx); }
drivers/net/ntnic/nthw/core/nthw_fpga.c +12 -12
@@ -217,19 +217,19 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) n_fpga_ident = p_fpga_info->n_fpga_ident; p_fpga_mgr =nthw_fpga_mgr_new (); -nthw_fpga_mgr_init (p_fpga_mgr, nthw_fpga_instances, - (const void *)sa_nthw_fpga_mod_str_map); -nthw_fpga_mgr_log_dump (p_fpga_mgr); - p_fpga =nthw_fpga_mgr_query_fpga (p_fpga_mgr, n_fpga_ident, p_fpga_info); - p_fpga_info->mp_fpga = p_fpga; - -if (p_fpga ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)\n" , p_adapter_id_str, - s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); -return -1 ; - } -if (p_fpga_mgr) { +nthw_fpga_mgr_init (p_fpga_mgr, nthw_fpga_instances, + (const void *)sa_nthw_fpga_mod_str_map); +nthw_fpga_mgr_log_dump (p_fpga_mgr); + p_fpga =nthw_fpga_mgr_query_fpga (p_fpga_mgr, n_fpga_ident, p_fpga_info); + p_fpga_info->mp_fpga = p_fpga; + +if (p_fpga ==NULL ) { +NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)\n" , p_adapter_id_str, + s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time); +return -1 ; + } +nthw_fpga_mgr_delete (p_fpga_mgr); p_fpga_mgr =NULL ; }
drivers/net/ntnic/nthw/core/nthw_hif.c +3 -15
@@ -83,23 +83,11 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance) p->mn_instance, p->mn_fpga_hif_ref_clk_freq, p->mn_fpga_param_hif_per_ps); p->mp_reg_build_seed =NULL ;/* Reg/Fld not present on HIF */ - -if (p->mp_reg_build_seed) - p->mp_fld_build_seed =NULL ;/* Reg/Fld not present on HIF */ -else - p->mp_fld_build_seed =NULL ; + p->mp_fld_build_seed =NULL ;/* Reg/Fld not present on HIF */ p->mp_reg_core_speed =NULL ;/* Reg/Fld not present on HIF */ - -if (p->mp_reg_core_speed) { - p->mp_fld_core_speed =NULL ;/* Reg/Fld not present on HIF */ - p->mp_fld_ddr3_speed =NULL ;/* Reg/Fld not present on HIF */ - - }else { - p->mp_reg_core_speed =NULL ; - p->mp_fld_core_speed =NULL ; - p->mp_fld_ddr3_speed =NULL ; - } + p->mp_fld_core_speed =NULL ;/* Reg/Fld not present on HIF */ + p->mp_fld_ddr3_speed =NULL ;/* Reg/Fld not present on HIF */ /* Optional registers since: 2018-04-25 */ p->mp_reg_int_mask =NULL ;/* Reg/Fld not present on HIF */
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +32 -26
84 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +11 -10
@@ -42,7 +42,7 @@ static struct drv_s *_g_p_drv[NUM_ADAPTER_MAX] = { NULL };static void store_pdrv (struct drv_s *p_drv) { -if (p_drv->adapter_no >NUM_ADAPTER_MAX ) { +if (p_drv->adapter_no >=NUM_ADAPTER_MAX ) {NT_LOG (ERR ,NTNIC ,"Internal error adapter number %u out of range. Max number of adapters: %u\n" , p_drv->adapter_no,NUM_ADAPTER_MAX );
@@ -384,16 +384,17 @@ eth_dev_close(struct rte_eth_dev *eth_dev) internals->p_drv =NULL ;rte_eth_dev_release_port (eth_dev); +if (p_drv) { +/* decrease initialized ethernet devices */ + p_drv->n_eth_dev_init_count--; -/* decrease initialized ethernet devices */ - p_drv->n_eth_dev_init_count--; - -/* -* rte_pci_dev has no private member for p_drv -* wait until all rte_eth_dev's are closed - then close adapters via p_drv -*/ -if (!p_drv->n_eth_dev_init_count && p_drv) -drv_deinit (p_drv); +/* +* rte_pci_dev has no private member for p_drv +* wait until all rte_eth_dev's are closed - then close adapters via p_drv +*/ +if (!p_drv->n_eth_dev_init_count) +drv_deinit (p_drv); + }return 0 ; }
drivers/net/ntnic/ntnic_vfio.c +4 -1
@@ -49,6 +49,7 @@ vfio_get(int vf_num)int nt_vfio_setup (struct rte_pci_device *dev) { +int ret;char devname[RTE_DEV_NAME_MAX_LEN ] = {0 };int iommu_group_num;int vf_num;
@@ -71,7 +72,9 @@ nt_vfio_setup(struct rte_pci_device *dev) vfio->iova_addr =START_VF_IOVA ;rte_pci_device_name (&dev->addr, devname,RTE_DEV_NAME_MAX_LEN ); -rte_vfio_get_group_num (rte_pci_get_sysfs_path (), devname, &iommu_group_num); + ret =rte_vfio_get_group_num (rte_pci_get_sysfs_path (), devname, &iommu_group_num); +if (ret <=0 ) +return -1 ;if (vf_num ==0 ) {/* use default container for pf0 */
drivers/net/ntnic/ntutil/nt_util.c +2 -1
@@ -31,7 +31,8 @@ uint64_t nt_os_get_time_monotonic_counter(void)/* Allocation size matching minimum alignment of specified size */ uint64_t nt_util_align_size (uint64_t size) { -return 1 <<rte_log2_u64 (size); +uint64_t alignment_size =1ULL <<rte_log2_u64 (size); +return alignment_size; }void nt_util_vfio_init (struct nt_util_vfio_impl *impl)
Signature · 1 line
2.45.0
PATCH v3 3/50 net/ntnic: update documentation
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add forgotten feature to the documentation (ntnic.ini)
--- doc/guides/nics/features/ntnic.ini | 1 + 1 file changed, 1 insertion(+)
doc/guides/nics/features/ntnic.ini +1 -0
@@ -6,6 +6,7 @@ [Features] FW version = Y Speed capabilities = Y +Link status = Y Unicast MAC filter = Y Multicast MAC filter = Y Linux = Y
Signature · 1 line
2.45.0
PATCH v3 4/50 net/ntnic: remove extra calling of the API for release port
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
During rte_eth_dev_close execution, eth_dev_close function exported by ntnic is called, followed by a call to rte_eth_dev_release_port.
Since there is no possible returns between the calls, calling rte_eth_dev_release_port from eth_dev_close is redundant and error-prone.
---
v2
* Update release notes
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/ntnic_ethdev.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -102,6 +102,7 @@ New Features * Update supported version of the FPGA to 9563.55.49 * Fix Coverity issues + * Fix issues related to release 24.07 Removed Items -------------
drivers/net/ntnic/ntnic_ethdev.c +0 -1
@@ -383,7 +383,6 @@ eth_dev_close(struct rte_eth_dev *eth_dev) internals->p_drv =NULL ; -rte_eth_dev_release_port (eth_dev);if (p_drv) {/* decrease initialized ethernet devices */ p_drv->n_eth_dev_init_count--;
Signature · 1 line
2.45.0
PATCH v3 5/50 net/ntnic: extend and fix logging implementation
In reply to Serhii IliushykFrom: Danylo Vodopianov <[email protected]>
Add suffixes logging
Fix the issue with the configuration log level for a specific module Fix extended debug logging
3-letter abbreviation for log type
Update documentation
new log modules were added
Log level in functions that initialize feature operations was updated from INFO to DEBUG to avoid noisy traces during driver startup.
log level for ops init was changed
nim and PMD modules was replaced with NTNIC
NIM module was replaced with NTNIC according to the ntnic log convention.
---
v2
* Update release notes
* Modify logging with RTE_LOG_LINE
v3
* Remove new line character from logs
--- doc/guides/nics/ntnic.rst | 29 +++++ doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 12 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 68 +++++----- drivers/net/ntnic/nim/i2c_nim.c | 24 ++-- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 12 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 30 ++--- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 120 +++++++++--------- drivers/net/ntnic/nthw/core/nthw_fpga.c | 36 +++--- drivers/net/ntnic/nthw/core/nthw_gpio_phy.c | 2 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 6 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 28 ++-- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 16 +-- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 4 +- drivers/net/ntnic/nthw/core/nthw_sdc.c | 2 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 10 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 22 ++-- drivers/net/ntnic/nthw/nthw_rac.c | 48 +++---- drivers/net/ntnic/ntlog/ntlog.c | 2 - drivers/net/ntnic/ntlog/ntlog.h | 61 ++++++--- drivers/net/ntnic/ntnic_ethdev.c | 93 +++++++------- drivers/net/ntnic/ntnic_vfio.c | 28 ++-- drivers/net/ntnic/ntutil/nt_util.c | 12 +- 23 files changed, 361 insertions(+), 305 deletions(-)
doc/guides/nics/ntnic.rst +29 -0
@@ -49,3 +49,32 @@ which is required for the PMD to use vfio-pci on the PF. This support has been back-ported to older Linux distributions and they are also supported. If vfio-pci is not required, kernel version 4.18 is supported. + + +Logging and Debugging +--------------------- + +NTNIC supports several groups of logging that can be enabled with ``--log-level`` +parameter: + +- NTNIC. + + Logging info from the main PMD code. i.e. code that is related to DPDK:: + + --log-level=pmd.net.ntnic.ntnic,8 + +- NTHW. + + Logging info from NTHW. i.e. code that is related to the FPGA and the Adapter:: + + --log-level=pmd.net.ntnic.nthw,8 + +- FILTER. + + Logging info from filter. i.e. code that is related to the binary filter:: + + --log-level=pmd.net.ntnic.filter,8 + +To enable logging on all levels use wildcard in the following way:: + + --log-level=pmd.net.ntnic.*,8
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -103,6 +103,7 @@ New Features * Update supported version of the FPGA to 9563.55.49 * Fix Coverity issues * Fix issues related to release 24.07 + * Extended and fixed the implementation of the logging Removed Items -------------
drivers/net/ntnic/adapter/nt4ga_adapter.c +6 -6
@@ -107,7 +107,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)PCIIDENT_TO_BUSNR (p_adapter_info->fpga_info.pciident),PCIIDENT_TO_DEVNR (p_adapter_info->fpga_info.pciident), PCIIDENT_TO_FUNCNR(p_adapter_info->fpga_info.pciident)); -NT_LOG (DBG ,NTNIC ,"%s: (0x%08X)\n" , p_dev_name, +NT_LOG (DBG ,NTNIC ,"%s: (0x%08X)" , p_dev_name, p_adapter_info->fpga_info.pciident); }
@@ -121,7 +121,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)PCIIDENT_TO_BUSNR (p_adapter_info->fpga_info.pciident),PCIIDENT_TO_DEVNR (p_adapter_info->fpga_info.pciident), PCIIDENT_TO_FUNCNR(p_adapter_info->fpga_info.pciident)); -NT_LOG (DBG ,NTNIC ,"%s: %s\n" , p_adapter_id_str, p_dev_name); +NT_LOG (DBG ,NTNIC ,"%s: %s" , p_adapter_id_str, p_dev_name); } {
@@ -142,7 +142,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) res =nthw_fpga_init (&p_adapter_info->fpga_info);if (res) { -NT_LOG_DBGX (ERR ,NTNIC ,"%s: %s: FPGA=%04d res=x%08X\n" , p_adapter_id_str, +NT_LOG_DBGX (ERR ,NTNIC ,"%s: %s: FPGA=%04d res=x%08X" , p_adapter_id_str, p_dev_name, fpga_info->n_fpga_prod_id, res);return res; }
@@ -171,7 +171,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) link_ops =get_100g_link_ops ();if (link_ops ==NULL ) { -NT_LOG (ERR ,NTNIC ,"NT200A02 100G link module uninitialized\n" ); +NT_LOG (ERR ,NTNIC ,"NT200A02 100G link module uninitialized" ); res =-1 ;break ; }
@@ -180,14 +180,14 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)break ;default : -NT_LOG (ERR ,NTNIC ,"Unsupported FPGA product: %04d\n" , +NT_LOG (ERR ,NTNIC ,"Unsupported FPGA product: %04d" , fpga_info->n_fpga_prod_id); res =-1 ;break ; }if (res) { -NT_LOG_DBGX (ERR ,NTNIC ,"%s: %s: FPGA=%04d res=x%08X\n" , +NT_LOG_DBGX (ERR ,NTNIC ,"%s: %s: FPGA=%04d res=x%08X" , p_adapter_id_str, p_dev_name, fpga_info->n_fpga_prod_id, res);return res;
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +34 -34
249 lines not on this page · raw message
drivers/net/ntnic/nim/i2c_nim.c +12 -12
@@ -28,7 +28,7 @@ static bool page_addressing(nt_nim_identifier_t id)return true;default : -NT_LOG (DBG ,NTNIC ,"Unknown NIM identifier %d\n" , id); +NT_LOG (DBG ,NTNIC ,"Unknown NIM identifier %d" , id);return false; } }
@@ -160,14 +160,14 @@ static int nim_read_write_data_lin(nim_i2c_ctx_p ctx, bool m_page_addressing, uiif (use_page_select) {if (nim_setup_page (ctx, (uint8_t )((lin_addr /128 ) -1 )) !=0 ) {NT_LOG (ERR ,NTNIC , -"Cannot set up page for linear address %u\n" , lin_addr); +"Cannot set up page for linear address %u" , lin_addr);return -1 ; } }if (nim_read_write_i2c_data (ctx, do_write, lin_addr, i2c_addr, a_reg_addr, (uint8_t )seq_cnt, p_data) !=0 ) { -NT_LOG (ERR ,NTNIC ," Call to nim_read_write_i2c_data failed\n" ); +NT_LOG (ERR ,NTNIC ," Call to nim_read_write_i2c_data failed" );return -1 ; }
@@ -219,7 +219,7 @@ static int i2c_nim_common_construct(nim_i2c_ctx_p ctx) res =-1 ;if (res) { -NT_LOG (ERR ,PMD ,"Can't read NIM id." ); +NT_LOG (ERR ,NTNIC ,"Can't read NIM id." );return res; }
@@ -308,7 +308,7 @@ static int qsfp_nim_state_build(nim_i2c_ctx_t *ctx, sfp_nim_state_t *state)break ;default : -NT_LOG (INF ,NIM ,"nim_id = %u is not an QSFP/QSFP+/QSFP28 module\n" , ctx->nim_id); +NT_LOG (INF ,NTNIC ,"nim_id = %u is not an QSFP/QSFP+/QSFP28 module" , ctx->nim_id); res =-1 ; }
@@ -405,7 +405,7 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx)uint16_t nim_units[5 ] = {1000 ,2 ,1 ,1 ,1 };/* QSFP MSA units in meters */ const char *yes_no[2 ] = {"No" ,"Yes" }; (void )yes_no; -NT_LOG (DBG ,NTNIC ,"Instance %d: NIM id: %s (%d)\n" , ctx->instance, +NT_LOG (DBG ,NTNIC ,"Instance %d: NIM id: %s (%d)" , ctx->instance,nim_id_to_text (ctx->nim_id), ctx->nim_id);/* Read DMI options */
@@ -415,12 +415,12 @@ static int qsfpplus_read_basic_data(nim_i2c_ctx_t *ctx) } ctx->avg_pwr = options &QSFP_DMI_AVG_PWR_BIT ; -NT_LOG (DBG ,NTNIC ,"Instance %d: NIM options: (DMI: Yes, AvgPwr: %s)\n" , ctx->instance, +NT_LOG (DBG ,NTNIC ,"Instance %d: NIM options: (DMI: Yes, AvgPwr: %s)" , ctx->instance, yes_no[ctx->avg_pwr]);qsfp_read_vendor_info (ctx); -NT_LOG (DBG ,PMD , -"Instance %d: NIM info: (Vendor: %s, PN: %s, SN: %s, Date: %s, Rev: %s)\n" , +NT_LOG (DBG ,NTNIC , +"Instance %d: NIM info: (Vendor: %s, PN: %s, SN: %s, Date: %s, Rev: %s)" , ctx->instance, ctx->vendor_name, ctx->prod_no, ctx->serial_no, ctx->date, ctx->rev); if (nim_read_write_data_lin(ctx, pg_addr, QSFP_SUP_LEN_INFO_LIN_ADDR, sizeof(nim_len_info),
@@ -540,7 +540,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx) (read_byte (ctx, enh_options_reg_addr) >>2 ) &0x03 ;/* bit 3..2 */ if (rate_select_type !=2 ) { -NT_LOG (DBG ,PMD ,"NIM has unhandled rate select type (%d)" , rate_select_type); +NT_LOG (DBG ,NTNIC ,"NIM has unhandled rate select type (%d)" , rate_select_type);return false; }
@@ -548,7 +548,7 @@ static bool qsfp28_is_rate_selection_enabled(nim_i2c_ctx_p ctx)read_byte (ctx, ext_rate_select_compl_reg_addr) &0x03 ;/* bit 1..0 */ if (ext_rate_select_ver !=0x02 ) { -NT_LOG (DBG ,PMD ,"NIM has unhandled extended rate select version (%d)" , +NT_LOG (DBG ,NTNIC ,"NIM has unhandled extended rate select version (%d)" , ext_rate_select_ver);return false; }
@@ -790,7 +790,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.\n" ,nim_id_to_text (ctx->nim_id)); +NT_LOG (ERR ,NTHW ,"NIM type %s is not supported." ,nim_id_to_text (ctx->nim_id)); }return res;
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +6 -6
@@ -18,7 +18,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)const struct rst_nt200a0x_ops *rst_nt200a0x_ops =get_rst_nt200a0x_ops ();if (rst_nt200a0x_ops ==NULL ) { -NT_LOG (ERR ,NTHW ,"RST NT200A0X NOT INCLUDED\n" ); +NT_LOG (ERR ,NTHW ,"RST NT200A0X NOT INCLUDED" );return -1 ; }
@@ -26,7 +26,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) res = rst_nt200a0x_ops->nthw_fpga_rst_nt200a0x_init (p_fpga_info, &rst);if (res) { -NT_LOG_DBGX (ERR ,NTHW ,"%s: FPGA=%04d res=%d\n" , p_adapter_id_str, +NT_LOG_DBGX (ERR ,NTHW ,"%s: FPGA=%04d res=%d" , p_adapter_id_str, p_fpga_info->n_fpga_prod_id, res);return res; }
@@ -46,20 +46,20 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)break ;default : -NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA product: %04d\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA product: %04d" , p_adapter_id_str, p_fpga_info->n_fpga_prod_id); res =-1 ;break ; }if (!included) { -NT_LOG (ERR ,NTHW ,"%s: NOT INCLUDED FPGA product: %04d\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: NOT INCLUDED FPGA product: %04d" , p_adapter_id_str, p_fpga_info->n_fpga_prod_id); res =-1 ; }if (res) { -NT_LOG_DBGX (ERR ,NTHW ,"%s: FPGA=%04d res=%d\n" , p_adapter_id_str, +NT_LOG_DBGX (ERR ,NTHW ,"%s: FPGA=%04d res=%d" , p_adapter_id_str, p_fpga_info->n_fpga_prod_id, res);return res; }
@@ -71,6 +71,6 @@ static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpgavoid nt200a0x_ops_init (void ) { -NT_LOG (INF ,NTHW ,"NT200A0X OPS INIT\n" ); +NT_LOG (DBG ,NTHW ,"NT200A0X OPS INIT" );register_nt200a0x_ops (&nt200a0x_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +15 -15
@@ -26,20 +26,20 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mn_fpga_version = n_fpga_version; p->mn_fpga_revision = n_fpga_revision; -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: FPGA reset setup: FPGA %04d-%02d-%02d\n" , p_adapter_id_str, +NT_LOG_DBGX (DBG ,NTHW ,"%s: FPGA reset setup: FPGA %04d-%02d-%02d" , p_adapter_id_str, n_fpga_product_id, n_fpga_version, n_fpga_revision); p_mod_rst =nthw_fpga_query_module (p_fpga,MOD_RST9563 ,0 );if (p_mod_rst ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: RST %d: no such instance\n" , p_adapter_id_str,0 ); +NT_LOG (ERR ,NTHW ,"%s: RST %d: no such instance" , p_adapter_id_str,0 );return -1 ; } p_mod_rst =nthw_fpga_query_module (p_fpga,MOD_RST9563 ,0 );if (p_mod_rst ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: RST %d: no such instance\n" , p_adapter_id_str,0 ); +NT_LOG (ERR ,NTHW ,"%s: RST %d: no such instance" , p_adapter_id_str,0 );return -1 ; }
@@ -70,10 +70,10 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_rst_tmc =nthw_register_query_field (p_curr_reg,RST9563_RST_TMC );if (!p->mp_fld_rst_tsm_ref_mmcm) -NT_LOG (DBG ,NTHW ,"%s: No RST9563_RST_TSM_REF_MMCM found\n" , p_adapter_id_str); +NT_LOG (DBG ,NTHW ,"%s: No RST9563_RST_TSM_REF_MMCM found" , p_adapter_id_str);if (!p->mp_fld_rst_tmc) -NT_LOG (DBG ,NTHW ,"%s: No RST9563_RST_TMC found\n" , p_adapter_id_str); +NT_LOG (DBG ,NTHW ,"%s: No RST9563_RST_TMC found" , p_adapter_id_str);nthw_register_update (p_curr_reg);
@@ -105,7 +105,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_stat_tsm_ref_mmcm_locked =NULL ;/* Field not present on 9563 */ if (!p->mp_fld_stat_tsm_ref_mmcm_locked) { -NT_LOG (DBG ,NTHW ,"%s: No RST9563_STAT_TSM_REF_MMCM_LOCKED found\n" , +NT_LOG (DBG ,NTHW ,"%s: No RST9563_STAT_TSM_REF_MMCM_LOCKED found" , p_adapter_id_str); }
@@ -127,7 +127,7 @@ static int nthw_fpga_rst9563_setup(nthw_fpga_t *p_fpga, struct nthw_fpga_rst_nt2 p->mp_fld_sticky_tsm_ref_mmcm_unlocked =NULL ;/* Field not present on 9563 */ if (!p->mp_fld_sticky_tsm_ref_mmcm_unlocked) { -NT_LOG (DBG ,NTHW ,"%s: No RST9563_STICKY_TSM_REF_MMCM_UNLOCKED found\n" , +NT_LOG (DBG ,NTHW ,"%s: No RST9563_STICKY_TSM_REF_MMCM_UNLOCKED found" , p_adapter_id_str); }
@@ -151,7 +151,7 @@ static int nthw_fpga_rst9563_periph_reset(nthw_fpga_t *p_fpga)if (p_mod_rst) {nthw_register_t *p_reg_rst;nthw_field_t *p_fld_rst_periph; -NT_LOG (DBG ,NTHW ,"%s: PERIPH RST\n" , p_adapter_id_str); +NT_LOG (DBG ,NTHW ,"%s: PERIPH RST" , p_adapter_id_str); p_reg_rst =nthw_module_get_register (p_mod_rst,RST9563_RST ); p_fld_rst_periph =nthw_register_get_field (p_reg_rst,RST9563_RST_PERIPH );nthw_field_set_flush (p_fld_rst_periph);
@@ -174,7 +174,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga,const struct clk9563_ops *clk9563_ops =get_clk9563_ops ();if (clk9563_ops ==NULL ) { -NT_LOG (INF ,NTNIC ,"CLK9563 module not included\n" ); +NT_LOG (INF ,NTNIC ,"CLK9563 module not included" );return -1 ; }
@@ -184,7 +184,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga, *clk9563_ops->get_n_data_9563_si5340_nt200a02_u23_v5()); }else { -NT_LOG (ERR ,NTHW ,"%s: Fpga %d: Unsupported clock synth model (%d)\n" , +NT_LOG (ERR ,NTHW ,"%s: Fpga %d: Unsupported clock synth model (%d)" , p_adapter_id_str, n_fpga_product_id, n_si_labs_clock_synth_model); res =-1 ; }
@@ -212,7 +212,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res =nthw_fpga_rst9563_periph_reset (p_fpga);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d" , p_adapter_id_str, res);return res; }
@@ -220,14 +220,14 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, n_si_labs_clock_synth_i2c_addr);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d" , p_adapter_id_str, res);return res; } res =nthw_fpga_rst9563_setup (p_fpga, p_rst);if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d" , p_adapter_id_str, res);return res; }
@@ -235,7 +235,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info, res = rst_ops !=NULL ? rst_ops->nthw_fpga_rst_nt200a0x_reset (p_fpga, p_rst) :-1 ;if (res) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: ERROR: res=%d\n" , p_adapter_id_str, res); +NT_LOG_DBGX (DBG ,NTHW ,"%s: ERROR: res=%d" , p_adapter_id_str, res);return res; }
@@ -246,6 +246,6 @@ static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rsvoid rst9563_ops_init (void ) { -NT_LOG (INF ,NTHW ,"RST9563 OPS INIT\n" ); +NT_LOG (DBG ,NTHW ,"RST9563 OPS INIT" );register_rst9563_ops (&rst9563_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +60 -60
403 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_fpga.c +18 -18
@@ -145,7 +145,7 @@ int nthw_fpga_silabs_detect(nthw_fpga_t *p_fpga, const int n_instance_no, const } } -NT_LOG (DBG ,NTHW ,"%s: %016" PRIX64 ": %d\n" , p_adapter_id_str, ident, res); +NT_LOG (DBG ,NTHW ,"%s: %016" PRIX64 ": %d" , p_adapter_id_str, ident, res);return res; }
@@ -210,7 +210,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)"%04d-%04d-%02d-%02d" , n_fpga_type_id, n_fpga_prod_id, n_fpga_ver_id, n_fpga_rev_id); -NT_LOG (INF ,NTHW ,"%s: FPGA %s (%" PRIX64 ") [%08X]\n" , p_adapter_id_str, +NT_LOG (INF ,NTHW ,"%s: FPGA %s (%" PRIX64 ") [%08X]" , p_adapter_id_str, s_fpga_prod_ver_rev_str, n_fpga_ident, n_fpga_build_time); }
@@ -225,7 +225,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) p_fpga_info->mp_fpga = p_fpga;if (p_fpga ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: %s (%08X)" , p_adapter_id_str, s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time);return -1 ; }
@@ -238,20 +238,20 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)nthw_fpga_get_param_info (p_fpga_info, p_fpga);/* debug: report params */ -NT_LOG (DBG ,NTHW ,"%s: NT_NIMS=%d\n" , p_adapter_id_str, p_fpga_info->n_nims); -NT_LOG (DBG ,NTHW ,"%s: NT_PHY_PORTS=%d\n" , p_adapter_id_str, p_fpga_info->n_phy_ports); -NT_LOG (DBG ,NTHW ,"%s: NT_PHY_QUADS=%d\n" , p_adapter_id_str, p_fpga_info->n_phy_quads); -NT_LOG (DBG ,NTHW ,"%s: NT_RX_PORTS=%d\n" , p_adapter_id_str, p_fpga_info->n_rx_ports); -NT_LOG (DBG ,NTHW ,"%s: NT_TX_PORTS=%d\n" , p_adapter_id_str, p_fpga_info->n_tx_ports); -NT_LOG (DBG ,NTHW ,"%s: nProfile=%d\n" , p_adapter_id_str, (int )p_fpga_info->profile); -NT_LOG (DBG ,NTHW ,"%s: bHasMcu=%d\n" , p_adapter_id_str, p_mcu_info->mb_has_mcu); -NT_LOG (DBG ,NTHW ,"%s: McuType=%d\n" , p_adapter_id_str, p_mcu_info->mn_mcu_type); -NT_LOG (DBG ,NTHW ,"%s: McuDramSize=%d\n" , p_adapter_id_str, p_mcu_info->mn_mcu_dram_size); +NT_LOG (DBG ,NTHW ,"%s: NT_NIMS=%d" , p_adapter_id_str, p_fpga_info->n_nims); +NT_LOG (DBG ,NTHW ,"%s: NT_PHY_PORTS=%d" , p_adapter_id_str, p_fpga_info->n_phy_ports); +NT_LOG (DBG ,NTHW ,"%s: NT_PHY_QUADS=%d" , p_adapter_id_str, p_fpga_info->n_phy_quads); +NT_LOG (DBG ,NTHW ,"%s: NT_RX_PORTS=%d" , p_adapter_id_str, p_fpga_info->n_rx_ports); +NT_LOG (DBG ,NTHW ,"%s: NT_TX_PORTS=%d" , p_adapter_id_str, p_fpga_info->n_tx_ports); +NT_LOG (DBG ,NTHW ,"%s: nProfile=%d" , p_adapter_id_str, (int )p_fpga_info->profile); +NT_LOG (DBG ,NTHW ,"%s: bHasMcu=%d" , p_adapter_id_str, p_mcu_info->mb_has_mcu); +NT_LOG (DBG ,NTHW ,"%s: McuType=%d" , p_adapter_id_str, p_mcu_info->mn_mcu_type); +NT_LOG (DBG ,NTHW ,"%s: McuDramSize=%d" , p_adapter_id_str, p_mcu_info->mn_mcu_dram_size); p_nthw_rac =nthw_rac_new ();if (p_nthw_rac ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: RAC is not found: %s (%08X)\n" , +NT_LOG (ERR ,NTHW ,"%s: Unsupported FPGA: RAC is not found: %s (%08X)" , p_adapter_id_str, s_fpga_prod_ver_rev_str, p_fpga_info->n_fpga_build_time);return -1 ; }
@@ -273,20 +273,20 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)break ;default : -NT_LOG (ERR ,NTHW ,"%s: Unsupported HW product id: %d\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: Unsupported HW product id: %d" , p_adapter_id_str, p_fpga_info->n_nthw_adapter_id); res =-1 ;break ; }if (!included) { -NT_LOG (ERR ,NTHW ,"%s: NOT INCLUDED HW product: %d\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: NOT INCLUDED HW product: %d" , p_adapter_id_str, p_fpga_info->n_nthw_adapter_id); res =-1 ; }if (res) { -NT_LOG (ERR ,NTHW ,"%s: status: 0x%08X\n" , p_adapter_id_str, res); +NT_LOG (ERR ,NTHW ,"%s: status: 0x%08X" , p_adapter_id_str, res);return res; }
@@ -299,7 +299,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) res =nthw_pcie3_init (p_nthw_pcie3, p_fpga,0 );if (res ==0 ) { -NT_LOG (DBG ,NTHW ,"%s: Pcie3 module found\n" , p_adapter_id_str); +NT_LOG (DBG ,NTHW ,"%s: Pcie3 module found" , p_adapter_id_str);nthw_pcie3_trigger_sample_time (p_nthw_pcie3); }else {
@@ -318,7 +318,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) res =nthw_hif_init (p_nthw_hif, p_fpga,0 );if (res ==0 ) { -NT_LOG (DBG ,NTHW ,"%s: Hif module found\n" , p_adapter_id_str); +NT_LOG (DBG ,NTHW ,"%s: Hif module found" , p_adapter_id_str);nthw_hif_trigger_sample_time (p_nthw_hif); }else {
drivers/net/ntnic/nthw/core/nthw_gpio_phy.c +1 -1
@@ -19,7 +19,7 @@ int nthw_gpio_phy_init(nthw_gpio_phy_t *p, nthw_fpga_t *p_fpga, int n_instance)return p_mod ==NULL ?-1 :0 ;if (p_mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: GPIO_PHY %d: no such instance\n" , +NT_LOG (ERR ,NTHW ,"%s: GPIO_PHY %d: no such instance" , p_fpga->p_fpga_info->mp_adapter_id_str, n_instance);return -1 ; }
drivers/net/ntnic/nthw/core/nthw_hif.c +3 -3
@@ -39,7 +39,7 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance)return mod ==NULL ?-1 :0 ;if (mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: HIF %d: no such instance\n" , +NT_LOG (ERR ,NTHW ,"%s: HIF %d: no such instance" , p_fpga->p_fpga_info->mp_adapter_id_str, n_instance);return -1 ; }
@@ -76,10 +76,10 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance) p->mn_fpga_id_build_no =nthw_field_get_updated (p->mp_fld_prod_id_msb_build_no); p->mn_fpga_id_item =nthw_field_get_updated (p->mp_fld_prod_id_msb_type_id); -NT_LOG (DBG ,NTHW ,"%s: HIF %d: %d-%d-%d-%d-%d\n" , p_adapter_id_str, p->mn_instance, +NT_LOG (DBG ,NTHW ,"%s: HIF %d: %d-%d-%d-%d-%d" , p_adapter_id_str, p->mn_instance, p->mn_fpga_id_item, p->mn_fpga_id_prod, p->mn_fpga_id_ver, p->mn_fpga_id_rev, p->mn_fpga_id_build_no); -NT_LOG (DBG ,NTHW ,"%s: HIF %d: HIF ref clock: %d Hz (%d ticks/ps)\n" , p_adapter_id_str, +NT_LOG (DBG ,NTHW ,"%s: HIF %d: HIF ref clock: %d Hz (%d ticks/ps)" , p_adapter_id_str, p->mn_instance, p->mn_fpga_hif_ref_clk_freq, p->mn_fpga_param_hif_per_ps); p->mp_reg_build_seed =NULL ;/* Reg/Fld not present on HIF */
drivers/net/ntnic/nthw/core/nthw_iic.c +14 -14
@@ -161,7 +161,7 @@ int nthw_iic_init(nthw_iic_t *p, nthw_fpga_t *p_fpga, int n_iic_instance,return mod ==NULL ?-1 :0 ;if (mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: I2C %d: no such instance\n" , p_adapter_id_str, +NT_LOG (ERR ,NTHW ,"%s: I2C %d: no such instance" , p_adapter_id_str, n_iic_instance);return -1 ; }
@@ -239,7 +239,7 @@ int nthw_iic_init(nthw_iic_t *p, nthw_fpga_t *p_fpga, int n_iic_instance,/* Setup controller timing */ if (p->mn_iic_cycle_time) { -NT_LOG (DBG ,NTHW ,"%s: I2C%d: cycletime=%d\n" , p_adapter_id_str, +NT_LOG (DBG ,NTHW ,"%s: I2C%d: cycletime=%d" , p_adapter_id_str, p->mn_iic_instance, p->mn_iic_cycle_time);nthw_iic_reg_set_timing (p, p->mn_iic_cycle_time); }
@@ -284,7 +284,7 @@ int nthw_iic_read_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintint retry = (p->mn_read_data_retry >=0 ? p->mn_read_data_retry :10 );if (n_debug_mode ==0xff ) { -NT_LOG (DBG ,NTHW ,"%s: adr=0x%2.2x, reg=%d, len=%d\n" , p_adapter_id_str, dev_addr, +NT_LOG (DBG ,NTHW ,"%s: adr=0x%2.2x, reg=%d, len=%d" , p_adapter_id_str, dev_addr, a_reg_addr, data_len); }
@@ -293,18 +293,18 @@ int nthw_iic_read_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintif (retry <=0 ) {NT_LOG (ERR ,NTHW , -"%s: I2C%d: Read retry exhausted (dev_addr=%d a_reg_addr=%d)\n" , +"%s: I2C%d: Read retry exhausted (dev_addr=%d a_reg_addr=%d)" , p_adapter_id_str, p->mn_iic_instance, dev_addr, a_reg_addr);return -1 ; }else { -NT_LOG (DBG ,NTHW ,"%s: I2C%d: Read retry=%d (dev_addr=%d a_reg_addr=%d)\n" , +NT_LOG (DBG ,NTHW ,"%s: I2C%d: Read retry=%d (dev_addr=%d a_reg_addr=%d)" , p_adapter_id_str, p->mn_iic_instance, retry, dev_addr, a_reg_addr); } }if (n_debug_mode ==0xff ) { -NT_LOG (DBG ,NTHW ,"%s: adr=0x%2.2x, reg=%d, len=%d, retries remaining: %d\n" , +NT_LOG (DBG ,NTHW ,"%s: adr=0x%2.2x, reg=%d, len=%d, retries remaining: %d" , p_adapter_id_str, dev_addr, a_reg_addr, data_len, retry); }
@@ -331,7 +331,7 @@ int nthw_iic_readbyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint8nthw_iic_reg_tx_fifo_write (p, a_reg_addr,0 ,1 );if (!nthw_iic_bus_ready (p)) { -NT_LOG_DBGX (ERR ,NTHW ,"%s: error:\n" , p_adapter_id_str); +NT_LOG_DBGX (ERR ,NTHW ,"%s: error:" , p_adapter_id_str);return -1 ; }
@@ -355,7 +355,7 @@ int nthw_iic_readbyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uint8return 0 ; }else { -NT_LOG_DBGX (ERR ,NTHW ,"%s: error\n" , p_adapter_id_str); +NT_LOG_DBGX (ERR ,NTHW ,"%s: error" , p_adapter_id_str);return -1 ; }
@@ -374,13 +374,13 @@ int nthw_iic_write_data(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uinif (retry <=0 ) {NT_LOG (ERR ,NTHW , -"%s: I2C%d: Write retry exhausted (dev_addr=%d a_reg_addr=%d)\n" , +"%s: I2C%d: Write retry exhausted (dev_addr=%d a_reg_addr=%d)" , p_adapter_id_str, p->mn_iic_instance, dev_addr, a_reg_addr);return -1 ; }else {NT_LOG (DBG ,NTHW , -"%s: I2C%d: Write retry=%d (dev_addr=%d a_reg_addr=%d)\n" , +"%s: I2C%d: Write retry=%d (dev_addr=%d a_reg_addr=%d)" , p_adapter_id_str, p->mn_iic_instance, retry, dev_addr, a_reg_addr); } }
@@ -422,11 +422,11 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintnthw_iic_reg_tx_fifo_write (p, *p_byte,0 ,1 );if (!nthw_iic_bus_ready (p)) { -NT_LOG_DBGX (WARNING ,NTHW ,"%s: warn: !busReady\n" , p_adapter_id_str); +NT_LOG_DBGX (WRN ,NTHW ,"%s: warn: !busReady" , p_adapter_id_str);while (true)if (nthw_iic_bus_ready (p)) { -NT_LOG_DBGX (DEBUG ,NTHW ,"%s: info: busReady\n" , +NT_LOG_DBGX (DBG ,NTHW ,"%s: info: busReady" , p_adapter_id_str);break ; }
@@ -435,7 +435,7 @@ int nthw_iic_writebyte(nthw_iic_t *p, uint8_t dev_addr, uint8_t a_reg_addr, uintreturn 0 ; }else { -NT_LOG_DBGX (WARNING ,NTHW ,"%s\n" , p_adapter_id_str); +NT_LOG_DBGX (WRN ,NTHW ,"%s" , p_adapter_id_str);return -1 ; } }
@@ -508,7 +508,7 @@ int nthw_iic_scan_dev_addr(nthw_iic_t *p, int n_dev_addr, int n_reg_addr)if (res ==0 ) {NT_LOG (DBG ,NTHW , -"%s: I2C%d: devaddr=0x%02X (%03d) regaddr=%02X val=%02X (%03d) res=%d\n" , +"%s: I2C%d: devaddr=0x%02X (%03d) regaddr=%02X val=%02X (%03d) res=%d" , p_adapter_id_str, p->mn_iic_instance, n_dev_addr, n_dev_addr, n_reg_addr, data_val, data_val, res); }
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +8 -8
@@ -35,7 +35,7 @@ int nthw_mac_pcs_init(nthw_mac_pcs_t *p, nthw_fpga_t *p_fpga, int n_instance)return mod ==NULL ?-1 :0 ;if (mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: MAC_PCS %d: no such instance\n" , +NT_LOG (ERR ,NTHW ,"%s: MAC_PCS %d: no such instance" , p_fpga->p_fpga_info->mp_adapter_id_str, n_instance);return -1 ; }
@@ -596,7 +596,7 @@ bool nthw_mac_pcs_reset_required(nthw_mac_pcs_t *p)void nthw_mac_pcs_set_fec (nthw_mac_pcs_t *p,bool enable) { -NT_LOG (DBG ,NTHW ,"Port %u: Set FEC: %u\n" , p->m_port_no, enable); +NT_LOG (DBG ,NTHW ,"Port %u: Set FEC: %u" , p->m_port_no, enable);nthw_field_get_updated (p->mp_field_fec_ctrl_reg_rs_fec_ctrl_in);
@@ -646,12 +646,12 @@ void nthw_mac_pcs_reset_fec_counters(nthw_mac_pcs_t *p)nthw_register_update (p->mp_reg_fec_ucw_cnt);if (nthw_field_get_val32 (p->mp_field_fec_cw_cnt_cw_cnt)) { -NT_LOG (DBG ,NTHW ,"Port %u: FEC_CW_CNT: %u\n" , p->m_port_no, +NT_LOG (DBG ,NTHW ,"Port %u: FEC_CW_CNT: %u" , p->m_port_no,nthw_field_get_val32 (p->mp_field_fec_cw_cnt_cw_cnt)); }if (nthw_field_get_val32 (p->mp_field_fec_ucw_cnt_ucw_cnt)) { -NT_LOG (DBG ,NTHW ,"Port %u: FEC_UCW_CNT: %u\n" , p->m_port_no, +NT_LOG (DBG ,NTHW ,"Port %u: FEC_UCW_CNT: %u" , p->m_port_no,nthw_field_get_val32 (p->mp_field_fec_ucw_cnt_ucw_cnt)); } }
@@ -735,7 +735,7 @@ void nthw_mac_pcs_set_gty_tx_tuning(nthw_mac_pcs_t *p, uint8_t lane, uint8_t tx_ }NT_LOG (DBG ,NTHW , -"Port %u, lane %u: GTY tx_pre_csr: %d, tx_diff_ctl: %d, tx_post_csr: %d\n" , +"Port %u, lane %u: GTY tx_pre_csr: %d, tx_diff_ctl: %d, tx_post_csr: %d" , p->m_port_no, lane, tx_pre_csr, tx_diff_ctl, tx_post_csr); }
@@ -768,7 +768,7 @@ void nthw_mac_pcs_set_receiver_equalization_mode(nthw_mac_pcs_t *p, uint8_t modenthw_field_set_val32 (p->mp_field_gty_ctl_rx_equa_rst2,0 );nthw_field_set_val_flush32 (p->mp_field_gty_ctl_rx_equa_rst3,0 ); -NT_LOG (DBG ,NTHW ,"Port %u: GTY receiver mode: %s\n" , p->m_port_no, +NT_LOG (DBG ,NTHW ,"Port %u: GTY receiver mode: %s" , p->m_port_no, (mode == c_mac_pcs_receiver_mode_dfe ?"DFE" :"LPM" )); }
@@ -794,7 +794,7 @@ void nthw_mac_pcs_swap_gty_tx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swabreak ; } -NT_LOG (DBG ,NTHW ,"Port %u: set GTY Tx lane (%d) polarity: %d\n" , p->m_port_no, lane, +NT_LOG (DBG ,NTHW ,"Port %u: set GTY Tx lane (%d) polarity: %d" , p->m_port_no, lane, swap); }
@@ -820,7 +820,7 @@ void nthw_mac_pcs_swap_gty_rx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swabreak ; } -NT_LOG (DBG ,NTHW ,"Port %u: set GTY Rx lane (%d) polarity: %d\n" , p->m_port_no, lane, +NT_LOG (DBG ,NTHW ,"Port %u: set GTY Rx lane (%d) polarity: %d" , p->m_port_no, lane, swap); }
drivers/net/ntnic/nthw/core/nthw_pcie3.c +2 -2
@@ -38,7 +38,7 @@ int nthw_pcie3_init(nthw_pcie3_t *p, nthw_fpga_t *p_fpga, int n_instance)return mod ==NULL ?-1 :0 ;if (mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: PCIE3 %d: no such instance\n" , +NT_LOG (ERR ,NTHW ,"%s: PCIE3 %d: no such instance" , p_fpga->p_fpga_info->mp_adapter_id_str, n_instance);return -1 ; }
@@ -250,7 +250,7 @@ int nthw_pcie3_get_stat_rate(nthw_pcie3_t *p, uint64_t *p_pci_rx_rate, uint64_tint nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p,struct nthw_hif_end_point_counters *epc) { -NT_LOG_DBGX (DEBUG ,NTHW ); +NT_LOG_DBGX (DBG ,NTHW );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,
drivers/net/ntnic/nthw/core/nthw_sdc.c +1 -1
@@ -37,7 +37,7 @@ int nthw_sdc_init(nthw_sdc_t *p, nthw_fpga_t *p_fpga, int n_instance)return mod ==NULL ?-1 :0 ;if (mod ==NULL ) { -NT_LOG (ERR ,NTHW ,"%s: SDC %d: no such instance\n" , p_adapter_id_str, n_instance); +NT_LOG (ERR ,NTHW ,"%s: SDC %d: no such instance" , p_adapter_id_str, n_instance);return -1 ; }
drivers/net/ntnic/nthw/core/nthw_si5340.c +5 -5
@@ -102,7 +102,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,uint8_t value;uint8_t ctrl_value; -NT_LOG (DBG ,NTHW ,"%s: data_cnt = %d, data_format = %d\n" , p_adapter_id_str, +NT_LOG (DBG ,NTHW ,"%s: data_cnt = %d, data_format = %d" , p_adapter_id_str, data_cnt, data_format);for (i =0 ; i < data_cnt; i++) {
@@ -117,7 +117,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt, p_data = ((const clk_profile_data_fmt2_t *)p_data) +1 ; }else { -NT_LOG (ERR ,NTHW ,"%s: Unhandled Si5340 data format (%d)\n" , +NT_LOG (ERR ,NTHW ,"%s: Unhandled Si5340 data format (%d)" , p_adapter_id_str, data_format);return -1 ; }
@@ -138,7 +138,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,if (ctrl_value != value) {NT_LOG (ERR ,NTHW , -"%s: Si5340 configuration readback check failed. (Addr = 0x%04X, Write = 0x%02X, Read = 0x%02X)\n" , +"%s: Si5340 configuration readback check failed. (Addr = 0x%04X, Write = 0x%02X, Read = 0x%02X)" , p_adapter_id_str, addr, value, ctrl_value);return -1 ; }
@@ -175,7 +175,7 @@ int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cnt,if (!success) {NT_LOG (ERR ,NTHW , -"%s: Si5340 configuration failed. (Status = 0x%02X, Sticky = 0x%02X)\n" , +"%s: Si5340 configuration failed. (Status = 0x%02X, Sticky = 0x%02X)" , p_adapter_id_str, status, sticky);return -1 ; }
@@ -186,7 +186,7 @@ int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cnt, design_id[sizeof (design_id) -1 ] =0 ; (void )design_id;/* Only used in debug mode */ -NT_LOG (DBG ,NTHW ,"%s: Si5340.Design_id = %s\n" , p_adapter_id_str, design_id); +NT_LOG (DBG ,NTHW ,"%s: Si5340.Design_id = %s" , p_adapter_id_str, design_id);return 0 ; }
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +11 -11
@@ -238,7 +238,7 @@ nthw_fpga_t *nthw_fpga_mgr_query_fpga(nthw_fpga_mgr_t *p_fpga_mgr, uint64_t n_fpif (p_fpga) { }else { -NT_LOG (ERR ,NTHW ,"FPGA Id 0x%" PRIX64 ": %04d: %d.%d: no match found\n" , +NT_LOG (ERR ,NTHW ,"FPGA Id 0x%" PRIX64 ": %04d: %d.%d: no match found" , n_fpga_id, n_fpga_prod_id, n_fpga_ver, n_fpga_rev); }
@@ -250,12 +250,12 @@ void nthw_fpga_mgr_log_dump(nthw_fpga_mgr_t *p) {int i; -NT_LOG_DBGX (DEBUG ,NTHW ,"fpgas=%d\n" , p->mn_fpgas); +NT_LOG_DBGX (DBG ,NTHW ,"fpgas=%d" , p->mn_fpgas);for (i =0 ; i < p->mn_fpgas; i++) {nthw_fpga_prod_init_s *p_init = p->mpa_fpga_prod_init[i]; (void )p_init; -NT_LOG_DBGX (DEBUG ,NTHW ,"fpga=%d/%d: %04d-%02d-%02d\n" , i, p->mn_fpgas, +NT_LOG_DBGX (DBG ,NTHW ,"fpga=%d/%d: %04d-%02d-%02d" , i, p->mn_fpgas, p_init->fpga_product_id, p_init->fpga_version, p_init->fpga_revision); } }
@@ -496,14 +496,14 @@ nthw_register_t *nthw_module_get_register(nthw_module_t *p, nthw_id_t id)nthw_register_t *p_register;if (p ==NULL ) { -NT_LOG (ERR ,NTHW ,"Illegal module context for register %u\n" , id); +NT_LOG (ERR ,NTHW ,"Illegal module context for register %u" , id);return NULL ; } p_register =nthw_module_lookup_register (p, id);if (!p_register) { -NT_LOG (ERR ,NTHW ,"Register %u not found in module: %s (%u)\n" , id, +NT_LOG (ERR ,NTHW ,"Register %u not found in module: %s (%u)" , id,nthw_fpga_mod_id_to_str (p->mn_mod_id), p->mn_mod_id); }
@@ -634,14 +634,14 @@ nthw_field_t *nthw_register_get_field(const nthw_register_t *p, nthw_id_t id)nthw_field_t *p_field;if (p ==NULL ) { -NT_LOG (ERR ,NTHW ,"Illegal register context for field %u\n" , id); +NT_LOG (ERR ,NTHW ,"Illegal register context for field %u" , id);return NULL ; } p_field =nthw_register_lookup_field (p, id);if (!p_field) { -NT_LOG (ERR ,NTHW ,"Field %u not found in module: %s (%u)\n" , id, +NT_LOG (ERR ,NTHW ,"Field %u not found in module: %s (%u)" , id,nthw_fpga_mod_id_to_str (p->mp_owner->mn_mod_id), p->mp_owner->mn_mod_id); }
@@ -846,7 +846,7 @@ void nthw_register_flush(const nthw_register_t *p, uint32_t cnt) rc =nthw_register_write_data (p, cnt);if (rc) -NT_LOG (ERR ,NTHW ,"Register write error %d\n" , rc); +NT_LOG (ERR ,NTHW ,"Register write error %d" , rc);for (i =0 ; i < cnt; i++) p->mp_dirty[i] = false;
@@ -903,8 +903,8 @@ void nthw_field_init(nthw_field_t *p, nthw_register_t *p_reg, const nthw_fpga_fi p->mn_tail_mask = (1 << bits_remaining) -1 ;if (p->mn_debug_mode >=0x100 ) { - NT_LOG_DBGX(DEBUG, NTHW, - "fldid=%08d: [%08d:%08d] %08d/%08d: (%08d,%08d) (0x%08X,%08d,0x%08X)\n", + NT_LOG_DBGX(DBG, NTHW, + "fldid=%08d: [%08d:%08d] %08d/%08d: (%08d,%08d) (0x%08X,%08d,0x%08X)", p_init->id, p_init->low, (p_init->low + p_init->bw), p_init->bw, ((p_init->bw + 31) / 32), p->mn_first_word, p->mn_first_bit, p->mn_front_mask, p->mn_body_length,
@@ -1143,7 +1143,7 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match e (void )n_reg_mask;NT_LOG (DBG ,NTHW , -"Register::Field::wait%s32(Dev: %s, Bus: %s, Addr: 0x%08X, Mask: 0x%08X, Iterations: %d, Interval: %d)\n" , +"Register::Field::wait%s32(Dev: %s, Bus: %s, Addr: 0x%08X, Mask: 0x%08X, Iterations: %d, Interval: %d)" , p_cond_name, p_dev_name, p_bus_name, n_reg_addr, n_reg_mask, n_poll_iterations, n_poll_interval); }
drivers/net/ntnic/nthw/nthw_rac.c +24 -24
187 lines not on this page · raw message
drivers/net/ntnic/ntlog/ntlog.c +0 -2
@@ -16,8 +16,6 @@#define NTLOG_HELPER_STR_SIZE_MAX (1024) -RTE_LOG_REGISTER_DEFAULT(nt_logtype, NOTICE) -char *ntlog_helper_str_alloc (const char *sinit) {char *s =malloc (NTLOG_HELPER_STR_SIZE_MAX );
drivers/net/ntnic/ntlog/ntlog.h +42 -19
81 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +49 -44
315 lines not on this page · raw message
drivers/net/ntnic/ntnic_vfio.c +14 -14
@@ -55,14 +55,14 @@ nt_vfio_setup(struct rte_pci_device *dev)int vf_num;struct vfio_dev *vfio; -NT_LOG (INF ,NTNIC ,"NT VFIO device setup %s\n" , dev->name); +NT_LOG (INF ,NTNIC ,"NT VFIO device setup %s" , dev->name); vf_num =nt_vfio_vf_num (dev); vfio =vfio_get (vf_num);if (vfio ==NULL ) { -NT_LOG (ERR ,NTNIC ,"VFIO device setup failed. Illegal device id\n" ); +NT_LOG (ERR ,NTNIC ,"VFIO device setup failed. Illegal device id" );return -1 ; }
@@ -85,7 +85,7 @@ nt_vfio_setup(struct rte_pci_device *dev)if (vfio->container_fd <0 ) {NT_LOG (ERR ,NTNIC , -"VFIO device setup failed. VFIO container creation failed.\n" ); +"VFIO device setup failed. VFIO container creation failed." );return -1 ; } }
@@ -94,14 +94,14 @@ nt_vfio_setup(struct rte_pci_device *dev)if (vfio->group_fd <0 ) {NT_LOG (ERR ,NTNIC , -"VFIO device setup failed. VFIO container group bind failed.\n" ); +"VFIO device setup failed. VFIO container group bind failed." ); goto err; }if (vf_num >0 ) {if (rte_pci_map_device (dev)) {NT_LOG (ERR ,NTNIC , -"Map VFIO device failed. is the vfio-pci driver loaded?\n" ); +"Map VFIO device failed. is the vfio-pci driver loaded?" ); goto err; } }
@@ -109,7 +109,7 @@ nt_vfio_setup(struct rte_pci_device *dev) vfio->dev_fd =rte_intr_dev_fd_get (dev->intr_handle);NT_LOG (DBG ,NTNIC , -"%s: VFIO id=%d, dev_fd=%d, container_fd=%d, group_fd=%d, iommu_group_num=%d\n" , +"%s: VFIO id=%d, dev_fd=%d, container_fd=%d, group_fd=%d, iommu_group_num=%d" , dev->name, vf_num, vfio->dev_fd, vfio->container_fd, vfio->group_fd, iommu_group_num);
@@ -128,12 +128,12 @@ nt_vfio_remove(int vf_num) {struct vfio_dev *vfio; -NT_LOG (DBG ,NTNIC ,"NT VFIO device remove VF=%d\n" , vf_num); +NT_LOG (DBG ,NTNIC ,"NT VFIO device remove VF=%d" , vf_num); vfio =vfio_get (vf_num);if (!vfio) { -NT_LOG (ERR ,NTNIC ,"VFIO device remove failed. Illegal device id\n" ); +NT_LOG (ERR ,NTNIC ,"VFIO device remove failed. Illegal device id" );return -1 ; }
@@ -161,24 +161,24 @@ nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size) vfio =vfio_get (vf_num);if (vfio ==NULL ) { -NT_LOG (ERR ,NTNIC ,"VFIO MAP: VF number %d invalid\n" , vf_num); +NT_LOG (ERR ,NTNIC ,"VFIO MAP: VF number %d invalid" , vf_num);return -1 ; }NT_LOG (DBG ,NTNIC ,"VFIO MMAP VF=%d VirtAddr=%p HPA=%" PRIX64 " VirtBase=%" PRIX64 -" IOVA Addr=%" PRIX64 " size=%" PRIX64 "\n" , +" IOVA Addr=%" PRIX64 " size=%" PRIX64 , vf_num, virt_addr,rte_malloc_virt2iova (virt_addr), gp_virt_base, vfio->iova_addr, size);int res =rte_vfio_container_dma_map (vfio->container_fd, gp_virt_base, vfio->iova_addr, size); -NT_LOG (DBG ,NTNIC ,"VFIO MMAP res %i, container_fd %i, vf_num %i\n" , res, +NT_LOG (DBG ,NTNIC ,"VFIO MMAP res %i, container_fd %i, vf_num %i" , res, vfio->container_fd, vf_num);if (res) { -NT_LOG (ERR ,NTNIC ,"rte_vfio_container_dma_map failed: res %d\n" , res); +NT_LOG (ERR ,NTNIC ,"rte_vfio_container_dma_map failed: res %d" , res);return -1 ; }
@@ -208,7 +208,7 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size vfio =vfio_get (vf_num);if (vfio ==NULL ) { -NT_LOG (ERR ,NTNIC ,"VFIO UNMAP: VF number %d invalid\n" , vf_num); +NT_LOG (ERR ,NTNIC ,"VFIO UNMAP: VF number %d invalid" , vf_num);return -1 ; }
@@ -220,7 +220,7 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t sizeif (res !=0 ) {NT_LOG (ERR ,NTNIC ,"VFIO UNMMAP FAILED! res %i, container_fd %i, vf_num %i, virt_base=%" PRIX64 -", IOVA=%" PRIX64 ", size=%" PRIX64 "\n" , +", IOVA=%" PRIX64 ", size=%" PRIX64 , res, vfio->container_fd, vf_num, gp_virt_base, iova_addr, size);return -1 ; }
drivers/net/ntnic/ntutil/nt_util.c +6 -6
@@ -48,7 +48,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) vfio_addr =rte_malloc (NULL ,sizeof (struct nt_dma_s ),0 );if (!vfio_addr) { -NT_LOG (ERR ,GENERAL ,"VFIO rte_malloc failed\n" ); +NT_LOG (ERR ,GENERAL ,"VFIO rte_malloc failed" );return NULL ; }
@@ -56,7 +56,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)if (!addr) {rte_free (vfio_addr); -NT_LOG (ERR ,GENERAL ,"VFIO rte_malloc_socket failed\n" ); +NT_LOG (ERR ,GENERAL ,"VFIO rte_malloc_socket failed" );return NULL ; }
@@ -65,7 +65,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)if (res !=0 ) {rte_free (addr);rte_free (vfio_addr); -NT_LOG (ERR ,GENERAL ,"VFIO nt_dma_map failed\n" ); +NT_LOG (ERR ,GENERAL ,"VFIO nt_dma_map failed" );return NULL ; }
@@ -74,7 +74,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)NT_LOG (DBG ,GENERAL ,"VFIO DMA alloc addr=%" PRIX64 ", iova=%" PRIX64 -", size=%" PRIX64 "align=0x%" PRIX64 "\n" , +", size=%" PRIX64 "align=0x%" PRIX64 , vfio_addr->addr, vfio_addr->iova, vfio_addr->size, align);return vfio_addr;
@@ -82,7 +82,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)void nt_dma_free (struct nt_dma_s *vfio_addr) { -NT_LOG (DBG ,GENERAL ,"VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 "\n" , +NT_LOG (DBG ,GENERAL ,"VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 , vfio_addr->addr, vfio_addr->iova, vfio_addr->size); int res = vfio_cb.vfio_dma_unmap(0, (void *)vfio_addr->addr, vfio_addr->iova,
@@ -90,7 +90,7 @@ void nt_dma_free(struct nt_dma_s *vfio_addr)if (res !=0 ) {NT_LOG (WRN ,GENERAL , -"VFIO DMA free FAILED addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 "\n" , +"VFIO DMA free FAILED addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 , vfio_addr->addr, vfio_addr->iova, vfio_addr->size); }
Signature · 1 line
2.45.0
PATCH v3 6/50 net/ntnic: add flow filter init API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the initialization of the flow filter.
---
v2
* Update release notes
v3
* Remove new line characters from logs
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/adapter/nt4ga_adapter.c | 18 ++++++++++++++++++ drivers/net/ntnic/include/flow_api.h | 12 ++++++++++++ drivers/net/ntnic/include/nt4ga_adapter.h | 6 ++++++ drivers/net/ntnic/include/nt4ga_filter.h | 13 +++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 7 +++++++ drivers/net/ntnic/ntnic_mod_reg.h | 8 ++++++++ 7 files changed, 65 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_api.h create mode 100644 drivers/net/ntnic/include/nt4ga_filter.h
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -104,6 +104,7 @@ New Features * Fix Coverity issues * Fix issues related to release 24.07 * Extended and fixed the implementation of the logging + * Added NT flow filter init API Removed Items -------------
drivers/net/ntnic/adapter/nt4ga_adapter.c +18 -0
@@ -75,6 +75,11 @@ static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE *static int nt4ga_adapter_init (struct adapter_info_s *p_adapter_info) { +const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); + +if (flow_filter_ops ==NULL ) +NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized" , __func__); +char *const p_dev_name =malloc (24 );char *const p_adapter_id_str =malloc (24 );fpga_info_t *fpga_info = &p_adapter_info->fpga_info;
@@ -155,6 +160,19 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) n_nim_ports = fpga_info->n_nims;assert (n_nim_ports >=1 ); +/* Nt4ga Init Filter */ +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, + p_adapter_info->adapter_no); + +if (res !=0 ) { +NT_LOG (ERR ,NTNIC ,"%s: Cannot initialize filter" , p_adapter_id_str); +return res; + } + } + {int i;const struct link_ops_s *link_ops =NULL ;
drivers/net/ntnic/include/flow_api.h new file +12 -0
@@ -0,0 +1,12 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _FLOW_API_H_ +#define _FLOW_API_H_ + +/* registered NIC backends */ +struct flow_nic_dev ; + +#endif
drivers/net/ntnic/include/nt4ga_adapter.h +6 -0
@@ -23,7 +23,13 @@ typedef struct hw_info_s {int hw_reserved1; } hw_info_t; +/* +* Services provided by the adapter module +*/ +#include "nt4ga_filter.h" + typedef struct adapter_info_s { + struct nt4ga_filter_s nt4ga_filter; struct nt4ga_link_s nt4ga_link; struct hw_info_s hw_info;
drivers/net/ntnic/include/nt4ga_filter.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef NT4GA_FILTER_H_ +#define NT4GA_FILTER_H_ + +typedef struct nt4ga_filter_s { +struct flow_nic_dev *mp_flow_device; +}nt4ga_filter_t ; + +#endif /* NT4GA_FILTER_H_ */
drivers/net/ntnic/ntnic_mod_reg.c +7 -0
@@ -88,3 +88,10 @@ struct rst9563_ops *get_rst9563_ops(void)rst9563_ops_init ();return rst9563_ops; } + +static const struct flow_filter_ops *flow_filter_ops; + +const struct flow_filter_ops *get_flow_filter_ops (void ) +{ +return flow_filter_ops; +}
drivers/net/ntnic/ntnic_mod_reg.h +8 -0
@@ -7,6 +7,7 @@#define __NTNIC_MOD_REG_H__#include <stdint.h> +#include "flow_api.h" #include "nthw_fpga_model.h" #include "nthw_platform_drv.h" #include "nthw_drv.h"
@@ -117,4 +118,11 @@ void register_rst9563_ops(struct rst9563_ops *ops);struct rst9563_ops *get_rst9563_ops (void );void rst9563_ops_init (void ); +struct flow_filter_ops { +int (*flow_filter_init)(nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device, +int adapter_no); +}; + +const struct flow_filter_ops *get_flow_filter_ops (void ); +#endif /* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
PATCH v3 7/50 net/ntnic: add flow filter deinitialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the deinitialization of the flow filter.
---
v3
* Remove newline characters from logs.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 17 +++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 1 + 2 files changed, 18 insertions(+)
drivers/net/ntnic/adapter/nt4ga_adapter.c +17 -0
@@ -217,12 +217,29 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)static int nt4ga_adapter_deinit (struct adapter_info_s *p_adapter_info) { +const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); + +if (flow_filter_ops ==NULL ) +NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized" , __func__); +fpga_info_t *fpga_info = &p_adapter_info->fpga_info;int i;int res =-1 ;stop_monitor_tasks (-1 ); +/* Nt4ga Deinit Filter */ +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); + +if (res !=0 ) { +NT_LOG (ERR ,NTNIC ,"Cannot deinitialize filter" ); +return res; + } + } +nthw_fpga_shutdown (&p_adapter_info->fpga_info);/* Rac rab reset flip flop */
drivers/net/ntnic/ntnic_mod_reg.h +1 -0
@@ -121,6 +121,7 @@ void rst9563_ops_init(void);struct flow_filter_ops {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); };const struct flow_filter_ops *get_flow_filter_ops (void );
Signature · 1 line
2.45.0
PATCH v3 8/50 net/ntnic: add flow backend initialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the initialization of the backend.
---
v2
* Update release notes
v3
* Remove newline characters from logs.
--- doc/guides/rel_notes/release_24_11.rst | 1 + drivers/net/ntnic/include/flow_api.h | 2 ++ drivers/net/ntnic/include/flow_filter.h | 14 ++++++++++ drivers/net/ntnic/meson.build | 2 ++ drivers/net/ntnic/nthw/flow_api/flow_api.c | 17 ++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_filter.c | 27 +++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.c | 15 +++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 9 +++++++ 8 files changed, 87 insertions(+) create mode 100644 drivers/net/ntnic/include/flow_filter.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api.c create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_filter.c
doc/guides/rel_notes/release_24_11.rst +1 -0
@@ -105,6 +105,7 @@ New Features * Fix issues related to release 24.07 * Extended and fixed the implementation of the logging * Added NT flow filter init API + * Added NT flow backend initialization API Removed Items -------------
drivers/net/ntnic/include/flow_api.h +2 -0
@@ -6,6 +6,8 @@#ifndef _FLOW_API_H_#define _FLOW_API_H_ +#include "ntlog.h" +/* registered NIC backends */ struct flow_nic_dev ;
drivers/net/ntnic/include/flow_filter.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __FLOW_FILTER_HPP__ +#define __FLOW_FILTER_HPP__ + +#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); + +#endif /* __FLOW_FILTER_HPP__ */
drivers/net/ntnic/meson.build +2 -0
@@ -42,6 +42,8 @@ sources = files( 'nthw/core/nthw_pcie3.c', 'nthw/core/nthw_sdc.c', 'nthw/core/nthw_si5340.c', + 'nthw/flow_api/flow_api.c', + 'nthw/flow_api/flow_filter.c', 'nthw/model/nthw_fpga_model.c', 'nthw/nthw_platform.c', 'nthw/nthw_rac.c',
drivers/net/ntnic/nthw/flow_api/flow_api.c new file +17 -0
@@ -0,0 +1,17 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include "ntnic_mod_reg.h" + +#include "flow_filter.h" + +static const struct flow_filter_ops ops = { + .flow_filter_init = flow_filter_init, +}; + +void init_flow_filter (void ) +{ +register_flow_filter_ops (&ops); +}
drivers/net/ntnic/nthw/flow_api/flow_filter.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#include "flow_filter.h" +#include "ntnic_mod_reg.h" + +int flow_filter_init (nthw_fpga_t *p_fpga,struct flow_nic_dev **p_flow_device,int adapter_no) +{ + (void )p_flow_device; + (void )adapter_no; + +void *be_dev =NULL ; + +const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); + +if (flow_backend_ops ==NULL ) { +NT_LOG (ERR ,FILTER ,"%s: flow_backend module uninitialized" , __func__); +return -1 ; + } + +NT_LOG (DBG ,FILTER ,"Initializing flow filter api" ); + flow_backend_ops->bin_flow_backend_init (p_fpga, &be_dev); + +return 0 ; +}
drivers/net/ntnic/ntnic_mod_reg.c +15 -0
@@ -89,9 +89,24 @@ struct rst9563_ops *get_rst9563_ops(void)return rst9563_ops; } +static const struct flow_backend_ops *flow_backend_ops; + +const struct flow_backend_ops *get_flow_backend_ops (void ) +{ +return flow_backend_ops; +} +static const struct flow_filter_ops *flow_filter_ops; +void register_flow_filter_ops (const struct flow_filter_ops *ops) +{ + flow_filter_ops = ops; +} +const struct flow_filter_ops *get_flow_filter_ops (void ) { +if (flow_filter_ops ==NULL ) +init_flow_filter (); +return flow_filter_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +9 -0
@@ -118,12 +118,21 @@ void register_rst9563_ops(struct rst9563_ops *ops);struct rst9563_ops *get_rst9563_ops (void );void rst9563_ops_init (void ); +struct flow_backend_ops { +const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga, +void **be_dev); +}; + +const struct flow_backend_ops *get_flow_backend_ops (void ); +struct flow_filter_ops {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); }; +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 );#endif /* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
PATCH v3 9/50 net/ntnic: add flow backend deinitialization API
In reply to Serhii IliushykFrom: Oleksandr Kolomeiets <[email protected]>
Add high-level interfaces for the deinitialization of the backend.
---
v3
* Remove newline characters from logs.
--- drivers/net/ntnic/include/flow_api.h | 7 ++++++- drivers/net/ntnic/include/flow_filter.h | 1 + drivers/net/ntnic/include/hw_mod_backend.h | 13 ++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_api.c | 12 +++++++++++ .../ntnic/nthw/flow_api/flow_api_nic_setup.h | 14 +++++++++++++ drivers/net/ntnic/nthw/flow_api/flow_filter.c | 21 +++++++++++++++++++ drivers/net/ntnic/ntnic_mod_reg.h | 1 + 7 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 drivers/net/ntnic/include/hw_mod_backend.h create mode 100644 drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h
drivers/net/ntnic/include/flow_api.h +6 -1
@@ -8,7 +8,12 @@#include "ntlog.h" +#include "hw_mod_backend.h" +/* registered NIC backends */ -struct flow_nic_dev ; +struct flow_nic_dev { +/* NIC backend API */ +struct flow_api_backend_s be; +};#endif
drivers/net/ntnic/include/flow_filter.h +1 -0
@@ -10,5 +10,6 @@#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);#endif /* __FLOW_FILTER_HPP__ */
drivers/net/ntnic/include/hw_mod_backend.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef _HW_MOD_BACKEND_H_ +#define _HW_MOD_BACKEND_H_ + +struct flow_api_backend_s { +void *be_dev; +}; + +#endif /* _HW_MOD_BACKEND_H_ */
drivers/net/ntnic/nthw/flow_api/flow_api.c +12 -0
@@ -3,12 +3,24 @@* Copyright(c) 2023 Napatech A/S */ +#include "flow_api_nic_setup.h" #include "ntnic_mod_reg.h" #include "flow_filter.h" +void *flow_api_get_be_dev (struct flow_nic_dev *ndev) +{ +if (!ndev) { +NT_LOG (DBG ,FILTER ,"ERR: %s" , __func__); +return NULL ; + } + +return ndev->be.be_dev; +} +static const struct flow_filter_ops ops = { .flow_filter_init = flow_filter_init, + .flow_filter_done = flow_filter_done, };void init_flow_filter (void )
drivers/net/ntnic/nthw/flow_api/flow_api_nic_setup.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* SPDX-License-Identifier: BSD-3-Clause +* Copyright(c) 2023 Napatech A/S +*/ + +#ifndef __FLOW_API_NIC_SETUP_H__ +#define __FLOW_API_NIC_SETUP_H__ + +#include "hw_mod_backend.h" +#include "flow_api.h" + +void *flow_api_get_be_dev (struct flow_nic_dev *dev); + +#endif /* __FLOW_API_NIC_SETUP_H__ */
drivers/net/ntnic/nthw/flow_api/flow_filter.c +21 -0
@@ -5,6 +5,7 @@#include "flow_filter.h" #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) {
@@ -25,3 +26,23 @@ 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) +{ +void *be_dev =flow_api_get_be_dev (dev); + +int res =0 ; + +if (be_dev) { +const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); + +if (flow_backend_ops ==NULL ) { +NT_LOG (WRN ,FILTER ,"%s: flow_backend module uninitialized" , __func__); +return res; + } + + flow_backend_ops->bin_flow_backend_done (be_dev); + } + +return res; +}
drivers/net/ntnic/ntnic_mod_reg.h +1 -0
@@ -121,6 +121,7 @@ void rst9563_ops_init(void);struct flow_backend_ops {const struct flow_api_backend_ops *(*bin_flow_backend_init)(nthw_fpga_t *p_fpga,void **be_dev); +void (*bin_flow_backend_done)(void *be_dev); };const struct flow_backend_ops *get_flow_backend_ops (void );
Signature · 1 line
2.45.0