migrate threads to DPDK service framework
Subsystems (2)
cover migrate threads to DPDK service framework
This modification provides better resource (CPU) management for NTNIC PMD.
The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.
After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.
The sercvice cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with special API by application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.
Serhii Iliushyk (7):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: cleanup using pthreads and rte_thread
doc/guides/nics/ntnic.rst | 112 ++++ drivers/net/ntnic/adapter/nt4ga_adapter.c | 27 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/nt4ga_adapter.h | 4 - drivers/net/ntnic/include/ntdrv_4ga.h | 4 - drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 4 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 303 +++++----- .../link_agx_100g/nt4ga_agx_link_100g.c | 306 ++++++----- drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 - drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 1 - .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 520 ++++++++++-------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 + drivers/net/ntnic/ntutil/nt_service.c | 127 +++++ drivers/net/ntnic/ntutil/nt_service.h | 62 +++ drivers/net/ntnic/ntutil/nt_util.c | 2 +- drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++ drivers/net/ntnic/rte_pmd_ntnic.h | 26 + 21 files changed, 1073 insertions(+), 570 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
Signature · 1 line
2.45.0
PATCH 1/7 net/ntnic: introduce service API for NTNIC PMD
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.
--- doc/guides/nics/ntnic.rst | 112 ++++++++++++++++++++++++++ drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/ntutil/nt_service.c | 103 +++++++++++++++++++++++ drivers/net/ntnic/ntutil/nt_service.h | 62 ++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++++++++++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.h | 21 +++++ 6 files changed, 404 insertions(+) create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
doc/guides/nics/ntnic.rst +112 -0
@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1); + +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
drivers/net/ntnic/meson.build +2 -0
@@ -120,7 +120,9 @@ sources = files( 'ntlog/ntlog.c', 'ntnic_filter/ntnic_filter.c', 'ntutil/nt_util.c', + 'ntutil/nt_service.c', 'ntnic_mod_reg.c', 'ntnic_vfio.c', 'ntnic_ethdev.c', + 'rte_pmd_ntnic.c' )
drivers/net/ntnic/ntutil/nt_service.c new file +103 -0
103 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.h new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.c new file +104 -0
104 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.h +21 -0
@@ -40,4 +40,25 @@ enum rte_ntnic_event_type { RTE_NTNIC_FLM_STATS_EVENT, }; +enum rte_ntnic_service_tag { +RTE_NTNIC_SERVICE_MAX =1 +}; + +/** +* Set the lcore for a specific service. +* +* @param tag The service tag to set the lcore for. +* @param lcore_id The lcore ID to set for the service. +* @return 0 on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_set_lcore (enum rte_ntnic_service_tag tag,uint32_t lcore_id); + +/** +* Get the ID of a specific service. +* +* @param tag The service tag to get the ID for. +* @return The service ID on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_get_id (enum rte_ntnic_service_tag tag); +#endif /* NTNIC_EVENT_H_ */
Signature · 1 line
2.45.0
Re: [PATCH v1 1/7] net/ntnic: introduce service API for NTNIC PMD
Quoted 9 lines · On Mon, 8 Sep 2025 13:04:39 +0200 Serhii Iliushyk <[email protected]> wrote:
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.Signed-off-by Serhii Iliushyk <[email protected]>---
Series queued to next-net
PATCH 2/7 net/ntnic: migrate flm update thread to service
In reply to Serhii IliushykThis commit adds the FLM update service to the NTNIC PMD. The service is responsible for handling creating/destroying flows.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 67 ++++++++++++------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 +++++ drivers/net/ntnic/ntutil/nt_service.c | 4 +- drivers/net/ntnic/rte_pmd_ntnic.h | 3 +- 5 files changed, 62 insertions(+), 30 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -15,7 +15,6 @@ typedef struct ntdrv_4ga_s {char *p_drv_name;volatile bool b_shutdown; -rte_thread_t flm_thread;rte_spinlock_t stat_lck;rte_thread_t stat_thread;rte_thread_t port_event_thread;
drivers/net/ntnic/ntnic_ethdev.c +41 -26
102 lines not on this page · raw message
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +17 -0
@@ -6,6 +6,7 @@#include <rte_flow_driver.h> #include <rte_pci.h> #include <rte_version.h> +#include <rte_pmd_ntnic.h> #include "ntlog.h" #include "nt_util.h"
@@ -13,6 +14,8 @@#include "ntnic_mod_reg.h" #include "ntos_system.h" #include "ntos_drv.h" +#include "nt_service.h" +#include "rte_service.h" #define MAX_RTE_FLOWS 8192
@@ -543,6 +546,13 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_return -1 ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be destroyed" ); +return -1 ; + } +struct pmd_internals *internals = eth_dev->data->dev_private; error->type =RTE_FLOW_ERROR_TYPE_NONE ;
@@ -580,6 +590,13 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,return NULL ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be created" ); +return NULL ; + } +struct pmd_internals *internals = eth_dev->data->dev_private;struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info;
drivers/net/ntnic/ntutil/nt_service.c +2 -2
@@ -12,8 +12,8 @@#define NT_SERVICE_UNKNOWN_ID (-1)static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX ] = { - [0 ] = { - .tag =RTE_NTNIC_SERVICE_MAX , + [RTE_NTNIC_SERVICE_FLM_UPDATE ] = { + .tag =RTE_NTNIC_SERVICE_FLM_UPDATE , .id =NT_SERVICE_UNKNOWN_ID , .lcore =RTE_MAX_LCORE , .initialized = false,
drivers/net/ntnic/rte_pmd_ntnic.h +2 -1
@@ -41,7 +41,8 @@ enum rte_ntnic_event_type { };enum rte_ntnic_service_tag { -RTE_NTNIC_SERVICE_MAX =1 +RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_MAX };/**
Signature · 1 line
2.45.0
PATCH 3/7 net/ntnic: migrate statistic thread to service
In reply to Serhii IliushykThe statistic service is responsible for collecting statistics.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 146 ++++++++++++++------------ drivers/net/ntnic/ntutil/nt_service.c | 6 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 4 files changed, 84 insertions(+), 70 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown;rte_spinlock_t stat_lck; -rte_thread_t stat_thread;rte_thread_t port_event_thread; } ntdrv_4ga_t;
drivers/net/ntnic/ntnic_ethdev.c +77 -69
179 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -18,6 +18,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_STAT] = { + .tag = RTE_NTNIC_SERVICE_STAT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -42,6 +42,7 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 4/7 net/ntnic: migrate port event thread to service
In reply to Serhii IliushykThe port event service is responsible for handling port events.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/include/ntos_drv.h | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 271 +++++++++++++++----------- drivers/net/ntnic/ntutil/nt_service.c | 12 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 2 + 5 files changed, 174 insertions(+), 114 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown; rte_spinlock_t stat_lck; - rte_thread_t port_event_thread; } ntdrv_4ga_t;#endif /* __NTDRV_4GA_H__ */
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -21,7 +21,7 @@#define NUM_MULTICAST_ADDRS_PER_PORT (16U)#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) +#define NUM_ADAPTER_PORTS_MAX (2)/* Max RSS queues */
drivers/net/ntnic/ntnic_ethdev.c +159 -112
311 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +12 -0
@@ -24,6 +24,18 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_PORT_0_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_0_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, + [RTE_NTNIC_SERVICE_PORT_1_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_1_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +2 -0
@@ -43,6 +43,8 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 ,RTE_NTNIC_SERVICE_STAT =1 , +RTE_NTNIC_SERVICE_PORT_0_EVENT =2 , +RTE_NTNIC_SERVICE_PORT_1_EVENT =3 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 5/7 net/ntnic: migrate adapter mon thread to service
In reply to Serhii IliushykThe adapter monitor service is responsible for link state management.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 25 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/nt4ga_adapter.h | 3 - drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 303 +++++++++-------- .../link_agx_100g/nt4ga_agx_link_100g.c | 306 ++++++++++-------- drivers/net/ntnic/ntutil/nt_service.c | 6 + drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 9 files changed, 334 insertions(+), 329 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
drivers/net/ntnic/adapter/nt4ga_adapter.c +2 -23
@@ -5,6 +5,7 @@#include <rte_thread.h> +#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h" #include "ntnic_mod_reg.h"
@@ -12,28 +13,6 @@/* * Global variables shared by NT adapter types */ -rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; - -/* -* Signal-handler to stop all monitor threads -*/ -static void stop_monitor_tasks (int signum) -{ -const size_t N =ARRAY_SIZE (monitor_task_is_running); -size_t i; - -/* Stop all monitor tasks */ -for (i =0 ; i <N ; i++) { -const int is_running = monitor_task_is_running[i]; - monitor_task_is_running[i] =0 ; - -if (signum ==-1 && is_running !=0 ) { -rte_thread_join (monitor_tasks[i],NULL ); -memset (&monitor_tasks[i],0 ,sizeof (monitor_tasks[0 ])); - } - } -}static int nt4ga_adapter_show_info (struct adapter_info_s *p_adapter_info,FILE *pfh) {
@@ -255,7 +234,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)int i;int res =-1 ; -stop_monitor_tasks (-1 ); +nthw_service_del (RTE_NTNIC_SERVICE_ADAPTER_MON );/* Nt4ga Deinit Filter */ nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
drivers/net/ntnic/include/common_adapter_defs.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2023 Napatech A/S -*/ - -#ifndef _COMMON_ADAPTER_DEFS_H_ -#define _COMMON_ADAPTER_DEFS_H_ - -/* -* Declarations shared by NT adapter types. -*/ -#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) - -#endif /* _COMMON_ADAPTER_DEFS_H_ */
drivers/net/ntnic/include/nt4ga_adapter.h +0 -3
@@ -47,8 +47,5 @@ typedef struct adapter_info_s { int n_tx_host_buffers; } adapter_info_t; -extern rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -extern volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; -#endif /* _NT4GA_ADAPTER_H_ */
drivers/net/ntnic/include/ntnic_stat.h +1 -1
@@ -6,7 +6,7 @@#ifndef NTNIC_STAT_H_ #define NTNIC_STAT_H_ -#include "common_adapter_defs.h" +#include "ntos_drv.h" #include "nthw_rmc.h" #include "nthw_rpf.h" #include "nthw_fpga_model.h"
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -20,7 +20,7 @@#define NUM_MAC_ADDRS_PER_PORT (16U)#define NUM_MULTICAST_ADDRS_PER_PORT (16U) -#define NUM_ADAPTER_MAX (8) +#define NUM_ADAPTER_MAX (1)#define NUM_ADAPTER_PORTS_MAX (2)
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +160 -143
358 lines not on this page · raw message
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +163 -143
360 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -36,6 +36,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_ADAPTER_MON] = { + .tag = RTE_NTNIC_SERVICE_ADAPTER_MON, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -45,6 +45,7 @@ enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_PORT_0_EVENT =2 ,RTE_NTNIC_SERVICE_PORT_1_EVENT =3 , +RTE_NTNIC_SERVICE_ADAPTER_MON =4 , RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 6/7 net/ntnic: add warning about service cores
In reply to Serhii IliushykThis commit adds a warning message if the service cores are not available. This warning notifies a user about potential issues with ntnic services. There in no error because the service cores may be added
by application itself after the pcie_probe.
--- drivers/net/ntnic/ntnic_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ntnic/ntnic_ethdev.c +8 -0
@@ -2607,6 +2607,14 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) } } +uint32_t cores[RTE_MAX_LCORE ] = {0 }; +int32_t lcore_count =rte_service_lcore_list (cores,RTE_MAX_LCORE ); + +if (lcore_count <=0 ) { +NT_LOG (WRN ,NTNIC ,"No service cores available. " +"Please check if all NTNIC services are started" ); + } +return 0 ; }
Signature · 1 line
2.45.0
PATCH 7/7 net/ntnic: cleanup using pthreads and rte_thread
In reply to Serhii IliushykThis patch cleans up the code to use pthreads and rte_thread APIs.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 2 -- drivers/net/ntnic/include/nt4ga_adapter.h | 1 - drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 -- drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 1 - .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 22 +++++-------------- drivers/net/ntnic/ntutil/nt_util.c | 2 +- 9 files changed, 7 insertions(+), 27 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <rte_thread.h> -#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h"
drivers/net/ntnic/include/nt4ga_adapter.h +0 -1
@@ -40,7 +40,6 @@ typedef struct adapter_info_s {char *mp_port_id_str[NUM_ADAPTER_PORTS_MAX ];char *mp_adapter_id_str;char *p_dev_name; -volatile bool *pb_shutdown;int adapter_no;int n_rx_host_buffers;
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -14,7 +14,6 @@ typedef struct ntdrv_4ga_s {struct adapter_info_s adapter_info;char *p_drv_name; -volatile bool b_shutdown;rte_spinlock_t stat_lck; } ntdrv_4ga_t;
drivers/net/ntnic/nthw/core/nthw_pca9532.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> -#include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_pcal6416a.c +0 -1
@@ -2,7 +2,6 @@* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "generic/rte_spinlock.h" #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
@@ -5276,7 +5276,7 @@ struct flow_handle *flow_async_create_profile_inline(struct flow_eth_dev *dev, }while (status ==CELL_STATUS_INITIALIZING );/* error handling in case that create_flow_filter() will fail in the other -* thread +* service */ if (status ==CELL_STATUS_UNINITIALIZED ) goto err_exit;
drivers/net/ntnic/ntnic_ethdev.c +5 -17
@@ -6,8 +6,6 @@#include <stdint.h> #include <stdarg.h> -#include <signal.h> -#include <rte_eal.h> #include <rte_dev.h> #include <rte_vfio.h>
@@ -33,12 +31,6 @@#include "rte_pmd_ntnic.h" #include "nt_service.h" -const rte_thread_attr_t thread_attr = { .priority =RTE_THREAD_PRIORITY_NORMAL }; -#define THREAD_CREATE (a, b, c) rte_thread_create(a, &thread_attr, b, c) -#define THREAD_CTRL_CREATE (a, b, c, d) rte_thread_create_internal_control(a, b, c, d) -#define THREAD_JOIN (a) rte_thread_join(a, NULL) -#define THREAD_FUNC static uint32_t -#define THREAD_RETURN (0)#define HW_MAX_PKT_LEN (10000)#define MAX_MTU (HW_MAX_PKT_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN)#define MIN_MTU_INLINE 512
@@ -1536,14 +1528,13 @@ drv_deinit(struct drv_s *p_drv)fpga_info_t *fpga_info = &p_nt_drv->adapter_info.fpga_info;/* -* Mark the global pdrv for cleared. Used by some threads to terminate. -* 1 second to give the threads a chance to see the termonation. +* Mark the global pdrv for cleared. Used by some services to terminate. +* 1 second to give the services a chance to see the termonation. */ clear_pdrv (p_drv);nt_os_wait_usec (1000000 );/* stop statistics service */ - p_drv->ntdrv.b_shutdown = true;nthw_service_del (RTE_NTNIC_SERVICE_STAT );if (fpga_info->profile ==FPGA_INFO_PROFILE_INLINE ) {
@@ -2323,9 +2314,6 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) p_nt_drv->adapter_info.hw_info.pci_sub_vendor_id, p_nt_drv->adapter_info.hw_info.pci_sub_device_id); - p_nt_drv->b_shutdown = false; - p_nt_drv->adapter_info.pb_shutdown = &p_nt_drv->b_shutdown; -/* store context */ store_pdrv (p_drv);
@@ -2366,7 +2354,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)NT_LOG_DBGX (DBG ,NTNIC ,"SG module is not initialized" ); } -/* Start ctrl, monitor, stat thread only for primary process. */ +/* Start ctrl, monitor, stat service only for primary process. */ if (err ==0 ) {/* mp_adapter_id_str is initialized after nt4ga_adapter_init(p_nt_drv) */ const char *const p_adapter_id_str = p_nt_drv->adapter_info.mp_adapter_id_str;
@@ -2631,7 +2619,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)fpga_info_t *fpga_info = &p_ntdrv->adapter_info.fpga_info;const int n_phy_ports = fpga_info->n_phy_ports; -/* let running threads end Rx and Tx activity */ +/* let running services end Rx and Tx activity */ if (sg_ops !=NULL ) {nt_os_wait_usec (1 *1000 *1000 );
@@ -2706,7 +2694,7 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,/* * 1 time calculation of 1 sec stat update rtc cycles to prevent stat poll -* flooding by OVS from multiple virtual port threads - no need to be precise +* flooding by OVS from multiple virtual port services - no need to be precise */ uint64_t now_rtc =rte_get_tsc_cycles ();nt_os_wait_usec (10 *1000 );
drivers/net/ntnic/ntutil/nt_util.c +1 -1
@@ -16,7 +16,7 @@static struct nt_util_vfio_impl vfio_cb; -/* uses usleep which schedules out the calling thread */ +/* uses usleep which schedules out the calling service */ void nt_os_wait_usec (int val) {rte_delay_us_sleep (val);
Signature · 1 line
2.45.0
v2 cover migrate threads to DPDK service framework
This modification provides better resource (CPU) management for NTNIC PMD.
The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.
After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.
The sercvice cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with special API by application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.
Serhii Iliushyk (7):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: cleanup using pthreads and rte_thread
doc/guides/nics/ntnic.rst | 112 ++++ drivers/net/ntnic/adapter/nt4ga_adapter.c | 27 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/nt4ga_adapter.h | 4 - drivers/net/ntnic/include/ntdrv_4ga.h | 4 - drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 4 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 303 +++++----- .../link_agx_100g/nt4ga_agx_link_100g.c | 306 ++++++----- drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 - drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 1 - .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 520 ++++++++++-------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 + drivers/net/ntnic/ntutil/nt_service.c | 127 +++++ drivers/net/ntnic/ntutil/nt_service.h | 62 +++ drivers/net/ntnic/ntutil/nt_util.c | 2 +- drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++ drivers/net/ntnic/rte_pmd_ntnic.h | 26 + 21 files changed, 1073 insertions(+), 570 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
Signature · 1 line
2.45.0
PATCH v2 1/7 net/ntnic: introduce service API for NTNIC PMD
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.
--- doc/guides/nics/ntnic.rst | 112 ++++++++++++++++++++++++++ drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/ntutil/nt_service.c | 103 +++++++++++++++++++++++ drivers/net/ntnic/ntutil/nt_service.h | 62 ++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++++++++++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.h | 21 +++++ 6 files changed, 404 insertions(+) create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
doc/guides/nics/ntnic.rst +112 -0
@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1); + +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
drivers/net/ntnic/meson.build +2 -0
@@ -120,7 +120,9 @@ sources = files( 'ntlog/ntlog.c', 'ntnic_filter/ntnic_filter.c', 'ntutil/nt_util.c', + 'ntutil/nt_service.c', 'ntnic_mod_reg.c', 'ntnic_vfio.c', 'ntnic_ethdev.c', + 'rte_pmd_ntnic.c', )
drivers/net/ntnic/ntutil/nt_service.c new file +103 -0
103 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.h new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.c new file +104 -0
104 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.h +21 -0
@@ -40,4 +40,25 @@ enum rte_ntnic_event_type { RTE_NTNIC_FLM_STATS_EVENT, }; +enum rte_ntnic_service_tag { +RTE_NTNIC_SERVICE_MAX =1 +}; + +/** +* Set the lcore for a specific service. +* +* @param tag The service tag to set the lcore for. +* @param lcore_id The lcore ID to set for the service. +* @return 0 on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_set_lcore (enum rte_ntnic_service_tag tag,uint32_t lcore_id); + +/** +* Get the ID of a specific service. +* +* @param tag The service tag to get the ID for. +* @return The service ID on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_get_id (enum rte_ntnic_service_tag tag); +#endif /* NTNIC_EVENT_H_ */
Signature · 1 line
2.45.0
Re: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD
Quoted 110 lines · On Mon, 8 Sep 2025 16:17:33 +0200 Serhii Iliushyk <[email protected]> wrote:
doc/guides/nics/ntnic.rst +102
-0@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1);
doc/guides/nics/ntnic.rst There are list of characteristics that age timeout action has: · line 299
Quoted 10 lines
doc/guides/nics/ntnic.rst +10
-0+ +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
It is not clear what happens if application does not use the driver API? What happens "out of the box" with OVS and VPP?
The fact that it requires special driver API's shows that there is a missing feature in the service lcore library. Should be able to do this stuff through that API. But that is not your problem, and doesn't need solving in this set.
Re: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD
From: Stephen Hemminger <[email protected]>
Sent: 13 September 2025 19:23
To: Serhii Iliushyk <[email protected]>
Cc: [email protected] <[email protected]>; Mykola Kostenok <[email protected]>; Christian Koue Muf <[email protected]>
Subject: Re: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD
Quoted 110 lines · On Mon, 8 Sep 2025 16:17:33 +0200 Serhii Iliushyk <[email protected]> wrote:
doc/guides/nics/ntnic.rst +102
-0@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1);
doc/guides/nics/ntnic.rst There are list of characteristics that age timeout action has: · line 299
Quoted 10 lines
doc/guides/nics/ntnic.rst +10
-0+ +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `https://linkprotect.cudasvc.com/url?a=https%3a%2f%2flibrte_net_ntnic.so&c=E,1,Y0L6xj9VNKcZFYqAqRe-8zIt_7rMPD4KOWRMISoqVC_WIz7nsVj8xFm2zsiLl9o97z8bgkUxWD4uEioCtxO_S3AIO5hqm9inj17-Hase1qRv2byMWjlBinC_4A,,&typo=1` or `librte_net_ntnic.a` for static linking.
It is not clear what happens if application does not use the driver API? What happens "out of the box" with OVS and VPP?
The fact that it requires special driver API's shows that there is a missing feature in the service lcore library. Should be able to do this stuff through that API. But that is not your problem, and doesn't need solving in this set.
Hi Stephen!
I will add some details here. There is an approach to run any application that can pass the EAL option to the rte_eal_init funtion.
Only one option is required here (-S SERVICE CORELIST or -s SERVICE COREMASK).
If this option is passed, then the ntnic services will be started with the function rte_service_start_with_defaults https://git.dpdk.org/dpdk/tree/lib/eal/linux/eal.c#n1259 inside of the rte_eal_init, since they are already registered after rte_bus_probe.
For OVS it is possible due to option dpdk_extra.
For example: ovs-vsctl set Open_vSwitch . other_config:dpdk_extra="-S 8,9,10,11,12 ..."
On the other side, the VPP has a "whitelist" of the EAL options, as far as I understand.
That list does not include handling service cores, so a small extension for the DPDK plugin is necessary here to support extra EAL option(s).
BR,
Serhii
Stephen Hemminger
AppliedRe: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD
In reply to Serhii IliushykQuoted 8 lines · On Mon, 8 Sep 2025 16:17:33 +0200 Serhii Iliushyk <[email protected]> wrote:
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.Signed-off-by Serhii Iliushyk <[email protected]>
Queued to next-net
cover Migrate threads to the DPDK service framework and refactor naming for exported symbols
In reply to Serhii IliushykThis modification provides better resource (CPU) management for NTNIC PMD.
The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.
After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.
The service cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with a special API by the application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.
This patch series also includes aligning the naming of the exported symbols to avoid potential conflicts with other applications and libraries.
The main change is to add the prefix "nthw_".
Serhii Iliushyk (24):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: avoid using thread API net/ntnic: fix potential format overflow net/ntnic: single file function as static net/ntnic: remove unused functions net/ntnic: move nthw to prefix part net/ntnic: change prefix hw to prefix nthw net/ntnic: modify prefix flow with prefix nthw net/ntnic: change prefix flm to prefix nthw net/ntnic: change prefix nt to prefix nthw net/ntnic: change prefix ntlog to prefix nthw net/ntnic: change prefix km to prefix nthw net/ntnic: change prefix set to prefix nthw net/ntnic: rename common hash and flow functions net/ntnic: rename register ops function net/ntnic: rename get ops functions net/ntnic: rename ops init functions net/ntnic: rename nim agx setup function net/ntnic: rename table ID functions
doc/guides/nics/ntnic.rst | 112 ++ drivers/net/ntnic/adapter/nt4ga_adapter.c | 41 +- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 10 +- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 54 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/create_elements.h | 9 - drivers/net/ntnic/include/flow_api.h | 10 +- drivers/net/ntnic/include/flow_api_engine.h | 18 +- drivers/net/ntnic/include/hw_mod_backend.h | 281 ++-- drivers/net/ntnic/include/nt4ga_adapter.h | 4 - drivers/net/ntnic/include/ntdrv_4ga.h | 4 - drivers/net/ntnic/include/ntnic_dbs.h | 22 +- drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 4 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 315 ++-- .../link_agx_100g/nt4ga_agx_link_100g.c | 326 ++-- drivers/net/ntnic/link_mgmt/nt4ga_link.c | 2 +- drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nim/i2c_nim.c | 10 +- drivers/net/ntnic/nim/i2c_nim.h | 2 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 14 +- .../net/ntnic/nthw/core/include/nthw_hif.h | 12 - .../net/ntnic/nthw/core/include/nthw_iic.h | 9 - .../ntnic/nthw/core/include/nthw_mac_pcs.h | 9 - .../net/ntnic/nthw/core/include/nthw_pcie3.h | 13 - .../nthw/core/include/nthw_pcm_nt400dxx.h | 1 - .../ntnic/nthw/core/include/nthw_phy_tile.h | 2 - .../net/ntnic/nthw/core/include/nthw_rpf.h | 2 - .../net/ntnic/nthw/core/include/nthw_si5340.h | 2 - .../clock_profiles/nthw_fpga_clk9563.c | 4 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 8 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 8 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 6 +- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 8 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 22 +- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 36 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 22 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 90 -- drivers/net/ntnic/nthw/core/nthw_i2cm.c | 4 +- drivers/net/ntnic/nthw/core/nthw_igam.c | 4 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 240 +-- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 67 +- drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 - drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - drivers/net/ntnic/nthw/core/nthw_pcie3.c | 86 -- .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c | 5 - drivers/net/ntnic/nthw/core/nthw_phy_tile.c | 51 +- drivers/net/ntnic/nthw/core/nthw_rpf.c | 14 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 3 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 6 +- drivers/net/ntnic/nthw/core/nthw_spi_v3.c | 12 +- drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 22 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 253 ++-- .../nthw/flow_api/flow_backend/flow_backend.c | 1342 ++++++++--------- drivers/net/ntnic/nthw/flow_api/flow_filter.c | 4 +- .../net/ntnic/nthw/flow_api/flow_hsh_cfg.c | 46 +- .../net/ntnic/nthw/flow_api/flow_hsh_cfg.h | 2 +- .../net/ntnic/nthw/flow_api/flow_id_table.c | 10 +- .../net/ntnic/nthw/flow_api/flow_id_table.h | 10 +- drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 134 +- .../nthw/flow_api/hw_mod/hw_mod_backend.c | 18 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 356 ++--- .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 70 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 107 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 40 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 32 +- .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 80 +- .../flow_api/profile_inline/flm_age_queue.c | 22 +- .../flow_api/profile_inline/flm_age_queue.h | 20 +- .../flow_api/profile_inline/flm_lrn_queue.c | 12 +- .../flow_api/profile_inline/flm_lrn_queue.h | 12 +- .../profile_inline/flow_api_hw_db_inline.c | 1138 +++++++------- .../profile_inline/flow_api_hw_db_inline.h | 99 +- .../profile_inline/flow_api_profile_inline.c | 598 ++++---- .../profile_inline/flow_api_profile_inline.h | 49 +- .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_cat.h | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_csu.h | 24 +- .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_flm.h | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_info.c | 88 +- .../ntnic/nthw/flow_filter/flow_nthw_info.h | 88 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 160 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 162 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 54 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 56 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 42 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 46 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 577 +++---- .../net/ntnic/nthw/model/nthw_fpga_model.h | 28 - drivers/net/ntnic/nthw/nthw_platform.c | 2 +- drivers/net/ntnic/nthw/nthw_platform_drv.h | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 28 +- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 20 +- .../nthw/supported/nthw_fpga_mod_str_map.c | 2 +- .../nthw/supported/nthw_fpga_mod_str_map.h | 2 +- drivers/net/ntnic/ntlog/ntlog.c | 6 +- drivers/net/ntnic/ntlog/ntlog.h | 6 +- drivers/net/ntnic/ntnic_ethdev.c | 617 ++++---- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 66 +- drivers/net/ntnic/ntnic_mod_reg.c | 96 +- drivers/net/ntnic/ntnic_mod_reg.h | 142 +- drivers/net/ntnic/ntnic_vfio.c | 18 +- drivers/net/ntnic/ntnic_vfio.h | 12 +- drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c | 4 +- drivers/net/ntnic/ntutil/nt_service.c | 127 ++ drivers/net/ntnic/ntutil/nt_service.h | 62 + drivers/net/ntnic/ntutil/nt_util.c | 75 +- drivers/net/ntnic/ntutil/nt_util.h | 21 +- drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 26 + 131 files changed, 5500 insertions(+), 5449 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
Signature · 1 line
2.45.0
PATCH 1/24 net/ntnic: introduce service API for NTNIC PMD
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.
--- doc/guides/nics/ntnic.rst | 112 ++++++++++++++++++++++++++ drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/ntutil/nt_service.c | 103 +++++++++++++++++++++++ drivers/net/ntnic/ntutil/nt_service.h | 62 ++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++++++++++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.h | 21 +++++ 6 files changed, 404 insertions(+) create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
doc/guides/nics/ntnic.rst +112 -0
@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1); + +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
drivers/net/ntnic/meson.build +2 -0
@@ -120,7 +120,9 @@ sources = files( 'ntlog/ntlog.c', 'ntnic_filter/ntnic_filter.c', 'ntutil/nt_util.c', + 'ntutil/nt_service.c', 'ntnic_mod_reg.c', 'ntnic_vfio.c', 'ntnic_ethdev.c', + 'rte_pmd_ntnic.c', )
drivers/net/ntnic/ntutil/nt_service.c new file +103 -0
103 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.h new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.c new file +104 -0
104 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.h +21 -0
@@ -40,4 +40,25 @@ enum rte_ntnic_event_type { RTE_NTNIC_FLM_STATS_EVENT, }; +enum rte_ntnic_service_tag { +RTE_NTNIC_SERVICE_MAX =1 +}; + +/** +* Set the lcore for a specific service. +* +* @param tag The service tag to set the lcore for. +* @param lcore_id The lcore ID to set for the service. +* @return 0 on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_set_lcore (enum rte_ntnic_service_tag tag,uint32_t lcore_id); + +/** +* Get the ID of a specific service. +* +* @param tag The service tag to get the ID for. +* @return The service ID on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_get_id (enum rte_ntnic_service_tag tag); +#endif /* NTNIC_EVENT_H_ */
Signature · 1 line
2.45.0
PATCH 2/24 net/ntnic: migrate flm update thread to service
In reply to Serhii IliushykThis commit adds the FLM update service to the NTNIC PMD. The service is responsible for handling creating/destroying flows.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 67 ++++++++++++------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 +++++ drivers/net/ntnic/ntutil/nt_service.c | 4 +- drivers/net/ntnic/rte_pmd_ntnic.h | 3 +- 5 files changed, 62 insertions(+), 30 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -15,7 +15,6 @@ typedef struct ntdrv_4ga_s {char *p_drv_name;volatile bool b_shutdown; -rte_thread_t flm_thread;rte_spinlock_t stat_lck;rte_thread_t stat_thread;rte_thread_t port_event_thread;
drivers/net/ntnic/ntnic_ethdev.c +41 -26
102 lines not on this page · raw message
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +17 -0
@@ -6,6 +6,7 @@#include <rte_flow_driver.h> #include <rte_pci.h> #include <rte_version.h> +#include <rte_pmd_ntnic.h> #include "ntlog.h" #include "nt_util.h"
@@ -13,6 +14,8 @@#include "ntnic_mod_reg.h" #include "ntos_system.h" #include "ntos_drv.h" +#include "nt_service.h" +#include "rte_service.h" #define MAX_RTE_FLOWS 8192
@@ -543,6 +546,13 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_return -1 ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be destroyed" ); +return -1 ; + } +struct pmd_internals *internals = eth_dev->data->dev_private; error->type =RTE_FLOW_ERROR_TYPE_NONE ;
@@ -580,6 +590,13 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,return NULL ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be created" ); +return NULL ; + } +struct pmd_internals *internals = eth_dev->data->dev_private;struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info;
drivers/net/ntnic/ntutil/nt_service.c +2 -2
@@ -12,8 +12,8 @@#define NT_SERVICE_UNKNOWN_ID (-1)static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX ] = { - [0 ] = { - .tag =RTE_NTNIC_SERVICE_MAX , + [RTE_NTNIC_SERVICE_FLM_UPDATE ] = { + .tag =RTE_NTNIC_SERVICE_FLM_UPDATE , .id =NT_SERVICE_UNKNOWN_ID , .lcore =RTE_MAX_LCORE , .initialized = false,
drivers/net/ntnic/rte_pmd_ntnic.h +2 -1
@@ -41,7 +41,8 @@ enum rte_ntnic_event_type { };enum rte_ntnic_service_tag { -RTE_NTNIC_SERVICE_MAX =1 +RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_MAX };/**
Signature · 1 line
2.45.0
PATCH 3/24 net/ntnic: migrate statistic thread to service
In reply to Serhii IliushykThe statistic service is responsible for collecting statistics.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 146 ++++++++++++++------------ drivers/net/ntnic/ntutil/nt_service.c | 6 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 4 files changed, 84 insertions(+), 70 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown;rte_spinlock_t stat_lck; -rte_thread_t stat_thread;rte_thread_t port_event_thread; } ntdrv_4ga_t;
drivers/net/ntnic/ntnic_ethdev.c +77 -69
179 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -18,6 +18,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_STAT] = { + .tag = RTE_NTNIC_SERVICE_STAT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -42,6 +42,7 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 4/24 net/ntnic: migrate port event thread to service
In reply to Serhii IliushykThe port event service is responsible for handling port events.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/include/ntos_drv.h | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 272 +++++++++++++++----------- drivers/net/ntnic/ntutil/nt_service.c | 12 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 2 + 5 files changed, 175 insertions(+), 114 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown; rte_spinlock_t stat_lck; - rte_thread_t port_event_thread; } ntdrv_4ga_t;#endif /* __NTDRV_4GA_H__ */
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -21,7 +21,7 @@#define NUM_MULTICAST_ADDRS_PER_PORT (16U)#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) +#define NUM_ADAPTER_PORTS_MAX (2)/* Max RSS queues */
drivers/net/ntnic/ntnic_ethdev.c +160 -112
312 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +12 -0
@@ -24,6 +24,18 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_PORT_0_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_0_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, + [RTE_NTNIC_SERVICE_PORT_1_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_1_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +2 -0
@@ -43,6 +43,8 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 ,RTE_NTNIC_SERVICE_STAT =1 , +RTE_NTNIC_SERVICE_PORT_0_EVENT =2 , +RTE_NTNIC_SERVICE_PORT_1_EVENT =3 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 5/24 net/ntnic: migrate adapter mon thread to service
In reply to Serhii IliushykThe adapter monitor service is responsible for link state management.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 25 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/nt4ga_adapter.h | 3 - drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 303 +++++++++-------- .../link_agx_100g/nt4ga_agx_link_100g.c | 306 ++++++++++-------- drivers/net/ntnic/ntutil/nt_service.c | 6 + drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 9 files changed, 334 insertions(+), 329 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
drivers/net/ntnic/adapter/nt4ga_adapter.c +2 -23
@@ -5,6 +5,7 @@#include <rte_thread.h> +#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h" #include "ntnic_mod_reg.h"
@@ -12,28 +13,6 @@/* * Global variables shared by NT adapter types */ -rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; - -/* -* Signal-handler to stop all monitor threads -*/ -static void stop_monitor_tasks (int signum) -{ -const size_t N =ARRAY_SIZE (monitor_task_is_running); -size_t i; - -/* Stop all monitor tasks */ -for (i =0 ; i <N ; i++) { -const int is_running = monitor_task_is_running[i]; - monitor_task_is_running[i] =0 ; - -if (signum ==-1 && is_running !=0 ) { -rte_thread_join (monitor_tasks[i],NULL ); -memset (&monitor_tasks[i],0 ,sizeof (monitor_tasks[0 ])); - } - } -}static int nt4ga_adapter_show_info (struct adapter_info_s *p_adapter_info,FILE *pfh) {
@@ -255,7 +234,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)int i;int res =-1 ; -stop_monitor_tasks (-1 ); +nthw_service_del (RTE_NTNIC_SERVICE_ADAPTER_MON );/* Nt4ga Deinit Filter */ nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
drivers/net/ntnic/include/common_adapter_defs.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2023 Napatech A/S -*/ - -#ifndef _COMMON_ADAPTER_DEFS_H_ -#define _COMMON_ADAPTER_DEFS_H_ - -/* -* Declarations shared by NT adapter types. -*/ -#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) - -#endif /* _COMMON_ADAPTER_DEFS_H_ */
drivers/net/ntnic/include/nt4ga_adapter.h +0 -3
@@ -47,8 +47,5 @@ typedef struct adapter_info_s { int n_tx_host_buffers; } adapter_info_t; -extern rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -extern volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; -#endif /* _NT4GA_ADAPTER_H_ */
drivers/net/ntnic/include/ntnic_stat.h +1 -1
@@ -6,7 +6,7 @@#ifndef NTNIC_STAT_H_ #define NTNIC_STAT_H_ -#include "common_adapter_defs.h" +#include "ntos_drv.h" #include "nthw_rmc.h" #include "nthw_rpf.h" #include "nthw_fpga_model.h"
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -20,7 +20,7 @@#define NUM_MAC_ADDRS_PER_PORT (16U)#define NUM_MULTICAST_ADDRS_PER_PORT (16U) -#define NUM_ADAPTER_MAX (8) +#define NUM_ADAPTER_MAX (1)#define NUM_ADAPTER_PORTS_MAX (2)
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +160 -143
358 lines not on this page · raw message
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +163 -143
360 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -36,6 +36,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_ADAPTER_MON] = { + .tag = RTE_NTNIC_SERVICE_ADAPTER_MON, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -45,6 +45,7 @@ enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_PORT_0_EVENT =2 ,RTE_NTNIC_SERVICE_PORT_1_EVENT =3 , +RTE_NTNIC_SERVICE_ADAPTER_MON =4 , RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 6/24 net/ntnic: add warning about service cores
In reply to Serhii IliushykThis commit adds a warning message if the service cores are not available. This warning notifies a user about potential issues with ntnic services. There in no error because the service cores may be added
by application itself after the pcie_probe.
--- drivers/net/ntnic/ntnic_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ntnic/ntnic_ethdev.c +8 -0
@@ -2608,6 +2608,14 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) } } +uint32_t cores[RTE_MAX_LCORE ] = {0 }; +int32_t lcore_count =rte_service_lcore_list (cores,RTE_MAX_LCORE ); + +if (lcore_count <=0 ) { +NT_LOG (WRN ,NTNIC ,"No service cores available. " +"Please check if all NTNIC services are started" ); + } +return 0 ; }
Signature · 1 line
2.45.0
PATCH 7/24 net/ntnic: avoid using thread API
In reply to Serhii IliushykThis patch cleans up the code to use pthreads and rte_thread APIs. Instead it uses service lcore.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 2 -- drivers/net/ntnic/include/nt4ga_adapter.h | 1 - drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 -- drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 1 - .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 22 +++++-------------- drivers/net/ntnic/ntutil/nt_util.c | 2 +- 9 files changed, 7 insertions(+), 27 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <rte_thread.h> -#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h"
drivers/net/ntnic/include/nt4ga_adapter.h +0 -1
@@ -40,7 +40,6 @@ typedef struct adapter_info_s {char *mp_port_id_str[NUM_ADAPTER_PORTS_MAX ];char *mp_adapter_id_str;char *p_dev_name; -volatile bool *pb_shutdown;int adapter_no;int n_rx_host_buffers;
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -14,7 +14,6 @@ typedef struct ntdrv_4ga_s {struct adapter_info_s adapter_info;char *p_drv_name; -volatile bool b_shutdown;rte_spinlock_t stat_lck; } ntdrv_4ga_t;
drivers/net/ntnic/nthw/core/nthw_pca9532.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> -#include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_pcal6416a.c +0 -1
@@ -2,7 +2,6 @@* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "generic/rte_spinlock.h" #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
@@ -5276,7 +5276,7 @@ struct flow_handle *flow_async_create_profile_inline(struct flow_eth_dev *dev, }while (status ==CELL_STATUS_INITIALIZING );/* error handling in case that create_flow_filter() will fail in the other -* thread +* service */ if (status ==CELL_STATUS_UNINITIALIZED ) goto err_exit;
drivers/net/ntnic/ntnic_ethdev.c +5 -17
@@ -6,8 +6,6 @@#include <stdint.h> #include <stdarg.h> -#include <signal.h> -#include <rte_eal.h> #include <rte_dev.h> #include <rte_vfio.h>
@@ -33,12 +31,6 @@#include "rte_pmd_ntnic.h" #include "nt_service.h" -const rte_thread_attr_t thread_attr = { .priority =RTE_THREAD_PRIORITY_NORMAL }; -#define THREAD_CREATE (a, b, c) rte_thread_create(a, &thread_attr, b, c) -#define THREAD_CTRL_CREATE (a, b, c, d) rte_thread_create_internal_control(a, b, c, d) -#define THREAD_JOIN (a) rte_thread_join(a, NULL) -#define THREAD_FUNC static uint32_t -#define THREAD_RETURN (0)#define HW_MAX_PKT_LEN (10000)#define MAX_MTU (HW_MAX_PKT_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN)#define MIN_MTU_INLINE 512
@@ -1536,14 +1528,13 @@ drv_deinit(struct drv_s *p_drv)fpga_info_t *fpga_info = &p_nt_drv->adapter_info.fpga_info;/* -* Mark the global pdrv for cleared. Used by some threads to terminate. -* 1 second to give the threads a chance to see the termonation. +* Mark the global pdrv for cleared. Used by some services to terminate. +* 1 second to give the services a chance to see the termonation. */ clear_pdrv (p_drv);nt_os_wait_usec (1000000 );/* stop statistics service */ - p_drv->ntdrv.b_shutdown = true;nthw_service_del (RTE_NTNIC_SERVICE_STAT );if (fpga_info->profile ==FPGA_INFO_PROFILE_INLINE ) {
@@ -2323,9 +2314,6 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) p_nt_drv->adapter_info.hw_info.pci_sub_vendor_id, p_nt_drv->adapter_info.hw_info.pci_sub_device_id); - p_nt_drv->b_shutdown = false; - p_nt_drv->adapter_info.pb_shutdown = &p_nt_drv->b_shutdown; -/* store context */ store_pdrv (p_drv);
@@ -2366,7 +2354,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)NT_LOG_DBGX (DBG ,NTNIC ,"SG module is not initialized" ); } -/* Start ctrl, monitor, stat thread only for primary process. */ +/* Start ctrl, monitor, stat service only for primary process. */ if (err ==0 ) {/* mp_adapter_id_str is initialized after nt4ga_adapter_init(p_nt_drv) */ const char *const p_adapter_id_str = p_nt_drv->adapter_info.mp_adapter_id_str;
@@ -2632,7 +2620,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)fpga_info_t *fpga_info = &p_ntdrv->adapter_info.fpga_info;const int n_phy_ports = fpga_info->n_phy_ports; -/* let running threads end Rx and Tx activity */ +/* let running services end Rx and Tx activity */ if (sg_ops !=NULL ) {nt_os_wait_usec (1 *1000 *1000 );
@@ -2707,7 +2695,7 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,/* * 1 time calculation of 1 sec stat update rtc cycles to prevent stat poll -* flooding by OVS from multiple virtual port threads - no need to be precise +* flooding by OVS from multiple virtual port services - no need to be precise */ uint64_t now_rtc =rte_get_tsc_cycles ();nt_os_wait_usec (10 *1000 );
drivers/net/ntnic/ntutil/nt_util.c +1 -1
@@ -16,7 +16,7 @@static struct nt_util_vfio_impl vfio_cb; -/* uses usleep which schedules out the calling thread */ +/* uses usleep which schedules out the calling service */ void nt_os_wait_usec (int val) {rte_delay_us_sleep (val);
Signature · 1 line
2.45.0
PATCH 8/24 net/ntnic: fix potential format overflow
In reply to Serhii IliushykUse snprintf instead sprintf to avoid format overflow
--- drivers/net/ntnic/ntnic_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ntnic/ntnic_ethdev.c +2 -2
@@ -2613,7 +2613,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)NT_LOG_DBGX (DBG ,NTNIC ,"PCI device deinitialization" );int i; -char name[32 ]; +char name[RTE_ETH_NAME_MAX_LEN ];struct pmd_internals *internals = eth_dev->data->dev_private;ntdrv_4ga_t *p_ntdrv = &internals->p_drv->ntdrv;
@@ -2640,7 +2640,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused) }for (i =0 ; i < n_phy_ports; i++) { -sprintf (name,"ntnic%d" , i); +snprintf (name,sizeof (name),"ntnic%d" , i); eth_dev =rte_eth_dev_allocated (name);if (eth_dev ==NULL )continue ;/* port already released */
Signature · 1 line
2.45.0
PATCH 9/24 net/ntnic: single file function as static
In reply to Serhii IliushykRefactoring: make single file functions static
to avoid namespace pollution.
--- drivers/net/ntnic/include/create_elements.h | 9 - drivers/net/ntnic/include/flow_api.h | 2 - drivers/net/ntnic/include/hw_mod_backend.h | 15 - drivers/net/ntnic/nim/i2c_nim.c | 4 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 2 - .../net/ntnic/nthw/core/include/nthw_hif.h | 12 - .../net/ntnic/nthw/core/include/nthw_iic.h | 9 - .../ntnic/nthw/core/include/nthw_mac_pcs.h | 9 - .../net/ntnic/nthw/core/include/nthw_pcie3.h | 13 - .../nthw/core/include/nthw_pcm_nt400dxx.h | 1 - .../ntnic/nthw/core/include/nthw_phy_tile.h | 2 - .../net/ntnic/nthw/core/include/nthw_rpf.h | 2 - .../net/ntnic/nthw/core/include/nthw_si5340.h | 2 - drivers/net/ntnic/nthw/core/nthw_fpga.c | 2 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 10 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 238 ++++----- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 52 +- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 11 +- .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c | 2 +- drivers/net/ntnic/nthw/core/nthw_phy_tile.c | 5 +- drivers/net/ntnic/nthw/core/nthw_rpf.c | 4 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 125 ++--- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 226 ++++---- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 79 +-- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 30 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 4 +- .../profile_inline/flow_api_hw_db_inline.c | 461 +++++++++-------- .../profile_inline/flow_api_hw_db_inline.h | 53 -- .../net/ntnic/nthw/model/nthw_fpga_model.c | 485 +++++++++--------- .../net/ntnic/nthw/model/nthw_fpga_model.h | 28 - drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 9 +- drivers/net/ntnic/ntnic_vfio.c | 2 +- drivers/net/ntnic/ntnic_vfio.h | 2 - drivers/net/ntnic/ntutil/nt_util.c | 4 +- drivers/net/ntnic/ntutil/nt_util.h | 3 - 36 files changed, 887 insertions(+), 1032 deletions(-)
drivers/net/ntnic/include/create_elements.h +0 -9
@@ -60,13 +60,4 @@ enum nt_rte_flow_item_type {extern rte_spinlock_t flow_lock; -int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out); -int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr); -int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[], -int max_elem); -int nthw_create_action_elements_inline (struct cnv_action_s *action, -const struct rte_flow_action actions[], -int max_elem, -uint32_t queue_offset); -#endif /* __CREATE_ELEMENTS_H__ */
drivers/net/ntnic/include/flow_api.h +0 -2
@@ -27,8 +27,6 @@ struct hw_mod_resource_s {/* * Device Management API */ -int nthw_flow_delete_eth_dev (struct flow_eth_dev *eth_dev); -/** * A structure used to configure the Receive Side Scaling (RSS) feature * of an Ethernet port.
drivers/net/ntnic/include/hw_mod_backend.h +0 -15
@@ -415,14 +415,6 @@ int hw_mod_cat_cot_flush(struct flow_api_backend_s *be, int start_idx, int countint hw_mod_cat_cot_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t value); -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 ;uint32_t nb_categories;
@@ -531,9 +523,6 @@ int hw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank, int start int count);int hw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value); -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 ;uint32_t nb_categories;
@@ -874,8 +863,6 @@ int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int countint hw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index,uint32_t value); -int hw_mod_pdb_config_flush (struct flow_api_backend_s *be); -struct tpe_func_s {COMMON_FUNC_INFO_S ;uint32_t nb_rcp_categories;
@@ -961,8 +948,6 @@ int hw_mod_tpe_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, i uint32_t value);int hw_mod_tpe_ifr_counters_update (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, -uint32_t value);int hw_mod_tpe_ifr_counters_get (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t *value);
drivers/net/ntnic/nim/i2c_nim.c +2 -2
@@ -13,7 +13,7 @@#include "qsfp_registers.h" #include "nim_defines.h" -int nim_agx_read_id (struct nim_i2c_ctx *ctx); +static int nim_agx_read_id (struct nim_i2c_ctx *ctx);static void nim_agx_read (struct nim_i2c_ctx *ctx,uint8_t dev_addr,uint8_t reg_addr,uint8_t data_len,void *p_data); static void nim_agx_write(struct nim_i2c_ctx *ctx, uint8_t dev_addr, uint8_t reg_addr,
@@ -931,7 +931,7 @@ static void nim_agx_write(struct nim_i2c_ctx *ctx,rte_spinlock_unlock (&p_nt_i2cm->i2cmmutex); } -int nim_agx_read_id (struct nim_i2c_ctx *ctx) +static int nim_agx_read_id (struct nim_i2c_ctx *ctx) {nim_agx_read (ctx,0xA0 ,0 ,sizeof (ctx->nim_id), &ctx->nim_id);return 0 ;
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +0 -2
@@ -16,8 +16,6 @@int nthw_fpga_init (struct fpga_info_s *p_fpga_info);int nthw_fpga_shutdown (struct fpga_info_s *p_fpga_info); -int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga); -int nthw_fpga_avr_probe (nthw_fpga_t *p_fpga,const int n_instance_no); int nthw_fpga_iic_scan(nthw_fpga_t *p_fpga, const int n_instance_no_begin,
drivers/net/ntnic/nthw/core/include/nthw_hif.h +0 -12
@@ -137,18 +137,6 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance);int nthw_hif_trigger_sample_time (nthw_hif_t *p);int nthw_hif_force_soft_reset (nthw_hif_t *p); -int nthw_hif_stat_req_enable (nthw_hif_t *p); -int nthw_hif_stat_req_disable (nthw_hif_t *p); - -int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, -uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq, -uint64_t *p_tags_in_use,uint64_t *p_rd_err,uint64_t *p_wr_err); -int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, -uint64_t *p_ref_clk_cnt,uint64_t *p_tags_in_use, -uint64_t *p_rd_err_cnt,uint64_t *p_wr_err_cnt); - -int nthw_hif_end_point_counters_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc); -int nthw_hif_read_test_reg (nthw_hif_t *p,uint8_t test_reg,uint32_t *p_value);int nthw_hif_write_test_reg (nthw_hif_t *p,uint8_t test_reg,uint32_t value);
drivers/net/ntnic/nthw/core/include/nthw_iic.h +0 -9
@@ -85,16 +85,7 @@ int nthw_iic_set_retry_params(nthw_iic_t *p, const int n_poll_delay, const int nint nthw_iic_read_data (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len,void *p_void); -int nthw_iic_readbyte (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len, -uint8_t *p_byte);int nthw_iic_write_data (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len,void *p_void); -int nthw_iic_writebyte (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len, -uint8_t *p_byte); -bool nthw_iic_bus_ready (nthw_iic_t *p); -bool nthw_iic_data_ready (nthw_iic_t *p); -int nthw_iic_scan (nthw_iic_t *p); -int nthw_iic_scan_dev_addr (nthw_iic_t *p,int n_dev_addr,int n_reg_addr); -#endif /* __NTHW_IIC_H__ */
drivers/net/ntnic/nthw/core/include/nthw_mac_pcs.h +0 -9
@@ -198,14 +198,12 @@ typedef struct nthw_mac_pcs nthw_mac_pcs_t;int nthw_mac_pcs_init (nthw_mac_pcs_t *p,nthw_fpga_t *p_fpga,int n_instance); -void nthw_mac_pcs_tx_path_rst (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_rx_path_rst (nthw_mac_pcs_t *p,bool enable);bool nthw_mac_pcs_is_rx_path_rst (nthw_mac_pcs_t *p);/* wrapper - for ease of use */ void nthw_mac_pcs_set_rx_enable (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_tx_enable (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_tx_sel_host (nthw_mac_pcs_t *p,bool enable); -void nthw_mac_pcs_set_tx_sel_tfg (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_ts_eop (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_host_loopback (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_line_loopback (nthw_mac_pcs_t *p,bool enable);
@@ -240,11 +238,4 @@ void nthw_mac_pcs_swap_gty_rx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swavoid nthw_mac_pcs_set_receiver_equalization_mode (nthw_mac_pcs_t *p,uint8_t mode);void nthw_mac_pcs_set_led_mode (nthw_mac_pcs_t *p,uint8_t mode);void nthw_mac_pcs_set_timestamp_comp_rx (nthw_mac_pcs_t *p,uint16_t rx_dly); -void nthw_mac_pcs_set_port_no (nthw_mac_pcs_t *p,uint8_t port_no); - -uint32_t nthw_mac_pcs_get_fld_block_lock_lock (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_block_lock_lock_mask (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_lane_lock_lock (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_lane_lock_lock_mask (nthw_mac_pcs_t *p); -#endif /* NTHW_MAC_PCS_H_ */
drivers/net/ntnic/nthw/core/include/nthw_pcie3.h +0 -13
@@ -80,17 +80,4 @@ int nthw_pcie3_init(nthw_pcie3_t *p, nthw_fpga_t *p_fpga, int n_instance);int nthw_pcie3_trigger_sample_time (nthw_pcie3_t *p); -int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p); -int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p); - -int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, -uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq, -uint32_t *p_tag_use_cnt,uint32_t *p_rq_rdy_cnt,uint32_t *p_rq_vld_cnt); -int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, -uint64_t *p_ref_clk_cnt,uint64_t *p_tag_use_cnt, -uint64_t *p_pci_nt_bus_util,uint64_t *p_pci_xil_bus_util); - -int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p, -struct nthw_hif_end_point_counters *epc); -#endif /* __NTHW_PCIE3_H__ */
drivers/net/ntnic/nthw/core/include/nthw_pcm_nt400dxx.h +0 -1
@@ -34,7 +34,6 @@ nthw_pcm_nt400dxx_t *nthw_pcm_nt400dxx_new(void);int nthw_pcm_nt400dxx_init (nthw_pcm_nt400dxx_t *p,nthw_fpga_t *p_fpga,int n_instance);void nthw_pcm_nt400dxx_set_ts_pll_recal (nthw_pcm_nt400dxx_t *p,uint32_t val);bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat (nthw_pcm_nt400dxx_t *p); -bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p);void nthw_pcm_nt400dxx_set_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p,uint32_t val);#endif /* __NTHW_PCM_NT400DXX_H__ */
drivers/net/ntnic/nthw/core/include/nthw_phy_tile.h +0 -2
@@ -133,8 +133,6 @@ bool nthw_phy_tile_get_rx_am_lock(nthw_phy_tile_t *p, uint8_t intf_no);void nthw_phy_tile_set_timestamp_comp_rx (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t value);uint32_t nthw_phy_tile_get_timestamp_comp_rx (nthw_phy_tile_t *p,uint8_t intf_no); -uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address); -void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address,uint32_t data);bool nthw_phy_tile_configure_fec (nthw_phy_tile_t *p,uint8_t intf_no,bool enable);uint32_t nthw_phy_tile_read_xcvr (nthw_phy_tile_t *p,uint8_t intf_no,uint8_t lane,uint32_t address);
drivers/net/ntnic/nthw/core/include/nthw_rpf.h +0 -2
@@ -37,9 +37,7 @@ typedef struct nthw_rpf nthw_rpf_t;typedef struct nthw_rpf nt_rpf ;nthw_rpf_t *nthw_rpf_new (void ); -void nthw_rpf_delete (nthw_rpf_t *p);int nthw_rpf_init (nthw_rpf_t *p,nthw_fpga_t *p_fpga,int n_instance); -void nthw_rpf_administrative_block (nthw_rpf_t *p);void nthw_rpf_block (nthw_rpf_t *p);void nthw_rpf_unblock (nthw_rpf_t *p);void nthw_rpf_set_maturing_delay (nthw_rpf_t *p,int32_t delay);
drivers/net/ntnic/nthw/core/include/nthw_si5340.h +0 -2
@@ -25,8 +25,6 @@ nthw_si5340_t *nthw_si5340_new(void);int nthw_si5340_init (nthw_si5340_t *p,nthw_iic_t *p_nthw_iic,uint8_t n_iic_addr);void nthw_si5340_delete (nthw_si5340_t *p); -int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt, -clk_profile_data_fmt_t data_format);int nthw_si5340_config_fmt2 (nthw_si5340_t *p,const clk_profile_data_fmt2_t *p_data,const int data_cnt);
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
@@ -18,7 +18,7 @@#include <arpa/inet.h> -int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga) +static int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga) {mcu_info_t *p_mcu_info = &p_fpga_info->mcu_info;
drivers/net/ntnic/nthw/core/nthw_hif.c +5 -5
@@ -217,7 +217,7 @@ int nthw_hif_trigger_sample_time(nthw_hif_t *p)return 0 ; } -int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, +static int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt,uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq,uint64_t *p_tags_in_use,uint64_t *p_rd_err,uint64_t *p_wr_err) {
@@ -241,7 +241,7 @@ int nthw_hif_get_stat(nthw_hif_t *p, uint32_t *p_rx_cnt, uint32_t *p_tx_cnt,return 0 ; } -int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, +static int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate,uint64_t *p_ref_clk_cnt,uint64_t *p_tags_in_use,uint64_t *p_rd_err_cnt,uint64_t *p_wr_err_cnt) {
@@ -280,7 +280,7 @@ int nthw_hif_get_stat_rate(nthw_hif_t *p, uint64_t *p_pci_rx_rate, uint64_t *p_preturn 0 ; } -int nthw_hif_stat_req_enable (nthw_hif_t *p) +static int nthw_hif_stat_req_enable (nthw_hif_t *p) {nthw_field_set_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -288,7 +288,7 @@ int nthw_hif_stat_req_enable(nthw_hif_t *p)return 0 ; } -int nthw_hif_stat_req_disable (nthw_hif_t *p) +static int nthw_hif_stat_req_disable (nthw_hif_t *p) {nthw_field_clr_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -296,7 +296,7 @@ int nthw_hif_stat_req_disable(nthw_hif_t *p)return 0 ; } -int nthw_hif_end_point_counters_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) +static int nthw_hif_end_point_cntrs_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) {RTE_ASSERT (epc);
drivers/net/ntnic/nthw/core/nthw_iic.c +119 -119
320 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +26 -26
94 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_pcie3.c +6 -5
@@ -169,7 +169,7 @@ int nthw_pcie3_trigger_sample_time(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p) +static int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p) {nthw_field_set_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -177,7 +177,7 @@ int nthw_pcie3_stat_req_enable(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p) +static int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p) {nthw_field_clr_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -185,7 +185,7 @@ int nthw_pcie3_stat_req_disable(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, +static int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt,uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq,uint32_t *p_tag_use_cnt,uint32_t *p_rq_rdy_cnt,uint32_t *p_rq_vld_cnt) {
@@ -205,7 +205,8 @@ int nthw_pcie3_get_stat(nthw_pcie3_t *p, uint32_t *p_rx_cnt, uint32_t *p_tx_cnt,return 0 ; } -int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, +static int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate, +uint64_t *p_pci_tx_rate,uint64_t *p_ref_clk_cnt,uint64_t *p_tag_use_cnt,uint64_t *p_pci_nt_bus_util,uint64_t *p_pci_xil_bus_util) {
@@ -244,7 +245,7 @@ int nthw_pcie3_get_stat_rate(nthw_pcie3_t *p, uint64_t *p_pci_rx_rate, uint64_treturn 0 ; } -int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p, +static int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p,struct nthw_hif_end_point_counters *epc) {NT_LOG_DBGX (DBG ,NTHW );
drivers/net/ntnic/nthw/core/nthw_pcm_nt400dxx.c +1 -1
@@ -68,7 +68,7 @@ bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat(nthw_pcm_nt400dxx_t *p)return nthw_field_get_updated (p->mp_fld_stat_ts_pll_locked) !=0 ; } -bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p) +static bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p) {return nthw_field_get_updated (p->mp_fld_latch_ts_pll_locked) !=0 ; }
drivers/net/ntnic/nthw/core/nthw_phy_tile.c +3 -2
@@ -954,7 +954,7 @@ uint32_t nthw_phy_tile_get_timestamp_comp_rx(nthw_phy_tile_t *p, uint8_t intf_noreturn nthw_field_get_val32 (p->mp_fld_port_comp_rx_compensation[intf_no]); } -uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address) +static uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address) {nthw_register_update (p->mp_reg_port_eth_base[intf_no]);nthw_field_set_val32 (p->mp_fld_port_eth_base_cmd[intf_no],0 );
@@ -966,7 +966,8 @@ uint32_t nthw_phy_tile_read_eth(nthw_phy_tile_t *p, uint8_t intf_no, uint32_t adreturn nthw_field_get_updated (p->mp_fld_port_eth_data_data[intf_no]); } -void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address,uint32_t data) +static void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no, +uint32_t address,uint32_t data) {nthw_field_set_val_flush32 (p->mp_fld_port_eth_data_data[intf_no], data);nthw_register_update (p->mp_reg_port_eth_base[intf_no]);
drivers/net/ntnic/nthw/core/nthw_rpf.c +2 -2
@@ -20,7 +20,7 @@ nthw_rpf_t *nthw_rpf_new(void)return p; } -void nthw_rpf_delete (nthw_rpf_t *p) +static void nthw_rpf_delete (nthw_rpf_t *p) {free (p); }
@@ -67,7 +67,7 @@ int nthw_rpf_init(nthw_rpf_t *p, nthw_fpga_t *p_fpga, int n_instance)return 0 ; } -void nthw_rpf_administrative_block (nthw_rpf_t *p) +static void nthw_rpf_administrative_block (nthw_rpf_t *p) {/* block all MAC ports */ nthw_register_update (p->mp_reg_control);
drivers/net/ntnic/nthw/core/nthw_si5340.c +1 -1
@@ -144,7 +144,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,return 0 ; } -int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt, +static int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt,clk_profile_data_fmt_t data_format) { const char *const p_adapter_id_str =
drivers/net/ntnic/nthw/flow_api/flow_api.c +63 -62
137 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c +113 -113
265 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c +40 -39
94 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c +15 -15
@@ -58,20 +58,6 @@ void hw_mod_pdb_free(struct flow_api_backend_s *be) } } -int hw_mod_pdb_reset (struct flow_api_backend_s *be) -{ -int err =0 ; -/* Zero entire cache area */ -nthw_zero_module_cache ((struct common_func_s *)(&be->hsh)); - -NT_LOG (DBG ,FILTER ,"INIT PDB RCP" ); - err |=hw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES ); - -NT_LOG (DBG ,FILTER ,"INIT PDB CONFIG" ); - err |=hw_mod_pdb_config_flush (be); -return err; -} -int hw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES )
@@ -243,7 +229,21 @@ int hw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint3return hw_mod_pdb_rcp_mod (be, field, index, &value,0 ); } -int hw_mod_pdb_config_flush (struct flow_api_backend_s *be) +static int hw_mod_pdb_config_flush (struct flow_api_backend_s *be) {return be->iface->pdb_config_flush (be->be_dev, &be->pdb); } + +int hw_mod_pdb_reset (struct flow_api_backend_s *be) +{ +int err =0 ; +/* Zero entire cache area */ +nthw_zero_module_cache ((struct common_func_s *)(&be->hsh)); + +NT_LOG (DBG ,FILTER ,"INIT PDB RCP" ); + err |=hw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES ); + +NT_LOG (DBG ,FILTER ,"INIT PDB CONFIG" ); + err |=hw_mod_pdb_config_flush (be); +return err; +}
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +2 -2
@@ -402,8 +402,8 @@ static int hw_mod_tpe_ifr_counters_mod(struct flow_api_backend_s *be, enum hw_tpreturn 0 ; } -int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, -uint32_t value) +static int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field, +int index,uint32_t value) {return hw_mod_tpe_ifr_counters_mod (be, field, index, &value,0 ); }
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +238 -223
638 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h +0 -53
96 lines not on this page · raw message
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +242 -243
595 lines not on this page · raw message
drivers/net/ntnic/nthw/model/nthw_fpga_model.h +0 -28
@@ -159,21 +159,13 @@ nthw_fpga_t *nthw_fpga_mgr_query_fpga(nthw_fpga_mgr_t *p, uint64_t n_fpga_id,void nthw_fpga_mgr_log_dump (nthw_fpga_mgr_t *p);nthw_fpga_t *nthw_fpga_model_new (void ); -void nthw_fpga_model_init (nthw_fpga_t *p,nthw_fpga_prod_init_s *p_init, -struct fpga_info_s *p_fpga_info); -int nthw_fpga_get_product_param (const nthw_fpga_t *p,const nthw_id_t n_param_id,const int default_value);int nthw_fpga_get_product_id (const nthw_fpga_t *p);nthw_module_t *nthw_fpga_query_module (const nthw_fpga_t *p,nthw_id_t id,int instance); -void nthw_fpga_set_debug_mode (nthw_fpga_t *p,int n_debug_mode); -nthw_param_t *nthw_param_new (void ); -void nthw_param_init (nthw_param_t *p,nthw_fpga_t *p_fpga,nthw_fpga_prod_param_s *p_init); -nthw_module_t *nthw_module_new (void ); -void nthw_module_init (nthw_module_t *p,nthw_fpga_t *p_fpga,nthw_fpga_module_init_s *p_init);void nthw_module_init2 (nthw_module_t *p,nthw_fpga_t *p_fpga,nthw_id_t mod_id,int instance,int debug_mode);
@@ -182,47 +174,27 @@ int nthw_module_get_minor_version(const nthw_module_t *p);uint64_t nthw_module_get_version_packed64 (const nthw_module_t *p);bool nthw_module_is_version_newer (const nthw_module_t *p,int major_version,int minor_version); -int nthw_module_get_bus (const nthw_module_t *p);nthw_register_t *nthw_module_query_register (nthw_module_t *p,nthw_id_t id);nthw_register_t *nthw_module_get_register (nthw_module_t *p,nthw_id_t id);int nthw_module_get_debug_mode (const nthw_module_t *p);void nthw_module_set_debug_mode (nthw_module_t *p,unsigned int debug_mode);nthw_register_t *nthw_register_new (void ); -void nthw_register_init (nthw_register_t *p,nthw_module_t *p_module, -nthw_fpga_register_init_s *p_init); -nthw_field_t *nthw_register_query_field (const nthw_register_t *p,nthw_id_t id);nthw_field_t *nthw_register_get_field (const nthw_register_t *p,nthw_id_t id);uint32_t nthw_register_get_address (const nthw_register_t *p); -int nthw_register_get_bit_width (const nthw_register_t *p); -int nthw_register_get_debug_mode (const nthw_register_t *p);void nthw_register_set_debug_mode (nthw_register_t *p,unsigned int debug_mode); -void nthw_register_get_val (const nthw_register_t *p,uint32_t *p_data,uint32_t len); -uint32_t nthw_register_get_val32 (const nthw_register_t *p); -uint32_t nthw_register_get_val_updated32 (const nthw_register_t *p); -void nthw_register_set_val (nthw_register_t *p,const uint32_t *p_data,uint32_t len);void nthw_register_make_dirty (nthw_register_t *p);void nthw_register_update (const nthw_register_t *p); -void nthw_register_reset (const nthw_register_t *p);void nthw_register_flush (const nthw_register_t *p,uint32_t cnt); -void nthw_register_clr (nthw_register_t *p); -nthw_field_t *nthw_field_new (void ); -void nthw_field_init (nthw_field_t *p,nthw_register_t *p_reg, -const nthw_fpga_field_init_s *p_init); - -int nthw_field_get_debug_mode (const nthw_field_t *p); -void nthw_field_set_debug_mode (nthw_field_t *p,unsigned int n_debug_mode);int nthw_field_get_bit_width (const nthw_field_t *p);int nthw_field_get_bit_pos_low (const nthw_field_t *p); -int nthw_field_get_bit_pos_high (const nthw_field_t *p);uint32_t nthw_field_get_mask (const nthw_field_t *p); -void nthw_field_reset (const nthw_field_t *p);void nthw_field_get_val (const nthw_field_t *p,uint32_t *p_data,uint32_t len);void nthw_field_set_val (const nthw_field_t *p,const uint32_t *p_data,uint32_t len);void nthw_field_set_val_flush (const nthw_field_t *p,const uint32_t *p_data,uint32_t len);
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +5 -4
@@ -31,7 +31,8 @@ static struct rte_flow nt_flows[MAX_RTE_FLOWS];rte_spinlock_t flow_lock =RTE_SPINLOCK_INITIALIZER ;static struct rte_flow nt_flows[MAX_RTE_FLOWS ]; -int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out) +static int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size, +struct rte_flow_item *out) {int hdri =0 ;int pkti =0 ;
@@ -249,7 +250,7 @@ int nthw_interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rreturn hdri +1 ; } -int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr) +static int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr) {if (!attribute) {NT_LOG (ERR ,FILTER ,"ERROR no attribute to iterate!" );
@@ -266,7 +267,7 @@ int nthw_create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *areturn 0 ; } -int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[], +static int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[],int max_elem) {int eidx =0 ;
@@ -316,7 +317,7 @@ int nthw_create_match_elements(struct cnv_match_s *match, const struct rte_flow_return (type >=0 ) ?0 :-1 ; } -int nthw_create_action_elements_inline (struct cnv_action_s *action, +static int nthw_create_action_elements_inline (struct cnv_action_s *action,const struct rte_flow_action actions[],int max_elem,uint32_t queue_offset)
drivers/net/ntnic/ntnic_vfio.c +1 -1
@@ -20,7 +20,7 @@#define ONE_G_MASK (ONE_G_SIZE - 1)#define START_VF_IOVA 0x220000000000 -int +static int nt_vfio_vf_num (const struct rte_pci_device *pdev) {return ((pdev->addr.devid &0x1f ) <<3 ) + ((pdev->addr.function) &0x7 );
drivers/net/ntnic/ntnic_vfio.h +0 -2
@@ -24,6 +24,4 @@ int nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size);/* Find device (PF/VF) number from device address */ -int -nt_vfio_vf_num (const struct rte_pci_device *dev);#endif /* _NTNIC_VFIO_H_ */
drivers/net/ntnic/ntutil/nt_util.c +2 -2
@@ -85,7 +85,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)return vfio_addr; } -void nt_dma_free (struct nt_dma_s *vfio_addr) +static void nt_dma_free (struct nt_dma_s *vfio_addr) {NT_LOG (DBG ,GENERAL ,"VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 , vfio_addr->addr, vfio_addr->iova, vfio_addr->size);
@@ -181,7 +181,7 @@ uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa) }/* Converts link speed provided in Mbps to NT specific definitions.*/ -nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps) +static nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps) {switch (link_speed_mbps) {case 10 :
drivers/net/ntnic/ntutil/nt_util.h +0 -3
@@ -55,8 +55,6 @@ struct port_link_speed { };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); -struct nt_util_vfio_impl {int (*vfio_dma_map)(int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size);int (*vfio_dma_unmap)(int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size);
@@ -66,7 +64,6 @@ void nt_util_vfio_init(struct nt_util_vfio_impl *impl);int nt_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed);uint32_t nt_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa); -nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps);int nt_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex); int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args);
Signature · 1 line
2.45.0
PATCH 10/24 net/ntnic: remove unused functions
In reply to Serhii IliushykRemove unused functions from various files in the ntnic PMD.
--- drivers/net/ntnic/nthw/core/nthw_hif.c | 90 ------------------- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 11 --- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 87 ------------------ .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c | 5 -- drivers/net/ntnic/nthw/core/nthw_rpf.c | 14 --- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 6 -- .../net/ntnic/nthw/model/nthw_fpga_model.c | 86 ------------------ drivers/net/ntnic/ntutil/nt_util.c | 51 ----------- 8 files changed, 350 deletions(-)
drivers/net/ntnic/nthw/core/nthw_hif.c +0 -90
@@ -217,96 +217,6 @@ int nthw_hif_trigger_sample_time(nthw_hif_t *p)return 0 ; } -static int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, -uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq, -uint64_t *p_tags_in_use,uint64_t *p_rd_err,uint64_t *p_wr_err) -{ - *p_rx_cnt =nthw_field_get_updated (p->mp_fld_stat_rx_counter); - *p_tx_cnt =nthw_field_get_updated (p->mp_fld_stat_tx_counter); - - *p_ref_clk_cnt =nthw_field_get_updated (p->mp_fld_stat_ref_clk_ref_clk); - - *p_tg_unit_size =NTHW_TG_CNT_SIZE ; - *p_tg_ref_freq = p->mn_fpga_hif_ref_clk_freq; - - *p_tags_in_use = (p->mp_fld_status_tags_in_use - ?nthw_field_get_updated (p->mp_fld_status_tags_in_use) - :0 ); - - *p_rd_err = - (p->mp_fld_status_rd_err ?nthw_field_get_updated (p->mp_fld_status_rd_err) :0 ); - *p_wr_err = - (p->mp_fld_status_wr_err ?nthw_field_get_updated (p->mp_fld_status_wr_err) :0 ); - -return 0 ; -} - -static int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, -uint64_t *p_ref_clk_cnt,uint64_t *p_tags_in_use, -uint64_t *p_rd_err_cnt,uint64_t *p_wr_err_cnt) -{ -uint32_t rx_cnt, tx_cnt, ref_clk_cnt, tg_unit_size, tg_ref_freq; -uint64_t n_tags_in_use, n_rd_err, n_wr_err; - -nthw_hif_get_stat (p, &rx_cnt, &tx_cnt, &ref_clk_cnt, &tg_unit_size, &tg_ref_freq, - &n_tags_in_use, &n_rd_err, &n_wr_err); - - *p_tags_in_use = n_tags_in_use; - -if (n_rd_err) - (*p_rd_err_cnt)++; - -if (n_wr_err) - (*p_wr_err_cnt)++; - -if (ref_clk_cnt) { -uint64_t rx_rate; -uint64_t tx_rate; - - *p_ref_clk_cnt = ref_clk_cnt; - - rx_rate = ((uint64_t )rx_cnt * tg_unit_size * tg_ref_freq) / (uint64_t )ref_clk_cnt; - *p_pci_rx_rate = rx_rate; - - tx_rate = ((uint64_t )tx_cnt * tg_unit_size * tg_ref_freq) / (uint64_t )ref_clk_cnt; - *p_pci_tx_rate = tx_rate; - - }else { - *p_pci_rx_rate =0 ; - *p_pci_tx_rate =0 ; - *p_ref_clk_cnt =0 ; - } - -return 0 ; -} - -static int nthw_hif_stat_req_enable (nthw_hif_t *p) -{ -nthw_field_set_all (p->mp_fld_stat_ctrl_ena); -nthw_field_set_all (p->mp_fld_stat_ctrl_req); -nthw_field_flush_register (p->mp_fld_stat_ctrl_req); -return 0 ; -} - -static int nthw_hif_stat_req_disable (nthw_hif_t *p) -{ -nthw_field_clr_all (p->mp_fld_stat_ctrl_ena); -nthw_field_set_all (p->mp_fld_stat_ctrl_req); -nthw_field_flush_register (p->mp_fld_stat_ctrl_req); -return 0 ; -} - -static int nthw_hif_end_point_cntrs_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) -{ -RTE_ASSERT (epc); - -/* Get stat rate and maintain rx/tx min/max */ -nthw_hif_get_stat_rate (p, &epc->cur_tx, &epc->cur_rx, &epc->n_ref_clk_cnt, - &epc->n_tags_in_use, &epc->n_rd_err, &epc->n_wr_err); - -return 0 ; -} -int nthw_hif_read_test_reg (nthw_hif_t *p,uint8_t test_reg,uint32_t *p_value) {uint32_t data;
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +0 -11
@@ -429,17 +429,6 @@ void nthw_mac_pcs_set_tx_sel_host(nthw_mac_pcs_t *p, bool enable)nthw_field_clr_flush (p->mp_fld_phymac_misc_tx_sel_host); } -static void nthw_mac_pcs_set_tx_sel_tfg (nthw_mac_pcs_t *p,bool enable) -{ -nthw_field_get_updated (p->mp_fld_phymac_misc_tx_sel_tfg); - -if (enable) -nthw_field_set_flush (p->mp_fld_phymac_misc_tx_sel_tfg); - -else -nthw_field_clr_flush (p->mp_fld_phymac_misc_tx_sel_tfg); -} -void nthw_mac_pcs_set_ts_eop (nthw_mac_pcs_t *p,bool enable) {if (p->mp_fld_phymac_misc_ts_eop) {
drivers/net/ntnic/nthw/core/nthw_pcie3.c +0 -87
90 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_pcm_nt400dxx.c +0 -5
@@ -68,11 +68,6 @@ bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat(nthw_pcm_nt400dxx_t *p)return nthw_field_get_updated (p->mp_fld_stat_ts_pll_locked) !=0 ; } -static bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p) -{ -return nthw_field_get_updated (p->mp_fld_latch_ts_pll_locked) !=0 ; -} -void nthw_pcm_nt400dxx_set_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p,uint32_t val) {nthw_field_update_register (p->mp_fld_latch_ts_pll_locked);
drivers/net/ntnic/nthw/core/nthw_rpf.c +0 -14
@@ -20,11 +20,6 @@ nthw_rpf_t *nthw_rpf_new(void)return p; } -static void nthw_rpf_delete (nthw_rpf_t *p) -{ -free (p); -} -int nthw_rpf_init (nthw_rpf_t *p,nthw_fpga_t *p_fpga,int n_instance) {nthw_module_t *p_mod =nthw_fpga_query_module (p_fpga,MOD_RPF , n_instance);
@@ -67,15 +62,6 @@ int nthw_rpf_init(nthw_rpf_t *p, nthw_fpga_t *p_fpga, int n_instance)return 0 ; } -static void nthw_rpf_administrative_block (nthw_rpf_t *p) -{ -/* block all MAC ports */ -nthw_register_update (p->mp_reg_control); -nthw_field_set_val_flush32 (p->mp_fld_control_pen,0 ); - - p->m_administrative_block = true; -} -void nthw_rpf_block (nthw_rpf_t *p) {nthw_register_update (p->mp_reg_control);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +0 -6
@@ -402,12 +402,6 @@ static int hw_mod_tpe_ifr_counters_mod(struct flow_api_backend_s *be, enum hw_tpreturn 0 ; } -static int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field, -int index,uint32_t value) -{ -return hw_mod_tpe_ifr_counters_mod (be, field, index, &value,0 ); -} -int hw_mod_tpe_ifr_counters_get (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t *value) {
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +0 -86
128 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_util.c +0 -51
63 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH 11/24 net/ntnic: move nthw to prefix part
In reply to Serhii IliushykMove nthw_ from function names to a prefix to specify NapaTech Hardware-related functions.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 2 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 2 +- .../nthw/flow_api/flow_backend/flow_backend.c | 1336 ++++++++--------- .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_cat.h | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_csu.h | 24 +- .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_flm.h | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_info.c | 88 +- .../ntnic/nthw/flow_filter/flow_nthw_info.h | 88 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 160 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 162 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 54 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 56 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 42 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 46 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 12 +- drivers/net/ntnic/nthw/nthw_platform.c | 2 +- drivers/net/ntnic/nthw/nthw_platform_drv.h | 2 +- .../nthw/supported/nthw_fpga_mod_str_map.c | 2 +- .../nthw/supported/nthw_fpga_mod_str_map.h | 2 +- 38 files changed, 1877 insertions(+), 1877 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +1 -1
@@ -71,7 +71,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)int res =-1 ;nthw_fpga_t *p_fpga =NULL ; - p_hw_info->n_nthw_adapter_id =nthw_platform_get_nthw_adapter_id (p_hw_info->pci_device_id); + p_hw_info->n_nthw_adapter_id =nthw_platform_get_adapter_id (p_hw_info->pci_device_id); fpga_info->n_nthw_adapter_id = p_hw_info->n_nthw_adapter_id;/* ref: DN-0060 section 9 */
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
@@ -388,7 +388,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info) p_fpga_mgr =nthw_fpga_mgr_new ();if (p_fpga_mgr) {nthw_fpga_mgr_init (p_fpga_mgr, nthw_fpga_instances, - (const void *)sa_nthw_fpga_mod_str_map); + (const void *)nthw_sa_fpga_mod_str_map);nthw_fpga_mgr_log_dump (p_fpga_mgr); p_fpga =nthw_fpga_mgr_query_fpga (p_fpga_mgr, n_fpga_ident, p_fpga_info); p_fpga_info->mp_fpga = p_fpga;
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +668 -668
2,138 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.c +115 -115
727 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_cat.h +115 -115
119 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_csu.h +12 -12
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.c +139 -139
278 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_flm.h +139 -139
278 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.c +29 -29
58 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hfu.h +29 -29
58 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.c +30 -30
60 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_hsh.h +30 -30
60 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.c +15 -15
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_ifr.h +15 -15
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.c +44 -44
88 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_info.h +44 -44
88 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.c +80 -80
160 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_km.h +81 -81
162 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.c +27 -27
54 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_pdb.h +28 -28
56 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.c +34 -34
68 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_qsl.h +34 -34
68 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.c +14 -14
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_slc_lr.h +14 -14
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c +11 -11
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h +11 -11
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.c +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_ins.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c +21 -21
42 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h +23 -23
46 lines not on this page · raw message
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +6 -6
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/nthw_platform_drv.h +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_str_map.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/ntnic/nthw/supported/nthw_fpga_mod_str_map.h +1 -1
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.45.0
Part of the diff is not shown here. View the raw message.
PATCH 12/24 net/ntnic: change prefix hw to prefix nthw
In reply to Serhii IliushykChange all prefix hw_ to prefix nthw_ to specify that this is Napatech hardware module.
--- drivers/net/ntnic/include/hw_mod_backend.h | 266 +++---- drivers/net/ntnic/nthw/flow_api/flow_api.c | 26 +- .../net/ntnic/nthw/flow_api/flow_hsh_cfg.c | 38 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 118 +-- .../nthw/flow_api/hw_mod/hw_mod_backend.c | 18 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 140 ++-- .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 70 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 40 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 32 +- .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 74 +- .../profile_inline/flow_api_hw_db_inline.c | 675 +++++++++--------- .../profile_inline/flow_api_hw_db_inline.h | 46 +- .../profile_inline/flow_api_profile_inline.c | 291 ++++---- drivers/net/ntnic/ntnic_ethdev.c | 2 +- drivers/net/ntnic/ntnic_mod_reg.h | 2 +- 18 files changed, 948 insertions(+), 932 deletions(-)
drivers/net/ntnic/include/hw_mod_backend.h +133 -133
@@ -353,66 +353,66 @@ enum hw_cat_e { /* 64 */ HW_CAT_CFN_ERR_TNL_TTL_EXP, }; -bool hw_mod_cat_present (struct flow_api_backend_s *be); -int hw_mod_cat_alloc (struct flow_api_backend_s *be); -void hw_mod_cat_free (struct flow_api_backend_s *be); -int hw_mod_cat_reset (struct flow_api_backend_s *be); -int hw_mod_cat_cfn_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_cat_cfn_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,int word_off, -uint32_t value); +bool nthw_mod_cat_present (struct flow_api_backend_s *be); +int nthw_mod_cat_alloc (struct flow_api_backend_s *be); +void nthw_mod_cat_free (struct flow_api_backend_s *be); +int nthw_mod_cat_reset (struct flow_api_backend_s *be); +int nthw_mod_cat_cfn_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_cat_cfn_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int index,int word_off,uint32_t value);/* KCE/KCS/FTE KM */ -int hw_mod_cat_kce_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_kce_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_kce_km_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kce_km_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_kce_km_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kce_km_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value); -int hw_mod_cat_kcs_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_kcs_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_kcs_km_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kcs_km_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_kcs_km_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kcs_km_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value); -int hw_mod_cat_fte_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_fte_km_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_fte_km_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_fte_km_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_fte_km_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_fte_km_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value);/* KCE/KCS/FTE FLM */ -int hw_mod_cat_kce_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_kce_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_kce_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kce_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_kce_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kce_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value); -int hw_mod_cat_kcs_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_kcs_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_kcs_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kcs_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_kcs_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_kcs_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value); -int hw_mod_cat_fte_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num, +int nthw_mod_cat_fte_flm_flush (struct flow_api_backend_s *be,enum km_flm_if_select_e if_num,int start_idx,int count); -int hw_mod_cat_fte_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_fte_flm_set (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t value); -int hw_mod_cat_fte_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field, +int nthw_mod_cat_fte_flm_get (struct flow_api_backend_s *be,enum hw_cat_e field,enum km_flm_if_select_e if_num,int index,uint32_t *value); -int hw_mod_cat_cte_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_cat_cte_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index, +int nthw_mod_cat_cte_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_cat_cte_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t value); -int hw_mod_cat_cte_get (struct flow_api_backend_s *be,enum hw_cat_e field,int index, +int nthw_mod_cat_cte_get (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t *value); -int hw_mod_cat_cts_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_cat_cts_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index, +int nthw_mod_cat_cts_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_cat_cts_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t value); -int hw_mod_cat_cts_get (struct flow_api_backend_s *be,enum hw_cat_e field,int index, +int nthw_mod_cat_cts_get (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t *value); -int hw_mod_cat_cot_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_cat_cot_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index, +int nthw_mod_cat_cot_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_cat_cot_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t value);struct km_func_s {
@@ -500,28 +500,28 @@ enum hw_km_e { HW_KM_TCQ_BANK_MASK,HW_KM_TCQ_QUAL }; -bool hw_mod_km_present (struct flow_api_backend_s *be); -int hw_mod_km_alloc (struct flow_api_backend_s *be); -void hw_mod_km_free (struct flow_api_backend_s *be); -int hw_mod_km_reset (struct flow_api_backend_s *be); -int hw_mod_km_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_km_rcp_set (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off, +bool nthw_mod_km_present (struct flow_api_backend_s *be); +int nthw_mod_km_alloc (struct flow_api_backend_s *be); +void nthw_mod_km_free (struct flow_api_backend_s *be); +int nthw_mod_km_reset (struct flow_api_backend_s *be); +int nthw_mod_km_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_km_rcp_set (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off,uint32_t value); -int hw_mod_km_rcp_get (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off, +int nthw_mod_km_rcp_get (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off,uint32_t *value); -int hw_mod_km_cam_flush (struct flow_api_backend_s *be,int start_bank,int start_record, +int nthw_mod_km_cam_flush (struct flow_api_backend_s *be,int start_bank,int start_record,int count); -int hw_mod_km_cam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record, +int nthw_mod_km_cam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value); -int hw_mod_km_tcam_flush (struct flow_api_backend_s *be,int start_bank,int count); -int hw_mod_km_tcam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte, +int nthw_mod_km_tcam_flush (struct flow_api_backend_s *be,int start_bank,int count); +int nthw_mod_km_tcam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte,int byte_val,uint32_t *value_set); -int hw_mod_km_tcam_get (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte, +int nthw_mod_km_tcam_get (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte,int byte_val,uint32_t *value_set); -int hw_mod_km_tci_flush (struct flow_api_backend_s *be,int start_bank,int start_record, +int nthw_mod_km_tci_flush (struct flow_api_backend_s *be,int start_bank,int start_record,int count); -int hw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record, +int nthw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value);struct flm_func_s {COMMON_FUNC_INFO_S ;
@@ -641,55 +641,55 @@ enum hw_flm_e { HW_FLM_SCRUB_INF, /* module ver 0.24 */ }; -bool hw_mod_flm_present (struct flow_api_backend_s *be); -int hw_mod_flm_alloc (struct flow_api_backend_s *be); -void hw_mod_flm_free (struct flow_api_backend_s *be); -int hw_mod_flm_reset (struct flow_api_backend_s *be); +bool nthw_mod_flm_present (struct flow_api_backend_s *be); +int nthw_mod_flm_alloc (struct flow_api_backend_s *be); +void nthw_mod_flm_free (struct flow_api_backend_s *be); +int nthw_mod_flm_reset (struct flow_api_backend_s *be); -int hw_mod_flm_control_flush (struct flow_api_backend_s *be); -int hw_mod_flm_control_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); +int nthw_mod_flm_control_flush (struct flow_api_backend_s *be); +int nthw_mod_flm_control_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); -int hw_mod_flm_status_update (struct flow_api_backend_s *be); -int hw_mod_flm_status_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); +int nthw_mod_flm_status_update (struct flow_api_backend_s *be); +int nthw_mod_flm_status_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); -int hw_mod_flm_scan_flush (struct flow_api_backend_s *be); -int hw_mod_flm_scan_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); +int nthw_mod_flm_scan_flush (struct flow_api_backend_s *be); +int nthw_mod_flm_scan_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); -int hw_mod_flm_load_bin_flush (struct flow_api_backend_s *be); -int hw_mod_flm_load_bin_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); +int nthw_mod_flm_load_bin_flush (struct flow_api_backend_s *be); +int nthw_mod_flm_load_bin_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); -int hw_mod_flm_prio_flush (struct flow_api_backend_s *be); -int hw_mod_flm_prio_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); +int nthw_mod_flm_prio_flush (struct flow_api_backend_s *be); +int nthw_mod_flm_prio_set (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t value); -int hw_mod_flm_pst_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_flm_pst_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index, +int nthw_mod_flm_pst_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_flm_pst_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index,uint32_t value); -int hw_mod_flm_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_flm_rcp_set_mask (struct flow_api_backend_s *be,enum hw_flm_e field,int index, +int nthw_mod_flm_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_flm_rcp_set_mask (struct flow_api_backend_s *be,enum hw_flm_e field,int index,uint32_t *value); -int hw_mod_flm_rcp_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index, +int nthw_mod_flm_rcp_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index,uint32_t value); -int hw_mod_flm_buf_ctrl_update (struct flow_api_backend_s *be); -int hw_mod_flm_buf_ctrl_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); +int nthw_mod_flm_buf_ctrl_update (struct flow_api_backend_s *be); +int nthw_mod_flm_buf_ctrl_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); -int hw_mod_flm_stat_update (struct flow_api_backend_s *be); -int hw_mod_flm_stat_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); +int nthw_mod_flm_stat_update (struct flow_api_backend_s *be); +int nthw_mod_flm_stat_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *value); -int hw_mod_flm_lrn_data_set_flush (struct flow_api_backend_s *be,enum hw_flm_e field, +int nthw_mod_flm_lrn_data_set_flush (struct flow_api_backend_s *be,enum hw_flm_e field,const uint32_t *value,uint32_t records,uint32_t *handled_records,uint32_t *inf_word_cnt,uint32_t *sta_word_cnt); -int hw_mod_flm_inf_sta_data_update_get (struct flow_api_backend_s *be,enum hw_flm_e field, +int nthw_mod_flm_inf_sta_data_update_get (struct flow_api_backend_s *be,enum hw_flm_e field,uint32_t *inf_value,uint32_t inf_size,uint32_t *inf_word_cnt,uint32_t *sta_value,uint32_t sta_size,uint32_t *sta_word_cnt); -uint32_t hw_mod_flm_scrub_timeout_decode (uint32_t t_enc); -uint32_t hw_mod_flm_scrub_timeout_encode (uint32_t t); -int hw_mod_flm_scrub_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_flm_scrub_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index, +uint32_t nthw_mod_flm_scrub_timeout_decode (uint32_t t_enc); +uint32_t nthw_mod_flm_scrub_timeout_encode (uint32_t t); +int nthw_mod_flm_scrub_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_flm_scrub_set (struct flow_api_backend_s *be,enum hw_flm_e field,int index,uint32_t value);struct hsh_func_s {
@@ -731,12 +731,12 @@ enum hw_hsh_e {HW_HSH_RCP_K ,HW_HSH_RCP_AUTO_IPV4_MASK }; -bool hw_mod_hsh_present (struct flow_api_backend_s *be); -int hw_mod_hsh_alloc (struct flow_api_backend_s *be); -void hw_mod_hsh_free (struct flow_api_backend_s *be); -int hw_mod_hsh_reset (struct flow_api_backend_s *be); -int hw_mod_hsh_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_hsh_rcp_set (struct flow_api_backend_s *be,enum hw_hsh_e field,uint32_t index, +bool nthw_mod_hsh_present (struct flow_api_backend_s *be); +int nthw_mod_hsh_alloc (struct flow_api_backend_s *be); +void nthw_mod_hsh_free (struct flow_api_backend_s *be); +int nthw_mod_hsh_reset (struct flow_api_backend_s *be); +int nthw_mod_hsh_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_hsh_rcp_set (struct flow_api_backend_s *be,enum hw_hsh_e field,uint32_t index,uint32_t word_off,uint32_t value); struct qsl_func_s {
@@ -773,23 +773,23 @@ enum hw_qsl_e {HW_QSL_UNMQ_DEST_QUEUE , HW_QSL_UNMQ_EN, }; -bool hw_mod_qsl_present (struct flow_api_backend_s *be); -int hw_mod_qsl_alloc (struct flow_api_backend_s *be); -void hw_mod_qsl_free (struct flow_api_backend_s *be); -int hw_mod_qsl_reset (struct flow_api_backend_s *be); -int hw_mod_qsl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_qsl_rcp_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +bool nthw_mod_qsl_present (struct flow_api_backend_s *be); +int nthw_mod_qsl_alloc (struct flow_api_backend_s *be); +void nthw_mod_qsl_free (struct flow_api_backend_s *be); +int nthw_mod_qsl_reset (struct flow_api_backend_s *be); +int nthw_mod_qsl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_qsl_rcp_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value); -int hw_mod_qsl_qst_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_qsl_qst_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qst_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_qsl_qst_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value); -int hw_mod_qsl_qen_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_qsl_qen_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qen_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_qsl_qen_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value); -int hw_mod_qsl_qen_get (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qen_get (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t *value); -int hw_mod_qsl_unmq_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_qsl_unmq_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_unmq_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_qsl_unmq_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value); struct slc_lr_func_s {
@@ -812,12 +812,12 @@ enum hw_slc_lr_e {HW_SLC_LR_RCP_TAIL_OFS ,HW_SLC_LR_RCP_PCAP }; -bool hw_mod_slc_lr_present (struct flow_api_backend_s *be); -int hw_mod_slc_lr_alloc (struct flow_api_backend_s *be); -void hw_mod_slc_lr_free (struct flow_api_backend_s *be); -int hw_mod_slc_lr_reset (struct flow_api_backend_s *be); -int hw_mod_slc_lr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_slc_lr_rcp_set (struct flow_api_backend_s *be,enum hw_slc_lr_e field,uint32_t index, +bool nthw_mod_slc_lr_present (struct flow_api_backend_s *be); +int nthw_mod_slc_lr_alloc (struct flow_api_backend_s *be); +void nthw_mod_slc_lr_free (struct flow_api_backend_s *be); +int nthw_mod_slc_lr_reset (struct flow_api_backend_s *be); +int nthw_mod_slc_lr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_slc_lr_rcp_set (struct flow_api_backend_s *be,enum hw_slc_lr_e field,uint32_t index,uint32_t value); struct pdb_func_s {
@@ -855,12 +855,12 @@ enum hw_pdb_e {HW_PDB_CONFIG_TS_FORMAT , HW_PDB_CONFIG_PORT_OFS, }; -bool hw_mod_pdb_present (struct flow_api_backend_s *be); -int hw_mod_pdb_alloc (struct flow_api_backend_s *be); -void hw_mod_pdb_free (struct flow_api_backend_s *be); -int hw_mod_pdb_reset (struct flow_api_backend_s *be); -int hw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index, +bool nthw_mod_pdb_present (struct flow_api_backend_s *be); +int nthw_mod_pdb_alloc (struct flow_api_backend_s *be); +void nthw_mod_pdb_free (struct flow_api_backend_s *be); +int nthw_mod_pdb_reset (struct flow_api_backend_s *be); +int nthw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index,uint32_t value); struct tpe_func_s {
@@ -930,53 +930,53 @@ enum hw_tpe_e {HW_TPE_CSU_RCP_INNER_L3_CMD , HW_TPE_CSU_RCP_INNER_L4_CMD, }; -bool hw_mod_tpe_present (struct flow_api_backend_s *be); -int hw_mod_tpe_alloc (struct flow_api_backend_s *be); -void hw_mod_tpe_free (struct flow_api_backend_s *be); -int hw_mod_tpe_reset (struct flow_api_backend_s *be); +bool nthw_mod_tpe_present (struct flow_api_backend_s *be); +int nthw_mod_tpe_alloc (struct flow_api_backend_s *be); +void nthw_mod_tpe_free (struct flow_api_backend_s *be); +int nthw_mod_tpe_reset (struct flow_api_backend_s *be); -int hw_mod_tpe_rpp_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_rpp_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_rpp_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_rpp_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_rpp_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_rpp_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_rpp_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_rpp_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_ifr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_ifr_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_ifr_counters_update (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_ifr_counters_get (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_ifr_counters_update (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_ifr_counters_get (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t *value); -int hw_mod_tpe_ins_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_ins_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_ins_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_ins_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_rpl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_rpl_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_rpl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_rpl_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_rpl_ext_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_rpl_ext_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_rpl_ext_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_rpl_ext_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_rpl_rpl_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_rpl_rpl_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_rpl_rpl_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_rpl_rpl_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t *value); -int hw_mod_tpe_cpy_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_cpy_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_cpy_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_cpy_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_hfu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_hfu_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_hfu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_hfu_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); -int hw_mod_tpe_csu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_csu_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, +int nthw_mod_tpe_csu_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count); +int nthw_mod_tpe_csu_rcp_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t value); enum debug_mode_e {
drivers/net/ntnic/nthw/flow_api/flow_api.c +13 -13
@@ -418,19 +418,19 @@ static int nthw_flow_delete_eth_dev(struct flow_eth_dev *eth_dev)* remove unmatched queue if setup in QSL * remove exception queue setting in QSL UNM */ -hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_DEST_QUEUE , eth_dev->port,0 ); -hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_EN , eth_dev->port,0 ); -hw_mod_qsl_unmq_flush (&ndev->be, eth_dev->port,1 ); +nthw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_DEST_QUEUE , eth_dev->port,0 ); +nthw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_EN , eth_dev->port,0 ); +nthw_mod_qsl_unmq_flush (&ndev->be, eth_dev->port,1 );if (ndev->flow_profile ==FLOW_ETH_DEV_PROFILE_INLINE ) {for (int i =0 ; i < eth_dev->num_queues; ++i) {uint32_t qen_value =0 ;uint32_t queue_id = (uint32_t )eth_dev->rx_queue[i].hw_id; -hw_mod_qsl_qen_get (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , &qen_value); -hw_mod_qsl_qen_set (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , +nthw_mod_qsl_qen_get (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , &qen_value); +nthw_mod_qsl_qen_set (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , qen_value & ~(1U << (queue_id %4 ))); -hw_mod_qsl_qen_flush (&ndev->be, queue_id /4 ,1 ); +nthw_mod_qsl_qen_flush (&ndev->be, queue_id /4 ,1 ); } }
@@ -678,14 +678,14 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no* Init QSL UNM - unmatched - redirects otherwise discarded * packets in QSL */ -if (hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_DEST_QUEUE , eth_dev->port, +if (nthw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_DEST_QUEUE , eth_dev->port, eth_dev->rx_queue[0 ].hw_id) <0 ) goto err_exit0; -if (hw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_EN , eth_dev->port,1 ) <0 ) +if (nthw_mod_qsl_unmq_set (&ndev->be,HW_QSL_UNMQ_EN , eth_dev->port,1 ) <0 ) goto err_exit0; -if (hw_mod_qsl_unmq_flush (&ndev->be, eth_dev->port,1 ) <0 ) +if (nthw_mod_qsl_unmq_flush (&ndev->be, eth_dev->port,1 ) <0 ) goto err_exit0; }
@@ -699,10 +699,10 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_nouint32_t qen_value =0 ;uint32_t queue_id = (uint32_t )eth_dev->rx_queue[i].hw_id; -hw_mod_qsl_qen_get (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , &qen_value); -hw_mod_qsl_qen_set (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , +nthw_mod_qsl_qen_get (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , &qen_value); +nthw_mod_qsl_qen_set (&ndev->be,HW_QSL_QEN_EN , queue_id /4 , qen_value | (1 << (queue_id %4 ))); -hw_mod_qsl_qen_flush (&ndev->be, queue_id /4 ,1 ); +nthw_mod_qsl_qen_flush (&ndev->be, queue_id /4 ,1 ); } }
@@ -1276,7 +1276,7 @@ static const struct flow_filter_ops ops = {/* * Other */ - .hw_mod_hsh_rcp_flush = hw_mod_hsh_rcp_flush, + .nthw_mod_hsh_rcp_flush = nthw_mod_hsh_rcp_flush, };void nthw_init_flow_filter (void )
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c +19 -19
@@ -70,11 +70,11 @@ static int hsh_set_part(struct flow_nic_dev *ndev, int hsh_idx, struct hsh_words words[word].free = false; - res |=hw_mod_hsh_rcp_set (&ndev->be, words[word].pe, hsh_idx,0 , pe); -NT_LOG (DBG ,FILTER ,"hw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32")" , + res |=nthw_mod_hsh_rcp_set (&ndev->be, words[word].pe, hsh_idx,0 , pe); +NT_LOG (DBG ,FILTER ,"nthw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32")" , (int )words[word].pe, hsh_idx, pe); - res |=hw_mod_hsh_rcp_set (&ndev->be, words[word].ofs, hsh_idx,0 , ofs); -NT_LOG (DBG ,FILTER ,"hw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32")" , + res |=nthw_mod_hsh_rcp_set (&ndev->be, words[word].ofs, hsh_idx,0 , ofs); +NT_LOG (DBG ,FILTER ,"nthw_mod_hsh_rcp_set(&ndev->be, %d, %d, 0, %" PRIu32")" , (int )words[word].ofs, hsh_idx, ofs);
@@ -95,10 +95,10 @@ static int hsh_set_part(struct flow_nic_dev *ndev, int hsh_idx, struct hsh_words mask =0x0 ; }/* reorder QW words mask from little to big endian */ - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_WORD_MASK , hsh_idx, + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_WORD_MASK , hsh_idx, words[word].index + words_count - mask_off, mask);NT_LOG (DBG ,FILTER , -"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%08" PRIX32 ")" , +"mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_WORD_MASK, %d, %d, 0x%08" PRIX32 ")" , hsh_idx, words[word].index + words_count - mask_off, mask); toeplitz_mask[words[word].index + mask_off -1 ] = mask; }
@@ -166,33 +166,33 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c };int res =0 ; - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_PRESET_ALL , hsh_idx,0 ,0 ); + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_PRESET_ALL , hsh_idx,0 ,0 );/* enable hashing */ - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_LOAD_DIST_TYPE , hsh_idx,0 ,2 ); + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_LOAD_DIST_TYPE , hsh_idx,0 ,2 );/* configure selected hash function and its key */ bool toeplitz = false;switch (rss_conf.algorithm) {case RTE_ETH_HASH_FUNCTION_DEFAULT :/* Use default NTH10 hashing algorithm */ - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TOEPLITZ , hsh_idx,0 ,0 ); + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TOEPLITZ , hsh_idx,0 ,0 );/* Use 1st 32-bits from rss_key to configure NTH10 SEED */ - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_SEED , hsh_idx,0 , + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_SEED , hsh_idx,0 , rss_conf.rss_key[0 ] <<24 | rss_conf.rss_key[1 ] <<16 | rss_conf.rss_key[2 ] <<8 | rss_conf.rss_key[3 ]);break ;case RTE_ETH_HASH_FUNCTION_TOEPLITZ : toeplitz = true; - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TOEPLITZ , hsh_idx,0 ,1 ); + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TOEPLITZ , hsh_idx,0 ,1 );uint8_t empty_key =0 ;/* Toeplitz key (always 40B) words have to be programmed in reverse order */ for (uint8_t i =0 ; i <= (MAX_RSS_KEY_LEN -4 ); i +=4 ) { - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_K , hsh_idx,9 - i /4 , + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_K , hsh_idx,9 - i /4 , rss_conf.rss_key[i] <<24 | rss_conf.rss_key[i +1 ] <<16 | rss_conf.rss_key[i +2 ] <<8 | rss_conf.rss_key[i +3 ]);NT_LOG (DBG ,FILTER , -"hw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 ")" , +"nthw_mod_hsh_rcp_set(&ndev->be, HW_HSH_RCP_K, %d, %d, 0x%" PRIX32 ")" , hsh_idx,9 - i /4 , rss_conf.rss_key[i] <<24 | rss_conf.rss_key[i +1 ] <<16 | rss_conf.rss_key[i +2 ] <<8 | rss_conf.rss_key[i +3 ]);
@@ -432,7 +432,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c 0, 32, toeplitz); } } - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_AUTO_IPV4_MASK , + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_AUTO_IPV4_MASK , hsh_idx,0 ,1 ); }else {/* IPv4 */
@@ -539,9 +539,9 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c res |=hsh_set_part (ndev, hsh_idx, words,DYN_L3 ,9 ,8 , toeplitz); }else { - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_P_MASK , + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_P_MASK , hsh_idx,0 ,1 ); - res |=hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TNL_P , + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TNL_P , hsh_idx,0 ,0 ); } }else {
@@ -555,9 +555,9 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c toeplitz); } }else { - res |=hw_mod_hsh_rcp_set (&ndev->be, + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_P_MASK , hsh_idx,0 ,1 ); - res |=hw_mod_hsh_rcp_set (&ndev->be, + res |=nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_TNL_P , hsh_idx,0 ,1 ); } }
@@ -644,7 +644,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_c }if (fields || res !=0 ) { -hw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_PRESET_ALL , hsh_idx,0 ,0 ); +nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_PRESET_ALL , hsh_idx,0 ,0 );if (sprint_nt_rss_mask (rss_buffer, rss_buffer_len," " , rss_conf.rss_hf) ==0 ) { NT_LOG(ERR, FILTER, "RSS configuration%s is not supported for hash func %s.", rss_buffer, (enum rte_eth_hash_function)toeplitz ?
drivers/net/ntnic/nthw/flow_api/flow_km.c +61 -57
316 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_backend.c +9 -9
@@ -18,17 +18,17 @@ static const struct {int (*reset)(struct flow_api_backend_s *be);bool (*present)(struct flow_api_backend_s *be); } module[] = { - { "CAT", hw_mod_cat_alloc, hw_mod_cat_free, hw_mod_cat_reset, hw_mod_cat_present }, - { "KM", hw_mod_km_alloc, hw_mod_km_free, hw_mod_km_reset, hw_mod_km_present }, - { "FLM", hw_mod_flm_alloc, hw_mod_flm_free, hw_mod_flm_reset, hw_mod_flm_present }, - { "HSH", hw_mod_hsh_alloc, hw_mod_hsh_free, hw_mod_hsh_reset, hw_mod_hsh_present }, - { "QSL", hw_mod_qsl_alloc, hw_mod_qsl_free, hw_mod_qsl_reset, hw_mod_qsl_present }, + { "CAT", nthw_mod_cat_alloc, nthw_mod_cat_free, nthw_mod_cat_reset, nthw_mod_cat_present }, + { "KM", nthw_mod_km_alloc, nthw_mod_km_free, nthw_mod_km_reset, nthw_mod_km_present }, + { "FLM", nthw_mod_flm_alloc, nthw_mod_flm_free, nthw_mod_flm_reset, nthw_mod_flm_present }, + { "HSH", nthw_mod_hsh_alloc, nthw_mod_hsh_free, nthw_mod_hsh_reset, nthw_mod_hsh_present }, + { "QSL", nthw_mod_qsl_alloc, nthw_mod_qsl_free, nthw_mod_qsl_reset, nthw_mod_qsl_present }, { - "SLC LR", hw_mod_slc_lr_alloc, hw_mod_slc_lr_free, hw_mod_slc_lr_reset, - hw_mod_slc_lr_present + "SLC LR", nthw_mod_slc_lr_alloc, nthw_mod_slc_lr_free, nthw_mod_slc_lr_reset, + nthw_mod_slc_lr_present }, - { "PDB", hw_mod_pdb_alloc, hw_mod_pdb_free, hw_mod_pdb_reset, hw_mod_pdb_present }, - { "TPE", hw_mod_tpe_alloc, hw_mod_tpe_free, hw_mod_tpe_reset, hw_mod_tpe_present }, + { "PDB", nthw_mod_pdb_alloc, nthw_mod_pdb_free, nthw_mod_pdb_reset, nthw_mod_pdb_present }, + { "TPE", nthw_mod_tpe_alloc, nthw_mod_tpe_free, nthw_mod_tpe_reset, nthw_mod_tpe_present }, }; #define MOD_COUNT (ARRAY_SIZE(module))
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c +70 -70
345 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c +35 -35
237 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c +7 -7
@@ -12,12 +12,12 @@#define _MOD_ "HSH"#define _VER_ be->hsh.ver -bool hw_mod_hsh_present (struct flow_api_backend_s *be) +bool nthw_mod_hsh_present (struct flow_api_backend_s *be) {return be->iface->get_hsh_present (be->be_dev); } -int hw_mod_hsh_alloc (struct flow_api_backend_s *be) +int nthw_mod_hsh_alloc (struct flow_api_backend_s *be) {int nb; _VER_ = be->iface->get_hsh_version (be->be_dev);
@@ -60,7 +60,7 @@ int hw_mod_hsh_alloc(struct flow_api_backend_s *be)return 0 ; } -void hw_mod_hsh_free (struct flow_api_backend_s *be) +void nthw_mod_hsh_free (struct flow_api_backend_s *be) {if (be->hsh.base) {free (be->hsh.base);
@@ -68,16 +68,16 @@ void hw_mod_hsh_free(struct flow_api_backend_s *be) } } -int hw_mod_hsh_reset (struct flow_api_backend_s *be) +int nthw_mod_hsh_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ nthw_zero_module_cache ((struct common_func_s *)(&be->hsh));NT_LOG (DBG ,FILTER ,"INIT HSH RCP" ); -return hw_mod_hsh_rcp_flush (be,0 , be->hsh.nb_rcp); +return nthw_mod_hsh_rcp_flush (be,0 , be->hsh.nb_rcp); } -int hw_mod_hsh_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_hsh_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->hsh.nb_rcp;
@@ -278,7 +278,7 @@ static int hw_mod_hsh_rcp_mod(struct flow_api_backend_s *be, enum hw_hsh_e fieldreturn 0 ; } -int hw_mod_hsh_rcp_set (struct flow_api_backend_s *be,enum hw_hsh_e field,uint32_t index, +int nthw_mod_hsh_rcp_set (struct flow_api_backend_s *be,enum hw_hsh_e field,uint32_t index,uint32_t word_off,uint32_t value) {return hw_mod_hsh_rcp_mod (be, field, index, word_off, &value,0 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c +21 -19
@@ -17,12 +17,12 @@#define KM_RCP_MASK_D_A_SIZE 12/* Mask for double size word extractors for DW8/DW10 */ #define KM_RCP_MASK_B_SIZE 6 -bool hw_mod_km_present (struct flow_api_backend_s *be) +bool nthw_mod_km_present (struct flow_api_backend_s *be) {return be->iface->get_km_present (be->be_dev); } -int hw_mod_km_alloc (struct flow_api_backend_s *be) +int nthw_mod_km_alloc (struct flow_api_backend_s *be) {int nb; _VER_ = be->iface->get_km_version (be->be_dev);
@@ -106,7 +106,7 @@ int hw_mod_km_alloc(struct flow_api_backend_s *be)return 0 ; } -void hw_mod_km_free (struct flow_api_backend_s *be) +void nthw_mod_km_free (struct flow_api_backend_s *be) {if (be->km.base) {free (be->km.base);
@@ -114,7 +114,7 @@ void hw_mod_km_free(struct flow_api_backend_s *be) } } -int hw_mod_km_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_km_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->km.nb_categories;
@@ -349,19 +349,20 @@ static int hw_mod_km_rcp_mod(struct flow_api_backend_s *be, enum hw_km_e field,return 0 ; } -int hw_mod_km_rcp_set (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off, +int nthw_mod_km_rcp_set (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off,uint32_t value) {return hw_mod_km_rcp_mod (be, field, index, word_off, &value,0 ); } -int hw_mod_km_rcp_get (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off, +int nthw_mod_km_rcp_get (struct flow_api_backend_s *be,enum hw_km_e field,int index,int word_off,uint32_t *value) {return hw_mod_km_rcp_mod (be, field, index, word_off, value,1 ); } -int hw_mod_km_cam_flush (struct flow_api_backend_s *be,int start_bank,int start_record,int count) +int nthw_mod_km_cam_flush (struct flow_api_backend_s *be,int start_bank, +int start_record,int count) {if (count ==ALL_ENTRIES ) count = be->km.nb_cam_records * be->km.nb_cam_banks;
@@ -467,13 +468,13 @@ static int hw_mod_km_cam_mod(struct flow_api_backend_s *be, enum hw_km_e field,return 0 ; } -int hw_mod_km_cam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record, +int nthw_mod_km_cam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value) {return hw_mod_km_cam_mod (be, field, bank, record, &value,0 ); } -int hw_mod_km_tcam_flush (struct flow_api_backend_s *be,int start_bank,int count) +int nthw_mod_km_tcam_flush (struct flow_api_backend_s *be,int start_bank,int count) {if (count ==ALL_ENTRIES ) count = be->km.nb_tcam_banks *4 *256 ;
@@ -560,19 +561,20 @@ static int hw_mod_km_tcam_mod(struct flow_api_backend_s *be, enum hw_km_e field,return 0 ; } -int hw_mod_km_tcam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte, +int nthw_mod_km_tcam_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte,int byte_val,uint32_t *value_set) {return hw_mod_km_tcam_mod (be, field, bank, byte, byte_val, value_set,0 ); } -int hw_mod_km_tcam_get (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte, +int nthw_mod_km_tcam_get (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int byte,int byte_val,uint32_t *value_set) {return hw_mod_km_tcam_mod (be, field, bank, byte, byte_val, value_set,1 ); } -int hw_mod_km_tci_flush (struct flow_api_backend_s *be,int start_bank,int start_record,int count) +int nthw_mod_km_tci_flush (struct flow_api_backend_s *be,int start_bank, +int start_record,int count) {if (count ==ALL_ENTRIES ) count = be->km.nb_tcam_banks * be->km.nb_tcam_bank_width;
@@ -624,7 +626,7 @@ static int hw_mod_km_tci_mod(struct flow_api_backend_s *be, enum hw_km_e field,return 0 ; } -int hw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record, +int nthw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value) {return hw_mod_km_tci_mod (be, field, bank, record, &value,0 );
@@ -646,7 +648,7 @@ static int hw_mod_km_tcq_flush(struct flow_api_backend_s *be, int start_bank,return be->iface->km_tcq_flush (be->be_dev, &be->km, start_bank, start_record, count); } -int hw_mod_km_reset (struct flow_api_backend_s *be) +int nthw_mod_km_reset (struct flow_api_backend_s *be) {uint32_t tcam_v_set[3 ] = {0x00000000 ,0x00000000 ,0x00000000 };
@@ -654,11 +656,11 @@ int hw_mod_km_reset(struct flow_api_backend_s *be)nthw_zero_module_cache ((struct common_func_s *)(&be->km));NT_LOG (DBG ,FILTER ,"INIT KM RCP" ); -hw_mod_km_rcp_flush (be,0 ,ALL_ENTRIES ); +nthw_mod_km_rcp_flush (be,0 ,ALL_ENTRIES );/* init CAM - all zero */ NT_LOG (DBG ,FILTER ,"INIT KM CAM" ); -hw_mod_km_cam_flush (be,0 ,0 ,ALL_ENTRIES ); +nthw_mod_km_cam_flush (be,0 ,0 ,ALL_ENTRIES );/* init TCAM - all zero */ NT_LOG (DBG ,FILTER ,"INIT KM TCAM" );
@@ -667,14 +669,14 @@ int hw_mod_km_reset(struct flow_api_backend_s *be)/* TCAM entries are cache controlled, * thus need to hard reset initially to sync cache with HW */ -hw_mod_km_tcam_set (be,HW_KM_TCAM_BANK_RESET , i,0 ,0 , tcam_v_set); +nthw_mod_km_tcam_set (be,HW_KM_TCAM_BANK_RESET , i,0 ,0 , tcam_v_set); } -hw_mod_km_tcam_flush (be,0 ,ALL_ENTRIES ); +nthw_mod_km_tcam_flush (be,0 ,ALL_ENTRIES );/* init TCI - all zero */ NT_LOG (DBG ,FILTER ,"INIT KM TCI" ); -hw_mod_km_tci_flush (be,0 ,0 ,ALL_ENTRIES ); +nthw_mod_km_tci_flush (be,0 ,0 ,ALL_ENTRIES );NT_LOG (DBG ,FILTER ,"INIT KM TCQ" );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c +7 -7
@@ -12,12 +12,12 @@#define _MOD_ "PDB"#define _VER_ be->pdb.ver -bool hw_mod_pdb_present (struct flow_api_backend_s *be) +bool nthw_mod_pdb_present (struct flow_api_backend_s *be) {return be->iface->get_pdb_present (be->be_dev); } -int hw_mod_pdb_alloc (struct flow_api_backend_s *be) +int nthw_mod_pdb_alloc (struct flow_api_backend_s *be) {int nb; _VER_ = be->iface->get_pdb_version (be->be_dev);
@@ -50,7 +50,7 @@ int hw_mod_pdb_alloc(struct flow_api_backend_s *be)return 0 ; } -void hw_mod_pdb_free (struct flow_api_backend_s *be) +void nthw_mod_pdb_free (struct flow_api_backend_s *be) {if (be->pdb.base) {free (be->pdb.base);
@@ -58,7 +58,7 @@ void hw_mod_pdb_free(struct flow_api_backend_s *be) } } -int hw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->pdb.nb_pdb_rcp_categories;
@@ -223,7 +223,7 @@ static int hw_mod_pdb_rcp_mod(struct flow_api_backend_s *be, enum hw_pdb_e fieldreturn 0 ; } -int hw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index, +int nthw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index,uint32_t value) {return hw_mod_pdb_rcp_mod (be, field, index, &value,0 );
@@ -234,14 +234,14 @@ static int hw_mod_pdb_config_flush(struct flow_api_backend_s *be)return be->iface->pdb_config_flush (be->be_dev, &be->pdb); } -int hw_mod_pdb_reset (struct flow_api_backend_s *be) +int nthw_mod_pdb_reset (struct flow_api_backend_s *be) {int err =0 ;/* Zero entire cache area */ nthw_zero_module_cache ((struct common_func_s *)(&be->hsh));NT_LOG (DBG ,FILTER ,"INIT PDB RCP" ); - err |=hw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES ); + err |=nthw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES );NT_LOG (DBG ,FILTER ,"INIT PDB CONFIG" ); err |=hw_mod_pdb_config_flush (be);
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c +16 -16
@@ -15,12 +15,12 @@#define QSL_QEN_ENTRIES 32#define QSL_QNMQ_ENTRIES 256 -bool hw_mod_qsl_present (struct flow_api_backend_s *be) +bool nthw_mod_qsl_present (struct flow_api_backend_s *be) {return be->iface->get_qsl_present (be->be_dev); } -int hw_mod_qsl_alloc (struct flow_api_backend_s *be) +int nthw_mod_qsl_alloc (struct flow_api_backend_s *be) {int nb; _VER_ = be->iface->get_qsl_version (be->be_dev);
@@ -64,7 +64,7 @@ int hw_mod_qsl_alloc(struct flow_api_backend_s *be)return 0 ; } -void hw_mod_qsl_free (struct flow_api_backend_s *be) +void nthw_mod_qsl_free (struct flow_api_backend_s *be) {if (be->qsl.base) {free (be->qsl.base);
@@ -72,19 +72,19 @@ void hw_mod_qsl_free(struct flow_api_backend_s *be) } } -int hw_mod_qsl_reset (struct flow_api_backend_s *be) +int nthw_mod_qsl_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ nthw_zero_module_cache ((struct common_func_s *)(&be->qsl));NT_LOG (DBG ,FILTER ,"INIT QSL RCP" ); -hw_mod_qsl_rcp_flush (be,0 ,ALL_ENTRIES ); +nthw_mod_qsl_rcp_flush (be,0 ,ALL_ENTRIES );NT_LOG (DBG ,FILTER ,"INIT QSL QST" ); -hw_mod_qsl_qst_flush (be,0 ,ALL_ENTRIES ); +nthw_mod_qsl_qst_flush (be,0 ,ALL_ENTRIES );NT_LOG (DBG ,FILTER ,"INIT QSL QEN" ); -hw_mod_qsl_qen_flush (be,0 ,ALL_ENTRIES ); +nthw_mod_qsl_qen_flush (be,0 ,ALL_ENTRIES );NT_LOG (DBG ,FILTER ,"INIT QSL UNMQ" ); be->iface->qsl_unmq_flush (be->be_dev, &be->qsl,0 ,256 );
@@ -92,7 +92,7 @@ int hw_mod_qsl_reset(struct flow_api_backend_s *be)return 0 ; } -int hw_mod_qsl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_qsl_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->qsl.nb_rcp_categories;
@@ -206,13 +206,13 @@ static int hw_mod_qsl_rcp_mod(struct flow_api_backend_s *be, enum hw_qsl_e fieldreturn 0 ; } -int hw_mod_qsl_rcp_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_rcp_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value) {return hw_mod_qsl_rcp_mod (be, field, index, &value,0 ); } -int hw_mod_qsl_qst_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_qsl_qst_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->qsl.nb_qst_entries;
@@ -286,13 +286,13 @@ static int hw_mod_qsl_qst_mod(struct flow_api_backend_s *be, enum hw_qsl_e fieldreturn 0 ; } -int hw_mod_qsl_qst_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qst_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value) {return hw_mod_qsl_qst_mod (be, field, index, &value,0 ); } -int hw_mod_qsl_qen_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_qsl_qen_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count =QSL_QEN_ENTRIES ;
@@ -336,19 +336,19 @@ static int hw_mod_qsl_qen_mod(struct flow_api_backend_s *be, enum hw_qsl_e fieldreturn 0 ; } -int hw_mod_qsl_qen_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qen_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value) {return hw_mod_qsl_qen_mod (be, field, index, &value,0 ); } -int hw_mod_qsl_qen_get (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_qen_get (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t *value) {return hw_mod_qsl_qen_mod (be, field, index, value,1 ); } -int hw_mod_qsl_unmq_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_qsl_unmq_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count =QSL_QNMQ_ENTRIES ;
@@ -396,7 +396,7 @@ static int hw_mod_qsl_unmq_mod(struct flow_api_backend_s *be, enum hw_qsl_e fielreturn 0 ; } -int hw_mod_qsl_unmq_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index, +int nthw_mod_qsl_unmq_set (struct flow_api_backend_s *be,enum hw_qsl_e field,uint32_t index,uint32_t value) {return hw_mod_qsl_unmq_mod (be, field, index, &value,0 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_slc_lr.c +7 -7
@@ -11,12 +11,12 @@#define _MOD_ "SLC_LR"#define _VER_ be->slc_lr.ver -bool hw_mod_slc_lr_present (struct flow_api_backend_s *be) +bool nthw_mod_slc_lr_present (struct flow_api_backend_s *be) {return be->iface->get_slc_lr_present (be->be_dev); } -int hw_mod_slc_lr_alloc (struct flow_api_backend_s *be) +int nthw_mod_slc_lr_alloc (struct flow_api_backend_s *be) { _VER_ = be->iface->get_slc_lr_version (be->be_dev);NT_LOG (DBG ,FILTER ,"SLC LR MODULE VERSION %i.%i" ,VER_MAJOR (_VER_),VER_MINOR (_VER_));
@@ -37,7 +37,7 @@ int hw_mod_slc_lr_alloc(struct flow_api_backend_s *be)return 0 ; } -void hw_mod_slc_lr_free (struct flow_api_backend_s *be) +void nthw_mod_slc_lr_free (struct flow_api_backend_s *be) {if (be->slc_lr.base) {free (be->slc_lr.base);
@@ -45,16 +45,16 @@ void hw_mod_slc_lr_free(struct flow_api_backend_s *be) } } -int hw_mod_slc_lr_reset (struct flow_api_backend_s *be) +int nthw_mod_slc_lr_reset (struct flow_api_backend_s *be) {/* Zero entire cache area */ nthw_zero_module_cache ((struct common_func_s *)(&be->slc_lr));NT_LOG (DBG ,FILTER ,"INIT SLC LR RCP" ); -return hw_mod_slc_lr_rcp_flush (be,0 , be->max_categories); +return nthw_mod_slc_lr_rcp_flush (be,0 , be->max_categories); } -int hw_mod_slc_lr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) +int nthw_mod_slc_lr_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES ) count = be->max_categories;
@@ -161,7 +161,7 @@ static int hw_mod_slc_lr_rcp_mod(struct flow_api_backend_s *be, enum hw_slc_lr_ereturn 0 ; } -int hw_mod_slc_lr_rcp_set (struct flow_api_backend_s *be,enum hw_slc_lr_e field,uint32_t index, +int nthw_mod_slc_lr_rcp_set (struct flow_api_backend_s *be,enum hw_slc_lr_e field,uint32_t index,uint32_t value) {return hw_mod_slc_lr_rcp_mod (be, field, index, &value,0 );
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +37 -37
234 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +342 -333
878 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h +23 -23
46 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +146 -145
291 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.45.0
Part of the diff is not shown here. View the raw message.
PATCH 13/24 net/ntnic: modify prefix flow with prefix nthw
In reply to Serhii IliushykChange the prefix flow_ with prefix nthw_flow to specify that the flow API belongs to the Napatech hardware (nthw).
--- drivers/net/ntnic/nthw/flow_api/flow_api.c | 54 +++++---- .../nthw/flow_api/flow_backend/flow_backend.c | 4 +- .../profile_inline/flow_api_profile_inline.c | 113 +++++++++--------- .../profile_inline/flow_api_profile_inline.h | 49 ++++---- drivers/net/ntnic/ntnic_ethdev.c | 2 +- drivers/net/ntnic/ntnic_mod_reg.c | 2 +- drivers/net/ntnic/ntnic_mod_reg.h | 46 +++---- 7 files changed, 141 insertions(+), 129 deletions(-)
drivers/net/ntnic/nthw/flow_api/flow_api.c +28 -26
@@ -299,7 +299,7 @@ static struct flow_handle *flow_create(struct flow_eth_dev *dev __rte_unused,return NULL ; } -return profile_inline_ops->flow_create_profile_inline (dev, attr, +return profile_inline_ops->nthw_flow_create_profile_inline (dev, attr, forced_vlan_vid, caller_id, item, action, error); }
@@ -313,7 +313,7 @@ static int flow_destroy(struct flow_eth_dev *dev __rte_unused,return -1 ; } -return profile_inline_ops->flow_destroy_profile_inline (dev, flow, error); +return profile_inline_ops->nthw_flow_destroy_profile_inline (dev, flow, error); }static int flow_flush (struct flow_eth_dev *dev,uint16_t caller_id,struct rte_flow_error *error)
@@ -325,7 +325,7 @@ static int flow_flush(struct flow_eth_dev *dev, uint16_t caller_id, struct rte_freturn -1 ; } -return profile_inline_ops->flow_flush_profile_inline (dev, caller_id, error); +return profile_inline_ops->nthw_flow_flush_profile_inline (dev, caller_id, error); } static int flow_actions_update(struct flow_eth_dev *dev,
@@ -340,7 +340,8 @@ static int flow_actions_update(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_actions_update_profile_inline (dev, flow, action, error); +return profile_inline_ops->nthw_flow_actions_update_profile_inline (dev, + flow, action, error); }/*
@@ -405,7 +406,7 @@ static int nthw_flow_delete_eth_dev(struct flow_eth_dev *eth_dev)while (flow) {if (flow->dev == eth_dev) {struct flow_handle *flow_next = flow->next; - profile_inline_ops->flow_destroy_locked_profile_inline (eth_dev, flow, + profile_inline_ops->nthw_flow_destroy_locked_profile_inline (eth_dev, flow,NULL ); flow = flow_next;
@@ -471,11 +472,11 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev)"ERROR : Flows still defined but all eth-ports deleted. Flow %p" , ndev->flow_base); - profile_inline_ops->flow_destroy_profile_inline (ndev->flow_base->dev, + profile_inline_ops->nthw_flow_destroy_profile_inline (ndev->flow_base->dev, ndev->flow_base,NULL ); } - profile_inline_ops->done_flow_management_of_ndev_profile_inline (ndev); + profile_inline_ops->nthw_done_flow_mgmnt_of_ndev_profile_inline (ndev);km_free_ndev_resource_management (&ndev->km_res_handle);kcc_free_ndev_resource_management (&ndev->kcc_res_handle);
@@ -656,7 +657,7 @@ static struct flow_eth_dev *flow_get_eth_dev(uint8_t adapter_no, uint8_t port_no/* Initialize modules if needed - recipe 0 is used as no-match and must be setup */ if (profile_inline_ops !=NULL && - profile_inline_ops->initialize_flow_management_of_ndev_profile_inline (ndev)) + profile_inline_ops->nthw_init_flow_mgmnt_of_ndev_profile_inline (ndev)) goto err_exit0; }else {
@@ -1021,7 +1022,8 @@ static int flow_dev_dump(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_dev_dump_profile_inline (dev, flow, caller_id, file, error); +return profile_inline_ops->nthw_flow_dev_dump_profile_inline (dev, + flow, caller_id, file, error); } static int flow_get_aged_flows(struct flow_eth_dev *dev,
@@ -1043,7 +1045,7 @@ static int flow_get_aged_flows(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_get_aged_flows_profile_inline (dev, caller_id, context, +return profile_inline_ops->nthw_flow_get_aged_flows_profile_inline (dev, caller_id, context, nb_contexts, error); }
@@ -1058,7 +1060,7 @@ static int flow_info_get(struct flow_eth_dev *dev, uint8_t caller_id,return -1 ; } -return profile_inline_ops->flow_info_get_profile_inline (dev, caller_id, port_info, +return profile_inline_ops->nthw_flow_info_get_profile_inline (dev, caller_id, port_info, queue_info, error); }
@@ -1073,7 +1075,7 @@ static int flow_configure(struct flow_eth_dev *dev, uint8_t caller_id,return -1 ; } -return profile_inline_ops->flow_configure_profile_inline (dev, caller_id, port_attr, +return profile_inline_ops->nthw_flow_configure_profile_inline (dev, caller_id, port_attr, nb_queue, queue_attr, error); }
@@ -1093,8 +1095,8 @@ flow_pattern_template_create(struct flow_eth_dev *dev,return NULL ; } -return profile_inline_ops->flow_pattern_template_create_profile_inline (dev, template_attr, - caller_id, pattern, error); +return profile_inline_ops->nthw_flow_pattern_template_create_profile_inline (dev, + template_attr, caller_id, pattern, error); } static int flow_pattern_template_destroy(struct flow_eth_dev *dev,
@@ -1108,7 +1110,7 @@ static int flow_pattern_template_destroy(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_pattern_template_destroy_profile_inline (dev, +return profile_inline_ops->nthw_flow_pattern_template_destroy_profile_inline (dev, pattern_template, error); }
@@ -1126,8 +1128,8 @@ flow_actions_template_create(struct flow_eth_dev *dev,return NULL ; } -return profile_inline_ops->flow_actions_template_create_profile_inline (dev, template_attr, - caller_id, actions, masks, error); +return profile_inline_ops->nthw_flow_actions_template_create_profile_inline (dev, + template_attr, caller_id, actions, masks, error); } static int flow_actions_template_destroy(struct flow_eth_dev *dev,
@@ -1141,7 +1143,7 @@ static int flow_actions_template_destroy(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_actions_template_destroy_profile_inline (dev, +return profile_inline_ops->nthw_flow_actions_template_destroy_profile_inline (dev, actions_template, error); }
@@ -1159,7 +1161,7 @@ static struct flow_template_table *flow_template_table_create(struct flow_eth_dereturn NULL ; } -return profile_inline_ops->flow_template_table_create_profile_inline (dev, table_attr, +return profile_inline_ops->nthw_flow_template_table_create_profile_inline (dev, table_attr, forced_vlan_vid, caller_id, pattern_templates, nb_pattern_templates, actions_templates, nb_actions_templates, error); }
@@ -1175,8 +1177,8 @@ static int flow_template_table_destroy(struct flow_eth_dev *dev,return -1 ; } -return profile_inline_ops->flow_template_table_destroy_profile_inline (dev, template_table, - error); +return profile_inline_ops->nthw_flow_template_table_destroy_profile_inline (dev, + template_table, error); } static struct flow_handle *
@@ -1193,7 +1195,7 @@ flow_async_create(struct flow_eth_dev *dev, uint32_t queue_id,return NULL ; } -return profile_inline_ops->flow_async_create_profile_inline (dev, queue_id, op_attr, +return profile_inline_ops->nthw_flow_async_create_profile_inline (dev, queue_id, op_attr, template_table, pattern, pattern_template_index, actions, actions_template_index, user_data, error); }
@@ -1209,8 +1211,8 @@ static int flow_async_destroy(struct flow_eth_dev *dev, uint32_t queue_id,return -1 ; } -return profile_inline_ops->flow_async_destroy_profile_inline (dev, queue_id, op_attr, flow, - user_data, error); +return profile_inline_ops->nthw_flow_async_destroy_profile_inline (dev, queue_id, + op_attr, flow, user_data, error); }int nthw_flow_get_flm_stats (struct flow_nic_dev *ndev,uint64_t *data,uint64_t size) {
@@ -1220,7 +1222,7 @@ int nthw_flow_get_flm_stats(struct flow_nic_dev *ndev, uint64_t *data, uint64_treturn -1 ;if (ndev->flow_profile ==FLOW_ETH_DEV_PROFILE_INLINE ) -return profile_inline_ops->flow_get_flm_stats_profile_inline (ndev, data, size); +return profile_inline_ops->nthw_flow_get_flm_stats_profile_inline (ndev, data, size);return -1 ; }
@@ -1233,7 +1235,7 @@ int nthw_flow_get_ifr_stats(struct flow_nic_dev *ndev, uint64_t *data, uint8_t preturn -1 ;if (ndev->flow_profile ==FLOW_ETH_DEV_PROFILE_INLINE ) { -return profile_inline_ops->flow_get_ifr_stats_profile_inline (ndev, data, +return profile_inline_ops->nthw_flow_get_ifr_stats_profile_inline (ndev, data, port_count); }
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +2 -2
@@ -1972,7 +1972,7 @@ static int free_rx_queue(void *be_dev, int hw_queue)return 0 ; } -const struct flow_api_backend_ops flow_be_iface = { +const struct flow_api_backend_ops nthw_flow_be_iface = {1 , set_debug_mode,
@@ -2248,7 +2248,7 @@ const struct flow_api_backend_ops *nthw_bin_flow_backend_init(nthw_fpga_t *p_fpg be_devs[physical_adapter_no].adapter_no = physical_adapter_no; *dev = (void *)&be_devs[physical_adapter_no]; -return &flow_be_iface; +return &nthw_flow_be_iface; }static void bin_flow_backend_done (void *dev)
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +59 -54
297 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.h +27 -22
135 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +1 -1
@@ -1192,7 +1192,7 @@ static int dev_set_mtu_inline(struct rte_eth_dev *eth_dev, uint16_t mtu)int ret =-1 ;if (internals->type ==PORT_TYPE_PHYSICAL && mtu >=MIN_MTU_INLINE && mtu <=MAX_MTU ) - ret = profile_inline_ops->flow_set_mtu_inline (flw_dev, internals->port, mtu); + ret = profile_inline_ops->nthw_flow_set_mtu_inline (flw_dev, internals->port, mtu);return ret ? -EINVAL :0 ; }
drivers/net/ntnic/ntnic_mod_reg.c +1 -1
@@ -226,7 +226,7 @@ void register_profile_inline_ops(const struct profile_inline_ops *ops)const struct profile_inline_ops *get_profile_inline_ops (void ) {if (profile_inline_ops ==NULL ) -profile_inline_init (); +nthw_profile_inline_init ();return profile_inline_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +23 -23
144 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH 14/24 net/ntnic: change prefix flm to prefix nthw
In reply to Serhii IliushykChange the prefix flm_ to prefix nthw_flm_ to specify that these functions and part of the ntwh (Napatech Hardware).
--- .../flow_api/profile_inline/flm_age_queue.c | 22 ++++---- .../flow_api/profile_inline/flm_age_queue.h | 20 +++---- .../flow_api/profile_inline/flm_lrn_queue.c | 12 ++-- .../flow_api/profile_inline/flm_lrn_queue.h | 12 ++-- .../profile_inline/flow_api_profile_inline.c | 55 ++++++++++--------- drivers/net/ntnic/ntnic_ethdev.c | 6 +- 6 files changed, 64 insertions(+), 63 deletions(-)
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_age_queue.c +11 -11
@@ -13,22 +13,22 @@static struct rte_ring *age_queue[MAX_EVT_AGE_QUEUES ];static RTE_ATOMIC (uint16_t ) age_event[MAX_EVT_AGE_PORTS ]; -__rte_always_inline int flm_age_event_get(uint8_t port) +__rte_always_inline int nthw_flm_age_event_get(uint8_t port) {return rte_atomic_load_explicit (&age_event[port], rte_memory_order_seq_cst); } -__rte_always_inline void flm_age_event_set(uint8_t port) +__rte_always_inline void nthw_flm_age_event_set(uint8_t port) {rte_atomic_store_explicit (&age_event[port],1 , rte_memory_order_seq_cst); } -__rte_always_inline void flm_age_event_clear(uint8_t port) +__rte_always_inline void nthw_flm_age_event_clear(uint8_t port) {rte_atomic_store_explicit (&age_event[port],0 , rte_memory_order_seq_cst); } -void flm_age_queue_free (uint8_t port,uint16_t caller_id) +void nthw_flm_age_queue_free (uint8_t port,uint16_t caller_id) {struct rte_ring *q =NULL ;
@@ -43,17 +43,17 @@ void flm_age_queue_free(uint8_t port, uint16_t caller_id)rte_ring_free (q); } -void flm_age_queue_free_all (void ) +void nthw_flm_age_queue_free_all (void ) {int i;int j;for (i =0 ; i <MAX_EVT_AGE_PORTS ; i++)for (j =0 ; j <MAX_EVT_AGE_QUEUES ; j++) -flm_age_queue_free (i, j); +nthw_flm_age_queue_free (i, j); } -struct rte_ring *flm_age_queue_create (uint8_t port,uint16_t caller_id,unsigned int count) +struct rte_ring *nthw_flm_age_queue_create (uint8_t port,uint16_t caller_id,unsigned int count) {char name[20 ];struct rte_ring *q =NULL ;
@@ -112,7 +112,7 @@ struct rte_ring *flm_age_queue_create(uint8_t port, uint16_t caller_id, unsignedreturn q; } -void flm_age_queue_put (uint16_t caller_id,struct flm_age_event_s *obj) +void nthw_flm_age_queue_put (uint16_t caller_id,struct flm_age_event_s *obj) {int ret;
@@ -125,7 +125,7 @@ void flm_age_queue_put(uint16_t caller_id, struct flm_age_event_s *obj) } } -int flm_age_queue_get (uint16_t caller_id,struct flm_age_event_s *obj) +int nthw_flm_age_queue_get (uint16_t caller_id,struct flm_age_event_s *obj) {int ret;
@@ -142,7 +142,7 @@ int flm_age_queue_get(uint16_t caller_id, struct flm_age_event_s *obj)return -ENOENT ; } -unsigned int flm_age_queue_count (uint16_t caller_id) +unsigned int nthw_flm_age_queue_count (uint16_t caller_id) {unsigned int ret =0 ;
@@ -152,7 +152,7 @@ unsigned int flm_age_queue_count(uint16_t caller_id)return ret; } -unsigned int flm_age_queue_get_size (uint16_t caller_id) +unsigned int nthw_flm_age_queue_get_size (uint16_t caller_id) {unsigned int ret =0 ;
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_age_queue.h +10 -10
@@ -28,15 +28,15 @@ struct flm_age_event_s {#define FLM_AGE_ELEM_SIZE sizeof(struct flm_age_event_s) -int flm_age_event_get (uint8_t port); -void flm_age_event_set (uint8_t port); -void flm_age_event_clear (uint8_t port); -void flm_age_queue_free (uint8_t port,uint16_t caller_id); -void flm_age_queue_free_all (void ); -struct rte_ring *flm_age_queue_create (uint8_t port,uint16_t caller_id,unsigned int count); -void flm_age_queue_put (uint16_t caller_id,struct flm_age_event_s *obj); -int flm_age_queue_get (uint16_t caller_id,struct flm_age_event_s *obj); -unsigned int flm_age_queue_count (uint16_t caller_id); -unsigned int flm_age_queue_get_size (uint16_t caller_id); +int nthw_flm_age_event_get (uint8_t port); +void nthw_flm_age_event_set (uint8_t port); +void nthw_flm_age_event_clear (uint8_t port); +void nthw_flm_age_queue_free (uint8_t port,uint16_t caller_id); +void nthw_flm_age_queue_free_all (void ); +struct rte_ring *nthw_flm_age_queue_create (uint8_t port,uint16_t caller_id,unsigned int count); +void nthw_flm_age_queue_put (uint16_t caller_id,struct flm_age_event_s *obj); +int nthw_flm_age_queue_get (uint16_t caller_id,struct flm_age_event_s *obj); +unsigned int nthw_flm_age_queue_count (uint16_t caller_id); +unsigned int nthw_flm_age_queue_get_size (uint16_t caller_id);#endif /* _FLM_AGE_QUEUE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.c +6 -6
@@ -16,7 +16,7 @@#define ELEM_SIZE sizeof(struct flm_v25_lrn_data_s) -void *flm_lrn_queue_create (void ) +void *nthw_flm_lrn_queue_create (void ) {static_assert ((ELEM_SIZE & ~(size_t )3 ) ==ELEM_SIZE ,"FLM LEARN struct size" ); struct rte_ring *q = rte_ring_create_elem("RFQ",
@@ -28,24 +28,24 @@ void *flm_lrn_queue_create(void)return q; } -void flm_lrn_queue_free (void *q) +void nthw_flm_lrn_queue_free (void *q) {rte_ring_free (q); } -uint32_t *flm_lrn_queue_get_write_buffer (void *q) +uint32_t *nthw_flm_lrn_queue_get_write_buffer (void *q) {struct rte_ring_zc_data zcd;unsigned int n =rte_ring_enqueue_zc_burst_elem_start (q,ELEM_SIZE ,1 , &zcd,NULL );return (n ==0 ) ?NULL : zcd.ptr1; } -void flm_lrn_queue_release_write_buffer (void *q) +void nthw_flm_lrn_queue_release_write_buffer (void *q) {rte_ring_enqueue_zc_elem_finish (q,1 ); } -read_record flm_lrn_queue_get_read_buffer (void *q) +read_record nthw_flm_lrn_queue_get_read_buffer (void *q) {struct rte_ring_zc_data zcd;read_record rr;
@@ -62,7 +62,7 @@ read_record flm_lrn_queue_get_read_buffer(void *q)return rr; } -void flm_lrn_queue_release_read_buffer (void *q,uint32_t num) +void nthw_flm_lrn_queue_release_read_buffer (void *q,uint32_t num) {rte_ring_dequeue_zc_elem_finish (q, num); }
drivers/net/ntnic/nthw/flow_api/profile_inline/flm_lrn_queue.h +6 -6
@@ -13,13 +13,13 @@ typedef struct read_record { uint32_t num; } read_record; -void *flm_lrn_queue_create (void ); -void flm_lrn_queue_free (void *q); +void *nthw_flm_lrn_queue_create (void ); +void nthw_flm_lrn_queue_free (void *q); -uint32_t *flm_lrn_queue_get_write_buffer (void *q); -void flm_lrn_queue_release_write_buffer (void *q); +uint32_t *nthw_flm_lrn_queue_get_write_buffer (void *q); +void nthw_flm_lrn_queue_release_write_buffer (void *q); -read_record flm_lrn_queue_get_read_buffer (void *q); -void flm_lrn_queue_release_read_buffer (void *q,uint32_t num); +read_record nthw_flm_lrn_queue_get_read_buffer (void *q); +void nthw_flm_lrn_queue_release_read_buffer (void *q,uint32_t num);#endif /* _FLM_LRN_QUEUE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +28 -27
204 lines not on this page · raw message
drivers/net/ntnic/ntnic_ethdev.c +3 -3
@@ -1547,7 +1547,7 @@ drv_deinit(struct drv_s *p_drv)/* Free all remote flm event queues */ nthw_flm_inf_sta_queue_free_all (FLM_INFO_REMOTE );/* Free all aged flow event queues */ -flm_age_queue_free_all (); +nthw_flm_age_queue_free_all (); }/* stop adapter */
@@ -1981,7 +1981,7 @@ static int port_event_service(void *context)/* Note: RTE_FLOW_PORT_FLAG_STRICT_QUEUE flag is not supported so * event is always generated */ -int aged_event_count =flm_age_event_get (port_no); +int aged_event_count =nthw_flm_age_event_get (port_no); if (aged_event_count > 0 && eth_dev[port_no] &&
@@ -1990,7 +1990,7 @@ static int port_event_service(void *context)rte_eth_dev_callback_process (eth_dev[port_no],RTE_ETH_EVENT_FLOW_AGED ,NULL ); -flm_age_event_clear (port_no); +nthw_flm_age_event_clear (port_no); do_wait = false; }
Signature · 1 line
2.45.0
PATCH 15/24 net/ntnic: change prefix nt to prefix nthw
In reply to Serhii Iliushykchange prefix nt_ to prefix nthw_ to specify that this is related to Napatech hardware.
--- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 2 +- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 12 ++--- .../link_agx_100g/nt4ga_agx_link_100g.c | 16 +++---- drivers/net/ntnic/nim/i2c_nim.c | 4 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 2 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 18 ++++---- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 32 ++++++------- drivers/net/ntnic/nthw/core/nthw_fpga.c | 2 +- drivers/net/ntnic/nthw/core/nthw_i2cm.c | 4 +- drivers/net/ntnic/nthw/core/nthw_igam.c | 4 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 2 +- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 6 +-- drivers/net/ntnic/nthw/core/nthw_phy_tile.c | 46 +++++++++---------- .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 2 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 4 +- drivers/net/ntnic/nthw/core/nthw_spi_v3.c | 12 ++--- .../profile_inline/flow_api_profile_inline.c | 18 ++++---- .../net/ntnic/nthw/model/nthw_fpga_model.c | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 8 ++-- drivers/net/ntnic/ntnic_ethdev.c | 42 +++++++++-------- drivers/net/ntnic/ntnic_vfio.c | 16 +++---- drivers/net/ntnic/ntnic_vfio.h | 10 ++-- drivers/net/ntnic/ntutil/nt_util.c | 22 ++++----- drivers/net/ntnic/ntutil/nt_util.h | 18 ++++---- 25 files changed, 154 insertions(+), 152 deletions(-)
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
@@ -128,7 +128,7 @@ static int nt4ga_stat_setup(struct adapter_info_s *p_adapter_info)int numa_node = p_adapter_info->fpga_info.numa_node;/* FPGA needs a 16K alignment on Statistics */ - p_dma =nt_dma_alloc (n_stat_size,0x4000 , numa_node); + p_dma =nthw_dma_alloc (n_stat_size,0x4000 , numa_node);if (!p_dma) {NT_LOG_DBGX (ERR ,NTNIC ,"p_dma alloc failed" );
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +1 -1
@@ -485,7 +485,7 @@ static int dbs_wait_hw_queue_shutdown(struct nthw_virt_queue *vq, int rx)if (err) {if (err == -ENOTSUP ) { -nt_os_wait_usec (200000 ); +nthw_os_wait_usec (200000 );return 0 ; }
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +6 -6
@@ -50,9 +50,9 @@ static int _reset_rx(adapter_info_t *drv, nthw_mac_pcs_t *mac_pcs) (void )drv;nthw_mac_pcs_rx_path_rst (mac_pcs, true); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ nthw_mac_pcs_rx_path_rst (mac_pcs, false); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ return 0 ; }
@@ -110,7 +110,7 @@ static void _set_loopback(struct adapter_info_s *p_adapter_info,/* After changing the loopback the system must be properly reset */ _reset_rx (p_adapter_info, mac_pcs); -nt_os_wait_usec (10000 );/* 10ms - arbitrary choice */ +nthw_os_wait_usec (10000 );/* 10ms - arbitrary choice */ if (!nthw_mac_pcs_is_rx_path_rst (mac_pcs)) {nthw_mac_pcs_reset_bip_counters (mac_pcs);
@@ -286,14 +286,14 @@ static int _create_nim(adapter_info_t *drv, int port, bool enable)*/ NT_LOG (DBG ,NTNIC ,"%s: Performing NIM reset" , drv->mp_port_id_str[port]);nthw_gpio_phy_set_reset (gpio_phy, (uint8_t )port, true); -nt_os_wait_usec (100000 );/* pause 0.1s */ +nthw_os_wait_usec (100000 );/* pause 0.1s */ nthw_gpio_phy_set_reset (gpio_phy, (uint8_t )port, false);/* * Wait a little after a module has been inserted before trying to access I2C * data, otherwise the module will not respond correctly. */ -nt_os_wait_usec (1000000 );/* pause 1.0s */ +nthw_os_wait_usec (1000000 );/* pause 1.0s */ if (!_nim_is_present (gpio_phy, (uint8_t )port)) { NT_LOG(DBG, NTNIC, "%s: NIM module is no longer absent!",
@@ -650,7 +650,7 @@ static int _common_ptp_nim_state_machine(void *data) }/* end-for */ if (rte_service_runstate_get (adapter_mon_srv->id)) -nt_os_wait_usec (5 *100000U );/* 5 x 0.1s = 0.5s */ +nthw_os_wait_usec (5 *100000U );/* 5 x 0.1s = 0.5s */ return 0 ; }
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +8 -8
@@ -93,17 +93,17 @@ static void phy_tx_path_rst(adapter_info_t *drv, int port, bool reset)static void phy_reset_rx (adapter_info_t *drv,int port) {phy_rx_path_rst (drv, port, true); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ phy_rx_path_rst (drv, port, false); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ }static void phy_reset_tx (adapter_info_t *drv,int port) {phy_tx_path_rst (drv, port, true); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ phy_tx_path_rst (drv, port, false); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ }static int phy_set_host_loopback (adapter_info_t *drv,int port,loopback_host_t loopback)
@@ -499,7 +499,7 @@ set_loopback(struct adapter_info_s *p_adapter_info, int port, uint32_t mode, uin/* After changing the loopback the system must be properly reset */ phy_reset_rx (p_adapter_info, port);phy_reset_tx (p_adapter_info, port); -nt_os_wait_usec (10000 );/* 10ms - arbitrary choice */ +nthw_os_wait_usec (10000 );/* 10ms - arbitrary choice */ }static void port_disable (adapter_info_t *drv,int port)
@@ -547,14 +547,14 @@ static int create_nim(adapter_info_t *drv, int port, bool enable)NT_LOG (DBG ,NTNIC ,"%s: Performing NIM reset" , drv->mp_port_id_str[port]);nim_set_reset (nim_ctx, (uint8_t )port, true); -nt_os_wait_usec (100000 );/* pause 0.1s */ +nthw_os_wait_usec (100000 );/* pause 0.1s */ nim_set_reset (nim_ctx, (uint8_t )port, false);/* * Wait a little after a module has been inserted before trying to access I2C * data, otherwise the module will not respond correctly. */ -nt_os_wait_usec (1000000 );/* pause 1.0s */ +nthw_os_wait_usec (1000000 );/* pause 1.0s */ res =nthw_construct_and_preinit_nim (nim_ctx,NULL );
@@ -941,7 +941,7 @@ static int _common_ptp_nim_state_machine(void *data) }if (rte_service_runstate_get (adapter_mon_srv->id)) -nt_os_wait_usec (5 *100000U );/* 5 x 0.1s = 0.5s */ +nthw_os_wait_usec (5 *100000U );/* 5 x 0.1s = 0.5s */ return 0 ; }
drivers/net/ntnic/nim/i2c_nim.c +2 -2
@@ -704,7 +704,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)* Probably because access to the paged address space is required. */ if (!init_complete_flag_present) { -nt_os_wait_usec (500000 ); +nthw_os_wait_usec (500000 );return ; }
@@ -724,7 +724,7 @@ static void qsfp28_wait_for_ready_after_reset(nim_i2c_ctx_p ctx)break ; } -nt_os_wait_usec (100000 );/* 100 ms */ +nthw_os_wait_usec (100000 );/* 100 ms */ count++; } }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
@@ -197,7 +197,7 @@ static int nthw_fpga_rst_nt200a0x_wait_sdc_calibrated(nthw_fpga_t *p_fpga,* reset DDR and perform calibration retry */ nthw_field_set_flush (p->mp_fld_rst_ddr4);/* Reset DDR PLL */ -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 );nthw_field_clr_flush (p->mp_fld_rst_ddr4); n_retry_cnt++;
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +9 -9
@@ -150,7 +150,7 @@ static int nthw_fpga_rst9574_wait_ddr4_calibration_complete(struct fpga_info_s * complete =nthw_fpga_rst9574_get_ddr4_calib_complete_stat (p_rst);if (!complete) -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 ); timeout--;
@@ -187,7 +187,7 @@ static int nthw_fpga_rst9574_wait_phy_ftile_rdy(struct fpga_info_s *p_fpga_info, complete =nthw_fpga_rst9574_get_phy_ftile_rdy_stat (p_rst);if (!complete) { -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 ); }else { NT_LOG(DBG, NTHW, "%s: PHY FTILE ready, margin to timeout %u",
@@ -221,7 +221,7 @@ static int nthw_fpga_rst9574_wait_phy_ftile_rst_done(struct fpga_info_s *p_fpga_ complete =nthw_fpga_rst9574_get_phy_ftile_rst_done_stat (p_rst);if (!complete) -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 ); timeout--;
@@ -251,7 +251,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,/* * Wait a while before waiting for deasserting ddr4 reset */ -nt_os_wait_usec (2000 ); +nthw_os_wait_usec (2000 );/* (1) De-RTE_ASSERT DDR4 reset: */ NT_LOG (DBG ,NTHW ,"%s: %s: De-asserting DDR4 reset" , p_adapter_id_str, __func__);
@@ -261,7 +261,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,* Wait a while before waiting for calibration complete, since calibration complete * is true while ddr4 is in reset */ -nt_os_wait_usec (2000 ); +nthw_os_wait_usec (2000 );/* (2) Wait until DDR4 calibration complete */ res =nthw_fpga_rst9574_wait_ddr4_calibration_complete (p_fpga_info, p_rst);
@@ -273,7 +273,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,nthw_fpga_rst9574_set_ddr4_calib_complete_latch (p_rst,1 );/* Wait for phy to settle.*/ -nt_os_wait_usec (20000 ); +nthw_os_wait_usec (20000 );/* (4) Ensure all latched status bits are still set: */ if (!nthw_fpga_rst9574_get_ddr4_calib_complete_latch (p_rst)) {
@@ -301,7 +301,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info, __func__);nthw_fpga_rst9574_phy_ftile_rst (p_rst,0 ); -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 );/* (7) Wait until PHY_FTILE ready */ if (nthw_fpga_rst9574_wait_phy_ftile_rdy (p_fpga_info, p_rst) !=-1 ) { success = true;
@@ -331,7 +331,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,int32_t count =1000 ;do { -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 ); }while (!nthw_phy_tile_get_port_status_reset_ack (p_phy_tile, i) && (--count >0 ));
@@ -343,7 +343,7 @@ static int nthw_fpga_rst9574_product_reset(struct fpga_info_s *p_fpga_info,/* Active low */ nthw_phy_tile_set_port_config_rst (p_phy_tile, i,1 ); -nt_os_wait_usec (20000 ); +nthw_os_wait_usec (20000 ); } }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +16 -16
@@ -58,13 +58,13 @@ static int nthw_fpga_rst_nt400dxx_init(struct fpga_info_s *p_fpga_info)/* (b1) Reset platform. It is released later */ nthw_prm_nt400dxx_platform_rst (p_fpga_info->mp_nthw_agx.p_prm,1 ); -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 );/* (C) Reset peripherals and release the reset */ nthw_prm_nt400dxx_periph_rst (p_fpga_info->mp_nthw_agx.p_prm,1 ); -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 );nthw_prm_nt400dxx_periph_rst (p_fpga_info->mp_nthw_agx.p_prm,0 ); -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 ); res =nthw_fpga_avr_probe (p_fpga,0 );
@@ -155,7 +155,7 @@ static int nthw_fpga_rst_nt400dxx_init(struct fpga_info_s *p_fpga_info)/* Enable power supply to NIMs */ nthw_pcal6416a_write (p_fpga_info->mp_nthw_agx.p_io_nim,8 ,1 ); -nt_os_wait_usec (100000 );/* 100ms */ +nthw_os_wait_usec (100000 );/* 100ms */ /* Check that power supply turned on. Warn if it didn't. */ uint8_t port_power_ok;
@@ -225,7 +225,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)/* (F) Check that the system PLL is ready. */ for (int i =1000 ; i >=0 ; i--) { -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 ); data =nthw_igam_read (p_igam,0xffff4 );if (data ==0x80000000 || data ==0xA0000000 ) {
@@ -251,7 +251,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)nthw_igam_set_ctrl_forward_rst (p_igam,0 );/* Ensure that the Avalon bus is not */ /* reset at every driver re-load. */ -nt_os_wait_usec (1000000 ); +nthw_os_wait_usec (1000000 );NT_LOG (DBG ,NTHW ,"%s: IGAM module not used." , p_adapter_id_str); }
@@ -267,14 +267,14 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)if (p_fpga_info->mp_nthw_agx.tcxo_present && p_fpga_info->mp_nthw_agx.tcxo_capable) {nthw_pcm_nt400dxx_set_ts_pll_recal (p_pcm,1 ); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );nthw_pcm_nt400dxx_set_ts_pll_recal (p_pcm,0 ); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 ); }/* (I) Wait for TS PLL locked. */ for (int i =1000 ; i >=0 ; i--) { -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );if (nthw_pcm_nt400dxx_get_ts_pll_locked_stat (p_pcm))break ;
@@ -320,9 +320,9 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)if (res ==0 )NT_LOG (DBG ,NTHW ,"%s: Hif module found" , p_fpga_info->mp_adapter_id_str); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );nthw_hif_force_soft_reset (p_nthw_hif); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );nthw_hif_delete (p_nthw_hif);/* (L) De-RTE_ASSERT platform reset. */
@@ -354,7 +354,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)/* (F) Check that the system PLL is ready. */ for (int i =1000 ; i >=0 ; i--) { -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );if (nthw_phy_tile_get_sys_pll_get_rdy (p_phy_tile) &&nthw_phy_tile_get_sys_pll_system_pll_lock (p_phy_tile)) {
@@ -363,7 +363,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)if (i ==500 ) {nthw_phy_tile_set_sys_pll_force_rst (p_phy_tile,1 ); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );nthw_phy_tile_set_sys_pll_force_rst (p_phy_tile,0 ); NT_LOG_DBGX(DBG, NTHW,
@@ -380,13 +380,13 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info) } } -nt_os_wait_usec (100000 );/* 100 ms */ +nthw_os_wait_usec (100000 );/* 100 ms */ uint32_t fgt_enable =0x0d ;/* FGT 0, 2 & 3 */ nthw_phy_tile_set_sys_pll_en_ref_clk_fgt (p_phy_tile, fgt_enable);for (int i =1000 ; i >=0 ; i--) { -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );if (nthw_phy_tile_get_sys_pll_ref_clk_fgt_enabled (p_phy_tile) == fgt_enable) {
@@ -395,7 +395,7 @@ static int nthw_fpga_rst_nt400dxx_reset(struct fpga_info_s *p_fpga_info)if (i ==500 ) {nthw_phy_tile_set_sys_pll_force_rst (p_phy_tile,1 ); -nt_os_wait_usec (1000 ); +nthw_os_wait_usec (1000 );nthw_phy_tile_set_sys_pll_force_rst (p_phy_tile,0 ); NT_LOG_DBGX(DBG, NTHW,
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
@@ -537,7 +537,7 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)NT_LOG (DBG ,NTHW ,"%s: TSM time: %016" PRIX64 " %016" PRIX64 "\n" , p_adapter_id_str, n_time, n_ts); - nt_os_wait_usec(1000); + nthw_os_wait_usec(1000); } }#endif
drivers/net/ntnic/nthw/core/nthw_i2cm.c +2 -2
@@ -102,7 +102,7 @@ int nthw_i2cm_init(nthw_i2cm_t *p, nthw_fpga_t *p_fpga, int n_i2c_instance) NT_I2C_CMD_STOP | NT_I2C_CMD_NACK);NT_LOG (INF ,NTHW ,"%s: %s init done" , p_adapter_id_str, __PRETTY_FUNCTION__); -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 );/* Initialize mutex */ rte_spinlock_init (&p->i2cmmutex);
@@ -118,7 +118,7 @@ static bool nthw_i2cm_ready(nthw_i2cm_t *p, bool wait_for_ack)uint32_t status =nthw_field_get_updated (p->mp_fld_cmd_status_cmd_status);uint32_t ready = (status & flags) ==0U ;/* MUST have a short break to avoid time-outs, even if ready == true */ -nt_os_wait_usec (SLEEP_USECS ); +nthw_os_wait_usec (SLEEP_USECS );if (ready)return true;
drivers/net/ntnic/nthw/core/nthw_igam.c +2 -2
@@ -68,7 +68,7 @@ uint32_t nthw_igam_read(nthw_igam_t *p, uint32_t address)nthw_field_set_val_flush32 (p->mp_fld_base_ptr, address);while (nthw_field_get_updated (p->mp_fld_base_busy) ==1 ) -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 );return nthw_field_get_updated (p->mp_fld_data_data); }
@@ -81,7 +81,7 @@ void nthw_igam_write(nthw_igam_t *p, uint32_t address, uint32_t data)nthw_field_set_val_flush32 (p->mp_fld_base_cmd,1 );while (nthw_field_get_updated (p->mp_fld_base_busy) ==1 ) -nt_os_wait_usec (100 ); +nthw_os_wait_usec (100 ); }void nthw_igam_set_ctrl_forward_rst (nthw_igam_t *p,uint32_t value)
drivers/net/ntnic/nthw/core/nthw_iic.c +1 -1
@@ -14,7 +14,7 @@#define I2C_TRANSMIT_WR (0x00)#define I2C_TRANSMIT_RD (0x01) -#define I2C_WAIT_US (x) nt_os_wait_usec(x) +#define I2C_WAIT_US (x) nthw_os_wait_usec(x)/* * Minimum timing values for I2C for a Marvel 88E11111 Phy.
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +3 -3
@@ -588,11 +588,11 @@ void nthw_mac_pcs_set_fec(nthw_mac_pcs_t *p, bool enable)/* Both Rx and Tx must be reset for new FEC state to become active */ nthw_mac_pcs_rx_path_rst (p, true);nthw_mac_pcs_tx_path_rst (p, true); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ nthw_mac_pcs_rx_path_rst (p, false);nthw_mac_pcs_tx_path_rst (p, false); -nt_os_wait_usec (10000 );/* 10ms */ +nthw_os_wait_usec (10000 );/* 10ms */ }bool nthw_mac_pcs_get_fec_bypass (nthw_mac_pcs_t *p)
@@ -740,7 +740,7 @@ void nthw_mac_pcs_set_receiver_equalization_mode(nthw_mac_pcs_t *p, uint8_t modenthw_field_set_val32 (p->mp_field_gty_ctl_rx_equa_rst2,1 );nthw_field_set_val_flush32 (p->mp_field_gty_ctl_rx_equa_rst3,1 ); -nt_os_wait_usec (1000 );/* 1ms */ +nthw_os_wait_usec (1000 );/* 1ms */ nthw_field_set_val32 (p->mp_field_gty_ctl_rx_equa_rst0,0 );nthw_field_set_val32 (p->mp_field_gty_ctl_rx_equa_rst1,0 );
drivers/net/ntnic/nthw/core/nthw_phy_tile.c +23 -23
164 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +1 -1
@@ -42,7 +42,7 @@ int nthw_pca9849_set_channel(nthw_pca9849_t *p, uint8_t channel)return res; p->m_current_channel = channel; -nt_os_wait_usec (10000 ); +nthw_os_wait_usec (10000 ); }return 0 ;
drivers/net/ntnic/nthw/core/nthw_si5340.c +2 -2
@@ -121,7 +121,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,if (addr ==0x0006 ) {/* Wait 300ms before continuing. See NT200E3-2-PTP_U23_Si5340_adr0_v2.h */ -nt_os_wait_usec (300000 ); +nthw_os_wait_usec (300000 ); }nthw_si5340_write (p, addr, value);
@@ -167,7 +167,7 @@ static int nthw_si5340_config(nthw_si5340_t *p, const void *p_data, int data_cntbreak ; } -nt_os_wait_usec (1000000 );/* 1 sec */ +nthw_os_wait_usec (1000000 );/* 1 sec */ }if (!success) {
drivers/net/ntnic/nthw/core/nthw_spi_v3.c +6 -6
@@ -39,10 +39,10 @@ static int wait_for_tx_data_sent(nthw_spim_t *p_spim_mod, uint64_t time_out)bool empty;uint64_t start_time;uint64_t cur_time; - start_time =nt_os_get_time_monotonic_counter (); + start_time =nthw_os_get_time_monotonic_counter ();while (true) { -nt_os_wait_usec (1000 );/* Every 1ms */ +nthw_os_wait_usec (1000 );/* Every 1ms */ result =nthw_spim_get_tx_fifo_empty (p_spim_mod, &empty);
@@ -54,7 +54,7 @@ static int wait_for_tx_data_sent(nthw_spim_t *p_spim_mod, uint64_t time_out)if (empty)break ; - cur_time =nt_os_get_time_monotonic_counter (); + cur_time =nthw_os_get_time_monotonic_counter ();if ((cur_time - start_time) > time_out) {NT_LOG (WRN ,NTHW ,"%s: Timed out" , __func__);
@@ -74,11 +74,11 @@ static int wait_for_rx_data_ready(nthw_spis_t *p_spis_mod, uint64_t time_out)bool empty;uint64_t start_time;uint64_t cur_time; - start_time =nt_os_get_time_monotonic_counter (); + start_time =nthw_os_get_time_monotonic_counter ();/* Wait for data to become ready in the Rx FIFO */ while (true) { -nt_os_wait_usec (10000 );/* Every 10ms */ +nthw_os_wait_usec (10000 );/* Every 10ms */ result =nthw_spis_get_rx_fifo_empty (p_spis_mod, &empty);
@@ -90,7 +90,7 @@ static int wait_for_rx_data_ready(nthw_spis_t *p_spis_mod, uint64_t time_out)if (!empty)break ; - cur_time =nt_os_get_time_monotonic_counter (); + cur_time =nthw_os_get_time_monotonic_counter ();if ((cur_time - start_time) > time_out) {NT_LOG (WRN ,NTHW ,"%s: Timed out" , __func__);
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +9 -9
@@ -197,7 +197,7 @@ static int flow_mtr_create_meter(struct flow_eth_dev *dev,nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);while (learn_record ==NULL ) { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); learn_record = (struct flm_v25_lrn_data_s *)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);
@@ -255,7 +255,7 @@ static int flow_mtr_probe_meter(struct flow_eth_dev *dev, uint8_t caller_id, uinnthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);while (learn_record ==NULL ) { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); learn_record = (struct flm_v25_lrn_data_s *)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);
@@ -295,7 +295,7 @@ static int flow_mtr_destroy_meter(struct flow_eth_dev *dev, uint8_t caller_id, unthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);while (learn_record ==NULL ) { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); learn_record = (struct flm_v25_lrn_data_s *)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);
@@ -348,7 +348,7 @@ static int flm_mtr_adjust_stats(struct flow_eth_dev *dev, uint8_t caller_id, uinnthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);while (learn_record ==NULL ) { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); learn_record = (struct flm_v25_lrn_data_s *)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);
@@ -644,7 +644,7 @@ static int flm_sdram_calibrate(struct flow_nic_dev *ndev)if (fail_value !=0 )break ; -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); }if (!success) {
@@ -685,7 +685,7 @@ static int flm_sdram_reset(struct flow_nic_dev *ndev, int enable)break ; } -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); }if (!success) {
@@ -709,7 +709,7 @@ static int flm_sdram_reset(struct flow_nic_dev *ndev, int enable)break ; } -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); }if (!success) {
@@ -976,7 +976,7 @@ static int flm_flow_programming(struct flow_handle *fh, uint32_t flm_op)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);while (learn_record ==NULL ) { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); learn_record = (struct flm_v25_lrn_data_s *)nthw_flm_lrn_queue_get_write_buffer (flm_lrn_queue_arr);
@@ -5274,7 +5274,7 @@ struct flow_handle *nthw_flow_async_create_profile_inline(struct flow_eth_dev *d }else {do { -nt_os_wait_usec (1 ); +nthw_os_wait_usec (1 ); status =atomic_load (&pattern_action_pair->status); }while (status ==CELL_STATUS_INITIALIZING );
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +1 -1
@@ -1060,7 +1060,7 @@ static int nthw_field_wait_cond32(const nthw_field_t *p, enum nthw_field_match eif (n_poll_iterations <=0 )return -1 ; -nt_os_wait_usec (n_poll_interval); +nthw_os_wait_usec (n_poll_interval); }return 0 ;
drivers/net/ntnic/nthw/nthw_rac.c +4 -4
@@ -326,7 +326,7 @@ int nthw_rac_rab_setup(nthw_rac_t *p)const struct fpga_info_s *const p_fpga_info = p->mp_fpga->p_fpga_info;uint32_t n_dma_buf_size =2L *RAB_DMA_BUF_CNT *sizeof (uint32_t ); -const size_t align_size =nt_util_align_size (n_dma_buf_size); +const size_t align_size =nthw_util_align_size (n_dma_buf_size);int numa_node = p_fpga_info->numa_node;uint64_t dma_addr;uint32_t buf;
@@ -334,10 +334,10 @@ int nthw_rac_rab_setup(nthw_rac_t *p)if (!p->m_dma) {struct nt_dma_s *vfio_dma;/* FPGA needs Page alignment (4K) */ - vfio_dma =nt_dma_alloc (align_size,0x1000 , numa_node); + vfio_dma =nthw_dma_alloc (align_size,0x1000 , numa_node);if (vfio_dma ==NULL ) { -NT_LOG (ERR ,NTNIC ,"nt_dma_alloc failed" ); +NT_LOG (ERR ,NTNIC ,"nthw_dma_alloc failed" );return -1 ; }
@@ -418,7 +418,7 @@ static int nthw_rac_rab_dma_wait(nthw_rac_t *p)uint32_t i;for (i =0 ; i <RAB_DMA_WAIT ; i++) { -nt_os_wait_usec_poll (1 ); +nthw_os_wait_usec_poll (1 );if ((p->m_dma_out_buf[p->m_dma_out_ptr_rd] & completion) == completion)break ;
drivers/net/ntnic/ntnic_ethdev.c +22 -20
159 lines not on this page · raw message
drivers/net/ntnic/ntnic_vfio.c +8 -8
@@ -47,7 +47,7 @@ vfio_get(int vf_num)/* External API */ int -nt_vfio_setup (struct rte_pci_device *dev) +nthw_vfio_setup (struct rte_pci_device *dev) {int ret;char devname[RTE_DEV_NAME_MAX_LEN ] = {0 };
@@ -123,7 +123,7 @@ nt_vfio_setup(struct rte_pci_device *dev) }int -nt_vfio_remove (int vf_num) +nthw_vfio_remove (int vf_num) {struct vfio_dev *vfio;
@@ -141,7 +141,7 @@ nt_vfio_remove(int vf_num) }int -nt_vfio_dma_map (int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size) +nthw_vfio_dma_map (int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size) {uint64_t gp_virt_base;uint64_t gp_offset;
@@ -189,7 +189,7 @@ nt_vfio_dma_map(int vf_num, void *virt_addr, uint64_t *iova_addr, uint64_t size) }int -nt_vfio_dma_unmap (int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size) +nthw_vfio_dma_unmap (int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size) {uint64_t gp_virt_base;struct vfio_dev *vfio;
@@ -225,10 +225,10 @@ nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size }void -nt_vfio_init (void ) +nthw_vfio_init (void ) { -struct nt_util_vfio_impl s = { .vfio_dma_map = nt_vfio_dma_map, - .vfio_dma_unmap = nt_vfio_dma_unmap +struct nt_util_vfio_impl s = { .vfio_dma_map = nthw_vfio_dma_map, + .vfio_dma_unmap = nthw_vfio_dma_unmap }; -nt_util_vfio_init (&s); +nthw_util_vfio_init (&s); }
drivers/net/ntnic/ntnic_vfio.h +5 -5
@@ -11,17 +11,17 @@#include <ethdev_pci.h> void -nt_vfio_init (void ); +nthw_vfio_init (void );int -nt_vfio_setup (struct rte_pci_device *dev); +nthw_vfio_setup (struct rte_pci_device *dev);int -nt_vfio_remove (int vf_num); +nthw_vfio_remove (int vf_num);int -nt_vfio_dma_map (int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size); +nthw_vfio_dma_map (int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size);int -nt_vfio_dma_unmap (int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size); +nthw_vfio_dma_unmap (int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size);/* Find device (PF/VF) number from device address */ #endif /* _NTNIC_VFIO_H_ */
drivers/net/ntnic/ntutil/nt_util.c +11 -11
@@ -17,35 +17,35 @@static struct nt_util_vfio_impl vfio_cb;/* uses usleep which schedules out the calling service */ -void nt_os_wait_usec (int val) +void nthw_os_wait_usec (int val) {rte_delay_us_sleep (val); }/* spins in a waiting loop calling pause asm instruction uses RDTSC - precise wait */ -void nt_os_wait_usec_poll (int val) +void nthw_os_wait_usec_poll (int val) {rte_delay_us (val); } -uint64_t nt_os_get_time_monotonic_counter (void ) +uint64_t nthw_os_get_time_monotonic_counter (void ) {return rte_get_timer_cycles (); }/* Allocation size matching minimum alignment of specified size */ -uint64_t nt_util_align_size (uint64_t size) +uint64_t nthw_util_align_size (uint64_t size) {uint64_t alignment_size =1ULL <<rte_log2_u64 (size);return alignment_size; } -void nt_util_vfio_init (struct nt_util_vfio_impl *impl) +void nthw_util_vfio_init (struct nt_util_vfio_impl *impl) { vfio_cb = *impl; } -struct nt_dma_s *nt_dma_alloc (uint64_t size,uint64_t align,int numa) +struct nt_dma_s *nthw_dma_alloc (uint64_t size,uint64_t align,int numa) {int res;struct nt_dma_s *vfio_addr;
@@ -65,7 +65,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)return NULL ; } - res = vfio_cb.vfio_dma_map (0 , addr, &vfio_addr->iova,nt_util_align_size (size)); + res = vfio_cb.vfio_dma_map (0 , addr, &vfio_addr->iova,nthw_util_align_size (size));if (res !=0 ) {rte_free (addr);
@@ -75,7 +75,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) } vfio_addr->addr = (uint64_t )addr; - vfio_addr->size =nt_util_align_size (size); + vfio_addr->size =nthw_util_align_size (size);NT_LOG (DBG ,GENERAL , "VFIO DMA alloc addr=%" PRIX64 ", iova=%" PRIX64
@@ -86,7 +86,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa) }/* NOTE: please note the difference between RTE_ETH_SPEED_NUM_xxx and RTE_ETH_LINK_SPEED_xxx */ -int nt_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed) +int nthw_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed) {int eth_speed_num =RTE_ETH_SPEED_NUM_NONE ;
@@ -131,7 +131,7 @@ int nt_link_speed_to_eth_speed_num(enum nt_link_speed_e nt_link_speed)return eth_speed_num; } -uint32_t nt_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa) +uint32_t nthw_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa) {uint32_t eth_speed_capa =0 ;
@@ -162,7 +162,7 @@ uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa)return eth_speed_capa; } -int nt_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex) +int nthw_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex) {int eth_link_duplex =0 ;
drivers/net/ntnic/ntutil/nt_util.h +9 -9
@@ -32,16 +32,16 @@#define PCIIDENT_PRINT_STR "%04x:%02x:%02x.%x"#define BDF_TO_PCIIDENT (dom, bus, dev, fnc) (((dom) << 16) | ((bus) << 8) | ((dev) << 3) | (fnc)) -uint64_t nt_os_get_time_monotonic_counter (void ); -void nt_os_wait_usec (int val); -void nt_os_wait_usec_poll (int val); +uint64_t nthw_os_get_time_monotonic_counter (void ); +void nthw_os_wait_usec (int val); +void nthw_os_wait_usec_poll (int val);static inline int min (int a,int b) {return (a < b) ? a : b; } -uint64_t nt_util_align_size (uint64_t size); +uint64_t nthw_util_align_size (uint64_t size);struct nt_dma_s {uint64_t iova;
@@ -54,17 +54,17 @@ struct port_link_speed {int link_speed; }; -struct nt_dma_s *nt_dma_alloc (uint64_t size,uint64_t align,int numa); +struct nt_dma_s *nthw_dma_alloc (uint64_t size,uint64_t align,int numa);struct nt_util_vfio_impl {int (*vfio_dma_map)(int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size);int (*vfio_dma_unmap)(int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size); }; -void nt_util_vfio_init (struct nt_util_vfio_impl *impl); +void nthw_util_vfio_init (struct nt_util_vfio_impl *impl); -int nt_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed); -uint32_t nt_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa); -int nt_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex); +int nthw_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed); +uint32_t nthw_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa); +int nthw_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex); int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args);
Signature · 1 line
2.45.0
PATCH 16/24 net/ntnic: change prefix ntlog to prefix nthw
In reply to Serhii IliushykChange prefix ntlog_ to prefix nthw_log for logging functions.
--- .../net/ntnic/nthw/model/nthw_fpga_model.c | 20 +++++++++---------- drivers/net/ntnic/nthw/nthw_rac.c | 20 +++++++++---------- drivers/net/ntnic/ntlog/ntlog.c | 6 +++--- drivers/net/ntnic/ntlog/ntlog.h | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-)
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +10 -10
@@ -727,17 +727,17 @@ void nthw_register_update(const nthw_register_t *p)uint32_t i = len;uint32_t *ptr = p_data; (void )ptr; -char *tmp_string =ntlog_helper_str_alloc ("Register::read" ); -ntlog_helper_str_add (tmp_string, +char *tmp_string =nthw_log_helper_str_alloc ("Register::read" ); +nthw_log_helper_str_add (tmp_string,"(Dev: %s, Bus: %s, Addr: 0x%08X, Cnt: %d, Data:" , p_dev_name, p_bus_name, addr, len);while (i--) -ntlog_helper_str_add (tmp_string," 0x%08X" , *ptr++); +nthw_log_helper_str_add (tmp_string," 0x%08X" , *ptr++); -ntlog_helper_str_add (tmp_string,")" ); +nthw_log_helper_str_add (tmp_string,")" );NT_LOG (DBG ,NTHW ,"%s" , tmp_string); -ntlog_helper_str_free (tmp_string); +nthw_log_helper_str_free (tmp_string); } } }
@@ -780,18 +780,18 @@ void nthw_register_flush(const nthw_register_t *p, uint32_t cnt)if (p->mn_debug_mode &NTHW_REG_DEBUG_ON_WRITE ) {uint32_t i = len * cnt;uint32_t *ptr = p_data; -char *tmp_string =ntlog_helper_str_alloc ("Register::write" ); +char *tmp_string =nthw_log_helper_str_alloc ("Register::write" ); -ntlog_helper_str_add (tmp_string, +nthw_log_helper_str_add (tmp_string,"(Dev: %s, Bus: %s, Addr: 0x%08X, Cnt: %d, Data:" , p_dev_name, p_bus_name, addr, i);while (i--) -ntlog_helper_str_add (tmp_string," 0x%08X" , *ptr++); +nthw_log_helper_str_add (tmp_string," 0x%08X" , *ptr++); -ntlog_helper_str_add (tmp_string,")" ); +nthw_log_helper_str_add (tmp_string,")" );NT_LOG (DBG ,NTHW ,"%s" , tmp_string); -ntlog_helper_str_free (tmp_string); +nthw_log_helper_str_free (tmp_string); } rc =nthw_register_write_data (p, cnt);
drivers/net/ntnic/nthw/nthw_rac.c +10 -10
@@ -654,8 +654,8 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uintchar *tmp_string;if (trc) { - tmp_string =ntlog_helper_str_alloc ("Register::write" ); -ntlog_helper_str_add (tmp_string, + tmp_string =nthw_log_helper_str_alloc ("Register::write" ); +nthw_log_helper_str_add (tmp_string,"(Dev: NA, Bus: RAB%u, Addr: 0x%08X, Cnt: %d, Data:" , bus_id, address, word_cnt); }
@@ -669,13 +669,13 @@ int nthw_rac_rab_write32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint }if (trc) -ntlog_helper_str_add (tmp_string," 0x%08X" , data); +nthw_log_helper_str_add (tmp_string," 0x%08X" , data); }if (trc) { -ntlog_helper_str_add (tmp_string,")" ); +nthw_log_helper_str_add (tmp_string,")" );NT_LOG (DBG ,NTHW ,"%s" , tmp_string); -ntlog_helper_str_free (tmp_string); +nthw_log_helper_str_free (tmp_string); } }
@@ -840,17 +840,17 @@ int nthw_rac_rab_read32(nthw_rac_t *p, bool trc, nthw_rab_bus_id_t bus_id, uint3 }if (trc) { -char *tmp_string =ntlog_helper_str_alloc ("Register::read" ); -ntlog_helper_str_add (tmp_string, +char *tmp_string =nthw_log_helper_str_alloc ("Register::read" ); +nthw_log_helper_str_add (tmp_string,"(Dev: NA, Bus: RAB%u, Addr: 0x%08X, Cnt: %d, Data:" , bus_id, address, word_cnt);for (i =0 ; i < word_cnt; i++) -ntlog_helper_str_add (tmp_string," 0x%08X" , p_data[i]); +nthw_log_helper_str_add (tmp_string," 0x%08X" , p_data[i]); -ntlog_helper_str_add (tmp_string,")" ); +nthw_log_helper_str_add (tmp_string,")" );NT_LOG (DBG ,NTHW ,"%s" , tmp_string); -ntlog_helper_str_free (tmp_string); +nthw_log_helper_str_free (tmp_string); } }
drivers/net/ntnic/ntlog/ntlog.c +3 -3
@@ -16,7 +16,7 @@#define NTLOG_HELPER_STR_SIZE_MAX (1024) -char *ntlog_helper_str_alloc (const char *sinit) +char *nthw_log_helper_str_alloc (const char *sinit) {char *s =malloc (NTLOG_HELPER_STR_SIZE_MAX );
@@ -33,7 +33,7 @@ char *ntlog_helper_str_alloc(const char *sinit) } __rte_format_printf(2, 0) -void ntlog_helper_str_add (char *s,const char *format, ...) +void nthw_log_helper_str_add (char *s,const char *format, ...) {if (!s)return ;
@@ -45,7 +45,7 @@ void ntlog_helper_str_add(char *s, const char *format, ...)va_end (args); } -void ntlog_helper_str_free (char *s) +void nthw_log_helper_str_free (char *s) {free (s); }
drivers/net/ntnic/ntlog/ntlog.h +3 -3
@@ -65,8 +65,8 @@ extern int nt_log_ntnic;* to use when one single function call to NT_LOG is not optimal - that is * you do not know the number of parameters at programming time or it is variable */ -char *ntlog_helper_str_alloc (const char *sinit); -void ntlog_helper_str_add (char *s,const char *format, ...); -void ntlog_helper_str_free (char *s); +char *nthw_log_helper_str_alloc (const char *sinit); +void nthw_log_helper_str_add (char *s,const char *format, ...); +void nthw_log_helper_str_free (char *s);#endif /* NTOSS_SYSTEM_NTLOG_H */
Signature · 1 line
2.45.0
PATCH 17/24 net/ntnic: change prefix km to prefix nthw
In reply to Serhii IliushykChange prefix km_ (key matcher) to prefix nthw_km_ for flow_api module.
--- drivers/net/ntnic/include/flow_api_engine.h | 18 ++-- drivers/net/ntnic/nthw/flow_api/flow_api.c | 4 +- drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 16 +-- .../profile_inline/flow_api_profile_inline.c | 99 ++++++++++--------- 5 files changed, 75 insertions(+), 64 deletions(-)
drivers/net/ntnic/include/flow_api_engine.h +9 -9
@@ -396,26 +396,26 @@ struct flow_template_table {uint16_t caller_id; }; -void km_attach_ndev_resource_management (struct km_flow_def_s *km,void **handle); -void km_free_ndev_resource_management (void **handle); +void nthw_km_attach_ndev_resource_management (struct km_flow_def_s *km,void **handle); +void nthw_km_free_ndev_resource_management (void **handle); -int km_add_match_elem (struct km_flow_def_s *km,uint32_t e_word[4 ],uint32_t e_mask[4 ], +int nthw_km_add_match_elem (struct km_flow_def_s *km,uint32_t e_word[4 ],uint32_t e_mask[4 ],uint32_t word_len,enum frame_offs_e start,int8_t offset); -int km_key_create (struct km_flow_def_s *km,uint32_t port_id); +int nthw_km_key_create (struct km_flow_def_s *km,uint32_t port_id);/* * Compares 2 KM key definitions after first collect validate and optimization. * km is compared against an existing km1. * if identical, km1 flow_type is returned */ -int km_key_compare (struct km_flow_def_s *km,struct km_flow_def_s *km1); +int nthw_km_key_compare (struct km_flow_def_s *km,struct km_flow_def_s *km1); -int km_rcp_set (struct km_flow_def_s *km,int index); +int nthw_km_rcp_set (struct km_flow_def_s *km,int index); -int km_write_data_match_entry (struct km_flow_def_s *km,uint32_t color); -int km_clear_data_match_entry (struct km_flow_def_s *km); +int nthw_km_write_data_match_entry (struct km_flow_def_s *km,uint32_t color); +int nthw_km_clear_data_match_entry (struct km_flow_def_s *km); -void kcc_free_ndev_resource_management (void **handle); +void nthw_kcc_free_ndev_resource_mgmnt (void **handle);/* * Group management
drivers/net/ntnic/nthw/flow_api/flow_api.c +2 -2
@@ -478,8 +478,8 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) profile_inline_ops->nthw_done_flow_mgmnt_of_ndev_profile_inline (ndev); -km_free_ndev_resource_management (&ndev->km_res_handle); -kcc_free_ndev_resource_management (&ndev->kcc_res_handle); +nthw_km_free_ndev_resource_management (&ndev->km_res_handle); +nthw_kcc_free_ndev_resource_mgmnt (&ndev->kcc_res_handle); ndev->flow_unique_id_counter =0 ;
drivers/net/ntnic/nthw/flow_api/flow_kcc.c +1 -1
@@ -8,7 +8,7 @@#include "hw_mod_backend.h" #include "flow_api_engine.h" -void kcc_free_ndev_resource_management (void **handle) +void nthw_kcc_free_ndev_resource_mgmnt (void **handle) {if (*handle) {free (*handle);
drivers/net/ntnic/nthw/flow_api/flow_km.c +8 -8
@@ -73,7 +73,7 @@ struct tcam_distrib_s {static int tcam_find_mapping (struct km_flow_def_s *km); -void km_attach_ndev_resource_management (struct km_flow_def_s *km,void **handle) +void nthw_km_attach_ndev_resource_management (struct km_flow_def_s *km,void **handle) {/* * KM entries occupied in CAM - to manage the cuckoo shuffling
@@ -100,7 +100,7 @@ void km_attach_ndev_resource_management(struct km_flow_def_s *km, void **handle)nthw_init_hasher (km->hsh, km->be->km.nb_cam_banks, km->be->km.nb_cam_records); } -void km_free_ndev_resource_management (void **handle) +void nthw_km_free_ndev_resource_management (void **handle) {if (*handle) {free (*handle);
@@ -110,7 +110,7 @@ void km_free_ndev_resource_management(void **handle) *handle =NULL ; } -int km_add_match_elem (struct km_flow_def_s *km,uint32_t e_word[4 ],uint32_t e_mask[4 ], +int nthw_km_add_match_elem (struct km_flow_def_s *km,uint32_t e_word[4 ],uint32_t e_mask[4 ],uint32_t word_len,enum frame_offs_e start_id,int8_t offset) {/* valid word_len 1,2,4 */
@@ -173,7 +173,7 @@ static int get_word(struct km_flow_def_s *km, uint32_t size, int marked[])return -1 ; } -int km_key_create (struct km_flow_def_s *km,uint32_t port_id) +int nthw_km_key_create (struct km_flow_def_s *km,uint32_t port_id) {/* * Create combined extractor mappings
@@ -377,7 +377,7 @@ int km_key_create(struct km_flow_def_s *km, uint32_t port_id)return 0 ; } -int km_key_compare (struct km_flow_def_s *km,struct km_flow_def_s *km1) +int nthw_km_key_compare (struct km_flow_def_s *km,struct km_flow_def_s *km1) {if (km->target != km1->target || km->num_ftype_elem != km1->num_ftype_elem || km->key_word_size != km1->key_word_size || km->info_set != km1->info_set)
@@ -473,7 +473,7 @@ int km_key_compare(struct km_flow_def_s *km, struct km_flow_def_s *km1)return km1->flow_type; } -int km_rcp_set (struct km_flow_def_s *km,int index) +int nthw_km_rcp_set (struct km_flow_def_s *km,int index) {int qw =0 ;int sw =0 ;
@@ -1101,7 +1101,7 @@ static int tcam_reset_entry(struct km_flow_def_s *km)return err; } -int km_write_data_match_entry (struct km_flow_def_s *km,uint32_t color) +int nthw_km_write_data_match_entry (struct km_flow_def_s *km,uint32_t color) {int res =-1 ;
@@ -1125,7 +1125,7 @@ int km_write_data_match_entry(struct km_flow_def_s *km, uint32_t color)return res; } -int km_clear_data_match_entry (struct km_flow_def_s *km) +int nthw_km_clear_data_match_entry (struct km_flow_def_s *km) {int res =0 ;
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +55 -44
297 lines not on this page · raw message
Signature · 1 line
2.45.0
PATCH 18/24 net/ntnic: change prefix set to prefix nthw
In reply to Serhii IliushykChange setter functions prefix from set_ to nthw_set_ for DBS module
--- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 50 +++++++++---------- drivers/net/ntnic/include/ntnic_dbs.h | 22 ++++---- drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 22 ++++---- 3 files changed, 47 insertions(+), 47 deletions(-)
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +25 -25
@@ -198,7 +198,7 @@ static void dbs_init_tx_queue(nthw_dbs_t *p_nthw_dbs, uint32_t queue, uint32_t snthw_get_tx_init (p_nthw_dbs, &init, &dummy, &busy); }while (busy !=0 ); -set_tx_init (p_nthw_dbs, start_idx, start_ptr,INIT_QUEUE , queue); +nthw_set_tx_init (p_nthw_dbs, start_idx, start_ptr,INIT_QUEUE , queue); do { nthw_get_tx_init(p_nthw_dbs, &init, &dummy, &busy);
@@ -221,14 +221,14 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info)if (p_nthw_dbs ==NULL )return -1 ; - res =dbs_init (NULL , p_fpga,0 );/* Check that DBS exists in FPGA */ + res =nthw_dbs_init (NULL , p_fpga,0 );/* Check that DBS exists in FPGA */ if (res) {free (p_nthw_dbs);return res; } - res =dbs_init (p_nthw_dbs, p_fpga,0 );/* Create DBS module */ + res =nthw_dbs_init (p_nthw_dbs, p_fpga,0 );/* Create DBS module */ if (res) {free (p_nthw_dbs);
@@ -242,7 +242,7 @@ static int nthw_virt_queue_init(struct fpga_info_s *p_fpga_info) txvq[i].usage =NTHW_VIRTQ_UNUSED ; } -dbs_reset (p_nthw_dbs); +nthw_dbs_reset (p_nthw_dbs);for (i =0 ; i <NT_DBS_RX_QUEUES_MAX ; ++i)dbs_init_rx_queue (p_nthw_dbs, i,0 ,0 );
@@ -382,8 +382,8 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,* 3. Configure the DBS.RX_DR_DATA memory; good idea to initialize all * DBS_RX_QUEUES entries. */ -if (set_rx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, host_id, qs, header, -0 ) !=0 ) { +if (nthw_set_rx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, + host_id, qs, header,0 ) !=0 ) {return NULL ; }
@@ -398,9 +398,9 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs, int_enable =0 ; vec =0 ; istk =0 ; -NT_LOG_DBGX (DBG ,NTNIC ,"set_rx_uw_data int=0 irq_vector=%i" , irq_vector); +NT_LOG_DBGX (DBG ,NTNIC ,"nthw_set_rx_uw_data int=0 irq_vector=%i" , irq_vector); -if (set_rx_uw_data (p_nthw_dbs, index, +if (nthw_set_rx_uw_data (p_nthw_dbs, index, (uint64_t )used_struct_phys_addr, host_id, qs,0 , int_enable, vec, istk) !=0 ) {return NULL ;
@@ -414,7 +414,7 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,* at a later time (after we have enabled vfio interrupts in the kernel). */ if (irq_vector <0 ) { -if (set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, +if (nthw_set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr,RX_AM_DISABLE , host_id,0 ,0 ) !=0 ) {return NULL ;
@@ -432,7 +432,7 @@ static struct nthw_virt_queue *nthw_setup_rx_virt_queue(nthw_dbs_t *p_nthw_dbs,* good idea to initialize all DBS_RX_QUEUES entries. */ uint32_t enable = rx_deferred_start ?RX_AM_DISABLE :RX_AM_ENABLE ; -if (set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, enable, +if (nthw_set_rx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, enable, host_id,0 , irq_vector >=0 ?1 :0 ) !=0 ) {return NULL ; }
@@ -520,7 +520,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)/* Clear UW */ rxvq->used_struct_phys_addr =NULL ; -if (set_rx_uw_data (p_nthw_dbs, rxvq->index, (uint64_t )rxvq->used_struct_phys_addr, +if (nthw_set_rx_uw_data (p_nthw_dbs, rxvq->index, (uint64_t )rxvq->used_struct_phys_addr, rxvq->host_id,0 ,PACKED (rxvq->vq_type),0 ,0 ,0 ) !=0 ) {return -1 ; }
@@ -528,7 +528,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)/* Disable AM */ rxvq->am_enable =RX_AM_DISABLE ; - if (set_rx_am_data(p_nthw_dbs, + if (nthw_set_rx_am_data(p_nthw_dbs, rxvq->index, (uint64_t)rxvq->avail_struct_phys_addr, rxvq->am_enable,
@@ -546,7 +546,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq) rxvq->avail_struct_phys_addr =NULL ; rxvq->host_id =0 ; - if (set_rx_am_data(p_nthw_dbs, + if (nthw_set_rx_am_data(p_nthw_dbs, rxvq->index, (uint64_t)rxvq->avail_struct_phys_addr, rxvq->am_enable,
@@ -558,7 +558,7 @@ static int dbs_internal_release_rx_virt_queue(struct nthw_virt_queue *rxvq)/* Clear DR */ rxvq->desc_struct_phys_addr =NULL ; - if (set_rx_dr_data(p_nthw_dbs, + if (nthw_set_rx_dr_data(p_nthw_dbs, rxvq->index, (uint64_t)rxvq->desc_struct_phys_addr, rxvq->host_id,
@@ -602,7 +602,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)/* Clear UW */ txvq->used_struct_phys_addr =NULL ; -if (set_tx_uw_data (p_nthw_dbs, txvq->index, (uint64_t )txvq->used_struct_phys_addr, +if (nthw_set_tx_uw_data (p_nthw_dbs, txvq->index, (uint64_t )txvq->used_struct_phys_addr, txvq->host_id,0 ,PACKED (txvq->vq_type),0 ,0 ,0 , txvq->in_order) !=0 ) {return -1 ;
@@ -611,7 +611,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq)/* Disable AM */ txvq->am_enable =TX_AM_DISABLE ; - if (set_tx_am_data(p_nthw_dbs, + if (nthw_set_tx_am_data(p_nthw_dbs, txvq->index, (uint64_t)txvq->avail_struct_phys_addr, txvq->am_enable,
@@ -629,7 +629,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq) txvq->avail_struct_phys_addr =NULL ; txvq->host_id =0 ; - if (set_tx_am_data(p_nthw_dbs, + if (nthw_set_tx_am_data(p_nthw_dbs, txvq->index, (uint64_t)txvq->avail_struct_phys_addr, txvq->am_enable,
@@ -644,7 +644,7 @@ static int dbs_internal_release_tx_virt_queue(struct nthw_virt_queue *txvq) txvq->port =0 ; txvq->header =0 ; - if (set_tx_dr_data(p_nthw_dbs, + if (nthw_set_tx_dr_data(p_nthw_dbs, txvq->index, (uint64_t)txvq->desc_struct_phys_addr, txvq->host_id,
@@ -713,8 +713,8 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,* 3. Configure the DBS.TX_DR_DATA memory; good idea to initialize all * DBS_TX_QUEUES entries. */ -if (set_tx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, host_id, qs, port, - header,0 ) !=0 ) { +if (nthw_set_tx_dr_data (p_nthw_dbs, index, (uint64_t )desc_struct_phys_addr, + host_id, qs, port, header,0 ) !=0 ) {return NULL ; }
@@ -730,7 +730,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs, vec =0 ; istk =0 ; -if (set_tx_uw_data (p_nthw_dbs, index, +if (nthw_set_tx_uw_data (p_nthw_dbs, index, (uint64_t )used_struct_phys_addr, host_id, qs,0 , int_enable, vec, istk, in_order) !=0 ) {return NULL ;
@@ -740,7 +740,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,* 2. Configure the DBS.TX_AM_DATA memory and enable the queues you plan to use; * good idea to initialize all DBS_TX_QUEUES entries. */ -if (set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr,TX_AM_DISABLE , +if (nthw_set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr,TX_AM_DISABLE , host_id,0 , irq_vector >=0 ?1 :0 ) !=0 ) {return NULL ; }
@@ -764,7 +764,7 @@ static struct nthw_virt_queue *nthw_setup_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,*/ if (irq_vector <0 ) {uint32_t enable = tx_deferred_start ?TX_AM_DISABLE :TX_AM_ENABLE ; -if (set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, +if (nthw_set_tx_am_data (p_nthw_dbs, index, (uint64_t )avail_struct_phys_addr, enable, host_id,0 ,0 ) !=0 ) {return NULL ; }
@@ -1127,12 +1127,12 @@ nthw_setup_mngd_tx_virt_queue(nthw_dbs_t *p_nthw_dbs,static int nthw_switch_rx_virt_queue (nthw_dbs_t *p_nthw_dbs,uint32_t index,uint32_t enable) { -return set_rx_am_data_enable (p_nthw_dbs, index, enable); +return nthw_set_rx_am_data_enable (p_nthw_dbs, index, enable); }static int nthw_switch_tx_virt_queue (nthw_dbs_t *p_nthw_dbs,uint32_t index,uint32_t enable) { -return set_tx_am_data_enable (p_nthw_dbs, index, enable); +return nthw_set_tx_am_data_enable (p_nthw_dbs, index, enable); } static uint16_t nthw_get_rx_packets(struct nthw_virt_queue *rxvq,
drivers/net/ntnic/include/ntnic_dbs.h +11 -11
@@ -233,8 +233,8 @@ struct nthw_dbs_s {typedef struct nthw_dbs_s nthw_dbs_t ;nthw_dbs_t *nthw_dbs_new (void ); -int dbs_init (nthw_dbs_t *p,nthw_fpga_t *p_fpga,int n_instance); -void dbs_reset (nthw_dbs_t *p); +int nthw_dbs_init (nthw_dbs_t *p,nthw_fpga_t *p_fpga,int n_instance); +void nthw_dbs_reset (nthw_dbs_t *p); int nthw_set_rx_control(nthw_dbs_t *p, uint32_t last_queue,
@@ -253,30 +253,30 @@ int nthw_set_tx_control(nthw_dbs_t *p,int nthw_set_rx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init,uint32_t queue);int nthw_get_rx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy); -int set_tx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init, +int nthw_set_tx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init,uint32_t queue);int nthw_get_tx_init (nthw_dbs_t *p,uint32_t *init,uint32_t *queue,uint32_t *busy);int nthw_set_rx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue);int nthw_get_rx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy);int nthw_set_tx_idle (nthw_dbs_t *p,uint32_t idle,uint32_t queue);int nthw_get_tx_idle (nthw_dbs_t *p,uint32_t *idle,uint32_t *queue,uint32_t *busy); -int set_rx_am_data (nthw_dbs_t *p, +int nthw_set_rx_am_data (nthw_dbs_t *p,uint32_t index,uint64_t guest_physical_address,uint32_t enable,uint32_t host_id,uint32_t packed,uint32_t int_enable); -int set_rx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable); -int set_tx_am_data (nthw_dbs_t *p, +int nthw_set_rx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable); +int nthw_set_tx_am_data (nthw_dbs_t *p,uint32_t index,uint64_t guest_physical_address,uint32_t enable,uint32_t host_id,uint32_t packed,uint32_t int_enable); -int set_tx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable); -int set_rx_uw_data(nthw_dbs_t *p, +int nthw_set_tx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable); +int nthw_set_rx_uw_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
@@ -285,7 +285,7 @@ int set_rx_uw_data(nthw_dbs_t *p,uint32_t int_enable, uint32_t vec, uint32_t istk); -int set_tx_uw_data(nthw_dbs_t *p, +int nthw_set_tx_uw_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
@@ -295,14 +295,14 @@ int set_tx_uw_data(nthw_dbs_t *p,uint32_t vec, uint32_t istk, uint32_t in_order); -int set_rx_dr_data (nthw_dbs_t *p, +int nthw_set_rx_dr_data (nthw_dbs_t *p,uint32_t index,uint64_t guest_physical_address,uint32_t host_id,uint32_t queue_size,uint32_t header,uint32_t packed); -int set_tx_dr_data(nthw_dbs_t *p, +int nthw_set_tx_dr_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
drivers/net/ntnic/nthw/dbs/nthw_dbs.c +11 -11
@@ -76,7 +76,7 @@ nthw_dbs_t *nthw_dbs_new(void)return p; } -int dbs_init (nthw_dbs_t *p,nthw_fpga_t *p_fpga,int n_instance) +int nthw_dbs_init (nthw_dbs_t *p,nthw_fpga_t *p_fpga,int n_instance) {nthw_module_t *mod =nthw_fpga_query_module (p_fpga,MOD_DBS , n_instance);
@@ -369,7 +369,7 @@ static int dbs_reset_tx_control(nthw_dbs_t *p)return 0 ; } -void dbs_reset (nthw_dbs_t *p) +void nthw_dbs_reset (nthw_dbs_t *p) {int i;dbs_reset_rx_control (p);
@@ -462,7 +462,7 @@ int nthw_get_rx_init(nthw_dbs_t *p, uint32_t *init, uint32_t *queue, uint32_t *breturn 0 ; } -int set_tx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init, +int nthw_set_tx_init (nthw_dbs_t *p,uint32_t start_idx,uint32_t start_ptr,uint32_t init,uint32_t queue) {if (p->mp_reg_tx_init_val) {
@@ -601,7 +601,7 @@ static void flush_rx_am_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_rx_avail_monitor_data,1 ); } -int set_rx_am_data(nthw_dbs_t *p, +int nthw_set_rx_am_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t enable,
@@ -618,7 +618,7 @@ int set_rx_am_data(nthw_dbs_t *p,return 0 ; } -int set_rx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable) +int nthw_set_rx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable) {if (!p->mp_reg_rx_avail_monitor_data)return -ENOTSUP ;
@@ -673,7 +673,7 @@ static void flush_tx_am_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_tx_avail_monitor_data,1 ); } -int set_tx_am_data(nthw_dbs_t *p, +int nthw_set_tx_am_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t enable,
@@ -690,7 +690,7 @@ int set_tx_am_data(nthw_dbs_t *p,return 0 ; } -int set_tx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable) +int nthw_set_tx_am_data_enable (nthw_dbs_t *p,uint32_t index,uint32_t enable) {if (!p->mp_reg_tx_avail_monitor_data)return -ENOTSUP ;
@@ -796,7 +796,7 @@ static void flush_rx_uw_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_rx_used_writer_data,1 ); } -int set_rx_uw_data(nthw_dbs_t *p, +int nthw_set_rx_uw_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
@@ -923,7 +923,7 @@ static void flush_tx_uw_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_tx_used_writer_data,1 ); } -int set_tx_uw_data(nthw_dbs_t *p, +int nthw_set_tx_uw_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
@@ -1019,7 +1019,7 @@ static void flush_rx_dr_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_rx_descriptor_reader_data,1 ); } -int set_rx_dr_data(nthw_dbs_t *p, +int nthw_set_rx_dr_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
@@ -1121,7 +1121,7 @@ static void flush_tx_dr_data(nthw_dbs_t *p, uint32_t index)nthw_register_flush (p->mp_reg_tx_descriptor_reader_data,1 ); } -int set_tx_dr_data(nthw_dbs_t *p, +int nthw_set_tx_dr_data(nthw_dbs_t *p, uint32_t index, uint64_t guest_physical_address, uint32_t host_id,
Signature · 1 line
2.45.0
PATCH 19/24 net/ntnic: rename common hash and flow functions
In reply to Serhii IliushykRename common hash and flow functions to have consistent naming convention.
--- drivers/net/ntnic/include/flow_api.h | 8 ++++---- drivers/net/ntnic/nthw/flow_api/flow_api.c | 12 ++++++------ drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c | 8 ++++---- drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h | 2 +- .../flow_api/profile_inline/flow_api_hw_db_inline.c | 4 ++-- .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-)
drivers/net/ntnic/include/flow_api.h +4 -4
@@ -56,7 +56,7 @@ struct nt_eth_rss_conf {enum rte_eth_hash_function algorithm; }; -int sprint_nt_rss_mask (char *str,uint16_t str_len,const char *prefix,uint64_t hash_mask); +int nthw_sprint_rss_mask (char *str,uint16_t str_len,const char *prefix,uint64_t hash_mask);struct flow_eth_dev {/* NIC that owns this port device */
@@ -171,7 +171,7 @@ void nthw_flow_nic_set_error(enum flow_nic_err_msg_e msg, struct rte_flow_error* Resources */ -extern const char *dbg_res_descr[]; +extern const char *nthw_dbg_res_descr[];#define flow_nic_set_bit (arr, x) \ do { \
@@ -199,7 +199,7 @@ extern const char *dbg_res_descr[];typeof (res_type) _temp_res_type = (res_type); \size_t _temp_index = (index); \NT_LOG (DBG ,FILTER ,"mark resource used: %s idx %zu" , \ - dbg_res_descr[_temp_res_type], _temp_index); \ + nthw_dbg_res_descr[_temp_res_type], _temp_index); \RTE_ASSERT (flow_nic_is_bit_set (_temp_ndev->res[_temp_res_type].alloc_bm, \ _temp_index) ==0 ); \flow_nic_set_bit (_temp_ndev->res[_temp_res_type].alloc_bm, _temp_index); \
@@ -210,7 +210,7 @@ extern const char *dbg_res_descr[];typeof (res_type) _temp_res_type = (res_type); \size_t _temp_index = (index); \NT_LOG (DBG ,FILTER ,"mark resource unused: %s idx %zu" , \ - dbg_res_descr[_temp_res_type], _temp_index); \ + nthw_dbg_res_descr[_temp_res_type], _temp_index); \flow_nic_unset_bit ((_ndev)->res[_temp_res_type].alloc_bm, _temp_index); \ }while (0 )
drivers/net/ntnic/nthw/flow_api/flow_api.c +6 -6
@@ -18,7 +18,7 @@ name, #name \ } -const char *dbg_res_descr[] = { +const char *nthw_dbg_res_descr[] = { [RES_QUEUE ] ="RES_QUEUE" , [RES_CAT_CFN ] ="RES_CAT_CFN" , [RES_CAT_COT ] ="RES_CAT_COT" ,
@@ -41,7 +41,7 @@ const char *dbg_res_descr[] = { [RES_INVALID ] ="RES_INVALID" , }; -static_assert (RTE_DIM (dbg_res_descr) ==RES_END , +static_assert (RTE_DIM (nthw_dbg_res_descr) ==RES_END ,"The list of debug descriptions is not fully completed" );static struct flow_nic_dev *dev_base;
@@ -212,7 +212,7 @@ void nthw_flow_nic_free_resource(struct flow_nic_dev *ndev, enum res_type_e res_int nthw_flow_nic_ref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index) {NT_LOG (DBG ,FILTER ,"Reference resource %s idx %i (before ref cnt %" PRIu32")" , - dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); + nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);RTE_ASSERT (flow_nic_is_resource_used (ndev, res_type, index));if (ndev->res[res_type].ref[index] == (uint32_t )-1 )
@@ -225,7 +225,7 @@ int nthw_flow_nic_ref_resource(struct flow_nic_dev *ndev, enum res_type_e res_tyint nthw_flow_nic_deref_resource (struct flow_nic_dev *ndev,enum res_type_e res_type,int index) {NT_LOG (DBG ,FILTER ,"De-reference resource %s idx %i (before ref cnt %" PRIu32")" , - dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]); + nthw_dbg_res_descr[res_type], index, ndev->res[res_type].ref[index]);RTE_ASSERT (flow_nic_is_resource_used (ndev, res_type, index));RTE_ASSERT (ndev->res[res_type].ref[index]);/* deref */
@@ -494,7 +494,7 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev)for (unsigned int i =0 ; i <RES_COUNT ; i++) {int err =0 ; -NT_LOG (DBG ,FILTER ,"RES state for: %s" , dbg_res_descr[i]); +NT_LOG (DBG ,FILTER ,"RES state for: %s" , nthw_dbg_res_descr[i]);for (unsigned int ii =0 ; ii < ndev->res[i].resource_count; ii++) {int ref = ndev->res[i].ref[ii];
@@ -983,7 +983,7 @@ static struct rss_type_info rss_to_string[] = { RSS_TO_STRING(RTE_ETH_RSS_L3_SRC_ONLY), }; -int sprint_nt_rss_mask (char *str,uint16_t str_len,const char *prefix,uint64_t hash_mask) +int nthw_sprint_rss_mask (char *str,uint16_t str_len,const char *prefix,uint64_t hash_mask) {if (str ==NULL || str_len ==0 )return -1 ;
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.c +4 -4
@@ -130,7 +130,7 @@ static __rte_always_inline void unset_bits_and_log(uint64_t *hash_mask, uint64_tchar rss_buffer[4096 ];uint16_t rss_buffer_len =sizeof (rss_buffer); -if (sprint_nt_rss_mask (rss_buffer, rss_buffer_len," " , *hash_mask & hash_bits) ==0 ) +if (nthw_sprint_rss_mask (rss_buffer, rss_buffer_len," " , *hash_mask & hash_bits) ==0 )NT_LOG (DBG ,FILTER ,"Configured RSS types:%s" , rss_buffer);unset_bits (hash_mask, hash_bits); }
@@ -141,14 +141,14 @@ static __rte_always_inline void unset_bits_if_all_enabled(uint64_t *hash_mask, uunset_bits (hash_mask, hash_bits); } -int hsh_set (struct flow_nic_dev *ndev,int hsh_idx,struct nt_eth_rss_conf rss_conf) +int nthw_hsh_set (struct flow_nic_dev *ndev,int hsh_idx,struct nt_eth_rss_conf rss_conf) {uint64_t fields = rss_conf.rss_hf;char rss_buffer[4096 ];uint16_t rss_buffer_len =sizeof (rss_buffer); -if (sprint_nt_rss_mask (rss_buffer, rss_buffer_len," " , fields) ==0 ) +if (nthw_sprint_rss_mask (rss_buffer, rss_buffer_len," " , fields) ==0 )NT_LOG (DBG ,FILTER ,"Requested RSS types:%s" , rss_buffer);/*
@@ -645,7 +645,7 @@ int hsh_set(struct flow_nic_dev *ndev, int hsh_idx, struct nt_eth_rss_conf rss_cif (fields || res !=0 ) {nthw_mod_hsh_rcp_set (&ndev->be,HW_HSH_RCP_PRESET_ALL , hsh_idx,0 ,0 ); -if (sprint_nt_rss_mask (rss_buffer, rss_buffer_len," " , rss_conf.rss_hf) ==0 ) { +if (nthw_sprint_rss_mask (rss_buffer, rss_buffer_len," " , rss_conf.rss_hf) ==0 ) {NT_LOG (ERR ,FILTER ,"RSS configuration%s is not supported for hash func %s." , rss_buffer, (enum rte_eth_hash_function )toeplitz ?"Toeplitz" :"NTH10" );
drivers/net/ntnic/nthw/flow_api/flow_hsh_cfg.h +1 -1
@@ -11,7 +11,7 @@#include "hw_mod_backend.h" #include "flow_api.h" -int hsh_set (struct flow_nic_dev *ndev,int hsh_idx, +int nthw_hsh_set (struct flow_nic_dev *ndev,int hsh_idx,struct nt_eth_rss_conf rss_conf);#endif /* _FLOW_HSH_CFG_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +2 -2
@@ -598,7 +598,7 @@ void nthw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const strucfprintf (file," %016lx\n" , data->hash_mask);/* convert hash mask to human readable RTE_ETH_RSS_* form if possible */ -if (sprint_nt_rss_mask (str_buffer, rss_buffer_len,"\n " , +if (nthw_sprint_rss_mask (str_buffer, rss_buffer_len,"\n " , data->hash_mask) ==0 ) {fprintf (file," Hash mask flags:%s\n" , str_buffer); }
@@ -2830,7 +2830,7 @@ struct hw_db_hsh_idx nthw_db_inline_hsh_add(struct flow_nic_dev *ndev, void *db_ tmp_rss_conf.rss_hf = data->hash_mask;memcpy (tmp_rss_conf.rss_key, data->key,MAX_RSS_KEY_LEN ); tmp_rss_conf.algorithm = data->func; -int res =hsh_set (ndev, idx.ids, tmp_rss_conf); +int res =nthw_hsh_set (ndev, idx.ids, tmp_rss_conf);if (res !=0 ) { idx.error =1 ;
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
@@ -3977,7 +3977,7 @@ int nthw_init_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev) .rss_hf = RTE_ETH_RSS_IPV6 | RTE_ETH_RSS_PORT, .algorithm = 0, }; -hsh_set (ndev,0 , hsh_5_tuple); +nthw_hsh_set (ndev,0 , hsh_5_tuple);nthw_mod_hsh_rcp_flush (&ndev->be,0 ,1 );flow_nic_mark_resource_used (ndev,RES_HSH_RCP ,0 );
drivers/net/ntnic/ntnic_ethdev.c +1 -1
@@ -1770,7 +1770,7 @@ static int eth_dev_rss_hash_update(struct rte_eth_dev *eth_dev, struct rte_eth_r tmp_rss_conf.algorithm = rss_conf->algorithm; tmp_rss_conf.rss_hf = rss_conf->rss_hf; -int res =hsh_set (ndev, hsh_idx, tmp_rss_conf); +int res =nthw_hsh_set (ndev, hsh_idx, tmp_rss_conf);if (res ==0 ) { flow_filter_ops->nthw_mod_hsh_rcp_flush (&ndev->be, hsh_idx,1 );
Signature · 1 line
2.45.0
PATCH 20/24 net/ntnic: rename register ops function
In reply to Serhii IliushykAdd prefix nthw_ to register ops function to follow naming convention.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 2 +- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 2 +- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 2 +- .../link_agx_100g/nt4ga_agx_link_100g.c | 2 +- drivers/net/ntnic/link_mgmt/nt4ga_link.c | 2 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 4 +- .../clock_profiles/nthw_fpga_clk9563.c | 2 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 2 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 2 +- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 2 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 2 +- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 2 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 4 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 2 +- .../nthw/flow_api/flow_backend/flow_backend.c | 2 +- .../profile_inline/flow_api_profile_inline.c | 2 +- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 2 +- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 6 +-- drivers/net/ntnic/ntnic_mod_reg.c | 38 +++++++++---------- drivers/net/ntnic/ntnic_mod_reg.h | 38 +++++++++---------- drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c | 2 +- 23 files changed, 63 insertions(+), 63 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +1 -1
@@ -283,5 +283,5 @@ static const struct adapter_ops ops = {void nthw_adapter_init (void ) { -register_adapter_ops (&ops); +nthw_reg_adapter_ops (&ops); }
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
@@ -596,5 +596,5 @@ static struct nt4ga_stat_ops ops = {void nt4ga_stat_ops_init (void ) {NT_LOG_DBGX (DBG ,NTNIC ,"Stat module was initialized" ); -register_nt4ga_stat_ops (&ops); +nthw_reg_nt4ga_stat_ops (&ops); }
drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c +1 -1
@@ -1451,5 +1451,5 @@ static struct sg_ops_s sg_ops = {void nthw_sg_init (void ) {NT_LOG (INF ,NTNIC ,"SG ops initialized" ); -register_sg_ops (&sg_ops); +nthw_reg_sg_ops (&sg_ops); }
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +1 -1
@@ -747,5 +747,5 @@ static struct link_ops_s link_100g_ops = {void nthw_link_100g_init (void ) { -register_100g_link_ops (&link_100g_ops); +nthw_reg_100g_link_ops (&link_100g_ops); }
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
@@ -37,7 +37,7 @@ static struct link_ops_s link_agx_100g_ops = {void link_agx_100g_init (void ) { -register_agx_100g_link_ops (&link_agx_100g_ops); +nthw_reg_agx_100g_link_ops (&link_agx_100g_ops); }/*
drivers/net/ntnic/link_mgmt/nt4ga_link.c +1 -1
@@ -210,5 +210,5 @@ static const struct port_ops ops = {void nthw_port_init (void ) { -register_port_ops (&ops); +nthw_reg_port_ops (&ops); }
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
@@ -32,7 +32,7 @@ struct nt200a0x_ops {int (*nthw_fpga_nt200a0x_init)(struct fpga_info_s *p_fpga_info); }; -void register_nt200a0x_ops (struct nt200a0x_ops *ops); +void nthw_reg_nt200a0x_ops (struct nt200a0x_ops *ops);struct nt200a0x_ops *get_nt200a0x_ops (void );void nt200a0x_ops_init (void );
@@ -40,7 +40,7 @@ struct nt400dxx_ops {int (*nthw_fpga_nt400dxx_init)(struct fpga_info_s *p_fpga_info); }; -void register_nt400dxx_ops (struct nt400dxx_ops *ops); +void nthw_reg_nt400dxx_ops (struct nt400dxx_ops *ops);struct nt400dxx_ops *get_nt400dxx_ops (void );void nt400dxx_ops_init (void );
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c +1 -1
@@ -35,7 +35,7 @@ static struct clk9563_ops ops = { .get_n_data_9563_si5340_nt200a02_u23_v5 =void clk9563_ops_init (void ) { -register_clk9563_ops (&ops); +nthw_reg_clk9563_ops (&ops); }#undef si5340_revd_registers
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
@@ -72,5 +72,5 @@ static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpgavoid nt200a0x_ops_init (void ) {NT_LOG (DBG ,NTHW ,"NT200A0X OPS INIT" ); -register_nt200a0x_ops (&nt200a0x_ops); +nthw_reg_nt200a0x_ops (&nt200a0x_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +1 -1
@@ -236,5 +236,5 @@ static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rsvoid rst9563_ops_init (void ) {NT_LOG (DBG ,NTHW ,"RST9563 OPS INIT" ); -register_rst9563_ops (&rst9563_ops); +nthw_reg_rst9563_ops (&rst9563_ops); }
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
@@ -578,5 +578,5 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_initvoid rst_nt200a0x_ops_init (void ) {NT_LOG (DBG ,NTHW ,"RST NT200A0X OPS INIT" ); -register_rst_nt200a0x_ops (&rst_nt200a0x_ops); +nthw_reg_rst_nt200a0x_ops (&rst_nt200a0x_ops); }
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +1 -1
@@ -215,5 +215,5 @@ static struct nt400dxx_ops nt400dxx_ops = { .nthw_fpga_nt400dxx_init = nthw_fpgavoid nt400dxx_ops_init (void ) { -register_nt400dxx_ops (&nt400dxx_ops); +nthw_reg_nt400dxx_ops (&nt400dxx_ops); }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +1 -1
@@ -373,5 +373,5 @@ static struct rst9574_ops rst9574_ops = {void rst9574_ops_init (void ) { -register_rst9574_ops (&rst9574_ops); +nthw_reg_rst9574_ops (&rst9574_ops); }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +1 -1
@@ -423,5 +423,5 @@ static struct rst_nt400dxx_ops rst_nt400dxx_ops = {void rst_nt400dxx_ops_init (void ) { -register_rst_nt400dxx_ops (&rst_nt400dxx_ops); +nthw_reg_rst_nt400dxx_ops (&rst_nt400dxx_ops); }
drivers/net/ntnic/nthw/core/nthw_fpga.c +2 -2
@@ -557,7 +557,7 @@ int nthw_fpga_shutdown(struct fpga_info_s *p_fpga_info)static struct nt200a0x_ops *nt200a0x_ops; -void register_nt200a0x_ops (struct nt200a0x_ops *ops) +void nthw_reg_nt200a0x_ops (struct nt200a0x_ops *ops) { nt200a0x_ops = ops; }
@@ -571,7 +571,7 @@ struct nt200a0x_ops *get_nt200a0x_ops(void)static struct nt400dxx_ops *nt400dxx_ops; -void register_nt400dxx_ops (struct nt400dxx_ops *ops) +void nthw_reg_nt400dxx_ops (struct nt400dxx_ops *ops) { nt400dxx_ops = ops; }
drivers/net/ntnic/nthw/flow_api/flow_api.c +1 -1
@@ -1283,5 +1283,5 @@ static const struct flow_filter_ops ops = {void nthw_init_flow_filter (void ) { -register_flow_filter_ops (&ops); +nthw_reg_flow_filter_ops (&ops); }
drivers/net/ntnic/nthw/flow_api/flow_backend/flow_backend.c +1 -1
@@ -2277,5 +2277,5 @@ static const struct flow_backend_ops ops = {void nthw_flow_backend_init (void ) { -register_flow_backend_ops (&ops); +nthw_reg_flow_backend_ops (&ops); }
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
@@ -5446,5 +5446,5 @@ static const struct profile_inline_ops ops = {void nthw_profile_inline_init (void ) { -register_profile_inline_ops (&ops); +nthw_reg_profile_inline_ops (&ops); }
drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +1 -1
@@ -485,5 +485,5 @@ static struct meter_ops_s meter_ops = {void nthw_meter_init (void ) {NT_LOG (DBG ,NTNIC ,"Meter ops initialized" ); -register_meter_ops (&meter_ops); +nthw_reg_meter_ops (&meter_ops); }
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +3 -3
@@ -1291,7 +1291,7 @@ static const struct ntnic_filter_ops ntnic_filter_ops = {void ntnic_filter_init (void ) { -register_ntnic_filter_ops (&ntnic_filter_ops); +nthw_reg_filter_ops (&ntnic_filter_ops); }static const struct rte_flow_ops dev_flow_ops = {
@@ -1313,7 +1313,7 @@ static const struct rte_flow_ops dev_flow_ops = {void nthw_dev_flow_init (void ) { -register_dev_flow_ops (&dev_flow_ops); +nthw_reg_dev_flow_ops (&dev_flow_ops); }static struct rte_flow_fp_ops async_dev_flow_ops = {
@@ -1323,5 +1323,5 @@ static struct rte_flow_fp_ops async_dev_flow_ops = {void nthw_dev_fp_flow_init (void ) { -register_dev_fp_flow_ops (&async_dev_flow_ops); +nthw_reg_dev_fp_flow_ops (&async_dev_flow_ops); }
drivers/net/ntnic/ntnic_mod_reg.c +19 -19
@@ -7,7 +7,7 @@static struct sg_ops_s *sg_ops; -void register_sg_ops (struct sg_ops_s *ops) +void nthw_reg_sg_ops (struct sg_ops_s *ops) { sg_ops = ops; }
@@ -24,7 +24,7 @@ const struct sg_ops_s *get_sg_ops(void)*/ static struct meter_ops_s *meter_ops; -void register_meter_ops (struct meter_ops_s *ops) +void nthw_reg_meter_ops (struct meter_ops_s *ops) { meter_ops = ops; }
@@ -42,7 +42,7 @@ const struct meter_ops_s *get_meter_ops(void)*/ static const struct ntnic_filter_ops *ntnic_filter_ops; -void register_ntnic_filter_ops (const struct ntnic_filter_ops *ops) +void nthw_reg_filter_ops (const struct ntnic_filter_ops *ops) { ntnic_filter_ops = ops; }
@@ -57,7 +57,7 @@ const struct ntnic_filter_ops *get_ntnic_filter_ops(void)static struct link_ops_s *link_100g_ops; -void register_100g_link_ops (struct link_ops_s *ops) +void nthw_reg_100g_link_ops (struct link_ops_s *ops) { link_100g_ops = ops; }
@@ -74,7 +74,7 @@ const struct link_ops_s *get_100g_link_ops(void)*/ static struct link_ops_s *link_agx_100g_ops; -void register_agx_100g_link_ops (struct link_ops_s *ops) +void nthw_reg_agx_100g_link_ops (struct link_ops_s *ops) { link_agx_100g_ops = ops; }
@@ -88,7 +88,7 @@ const struct link_ops_s *get_agx_100g_link_ops(void)static const struct port_ops *port_ops; -void register_port_ops (const struct port_ops *ops) +void nthw_reg_port_ops (const struct port_ops *ops) { port_ops = ops; }
@@ -102,7 +102,7 @@ const struct port_ops *get_port_ops(void)static const struct nt4ga_stat_ops *nt4ga_stat_ops; -void register_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops) +void nthw_reg_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops) { nt4ga_stat_ops = ops; }
@@ -117,7 +117,7 @@ const struct nt4ga_stat_ops *get_nt4ga_stat_ops(void)static const struct adapter_ops *adapter_ops; -void register_adapter_ops (const struct adapter_ops *ops) +void nthw_reg_adapter_ops (const struct adapter_ops *ops) { adapter_ops = ops; }
@@ -131,7 +131,7 @@ const struct adapter_ops *get_adapter_ops(void)static struct clk9563_ops *clk9563_ops; -void register_clk9563_ops (struct clk9563_ops *ops) +void nthw_reg_clk9563_ops (struct clk9563_ops *ops) { clk9563_ops = ops; }
@@ -145,7 +145,7 @@ struct clk9563_ops *get_clk9563_ops(void)static struct rst_nt200a0x_ops *rst_nt200a0x_ops; -void register_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops) +void nthw_reg_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops) { rst_nt200a0x_ops = ops; }
@@ -159,7 +159,7 @@ struct rst_nt200a0x_ops *get_rst_nt200a0x_ops(void)static struct rst9563_ops *rst9563_ops; -void register_rst9563_ops (struct rst9563_ops *ops) +void nthw_reg_rst9563_ops (struct rst9563_ops *ops) { rst9563_ops = ops; }
@@ -173,14 +173,14 @@ struct rst9563_ops *get_rst9563_ops(void)static const struct flow_backend_ops *flow_backend_ops; -void register_flow_backend_ops (const struct flow_backend_ops *ops) +void nthw_reg_flow_backend_ops (const struct flow_backend_ops *ops) { flow_backend_ops = ops; }static struct rst9574_ops *rst9574_ops; -void register_rst9574_ops (struct rst9574_ops *ops) +void nthw_reg_rst9574_ops (struct rst9574_ops *ops) { rst9574_ops = ops; }
@@ -195,7 +195,7 @@ struct rst9574_ops *get_rst9574_ops(void)static struct rst_nt400dxx_ops *rst_nt400dxx_ops; -void register_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops) +void nthw_reg_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops) { rst_nt400dxx_ops = ops; }
@@ -218,7 +218,7 @@ const struct flow_backend_ops *get_flow_backend_ops(void)static const struct profile_inline_ops *profile_inline_ops; -void register_profile_inline_ops (const struct profile_inline_ops *ops) +void nthw_reg_profile_inline_ops (const struct profile_inline_ops *ops) { profile_inline_ops = ops; }
@@ -233,7 +233,7 @@ const struct profile_inline_ops *get_profile_inline_ops(void)static const struct flow_filter_ops *flow_filter_ops; -void register_flow_filter_ops (const struct flow_filter_ops *ops) +void nthw_reg_flow_filter_ops (const struct flow_filter_ops *ops) { flow_filter_ops = ops; }
@@ -248,7 +248,7 @@ const struct flow_filter_ops *get_flow_filter_ops(void)static const struct rte_flow_fp_ops *dev_fp_flow_ops; -void register_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops) +void nthw_reg_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops) { dev_fp_flow_ops = ops; }
@@ -263,7 +263,7 @@ const struct rte_flow_fp_ops *get_dev_fp_flow_ops(void)static const struct rte_flow_ops *dev_flow_ops; -void register_dev_flow_ops (const struct rte_flow_ops *ops) +void nthw_reg_dev_flow_ops (const struct rte_flow_ops *ops) { dev_flow_ops = ops; }
@@ -278,7 +278,7 @@ const struct rte_flow_ops *get_dev_flow_ops(void)static struct ntnic_xstats_ops *ntnic_xstats_ops; -void register_ntnic_xstats_ops (struct ntnic_xstats_ops *ops) +void nthw_reg_xstats_ops (struct ntnic_xstats_ops *ops) { ntnic_xstats_ops = ops; }
drivers/net/ntnic/ntnic_mod_reg.h +19 -19
@@ -119,7 +119,7 @@ struct sg_ops_s {int (*nthw_virt_queue_init)(struct fpga_info_s *p_fpga_info); }; -void register_sg_ops (struct sg_ops_s *ops); +void nthw_reg_sg_ops (struct sg_ops_s *ops);const struct sg_ops_s *get_sg_ops (void );void nthw_sg_init (void );
@@ -128,7 +128,7 @@ struct meter_ops_s {int (*eth_mtr_ops_get)(struct rte_eth_dev *eth_dev,void *ops); }; -void register_meter_ops (struct meter_ops_s *ops); +void nthw_reg_meter_ops (struct meter_ops_s *ops);const struct meter_ops_s *get_meter_ops (void );void nthw_meter_init (void );
@@ -139,7 +139,7 @@ struct ntnic_filter_ops {int (*poll_statistics)(struct pmd_internals *internals); }; -void register_ntnic_filter_ops (const struct ntnic_filter_ops *ops); +void nthw_reg_filter_ops (const struct ntnic_filter_ops *ops);const struct ntnic_filter_ops *get_ntnic_filter_ops (void );void ntnic_filter_init (void );
@@ -147,11 +147,11 @@ struct link_ops_s {int (*link_init)(struct adapter_info_s *p_adapter_info,nthw_fpga_t *p_fpga); }; -void register_100g_link_ops (struct link_ops_s *ops); +void nthw_reg_100g_link_ops (struct link_ops_s *ops);const struct link_ops_s *get_100g_link_ops (void );void nthw_link_100g_init (void ); -void register_agx_100g_link_ops (struct link_ops_s *ops); +void nthw_reg_agx_100g_link_ops (struct link_ops_s *ops);const struct link_ops_s *get_agx_100g_link_ops (void );void link_agx_100g_init (void );
@@ -207,7 +207,7 @@ struct port_ops {int (*tx_power)(struct adapter_info_s *p,int port,bool disable); }; -void register_port_ops (const struct port_ops *ops); +void nthw_reg_port_ops (const struct port_ops *ops);const struct port_ops *get_port_ops (void );void nthw_port_init (void );
@@ -218,7 +218,7 @@ struct nt4ga_stat_ops { nt4ga_stat_t *p_nt4ga_stat); }; -void register_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops); +void nthw_reg_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops);const struct nt4ga_stat_ops *get_nt4ga_stat_ops (void );void nt4ga_stat_ops_init (void );
@@ -229,7 +229,7 @@ struct adapter_ops {int (*show_info)(struct adapter_info_s *p_adapter_info,FILE *pfh); }; -void register_adapter_ops (const struct adapter_ops *ops); +void nthw_reg_adapter_ops (const struct adapter_ops *ops);const struct adapter_ops *get_adapter_ops (void );void nthw_adapter_init (void );
@@ -238,7 +238,7 @@ struct clk9563_ops {const clk_profile_data_fmt2_t *(*get_p_data_9563_si5340_nt200a02_u23_v5)(void ); }; -void register_clk9563_ops (struct clk9563_ops *ops); +void nthw_reg_clk9563_ops (struct clk9563_ops *ops);struct clk9563_ops *get_clk9563_ops (void );void clk9563_ops_init (void );
@@ -249,7 +249,7 @@ struct rst_nt200a0x_ops { const struct nthw_fpga_rst_nt200a0x *p); }; -void register_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops); +void nthw_reg_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops);struct rst_nt200a0x_ops *get_rst_nt200a0x_ops (void );void rst_nt200a0x_ops_init (void );
@@ -258,7 +258,7 @@ struct rst9563_ops { struct nthw_fpga_rst_nt200a0x *const p); }; -void register_rst9563_ops (struct rst9563_ops *ops); +void nthw_reg_rst9563_ops (struct rst9563_ops *ops);struct rst9563_ops *get_rst9563_ops (void );void rst9563_ops_init (void );
@@ -269,7 +269,7 @@ struct rst9574_ops { struct nthw_fpga_rst_nt400dxx *const p); }; -void register_rst9574_ops (struct rst9574_ops *ops); +void nthw_reg_rst9574_ops (struct rst9574_ops *ops);struct rst9574_ops *get_rst9574_ops (void );void rst9574_ops_init (void );
@@ -278,7 +278,7 @@ struct rst_nt400dxx_ops {int (*nthw_fpga_rst_nt400dxx_reset)(struct fpga_info_s *p_fpga_info); }; -void register_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops); +void nthw_reg_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops);struct rst_nt400dxx_ops *get_rst_nt400dxx_ops (void );void rst_nt400dxx_ops_init (void );
@@ -288,7 +288,7 @@ struct flow_backend_ops {void (*bin_flow_backend_done)(void *be_dev); }; -void register_flow_backend_ops (const struct flow_backend_ops *ops); +void nthw_reg_flow_backend_ops (const struct flow_backend_ops *ops);const struct flow_backend_ops *get_flow_backend_ops (void );void nthw_flow_backend_init (void );
@@ -446,7 +446,7 @@ struct profile_inline_ops {int (*nthw_flow_set_mtu_inline)(struct flow_eth_dev *dev,uint32_t port,uint16_t mtu); }; -void register_profile_inline_ops (const struct profile_inline_ops *ops); +void nthw_reg_profile_inline_ops (const struct profile_inline_ops *ops);const struct profile_inline_ops *get_profile_inline_ops (void );void nthw_profile_inline_init (void );
@@ -559,15 +559,15 @@ struct flow_filter_ops { struct rte_flow_error *error); }; -void register_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops); +void nthw_reg_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops);const struct rte_flow_fp_ops *get_dev_fp_flow_ops (void );void nthw_dev_fp_flow_init (void ); -void register_dev_flow_ops (const struct rte_flow_ops *ops); +void nthw_reg_dev_flow_ops (const struct rte_flow_ops *ops);const struct rte_flow_ops *get_dev_flow_ops (void );void nthw_dev_flow_init (void ); -void register_flow_filter_ops (const struct flow_filter_ops *ops); +void nthw_reg_flow_filter_ops (const struct flow_filter_ops *ops);const struct flow_filter_ops *get_flow_filter_ops (void );void nthw_init_flow_filter (void );
@@ -591,7 +591,7 @@ struct ntnic_xstats_ops { uint8_t port); }; -void register_ntnic_xstats_ops (struct ntnic_xstats_ops *ops); +void nthw_reg_xstats_ops (struct ntnic_xstats_ops *ops);struct ntnic_xstats_ops *get_ntnic_xstats_ops (void );void ntnic_xstats_ops_init (void );
drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c +1 -1
@@ -822,5 +822,5 @@ static struct ntnic_xstats_ops ops = {void ntnic_xstats_ops_init (void ) {NT_LOG_DBGX (DBG ,NTNIC ,"xstats module was initialized" ); -register_ntnic_xstats_ops (&ops); +nthw_reg_xstats_ops (&ops); }
Signature · 1 line
2.45.0
PATCH 21/24 net/ntnic: rename get ops functions
In reply to Serhii IliushykAdd prefix nthw_ to get ops functions to follow naming convention.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 10 ++-- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 4 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 4 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 4 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 4 +- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 4 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 8 +-- drivers/net/ntnic/nthw/flow_api/flow_api.c | 42 +++++++-------- drivers/net/ntnic/nthw/flow_api/flow_filter.c | 4 +- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 18 +++---- drivers/net/ntnic/ntnic_ethdev.c | 54 +++++++++---------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 32 +++++------ drivers/net/ntnic/ntnic_mod_reg.c | 38 ++++++------- drivers/net/ntnic/ntnic_mod_reg.h | 38 ++++++------- 14 files changed, 132 insertions(+), 132 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +5 -5
@@ -52,7 +52,7 @@ static int nt4ga_adapter_show_info(struct adapter_info_s *p_adapter_info, FILE *static int nt4ga_adapter_init (struct adapter_info_s *p_adapter_info) { -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL )NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized" , __func__);
@@ -162,7 +162,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)switch (fpga_info->n_fpga_prod_id) {/* NT200A01: 2x100G (Xilinx) */ case 9563 :/* NT200A02 (Cap) */ - link_ops =get_100g_link_ops (); + link_ops =nthw_get_100g_link_ops ();if (link_ops ==NULL ) {NT_LOG (ERR ,NTNIC ,"NT200A02 100G link module uninitialized" );
@@ -173,7 +173,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) res = link_ops->link_init (p_adapter_info, p_fpga);break ;case 9574 :/* NT400D13 (Intel Agilex FPGA) */ - link_ops =get_agx_100g_link_ops (); + link_ops =nthw_get_agx_100g_link_ops ();if (link_ops ==NULL ) {NT_LOG (ERR ,NTNIC ,"NT400D11 100G link module uninitialized" ); res =-1 ;
@@ -197,7 +197,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info) } } -const struct nt4ga_stat_ops *nt4ga_stat_ops =get_nt4ga_stat_ops (); +const struct nt4ga_stat_ops *nt4ga_stat_ops =nthw_get_nt4ga_stat_ops ();if (nt4ga_stat_ops !=NULL ) {/* Nt4ga Stat init/setup */
@@ -223,7 +223,7 @@ static int nt4ga_adapter_init(struct adapter_info_s *p_adapter_info)static int nt4ga_adapter_deinit (struct adapter_info_s *p_adapter_info) { -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL )NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized" , __func__);
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +2 -2
@@ -191,7 +191,7 @@ static int nt4ga_stat_setup(struct adapter_info_s *p_adapter_info)return -1 ; } -if (get_flow_filter_ops () !=NULL ) { +if (nthw_get_flow_filter_ops () !=NULL ) {struct flow_nic_dev *ndev = p_adapter_info->nt4ga_filter.mp_flow_device; p_nt4ga_stat->flm_stat_ver = ndev->be.flm.ver; p_nt4ga_stat->mp_stat_structs_flm =calloc (1 ,sizeof (struct flm_counters_v1 ));
@@ -244,7 +244,7 @@ static int nt4ga_stat_collect_cap_v1_stats(struct adapter_info_s *p_adapter_info uint32_t *p_stat_dma_virtual) { (void )p_adapter_info; -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL || p_nt4ga_stat ==NULL )return -1 ;
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
@@ -33,7 +33,7 @@ struct nt200a0x_ops { };void nthw_reg_nt200a0x_ops (struct nt200a0x_ops *ops); -struct nt200a0x_ops *get_nt200a0x_ops (void ); +struct nt200a0x_ops *nthw_get_nt200a0x_ops (void );void nt200a0x_ops_init (void );struct nt400dxx_ops {
@@ -41,7 +41,7 @@ struct nt400dxx_ops { };void nthw_reg_nt400dxx_ops (struct nt400dxx_ops *ops); -struct nt400dxx_ops *get_nt400dxx_ops (void ); +struct nt400dxx_ops *nthw_get_nt400dxx_ops (void );void nt400dxx_ops_init (void );#endif /* __NTHW_FPGA_H__ */
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +2 -2
@@ -15,7 +15,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)const char *const p_adapter_id_str = p_fpga_info->mp_adapter_id_str;struct nthw_fpga_rst_nt200a0x rst;int res =-1 ; -const struct rst_nt200a0x_ops *rst_nt200a0x_ops =get_rst_nt200a0x_ops (); +const struct rst_nt200a0x_ops *rst_nt200a0x_ops =nthw_get_rst_nt200a0x_ops ();if (rst_nt200a0x_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"RST NT200A0X NOT INCLUDED" );
@@ -32,7 +32,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info) }bool included = true; -struct rst9563_ops *rst9563_ops =get_rst9563_ops (); +struct rst9563_ops *rst9563_ops =nthw_get_rst9563_ops ();/* reset specific */ switch (p_fpga_info->n_fpga_prod_id) {
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +2 -2
@@ -160,7 +160,7 @@ static int nthw_fpga_rst9563_clock_synth_init(nthw_fpga_t *p_fpga,const char *const p_adapter_id_str = p_fpga->p_fpga_info->mp_adapter_id_str;const int n_fpga_product_id = p_fpga->mn_product_id;int res; -const struct clk9563_ops *clk9563_ops =get_clk9563_ops (); +const struct clk9563_ops *clk9563_ops =nthw_get_clk9563_ops ();if (clk9563_ops ==NULL ) {NT_LOG (INF ,NTNIC ,"CLK9563 module not included" );
@@ -220,7 +220,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info,return res; } -const struct rst_nt200a0x_ops *rst_ops =get_rst_nt200a0x_ops (); +const struct rst_nt200a0x_ops *rst_ops =nthw_get_rst_nt200a0x_ops (); res = rst_ops !=NULL ? rst_ops->nthw_fpga_rst_nt200a0x_reset (p_fpga, p_rst) :-1 ;if (res) {
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +2 -2
@@ -124,7 +124,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)switch (p_fpga_info->n_fpga_prod_id) {case 9574 : - rst9574_ops =get_rst9574_ops (); + rst9574_ops =nthw_get_rst9574_ops ();if (rst9574_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"%s: RST 9574 NOT INCLUDED" , p_adapter_id_str);
@@ -148,7 +148,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)return -1 ; } -struct rst_nt400dxx_ops *rst_nt400dxx_ops =get_rst_nt400dxx_ops (); +struct rst_nt400dxx_ops *rst_nt400dxx_ops =nthw_get_rst_nt400dxx_ops ();if (rst_nt400dxx_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"RST NT400DXX NOT INCLUDED" );
drivers/net/ntnic/nthw/core/nthw_fpga.c +4 -4
@@ -431,8 +431,8 @@ int nthw_fpga_init(struct fpga_info_s *p_fpga_info)nthw_rac_rab_flush (p_nthw_rac); p_fpga_info->mp_nthw_rac = p_nthw_rac; -struct nt200a0x_ops *nt200a0x_ops =get_nt200a0x_ops (); -struct nt400dxx_ops *nt400dxx_ops =get_nt400dxx_ops (); +struct nt200a0x_ops *nt200a0x_ops =nthw_get_nt200a0x_ops (); +struct nt400dxx_ops *nt400dxx_ops =nthw_get_nt400dxx_ops ();switch (p_fpga_info->n_nthw_adapter_id) {case NT_HW_ADAPTER_ID_NT200A02 :
@@ -562,7 +562,7 @@ void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops) nt200a0x_ops = ops; } -struct nt200a0x_ops *get_nt200a0x_ops (void ) +struct nt200a0x_ops *nthw_get_nt200a0x_ops (void ) {if (nt200a0x_ops ==NULL )nt200a0x_ops_init ();
@@ -576,7 +576,7 @@ void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops) nt400dxx_ops = ops; } -struct nt400dxx_ops *get_nt400dxx_ops (void ) +struct nt400dxx_ops *nthw_get_nt400dxx_ops (void ) {if (nt400dxx_ops ==NULL )nt400dxx_ops_init ();
drivers/net/ntnic/nthw/flow_api/flow_api.c +21 -21
168 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/flow_filter.c +2 -2
@@ -12,7 +12,7 @@ int nthw_flow_filter_init(nthw_fpga_t *p_fpga, struct flow_nic_dev **p_flow_devivoid *be_dev =NULL ;struct flow_nic_dev *flow_nic; -const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); +const struct flow_backend_ops *flow_backend_ops =nthw_get_flow_backend_ops ();if (flow_backend_ops ==NULL ) {NT_LOG (ERR ,FILTER ,"%s: flow_backend module uninitialized" , __func__);
@@ -41,7 +41,7 @@ int nthw_flow_filter_done(struct flow_nic_dev *dev)int res =nthw_flow_api_done (dev);if (be_dev) { -const struct flow_backend_ops *flow_backend_ops =get_flow_backend_ops (); +const struct flow_backend_ops *flow_backend_ops =nthw_get_flow_backend_ops ();if (flow_backend_ops ==NULL ) {NT_LOG (WRN ,FILTER ,"%s: flow_backend module uninitialized" , __func__);
drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +9 -9
@@ -35,7 +35,7 @@ static int eth_mtr_capabilities_get_inline(struct rte_eth_dev *eth_dev,struct rte_mtr_capabilities *cap, struct rte_mtr_error *error) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -106,7 +106,7 @@ static int eth_mtr_meter_profile_add_inline(struct rte_eth_dev *eth_dev,struct rte_mtr_meter_profile *profile, struct rte_mtr_error *error __rte_unused) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -157,7 +157,7 @@ static int eth_mtr_meter_profile_delete_inline(struct rte_eth_dev *eth_dev,uint32_t meter_profile_id, struct rte_mtr_error *error __rte_unused) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -180,7 +180,7 @@ static int eth_mtr_meter_policy_add_inline(struct rte_eth_dev *eth_dev,struct rte_mtr_meter_policy_params *policy, struct rte_mtr_error *error) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -226,7 +226,7 @@ static int eth_mtr_meter_policy_delete_inline(struct rte_eth_dev *eth_dev __rte_uint32_t policy_id, struct rte_mtr_error *error __rte_unused) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -246,7 +246,7 @@ static int eth_mtr_create_inline(struct rte_eth_dev *eth_dev,int shared, struct rte_mtr_error *error) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -312,7 +312,7 @@ static int eth_mtr_destroy_inline(struct rte_eth_dev *eth_dev,uint32_t mtr_id, struct rte_mtr_error *error __rte_unused) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -342,7 +342,7 @@ static int eth_mtr_stats_adjust_inline(struct rte_eth_dev *eth_dev,uint64_t adjust_value, struct rte_mtr_error *error) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
@@ -405,7 +405,7 @@ static int eth_mtr_stats_read_inline(struct rte_eth_dev *eth_dev,int clear, struct rte_mtr_error *error) { - const struct profile_inline_ops *profile_inline_ops = get_profile_inline_ops(); + const struct profile_inline_ops *profile_inline_ops = nthw_get_profile_inline_ops();if (profile_inline_ops ==NULL ) {NT_LOG (ERR ,NTHW ,"profile_inline module uninitialized" );
drivers/net/ntnic/ntnic_ethdev.c +27 -27
216 lines not on this page · raw message
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +16 -16
@@ -540,7 +540,7 @@ static int convert_flow(struct rte_eth_dev *eth_dev,static int eth_flow_destroy (struct rte_eth_dev *eth_dev,struct rte_flow *flow,struct rte_flow_error *error) { -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -584,7 +584,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,const struct rte_flow_action actions[], struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -667,7 +667,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,static int eth_flow_flush (struct rte_eth_dev *eth_dev,struct rte_flow_error *error) { -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -708,7 +708,7 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev,const struct rte_flow_action actions[], struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -770,7 +770,7 @@ static int eth_flow_dev_dump(struct rte_eth_dev *eth_dev,FILE *file, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG (ERR ,NTNIC ,"%s: flow_filter module uninitialized" , __func__);
@@ -797,7 +797,7 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev,uint32_t nb_contexts, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,NTNIC ,"flow_filter module uninitialized" );
@@ -824,7 +824,7 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev,static int eth_flow_info_get (struct rte_eth_dev *dev,struct rte_flow_port_info *port_info,struct rte_flow_queue_info *queue_info,struct rte_flow_error *error) { -const struct flow_filter_ops *flow_filter_ops =get_flow_filter_ops (); +const struct flow_filter_ops *flow_filter_ops =nthw_get_flow_filter_ops ();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -849,7 +849,7 @@ static int eth_flow_configure(struct rte_eth_dev *dev, const struct rte_flow_por uint16_t nb_queue, const struct rte_flow_queue_attr *queue_attr[], struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -875,7 +875,7 @@ static struct rte_flow_pattern_template *eth_flow_pattern_template_create(structconst struct rte_flow_pattern_template_attr *template_attr, const struct rte_flow_item pattern[], struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -914,7 +914,7 @@ static int eth_flow_pattern_template_destroy(struct rte_eth_dev *dev,struct rte_flow_pattern_template *pattern_template, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -939,7 +939,7 @@ static struct rte_flow_actions_template *eth_flow_actions_template_create(struct const struct rte_flow_action actions[], const struct rte_flow_action masks[], struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -1000,7 +1000,7 @@ static int eth_flow_actions_template_destroy(struct rte_eth_dev *dev,struct rte_flow_actions_template *actions_template, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,NTNIC ,"flow_filter module uninitialized" );
@@ -1026,7 +1026,7 @@ static struct rte_flow_template_table *eth_flow_template_table_create(struct rte struct rte_flow_actions_template *actions_templates[], uint8_t nb_actions_templates, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -1065,7 +1065,7 @@ static int eth_flow_template_table_destroy(struct rte_eth_dev *dev,struct rte_flow_template_table *template_table, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -1091,7 +1091,7 @@ static struct rte_flow *eth_flow_async_create(struct rte_eth_dev *dev, uint32_t uint8_t pattern_template_index, const struct rte_flow_action actions[], uint8_t actions_template_index, void *user_data, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
@@ -1151,7 +1151,7 @@ static int eth_flow_async_destroy(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow *flow, void *user_data, struct rte_flow_error *error) { - const struct flow_filter_ops *flow_filter_ops = get_flow_filter_ops(); + const struct flow_filter_ops *flow_filter_ops = nthw_get_flow_filter_ops();if (flow_filter_ops ==NULL ) {NT_LOG_DBGX (ERR ,FILTER ,"flow_filter module uninitialized" );
drivers/net/ntnic/ntnic_mod_reg.c +19 -19
@@ -12,7 +12,7 @@ void nthw_reg_sg_ops(struct sg_ops_s *ops) sg_ops = ops; } -const struct sg_ops_s *get_sg_ops (void ) +const struct sg_ops_s *nthw_get_sg_ops (void ) {if (sg_ops ==NULL )nthw_sg_init ();
@@ -29,7 +29,7 @@ void nthw_reg_meter_ops(struct meter_ops_s *ops) meter_ops = ops; } -const struct meter_ops_s *get_meter_ops (void ) +const struct meter_ops_s *nthw_get_meter_ops (void ) {if (meter_ops ==NULL )nthw_meter_init ();
@@ -47,7 +47,7 @@ void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops) ntnic_filter_ops = ops; } -const struct ntnic_filter_ops *get_ntnic_filter_ops (void ) +const struct ntnic_filter_ops *nthw_get_filter_ops (void ) {if (ntnic_filter_ops ==NULL )ntnic_filter_init ();
@@ -62,7 +62,7 @@ void nthw_reg_100g_link_ops(struct link_ops_s *ops) link_100g_ops = ops; } -const struct link_ops_s *get_100g_link_ops (void ) +const struct link_ops_s *nthw_get_100g_link_ops (void ) {if (link_100g_ops ==NULL )nthw_link_100g_init ();
@@ -79,7 +79,7 @@ void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops) link_agx_100g_ops = ops; } -const struct link_ops_s *get_agx_100g_link_ops (void ) +const struct link_ops_s *nthw_get_agx_100g_link_ops (void ) {if (link_agx_100g_ops ==NULL )link_agx_100g_init ();
@@ -93,7 +93,7 @@ void nthw_reg_port_ops(const struct port_ops *ops) port_ops = ops; } -const struct port_ops *get_port_ops (void ) +const struct port_ops *nthw_get_port_ops (void ) {if (port_ops ==NULL )nthw_port_init ();
@@ -107,7 +107,7 @@ void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops) nt4ga_stat_ops = ops; } -const struct nt4ga_stat_ops *get_nt4ga_stat_ops (void ) +const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops (void ) {if (nt4ga_stat_ops ==NULL )nt4ga_stat_ops_init ();
@@ -122,7 +122,7 @@ void nthw_reg_adapter_ops(const struct adapter_ops *ops) adapter_ops = ops; } -const struct adapter_ops *get_adapter_ops (void ) +const struct adapter_ops *nthw_get_adapter_ops (void ) {if (adapter_ops ==NULL )nthw_adapter_init ();
@@ -136,7 +136,7 @@ void nthw_reg_clk9563_ops(struct clk9563_ops *ops) clk9563_ops = ops; } -struct clk9563_ops *get_clk9563_ops (void ) +struct clk9563_ops *nthw_get_clk9563_ops (void ) {if (clk9563_ops ==NULL )clk9563_ops_init ();
@@ -150,7 +150,7 @@ void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops) rst_nt200a0x_ops = ops; } -struct rst_nt200a0x_ops *get_rst_nt200a0x_ops (void ) +struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops (void ) {if (rst_nt200a0x_ops ==NULL )rst_nt200a0x_ops_init ();
@@ -164,7 +164,7 @@ void nthw_reg_rst9563_ops(struct rst9563_ops *ops) rst9563_ops = ops; } -struct rst9563_ops *get_rst9563_ops (void ) +struct rst9563_ops *nthw_get_rst9563_ops (void ) {if (rst9563_ops ==NULL )rst9563_ops_init ();
@@ -185,7 +185,7 @@ void nthw_reg_rst9574_ops(struct rst9574_ops *ops) rst9574_ops = ops; } -struct rst9574_ops *get_rst9574_ops (void ) +struct rst9574_ops *nthw_get_rst9574_ops (void ) {if (rst9574_ops ==NULL )rst9574_ops_init ();
@@ -200,7 +200,7 @@ void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops) rst_nt400dxx_ops = ops; } -struct rst_nt400dxx_ops *get_rst_nt400dxx_ops (void ) +struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops (void ) {if (rst_nt400dxx_ops ==NULL )rst_nt400dxx_ops_init ();
@@ -208,7 +208,7 @@ struct rst_nt400dxx_ops *get_rst_nt400dxx_ops(void)return rst_nt400dxx_ops; } -const struct flow_backend_ops *get_flow_backend_ops (void ) +const struct flow_backend_ops *nthw_get_flow_backend_ops (void ) {if (flow_backend_ops ==NULL )nthw_flow_backend_init ();
@@ -223,7 +223,7 @@ void nthw_reg_profile_inline_ops(const struct profile_inline_ops *ops) profile_inline_ops = ops; } -const struct profile_inline_ops *get_profile_inline_ops (void ) +const struct profile_inline_ops *nthw_get_profile_inline_ops (void ) {if (profile_inline_ops ==NULL )nthw_profile_inline_init ();
@@ -238,7 +238,7 @@ void nthw_reg_flow_filter_ops(const struct flow_filter_ops *ops) flow_filter_ops = ops; } -const struct flow_filter_ops *get_flow_filter_ops (void ) +const struct flow_filter_ops *nthw_get_flow_filter_ops (void ) {if (flow_filter_ops ==NULL )nthw_init_flow_filter ();
@@ -253,7 +253,7 @@ void nthw_reg_dev_fp_flow_ops(const struct rte_flow_fp_ops *ops) dev_fp_flow_ops = ops; } -const struct rte_flow_fp_ops *get_dev_fp_flow_ops (void ) +const struct rte_flow_fp_ops *nthw_get_dev_fp_flow_ops (void ) {if (dev_fp_flow_ops ==NULL )nthw_dev_fp_flow_init ();
@@ -268,7 +268,7 @@ void nthw_reg_dev_flow_ops(const struct rte_flow_ops *ops) dev_flow_ops = ops; } -const struct rte_flow_ops *get_dev_flow_ops (void ) +const struct rte_flow_ops *nthw_get_dev_flow_ops (void ) {if (dev_flow_ops ==NULL )nthw_dev_flow_init ();
@@ -283,7 +283,7 @@ void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops) ntnic_xstats_ops = ops; } -struct ntnic_xstats_ops *get_ntnic_xstats_ops (void ) +struct ntnic_xstats_ops *nthw_get_xstats_ops (void ) {if (ntnic_xstats_ops ==NULL )ntnic_xstats_ops_init ();
drivers/net/ntnic/ntnic_mod_reg.h +19 -19
@@ -120,7 +120,7 @@ struct sg_ops_s { };void nthw_reg_sg_ops (struct sg_ops_s *ops); -const struct sg_ops_s *get_sg_ops (void ); +const struct sg_ops_s *nthw_get_sg_ops (void );void nthw_sg_init (void );/* Meter ops section */
@@ -129,7 +129,7 @@ struct meter_ops_s { };void nthw_reg_meter_ops (struct meter_ops_s *ops); -const struct meter_ops_s *get_meter_ops (void ); +const struct meter_ops_s *nthw_get_meter_ops (void );void nthw_meter_init (void );/*
@@ -140,7 +140,7 @@ struct ntnic_filter_ops { };void nthw_reg_filter_ops (const struct ntnic_filter_ops *ops); -const struct ntnic_filter_ops *get_ntnic_filter_ops (void ); +const struct ntnic_filter_ops *nthw_get_filter_ops (void );void ntnic_filter_init (void );struct link_ops_s {
@@ -148,11 +148,11 @@ struct link_ops_s { };void nthw_reg_100g_link_ops (struct link_ops_s *ops); -const struct link_ops_s *get_100g_link_ops (void ); +const struct link_ops_s *nthw_get_100g_link_ops (void );void nthw_link_100g_init (void );void nthw_reg_agx_100g_link_ops (struct link_ops_s *ops); -const struct link_ops_s *get_agx_100g_link_ops (void ); +const struct link_ops_s *nthw_get_agx_100g_link_ops (void );void link_agx_100g_init (void );struct port_ops {
@@ -208,7 +208,7 @@ struct port_ops { };void nthw_reg_port_ops (const struct port_ops *ops); -const struct port_ops *get_port_ops (void ); +const struct port_ops *nthw_get_port_ops (void );void nthw_port_init (void );struct nt4ga_stat_ops {
@@ -219,7 +219,7 @@ struct nt4ga_stat_ops { };void nthw_reg_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops); -const struct nt4ga_stat_ops *get_nt4ga_stat_ops (void ); +const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops (void );void nt4ga_stat_ops_init (void );struct adapter_ops {
@@ -230,7 +230,7 @@ struct adapter_ops { };void nthw_reg_adapter_ops (const struct adapter_ops *ops); -const struct adapter_ops *get_adapter_ops (void ); +const struct adapter_ops *nthw_get_adapter_ops (void );void nthw_adapter_init (void );struct clk9563_ops {
@@ -239,7 +239,7 @@ struct clk9563_ops { };void nthw_reg_clk9563_ops (struct clk9563_ops *ops); -struct clk9563_ops *get_clk9563_ops (void ); +struct clk9563_ops *nthw_get_clk9563_ops (void );void clk9563_ops_init (void );struct rst_nt200a0x_ops {
@@ -250,7 +250,7 @@ struct rst_nt200a0x_ops { };void nthw_reg_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops); -struct rst_nt200a0x_ops *get_rst_nt200a0x_ops (void ); +struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops (void );void rst_nt200a0x_ops_init (void );struct rst9563_ops {
@@ -259,7 +259,7 @@ struct rst9563_ops { };void nthw_reg_rst9563_ops (struct rst9563_ops *ops); -struct rst9563_ops *get_rst9563_ops (void ); +struct rst9563_ops *nthw_get_rst9563_ops (void );void rst9563_ops_init (void );struct rst9574_ops {
@@ -270,7 +270,7 @@ struct rst9574_ops { };void nthw_reg_rst9574_ops (struct rst9574_ops *ops); -struct rst9574_ops *get_rst9574_ops (void ); +struct rst9574_ops *nthw_get_rst9574_ops (void );void rst9574_ops_init (void );struct rst_nt400dxx_ops {
@@ -279,7 +279,7 @@ struct rst_nt400dxx_ops { };void nthw_reg_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops); -struct rst_nt400dxx_ops *get_rst_nt400dxx_ops (void ); +struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops (void );void rst_nt400dxx_ops_init (void );struct flow_backend_ops {
@@ -289,7 +289,7 @@ struct flow_backend_ops { };void nthw_reg_flow_backend_ops (const struct flow_backend_ops *ops); -const struct flow_backend_ops *get_flow_backend_ops (void ); +const struct flow_backend_ops *nthw_get_flow_backend_ops (void );void nthw_flow_backend_init (void );struct profile_inline_ops {
@@ -447,7 +447,7 @@ struct profile_inline_ops { };void nthw_reg_profile_inline_ops (const struct profile_inline_ops *ops); -const struct profile_inline_ops *get_profile_inline_ops (void ); +const struct profile_inline_ops *nthw_get_profile_inline_ops (void );void nthw_profile_inline_init (void );struct flow_filter_ops {
@@ -560,15 +560,15 @@ struct flow_filter_ops { };void nthw_reg_dev_fp_flow_ops (const struct rte_flow_fp_ops *ops); -const struct rte_flow_fp_ops *get_dev_fp_flow_ops (void ); +const struct rte_flow_fp_ops *nthw_get_dev_fp_flow_ops (void );void nthw_dev_fp_flow_init (void );void nthw_reg_dev_flow_ops (const struct rte_flow_ops *ops); -const struct rte_flow_ops *get_dev_flow_ops (void ); +const struct rte_flow_ops *nthw_get_dev_flow_ops (void );void nthw_dev_flow_init (void );void nthw_reg_flow_filter_ops (const struct flow_filter_ops *ops); -const struct flow_filter_ops *get_flow_filter_ops (void ); +const struct flow_filter_ops *nthw_get_flow_filter_ops (void );void nthw_init_flow_filter (void );struct ntnic_xstats_ops {
@@ -592,7 +592,7 @@ struct ntnic_xstats_ops { };void nthw_reg_xstats_ops (struct ntnic_xstats_ops *ops); -struct ntnic_xstats_ops *get_ntnic_xstats_ops (void ); +struct ntnic_xstats_ops *nthw_get_xstats_ops (void );void ntnic_xstats_ops_init (void );#endif /* __NTNIC_MOD_REG_H__ */
Signature · 1 line
2.45.0
PATCH 22/24 net/ntnic: rename ops init functions
In reply to Serhii IliushykAdd prefix nthw_ to ops init function to follow the naming convention.
--- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 2 +- .../link_agx_100g/nt4ga_agx_link_100g.c | 2 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 4 ++-- .../clock_profiles/nthw_fpga_clk9563.c | 2 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 2 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 2 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 2 +- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 2 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 2 +- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 2 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 4 ++-- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 2 +- drivers/net/ntnic/ntnic_mod_reg.c | 18 +++++++++--------- drivers/net/ntnic/ntnic_mod_reg.h | 18 +++++++++--------- drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c | 2 +- 15 files changed, 33 insertions(+), 33 deletions(-)
drivers/net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c +1 -1
@@ -593,7 +593,7 @@ static struct nt4ga_stat_ops ops = { .nt4ga_stat_collect = nt4ga_stat_collect }; -void nt4ga_stat_ops_init (void ) +void nthw_stat_ops_init (void ) {NT_LOG_DBGX (DBG ,NTNIC ,"Stat module was initialized" );nthw_reg_nt4ga_stat_ops (&ops);
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
@@ -35,7 +35,7 @@ static struct link_ops_s link_agx_100g_ops = { .link_init = nt4ga_agx_link_100g_ports_init, }; -void link_agx_100g_init (void ) +void nthw_link_agx_100g_ops_init (void ) {nthw_reg_agx_100g_link_ops (&link_agx_100g_ops); }
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +2 -2
@@ -34,7 +34,7 @@ struct nt200a0x_ops {void nthw_reg_nt200a0x_ops (struct nt200a0x_ops *ops);struct nt200a0x_ops *nthw_get_nt200a0x_ops (void ); -void nt200a0x_ops_init (void ); +void nthw_nt200a0x_ops_init (void );struct nt400dxx_ops {int (*nthw_fpga_nt400dxx_init)(struct fpga_info_s *p_fpga_info);
@@ -42,6 +42,6 @@ struct nt400dxx_ops {void nthw_reg_nt400dxx_ops (struct nt400dxx_ops *ops);struct nt400dxx_ops *nthw_get_nt400dxx_ops (void ); -void nt400dxx_ops_init (void ); +void nthw_nt400dxx_ops_init (void );#endif /* __NTHW_FPGA_H__ */
drivers/net/ntnic/nthw/core/nt200a0x/clock_profiles/nthw_fpga_clk9563.c +1 -1
@@ -33,7 +33,7 @@ static struct clk9563_ops ops = { .get_n_data_9563_si5340_nt200a02_u23_v5 = get_p_data_9563_si5340_nt200a02_u23_v5 }; -void clk9563_ops_init (void ) +void nthw_clk9563_ops_init (void ) {nthw_reg_clk9563_ops (&ops); }
drivers/net/ntnic/nthw/core/nt200a0x/nthw_fpga_nt200a0x.c +1 -1
@@ -69,7 +69,7 @@ static int nthw_fpga_nt200a0x_init(struct fpga_info_s *p_fpga_info)static struct nt200a0x_ops nt200a0x_ops = { .nthw_fpga_nt200a0x_init = nthw_fpga_nt200a0x_init }; -void nt200a0x_ops_init (void ) +void nthw_nt200a0x_ops_init (void ) {NT_LOG (DBG ,NTHW ,"NT200A0X OPS INIT" );nthw_reg_nt200a0x_ops (&nt200a0x_ops);
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst9563.c +1 -1
@@ -233,7 +233,7 @@ static int nthw_fpga_rst9563_init(struct fpga_info_s *p_fpga_info,static struct rst9563_ops rst9563_ops = { .nthw_fpga_rst9563_init = nthw_fpga_rst9563_init }; -void rst9563_ops_init (void ) +void nthw_rst9563_ops_init (void ) {NT_LOG (DBG ,NTHW ,"RST9563 OPS INIT" );nthw_reg_rst9563_ops (&rst9563_ops);
drivers/net/ntnic/nthw/core/nt200a0x/reset/nthw_fpga_rst_nt200a0x.c +1 -1
@@ -575,7 +575,7 @@ static struct rst_nt200a0x_ops rst_nt200a0x_ops = { .nthw_fpga_rst_nt200a0x_init nthw_fpga_rst_nt200a0x_reset }; -void rst_nt200a0x_ops_init (void ) +void nthw_rst_nt200a0x_ops_init (void ) {NT_LOG (DBG ,NTHW ,"RST NT200A0X OPS INIT" );nthw_reg_rst_nt200a0x_ops (&rst_nt200a0x_ops);
drivers/net/ntnic/nthw/core/nt400dxx/nthw_fpga_nt400dxx.c +1 -1
@@ -213,7 +213,7 @@ static int nthw_fpga_nt400dxx_init(struct fpga_info_s *p_fpga_info)static struct nt400dxx_ops nt400dxx_ops = { .nthw_fpga_nt400dxx_init = nthw_fpga_nt400dxx_init }; -void nt400dxx_ops_init (void ) +void nthw_nt400dxx_ops_init (void ) {nthw_reg_nt400dxx_ops (&nt400dxx_ops); }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst9574.c +1 -1
@@ -371,7 +371,7 @@ static struct rst9574_ops rst9574_ops = { .nthw_fpga_rst9574_setup = nthw_fpga_rst9574_setup, }; -void rst9574_ops_init (void ) +void nthw_rst9574_ops_init (void ) {nthw_reg_rst9574_ops (&rst9574_ops); }
drivers/net/ntnic/nthw/core/nt400dxx/reset/nthw_fpga_rst_nt400dxx.c +1 -1
@@ -421,7 +421,7 @@ static struct rst_nt400dxx_ops rst_nt400dxx_ops = { .nthw_fpga_rst_nt400dxx_reset = nthw_fpga_rst_nt400dxx_reset }; -void rst_nt400dxx_ops_init (void ) +void nthw_rst_nt400dxx_ops_init (void ) {nthw_reg_rst_nt400dxx_ops (&rst_nt400dxx_ops); }
drivers/net/ntnic/nthw/core/nthw_fpga.c +2 -2
@@ -565,7 +565,7 @@ void nthw_reg_nt200a0x_ops(struct nt200a0x_ops *ops)struct nt200a0x_ops *nthw_get_nt200a0x_ops (void ) {if (nt200a0x_ops ==NULL ) -nt200a0x_ops_init (); +nthw_nt200a0x_ops_init ();return nt200a0x_ops; }
@@ -579,6 +579,6 @@ void nthw_reg_nt400dxx_ops(struct nt400dxx_ops *ops)struct nt400dxx_ops *nthw_get_nt400dxx_ops (void ) {if (nt400dxx_ops ==NULL ) -nt400dxx_ops_init (); +nthw_nt400dxx_ops_init ();return nt400dxx_ops; }
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +1 -1
@@ -1289,7 +1289,7 @@ static const struct ntnic_filter_ops ntnic_filter_ops = { .poll_statistics = poll_statistics, }; -void ntnic_filter_init (void ) +void nthw_filter_ops_init (void ) {nthw_reg_filter_ops (&ntnic_filter_ops); }
drivers/net/ntnic/ntnic_mod_reg.c +9 -9
@@ -50,7 +50,7 @@ void nthw_reg_filter_ops(const struct ntnic_filter_ops *ops)const struct ntnic_filter_ops *nthw_get_filter_ops (void ) {if (ntnic_filter_ops ==NULL ) -ntnic_filter_init (); +nthw_filter_ops_init ();return ntnic_filter_ops; }
@@ -82,7 +82,7 @@ void nthw_reg_agx_100g_link_ops(struct link_ops_s *ops)const struct link_ops_s *nthw_get_agx_100g_link_ops (void ) {if (link_agx_100g_ops ==NULL ) -link_agx_100g_init (); +nthw_link_agx_100g_ops_init ();return link_agx_100g_ops; }
@@ -110,7 +110,7 @@ void nthw_reg_nt4ga_stat_ops(const struct nt4ga_stat_ops *ops)const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops (void ) {if (nt4ga_stat_ops ==NULL ) -nt4ga_stat_ops_init (); +nthw_stat_ops_init ();return nt4ga_stat_ops; }
@@ -139,7 +139,7 @@ void nthw_reg_clk9563_ops(struct clk9563_ops *ops)struct clk9563_ops *nthw_get_clk9563_ops (void ) {if (clk9563_ops ==NULL ) -clk9563_ops_init (); +nthw_clk9563_ops_init ();return clk9563_ops; }
@@ -153,7 +153,7 @@ void nthw_reg_rst_nt200a0x_ops(struct rst_nt200a0x_ops *ops)struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops (void ) {if (rst_nt200a0x_ops ==NULL ) -rst_nt200a0x_ops_init (); +nthw_rst_nt200a0x_ops_init ();return rst_nt200a0x_ops; }
@@ -167,7 +167,7 @@ void nthw_reg_rst9563_ops(struct rst9563_ops *ops)struct rst9563_ops *nthw_get_rst9563_ops (void ) {if (rst9563_ops ==NULL ) -rst9563_ops_init (); +nthw_rst9563_ops_init ();return rst9563_ops; }
@@ -188,7 +188,7 @@ void nthw_reg_rst9574_ops(struct rst9574_ops *ops)struct rst9574_ops *nthw_get_rst9574_ops (void ) {if (rst9574_ops ==NULL ) -rst9574_ops_init (); +nthw_rst9574_ops_init ();return rst9574_ops; }
@@ -203,7 +203,7 @@ void nthw_reg_rst_nt400dxx_ops(struct rst_nt400dxx_ops *ops)struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops (void ) {if (rst_nt400dxx_ops ==NULL ) -rst_nt400dxx_ops_init (); +nthw_rst_nt400dxx_ops_init ();return rst_nt400dxx_ops; }
@@ -286,7 +286,7 @@ void nthw_reg_xstats_ops(struct ntnic_xstats_ops *ops)struct ntnic_xstats_ops *nthw_get_xstats_ops (void ) {if (ntnic_xstats_ops ==NULL ) -ntnic_xstats_ops_init (); +nthw_xstats_ops_init ();return ntnic_xstats_ops; }
drivers/net/ntnic/ntnic_mod_reg.h +9 -9
@@ -141,7 +141,7 @@ struct ntnic_filter_ops {void nthw_reg_filter_ops (const struct ntnic_filter_ops *ops);const struct ntnic_filter_ops *nthw_get_filter_ops (void ); -void ntnic_filter_init (void ); +void nthw_filter_ops_init (void );struct link_ops_s {int (*link_init)(struct adapter_info_s *p_adapter_info,nthw_fpga_t *p_fpga);
@@ -153,7 +153,7 @@ void nthw_link_100g_init(void);void nthw_reg_agx_100g_link_ops (struct link_ops_s *ops);const struct link_ops_s *nthw_get_agx_100g_link_ops (void ); -void link_agx_100g_init (void ); +void nthw_link_agx_100g_ops_init (void );struct port_ops {bool (*get_nim_present)(struct adapter_info_s *p,int port);
@@ -220,7 +220,7 @@ struct nt4ga_stat_ops {void nthw_reg_nt4ga_stat_ops (const struct nt4ga_stat_ops *ops);const struct nt4ga_stat_ops *nthw_get_nt4ga_stat_ops (void ); -void nt4ga_stat_ops_init (void ); +void nthw_stat_ops_init (void );struct adapter_ops {int (*init)(struct adapter_info_s *p_adapter_info);
@@ -240,7 +240,7 @@ struct clk9563_ops {void nthw_reg_clk9563_ops (struct clk9563_ops *ops);struct clk9563_ops *nthw_get_clk9563_ops (void ); -void clk9563_ops_init (void ); +void nthw_clk9563_ops_init (void );struct rst_nt200a0x_ops { int (*nthw_fpga_rst_nt200a0x_init)(struct fpga_info_s *p_fpga_info,
@@ -251,7 +251,7 @@ struct rst_nt200a0x_ops {void nthw_reg_rst_nt200a0x_ops (struct rst_nt200a0x_ops *ops);struct rst_nt200a0x_ops *nthw_get_rst_nt200a0x_ops (void ); -void rst_nt200a0x_ops_init (void ); +void nthw_rst_nt200a0x_ops_init (void );struct rst9563_ops { int (*nthw_fpga_rst9563_init)(struct fpga_info_s *p_fpga_info,
@@ -260,7 +260,7 @@ struct rst9563_ops {void nthw_reg_rst9563_ops (struct rst9563_ops *ops);struct rst9563_ops *nthw_get_rst9563_ops (void ); -void rst9563_ops_init (void ); +void nthw_rst9563_ops_init (void );struct rst9574_ops { int (*nthw_fpga_rst9574_init)(struct fpga_info_s *p_fpga_info,
@@ -271,7 +271,7 @@ struct rst9574_ops {void nthw_reg_rst9574_ops (struct rst9574_ops *ops);struct rst9574_ops *nthw_get_rst9574_ops (void ); -void rst9574_ops_init (void ); +void nthw_rst9574_ops_init (void );struct rst_nt400dxx_ops {int (*nthw_fpga_rst_nt400dxx_init)(struct fpga_info_s *p_fpga_info);
@@ -280,7 +280,7 @@ struct rst_nt400dxx_ops {void nthw_reg_rst_nt400dxx_ops (struct rst_nt400dxx_ops *ops);struct rst_nt400dxx_ops *nthw_get_rst_nt400dxx_ops (void ); -void rst_nt400dxx_ops_init (void ); +void nthw_rst_nt400dxx_ops_init (void );struct flow_backend_ops { const struct flow_api_backend_ops *(*nthw_bin_flow_backend_init)(nthw_fpga_t *p_fpga,
@@ -593,6 +593,6 @@ struct ntnic_xstats_ops {void nthw_reg_xstats_ops (struct ntnic_xstats_ops *ops);struct ntnic_xstats_ops *nthw_get_xstats_ops (void ); -void ntnic_xstats_ops_init (void ); +void nthw_xstats_ops_init (void );#endif /* __NTNIC_MOD_REG_H__ */
drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c +1 -1
@@ -819,7 +819,7 @@ static struct ntnic_xstats_ops ops = { .nthw_xstats_get_by_id = nthw_xstats_get_by_id }; -void ntnic_xstats_ops_init (void ) +void nthw_xstats_ops_init (void ) {NT_LOG_DBGX (DBG ,NTNIC ,"xstats module was initialized" );nthw_reg_xstats_ops (&ops);
Signature · 1 line
2.45.0
PATCH 23/24 net/ntnic: rename nim agx setup function
In reply to Serhii IliushykAdd prefix nthw_ to nim_agx_setup to follow naming convention.
--- drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c | 2 +- drivers/net/ntnic/nim/i2c_nim.c | 2 +- drivers/net/ntnic/nim/i2c_nim.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +1 -1
@@ -991,7 +991,7 @@ int nt4ga_agx_link_100g_ports_init(struct adapter_info_s *p_adapter_info, nthw_ffor (i =0 ; i < nb_ports; i++) {/* 2 + adapter port number */ const uint8_t instance = (uint8_t )(2U + i); -nim_agx_setup (&nim_ctx[i], p_nthw_agx->p_io_nim, p_nthw_agx->p_i2cm, +nthw_nim_agx_setup (&nim_ctx[i], p_nthw_agx->p_io_nim, p_nthw_agx->p_i2cm, p_nthw_agx->p_pca9849); nim_ctx[i].hwagx.mux_channel = i; nim_ctx[i].instance = instance;/* not used */
drivers/net/ntnic/nim/i2c_nim.c +1 -1
@@ -881,7 +881,7 @@ bool nthw_qsfp28_set_fec_enable(nim_i2c_ctx_p ctx, bool media_side_fec, bool hosreturn true; } -void nim_agx_setup (struct nim_i2c_ctx *ctx,nthw_pcal6416a_t *p_io_nim,nthw_i2cm_t *p_nt_i2cm, +void nthw_nim_agx_setup (struct nim_i2c_ctx *ctx,nthw_pcal6416a_t *p_io_nim,nthw_i2cm_t *p_nt_i2cm,nthw_pca9849_t *p_ca9849) { ctx->hwagx.p_nt_i2cm = p_nt_i2cm;
drivers/net/ntnic/nim/i2c_nim.h +1 -1
@@ -36,7 +36,7 @@ int nthw_construct_and_preinit_nim(nim_i2c_ctx_p ctx, void *extra);void nthw_qsfp28_set_high_power (nim_i2c_ctx_p ctx);bool nthw_qsfp28_set_fec_enable (nim_i2c_ctx_p ctx,bool media_side_fec,bool host_side_fec); -void nim_agx_setup (struct nim_i2c_ctx *ctx,nthw_pcal6416a_t *p_io_nim,nthw_i2cm_t *p_nt_i2cm, +void nthw_nim_agx_setup (struct nim_i2c_ctx *ctx,nthw_pcal6416a_t *p_io_nim,nthw_i2cm_t *p_nt_i2cm,nthw_pca9849_t *p_ca9849);#endif /* I2C_NIM_H_ */
Signature · 1 line
2.45.0
PATCH 24/24 net/ntnic: rename table ID functions
In reply to Serhii IliushykExtent table id functions with prefix nthw_.
--- drivers/net/ntnic/nthw/flow_api/flow_id_table.c | 10 +++++----- drivers/net/ntnic/nthw/flow_api/flow_id_table.h | 10 +++++----- .../profile_inline/flow_api_profile_inline.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-)
drivers/net/ntnic/nthw/flow_api/flow_id_table.c +5 -5
@@ -64,7 +64,7 @@ static inline uint32_t ntnic_id_table_array_pop_free_id(struct ntnic_id_table_dareturn id; } -void *ntnic_id_table_create (void ) +void *nthw_id_table_create (void ) {struct ntnic_id_table_data *handle =calloc (1 ,sizeof (struct ntnic_id_table_data ));
@@ -74,7 +74,7 @@ void *ntnic_id_table_create(void)return handle; } -void ntnic_id_table_destroy (void *id_table) +void nthw_id_table_destroy (void *id_table) {struct ntnic_id_table_data *handle = id_table;
@@ -84,7 +84,7 @@ void ntnic_id_table_destroy(void *id_table)free (id_table); } -uint32_t ntnic_id_table_get_id (void *id_table,union flm_handles flm_h,uint8_t caller_id, +uint32_t nthw_id_table_get_id (void *id_table,union flm_handles flm_h,uint8_t caller_id,uint8_t type) {struct ntnic_id_table_data *handle = id_table;
@@ -106,7 +106,7 @@ uint32_t ntnic_id_table_get_id(void *id_table, union flm_handles flm_h, uint8_treturn new_id; } -void ntnic_id_table_free_id (void *id_table,uint32_t id) +void nthw_id_table_free_id (void *id_table,uint32_t id) {struct ntnic_id_table_data *handle = id_table;
@@ -129,7 +129,7 @@ void ntnic_id_table_free_id(void *id_table, uint32_t id)rte_spinlock_unlock (&handle->mtx); } -void ntnic_id_table_find (void *id_table,uint32_t id,union flm_handles *flm_h,uint8_t *caller_id, +void nthw_id_table_find (void *id_table,uint32_t id,union flm_handles *flm_h,uint8_t *caller_id,uint8_t *type) {struct ntnic_id_table_data *handle = id_table;
drivers/net/ntnic/nthw/flow_api/flow_id_table.h +5 -5
@@ -13,14 +13,14 @@ union flm_handles { void *p; }; -void *ntnic_id_table_create (void ); -void ntnic_id_table_destroy (void *id_table); +void *nthw_id_table_create (void ); +void nthw_id_table_destroy (void *id_table); -uint32_t ntnic_id_table_get_id (void *id_table,union flm_handles flm_h,uint8_t caller_id, +uint32_t nthw_id_table_get_id (void *id_table,union flm_handles flm_h,uint8_t caller_id,uint8_t type); -void ntnic_id_table_free_id (void *id_table,uint32_t id); +void nthw_id_table_free_id (void *id_table,uint32_t id); -void ntnic_id_table_find (void *id_table,uint32_t id,union flm_handles *flm_h,uint8_t *caller_id, +void nthw_id_table_find (void *id_table,uint32_t id,union flm_handles *flm_h,uint8_t *caller_id,uint8_t *type);#endif /* FLOW_ID_TABLE_H_ */
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +8 -8
@@ -211,7 +211,7 @@ static int flow_mtr_create_meter(struct flow_eth_dev *dev,union flm_handles flm_h; flm_h.idx = mtr_id; -uint32_t flm_id =ntnic_id_table_get_id (dev->ndev->id_table_handle, flm_h, caller_id,2 ); +uint32_t flm_id =nthw_id_table_get_id (dev->ndev->id_table_handle, flm_h, caller_id,2 ); learn_record->sw9 = flm_id; learn_record->kid =1 ;
@@ -327,7 +327,7 @@ static int flow_mtr_destroy_meter(struct flow_eth_dev *dev, uint8_t caller_id, u mtr_stat[mtr_id].n_pkt_base =0 ; mtr_stat[mtr_id].buckets =NULL ; -ntnic_id_table_free_id (dev->ndev->id_table_handle, flm_id); +nthw_id_table_free_id (dev->ndev->id_table_handle, flm_id);nthw_flm_lrn_queue_release_write_buffer (flm_lrn_queue_arr);
@@ -431,7 +431,7 @@ static void flm_mtr_read_inf_records(struct flow_eth_dev *dev, uint32_t *data, uuint8_t caller_id;uint8_t type;union flm_handles flm_h; -ntnic_id_table_find (dev->ndev->id_table_handle, inf_data->id, &flm_h, &caller_id, +nthw_id_table_find (dev->ndev->id_table_handle, inf_data->id, &flm_h, &caller_id, &type);/* Check that received record hold valid meter statistics */
@@ -507,7 +507,7 @@ static void flm_mtr_read_sta_records(struct flow_eth_dev *dev, uint32_t *data, uuint8_t caller_id;uint8_t type;union flm_handles flm_h; -ntnic_id_table_find (dev->ndev->id_table_handle, sta_data->id, &flm_h, &caller_id, +nthw_id_table_find (dev->ndev->id_table_handle, sta_data->id, &flm_h, &caller_id, &type);if (type ==1 ) {
@@ -958,14 +958,14 @@ static int flm_flow_programming(struct flow_handle *fh, uint32_t flm_op)if (flm_op ==NT_FLM_OP_LEARN ) {union flm_handles flm_h; flm_h.p = fh; - fh->flm_id =ntnic_id_table_get_id (fh->dev->ndev->id_table_handle, flm_h, + fh->flm_id =nthw_id_table_get_id (fh->dev->ndev->id_table_handle, flm_h, fh->caller_id,1 ); }uint32_t flm_id = fh->flm_id;if (flm_op ==NT_FLM_OP_UNLEARN ) { -ntnic_id_table_free_id (fh->dev->ndev->id_table_handle, flm_id); +nthw_id_table_free_id (fh->dev->ndev->id_table_handle, flm_id);if (rte_atomic_load_explicit (&fh->learn_ignored, rte_memory_order_seq_cst) ==1 )return 0 ;
@@ -4057,7 +4057,7 @@ int nthw_init_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev)nthw_mod_flm_pst_flush (&ndev->be,0 ,ALL_ENTRIES ); - ndev->id_table_handle =ntnic_id_table_create (); + ndev->id_table_handle =nthw_id_table_create ();if (ndev->id_table_handle ==NULL ) goto err_exit0;
@@ -4132,7 +4132,7 @@ int nthw_done_flow_mgmnt_of_ndev_profile_inline(struct flow_nic_dev *ndev)free (ndev->flm_mtr_handle);nthw_flow_group_handle_destroy (&ndev->group_handle); -ntnic_id_table_destroy (ndev->id_table_handle); +nthw_id_table_destroy (ndev->id_table_handle);nthw_mod_cat_cfn_set (&ndev->be,HW_CAT_CFN_PRESET_ALL ,0 ,0 ,0 );nthw_mod_cat_cfn_flush (&ndev->be,0 ,1 );
Signature · 1 line
2.45.0
cover Migrate threads to the DPDK service framework and refactor naming for exported symbols
In reply to Serhii IliushykThis modification provides better resource (CPU) management for NTNIC PMD.
The following threads are migrated:
* FLM update thread
* Statistic thread
* Port event thread
* Adapter monitoring thread
Additionally, a warning is added to inform users about the importance of dedicating lcores to the DPDK service framework when using the NTNIC PMD. The code is also cleaned up to use pthreads and rte_thread APIs.
After this patch series, an each application using NTNIC PMD should dedicate at least five(5) cores for DPDK service framework to ensure proper operation of the NTNIC PMD.
The service cores can be dedicated by EAL options:
* s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
* S SERVICE CORELIST List of cores to run services on
Or with a special API by the application itself.
* rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
* rte_pmd_ntnic_service_get_id to get a service ID.
This patch series also includes aligning the naming of the exported symbols to avoid potential conflicts with other applications and libraries.
The main change is to add the prefix "nthw_".
Serhii Iliushyk (24):
net/ntnic: introduce service API for NTNIC PMD net/ntnic: migrate flm update thread to service net/ntnic: migrate statistic thread to service net/ntnic: migrate port event thread to service net/ntnic: migrate adapter mon thread to service net/ntnic: add warning about service cores net/ntnic: avoid using thread API net/ntnic: fix potential format overflow net/ntnic: single file function as static net/ntnic: remove unused functions net/ntnic: move nthw to prefix part net/ntnic: change prefix hw to prefix nthw net/ntnic: modify prefix flow with prefix nthw net/ntnic: change prefix flm to prefix nthw net/ntnic: change prefix nt to prefix nthw net/ntnic: change prefix ntlog to prefix nthw net/ntnic: change prefix km to prefix nthw net/ntnic: change prefix set to prefix nthw net/ntnic: rename common hash and flow functions net/ntnic: rename register ops function net/ntnic: rename get ops functions net/ntnic: rename ops init functions net/ntnic: rename nim agx setup function net/ntnic: rename table ID functions
doc/guides/nics/ntnic.rst | 112 ++ drivers/net/ntnic/adapter/nt4ga_adapter.c | 41 +- .../net/ntnic/adapter/nt4ga_stat/nt4ga_stat.c | 10 +- drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 54 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/create_elements.h | 9 - drivers/net/ntnic/include/flow_api.h | 10 +- drivers/net/ntnic/include/flow_api_engine.h | 18 +- drivers/net/ntnic/include/hw_mod_backend.h | 281 ++-- drivers/net/ntnic/include/nt4ga_adapter.h | 4 - drivers/net/ntnic/include/ntdrv_4ga.h | 4 - drivers/net/ntnic/include/ntnic_dbs.h | 22 +- drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 4 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 315 ++-- .../link_agx_100g/nt4ga_agx_link_100g.c | 326 ++-- drivers/net/ntnic/link_mgmt/nt4ga_link.c | 2 +- drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nim/i2c_nim.c | 10 +- drivers/net/ntnic/nim/i2c_nim.h | 2 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 14 +- .../net/ntnic/nthw/core/include/nthw_hif.h | 12 - .../net/ntnic/nthw/core/include/nthw_iic.h | 9 - .../ntnic/nthw/core/include/nthw_mac_pcs.h | 9 - .../net/ntnic/nthw/core/include/nthw_pcie3.h | 13 - .../nthw/core/include/nthw_pcm_nt400dxx.h | 1 - .../ntnic/nthw/core/include/nthw_phy_tile.h | 2 - .../net/ntnic/nthw/core/include/nthw_rpf.h | 2 - .../net/ntnic/nthw/core/include/nthw_si5340.h | 2 - .../clock_profiles/nthw_fpga_clk9563.c | 4 +- .../nthw/core/nt200a0x/nthw_fpga_nt200a0x.c | 8 +- .../core/nt200a0x/reset/nthw_fpga_rst9563.c | 8 +- .../nt200a0x/reset/nthw_fpga_rst_nt200a0x.c | 6 +- .../nthw/core/nt400dxx/nthw_fpga_nt400dxx.c | 8 +- .../core/nt400dxx/reset/nthw_fpga_rst9574.c | 22 +- .../nt400dxx/reset/nthw_fpga_rst_nt400dxx.c | 36 +- drivers/net/ntnic/nthw/core/nthw_fpga.c | 22 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 90 -- drivers/net/ntnic/nthw/core/nthw_i2cm.c | 4 +- drivers/net/ntnic/nthw/core/nthw_igam.c | 4 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 240 +-- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 67 +- drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 - drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - drivers/net/ntnic/nthw/core/nthw_pcie3.c | 86 -- .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c | 5 - drivers/net/ntnic/nthw/core/nthw_phy_tile.c | 51 +- drivers/net/ntnic/nthw/core/nthw_rpf.c | 14 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 3 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 6 +- drivers/net/ntnic/nthw/core/nthw_spi_v3.c | 12 +- drivers/net/ntnic/nthw/dbs/nthw_dbs.c | 22 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 253 ++-- .../nthw/flow_api/flow_backend/flow_backend.c | 1342 ++++++++--------- drivers/net/ntnic/nthw/flow_api/flow_filter.c | 4 +- .../net/ntnic/nthw/flow_api/flow_hsh_cfg.c | 46 +- .../net/ntnic/nthw/flow_api/flow_hsh_cfg.h | 2 +- .../net/ntnic/nthw/flow_api/flow_id_table.c | 10 +- .../net/ntnic/nthw/flow_api/flow_id_table.h | 10 +- drivers/net/ntnic/nthw/flow_api/flow_kcc.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_km.c | 134 +- .../nthw/flow_api/hw_mod/hw_mod_backend.c | 18 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 356 ++--- .../ntnic/nthw/flow_api/hw_mod/hw_mod_flm.c | 70 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_hsh.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 107 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 40 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_qsl.c | 32 +- .../nthw/flow_api/hw_mod/hw_mod_slc_lr.c | 14 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 80 +- .../flow_api/profile_inline/flm_age_queue.c | 22 +- .../flow_api/profile_inline/flm_age_queue.h | 20 +- .../flow_api/profile_inline/flm_lrn_queue.c | 12 +- .../flow_api/profile_inline/flm_lrn_queue.h | 12 +- .../profile_inline/flow_api_hw_db_inline.c | 1138 +++++++------- .../profile_inline/flow_api_hw_db_inline.h | 99 +- .../profile_inline/flow_api_profile_inline.c | 598 ++++---- .../profile_inline/flow_api_profile_inline.h | 49 +- .../ntnic/nthw/flow_filter/flow_nthw_cat.c | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_cat.h | 230 +-- .../ntnic/nthw/flow_filter/flow_nthw_csu.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_csu.h | 24 +- .../ntnic/nthw/flow_filter/flow_nthw_flm.c | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_flm.h | 278 ++-- .../ntnic/nthw/flow_filter/flow_nthw_hfu.c | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hfu.h | 58 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.c | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_hsh.h | 60 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.c | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_ifr.h | 30 +- .../ntnic/nthw/flow_filter/flow_nthw_info.c | 88 +- .../ntnic/nthw/flow_filter/flow_nthw_info.h | 88 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.c | 160 +- .../net/ntnic/nthw/flow_filter/flow_nthw_km.h | 162 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.c | 54 +- .../ntnic/nthw/flow_filter/flow_nthw_pdb.h | 56 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.c | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_qsl.h | 68 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.c | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_rpp_lr.h | 32 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.c | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_slc_lr.h | 28 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.c | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_cpy.h | 22 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.c | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_ins.h | 20 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.c | 42 +- .../ntnic/nthw/flow_filter/flow_nthw_tx_rpl.h | 46 +- .../net/ntnic/nthw/model/nthw_fpga_model.c | 577 +++---- .../net/ntnic/nthw/model/nthw_fpga_model.h | 28 - drivers/net/ntnic/nthw/nthw_platform.c | 2 +- drivers/net/ntnic/nthw/nthw_platform_drv.h | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 28 +- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 20 +- .../nthw/supported/nthw_fpga_mod_str_map.c | 2 +- .../nthw/supported/nthw_fpga_mod_str_map.h | 2 +- drivers/net/ntnic/ntlog/ntlog.c | 6 +- drivers/net/ntnic/ntlog/ntlog.h | 6 +- drivers/net/ntnic/ntnic_ethdev.c | 617 ++++---- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 66 +- drivers/net/ntnic/ntnic_mod_reg.c | 96 +- drivers/net/ntnic/ntnic_mod_reg.h | 142 +- drivers/net/ntnic/ntnic_vfio.c | 18 +- drivers/net/ntnic/ntnic_vfio.h | 12 +- drivers/net/ntnic/ntnic_xstats/ntnic_xstats.c | 4 +- drivers/net/ntnic/ntutil/nt_service.c | 127 ++ drivers/net/ntnic/ntutil/nt_service.h | 62 + drivers/net/ntnic/ntutil/nt_util.c | 75 +- drivers/net/ntnic/ntutil/nt_util.h | 21 +- drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 26 + 131 files changed, 5500 insertions(+), 5449 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
Signature · 1 line
2.45.0
PATCH 1/24 net/ntnic: introduce service API for NTNIC PMD
This commit adds a common service API for the NTNIC PMD, which includes functions for service management: add or delete a service and retrieve information about a service.
The API is designed to facilitate the interaction with services within the NTNIC driver, allowing for better control
and monitoring of service states.
--- doc/guides/nics/ntnic.rst | 112 ++++++++++++++++++++++++++ drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/ntutil/nt_service.c | 103 +++++++++++++++++++++++ drivers/net/ntnic/ntutil/nt_service.h | 62 ++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.c | 104 ++++++++++++++++++++++++ drivers/net/ntnic/rte_pmd_ntnic.h | 21 +++++ 6 files changed, 404 insertions(+) create mode 100644 drivers/net/ntnic/ntutil/nt_service.c create mode 100644 drivers/net/ntnic/ntutil/nt_service.h create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
doc/guides/nics/ntnic.rst +112 -0
@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1); + +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
drivers/net/ntnic/meson.build +2 -0
@@ -120,7 +120,9 @@ sources = files( 'ntlog/ntlog.c', 'ntnic_filter/ntnic_filter.c', 'ntutil/nt_util.c', + 'ntutil/nt_service.c', 'ntnic_mod_reg.c', 'ntnic_vfio.c', 'ntnic_ethdev.c', + 'rte_pmd_ntnic.c', )
drivers/net/ntnic/ntutil/nt_service.c new file +103 -0
103 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.h new file +62 -0
62 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.c new file +104 -0
104 lines not on this page · raw message
drivers/net/ntnic/rte_pmd_ntnic.h +21 -0
@@ -40,4 +40,25 @@ enum rte_ntnic_event_type { RTE_NTNIC_FLM_STATS_EVENT, }; +enum rte_ntnic_service_tag { +RTE_NTNIC_SERVICE_MAX =1 +}; + +/** +* Set the lcore for a specific service. +* +* @param tag The service tag to set the lcore for. +* @param lcore_id The lcore ID to set for the service. +* @return 0 on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_set_lcore (enum rte_ntnic_service_tag tag,uint32_t lcore_id); + +/** +* Get the ID of a specific service. +* +* @param tag The service tag to get the ID for. +* @return The service ID on success, negative value on failure. +*/ +int rte_pmd_ntnic_service_get_id (enum rte_ntnic_service_tag tag); +#endif /* NTNIC_EVENT_H_ */
Signature · 1 line
2.45.0
Re: [PATCH v1 01/24] net/ntnic: introduce service API for NTNIC PMD
20/10/2025 18:35, Serhii Iliushyk:
Quoted 108 lines
doc/guides/nics/ntnic.rst +102
-0@@ -185,3 +185,115 @@ There are list of characteristics that age timeout action has: - after flow is aged-out it's not automatically deleted; - aged-out flow can be updated with ``flow update`` command, and its aged-out status will be reverted; + +Service API +----------- + +**nthw_service_add** +**nthw_service_del** +**nthw_service_get_info** + +The NTNIC PMD provides a service API that allows applications to configure services + +The services are responsible for handling the vital functionality of the NTNIC PMD: + +- **FLM Update**: is responsible for creating and destroying flows; +- **Statistics**: is responsible for collecting statistics; +- **Port event**: is responsible for handling port events: aging, port load, and flow load; +- **Adapter monitor** is responsible for link control; + +**NOTE**: Use next EAL options to configure set service cores + * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; + * -S SERVICE CORELIST List of cores to run services on; + +**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + +For example + +.. code-block:: console + + dpdk-testpmd -S 8,9,10,11,12 + +The PMD registers each service during initialization by function: + +.. code-block:: c + + int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) + +and unregistered by the PMD during deinitialization by the function: + +.. code-block:: c + + int nthw_service_del(const enum rte_ntnic_service_tag tag) + +The service info may be retrieved by function: + +.. code-block:: c + + struct nt_service *nthw_service_get_info(const enum rte_ntnic_service_tag tag) + +The service info includes the service ID, assigned lcore, and initialization state. + +Service API for user applications +--------------------------------- +**rte_pmd_ntnic_service_set_lcore** +**rte_pmd_ntnic_service_get_id** + +The exported service API is available for applications to configure the services. + +By API function: + +.. code-block:: c + + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) + +For example to assign lcores 8,9,10,11,12 to the services, the application can use: + +.. code-block:: c + + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); + +The API will automatically lcore to service core list and map the service to the lcore. + +.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +Each service has its own tag to identify it. + +.. code-block:: c + + enum rte_ntnic_service_tag { + RTE_NTNIC_SERVICE_FLM_UPDATE = 0, + RTE_NTNIC_SERVICE_STAT = 1, + RTE_NTNIC_SERVICE_PORT_0_EVENT = 2, + RTE_NTNIC_SERVICE_PORT_1_EVENT = 3, + RTE_NTNIC_SERVICE_ADAPTER_MON = 4, + RTE_NTNIC_SERVICE_MAX + }; + +The application may use next API function to retrieve the service id: + +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + + +For example, to enable statistics for flm_update service, the application can use: + +.. code-block:: c + + int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); + rte_service_set_stats_enable(flm_update_id, 1);
doc/guides/nics/ntnic.rst There are list of characteristics that age timeout action has: · line 299
Quoted 10 lines
doc/guides/nics/ntnic.rst +10
-0+ +All other manipulations with the service can be done with the service ID and rte_service* API. + +To use the service API, an application must have included the header file: + +.. code-block:: c + + #include <rte_pmd_ntnic.h> + +And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
This doc is a real mess considering formatting.
I suppose you didn't read it twice and never tried to generate HTML output. I'll do a quick cleanup while pulling in the main branch.
cover cleanup the guide for NTNIC PMD
Hi Thomas,
I have made a quick cleanup of the NTNIC PMD guide. Please take a look at the related patch.
Serhii Iliushyk (1):
doc: refactoring the guide for NTNIC PMD
doc/guides/nics/ntnic.rst | 262 ++++++++++++++++++++------------------ 1 file changed, 140 insertions(+), 122 deletions(-)
Signature · 1 line
2.45.0
PATCH 1/1 doc: refactoring the guide for NTNIC PMD
Improve the doc formatting.
--- doc/guides/nics/ntnic.rst | 262 ++++++++++++++++++++------------------ 1 file changed, 140 insertions(+), 122 deletions(-)
doc/guides/nics/ntnic.rst +140 -122
@@ -4,7 +4,7 @@ NTNIC Poll Mode Driver ====================== -The NTNIC PMD provides poll mode driver support for Napatech smartNICs. +The NTNIC PMD provides poll-mode driver (PMD) support for Napatech SmartNICs. Design
@@ -23,66 +23,66 @@ The physical ports are located behind PF0 as DPDK port 0 and 1. Supported NICs -------------- -- NT200A02 2x100G SmartNIC +================== ================ ================================ +SmartNIC total bandwidth FPGA id +================== ================ ================================ +**NT200A02** 2x100 Gb/s 9563 (Inline Flow Management) +**NT400D11** 2x100 Gb/s 9569 (Inline Flow Management) +**NT400D13** 2x100 Gb/s 9574 (Inline Flow Management) +================== ================ ================================ - - FPGA ID 9563 (Inline Flow Management) +All information about Napatech SmartNICs can be found by links below: -- NT400D11 2x100G SmartNIC - - - FPGA ID 9569 (Inline Flow Management) - -- NT400D13 2x100G SmartNIC - - - FPGA ID 9574 (Inline Flow Management) - -All information about NT200A02 and NT400D13 can be found by links below: - -- https://www.napatech.com/products/nt200a02-smartnic-inline/ -- https://www.napatech.com/products/nt400d11-smartnic-programmable/ -- https://www.napatech.com/products/nt400d13-smartnic-programmable/ -- https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/ +- `NT200A02 <https://www.napatech.com/products/nt200a02-smartnic-inline/>`_ +- `NT400D11 <https://www.napatech.com/products/nt400d11-smartnic-programmable/>`_ +- `NT400D13 <https://www.napatech.com/products/nt400d13-smartnic-programmable/>`_ +- `Napatech FPGA-based SmartNICs <https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/>`_ Features -------- - -- FW version -- Speed capabilities -- Link status (Link update only) -- Unicast MAC filter -- Multicast MAC filter -- Promiscuous mode (Enable only. The device always run promiscuous mode) -- Flow API support. -- Support for multiple rte_flow groups. -- Multiple TX and RX queues. -- Scattered and gather for TX and RX. -- Jumbo frame support. -- Traffic mirroring. -- VLAN filtering. -- Packet modification: NAT, TTL decrement, DSCP tagging -- Tunnel types: GTP. -- Encapsulation and decapsulation of GTP data. -- RX VLAN stripping via raw decap. -- TX VLAN insertion via raw encap. -- CAM and TCAM based matching. -- Exact match of 140 million flows and policies. -- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. -- RSS hash -- RSS key update -- RSS based on VLAN or 5-tuple. -- RSS using different combinations of fields: L3 only, L4 only or both, - and source only, destination only or both. -- Several RSS hash keys, one for each flow type. -- Default RSS operation with no hash key specification. -- Port and queue statistics. -- RMON statistics in extended stats. -- Link state information. -- Flow statistics -- Flow aging support -- Flow metering, including meter policy API. -- Flow update. Update of the action list for specific flow -- Asynchronous flow support -- MTU update +.. rst-class:: punchcard + +================================================================================================================ ======= +Supported Features Linux +================================================================================================================ ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X +Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. X +Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using different combinations of fields: L3 only, L4 only or both, and source only, destination only or both. X +Several RSS hash keys, one for each flow type. X +Default RSS operation with no hash key specification. X +Port and queue statistics. X +RMON statistics in extended stats. X +Link state information. X +Flow statistics X +Flow aging support X +Flow metering, including meter policy API. X +Flow update. Update of the action list for specific flow X +Asynchronous flow support X +MTU update X +================================================================================================================ ======= Limitations ~~~~~~~~~~~
@@ -103,76 +103,86 @@ 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. +NTNIC-specific arguments can be passed in the PCI device parameter list: -``--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:: +.. code-block:: console - <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] + <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] -The NTNIC specific argument format is:: + 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. + Multiple arguments for the same device are separated by commas. The + ``<object-ids>`` field can be a single value or a range. + +- ``rxqs`` parameter [int] -``rxqs`` parameter [int] + Number of Rx queues to use. Example: - Specify number of Rx queues to use:: +.. code-block:: console -a <domain>:<bus>:00.0,rxqs=4,txqs=4 By default, the value is set to 1. -``txqs`` parameter [int] +- ``txqs`` parameter [int] + + Number of Tx queues to use. Example: - Specify number of Tx queues to use:: +.. code-block:: console -a <domain>:<bus>:00.0,rxqs=4,txqs=4 By default, the value is set to 1. -``exception_path`` parameter [int] +- ``exception_path`` parameter [int] Enable exception path for unmatched packets to go through queue 0. - To enable exception_path:: + To enable exception_path: + +.. code-block:: console -a <domain>:<bus>:00.0,exception_path=1 By default, the value is set to 0. 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:: + Logging info from the main PMD code. i.e. code that is related to DPDK: + + .. code-block:: console --log-level=pmd.net.ntnic.ntnic,8 NTHW - Logging info from NTHW. i.e. code that is related to the FPGA and the adapter:: + Logging info from NTHW. i.e. code that is related to the FPGA and the adapter: + + .. code-block:: console --log-level=pmd.net.ntnic.nthw,8 FILTER - Logging info from filter. i.e. code that is related to the binary filter:: + Logging info from filter. i.e. code that is related to the binary filter: + + .. code-block:: console - --log-level=pmd.net.ntnic.filter,8 + --log-level=pmd.net.ntnic.filter,8 -To enable logging on all levels use wildcard in the following way:: +To enable logging on all levels use wildcard in the following way: + +.. code-block:: console --log-level=pmd.net.ntnic.*,8 Flow Scanner ------------- +~~~~~~~~~~~~ Flow Scanner is DPDK mechanism that constantly and periodically scans the flow tables to check for aged-out flows.
@@ -202,46 +212,55 @@ There are list of characteristics that age timeout action has: and its aged-out status will be reverted; Service API ------------ +~~~~~~~~~~~ + +The NTNIC PMD provides a service API that allows applications to configure +and manage PMD services. + +Primary service functions: + +**nthw_service_add**, **nthw_service_del**, **nthw_service_get_info** -**nthw_service_add** -**nthw_service_del** -**nthw_service_get_info** +Services handle vital PMD functionality such as: -The NTNIC PMD provides a service API that allows applications to configure services +======================== ================================================= +Service name Service purpose +======================== ================================================= +**FLM Update** create and destroy flows +**Statistics** collect statistics +**Port event** handle port events (aging, port load, flow load) +**Adapter monitor** monitor link state +======================== ================================================= -The services are responsible for handling the vital functionality of the NTNIC PMD: +Reserve service lcores via EAL options. Examples: -- **FLM Update**: is responsible for creating and destroying flows; -- **Statistics**: is responsible for collecting statistics; -- **Port event**: is responsible for handling port events: aging, port load, and flow load; -- **Adapter monitor** is responsible for link control; +- ``-s SERVICE COREMASK`` — hexadecimal bitmask of cores to use as service cores +- ``-S SERVICE CORELIST`` — list of cores to run services on -**NOTE**: Use next EAL options to configure set service cores - * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; - * -S SERVICE CORELIST List of cores to run services on; + .. note:: -**NOTE**: **At least 5 lcores must be reserved** for the ntnic services by EAL options. above. + At least **five (5)** lcores must be reserved for NTNIC services. -For example +For example: .. code-block:: console dpdk-testpmd -S 8,9,10,11,12 -The PMD registers each service during initialization by function: + +The PMD registers each service during initialization with: .. code-block:: c int nthw_service_add(struct rte_service_spec *srv_spec, const enum rte_ntnic_service_tag tag) -and unregistered by the PMD during deinitialization by the function: +And unregister it during deinitialization with: .. code-block:: c int nthw_service_del(const enum rte_ntnic_service_tag tag) -The service info may be retrieved by function: +Retrieve service info can be done with `nthw_service_get_info`: .. code-block:: c
@@ -249,32 +268,19 @@ The service info may be retrieved by function: The service info includes the service ID, assigned lcore, and initialization state. -Service API for user applications ---------------------------------- -**rte_pmd_ntnic_service_set_lcore** -**rte_pmd_ntnic_service_get_id** - -The exported service API is available for applications to configure the services. - -By API function: +Service API for applications +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: c +Exported functions: - int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) +- ``rte_pmd_ntnic_service_set_lcore`` +- ``rte_pmd_ntnic_service_get_id`` -For example to assign lcores 8,9,10,11,12 to the services, the application can use: +Set a service lcore with: .. code-block:: c - rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); - rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); - rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); - rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); - rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); - -The API will automatically lcore to service core list and map the service to the lcore. - -.. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_service_tag tag, uint32_t lcore_id) Each service has its own tag to identify it.
@@ -289,26 +295,38 @@ Each service has its own tag to identify it. RTE_NTNIC_SERVICE_MAX }; -The application may use next API function to retrieve the service id: +Example: assign lcores 8–12 to services .. code-block:: c - int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_STAT, 8); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_ADAPTER_MON, 9); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_0_EVENT, 10); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT, 11); + rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); +The API maps services to lcores and returns a service ID via: -For example, to enable statistics for flm_update service, the application can use: +.. code-block:: c + + int rte_pmd_ntnic_service_get_id(enum rte_ntnic_service_tag tag); + +Example: enable statistics for the flm_update service .. code-block:: c int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); rte_service_set_stats_enable(flm_update_id, 1); -All other manipulations with the service can be done with the service ID and rte_service* API. -To use the service API, an application must have included the header file: + .. note:: Use `rte_service_lcore_start` to start the lcore after mapping it to the service. + +All service operations use the service ID and the standard `rte_service*` APIs. + +To use the NTNIC service API include the header: .. code-block:: c #include <rte_pmd_ntnic.h> -And linked with the library: `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking. +Link with `librte_net_ntnic.so` or `librte_net_ntnic.a` for static linking.
Signature · 1 line
2.45.0
Re: [PATCH v1 1/1] doc: refactoring the guide for NTNIC PMD
22/10/2025 18:40, Serhii Iliushyk:
Quoted 1 line
+.. rst-class:: punchcard
Nice to see this new class used.
doc/guides/nics/ntnic.rst The physical ports are located behind PF0 as DPDK port 0 and 1. · line 48
Quoted 4 lines
doc/guides/nics/ntnic.rst +4
-0+ +================================================================================================================ ======= +Supported Features Linux +================================================================================================================ =======
Columns are too wide.
[...]
doc/guides/nics/ntnic.rst Command line arguments · line 106
Quoted 5 lines
Following standard DPDK command line arguments are used by the PMD:
-``-a``
doc/guides/nics/ntnic.rst +1
-1- Used to specifically define the NT adapter by PCI ID. +NTNIC-specific arguments can be passed in the PCI device parameter list:
So there are 2 sentences ending with a colon.
doc/guides/nics/ntnic.rst The service info may be retrieved by function: · line 255
Quoted 4 lines
doc/guides/nics/ntnic.rst +0
-4-Service API for user applications ---------------------------------- -**rte_pmd_ntnic_service_set_lcore** -**rte_pmd_ntnic_service_get_id**
That's the kind of things I've already reworked in the main branch.
Please start from a fresh update.
PATCH v2 1/1 doc: refactoring the guide for NTNIC PMD
Improve the doc formatting.
--- doc/guides/nics/ntnic.rst | 221 ++++++++++++++++++++------------------ 1 file changed, 116 insertions(+), 105 deletions(-)
doc/guides/nics/ntnic.rst +116 -105
@@ -23,66 +23,67 @@ The physical ports are located behind PF0 as DPDK port 0 and 1. Supported NICs -------------- -- NT200A02 2x100G SmartNIC +================== ================ ================================ +SmartNIC total bandwidth FPGA id +================== ================ ================================ +**NT200A02** 2x100 Gb/s 9563 (Inline Flow Management) +**NT400D11** 2x100 Gb/s 9569 (Inline Flow Management) +**NT400D13** 2x100 Gb/s 9574 (Inline Flow Management) +================== ================ ================================ - - FPGA ID 9563 (Inline Flow Management) +All information about Napatech SmartNICs can be found by links below: -- NT400D11 2x100G SmartNIC - - - FPGA ID 9569 (Inline Flow Management) - -- NT400D13 2x100G SmartNIC - - - FPGA ID 9574 (Inline Flow Management) - -All information about NT200A02 and NT400D13 can be found by links below: - -- https://www.napatech.com/products/nt200a02-smartnic-inline/ -- https://www.napatech.com/products/nt400d11-smartnic-programmable/ -- https://www.napatech.com/products/nt400d13-smartnic-programmable/ -- https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/ +- `NT200A02 <https://www.napatech.com/products/nt200a02-smartnic-inline/>`_ +- `NT400D11 <https://www.napatech.com/products/nt400d11-smartnic-programmable/>`_ +- `NT400D13 <https://www.napatech.com/products/nt400d13-smartnic-programmable/>`_ +- `Napatech FPGA-based SmartNICs <https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/>`_ Features -------- -- FW version -- Speed capabilities -- Link status (Link update only) -- Unicast MAC filter -- Multicast MAC filter -- Promiscuous mode (Enable only. The device always run promiscuous mode) -- Flow API support. -- Support for multiple rte_flow groups. -- Multiple TX and RX queues. -- Scattered and gather for TX and RX. -- Jumbo frame support. -- Traffic mirroring. -- VLAN filtering. -- Packet modification: NAT, TTL decrement, DSCP tagging -- Tunnel types: GTP. -- Encapsulation and decapsulation of GTP data. -- RX VLAN stripping via raw decap. -- TX VLAN insertion via raw encap. -- CAM and TCAM based matching. -- Exact match of 140 million flows and policies. -- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. -- RSS hash -- RSS key update -- RSS based on VLAN or 5-tuple. -- RSS using different combinations of fields: L3 only, L4 only or both, - and source only, destination only or both. -- Several RSS hash keys, one for each flow type. -- Default RSS operation with no hash key specification. -- Port and queue statistics. -- RMON statistics in extended stats. -- Link state information. -- Flow statistics -- Flow aging support -- Flow metering, including meter policy API. -- Flow update. Update of the action list for specific flow -- Asynchronous flow support -- MTU update +.. rst-class:: punchcard + +=========================================================================================== ======= +Supported Features Linux +=========================================================================================== ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X +Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. X +Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using combinations of fields: L3 only, L4 only or both, and src only, dst only or both. X +Several RSS hash keys, one for each flow type. X +Default RSS operation with no hash key specification. X +Port and queue statistics. X +RMON statistics in extended stats. X +Link state information. X +Flow statistics X +Flow aging support X +Flow metering, including meter policy API. X +Flow update. Update of the action list for specific flow X +Asynchronous flow support X +MTU update X +=========================================================================================== ======= Limitations ~~~~~~~~~~~
@@ -101,79 +102,89 @@ Configuration Command line arguments ~~~~~~~~~~~~~~~~~~~~~~ -Following standard DPDK command line arguments are used by the PMD: +Following standard DPDK command line arguments are used by the PMD. -``-a`` - Used to specifically define the NT adapter by PCI ID. +NTNIC-specific arguments can be passed in the PCI device parameter list: -``--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:: +.. code-block:: console <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] -The NTNIC specific argument format is:: +The NTNIC-specific argument format is + +<object>.<attribute>=[<object-ids>:]<value> + +Multiple arguments for the same device are separated by commas. The +``<object-ids>`` field can be a single value or a range. - <object>.<attribute>=[<object-ids>:]<value> +- ``rxqs`` parameter [int] -Multiple arguments for the same device are separated by ‘,’ comma. -<object-ids> can be a single value or a range. + Number of Rx queues to use. Example: -``rxqs`` parameter [int] + .. code-block:: console - Specify number of Rx queues to use:: + -a <domain>:<bus>:00.0,rxqs=4,txqs=4 - -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + By default, the value is set to 1. - By default, the value is set to 1. +- ``txqs`` parameter [int] -``txqs`` parameter [int] + Number of Tx queues to use. Example: - Specify number of Tx queues to use:: + .. code-block:: console - -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + -a <domain>:<bus>:00.0,rxqs=4,txqs=4 - By default, the value is set to 1. + By default, the value is set to 1. -``exception_path`` parameter [int] +- ``exception_path`` parameter [int] Enable exception path for unmatched packets to go through queue 0. - To enable exception_path:: + To enable exception_path: - -a <domain>:<bus>:00.0,exception_path=1 + .. code-block:: console - By default, the value is set to 0. + -a <domain>:<bus>:00.0,exception_path=1 + + By default, the value is set to 0. 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:: + Logging info from the main PMD code. i.e. code that is related to DPDK: + + .. code-block:: console --log-level=pmd.net.ntnic.ntnic,8 NTHW - Logging info from NTHW. i.e. code that is related to the FPGA and the adapter:: + Logging info from NTHW. i.e. code that is related to the FPGA and the adapter: + + .. code-block:: console --log-level=pmd.net.ntnic.nthw,8 FILTER - Logging info from filter. i.e. code that is related to the binary filter:: + Logging info from filter. i.e. code that is related to the binary filter: + + .. code-block:: console - --log-level=pmd.net.ntnic.filter,8 + --log-level=pmd.net.ntnic.filter,8 -To enable logging on all levels use wildcard in the following way:: +To enable logging on all levels use wildcard in the following way: + +.. code-block:: console --log-level=pmd.net.ntnic.*,8 Flow Scanner ------------- +~~~~~~~~~~~~ Flow Scanner is DPDK mechanism that constantly and periodically scans the flow tables to check for aged-out flows.
@@ -204,7 +215,7 @@ There are list of characteristics that age timeout action has: Service API ------------ +~~~~~~~~~~~ The NTNIC PMD provides a service API that allows applications to configure services:
@@ -214,29 +225,29 @@ The NTNIC PMD provides a service API that allows applications to configure servi The services are responsible for handling the vital functionality of the NTNIC PMD: -FLM Update - is responsible for creating and destroying flows; -Statistics - is responsible for collecting statistics; -Port event - is responsible for handling port events: aging, port load, and flow load; -Adapter monitor - is responsible for link control; +======================== ================================================= +Service name Service purpose +======================== ================================================= +**FLM Update** create and destroy flows +**Statistics** collect statistics +**Port event** handle port events (aging, port load, flow load) +**Adapter monitor** monitor link state +======================== ================================================= -.. note:: + .. note:: - Use next EAL options to configure set service cores: + Use next EAL options to configure set service cores: - * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; - * -S SERVICE CORELIST List of cores to run services on; + * **-S SERVICE CORELIST** List of cores to run services on; + * **-s SERVICE COREMASK** Hexadecimal bitmask of cores to be used as service cores; - At least 5 lcores must be reserved for the ntnic services by EAL options. + At least **5 (five)** lcores must be reserved for the ntnic services by EAL options. -For example, + For example, -.. code-block:: console + .. code-block:: console - dpdk-testpmd -S 8,9,10,11,12 + dpdk-testpmd -S 8,9,10,11,12 The PMD registers each service during initialization by function ``nthw_service_add`` and unregistered by the PMD during deinitialization by the function ``nthw_service_del``.
@@ -262,11 +273,11 @@ For example to assign lcores 8,9,10,11,12 to the services, the application can u rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); -The API will automatically lcore to service core list and map the service to the lcore. +The API will automatically map a service to an lcore. -.. note:: + .. note:: - Use ``rte_service_lcore_start`` to start the lcore after mapping it to the service. + Use ``rte_service_lcore_start`` to start the lcore after mapping it to the service. Each service has its own tag to identify it:
@@ -284,9 +295,9 @@ For example, to enable statistics for flm_update service, the application can us int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); rte_service_set_stats_enable(flm_update_id, 1); -All other manipulations with the service can be done with the service ID and rte_service API. +All other manipulations with the service can be done with the service ID and *rte_service* API. -To use the service API, an application must have included the header file: +To use the NTNIC service API, an application must have included the header file: .. code-block:: c
Signature · 1 line
2.45.0
Re: [PATCH v2] doc: refactoring the guide for NTNIC PMD
23/10/2025 16:35, Serhii Iliushyk:
Quoted 18 lines
+=========================================================================================== =======
doc/guides/nics/ntnic.rst +17
-0+Supported Features Linux +=========================================================================================== ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X
doc/guides/nics/ntnic.rst The physical ports are located behind PF0 as DPDK port 0 and 1. · line 74
Quoted 10 lines
doc/guides/nics/ntnic.rst +10
-0+Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. X +Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using combinations of fields: L3 only, L4 only or both, and src only, dst only or both. X
When you make a table, you should not write sentences. Columns must not be wide.
[...]
Quoted 1 line
+<object>.<attribute>=[<object-ids>:]<value>
Should it have a fixed witdth font?
[...]
Quoted 2 lines
-``exception_path`` parameter [int]
+- ``exception_path`` parameter [int]
Why do you replace the definition list with a simple list? Did you check the HTML output?
[...]
Quoted 3 lines
Logging and Debugging
----------------------
+~~~~~~~~~~~~~~~~~~~~~
Why? So there is only 1 main title like "Features"?
[...]
Quoted 2 lines
-.. note::
+ .. note::
No reason to do that.
Re: [PATCH v2] doc: refactoring the guide for NTNIC PMD
From: Thomas Monjalon <[email protected]>
Sent: 23 October 2025 17:49
To: Serhii Iliushyk <[email protected]>
Cc: [email protected] <[email protected]>; Mykola Kostenok <[email protected]>; Serhii Iliushyk <[email protected]>; Christian Koue Muf <[email protected]>; [email protected] <[email protected]> Subject: Re: [PATCH v2] doc: refactoring the guide for NTNIC PMD
Quoted 24 lines
23/10/2025 16:35, Serhii Iliushyk:
Quoted 23 lines
+=========================================================================================== =======
doc/guides/nics/ntnic.rst +22
-0+Supported Features Linux +=========================================================================================== ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X +Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. X
Quoted 8 lines
doc/guides/nics/ntnic.rst The physical ports are located behind PF0 as DPDK port 0 and 1. · line 74
Quoted 5 lines
doc/guides/nics/ntnic.rst +5
-0+Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using combinations of fields: L3 only, L4 only or both, and src only, dst only or both. X
When you make a table, you should not write sentences. Columns must not be wide.
I will fix it. Is there any value for column length?
Quoted 6 lines
[...]Quoted 1 line
+<object>.<attribute>=[<object-ids>:]<value>
Should it have a fixed witdth font?
It may have a fixed-width font. I can fix it if it's required.
Quoted 8 lines
[...]Quoted 2 lines
-``exception_path`` parameter [int]
+- ``exception_path`` parameter [int]
Why do you replace the definition list with a simple list? Did you check the HTML output?
I did it to make it clearer when viewing the doc in RST preview or in plain text.
Quoted 8 lines
[...]Quoted 3 lines
Logging and Debugging
----------------------
+~~~~~~~~~~~~~~~~~~~~~
Why? So there is only 1 main title like "Features"?
The titles have further structure after refactoring:
NTNIC Poll Mode Driver
- Design
- Supported NICs
- Features
- Limitations
- Configuration
- Command line arguments
- Logging and Debugging
- Flow Scanner
- Service API
- Service API for user applications
Quoted 6 lines
[...]Quoted 2 lines
-.. note::
+ .. note::
No reason to do that.
If there is no tabulation, the section "None" grabs all the text below in the HTML.
Re: [PATCH v2] doc: refactoring the guide for NTNIC PMD
24/10/2025 15:30, Serhii Iliushyk:
Quoted 34 lines
From: Thomas Monjalon <[email protected]>
Quoted 24 lines
23/10/2025 16:35, Serhii Iliushyk:
Quoted 23 lines
+=========================================================================================== =======
doc/guides/nics/ntnic.rst +22
-0+Supported Features Linux +=========================================================================================== ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X +Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. XQuoted 8 lines
doc/guides/nics/ntnic.rst The physical ports are located behind PF0 as DPDK port 0 and 1. · line 74
Quoted 5 lines
doc/guides/nics/ntnic.rst +5
-0+Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using combinations of fields: L3 only, L4 only or both, and src only, dst only or both. XWhen you make a table, you should not write sentences. Columns must not be wide.
Quoted 1 line
I will fix it. Is there any value for column length?
No value, but keep it narrow to allow adding columns without going out of space.
Descriptions should got somewhere else, not in a table.
Look how links are used in mlx5 doc tables.
Quoted 6 lines
Quoted 5 lines
[...]
Quoted 1 line
+<object>.<attribute>=[<object-ids>:]<value>
Should it have a fixed witdth font?
It may have a fixed-width font. I can fix it if it's required.
Yes, it is not a sentence.
Quoted 8 lines
Quoted 7 lines
[...]
Quoted 2 lines
-``exception_path`` parameter [int]
+- ``exception_path`` parameter [int]Why do you replace the definition list with a simple list? Did you check the HTML output?
I did it to make it clearer when viewing the doc in RST preview or in plain text.
HTML output should be the priority.
Quoted 10 lines
Quoted 7 lines
[...]
Quoted 3 lines
Logging and Debugging
----------------------
+~~~~~~~~~~~~~~~~~~~~~Why? So there is only 1 main title like "Features"?
The titles have further structure after refactoring:
Quoted 11 lines
NTNIC Poll Mode Driver
- Design
- Supported NICs
- Features
- Limitations
- Configuration
- Command line arguments
- Logging and Debugging
- Flow Scanner
- Service API
- Service API for user applications
OK
Quoted 7 lines
Quoted 5 lines
[...]
Quoted 2 lines
-.. note::
+ .. note::No reason to do that.
If there is no tabulation, the section "None" grabs all the text below in the HTML.
So the problem is opposite, you must unindent the text below, right?
v3 cover Clean up the guide for NTNIC PMD
Hi,
I have made the requested changes.
The simple list of features was converted into a list-table.
Serhii Iliushyk (1):
doc: refactoring the guide for NTNIC PMD
doc/guides/nics/ntnic.rst | 204 ++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 98 deletions(-)
Signature · 1 line
2.45.0
PATCH v3 1/1 doc: refactoring the guide for NTNIC PMD
Improve the doc formatting.
--- doc/guides/nics/ntnic.rst | 204 ++++++++++++++++++++------------------ 1 file changed, 106 insertions(+), 98 deletions(-)
doc/guides/nics/ntnic.rst +106 -98
@@ -23,66 +23,64 @@ The physical ports are located behind PF0 as DPDK port 0 and 1. Supported NICs -------------- -- NT200A02 2x100G SmartNIC +================== ================ ================================ +SmartNIC total bandwidth FPGA id +================== ================ ================================ +**NT200A02** 2x100 Gb/s 9563 (Inline Flow Management) +**NT400D11** 2x100 Gb/s 9569 (Inline Flow Management) +**NT400D13** 2x100 Gb/s 9574 (Inline Flow Management) +================== ================ ================================ - - FPGA ID 9563 (Inline Flow Management) +All information about Napatech SmartNICs can be found by links below: -- NT400D11 2x100G SmartNIC - - - FPGA ID 9569 (Inline Flow Management) - -- NT400D13 2x100G SmartNIC - - - FPGA ID 9574 (Inline Flow Management) - -All information about NT200A02 and NT400D13 can be found by links below: - -- https://www.napatech.com/products/nt200a02-smartnic-inline/ -- https://www.napatech.com/products/nt400d11-smartnic-programmable/ -- https://www.napatech.com/products/nt400d13-smartnic-programmable/ -- https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/ +- `NT200A02 <https://www.napatech.com/products/nt200a02-smartnic-inline/>`_ +- `NT400D11 <https://www.napatech.com/products/nt400d11-smartnic-programmable/>`_ +- `NT400D13 <https://www.napatech.com/products/nt400d13-smartnic-programmable/>`_ +- `Napatech FPGA-based SmartNICs <https://www.napatech.com/support/resources/data-sheets/link-inline-software-for-napatech/>`_ Features -------- -- FW version -- Speed capabilities -- Link status (Link update only) -- Unicast MAC filter -- Multicast MAC filter -- Promiscuous mode (Enable only. The device always run promiscuous mode) -- Flow API support. -- Support for multiple rte_flow groups. -- Multiple TX and RX queues. -- Scattered and gather for TX and RX. -- Jumbo frame support. -- Traffic mirroring. -- VLAN filtering. -- Packet modification: NAT, TTL decrement, DSCP tagging -- Tunnel types: GTP. -- Encapsulation and decapsulation of GTP data. -- RX VLAN stripping via raw decap. -- TX VLAN insertion via raw encap. -- CAM and TCAM based matching. -- Exact match of 140 million flows and policies. -- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. -- RSS hash -- RSS key update -- RSS based on VLAN or 5-tuple. -- RSS using different combinations of fields: L3 only, L4 only or both, - and source only, destination only or both. -- Several RSS hash keys, one for each flow type. -- Default RSS operation with no hash key specification. -- Port and queue statistics. -- RMON statistics in extended stats. -- Link state information. -- Flow statistics -- Flow aging support -- Flow metering, including meter policy API. -- Flow update. Update of the action list for specific flow -- Asynchronous flow support -- MTU update +.. list-table:: Supported Features + :widths: 100 + + * - FW version + * - Speed capabilities + * - Link status (link updates only) + * - Unicast MAC filtering + * - Multicast MAC filtering + * - Promiscuous mode (device always runs in promiscuous mode) + * - Flow API support + * - Support for multiple rte_flow groups + * - Multiple TX and RX queues + * - Scatter/gather for TX and RX + * - Jumbo frame support + * - Traffic mirroring + * - VLAN filtering + * - Packet modification: NAT, TTL decrement, DSCP tagging + * - Tunnel types: GTP + * - Encapsulation and decapsulation of GTP data + * - RX VLAN stripping via raw decap + * - TX VLAN insertion via raw encap + * - CAM- and TCAM-based matching + * - Exact match for up to 140 million flows and policies + * - Tunnel HW offload: packet type, inner/outer RSS, IP and UDP checksum verification + * - RSS hash + * - RSS key update + * - RSS based on VLAN or 5-tuple + * - RSS using combinations of fields (L3, L4, source/destination) + * - Several RSS hash keys (one per flow type) + * - Default RSS operation with no hash key specification + * - Port and queue statistics + * - RMON statistics in extended stats + * - Link state information + * - Flow statistics + * - Flow aging support + * - Flow metering, including meter policy API + * - Flow update (update action list for a specific flow) + * - Asynchronous flow support + * - MTU update Limitations ~~~~~~~~~~~
@@ -101,79 +99,89 @@ Configuration Command line arguments ~~~~~~~~~~~~~~~~~~~~~~ -Following standard DPDK command line arguments are used by the PMD: +Following standard DPDK command line arguments are used by the PMD. -``-a`` - Used to specifically define the NT adapter by PCI ID. +NTNIC-specific arguments can be passed in the PCI device parameter list: -``--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:: +.. code-block:: console <application> ... -a 0000:03:00.0[{,<NTNIC specific argument>}] -The NTNIC specific argument format is:: +The NTNIC-specific argument format is - <object>.<attribute>=[<object-ids>:]<value> +``<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. +Multiple arguments for the same device are separated by commas. The +``<object-ids>`` field can be a single value or a range. ``rxqs`` parameter [int] - Specify number of Rx queues to use:: + Number of Rx queues to use. Example: - -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + .. code-block:: console - By default, the value is set to 1. + -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:: + Number of Tx queues to use. Example: + + .. code-block:: console - -a <domain>:<bus>:00.0,rxqs=4,txqs=4 + -a <domain>:<bus>:00.0,rxqs=4,txqs=4 - By default, the value is set to 1. + By default, the value is set to 1. ``exception_path`` parameter [int] Enable exception path for unmatched packets to go through queue 0. - To enable exception_path:: + To enable exception_path: - -a <domain>:<bus>:00.0,exception_path=1 + .. code-block:: console - By default, the value is set to 0. + -a <domain>:<bus>:00.0,exception_path=1 + + By default, the value is set to 0. 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:: + Logging info from the main PMD code. i.e. code that is related to DPDK: + + .. code-block:: console --log-level=pmd.net.ntnic.ntnic,8 NTHW - Logging info from NTHW. i.e. code that is related to the FPGA and the adapter:: + Logging info from NTHW. i.e. code that is related to the FPGA and the adapter: + + .. code-block:: console --log-level=pmd.net.ntnic.nthw,8 FILTER - Logging info from filter. i.e. code that is related to the binary filter:: + Logging info from filter. i.e. code that is related to the binary filter: + + .. code-block:: console - --log-level=pmd.net.ntnic.filter,8 + --log-level=pmd.net.ntnic.filter,8 -To enable logging on all levels use wildcard in the following way:: +To enable logging on all levels use wildcard in the following way: + +.. code-block:: console --log-level=pmd.net.ntnic.*,8 Flow Scanner ------------- +~~~~~~~~~~~~ Flow Scanner is DPDK mechanism that constantly and periodically scans the flow tables to check for aged-out flows.
@@ -204,7 +212,7 @@ There are list of characteristics that age timeout action has: Service API ------------ +~~~~~~~~~~~ The NTNIC PMD provides a service API that allows applications to configure services:
@@ -214,29 +222,29 @@ The NTNIC PMD provides a service API that allows applications to configure servi The services are responsible for handling the vital functionality of the NTNIC PMD: -FLM Update - is responsible for creating and destroying flows; -Statistics - is responsible for collecting statistics; -Port event - is responsible for handling port events: aging, port load, and flow load; -Adapter monitor - is responsible for link control; +======================== ================================================= +Service name Service purpose +======================== ================================================= +**FLM Update** create and destroy flows +**Statistics** collect statistics +**Port event** handle port events (aging, port load, flow load) +**Adapter monitor** monitor link state +======================== ================================================= .. note:: Use next EAL options to configure set service cores: - * -s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores; - * -S SERVICE CORELIST List of cores to run services on; + * **-S SERVICE CORELIST** List of cores to run services on; + * **-s SERVICE COREMASK** Hexadecimal bitmask of cores to be used as service cores; - At least 5 lcores must be reserved for the ntnic services by EAL options. + At least **5 (five)** lcores must be reserved for the ntnic services by EAL options. -For example, + For example, -.. code-block:: console + .. code-block:: console - dpdk-testpmd -S 8,9,10,11,12 + dpdk-testpmd -S 8,9,10,11,12 The PMD registers each service during initialization by function ``nthw_service_add`` and unregistered by the PMD during deinitialization by the function ``nthw_service_del``.
@@ -262,7 +270,7 @@ For example to assign lcores 8,9,10,11,12 to the services, the application can u rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_PORT_1_EVENT,11); rte_pmd_ntnic_service_set_lcore(RTE_NTNIC_SERVICE_FLM_UPDATE, 12); -The API will automatically lcore to service core list and map the service to the lcore. +The API will automatically map a service to an lcore. .. note::
@@ -284,9 +292,9 @@ For example, to enable statistics for flm_update service, the application can us int flm_update_id = rte_pmd_ntnic_service_get_id(RTE_NTNIC_SERVICE_FLM_UPDATE); rte_service_set_stats_enable(flm_update_id, 1); -All other manipulations with the service can be done with the service ID and rte_service API. +All other manipulations with the service can be done with the service ID and *rte_service* API. -To use the service API, an application must have included the header file: +To use the NTNIC service API, an application must have included the header file: .. code-block:: c
Signature · 1 line
2.45.0
Stephen Hemminger
AppliedRe: [PATCH v3 1/1] doc: refactoring the guide for NTNIC PMD
Quoted 3 lines · On Mon, 27 Oct 2025 14:00:01 +0100 Serhii Iliushyk <[email protected]> wrote:
Improve the doc formatting.
Signed-off-by Serhii Iliushyk <[email protected]>
Queued to next-net
Re: [PATCH v1 1/1] doc: refactoring the guide for NTNIC PMD
In reply to Serhii IliushykQuoted 73 lines · On Wed, 22 Oct 2025 18:40:14 +0200 Serhii Iliushyk <[email protected]> wrote:
Features
--------doc/guides/nics/ntnic.rst +32
-38- -- FW version -- Speed capabilities -- Link status (Link update only) -- Unicast MAC filter -- Multicast MAC filter -- Promiscuous mode (Enable only. The device always run promiscuous mode) -- Flow API support. -- Support for multiple rte_flow groups. -- Multiple TX and RX queues. -- Scattered and gather for TX and RX. -- Jumbo frame support. -- Traffic mirroring. -- VLAN filtering. -- Packet modification: NAT, TTL decrement, DSCP tagging -- Tunnel types: GTP. -- Encapsulation and decapsulation of GTP data. -- RX VLAN stripping via raw decap. -- TX VLAN insertion via raw encap. -- CAM and TCAM based matching. -- Exact match of 140 million flows and policies. -- Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. -- RSS hash -- RSS key update -- RSS based on VLAN or 5-tuple. -- RSS using different combinations of fields: L3 only, L4 only or both, - and source only, destination only or both. -- Several RSS hash keys, one for each flow type. -- Default RSS operation with no hash key specification. -- Port and queue statistics. -- RMON statistics in extended stats. -- Link state information. -- Flow statistics -- Flow aging support -- Flow metering, including meter policy API. -- Flow update. Update of the action list for specific flow -- Asynchronous flow support -- MTU update +.. rst-class:: punchcard + +================================================================================================================ ======= +Supported Features Linux +================================================================================================================ ======= +FW version X +Speed capabilities X +Link status (Link update only) X +Unicast MAC filter X +Multicast MAC filter X +Promiscuous mode (Enable only. The device always run promiscuous mode) X +Flow API support. X +Support for multiple rte_flow groups. X +Multiple TX and RX queues. X +Scattered and gather for TX and RX. X +Jumbo frame support. X +Traffic mirroring. X +VLAN filtering. X +Packet modification: NAT, TTL decrement, DSCP tagging X +Tunnel types: GTP. X +Encapsulation and decapsulation of GTP data. X +RX VLAN stripping via raw decap. X +TX VLAN insertion via raw encap. X +CAM and TCAM based matching. X +Exact match of 140 million flows and policies. X +Tunnel HW offload: Packet type, inner/outer RSS, IP and UDP checksum verification. X +RSS hash X +RSS key update X +RSS based on VLAN or 5*tuple. X +RSS using different combinations of fields: L3 only, L4 only or both, and source only, destination only or both. X +Several RSS hash keys, one for each flow type. X +Default RSS operation with no hash key specification. X
doc/guides/nics/ntnic.rst The physical ports are located behind PF0 as DPDK port 0 and 1. · line 85
Quoted 10 lines
doc/guides/nics/ntnic.rst +10
-0+Port and queue statistics. X +RMON statistics in extended stats. X +Link state information. X +Flow statistics X +Flow aging support X +Flow metering, including meter policy API. X +Flow update. Update of the action list for specific flow X +Asynchronous flow support X +MTU update X +================================================================================================================ =======
Why is this table needed. Most of this is already in NIC features table and having a duplicate is redundant.
PATCH 2/24 net/ntnic: migrate flm update thread to service
In reply to Serhii IliushykThis commit adds the FLM update service to the NTNIC PMD. The service is responsible for handling creating/destroying flows.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 67 ++++++++++++------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 17 +++++ drivers/net/ntnic/ntutil/nt_service.c | 4 +- drivers/net/ntnic/rte_pmd_ntnic.h | 3 +- 5 files changed, 62 insertions(+), 30 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -15,7 +15,6 @@ typedef struct ntdrv_4ga_s {char *p_drv_name;volatile bool b_shutdown; -rte_thread_t flm_thread;rte_spinlock_t stat_lck;rte_thread_t stat_thread;rte_thread_t port_event_thread;
drivers/net/ntnic/ntnic_ethdev.c +41 -26
102 lines not on this page · raw message
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +17 -0
@@ -6,6 +6,7 @@#include <rte_flow_driver.h> #include <rte_pci.h> #include <rte_version.h> +#include <rte_pmd_ntnic.h> #include "ntlog.h" #include "nt_util.h"
@@ -13,6 +14,8 @@#include "ntnic_mod_reg.h" #include "ntos_system.h" #include "ntos_drv.h" +#include "nt_service.h" +#include "rte_service.h" #define MAX_RTE_FLOWS 8192
@@ -543,6 +546,13 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_return -1 ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be destroyed" ); +return -1 ; + } +struct pmd_internals *internals = eth_dev->data->dev_private; error->type =RTE_FLOW_ERROR_TYPE_NONE ;
@@ -580,6 +590,13 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev,return NULL ; } +struct nt_service *srv =nthw_service_get_info (RTE_NTNIC_SERVICE_FLM_UPDATE ); + +if (!srv || !NT_SERVICE_GET_STATE (srv) || !rte_service_runstate_get (srv->id)) { +NT_LOG (ERR ,FILTER ,"flm update service is not started. Flow cannot be created" ); +return NULL ; + } +struct pmd_internals *internals = eth_dev->data->dev_private;struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info;
drivers/net/ntnic/ntutil/nt_service.c +2 -2
@@ -12,8 +12,8 @@#define NT_SERVICE_UNKNOWN_ID (-1)static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX ] = { - [0 ] = { - .tag =RTE_NTNIC_SERVICE_MAX , + [RTE_NTNIC_SERVICE_FLM_UPDATE ] = { + .tag =RTE_NTNIC_SERVICE_FLM_UPDATE , .id =NT_SERVICE_UNKNOWN_ID , .lcore =RTE_MAX_LCORE , .initialized = false,
drivers/net/ntnic/rte_pmd_ntnic.h +2 -1
@@ -41,7 +41,8 @@ enum rte_ntnic_event_type { };enum rte_ntnic_service_tag { -RTE_NTNIC_SERVICE_MAX =1 +RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_MAX };/**
Signature · 1 line
2.45.0
PATCH 3/24 net/ntnic: migrate statistic thread to service
In reply to Serhii IliushykThe statistic service is responsible for collecting statistics.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/ntnic_ethdev.c | 146 ++++++++++++++------------ drivers/net/ntnic/ntutil/nt_service.c | 6 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 4 files changed, 84 insertions(+), 70 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown;rte_spinlock_t stat_lck; -rte_thread_t stat_thread;rte_thread_t port_event_thread; } ntdrv_4ga_t;
drivers/net/ntnic/ntnic_ethdev.c +77 -69
179 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -18,6 +18,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_STAT] = { + .tag = RTE_NTNIC_SERVICE_STAT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -42,6 +42,7 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 , +RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 4/24 net/ntnic: migrate port event thread to service
In reply to Serhii IliushykThe port event service is responsible for handling port events.
--- drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/include/ntos_drv.h | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 272 +++++++++++++++----------- drivers/net/ntnic/ntutil/nt_service.c | 12 ++ drivers/net/ntnic/rte_pmd_ntnic.h | 2 + 5 files changed, 175 insertions(+), 114 deletions(-)
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -16,7 +16,6 @@ typedef struct ntdrv_4ga_s {volatile bool b_shutdown; rte_spinlock_t stat_lck; - rte_thread_t port_event_thread; } ntdrv_4ga_t;#endif /* __NTDRV_4GA_H__ */
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -21,7 +21,7 @@#define NUM_MULTICAST_ADDRS_PER_PORT (16U)#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) +#define NUM_ADAPTER_PORTS_MAX (2)/* Max RSS queues */
drivers/net/ntnic/ntnic_ethdev.c +160 -112
312 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +12 -0
@@ -24,6 +24,18 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_PORT_0_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_0_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, + [RTE_NTNIC_SERVICE_PORT_1_EVENT] = { + .tag = RTE_NTNIC_SERVICE_PORT_1_EVENT, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +2 -0
@@ -43,6 +43,8 @@ enum rte_ntnic_event_type {enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_FLM_UPDATE =0 ,RTE_NTNIC_SERVICE_STAT =1 , +RTE_NTNIC_SERVICE_PORT_0_EVENT =2 , +RTE_NTNIC_SERVICE_PORT_1_EVENT =3 ,RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
PATCH 5/24 net/ntnic: migrate adapter mon thread to service
In reply to Serhii IliushykThe adapter monitor service is responsible for link state management.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 25 +- .../net/ntnic/include/common_adapter_defs.h | 15 - drivers/net/ntnic/include/nt4ga_adapter.h | 3 - drivers/net/ntnic/include/ntnic_stat.h | 2 +- drivers/net/ntnic/include/ntos_drv.h | 2 +- .../link_mgmt/link_100g/nt4ga_link_100g.c | 303 +++++++++-------- .../link_agx_100g/nt4ga_agx_link_100g.c | 306 ++++++++++-------- drivers/net/ntnic/ntutil/nt_service.c | 6 + drivers/net/ntnic/rte_pmd_ntnic.h | 1 + 9 files changed, 334 insertions(+), 329 deletions(-) delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
drivers/net/ntnic/adapter/nt4ga_adapter.c +2 -23
@@ -5,6 +5,7 @@#include <rte_thread.h> +#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h" #include "ntnic_mod_reg.h"
@@ -12,28 +13,6 @@/* * Global variables shared by NT adapter types */ -rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; - -/* -* Signal-handler to stop all monitor threads -*/ -static void stop_monitor_tasks (int signum) -{ -const size_t N =ARRAY_SIZE (monitor_task_is_running); -size_t i; - -/* Stop all monitor tasks */ -for (i =0 ; i <N ; i++) { -const int is_running = monitor_task_is_running[i]; - monitor_task_is_running[i] =0 ; - -if (signum ==-1 && is_running !=0 ) { -rte_thread_join (monitor_tasks[i],NULL ); -memset (&monitor_tasks[i],0 ,sizeof (monitor_tasks[0 ])); - } - } -}static int nt4ga_adapter_show_info (struct adapter_info_s *p_adapter_info,FILE *pfh) {
@@ -255,7 +234,7 @@ static int nt4ga_adapter_deinit(struct adapter_info_s *p_adapter_info)int i;int res =-1 ; -stop_monitor_tasks (-1 ); +nthw_service_del (RTE_NTNIC_SERVICE_ADAPTER_MON );/* Nt4ga Deinit Filter */ nt4ga_filter_t *p_filter = &p_adapter_info->nt4ga_filter;
drivers/net/ntnic/include/common_adapter_defs.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* -* SPDX-License-Identifier: BSD-3-Clause -* Copyright(c) 2023 Napatech A/S -*/ - -#ifndef _COMMON_ADAPTER_DEFS_H_ -#define _COMMON_ADAPTER_DEFS_H_ - -/* -* Declarations shared by NT adapter types. -*/ -#define NUM_ADAPTER_MAX (8) -#define NUM_ADAPTER_PORTS_MAX (128) - -#endif /* _COMMON_ADAPTER_DEFS_H_ */
drivers/net/ntnic/include/nt4ga_adapter.h +0 -3
@@ -47,8 +47,5 @@ typedef struct adapter_info_s { int n_tx_host_buffers; } adapter_info_t; -extern rte_thread_t monitor_tasks[NUM_ADAPTER_MAX ]; -extern volatile int monitor_task_is_running[NUM_ADAPTER_MAX ]; -#endif /* _NT4GA_ADAPTER_H_ */
drivers/net/ntnic/include/ntnic_stat.h +1 -1
@@ -6,7 +6,7 @@#ifndef NTNIC_STAT_H_ #define NTNIC_STAT_H_ -#include "common_adapter_defs.h" +#include "ntos_drv.h" #include "nthw_rmc.h" #include "nthw_rpf.h" #include "nthw_fpga_model.h"
drivers/net/ntnic/include/ntos_drv.h +1 -1
@@ -20,7 +20,7 @@#define NUM_MAC_ADDRS_PER_PORT (16U)#define NUM_MULTICAST_ADDRS_PER_PORT (16U) -#define NUM_ADAPTER_MAX (8) +#define NUM_ADAPTER_MAX (1)#define NUM_ADAPTER_PORTS_MAX (2)
drivers/net/ntnic/link_mgmt/link_100g/nt4ga_link_100g.c +160 -143
358 lines not on this page · raw message
drivers/net/ntnic/link_mgmt/link_agx_100g/nt4ga_agx_link_100g.c +163 -143
360 lines not on this page · raw message
drivers/net/ntnic/ntutil/nt_service.c +6 -0
@@ -36,6 +36,12 @@ static struct nt_service g_nt_services[RTE_NTNIC_SERVICE_MAX] = { .lcore = RTE_MAX_LCORE, .initialized = false, }, + [RTE_NTNIC_SERVICE_ADAPTER_MON] = { + .tag = RTE_NTNIC_SERVICE_ADAPTER_MON, + .id = NT_SERVICE_UNKNOWN_ID, + .lcore = RTE_MAX_LCORE, + .initialized = false, + }, };inline struct nt_service *nthw_service_get_info (const enum rte_ntnic_service_tag tag)
drivers/net/ntnic/rte_pmd_ntnic.h +1 -0
@@ -45,6 +45,7 @@ enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_PORT_0_EVENT =2 ,RTE_NTNIC_SERVICE_PORT_1_EVENT =3 , +RTE_NTNIC_SERVICE_ADAPTER_MON =4 , RTE_NTNIC_SERVICE_MAX };
Signature · 1 line
2.45.0
Re: [PATCH v1 05/24] net/ntnic: migrate adapter mon thread to service
20/10/2025 18:35, Serhii Iliushyk:
drivers/net/ntnic/rte_pmd_ntnic.h enum rte_ntnic_service_tag { · line 50
Quoted 9 lines
drivers/net/ntnic/rte_pmd_ntnic.h +1
-0@@ -45,6 +45,7 @@ enum rte_ntnic_service_tag {RTE_NTNIC_SERVICE_STAT =1 ,RTE_NTNIC_SERVICE_PORT_0_EVENT =2 ,RTE_NTNIC_SERVICE_PORT_1_EVENT =3 , +RTE_NTNIC_SERVICE_ADAPTER_MON =4 , RTE_NTNIC_SERVICE_MAX };
Each time you will add a new service tag, you will break the ABI.
PATCH 6/24 net/ntnic: add warning about service cores
In reply to Serhii IliushykThis commit adds a warning message if the service cores are not available. This warning notifies a user about potential issues with ntnic services. There in no error because the service cores may be added
by application itself after the pcie_probe.
--- drivers/net/ntnic/ntnic_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ntnic/ntnic_ethdev.c +8 -0
@@ -2608,6 +2608,14 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) } } +uint32_t cores[RTE_MAX_LCORE ] = {0 }; +int32_t lcore_count =rte_service_lcore_list (cores,RTE_MAX_LCORE ); + +if (lcore_count <=0 ) { +NT_LOG (WRN ,NTNIC ,"No service cores available. " +"Please check if all NTNIC services are started" ); + } +return 0 ; }
Signature · 1 line
2.45.0
PATCH 7/24 net/ntnic: avoid using thread API
In reply to Serhii IliushykThis patch cleans up the code to use pthreads and rte_thread APIs. Instead it uses service lcore.
--- drivers/net/ntnic/adapter/nt4ga_adapter.c | 2 -- drivers/net/ntnic/include/nt4ga_adapter.h | 1 - drivers/net/ntnic/include/ntdrv_4ga.h | 1 - drivers/net/ntnic/nthw/core/nthw_pca9532.c | 2 -- drivers/net/ntnic/nthw/core/nthw_pcal6416a.c | 1 - .../net/ntnic/nthw/core/nthw_si5332_si5156.c | 1 - .../profile_inline/flow_api_profile_inline.c | 2 +- drivers/net/ntnic/ntnic_ethdev.c | 22 +++++-------------- drivers/net/ntnic/ntutil/nt_util.c | 2 +- 9 files changed, 7 insertions(+), 27 deletions(-)
drivers/net/ntnic/adapter/nt4ga_adapter.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <rte_thread.h> -#include "nt_service.h" #include "ntlog.h" #include "nthw_fpga.h"
drivers/net/ntnic/include/nt4ga_adapter.h +0 -1
@@ -40,7 +40,6 @@ typedef struct adapter_info_s {char *mp_port_id_str[NUM_ADAPTER_PORTS_MAX ];char *mp_adapter_id_str;char *p_dev_name; -volatile bool *pb_shutdown;int adapter_no;int n_rx_host_buffers;
drivers/net/ntnic/include/ntdrv_4ga.h +0 -1
@@ -14,7 +14,6 @@ typedef struct ntdrv_4ga_s {struct adapter_info_s adapter_info;char *p_drv_name; -volatile bool b_shutdown;rte_spinlock_t stat_lck; } ntdrv_4ga_t;
drivers/net/ntnic/nthw/core/nthw_pca9532.c +0 -2
@@ -3,8 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> -#include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_pcal6416a.c +0 -1
@@ -2,7 +2,6 @@* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/core/nthw_si5332_si5156.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2023 Napatech A/S */ -#include <pthread.h> #include "generic/rte_spinlock.h" #include "nt_util.h" #include "ntlog.h"
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_profile_inline.c +1 -1
@@ -5276,7 +5276,7 @@ struct flow_handle *flow_async_create_profile_inline(struct flow_eth_dev *dev, }while (status ==CELL_STATUS_INITIALIZING );/* error handling in case that create_flow_filter() will fail in the other -* thread +* service */ if (status ==CELL_STATUS_UNINITIALIZED ) goto err_exit;
drivers/net/ntnic/ntnic_ethdev.c +5 -17
@@ -6,8 +6,6 @@#include <stdint.h> #include <stdarg.h> -#include <signal.h> -#include <rte_eal.h> #include <rte_dev.h> #include <rte_vfio.h>
@@ -33,12 +31,6 @@#include "rte_pmd_ntnic.h" #include "nt_service.h" -const rte_thread_attr_t thread_attr = { .priority =RTE_THREAD_PRIORITY_NORMAL }; -#define THREAD_CREATE (a, b, c) rte_thread_create(a, &thread_attr, b, c) -#define THREAD_CTRL_CREATE (a, b, c, d) rte_thread_create_internal_control(a, b, c, d) -#define THREAD_JOIN (a) rte_thread_join(a, NULL) -#define THREAD_FUNC static uint32_t -#define THREAD_RETURN (0)#define HW_MAX_PKT_LEN (10000)#define MAX_MTU (HW_MAX_PKT_LEN - RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN)#define MIN_MTU_INLINE 512
@@ -1536,14 +1528,13 @@ drv_deinit(struct drv_s *p_drv)fpga_info_t *fpga_info = &p_nt_drv->adapter_info.fpga_info;/* -* Mark the global pdrv for cleared. Used by some threads to terminate. -* 1 second to give the threads a chance to see the termonation. +* Mark the global pdrv for cleared. Used by some services to terminate. +* 1 second to give the services a chance to see the termonation. */ clear_pdrv (p_drv);nt_os_wait_usec (1000000 );/* stop statistics service */ - p_drv->ntdrv.b_shutdown = true;nthw_service_del (RTE_NTNIC_SERVICE_STAT );if (fpga_info->profile ==FPGA_INFO_PROFILE_INLINE ) {
@@ -2323,9 +2314,6 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev) p_nt_drv->adapter_info.hw_info.pci_sub_vendor_id, p_nt_drv->adapter_info.hw_info.pci_sub_device_id); - p_nt_drv->b_shutdown = false; - p_nt_drv->adapter_info.pb_shutdown = &p_nt_drv->b_shutdown; -/* store context */ store_pdrv (p_drv);
@@ -2366,7 +2354,7 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)NT_LOG_DBGX (DBG ,NTNIC ,"SG module is not initialized" ); } -/* Start ctrl, monitor, stat thread only for primary process. */ +/* Start ctrl, monitor, stat service only for primary process. */ if (err ==0 ) {/* mp_adapter_id_str is initialized after nt4ga_adapter_init(p_nt_drv) */ const char *const p_adapter_id_str = p_nt_drv->adapter_info.mp_adapter_id_str;
@@ -2632,7 +2620,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)fpga_info_t *fpga_info = &p_ntdrv->adapter_info.fpga_info;const int n_phy_ports = fpga_info->n_phy_ports; -/* let running threads end Rx and Tx activity */ +/* let running services end Rx and Tx activity */ if (sg_ops !=NULL ) {nt_os_wait_usec (1 *1000 *1000 );
@@ -2707,7 +2695,7 @@ nthw_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,/* * 1 time calculation of 1 sec stat update rtc cycles to prevent stat poll -* flooding by OVS from multiple virtual port threads - no need to be precise +* flooding by OVS from multiple virtual port services - no need to be precise */ uint64_t now_rtc =rte_get_tsc_cycles ();nt_os_wait_usec (10 *1000 );
drivers/net/ntnic/ntutil/nt_util.c +1 -1
@@ -16,7 +16,7 @@static struct nt_util_vfio_impl vfio_cb; -/* uses usleep which schedules out the calling thread */ +/* uses usleep which schedules out the calling service */ void nt_os_wait_usec (int val) {rte_delay_us_sleep (val);
Signature · 1 line
2.45.0
PATCH 8/24 net/ntnic: fix potential format overflow
In reply to Serhii IliushykUse snprintf instead sprintf to avoid format overflow
--- drivers/net/ntnic/ntnic_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ntnic/ntnic_ethdev.c +2 -2
@@ -2613,7 +2613,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)NT_LOG_DBGX (DBG ,NTNIC ,"PCI device deinitialization" );int i; -char name[32 ]; +char name[RTE_ETH_NAME_MAX_LEN ];struct pmd_internals *internals = eth_dev->data->dev_private;ntdrv_4ga_t *p_ntdrv = &internals->p_drv->ntdrv;
@@ -2640,7 +2640,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused) }for (i =0 ; i < n_phy_ports; i++) { -sprintf (name,"ntnic%d" , i); +snprintf (name,sizeof (name),"ntnic%d" , i); eth_dev =rte_eth_dev_allocated (name);if (eth_dev ==NULL )continue ;/* port already released */
Signature · 1 line
2.45.0
PATCH 9/24 net/ntnic: single file function as static
In reply to Serhii IliushykRefactoring: make single file functions static
to avoid namespace pollution.
--- drivers/net/ntnic/include/create_elements.h | 9 - drivers/net/ntnic/include/flow_api.h | 2 - drivers/net/ntnic/include/hw_mod_backend.h | 15 - drivers/net/ntnic/nim/i2c_nim.c | 4 +- .../net/ntnic/nthw/core/include/nthw_fpga.h | 2 - .../net/ntnic/nthw/core/include/nthw_hif.h | 12 - .../net/ntnic/nthw/core/include/nthw_iic.h | 9 - .../ntnic/nthw/core/include/nthw_mac_pcs.h | 9 - .../net/ntnic/nthw/core/include/nthw_pcie3.h | 13 - .../nthw/core/include/nthw_pcm_nt400dxx.h | 1 - .../ntnic/nthw/core/include/nthw_phy_tile.h | 2 - .../net/ntnic/nthw/core/include/nthw_rpf.h | 2 - .../net/ntnic/nthw/core/include/nthw_si5340.h | 2 - drivers/net/ntnic/nthw/core/nthw_fpga.c | 2 +- drivers/net/ntnic/nthw/core/nthw_hif.c | 10 +- drivers/net/ntnic/nthw/core/nthw_iic.c | 238 ++++----- drivers/net/ntnic/nthw/core/nthw_mac_pcs.c | 52 +- drivers/net/ntnic/nthw/core/nthw_pcie3.c | 11 +- .../net/ntnic/nthw/core/nthw_pcm_nt400dxx.c | 2 +- drivers/net/ntnic/nthw/core/nthw_phy_tile.c | 5 +- drivers/net/ntnic/nthw/core/nthw_rpf.c | 4 +- drivers/net/ntnic/nthw/core/nthw_si5340.c | 2 +- drivers/net/ntnic/nthw/flow_api/flow_api.c | 125 ++--- .../ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c | 226 ++++---- .../ntnic/nthw/flow_api/hw_mod/hw_mod_km.c | 79 +-- .../ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c | 30 +- .../ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c | 4 +- .../profile_inline/flow_api_hw_db_inline.c | 461 +++++++++-------- .../profile_inline/flow_api_hw_db_inline.h | 53 -- .../net/ntnic/nthw/model/nthw_fpga_model.c | 485 +++++++++--------- .../net/ntnic/nthw/model/nthw_fpga_model.h | 28 - drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 9 +- drivers/net/ntnic/ntnic_vfio.c | 2 +- drivers/net/ntnic/ntnic_vfio.h | 2 - drivers/net/ntnic/ntutil/nt_util.c | 4 +- drivers/net/ntnic/ntutil/nt_util.h | 3 - 36 files changed, 887 insertions(+), 1032 deletions(-)
drivers/net/ntnic/include/create_elements.h +0 -9
@@ -60,13 +60,4 @@ enum nt_rte_flow_item_type {extern rte_spinlock_t flow_lock; -int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out); -int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr); -int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[], -int max_elem); -int nthw_create_action_elements_inline (struct cnv_action_s *action, -const struct rte_flow_action actions[], -int max_elem, -uint32_t queue_offset); -#endif /* __CREATE_ELEMENTS_H__ */
drivers/net/ntnic/include/flow_api.h +0 -2
@@ -27,8 +27,6 @@ struct hw_mod_resource_s {/* * Device Management API */ -int nthw_flow_delete_eth_dev (struct flow_eth_dev *eth_dev); -/** * A structure used to configure the Receive Side Scaling (RSS) feature * of an Ethernet port.
drivers/net/ntnic/include/hw_mod_backend.h +0 -15
@@ -415,14 +415,6 @@ int hw_mod_cat_cot_flush(struct flow_api_backend_s *be, int start_idx, int countint hw_mod_cat_cot_set (struct flow_api_backend_s *be,enum hw_cat_e field,int index,uint32_t value); -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 ;uint32_t nb_categories;
@@ -531,9 +523,6 @@ int hw_mod_km_tci_flush(struct flow_api_backend_s *be, int start_bank, int start int count);int hw_mod_km_tci_set (struct flow_api_backend_s *be,enum hw_km_e field,int bank,int record,uint32_t value); -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 ;uint32_t nb_categories;
@@ -874,8 +863,6 @@ int hw_mod_pdb_rcp_flush(struct flow_api_backend_s *be, int start_idx, int countint hw_mod_pdb_rcp_set (struct flow_api_backend_s *be,enum hw_pdb_e field,uint32_t index,uint32_t value); -int hw_mod_pdb_config_flush (struct flow_api_backend_s *be); -struct tpe_func_s {COMMON_FUNC_INFO_S ;uint32_t nb_rcp_categories;
@@ -961,8 +948,6 @@ int hw_mod_tpe_ifr_rcp_set(struct flow_api_backend_s *be, enum hw_tpe_e field, i uint32_t value);int hw_mod_tpe_ifr_counters_update (struct flow_api_backend_s *be,int start_idx,int count); -int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, -uint32_t value);int hw_mod_tpe_ifr_counters_get (struct flow_api_backend_s *be,enum hw_tpe_e field,int index,uint32_t *value);
drivers/net/ntnic/nim/i2c_nim.c +2 -2
@@ -13,7 +13,7 @@#include "qsfp_registers.h" #include "nim_defines.h" -int nim_agx_read_id (struct nim_i2c_ctx *ctx); +static int nim_agx_read_id (struct nim_i2c_ctx *ctx);static void nim_agx_read (struct nim_i2c_ctx *ctx,uint8_t dev_addr,uint8_t reg_addr,uint8_t data_len,void *p_data); static void nim_agx_write(struct nim_i2c_ctx *ctx, uint8_t dev_addr, uint8_t reg_addr,
@@ -931,7 +931,7 @@ static void nim_agx_write(struct nim_i2c_ctx *ctx,rte_spinlock_unlock (&p_nt_i2cm->i2cmmutex); } -int nim_agx_read_id (struct nim_i2c_ctx *ctx) +static int nim_agx_read_id (struct nim_i2c_ctx *ctx) {nim_agx_read (ctx,0xA0 ,0 ,sizeof (ctx->nim_id), &ctx->nim_id);return 0 ;
drivers/net/ntnic/nthw/core/include/nthw_fpga.h +0 -2
@@ -16,8 +16,6 @@int nthw_fpga_init (struct fpga_info_s *p_fpga_info);int nthw_fpga_shutdown (struct fpga_info_s *p_fpga_info); -int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga); -int nthw_fpga_avr_probe (nthw_fpga_t *p_fpga,const int n_instance_no); int nthw_fpga_iic_scan(nthw_fpga_t *p_fpga, const int n_instance_no_begin,
drivers/net/ntnic/nthw/core/include/nthw_hif.h +0 -12
@@ -137,18 +137,6 @@ int nthw_hif_init(nthw_hif_t *p, nthw_fpga_t *p_fpga, int n_instance);int nthw_hif_trigger_sample_time (nthw_hif_t *p);int nthw_hif_force_soft_reset (nthw_hif_t *p); -int nthw_hif_stat_req_enable (nthw_hif_t *p); -int nthw_hif_stat_req_disable (nthw_hif_t *p); - -int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, -uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq, -uint64_t *p_tags_in_use,uint64_t *p_rd_err,uint64_t *p_wr_err); -int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, -uint64_t *p_ref_clk_cnt,uint64_t *p_tags_in_use, -uint64_t *p_rd_err_cnt,uint64_t *p_wr_err_cnt); - -int nthw_hif_end_point_counters_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc); -int nthw_hif_read_test_reg (nthw_hif_t *p,uint8_t test_reg,uint32_t *p_value);int nthw_hif_write_test_reg (nthw_hif_t *p,uint8_t test_reg,uint32_t value);
drivers/net/ntnic/nthw/core/include/nthw_iic.h +0 -9
@@ -85,16 +85,7 @@ int nthw_iic_set_retry_params(nthw_iic_t *p, const int n_poll_delay, const int nint nthw_iic_read_data (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len,void *p_void); -int nthw_iic_readbyte (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len, -uint8_t *p_byte);int nthw_iic_write_data (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len,void *p_void); -int nthw_iic_writebyte (nthw_iic_t *p,uint8_t dev_addr,uint8_t a_reg_addr,uint8_t data_len, -uint8_t *p_byte); -bool nthw_iic_bus_ready (nthw_iic_t *p); -bool nthw_iic_data_ready (nthw_iic_t *p); -int nthw_iic_scan (nthw_iic_t *p); -int nthw_iic_scan_dev_addr (nthw_iic_t *p,int n_dev_addr,int n_reg_addr); -#endif /* __NTHW_IIC_H__ */
drivers/net/ntnic/nthw/core/include/nthw_mac_pcs.h +0 -9
@@ -198,14 +198,12 @@ typedef struct nthw_mac_pcs nthw_mac_pcs_t;int nthw_mac_pcs_init (nthw_mac_pcs_t *p,nthw_fpga_t *p_fpga,int n_instance); -void nthw_mac_pcs_tx_path_rst (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_rx_path_rst (nthw_mac_pcs_t *p,bool enable);bool nthw_mac_pcs_is_rx_path_rst (nthw_mac_pcs_t *p);/* wrapper - for ease of use */ void nthw_mac_pcs_set_rx_enable (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_tx_enable (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_tx_sel_host (nthw_mac_pcs_t *p,bool enable); -void nthw_mac_pcs_set_tx_sel_tfg (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_ts_eop (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_host_loopback (nthw_mac_pcs_t *p,bool enable);void nthw_mac_pcs_set_line_loopback (nthw_mac_pcs_t *p,bool enable);
@@ -240,11 +238,4 @@ void nthw_mac_pcs_swap_gty_rx_polarity(nthw_mac_pcs_t *p, uint8_t lane, bool swavoid nthw_mac_pcs_set_receiver_equalization_mode (nthw_mac_pcs_t *p,uint8_t mode);void nthw_mac_pcs_set_led_mode (nthw_mac_pcs_t *p,uint8_t mode);void nthw_mac_pcs_set_timestamp_comp_rx (nthw_mac_pcs_t *p,uint16_t rx_dly); -void nthw_mac_pcs_set_port_no (nthw_mac_pcs_t *p,uint8_t port_no); - -uint32_t nthw_mac_pcs_get_fld_block_lock_lock (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_block_lock_lock_mask (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_lane_lock_lock (nthw_mac_pcs_t *p); -uint32_t nthw_mac_pcs_get_fld_lane_lock_lock_mask (nthw_mac_pcs_t *p); -#endif /* NTHW_MAC_PCS_H_ */
drivers/net/ntnic/nthw/core/include/nthw_pcie3.h +0 -13
@@ -80,17 +80,4 @@ int nthw_pcie3_init(nthw_pcie3_t *p, nthw_fpga_t *p_fpga, int n_instance);int nthw_pcie3_trigger_sample_time (nthw_pcie3_t *p); -int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p); -int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p); - -int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, -uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq, -uint32_t *p_tag_use_cnt,uint32_t *p_rq_rdy_cnt,uint32_t *p_rq_vld_cnt); -int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, -uint64_t *p_ref_clk_cnt,uint64_t *p_tag_use_cnt, -uint64_t *p_pci_nt_bus_util,uint64_t *p_pci_xil_bus_util); - -int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p, -struct nthw_hif_end_point_counters *epc); -#endif /* __NTHW_PCIE3_H__ */
drivers/net/ntnic/nthw/core/include/nthw_pcm_nt400dxx.h +0 -1
@@ -34,7 +34,6 @@ nthw_pcm_nt400dxx_t *nthw_pcm_nt400dxx_new(void);int nthw_pcm_nt400dxx_init (nthw_pcm_nt400dxx_t *p,nthw_fpga_t *p_fpga,int n_instance);void nthw_pcm_nt400dxx_set_ts_pll_recal (nthw_pcm_nt400dxx_t *p,uint32_t val);bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat (nthw_pcm_nt400dxx_t *p); -bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p);void nthw_pcm_nt400dxx_set_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p,uint32_t val);#endif /* __NTHW_PCM_NT400DXX_H__ */
drivers/net/ntnic/nthw/core/include/nthw_phy_tile.h +0 -2
@@ -133,8 +133,6 @@ bool nthw_phy_tile_get_rx_am_lock(nthw_phy_tile_t *p, uint8_t intf_no);void nthw_phy_tile_set_timestamp_comp_rx (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t value);uint32_t nthw_phy_tile_get_timestamp_comp_rx (nthw_phy_tile_t *p,uint8_t intf_no); -uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address); -void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address,uint32_t data);bool nthw_phy_tile_configure_fec (nthw_phy_tile_t *p,uint8_t intf_no,bool enable);uint32_t nthw_phy_tile_read_xcvr (nthw_phy_tile_t *p,uint8_t intf_no,uint8_t lane,uint32_t address);
drivers/net/ntnic/nthw/core/include/nthw_rpf.h +0 -2
@@ -37,9 +37,7 @@ typedef struct nthw_rpf nthw_rpf_t;typedef struct nthw_rpf nt_rpf ;nthw_rpf_t *nthw_rpf_new (void ); -void nthw_rpf_delete (nthw_rpf_t *p);int nthw_rpf_init (nthw_rpf_t *p,nthw_fpga_t *p_fpga,int n_instance); -void nthw_rpf_administrative_block (nthw_rpf_t *p);void nthw_rpf_block (nthw_rpf_t *p);void nthw_rpf_unblock (nthw_rpf_t *p);void nthw_rpf_set_maturing_delay (nthw_rpf_t *p,int32_t delay);
drivers/net/ntnic/nthw/core/include/nthw_si5340.h +0 -2
@@ -25,8 +25,6 @@ nthw_si5340_t *nthw_si5340_new(void);int nthw_si5340_init (nthw_si5340_t *p,nthw_iic_t *p_nthw_iic,uint8_t n_iic_addr);void nthw_si5340_delete (nthw_si5340_t *p); -int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt, -clk_profile_data_fmt_t data_format);int nthw_si5340_config_fmt2 (nthw_si5340_t *p,const clk_profile_data_fmt2_t *p_data,const int data_cnt);
drivers/net/ntnic/nthw/core/nthw_fpga.c +1 -1
@@ -18,7 +18,7 @@#include <arpa/inet.h> -int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga) +static int nthw_fpga_get_param_info (struct fpga_info_s *p_fpga_info,nthw_fpga_t *p_fpga) {mcu_info_t *p_mcu_info = &p_fpga_info->mcu_info;
drivers/net/ntnic/nthw/core/nthw_hif.c +5 -5
@@ -217,7 +217,7 @@ int nthw_hif_trigger_sample_time(nthw_hif_t *p)return 0 ; } -int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, +static int nthw_hif_get_stat (nthw_hif_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt,uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq,uint64_t *p_tags_in_use,uint64_t *p_rd_err,uint64_t *p_wr_err) {
@@ -241,7 +241,7 @@ int nthw_hif_get_stat(nthw_hif_t *p, uint32_t *p_rx_cnt, uint32_t *p_tx_cnt,return 0 ; } -int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, +static int nthw_hif_get_stat_rate (nthw_hif_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate,uint64_t *p_ref_clk_cnt,uint64_t *p_tags_in_use,uint64_t *p_rd_err_cnt,uint64_t *p_wr_err_cnt) {
@@ -280,7 +280,7 @@ int nthw_hif_get_stat_rate(nthw_hif_t *p, uint64_t *p_pci_rx_rate, uint64_t *p_preturn 0 ; } -int nthw_hif_stat_req_enable (nthw_hif_t *p) +static int nthw_hif_stat_req_enable (nthw_hif_t *p) {nthw_field_set_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -288,7 +288,7 @@ int nthw_hif_stat_req_enable(nthw_hif_t *p)return 0 ; } -int nthw_hif_stat_req_disable (nthw_hif_t *p) +static int nthw_hif_stat_req_disable (nthw_hif_t *p) {nthw_field_clr_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -296,7 +296,7 @@ int nthw_hif_stat_req_disable(nthw_hif_t *p)return 0 ; } -int nthw_hif_end_point_counters_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) +static int nthw_hif_end_point_cntrs_sample (nthw_hif_t *p,struct nthw_hif_end_point_counters *epc) {RTE_ASSERT (epc);
drivers/net/ntnic/nthw/core/nthw_iic.c +119 -119
320 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_mac_pcs.c +26 -26
94 lines not on this page · raw message
drivers/net/ntnic/nthw/core/nthw_pcie3.c +6 -5
@@ -169,7 +169,7 @@ int nthw_pcie3_trigger_sample_time(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p) +static int nthw_pcie3_stat_req_enable (nthw_pcie3_t *p) {nthw_field_set_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -177,7 +177,7 @@ int nthw_pcie3_stat_req_enable(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p) +static int nthw_pcie3_stat_req_disable (nthw_pcie3_t *p) {nthw_field_clr_all (p->mp_fld_stat_ctrl_ena);nthw_field_set_all (p->mp_fld_stat_ctrl_req);
@@ -185,7 +185,7 @@ int nthw_pcie3_stat_req_disable(nthw_pcie3_t *p)return 0 ; } -int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt, +static int nthw_pcie3_get_stat (nthw_pcie3_t *p,uint32_t *p_rx_cnt,uint32_t *p_tx_cnt,uint32_t *p_ref_clk_cnt,uint32_t *p_tg_unit_size,uint32_t *p_tg_ref_freq,uint32_t *p_tag_use_cnt,uint32_t *p_rq_rdy_cnt,uint32_t *p_rq_vld_cnt) {
@@ -205,7 +205,8 @@ int nthw_pcie3_get_stat(nthw_pcie3_t *p, uint32_t *p_rx_cnt, uint32_t *p_tx_cnt,return 0 ; } -int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate,uint64_t *p_pci_tx_rate, +static int nthw_pcie3_get_stat_rate (nthw_pcie3_t *p,uint64_t *p_pci_rx_rate, +uint64_t *p_pci_tx_rate,uint64_t *p_ref_clk_cnt,uint64_t *p_tag_use_cnt,uint64_t *p_pci_nt_bus_util,uint64_t *p_pci_xil_bus_util) {
@@ -244,7 +245,7 @@ int nthw_pcie3_get_stat_rate(nthw_pcie3_t *p, uint64_t *p_pci_rx_rate, uint64_treturn 0 ; } -int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p, +static int nthw_pcie3_end_point_counters_sample_post (nthw_pcie3_t *p,struct nthw_hif_end_point_counters *epc) {NT_LOG_DBGX (DBG ,NTHW );
drivers/net/ntnic/nthw/core/nthw_pcm_nt400dxx.c +1 -1
@@ -68,7 +68,7 @@ bool nthw_pcm_nt400dxx_get_ts_pll_locked_stat(nthw_pcm_nt400dxx_t *p)return nthw_field_get_updated (p->mp_fld_stat_ts_pll_locked) !=0 ; } -bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p) +static bool nthw_pcm_nt400dxx_get_ts_pll_locked_latch (nthw_pcm_nt400dxx_t *p) {return nthw_field_get_updated (p->mp_fld_latch_ts_pll_locked) !=0 ; }
drivers/net/ntnic/nthw/core/nthw_phy_tile.c +3 -2
@@ -954,7 +954,7 @@ uint32_t nthw_phy_tile_get_timestamp_comp_rx(nthw_phy_tile_t *p, uint8_t intf_noreturn nthw_field_get_val32 (p->mp_fld_port_comp_rx_compensation[intf_no]); } -uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address) +static uint32_t nthw_phy_tile_read_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address) {nthw_register_update (p->mp_reg_port_eth_base[intf_no]);nthw_field_set_val32 (p->mp_fld_port_eth_base_cmd[intf_no],0 );
@@ -966,7 +966,8 @@ uint32_t nthw_phy_tile_read_eth(nthw_phy_tile_t *p, uint8_t intf_no, uint32_t adreturn nthw_field_get_updated (p->mp_fld_port_eth_data_data[intf_no]); } -void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no,uint32_t address,uint32_t data) +static void nthw_phy_tile_write_eth (nthw_phy_tile_t *p,uint8_t intf_no, +uint32_t address,uint32_t data) {nthw_field_set_val_flush32 (p->mp_fld_port_eth_data_data[intf_no], data);nthw_register_update (p->mp_reg_port_eth_base[intf_no]);
drivers/net/ntnic/nthw/core/nthw_rpf.c +2 -2
@@ -20,7 +20,7 @@ nthw_rpf_t *nthw_rpf_new(void)return p; } -void nthw_rpf_delete (nthw_rpf_t *p) +static void nthw_rpf_delete (nthw_rpf_t *p) {free (p); }
@@ -67,7 +67,7 @@ int nthw_rpf_init(nthw_rpf_t *p, nthw_fpga_t *p_fpga, int n_instance)return 0 ; } -void nthw_rpf_administrative_block (nthw_rpf_t *p) +static void nthw_rpf_administrative_block (nthw_rpf_t *p) {/* block all MAC ports */ nthw_register_update (p->mp_reg_control);
drivers/net/ntnic/nthw/core/nthw_si5340.c +1 -1
@@ -144,7 +144,7 @@ static int nthw_si5340_cfg(nthw_si5340_t *p, const void *p_data, int data_cnt,return 0 ; } -int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt, +static int nthw_si5340_config (nthw_si5340_t *p,const void *p_data,int data_cnt,clk_profile_data_fmt_t data_format) { const char *const p_adapter_id_str =
drivers/net/ntnic/nthw/flow_api/flow_api.c +63 -62
137 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_cat.c +113 -113
265 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_km.c +40 -39
94 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_pdb.c +15 -15
@@ -58,20 +58,6 @@ void hw_mod_pdb_free(struct flow_api_backend_s *be) } } -int hw_mod_pdb_reset (struct flow_api_backend_s *be) -{ -int err =0 ; -/* Zero entire cache area */ -nthw_zero_module_cache ((struct common_func_s *)(&be->hsh)); - -NT_LOG (DBG ,FILTER ,"INIT PDB RCP" ); - err |=hw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES ); - -NT_LOG (DBG ,FILTER ,"INIT PDB CONFIG" ); - err |=hw_mod_pdb_config_flush (be); -return err; -} -int hw_mod_pdb_rcp_flush (struct flow_api_backend_s *be,int start_idx,int count) {if (count ==ALL_ENTRIES )
@@ -243,7 +229,21 @@ int hw_mod_pdb_rcp_set(struct flow_api_backend_s *be, enum hw_pdb_e field, uint3return hw_mod_pdb_rcp_mod (be, field, index, &value,0 ); } -int hw_mod_pdb_config_flush (struct flow_api_backend_s *be) +static int hw_mod_pdb_config_flush (struct flow_api_backend_s *be) {return be->iface->pdb_config_flush (be->be_dev, &be->pdb); } + +int hw_mod_pdb_reset (struct flow_api_backend_s *be) +{ +int err =0 ; +/* Zero entire cache area */ +nthw_zero_module_cache ((struct common_func_s *)(&be->hsh)); + +NT_LOG (DBG ,FILTER ,"INIT PDB RCP" ); + err |=hw_mod_pdb_rcp_flush (be,0 ,ALL_ENTRIES ); + +NT_LOG (DBG ,FILTER ,"INIT PDB CONFIG" ); + err |=hw_mod_pdb_config_flush (be); +return err; +}
drivers/net/ntnic/nthw/flow_api/hw_mod/hw_mod_tpe.c +2 -2
@@ -402,8 +402,8 @@ static int hw_mod_tpe_ifr_counters_mod(struct flow_api_backend_s *be, enum hw_tpreturn 0 ; } -int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field,int index, -uint32_t value) +static int hw_mod_tpe_ifr_counters_set (struct flow_api_backend_s *be,enum hw_tpe_e field, +int index,uint32_t value) {return hw_mod_tpe_ifr_counters_mod (be, field, index, &value,0 ); }
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +238 -223
638 lines not on this page · raw message
drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.h +0 -53
96 lines not on this page · raw message
drivers/net/ntnic/nthw/model/nthw_fpga_model.c +242 -243
595 lines not on this page · raw message
drivers/net/ntnic/nthw/model/nthw_fpga_model.h +0 -28
@@ -159,21 +159,13 @@ nthw_fpga_t *nthw_fpga_mgr_query_fpga(nthw_fpga_mgr_t *p, uint64_t n_fpga_id,void nthw_fpga_mgr_log_dump (nthw_fpga_mgr_t *p);nthw_fpga_t *nthw_fpga_model_new (void ); -void nthw_fpga_model_init (nthw_fpga_t *p,nthw_fpga_prod_init_s *p_init, -struct fpga_info_s *p_fpga_info); -int nthw_fpga_get_product_param (const nthw_fpga_t *p,const nthw_id_t n_param_id,const int default_value);int nthw_fpga_get_product_id (const nthw_fpga_t *p);nthw_module_t *nthw_fpga_query_module (const nthw_fpga_t *p,nthw_id_t id,int instance); -void nthw_fpga_set_debug_mode (nthw_fpga_t *p,int n_debug_mode); -nthw_param_t *nthw_param_new (void ); -void nthw_param_init (nthw_param_t *p,nthw_fpga_t *p_fpga,nthw_fpga_prod_param_s *p_init); -nthw_module_t *nthw_module_new (void ); -void nthw_module_init (nthw_module_t *p,nthw_fpga_t *p_fpga,nthw_fpga_module_init_s *p_init);void nthw_module_init2 (nthw_module_t *p,nthw_fpga_t *p_fpga,nthw_id_t mod_id,int instance,int debug_mode);
@@ -182,47 +174,27 @@ int nthw_module_get_minor_version(const nthw_module_t *p);uint64_t nthw_module_get_version_packed64 (const nthw_module_t *p);bool nthw_module_is_version_newer (const nthw_module_t *p,int major_version,int minor_version); -int nthw_module_get_bus (const nthw_module_t *p);nthw_register_t *nthw_module_query_register (nthw_module_t *p,nthw_id_t id);nthw_register_t *nthw_module_get_register (nthw_module_t *p,nthw_id_t id);int nthw_module_get_debug_mode (const nthw_module_t *p);void nthw_module_set_debug_mode (nthw_module_t *p,unsigned int debug_mode);nthw_register_t *nthw_register_new (void ); -void nthw_register_init (nthw_register_t *p,nthw_module_t *p_module, -nthw_fpga_register_init_s *p_init); -nthw_field_t *nthw_register_query_field (const nthw_register_t *p,nthw_id_t id);nthw_field_t *nthw_register_get_field (const nthw_register_t *p,nthw_id_t id);uint32_t nthw_register_get_address (const nthw_register_t *p); -int nthw_register_get_bit_width (const nthw_register_t *p); -int nthw_register_get_debug_mode (const nthw_register_t *p);void nthw_register_set_debug_mode (nthw_register_t *p,unsigned int debug_mode); -void nthw_register_get_val (const nthw_register_t *p,uint32_t *p_data,uint32_t len); -uint32_t nthw_register_get_val32 (const nthw_register_t *p); -uint32_t nthw_register_get_val_updated32 (const nthw_register_t *p); -void nthw_register_set_val (nthw_register_t *p,const uint32_t *p_data,uint32_t len);void nthw_register_make_dirty (nthw_register_t *p);void nthw_register_update (const nthw_register_t *p); -void nthw_register_reset (const nthw_register_t *p);void nthw_register_flush (const nthw_register_t *p,uint32_t cnt); -void nthw_register_clr (nthw_register_t *p); -nthw_field_t *nthw_field_new (void ); -void nthw_field_init (nthw_field_t *p,nthw_register_t *p_reg, -const nthw_fpga_field_init_s *p_init); - -int nthw_field_get_debug_mode (const nthw_field_t *p); -void nthw_field_set_debug_mode (nthw_field_t *p,unsigned int n_debug_mode);int nthw_field_get_bit_width (const nthw_field_t *p);int nthw_field_get_bit_pos_low (const nthw_field_t *p); -int nthw_field_get_bit_pos_high (const nthw_field_t *p);uint32_t nthw_field_get_mask (const nthw_field_t *p); -void nthw_field_reset (const nthw_field_t *p);void nthw_field_get_val (const nthw_field_t *p,uint32_t *p_data,uint32_t len);void nthw_field_set_val (const nthw_field_t *p,const uint32_t *p_data,uint32_t len);void nthw_field_set_val_flush (const nthw_field_t *p,const uint32_t *p_data,uint32_t len);
drivers/net/ntnic/ntnic_filter/ntnic_filter.c +5 -4
@@ -31,7 +31,8 @@ static struct rte_flow nt_flows[MAX_RTE_FLOWS];rte_spinlock_t flow_lock =RTE_SPINLOCK_INITIALIZER ;static struct rte_flow nt_flows[MAX_RTE_FLOWS ]; -int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size,struct rte_flow_item *out) +static int nthw_interpret_raw_data (uint8_t *data,uint8_t *preserve,int size, +struct rte_flow_item *out) {int hdri =0 ;int pkti =0 ;
@@ -249,7 +250,7 @@ int nthw_interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rreturn hdri +1 ; } -int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr) +static int nthw_create_attr (struct cnv_attr_s *attribute,const struct rte_flow_attr *attr) {if (!attribute) {NT_LOG (ERR ,FILTER ,"ERROR no attribute to iterate!" );
@@ -266,7 +267,7 @@ int nthw_create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *areturn 0 ; } -int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[], +static int nthw_create_match_elements (struct cnv_match_s *match,const struct rte_flow_item items[],int max_elem) {int eidx =0 ;
@@ -316,7 +317,7 @@ int nthw_create_match_elements(struct cnv_match_s *match, const struct rte_flow_return (type >=0 ) ?0 :-1 ; } -int nthw_create_action_elements_inline (struct cnv_action_s *action, +static int nthw_create_action_elements_inline (struct cnv_action_s *action,const struct rte_flow_action actions[],int max_elem,uint32_t queue_offset)
drivers/net/ntnic/ntnic_vfio.c +1 -1
@@ -20,7 +20,7 @@#define ONE_G_MASK (ONE_G_SIZE - 1)#define START_VF_IOVA 0x220000000000 -int +static int nt_vfio_vf_num (const struct rte_pci_device *pdev) {return ((pdev->addr.devid &0x1f ) <<3 ) + ((pdev->addr.function) &0x7 );
drivers/net/ntnic/ntnic_vfio.h +0 -2
@@ -24,6 +24,4 @@ int nt_vfio_dma_unmap(int vf_num, void *virt_addr, uint64_t iova_addr, uint64_t size);/* Find device (PF/VF) number from device address */ -int -nt_vfio_vf_num (const struct rte_pci_device *dev);#endif /* _NTNIC_VFIO_H_ */
drivers/net/ntnic/ntutil/nt_util.c +2 -2
@@ -85,7 +85,7 @@ struct nt_dma_s *nt_dma_alloc(uint64_t size, uint64_t align, int numa)return vfio_addr; } -void nt_dma_free (struct nt_dma_s *vfio_addr) +static void nt_dma_free (struct nt_dma_s *vfio_addr) {NT_LOG (DBG ,GENERAL ,"VFIO DMA free addr=%" PRIX64 ", iova=%" PRIX64 ", size=%" PRIX64 , vfio_addr->addr, vfio_addr->iova, vfio_addr->size);
@@ -181,7 +181,7 @@ uint32_t nt_link_speed_capa_to_eth_speed_capa(int nt_link_speed_capa) }/* Converts link speed provided in Mbps to NT specific definitions.*/ -nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps) +static nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps) {switch (link_speed_mbps) {case 10 :
drivers/net/ntnic/ntutil/nt_util.h +0 -3
@@ -55,8 +55,6 @@ struct port_link_speed { };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); -struct nt_util_vfio_impl {int (*vfio_dma_map)(int vf_num,void *virt_addr,uint64_t *iova_addr,uint64_t size);int (*vfio_dma_unmap)(int vf_num,void *virt_addr,uint64_t iova_addr,uint64_t size);
@@ -66,7 +64,6 @@ void nt_util_vfio_init(struct nt_util_vfio_impl *impl);int nt_link_speed_to_eth_speed_num (enum nt_link_speed_e nt_link_speed);uint32_t nt_link_speed_capa_to_eth_speed_capa (int nt_link_speed_capa); -nt_link_speed_t nthw_convert_link_speed (int link_speed_mbps);int nt_link_duplex_to_eth_duplex (enum nt_link_duplex_e nt_link_duplex); int nthw_string_to_u32(const char *key_str __rte_unused, const char *value_str, void *extra_args);
Signature · 1 line
2.45.0