DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Serhii Iliushyk <sil-plv@napatech.com>
Cc: dev@dpdk.org, mko-plv@napatech.com, ckm@napatech.com
Subject: Re: [PATCH v2 0/7] migrate threads to DPDK service framework
Date: Tue, 23 Sep 2025 07:47:25 -0700	[thread overview]
Message-ID: <20250923074715.41aed917@hermes.local> (raw)
In-Reply-To: <20250908141740.1312268-1-sil-plv@napatech.com>

On Mon,  8 Sep 2025 16:17:32 +0200
Serhii Iliushyk <sil-plv@napatech.com> wrote:

> This modification provides better resource (CPU) management for NTNIC PMD.
> 
> The following threads are migrated:
>         * FLM update thread
>         * Statistic thread
>         * Port event thread
>         * Adapter monitoring thread
> Additionally, a warning is added to inform users about the importance of
> dedicating lcores to the DPDK service framework when using the NTNIC PMD.
> The code is also cleaned up to use pthreads and rte_thread APIs.
> 
> After this patch series, an each application using NTNIC PMD should
> dedicate at least five(5) cores for DPDK service framework to ensure
> proper operation of the NTNIC PMD.
> 
> The sercvice cores can be dedicated by EAL options:
>         * s SERVICE COREMASK Hexadecimal bitmask of cores to be used as service cores
>         * S SERVICE CORELIST List of cores to run services on
> Or with special API by application itself.
>         * rte_pmd_ntnic_service_set_lcore to map a service to a specific lcore
>         * rte_pmd_ntnic_service_get_id to get a service ID.
> 
> Serhii Iliushyk (7):
>   net/ntnic: introduce service API for NTNIC PMD
>   net/ntnic: migrate flm update thread to service
>   net/ntnic: migrate statistic thread to service
>   net/ntnic: migrate port event thread to service
>   net/ntnic: migrate adapter mon thread to service
>   net/ntnic: add warning about service cores
>   net/ntnic: cleanup using pthreads and rte_thread
> 
>  doc/guides/nics/ntnic.rst                     | 112 ++++
>  drivers/net/ntnic/adapter/nt4ga_adapter.c     |  27 +-
>  .../net/ntnic/include/common_adapter_defs.h   |  15 -
>  drivers/net/ntnic/include/nt4ga_adapter.h     |   4 -
>  drivers/net/ntnic/include/ntdrv_4ga.h         |   4 -
>  drivers/net/ntnic/include/ntnic_stat.h        |   2 +-
>  drivers/net/ntnic/include/ntos_drv.h          |   4 +-
>  .../link_mgmt/link_100g/nt4ga_link_100g.c     | 303 +++++-----
>  .../link_agx_100g/nt4ga_agx_link_100g.c       | 306 ++++++-----
>  drivers/net/ntnic/meson.build                 |   2 +
>  drivers/net/ntnic/nthw/core/nthw_pca9532.c    |   2 -
>  drivers/net/ntnic/nthw/core/nthw_pcal6416a.c  |   1 -
>  .../net/ntnic/nthw/core/nthw_si5332_si5156.c  |   1 -
>  .../profile_inline/flow_api_profile_inline.c  |   2 +-
>  drivers/net/ntnic/ntnic_ethdev.c              | 520 ++++++++++--------
>  drivers/net/ntnic/ntnic_filter/ntnic_filter.c |  17 +
>  drivers/net/ntnic/ntutil/nt_service.c         | 127 +++++
>  drivers/net/ntnic/ntutil/nt_service.h         |  62 +++
>  drivers/net/ntnic/ntutil/nt_util.c            |   2 +-
>  drivers/net/ntnic/rte_pmd_ntnic.c             | 104 ++++
>  drivers/net/ntnic/rte_pmd_ntnic.h             |  26 +
>  21 files changed, 1073 insertions(+), 570 deletions(-)
>  delete mode 100644 drivers/net/ntnic/include/common_adapter_defs.h
>  create mode 100644 drivers/net/ntnic/ntutil/nt_service.c
>  create mode 100644 drivers/net/ntnic/ntutil/nt_service.h
>  create mode 100644 drivers/net/ntnic/rte_pmd_ntnic.c
> 

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

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

diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 3edf7796f7..18dab16f6b 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -2580,7 +2580,8 @@ nthw_pci_dev_init(struct rte_pci_device *pci_dev)
                                .callback_userdata = internals
                        };
 
-                       sprintf(port_event_spec.name, "ntnic-port_%d_event_service", n_intf_no);
+                       snprintf(port_event_spec.name, RTE_SERVICE_NAME_MAX,
+                                "ntnic-%d_event", n_intf_no);
 
                        const int port_srv_tag[2] = {
                                RTE_NTNIC_SERVICE_PORT_0_EVENT,
@@ -2612,9 +2613,8 @@ static int
 nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)
 {
        NT_LOG_DBGX(DBG, NTNIC, "PCI device deinitialization");
-
        int i;
-       char name[32];
+       char name[RTE_ETH_NAME_MAX_LEN];
 
        struct pmd_internals *internals = eth_dev->data->dev_private;
        ntdrv_4ga_t *p_ntdrv = &internals->p_drv->ntdrv;
@@ -2641,7 +2641,7 @@ nthw_pci_dev_deinit(struct rte_eth_dev *eth_dev __rte_unused)
        }
 
        for (i = 0; i < n_phy_ports; i++) {
-               sprintf(name, "ntnic%d", i);
+               snprintf(name, sizeof(name), "ntnic%d", i);
                eth_dev = rte_eth_dev_allocated(name);
                if (eth_dev == NULL)
                        continue; /* port already released */


  parent reply	other threads:[~2025-09-23 14:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 11:04 [PATCH v1 " 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-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     ` Stephen Hemminger [this message]
2025-09-08 20:08 ` [PATCH v1 0/7] migrate threads to DPDK service framework 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=20250923074715.41aed917@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=ckm@napatech.com \
    --cc=dev@dpdk.org \
    --cc=mko-plv@napatech.com \
    --cc=sil-plv@napatech.com \
    /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).