From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9D22A46EFE; Mon, 15 Sep 2025 12:10:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EA1140611; Mon, 15 Sep 2025 12:10:48 +0200 (CEST) Received: from egress-ip11a.ess.de.barracuda.com (egress-ip11a.ess.de.barracuda.com [18.184.203.234]) by mails.dpdk.org (Postfix) with ESMTP id ABA8840262 for ; Mon, 15 Sep 2025 12:10:45 +0200 (CEST) Received: from OSPPR02CU001.outbound.protection.outlook.com (mail-norwayeastazon11023133.outbound.protection.outlook.com [40.107.159.133]) by mx-outbound14-229.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Sep 2025 10:10:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N0riz0wIjHVU5DKlPL0QqPuhN6LpXQ08lgnhDncSuihLk+hrdWG2TMiwimzaH5vMuDOyW+IT3Oi6gmfAG5xDVzxYNGSnf/+imw/L9Cph36RMS7zCIYhn94shmIqe9r1hHy0Gf5466YRcMDI/tRE2Twrm5GvS47s+vrMubxlLzCeylCjA807MSYtpWoKzFIyBCLIaaJU02cHYGQNBkxNkaDBxHO74XnFubsJeitzr5Fw/DLx281d3uhQ5yCTwzSOKjaoyFTPns6OCbTTeQ3/4mvLL7LXSMsXlK5vuyNgN9GBo2hAPM2/1IjUOjMvgZJFgEtb8gOEdTx9PKT8RSDnGpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8YZoIYCmjZSh2TYCtn1nbzlZOYddcl4dYRK0YxoPIsc=; b=rM1Mv7G/UWAZtzWM4MM2pi92AS/0QLEtW63x2BivvH6zTOdJ9wiFD0Atvs8cwLRiJdsfe9Pa3BSrw63gUIh7dTjWfaP7gIuQ+mll/1S55O4K0xWUy4fr1wfc/OxnnhhzbXKlfhxLRNYXpkkd+p8sEV4WKDXod194nG5Puhm2xSaeMNc+gJ6sGy1X05Km0ReeITA1XLzKOs55sXy3zJnWPV4Je5JxNAV2gigKK1tjDH0aybSh9i10MOCCe42Li/U1PkpGLolRto3bmZBm62aWGtCNwkKudEw3luRXH02arOqYUkDEUKAYRPRRnuOWFfTQL85ef54voNGNJcG8q07VsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=napatech.com; dmarc=pass action=none header.from=napatech.com; dkim=pass header.d=napatech.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8YZoIYCmjZSh2TYCtn1nbzlZOYddcl4dYRK0YxoPIsc=; b=dAD+nMT+9M4ryX1TCakcEfwKXw2ZVUFzBhS0mBoiKysgHkNjL9MLgPpkem4pygJgw7Yt4PbOWRnVhdI27jXAG+ni6vHTG4f7vPmaNnef1u8PQjWU48OFIVZ49glKMep663uzJ40RraAWOC5DfqjxnJGLgNdvKHpyud3684GUDH0= Received: from VE1P190MB0830.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:1a9::5) by DB9P190MB1195.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:221::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.21; Mon, 15 Sep 2025 10:10:39 +0000 Received: from VE1P190MB0830.EURP190.PROD.OUTLOOK.COM ([fe80::fb19:d808:3eac:2ea3]) by VE1P190MB0830.EURP190.PROD.OUTLOOK.COM ([fe80::fb19:d808:3eac:2ea3%5]) with mapi id 15.20.9115.018; Mon, 15 Sep 2025 10:10:39 +0000 From: Serhii Iliushyk To: Stephen Hemminger CC: "dev@dpdk.org" , Mykola Kostenok , Christian Koue Muf Subject: Re: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD Thread-Topic: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD Thread-Index: AQHcIMtbs8wf0vEVgkCtO5K3aRZYrbSRU8UAgAKReOw= Date: Mon, 15 Sep 2025 10:10:39 +0000 Message-ID: References: <20250908110446.1071964-8-sil-plv@napatech.com> <20250908141740.1312268-1-sil-plv@napatech.com> <20250908141740.1312268-2-sil-plv@napatech.com> <20250913092304.1ca77333@hermes.local> In-Reply-To: <20250913092304.1ca77333@hermes.local> Accept-Language: en-GB, en-US Content-Language: en-GB X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=napatech.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VE1P190MB0830:EE_|DB9P190MB1195:EE_ x-ms-office365-filtering-correlation-id: e573d450-c7ef-4e7c-9e97-08ddf4401f16 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|7053199007|38070700021|8096899003|13003099007; x-microsoft-antispam-message-info: =?iso-8859-1?Q?w+Wmx4/UCJb0xLtVxRlBtUrsWmcWQ37Waa9fzyEwgIViDQ687fKGI/I2dw?= =?iso-8859-1?Q?NqGqt2+VfcT1JWgqleeudXhjYdMZhdNKReNKrHZSwiFy82I7eOsdv6yngn?= =?iso-8859-1?Q?r1cj5LeRhmtpEyG9LXtJ8yNJEfOpVDBs89Uc2/Hj5C1smVnQh1/sJEqr22?= =?iso-8859-1?Q?FIZ6tfHD7UYzyMiWjUfIrsorSk84hd8D2A7XllkYIUpO74aFm2fLVB/aXr?= =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2eKEQs430Vv4tvY/BDRzwCj0?= =?iso-8859-1?Q?3vjXowN0IZj+bYPRHDa4TvZLbxFg+u8E8ePiQu/MMYZAEUZMGtT7sI0ur2?= =?iso-8859-1?Q?vOO8Jsn/apPFvEiBmT0Uwn4x2OsMMlpT5Y7JLMGuOwfxxk94zv1D3Gi7TG?= =?iso-8859-1?Q?aNRx1OdDi9Xu/n3BCICeybYKr64MTaVrp5HqDh++vnFmMkKBbbOt0RZy7d?= =?iso-8859-1?Q?px1WQ9r+UPvwIE1OrbA0SNJdgisO4nVwXx5R3xkba1PmvEJjdiITaj5S3t?= =?iso-8859-1?Q?2TkV2kZysJSWXoVZS4T0ckzxQUcNJPlQ0uVeebHwB9x+f/bJgjQKqud57p?= =?iso-8859-1?Q?3e6AsI25nIW83HpRA+V3eKt54J2cnnGjEYS+v5Gu0PSyd31N/IoKRogXJE?= =?iso-8859-1?Q?A=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1P190MB0830.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(7053199007)(38070700021)(8096899003)(13003099007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?b3cIs4HrBjOJeYlV427oxpL/F502fQWYv3kI+1rywPKi6ZLJary9atisuK?= =?iso-8859-1?Q?l0GFXsa8TXXiJgNLX65dIFUySrQnz5uMVWhG+sQ23lrBmM5rQCYA7goh8Q?= =?iso-8859-1?Q?EQ2YB455tHxKxHjCBI4z7uEdujOqxZRUhmeRsFtotz8HYlGhKkbVKrobNw?= =?iso-8859-1?Q?cBo96qMRjHhMHQZ6I4TbrDWKjQacXM1syaJ26XAV9DpLTFRsqWutzoYWVd?= =?iso-8859-1?Q?n3LkanokPm3mjvre/nYnk9mHNbhgGJF1q9RyvS5jSMf3oe96tI84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Za6MVFRuZGKsHMDRDbDjJg1QwdOpaYhkCJnKyv?= =?iso-8859-1?Q?CUn9xaQstOpH1i6y7JnR79etdA7v58ermPNG1BgP69FSdD2xzfq2s4ip5R?= =?iso-8859-1?Q?J5SIsxFiNUzWQxmnpnPUVi4c5Xs/lFxcCwjE64eZqzdCvWdQUXgQez7CiX?= =?iso-8859-1?Q?z/KgDqWnNS/f0SKC0jX+t3x12Oyv4Ap1s4XdfEiT/RRbz5xVoSgIKIV12e?= =?iso-8859-1?Q?rqbdKf1bBZuUKmA65jb+OTYxI4BkC/CvGtirOPfy8851hVR8ryGFWSOnBi?= =?iso-8859-1?Q?tUg7HBvDe4SEMN5mAv9MUDKUKIGwhWvbdZIOzdvkx4S9jGORm1zcWvMLo3?= =?iso-8859-1?Q?+FGWTkAIL8uIqzcDag/nFR6vXIZCDe7zAEE2kwAm6WnrboRpB2JX0xRxeu?= =?iso-8859-1?Q?sajSeHR6IlOTU/e3kiVXhIcY6r1ExLdNPt31ioxQOqgryeV2Q3c4BoCPzC?= =?iso-8859-1?Q?kEqRw2UYnSa2cBT95EdrEF6BkSNqKPRms4?= Content-Type: multipart/alternative; boundary="_000_VE1P190MB08305B788F9E11C757A19CFB8015AVE1P190MB0830EURP_" MIME-Version: 1.0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: P3souRuecGX7c/cCe1vaYanUooNR2oIpmV+gAIWWj5w7W7n/JgpDKkcANssWGfHkOuZg0Kdkq379pzK/U6Z6W+dE6R+X3wBVSeXSi8N0+k7dFrnBXSyuKOUW08GhlHiwT8tM3tIsGkhYEe6VCYbl2OJsAHAisdnKQ6uzN9+UP8us/Mf6QPraDMP+dEdhsH7fz69jymDx4YyA/KdA6nLGaMuVLFYw3yLaOS9d9rOZi8AfeCkg9AEz60cDdsHVq6WOXc43gaP82wnp1WOfXh1qeOmTG6ZRhgyikC/qneSDpIBRL5SaQ5Oh0laNyZJuj3uXZrDKavMTdGW/6VPzGVOAuI588fwvpHiiiELAI2AoA/aAHA2k5UJ8GV0ihpo2LJz1+SSNDQ0y4BSZ8RBBbZdbmSBP7BZe5F7QYI5WGFh1jTJM+dZge7hDlouNvyDiRAVDw9Zz+N7bY2hw0a05a3gHUJCKkMIJ/nJXUOAWwS1sorYhunTU3oGlesqAxonS6pxgUrbKZmz3qELg/yPxtVu89F1U5BlUB8Udrppp93EgckABYu8U31248ky4d3gs0avTFJVZijdsQuXSvWtLiBF5zAifvAmKjSVxCsNLBLXXYt7F+6oig52D5MEnoKGc8gtYuYT0C1aWcWuAj0DwuEf7tQWZdXNWdB3Uv6bSC3BTguU= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VE1P190MB0830.EURP190.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: e573d450-c7ef-4e7c-9e97-08ddf4401f16 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2025 10:10:39.3104 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: kokQyqwI5qguPDJHtOOMB9O4kQ5GTie/I7LWVlzSh1ig0oXhMsBT3VR2o356xDojflTRmS59PEMdhZkghP/tLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9P190MB1195 X-BESS-ID: 1757931042-303813-7624-1409-1 X-BESS-VER: 2019.1_20250904.2304 X-BESS-Apparent-Source-IP: 40.107.159.133 X-BESS-Parts: H4sIAAAAAAACAzXLOw6EMAwE0Lu4psgPj81V0BYOSUSDKDbFSoi7bwpoRjMjvf Wi+uu0UB850fmlhZ3IaPs40TQ6aZUFGzg4pDHVUmRfdG6R7un1ez8erwAen4tZq1aCef hSTZP5rMgpCDtj0P35A9AJuOeBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.267505 [from cloudscan21-252.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=HTML_MESSAGE, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_VE1P190MB08305B788F9E11C757A19CFB8015AVE1P190MB0830EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable From: Stephen Hemminger Sent: 13 September 2025 19:23 To: Serhii Iliushyk Cc: dev@dpdk.org ; Mykola Kostenok ; Ch= ristian Koue Muf Subject: Re: [PATCH v2 1/7] net/ntnic: introduce service API for NTNIC PMD On Mon, 8 Sep 2025 16:17:33 +0200 Serhii Iliushyk wrote: > diff --git a/doc/guides/nics/ntnic.rst b/doc/guides/nics/ntnic.rst > index b3d6ad70c1..a173eaa2ac 100644 > --- 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 configu= re 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 l= oad, 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 serv= ice 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 rt= e_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 initializa= tion 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, u= int32_t lcore_id) > + > +For example to assign lcores 8,9,10,11,12 to the services, the applicati= on 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 servic= e 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 =3D 0, > + RTE_NTNIC_SERVICE_STAT =3D 1, > + RTE_NTNIC_SERVICE_PORT_0_EVENT =3D 2, > + RTE_NTNIC_SERVICE_PORT_1_EVENT =3D 3, > + RTE_NTNIC_SERVICE_ADAPTER_MON =3D 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 applicatio= n can use: > + > +.. code-block:: c > + > + int flm_update_id =3D 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 fil= e: > + > +.. code-block:: c > + > + #include > + > +And linked with the library: `https://linkprotect.cudasvc.com/url?a=3Dht= tps%3a%2f%2flibrte_net_ntnic.so&c=3DE,1,Y0L6xj9VNKcZFYqAqRe-8zIt_7rMPD4KOWR= MISoqVC_WIz7nsVj8xFm2zsiLl9o97z8bgkUxWD4uEioCtxO_S3AIO5hqm9inj17-Hase1qRv2b= yMWjlBinC_4A,,&typo=3D1` 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 missin= g feature in the service lcore library. Should be able to do this stuff throu= gh 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 t= hat can pass the EAL option to the rte_eal_init funtion. Only one option is required here (-S SERVICE CORELIST or -s SERVICE COREMAS= K). 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/li= b/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=3D"-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 --_000_VE1P190MB08305B788F9E11C757A19CFB8015AVE1P190MB0830EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: 13 September 2025 19:23
To: Serhii Iliushyk <sil-plv@napatech.com>
Cc: dev@dpdk.org <dev@dpdk.org>; Mykola Kostenok <mko-= plv@napatech.com>; Christian Koue Muf <ckm@napatech.com>
Subject: Re: [PATCH v2 1/7] net/ntnic: introduce service API fo= r NTNIC PMD
 
On Mon,  8 Se= p 2025 16:17:33 +0200
Serhii Iliushyk <sil-plv@napatech.com> wrote:

> diff --git a/doc/guides/nics/ntnic.rst b/doc/guides/nics/ntnic.rst
> index b3d6ad70c1..a173eaa2ac 100644
> --- a/doc/guides/nics/ntnic.rst
> +++ b/doc/guides/nics/ntnic.rst
> @@ -185,3 +185,115 @@ There are list of characteristics that age timeo= ut 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 conf= igure 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, por= t 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 servic= es 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:<= br> > +
> +.. code-block:: c
> +
> +   int nthw_service_del(const enum rte_ntnic_service_tag ta= g)
> +
> +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 initial= ization 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 t= he services.
> +
> +By API function:
> +
> +.. code-block:: c
> +
> +   int rte_pmd_ntnic_service_set_lcore(enum rte_ntnic_servi= ce_tag tag, uint32_t lcore_id)
> +
> +For example to assign lcores 8,9,10,11,12 to the services, the applic= ation 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_ADAPTE= R_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_UP= DATE, 12);
> +
> +The API will automatically lcore to service core list and map the ser= vice to the lcore.
> +
> +.. note:: Use `rte_service_lcore_start` to start the lcore after mapp= ing 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 =3D 0, > +      RTE_NTNIC_SERVICE_STAT =3D 1,
> +      RTE_NTNIC_SERVICE_PORT_0_EVENT =3D 2,<= br> > +      RTE_NTNIC_SERVICE_PORT_1_EVENT =3D 3,<= br> > +      RTE_NTNIC_SERVICE_ADAPTER_MON =3D 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 ta= g);
> +
> +
> +For example, to enable statistics for flm_update service, the applica= tion can use:
> +
> +.. code-block:: c
> +
> +   int flm_update_id =3D rte_pmd_ntnic_service_get_id(RTE_N= TNIC_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: `https://linkprotect.cudasvc.com/url?a= =3Dhttps%3a%2f%2flibrte_net_ntnic.so&c=3DE,1,Y0L6xj9VNKcZFYqAqRe-8zIt_7= rMPD4KOWRMISoqVC_WIz7nsVj8xFm2zsiLl9o97z8bgkUxWD4uEioCtxO_S3AIO5hqm9inj17-H= ase1qRv2byMWjlBinC_4A,,&typo=3D1` 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 missin= g
feature in the service lcore library. Should be able to do this stuff throu= gh 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 t= hat can pass the EAL option to the rte_eal_init funtion.
Only one option is required here (-S SERVICE CORELIST or -s SERVICE CO= REMASK).
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 i= nside 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=3D"-= 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
--_000_VE1P190MB08305B788F9E11C757A19CFB8015AVE1P190MB0830EURP_--