DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Serhii Iliushyk <sil-plv@napatech.com>
Cc: dev@dpdk.org, mko-plv@napatech.com, sil-plv@napatech.com,
	ckm@napatech.com, stephen@networkplumber.org
Subject: Re: [PATCH v1 01/24] net/ntnic: introduce service API for NTNIC PMD
Date: Tue, 21 Oct 2025 17:12:27 +0200	[thread overview]
Message-ID: <9256303.5OynTdThKG@thomas> (raw)
In-Reply-To: <20251020163620.282312-2-sil-plv@napatech.com>

20/10/2025 18:35, Serhii Iliushyk:
> --- a/doc/guides/nics/ntnic.rst
> +++ b/doc/guides/nics/ntnic.rst
> @@ -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.


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.



  reply	other threads:[~2025-10-21 15:12 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 11:04 [PATCH v1 0/7] migrate threads to DPDK service framework Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 1/7] net/ntnic: introduce service API for NTNIC PMD Serhii Iliushyk
2025-09-24 20:27   ` Stephen Hemminger
2025-09-08 11:04 ` [PATCH v1 2/7] net/ntnic: migrate flm update thread to service Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 3/7] net/ntnic: migrate statistic " Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 4/7] net/ntnic: migrate port event " Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 5/7] net/ntnic: migrate adapter mon " Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 6/7] net/ntnic: add warning about service cores Serhii Iliushyk
2025-09-08 11:04 ` [PATCH v1 7/7] net/ntnic: cleanup using pthreads and rte_thread Serhii Iliushyk
2025-09-08 14:17   ` [PATCH v2 0/7] migrate threads to DPDK service framework Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD Serhii Iliushyk
2025-09-13 16:23       ` Stephen Hemminger
2025-09-15 10:10         ` Serhii Iliushyk
2025-09-15 15:46       ` Stephen Hemminger
2025-09-24 14:41       ` [PATCH v1 00/24] Migrate threads to the DPDK service framework and refactor naming for exported symbols Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 01/24] net/ntnic: introduce service API for NTNIC PMD Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 02/24] net/ntnic: migrate flm update thread to service Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 03/24] net/ntnic: migrate statistic " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 04/24] net/ntnic: migrate port event " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 05/24] net/ntnic: migrate adapter mon " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 06/24] net/ntnic: add warning about service cores Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 07/24] net/ntnic: avoid using thread API Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 08/24] net/ntnic: fix potential format overflow Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 09/24] net/ntnic: single file function as static Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 10/24] net/ntnic: remove unused functions Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 11/24] net/ntnic: move nthw to prefix part Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 12/24] net/ntnic: change prefix hw to prefix nthw Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 13/24] net/ntnic: modify prefix flow with " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 14/24] net/ntnic: change prefix flm to " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 15/24] net/ntnic: change prefix nt " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 16/24] net/ntnic: change prefix ntlog " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 17/24] net/ntnic: change prefix km " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 18/24] net/ntnic: change prefix set " Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 19/24] net/ntnic: rename common hash and flow functions Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 20/24] net/ntnic: rename register ops function Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 21/24] net/ntnic: rename get ops functions Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 22/24] net/ntnic: rename ops init functions Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 23/24] net/ntnic: rename nim agx setup function Serhii Iliushyk
2025-09-24 14:41         ` [PATCH v1 24/24] net/ntnic: rename table ID functions Serhii Iliushyk
2025-10-20 16:35       ` [PATCH v1 00/24] Migrate threads to the DPDK service framework and refactor naming for exported symbols Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 01/24] net/ntnic: introduce service API for NTNIC PMD Serhii Iliushyk
2025-10-21 15:12           ` Thomas Monjalon [this message]
2025-10-22 16:40             ` [PATCH v1 0/1] cleanup the guide " Serhii Iliushyk
2025-10-22 16:40               ` [PATCH v1 1/1] doc: refactoring " Serhii Iliushyk
2025-10-22 17:35                 ` Thomas Monjalon
2025-10-20 16:35         ` [PATCH v1 02/24] net/ntnic: migrate flm update thread to service Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 03/24] net/ntnic: migrate statistic " Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 04/24] net/ntnic: migrate port event " Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 05/24] net/ntnic: migrate adapter mon " Serhii Iliushyk
2025-10-21 15:20           ` Thomas Monjalon
2025-10-20 16:35         ` [PATCH v1 06/24] net/ntnic: add warning about service cores Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 07/24] net/ntnic: avoid using thread API Serhii Iliushyk
2025-10-20 16:35         ` [PATCH v1 08/24] net/ntnic: fix potential format overflow Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 09/24] net/ntnic: single file function as static Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 10/24] net/ntnic: remove unused functions Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 11/24] net/ntnic: move nthw to prefix part Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 12/24] net/ntnic: change prefix hw to prefix nthw Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 13/24] net/ntnic: modify prefix flow with " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 14/24] net/ntnic: change prefix flm to " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 15/24] net/ntnic: change prefix nt " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 16/24] net/ntnic: change prefix ntlog " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 17/24] net/ntnic: change prefix km " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 18/24] net/ntnic: change prefix set " Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 19/24] net/ntnic: rename common hash and flow functions Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 20/24] net/ntnic: rename register ops function Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 21/24] net/ntnic: rename get ops functions Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 22/24] net/ntnic: rename ops init functions Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 23/24] net/ntnic: rename nim agx setup function Serhii Iliushyk
2025-10-20 16:36         ` [PATCH v1 24/24] net/ntnic: rename table ID functions Serhii Iliushyk
2025-10-20 21:17         ` [PATCH v1 00/24] Migrate threads to the DPDK service framework and refactor naming for exported symbols Stephen Hemminger
2025-10-20 21:38         ` Stephen Hemminger
2025-09-08 14:17     ` [PATCH v2 2/7] net/ntnic: migrate flm update thread to service Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 3/7] net/ntnic: migrate statistic " Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 4/7] net/ntnic: migrate port event " Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 5/7] net/ntnic: migrate adapter mon " Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 6/7] net/ntnic: add warning about service cores Serhii Iliushyk
2025-09-08 14:17     ` [PATCH v2 7/7] net/ntnic: cleanup using pthreads and rte_thread Serhii Iliushyk
2025-09-23 14:47     ` [PATCH v2 0/7] migrate threads to DPDK service framework Stephen Hemminger
2025-09-08 20:08 ` [PATCH v1 " Stephen Hemminger
2025-09-10 12:13   ` Serhii Iliushyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9256303.5OynTdThKG@thomas \
    --to=thomas@monjalon.net \
    --cc=ckm@napatech.com \
    --cc=dev@dpdk.org \
    --cc=mko-plv@napatech.com \
    --cc=sil-plv@napatech.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).