DPDK patches and discussions
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* Re: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
  2023-11-02 18:37  3% ` Stephen Hemminger
@ 2023-11-07 17:33  0%   ` rahul gupta
  2023-11-08  4:38  0%   ` Rahul Gupta
  1 sibling, 0 replies; 200+ results
From: rahul gupta @ 2023-11-07 17:33 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Rahul Gupta, dev, thomas, sovaradh, okaya, sujithsankar,
	sowmini.varadhan, Rahul Gupta

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

Hi Stephen,

Thanks for your review.
If I make it __rte_internal then, testpmd or our application can't use it.
So instead I am planning to make it __rte_experimental.

Regards,
Rahul.

On Fri, 3 Nov 2023 at 00:08, Stephen Hemminger <stephen@networkplumber.org>
wrote:

> On Thu,  2 Nov 2023 11:19:24 -0700
> Rahul Gupta <rahulgupt@linux.microsoft.com> wrote:
>
> > From: Rahul Gupta <rahulgupt@linux.microsoft.com>
> > To: dev@dpdk.org,  thomas@monjalon.net
> > Cc: sovaradh@linux.microsoft.com, okaya@kernel.org,
> sujithsankar@microsoft.com,  sowmini.varadhan@microsoft.com,
> rahulrgupta27@gmail.com,  Rahul Gupta <rahulgupt@microsoft.com>,  Rahul
> Gupta <rahulgupt@linux.microsoft.com>
> > Subject: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
> > Date: Thu,  2 Nov 2023 11:19:24 -0700
> > X-Mailer: git-send-email 1.8.3.1
> >
> > From: Rahul Gupta <rahulgupt@microsoft.com>
> >
> > Initialization often requires rte_eal_init + rte_pktmbuf_pool_create
> > which can consume a total time of 500-600 ms:
> > a) For many devices FLR may take a significant chunk of time
> >    (200-250 ms in our use-case), this FLR is triggered during device
> >    probe in rte_eal_init().
> > b) rte_pktmbuf_pool_create() can consume upto 300-350 ms for
> > applications that require huge memory.
> >
> > This cost is incurred on each restart (which happens in our use-case
> > during binary updates for servicing).
> > This patch provides an optimization using pthreads that appplications
> > can use and which can save 200-230ms.
> >
> > In this patch, rte_eal_init() is refactored into two parts-
> > a) 1st part is dependent code ie- it’s a perquisite of the FLR and
> >    mempool creation. So this code needs to be executed before any
> >    pthreads. Its named as rte_eal_init_setup()
> > b) 2nd part of code is independent code ie- it can execute in parallel
> >    to mempool creation in a pthread. Its named as rte_probe_and_ioctl().
> >
> > Existing applications require no changes unless they wish to leverage
> > the optimization.
> >
> > If the application wants to use pthread functionality, it should call-
> > a) rte_eal_init_setup() then create two or more pthreads-
> > b) in one pthread call- rte_probe_and_ioctl(),
> > c) second pthread call- rte_pktmbuf_pool_create()
> > d) (optional) Other pthreads for  any other independent function.
> >
> > Signed-off-by: Rahul Gupta <rahulgupt@linux.microsoft.com>
>
> These probably marked internal rather than part of API/ABI.
>

[-- Attachment #2: Type: text/html, Size: 4000 bytes --]

^ permalink raw reply	[relevance 0%]

* Re: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
  2023-11-02 18:37  3% ` Stephen Hemminger
  2023-11-07 17:33  0%   ` rahul gupta
@ 2023-11-08  4:38  0%   ` Rahul Gupta
  1 sibling, 0 replies; 200+ results
From: Rahul Gupta @ 2023-11-08  4:38 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, thomas, sovaradh, okaya, sujithsankar, sowmini.varadhan,
	rahulrgupta27, Rahul Gupta, Rahul Gupta

On (11/02/23 11:37), Stephen Hemminger wrote:
> Date: Thu, 2 Nov 2023 11:37:59 -0700
> From: Stephen Hemminger <stephen@networkplumber.org>
> To: Rahul Gupta <rahulgupt@linux.microsoft.com>
> Cc: dev@dpdk.org, thomas@monjalon.net, sovaradh@linux.microsoft.com,
>  okaya@kernel.org, sujithsankar@microsoft.com,
>  sowmini.varadhan@microsoft.com, rahulrgupta27@gmail.com, Rahul Gupta
>  <rahulgupt@microsoft.com>
> Subject: Re: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu)
> 
> On Thu,  2 Nov 2023 11:19:24 -0700
> Rahul Gupta <rahulgupt@linux.microsoft.com> wrote:
> 
> > From: Rahul Gupta <rahulgupt@linux.microsoft.com>
> > To: dev@dpdk.org,  thomas@monjalon.net
> > Cc: sovaradh@linux.microsoft.com, okaya@kernel.org, sujithsankar@microsoft.com,  sowmini.varadhan@microsoft.com, rahulrgupta27@gmail.com,  Rahul Gupta <rahulgupt@microsoft.com>,  Rahul Gupta <rahulgupt@linux.microsoft.com>
> > Subject: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
> > Date: Thu,  2 Nov 2023 11:19:24 -0700
> > X-Mailer: git-send-email 1.8.3.1
> > 
> > From: Rahul Gupta <rahulgupt@microsoft.com>
> > 
> > Initialization often requires rte_eal_init + rte_pktmbuf_pool_create
> > which can consume a total time of 500-600 ms:
> > a) For many devices FLR may take a significant chunk of time
> >    (200-250 ms in our use-case), this FLR is triggered during device
> >    probe in rte_eal_init().
> > b) rte_pktmbuf_pool_create() can consume upto 300-350 ms for
> > applications that require huge memory.
> > 
> > This cost is incurred on each restart (which happens in our use-case
> > during binary updates for servicing).
> > This patch provides an optimization using pthreads that appplications
> > can use and which can save 200-230ms.
> > 
> > In this patch, rte_eal_init() is refactored into two parts-
> > a) 1st part is dependent code ie- it’s a perquisite of the FLR and
> >    mempool creation. So this code needs to be executed before any
> >    pthreads. Its named as rte_eal_init_setup()
> > b) 2nd part of code is independent code ie- it can execute in parallel
> >    to mempool creation in a pthread. Its named as rte_probe_and_ioctl().
> > 
> > Existing applications require no changes unless they wish to leverage
> > the optimization.
> > 
> > If the application wants to use pthread functionality, it should call-
> > a) rte_eal_init_setup() then create two or more pthreads-
> > b) in one pthread call- rte_probe_and_ioctl(),
> > c) second pthread call- rte_pktmbuf_pool_create()
> > d) (optional) Other pthreads for  any other independent function.
> > 
> > Signed-off-by: Rahul Gupta <rahulgupt@linux.microsoft.com>
> 
> These probably marked internal rather than part of API/ABI.

Hi Stephen,

Thanks for your review.
If I make it __rte_internal then, testpmd or our application can't use it.
So instead I am planning to make it __rte_experimental.

Regards,
Rahul.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
                       ` (4 preceding siblings ...)
  2023-10-28  9:50  0%   ` Jie Hai
@ 2023-11-08  2:55  0%   ` lihuisong (C)
  5 siblings, 0 replies; 200+ results
From: lihuisong (C) @ 2023-11-08  2:55 UTC (permalink / raw)
  To: Jie Hai; +Cc: dev, liudongdong3

lgtm, for series,
Acked-by: Huisong Li <lihuisong@huawei.com>


在 2023/7/4 17:04, Jie Hai 写道:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
>
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
>
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
>
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
>
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
>
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
>
> v6->v7:
> 1. Remove prod/consumer head/tail info.
>
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
>
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/5] kvargs: add one new process API
  2023-11-06 16:19  0%         ` Stephen Hemminger
@ 2023-11-07  3:21  0%           ` fengchengwen
  0 siblings, 0 replies; 200+ results
From: fengchengwen @ 2023-11-07  3:21 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: thomas, ferruh.yigit, dev

Hi Stephen,

On 2023/11/7 0:19, Stephen Hemminger wrote:
> On Mon, 6 Nov 2023 15:13:35 +0800
> fengchengwen <fengchengwen@huawei.com> wrote:
> 
>>>> +  
>>>
>>> Looks good but may I suggest some alternatives.
>>>
>>> Since this is an API and ABI change as was not announced, maybe a little late
>>> in the process for this release. And since unlikely to go in 23.11 need to do something
>>> better in 24.03.
>>>
>>> What about changing the args to rte_kvargs_process() to add an additional default
>>> value. Most callers don't have a default (use key-value) but the ones that take only-key
>>> would pass the default value.  
>>
>> The API definition changed, it may need modify most drivers.
>>
>> Although it's a little late, better continue current.
>>
>> Thanks
>> Chengwen
> 
> Looking ahead, I would like to replace all of EAL args and KVargs processing
> with something more like the python parseargs library. The API is cleaner and
> incorporating the help with arg parsing is a real benefit. Thomas also suggested
> integrating help in the arg parsing.
> 
> Something like: https://github.com/cofyc/argparse

The argparse is great, especial it integrate help in the arg parsing, which could help
for parse args.
I will propose a argparse library RFC later, and we could both work on it.

As for this commit, I think it has difference: the KV pair was not separated by spaces,

So for:  dpdk-testpmd -a 0000:7d:00.0,a=1,b=2,c=3 --file-prefix=feng

We could parse 'a' has value: 0000:7d:00.0,a=1,b=2,c=3
               'file-prefix' has value: feng
by argparse.

and then use kvargs to parse a=1,b=2,c=3.

Thanks
Chengwen

> 
> .
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/5] kvargs: add one new process API
  2023-11-06  7:13  0%       ` fengchengwen
@ 2023-11-06 16:19  0%         ` Stephen Hemminger
  2023-11-07  3:21  0%           ` fengchengwen
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-11-06 16:19 UTC (permalink / raw)
  To: fengchengwen; +Cc: thomas, ferruh.yigit, dev

On Mon, 6 Nov 2023 15:13:35 +0800
fengchengwen <fengchengwen@huawei.com> wrote:

> >> +  
> > 
> > Looks good but may I suggest some alternatives.
> > 
> > Since this is an API and ABI change as was not announced, maybe a little late
> > in the process for this release. And since unlikely to go in 23.11 need to do something
> > better in 24.03.
> > 
> > What about changing the args to rte_kvargs_process() to add an additional default
> > value. Most callers don't have a default (use key-value) but the ones that take only-key
> > would pass the default value.  
> 
> The API definition changed, it may need modify most drivers.
> 
> Although it's a little late, better continue current.
> 
> Thanks
> Chengwen

Looking ahead, I would like to replace all of EAL args and KVargs processing
with something more like the python parseargs library. The API is cleaner and
incorporating the help with arg parsing is a real benefit. Thomas also suggested
integrating help in the arg parsing.

Something like: https://github.com/cofyc/argparse

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/5] kvargs: add one new process API
  2023-11-06  3:18  4%     ` Stephen Hemminger
@ 2023-11-06  7:13  0%       ` fengchengwen
  2023-11-06 16:19  0%         ` Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: fengchengwen @ 2023-11-06  7:13 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: thomas, ferruh.yigit, dev

Hi Stephen,

On 2023/11/6 11:18, Stephen Hemminger wrote:
> On Sun, 5 Nov 2023 05:45:35 +0000
> Chengwen Feng <fengchengwen@huawei.com> wrote:
> 
>> +* **Updated kvargs process API.**
>> +
>> +  * Introduced rte_kvargs_process_opt() API, which inherits the function
>> +    of rte_kvargs_process() and could handle both key=value and only-key
>> +    cases.
>> +
>> +  * Constraint rte_kvargs_process() API can only handle key=value cases,
>> +    it will return -1 when handle only-key case (that is the matched key's
>> +    value is NULL).
>> +
> 
> Looks good but may I suggest some alternatives.
> 
> Since this is an API and ABI change as was not announced, maybe a little late
> in the process for this release. And since unlikely to go in 23.11 need to do something
> better in 24.03.
> 
> What about changing the args to rte_kvargs_process() to add an additional default
> value. Most callers don't have a default (use key-value) but the ones that take only-key
> would pass the default value.

The API definition changed, it may need modify most drivers.

Although it's a little late, better continue current.

Thanks
Chengwen

> 
> Then use ABI versioning to add the new arg and you would not have to introduce
> a new function. And add a legacy API version that does what current code does.
> 
> All the drivers in DPDK would get the new API/ABI but any customer apps using rte_kvargs_process()
> would get the old version.
> 
> 
> .
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/5] kvargs: add one new process API
  @ 2023-11-06  3:18  4%     ` Stephen Hemminger
  2023-11-06  7:13  0%       ` fengchengwen
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-11-06  3:18 UTC (permalink / raw)
  To: Chengwen Feng; +Cc: thomas, ferruh.yigit, dev

On Sun, 5 Nov 2023 05:45:35 +0000
Chengwen Feng <fengchengwen@huawei.com> wrote:

> +* **Updated kvargs process API.**
> +
> +  * Introduced rte_kvargs_process_opt() API, which inherits the function
> +    of rte_kvargs_process() and could handle both key=value and only-key
> +    cases.
> +
> +  * Constraint rte_kvargs_process() API can only handle key=value cases,
> +    it will return -1 when handle only-key case (that is the matched key's
> +    value is NULL).
> +

Looks good but may I suggest some alternatives.

Since this is an API and ABI change as was not announced, maybe a little late
in the process for this release. And since unlikely to go in 23.11 need to do something
better in 24.03.

What about changing the args to rte_kvargs_process() to add an additional default
value. Most callers don't have a default (use key-value) but the ones that take only-key
would pass the default value.

Then use ABI versioning to add the new arg and you would not have to introduce
a new function. And add a legacy API version that does what current code does.

All the drivers in DPDK would get the new API/ABI but any customer apps using rte_kvargs_process()
would get the old version.


^ permalink raw reply	[relevance 4%]

* Re: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
  @ 2023-11-02 18:37  3% ` Stephen Hemminger
  2023-11-07 17:33  0%   ` rahul gupta
  2023-11-08  4:38  0%   ` Rahul Gupta
  0 siblings, 2 replies; 200+ results
From: Stephen Hemminger @ 2023-11-02 18:37 UTC (permalink / raw)
  To: Rahul Gupta
  Cc: dev, thomas, sovaradh, okaya, sujithsankar, sowmini.varadhan,
	rahulrgupta27, Rahul Gupta

On Thu,  2 Nov 2023 11:19:24 -0700
Rahul Gupta <rahulgupt@linux.microsoft.com> wrote:

> From: Rahul Gupta <rahulgupt@linux.microsoft.com>
> To: dev@dpdk.org,  thomas@monjalon.net
> Cc: sovaradh@linux.microsoft.com, okaya@kernel.org, sujithsankar@microsoft.com,  sowmini.varadhan@microsoft.com, rahulrgupta27@gmail.com,  Rahul Gupta <rahulgupt@microsoft.com>,  Rahul Gupta <rahulgupt@linux.microsoft.com>
> Subject: [RFC] eal: RFC to refactor rte_eal_init into sub-functions
> Date: Thu,  2 Nov 2023 11:19:24 -0700
> X-Mailer: git-send-email 1.8.3.1
> 
> From: Rahul Gupta <rahulgupt@microsoft.com>
> 
> Initialization often requires rte_eal_init + rte_pktmbuf_pool_create
> which can consume a total time of 500-600 ms:
> a) For many devices FLR may take a significant chunk of time
>    (200-250 ms in our use-case), this FLR is triggered during device
>    probe in rte_eal_init().
> b) rte_pktmbuf_pool_create() can consume upto 300-350 ms for
> applications that require huge memory.
> 
> This cost is incurred on each restart (which happens in our use-case
> during binary updates for servicing).
> This patch provides an optimization using pthreads that appplications
> can use and which can save 200-230ms.
> 
> In this patch, rte_eal_init() is refactored into two parts-
> a) 1st part is dependent code ie- it’s a perquisite of the FLR and
>    mempool creation. So this code needs to be executed before any
>    pthreads. Its named as rte_eal_init_setup()
> b) 2nd part of code is independent code ie- it can execute in parallel
>    to mempool creation in a pthread. Its named as rte_probe_and_ioctl().
> 
> Existing applications require no changes unless they wish to leverage
> the optimization.
> 
> If the application wants to use pthread functionality, it should call-
> a) rte_eal_init_setup() then create two or more pthreads-
> b) in one pthread call- rte_probe_and_ioctl(),
> c) second pthread call- rte_pktmbuf_pool_create()
> d) (optional) Other pthreads for  any other independent function.
> 
> Signed-off-by: Rahul Gupta <rahulgupt@linux.microsoft.com>

These probably marked internal rather than part of API/ABI.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v9 0/9] support setting and querying RSS algorithms
  2023-11-02  8:20  3% ` [PATCH v9 0/9] " Jie Hai
  2023-11-02  8:20  3%   ` [PATCH v9 1/9] ethdev: overwrite some comment related to RSS Jie Hai
  2023-11-02  8:20  4%   ` [PATCH v9 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-11-02 13:11  0%   ` Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-11-02 13:11 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 11/2/2023 8:20 AM, Jie Hai wrote:
> This patchset is to support setting and querying RSS algorithms.
> For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
> and field "algorithm" is added to ``rte_eth_rss_conf``.
> The drivers should reports their "rss_algo_capa" if they support
> updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
> by field "algorithm" and the related API should verify "algorithm" with
> "rss_algo_capa".
> 
> --
> v9:
> 1. rewrite some comments.
> 2. modify check on rss_key_len and move it to patch 1.
> 3. add API change for rss_key_len.
> 4. add NEW Feature for RSS.
> 5. move modification on rss_config_display to patch 7/9.
> 6. update testpmd documentation.
> 7. add acked-bys.
> 
> v8:
> 1. rewrite some comments.
> 2. add check for rss_key_len in ethdev level.
> 3. add Acked-by: Huisong Li <lihuisong@huawei.com>.
> 4. fix log on RSS hash algorithm.
> 5. add rte_eth_dev_rss_algo_name to lib/ethdev/version.map.
> 6. fix RSS algorithm display on testpmd.
> 
> v7:
> 1. fix compile error.
> 2. add signed-off-by to patch[4/9].
> v6:
> 1. rewrite some comments.
> 2. add "rss_algo_capa" for `rte_eth_dev_info``.
> 3. add new API to get name of RSS algorithms
> 
> v5:
> 1. rewrite some comments.
> 2. check RSS algorithm for drivers supporting RSS.
> 3. change field "func" of rss_conf to "algorithm".
> 4. fix commit log for [PATCH v4 4/7].
> 5. add Acked-by Reshma Pattan.
> 6. add symmetric_toeplitz_sort for showing.
> 7. change "hf" to "hash function" for showing.
> 
> v4:
> 1. recomment some definitions related to RSS.
> 2. allocate static memory for rss_key instead of dynamic.
> 3. use array of strings to get the name of rss algorithm.
> 4. add display of rss algorithm with testpmd.
> 
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> 
> Huisong Li (1):
>   net/hns3: support setting and querying RSS hash function
> 
> Jie Hai (8):
>   ethdev: overwrite some comment related to RSS
>   ethdev: support setting and querying RSS algorithm
>   net/hns3: report RSS hash algorithms capability
>   app/proc-info: fix never show RSS info
>   app/proc-info: adjust the display format of RSS info
>   ethdev: add API to get RSS algorithm names
>   app/proc-info: support querying RSS hash algorithm
>   app/testpmd: add RSS hash algorithms display
> 
>  

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>

Series applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3] event/dlb2: fix disable PASID for kernel 6.2
  2023-11-02 10:23  4%                   ` Bruce Richardson
@ 2023-11-02 10:48  0%                     ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-11-02 10:48 UTC (permalink / raw)
  To: Sevincer, Abdullah, Bruce Richardson
  Cc: Jerin Jacob, dev, jerinj, Chen, Mike Ximing, stable, Marchand,
	David, Xia, Chenbo, nipun.gupta

02/11/2023 11:23, Bruce Richardson:
> On Wed, Nov 01, 2023 at 07:05:54PM +0000, Sevincer, Abdullah wrote:
> > 
> > >++ PCIe maintainers.
> > 
> > >+I will leave this up to @David Marchand  / @Thomas as this patch has common code changes and needs to come via main tree.
> > 
> > >+Also in this case, The comment was given very early(Back in June 7) for the same.
> > >+https://patches.dpdk.org/project/dpdk/patch/20230607210050.107944-1-abdullah.sevincer@intel.com/
> > 
> > Thanks Jerrin and Bruce for the comments.
> > I will wait for opinion of PCI maintainers.
> 
> Thinking on this more, any API for enable/disable pasid would be
> internal-only, so therefore would not be subject to ABI/API change rules
> AFAIK. This gives us more freedom to change it as more discovery
> capabilities become available.
> Therefore, an initial version of the function can take the offset as
> parameter, and we can update it without API/ABI concerns later. I was
> previously worried about trying to get the API correct first time, but for
> internal functions, we don't need to.

It looks a good option.
Better to add an internal PCI function than doing it in a PMD.

> WDYT, Jerin, Abdullah.



^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3] event/dlb2: fix disable PASID for kernel 6.2
  @ 2023-11-02 10:23  4%                   ` Bruce Richardson
  2023-11-02 10:48  0%                     ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2023-11-02 10:23 UTC (permalink / raw)
  To: Sevincer, Abdullah
  Cc: Jerin Jacob, dev, jerinj, Chen, Mike Ximing, stable, Marchand,
	 David, Thomas Monjalon, Xia, Chenbo, nipun.gupta

On Wed, Nov 01, 2023 at 07:05:54PM +0000, Sevincer, Abdullah wrote:
> 
> >++ PCIe maintainers.
> 
> >+I will leave this up to @David Marchand  / @Thomas as this patch has common code changes and needs to come via main tree.
> 
> >+Also in this case, The comment was given very early(Back in June 7) for the same.
> >+https://patches.dpdk.org/project/dpdk/patch/20230607210050.107944-1-abdullah.sevincer@intel.com/
> 
> Thanks Jerrin and Bruce for the comments.
> I will wait for opinion of PCI maintainers.

Thinking on this more, any API for enable/disable pasid would be
internal-only, so therefore would not be subject to ABI/API change rules
AFAIK. This gives us more freedom to change it as more discovery
capabilities become available.
Therefore, an initial version of the function can take the offset as
parameter, and we can update it without API/ABI concerns later. I was
previously worried about trying to get the API correct first time, but for
internal functions, we don't need to.

WDYT, Jerin, Abdullah.

/Bruce

^ permalink raw reply	[relevance 4%]

* [PATCH v9 2/9] ethdev: support setting and querying RSS algorithm
  2023-11-02  8:20  3% ` [PATCH v9 0/9] " Jie Hai
  2023-11-02  8:20  3%   ` [PATCH v9 1/9] ethdev: overwrite some comment related to RSS Jie Hai
@ 2023-11-02  8:20  4%   ` Jie Hai
  2023-11-02 13:11  0%   ` [PATCH v9 0/9] support setting and querying RSS algorithms Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-11-02  8:20 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_dev_info`` is extended by adding a new
field "rss_algo_capa". Drivers are responsible for reporting this
capa and configurations of RSS hash algorithm can be verified based
on the capability. The default value of "rss_algo_capa" is
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "algorithm". This represents the RSS algorithms to apply.
If the value of "algorithm" used for configuration is a gibberish
value, drivers should report the error.

To check whether the drivers report valid "algorithm", it is set
to default value before querying in rte_eth_dev_rss_hash_conf_get().

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst | 13 ++++++++++++
 lib/ethdev/rte_ethdev.c                | 25 ++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 29 ++++++++++++++++++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 26 ++---------------------
 5 files changed, 69 insertions(+), 25 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 0b67f31dc385..20556b8a17ce 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -122,6 +122,13 @@ New Features
   a group's miss actions, which are the actions to be performed on packets
   that didn't match any of the flow rules in the group.
 
+* **Added support for RSS hash algorithm.**
+
+  * Added new field ``rss_algo_capa`` to ``rte_eth_dev_info`` structure for
+    reporting RSS hash algorithm capability that drivers support.
+  * Added new field ``algorithm`` to ``rte_eth_rss_conf`` structure for RSS
+    hash algorithm querying and configuring.
+
 * **Updated Amazon ena (Elastic Network Adapter) net driver.**
 
   * Upgraded ENA HAL to latest version.
@@ -376,6 +383,12 @@ ABI Changes
 * security: struct ``rte_security_ipsec_sa_options`` was updated
   due to inline out-of-place feature addition.
 
+* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
+* reporting RSS hash algorithm capability.
+
+* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
+  hash algorithm.
+
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 6727aca12dce..36d8deef90c5 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1269,6 +1269,7 @@ int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
 {
+	enum rte_eth_hash_function algorithm;
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf orig_conf;
@@ -1510,6 +1511,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
+	if (algorithm >= CHAR_BIT * sizeof(dev_info.rss_algo_capa) ||
+	    (dev_info.rss_algo_capa & RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u configured RSS hash algorithm (%u)"
+			"is not in the algorithm capability (0x%" PRIx32 ")\n",
+			port_id, algorithm, dev_info.rss_algo_capa);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of Rx/Tx queues and reconfigure device.
 	 */
@@ -3767,6 +3779,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
 		RTE_ETHER_CRC_LEN;
 	dev_info->max_mtu = UINT16_MAX;
+	dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
 
 	if (*dev->dev_ops->dev_infos_get == NULL)
 		return -ENOTSUP;
@@ -4716,6 +4729,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	if (rss_conf->algorithm >= CHAR_BIT * sizeof(dev_info.rss_algo_capa) ||
+	    (dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u configured RSS hash algorithm (%u)"
+			"is not in the algorithm capability (0x%" PRIx32 ")\n",
+			port_id, rss_conf->algorithm, dev_info.rss_algo_capa);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4756,6 +4779,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index fb1a1f89c67f..37d8ef694523 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
 	 * which RSS hashing is to be applied.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
@@ -1749,6 +1777,7 @@ struct rte_eth_dev_info {
 	/** Device redirection table size, the total number of entries. */
 	uint16_t reta_size;
 	uint8_t hash_key_size; /**< Hash key size in bytes */
+	uint32_t rss_algo_capa; /** RSS hash algorithms capabilities */
 	/** Bit mask of RSS offloads, the bit offset also means flow type */
 	uint64_t flow_type_rss_offloads;
 	struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 20ee8430eaec..549e3295584c 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 751c29a0f3f3..affdc8121b57 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/** DEFAULT means driver decides which hash algorithm to pick. */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* [PATCH v9 0/9] support setting and querying RSS algorithms
      2023-11-01  7:40  3% ` [PATCH v8 00/10] " Jie Hai
@ 2023-11-02  8:20  3% ` Jie Hai
  2023-11-02  8:20  3%   ` [PATCH v9 1/9] ethdev: overwrite some comment related to RSS Jie Hai
                     ` (2 more replies)
  2 siblings, 3 replies; 200+ results
From: Jie Hai @ 2023-11-02  8:20 UTC (permalink / raw)
  To: dev; +Cc: lihuisong, fengchengwen, liudongdong3

This patchset is to support setting and querying RSS algorithms.
For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
and field "algorithm" is added to ``rte_eth_rss_conf``.
The drivers should reports their "rss_algo_capa" if they support
updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
by field "algorithm" and the related API should verify "algorithm" with
"rss_algo_capa".

--
v9:
1. rewrite some comments.
2. modify check on rss_key_len and move it to patch 1.
3. add API change for rss_key_len.
4. add NEW Feature for RSS.
5. move modification on rss_config_display to patch 7/9.
6. update testpmd documentation.
7. add acked-bys.

v8:
1. rewrite some comments.
2. add check for rss_key_len in ethdev level.
3. add Acked-by: Huisong Li <lihuisong@huawei.com>.
4. fix log on RSS hash algorithm.
5. add rte_eth_dev_rss_algo_name to lib/ethdev/version.map.
6. fix RSS algorithm display on testpmd.

v7:
1. fix compile error.
2. add signed-off-by to patch[4/9].
v6:
1. rewrite some comments.
2. add "rss_algo_capa" for `rte_eth_dev_info``.
3. add new API to get name of RSS algorithms

v5:
1. rewrite some comments.
2. check RSS algorithm for drivers supporting RSS.
3. change field "func" of rss_conf to "algorithm".
4. fix commit log for [PATCH v4 4/7].
5. add Acked-by Reshma Pattan.
6. add symmetric_toeplitz_sort for showing.
7. change "hf" to "hash function" for showing.

v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.

Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (8):
  ethdev: overwrite some comment related to RSS
  ethdev: support setting and querying RSS algorithm
  net/hns3: report RSS hash algorithms capability
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  ethdev: add API to get RSS algorithm names
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                        | 24 +++---
 app/test-pmd/cmdline.c                      | 29 ++++++--
 app/test-pmd/config.c                       | 29 +++-----
 app/test-pmd/testpmd.h                      |  2 +-
 doc/guides/rel_notes/release_23_11.rst      | 22 ++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  4 +-
 drivers/net/hns3/hns3_common.c              |  4 +
 drivers/net/hns3/hns3_rss.c                 | 47 +++++++-----
 lib/ethdev/rte_ethdev.c                     | 81 +++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                     | 78 ++++++++++++++++----
 lib/ethdev/rte_flow.c                       |  1 -
 lib/ethdev/rte_flow.h                       | 25 +------
 lib/ethdev/version.map                      |  1 +
 13 files changed, 252 insertions(+), 95 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* [PATCH v9 1/9] ethdev: overwrite some comment related to RSS
  2023-11-02  8:20  3% ` [PATCH v9 0/9] " Jie Hai
@ 2023-11-02  8:20  3%   ` Jie Hai
  2023-11-02  8:20  4%   ` [PATCH v9 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-11-02 13:11  0%   ` [PATCH v9 0/9] support setting and querying RSS algorithms Ferruh Yigit
  2 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-11-02  8:20 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

In rte_eth_dev_rss_hash_conf_get(), the "rss_key_len" should be
greater than or equal to the "hash_key_size" which get from
rte_eth_dev_info_get() API. And the "rss_key" should contain at
least "hash_key_size" bytes. If these requirements are not met,
the query unreliable.

In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), the
"rss_key_len" indicates the length of the "rss_key" in bytes of
the array pointed by "rss_key", it should be equal to the
"hash_key_size" if "rss_key" is not NULL.

This patch overwrites the comments of fields of "rte_eth_rss_conf"
and "RTE_ETH_HASH_FUNCTION_DEFAULT", checks "rss_key_len" in
ethdev level, and documents these changes.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  4 ++++
 lib/ethdev/rte_ethdev.c                | 31 ++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 33 ++++++++++++++------------
 lib/ethdev/rte_flow.h                  |  1 +
 4 files changed, 54 insertions(+), 15 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 95db98d098d8..0b67f31dc385 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -345,6 +345,10 @@ API Changes
   Updated ``rte_ml_op``, ``rte_ml_io_quantize`` and ``rte_ml_io_dequantize``
   to support an array of ``rte_ml_buff_seg``.
 
+* ethdev: When ``rte_eth_dev_configure`` or ``rte_eth_dev_rss_hash_update`` are
+  called, the ``rss_key_len`` of structure ``rte_eth_rss_conf`` should be provided
+  by user for the case ``rss_key != NULL``, it won't be taken as default 40
+  bytes anymore.
 
 ABI Changes
 -----------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index af23ac0ad00f..6727aca12dce 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1500,6 +1500,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev_conf->rx_adv_conf.rss_conf.rss_key != NULL &&
+	    dev_conf->rx_adv_conf.rss_conf.rss_key_len != dev_info.hash_key_size) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n",
+			port_id, dev_conf->rx_adv_conf.rss_conf.rss_key_len,
+			dev_info.hash_key_size);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of Rx/Tx queues and reconfigure device.
 	 */
@@ -4698,6 +4708,14 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->rss_key != NULL &&
+	    rss_conf->rss_key_len != dev_info.hash_key_size) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS key len: %u, valid value: %u\n",
+			port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4712,6 +4730,7 @@ int
 rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 			      struct rte_eth_rss_conf *rss_conf)
 {
+	struct rte_eth_dev_info dev_info = { 0 };
 	struct rte_eth_dev *dev;
 	int ret;
 
@@ -4725,6 +4744,18 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0)
+		return ret;
+
+	if (rss_conf->rss_key != NULL &&
+	    rss_conf->rss_key_len < dev_info.hash_key_size) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS key len: %u, should not be less than: %u\n",
+			port_id, rss_conf->rss_key_len, dev_info.hash_key_size);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index a53dd5a1efec..fb1a1f89c67f 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -448,24 +448,27 @@ struct rte_vlan_filter_conf {
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
- * If not NULL, the *rss_key* pointer of the *rss_conf* structure points
- * to an array holding the RSS key to use for hashing specific header
- * fields of received packets. The length of this array should be indicated
- * by *rss_key_len* below. Otherwise, a default random hash key is used by
- * the device driver.
- *
- * The *rss_key_len* field of the *rss_conf* structure indicates the length
- * in bytes of the array pointed by *rss_key*. To be compatible, this length
- * will be checked in i40e only. Others assume 40 bytes to be used as before.
- *
- * The *rss_hf* field of the *rss_conf* structure indicates the different
- * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
- * Supplying an *rss_hf* equal to zero disables the RSS feature.
  */
 struct rte_eth_rss_conf {
-	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
+	/**
+	 * In rte_eth_dev_rss_hash_conf_get(), the *rss_key_len* should be
+	 * greater than or equal to the *hash_key_size* which get from
+	 * rte_eth_dev_info_get() API. And the *rss_key* should contain at least
+	 * *hash_key_size* bytes. If not meet these requirements, the query
+	 * result is unreliable even if the operation returns success.
+	 *
+	 * In rte_eth_dev_rss_hash_update() or rte_eth_dev_configure(), if
+	 * *rss_key* is not NULL, the *rss_key_len* indicates the length of the
+	 * *rss_key* in bytes and it should be equal to *hash_key_size*.
+	 * If *rss_key* is NULL, drivers are free to use a random or a default key.
+	 */
+	uint8_t *rss_key;
 	uint8_t rss_key_len; /**< hash key length in bytes. */
-	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
+	/**
+	 * Indicates the type of packets or the specific part of packets to
+	 * which RSS hashing is to be applied.
+	 */
+	uint64_t rss_hf;
 };
 
 /*
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index c16fe8c21f2f..751c29a0f3f3 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -3226,6 +3226,7 @@ struct rte_flow_query_count {
  * Hash function types.
  */
 enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
 	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
 	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
 	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm
  2023-11-01 13:36  3%     ` Ferruh Yigit
@ 2023-11-02  6:58  0%       ` Jie Hai
  0 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-11-02  6:58 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Thomas Monjalon, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

On 2023/11/1 21:36, Ferruh Yigit wrote:
> On 11/1/2023 7:40 AM, Jie Hai wrote:
>> Currently, rte_eth_rss_conf supports configuring and querying
>> RSS hash functions, rss key and it's length, but not RSS hash
>> algorithm.
>>
>> The structure ``rte_eth_dev_info`` is extended by adding a new
>> field "rss_algo_capa". Drivers are responsible for reporting this
>> capa and configurations of RSS hash algorithm can be verified based
>> on the capability. The default value of "rss_algo_capa" is
>> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "algorithm". This represents the RSS algorithms to apply.
>> If the value of "algorithm" used for configuration is a gibberish
>> value, drivers should report the error.
>>
>> To check whether the drivers report valid "algorithm", it is set
>> to default value before querying in rte_eth_dev_rss_hash_conf_get().
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> Acked-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   doc/guides/rel_notes/release_23_11.rst |  5 +++++
>>   lib/ethdev/rte_ethdev.c                | 26 +++++++++++++++++++++++
>>   lib/ethdev/rte_ethdev.h                | 29 ++++++++++++++++++++++++++
>>   lib/ethdev/rte_flow.c                  |  1 -
>>   lib/ethdev/rte_flow.h                  | 26 ++---------------------
>>   5 files changed, 62 insertions(+), 25 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
>> index 95db98d098d8..e207786044f9 100644
>> --- a/doc/guides/rel_notes/release_23_11.rst
>> +++ b/doc/guides/rel_notes/release_23_11.rst
>> @@ -372,6 +372,11 @@ ABI Changes
>>   * security: struct ``rte_security_ipsec_sa_options`` was updated
>>     due to inline out-of-place feature addition.
>>   
>> +* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
>> +* reporting RSS hash algorithm capability.
>> +
>> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
>> +  hash algorithm.
>>   
> 
> As well as ABI change, can you also update the "New Features", to
> document getting hash algorithm capability and setting hash algorithm
> support added?
> 
> Also please add an empty line here.
thanks,will add.
> 
>>   Known Issues
>>   ------------
>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>> index 07bb35833ba6..f9bd99d07eb1 100644
>> --- a/lib/ethdev/rte_ethdev.c
>> +++ b/lib/ethdev/rte_ethdev.c
>> @@ -1269,6 +1269,7 @@ int
>>   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   		      const struct rte_eth_conf *dev_conf)
>>   {
>> +	enum rte_eth_hash_function algorithm;
>>   	struct rte_eth_dev *dev;
>>   	struct rte_eth_dev_info dev_info;
>>   	struct rte_eth_conf orig_conf;
>> @@ -1510,6 +1511,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   		goto rollback;
>>   	}
>>   
>> +	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
>> +	if (RTE_ETH_HASH_ALGO_TO_CAPA(algorithm) == 0 ||
>>
> 
> "RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)" can't be zero for valid "enum
> rte_eth_hash_function" values, I assume above check is for the case
> algorith > 31, as it will result zero.
> My concern is, this is undefined behaviour (shift left >= 32) and some
> compiler can complain about it, instead of relying this can you please
> add explicit "0 <= algorithm < 32" check?
yes, how about associate with "rss_algo_capa"?

+       if (algorithm >= CHAR_BIT * sizeof(dev_info.rss_algo_capa) ||
+           (dev_info.rss_algo_capa & 
RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {

> 
> 
> 
> .

^ permalink raw reply	[relevance 0%]

* [PATCH 04/11] net/nfp: add flag to indicate multiple PFs support
  @ 2023-11-02  2:23  9% ` Chaoyong He
  0 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-11-02  2:23 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Peng Zhang, Chaoyong He, Long Wu

From: Peng Zhang <peng.zhang@corigine.com>

Support for multiple PFs have been added to the NFP3800 firmware. This
can be detected by reading the NSP major version, which was bumped to 1
when support was added.

Add a flag and detecting method to record if the current device is
cabable to support multiple PFs. This will be used in later patches to
initialize and make use of this new feature.

Noteworthy about the detection method from NSP version information, the
NSP minor version was not touched when increasing the major version.
This makes the first NSP version to support multiple PFs version 1.8,
while the latest version without this supports remains 0.8.

Signed-off-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c      | 49 +++++++++++++++++++++++--------
 drivers/net/nfp/nfp_net_common.h  |  8 +++++
 drivers/net/nfp/nfpcore/nfp_nsp.c | 14 +++++++--
 3 files changed, 56 insertions(+), 15 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index aa2b59af32..7022ef435f 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -479,7 +479,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
-	if (port == 0) {
+	if (port == 0 || pf_dev->multi_pf.enabled) {
 		uint32_t min_size;
 
 		hw->ctrl_bar = pf_dev->ctrl_bar;
@@ -712,6 +712,26 @@ nfp_fw_setup(struct rte_pci_device *dev,
 	return err;
 }
 
+static inline bool
+nfp_check_multi_pf_from_nsp(struct rte_pci_device *pci_dev,
+		struct nfp_cpp *cpp)
+{
+	bool flag;
+	struct nfp_nsp *nsp;
+
+	nsp = nfp_nsp_open(cpp);
+	if (nsp == NULL) {
+		PMD_DRV_LOG(ERR, "NFP error when obtaining NSP handle");
+		return false;
+	}
+
+	flag = (nfp_nsp_get_abi_ver_major(nsp) > 0) &&
+			(pci_dev->id.device_id == PCI_DEVICE_ID_NFP3800_PF_NIC);
+
+	nfp_nsp_close(nsp);
+	return flag;
+}
+
 static int
 nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev,
 		const struct nfp_dev_info *dev_info)
@@ -874,6 +894,14 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 		return -ENODEV;
 	}
 
+	/* Allocate memory for the PF "device" */
+	snprintf(name, sizeof(name), "nfp_pf%d", 0);
+	pf_dev = rte_zmalloc(name, sizeof(*pf_dev), 0);
+	if (pf_dev == NULL) {
+		PMD_INIT_LOG(ERR, "Can't allocate memory for the PF device");
+		return -ENOMEM;
+	}
+
 	/*
 	 * When device bound to UIO, the device could be used, by mistake,
 	 * by two DPDK apps, and the UIO driver does not avoid it. This
@@ -888,7 +916,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 
 	if (cpp == NULL) {
 		PMD_INIT_LOG(ERR, "A CPP handle can not be obtained");
-		return -EIO;
+		ret = -EIO;
+		goto pf_cleanup;
 	}
 
 	hwinfo = nfp_hwinfo_read(cpp);
@@ -906,6 +935,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 		goto hwinfo_cleanup;
 	}
 
+	pf_dev->multi_pf.enabled = nfp_check_multi_pf_from_nsp(pci_dev, cpp);
+
 	/* Force the physical port down to clear the possible DMA error */
 	for (i = 0; i < nfp_eth_table->count; i++)
 		nfp_eth_set_configured(cpp, nfp_eth_table->ports[i].index, 0);
@@ -932,14 +963,6 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 		goto sym_tbl_cleanup;
 	}
 
-	/* Allocate memory for the PF "device" */
-	snprintf(name, sizeof(name), "nfp_pf%d", 0);
-	pf_dev = rte_zmalloc(name, sizeof(*pf_dev), 0);
-	if (pf_dev == NULL) {
-		ret = -ENOMEM;
-		goto sym_tbl_cleanup;
-	}
-
 	/* Populate the newly created PF device */
 	pf_dev->app_fw_id = app_fw_id;
 	pf_dev->cpp = cpp;
@@ -957,7 +980,7 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 	if (pf_dev->qc_bar == NULL) {
 		PMD_INIT_LOG(ERR, "nfp_rtsym_map fails for net.qc");
 		ret = -EIO;
-		goto pf_cleanup;
+		goto sym_tbl_cleanup;
 	}
 
 	PMD_INIT_LOG(DEBUG, "qc_bar address: %p", pf_dev->qc_bar);
@@ -998,8 +1021,6 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 
 hwqueues_cleanup:
 	nfp_cpp_area_free(pf_dev->qc_area);
-pf_cleanup:
-	rte_free(pf_dev);
 sym_tbl_cleanup:
 	free(sym_tbl);
 eth_table_cleanup:
@@ -1008,6 +1029,8 @@ nfp_pf_init(struct rte_pci_device *pci_dev)
 	free(hwinfo);
 cpp_cleanup:
 	nfp_cpp_free(cpp);
+pf_cleanup:
+	rte_free(pf_dev);
 
 	return ret;
 }
diff --git a/drivers/net/nfp/nfp_net_common.h b/drivers/net/nfp/nfp_net_common.h
index b9df2fe563..bd0ed077c5 100644
--- a/drivers/net/nfp/nfp_net_common.h
+++ b/drivers/net/nfp/nfp_net_common.h
@@ -54,6 +54,11 @@ struct nfp_net_tlv_caps {
 	uint32_t mbox_cmsg_types;        /**< Cmsgs which can be passed through the mailbox */
 };
 
+struct nfp_multi_pf {
+	/** Support multiple PF */
+	bool enabled;
+};
+
 struct nfp_pf_dev {
 	/** Backpointer to associated pci device */
 	struct rte_pci_device *pci_dev;
@@ -79,6 +84,9 @@ struct nfp_pf_dev {
 
 	/** Service id of cpp bridge service */
 	uint32_t cpp_bridge_id;
+
+	/** Multiple PF configuration */
+	struct nfp_multi_pf multi_pf;
 };
 
 struct nfp_app_fw_nic {
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index a680b972b8..9f88b822f3 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -40,7 +40,17 @@
 #define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
 
 #define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
+
+/*
+ * ABI major version is bumped separately without resetting minor
+ * version when the change in NSP is not compatible to old driver.
+ */
+#define NSP_MAJOR               1
+
+/*
+ * ABI minor version is bumped when new feature is introduced
+ * while old driver can still work without this new feature.
+ */
 #define NSP_MINOR               8
 
 #define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
@@ -203,7 +213,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 	state->ver.major = FIELD_GET(NSP_STATUS_MAJOR, reg);
 	state->ver.minor = FIELD_GET(NSP_STATUS_MINOR, reg);
 
-	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
+	if (state->ver.major > NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
 				state->ver.minor);
 		return -EINVAL;
-- 
2.39.1


^ permalink raw reply	[relevance 9%]

* [PATCH v6 1/3] net/tap: support infrastructure to build the BPF filter
  @ 2023-11-01 18:02  4%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-11-01 18:02 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Move the BPF program related code into a subdirectory.
And add a Makefile for building it.

The code depends on include files from iproute2.
But these are not public headers which iproute2 exports
as a package API. Therefore make a local copy here.

The standalone build was also broken because by
commit ef5baf3486e0 ("replace packed attributes")
which introduced __rte_packed into this code.

Add a python program to extract the resulting BPF into
a format that can be consumed by the TAP driver.

Update the documentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/nics/tap.rst                     |  11 +-
 drivers/net/tap/bpf/.gitignore              |   1 +
 drivers/net/tap/bpf/Makefile                |  18 ++
 drivers/net/tap/bpf/bpf_api.h               | 275 ++++++++++++++++++++
 drivers/net/tap/bpf/bpf_elf.h               |  53 ++++
 drivers/net/tap/bpf/bpf_extract.py          |  86 ++++++
 drivers/net/tap/{ => bpf}/tap_bpf_program.c |  10 +-
 drivers/net/tap/tap_rss.h                   |   2 +-
 8 files changed, 444 insertions(+), 12 deletions(-)
 create mode 100644 drivers/net/tap/bpf/.gitignore
 create mode 100644 drivers/net/tap/bpf/Makefile
 create mode 100644 drivers/net/tap/bpf/bpf_api.h
 create mode 100644 drivers/net/tap/bpf/bpf_elf.h
 create mode 100644 drivers/net/tap/bpf/bpf_extract.py
 rename drivers/net/tap/{ => bpf}/tap_bpf_program.c (96%)

diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst
index 07df0d35a2..449e747994 100644
--- a/doc/guides/nics/tap.rst
+++ b/doc/guides/nics/tap.rst
@@ -256,15 +256,12 @@ C functions under different ELF sections.
 
 2. Install ``LLVM`` library and ``clang`` compiler versions 3.7 and above
 
-3. Compile ``tap_bpf_program.c`` via ``LLVM`` into an object file::
+3. Use make to compile  `tap_bpf_program.c`` via ``LLVM`` into an object file
+   and extract the resulting instructions into ``tap_bpf_insn.h``.
 
-    clang -O2 -emit-llvm -c tap_bpf_program.c -o - | llc -march=bpf \
-    -filetype=obj -o <tap_bpf_program.o>
+    cd bpf; make
 
-
-4. Use a tool that receives two parameters: an eBPF object file and a section
-name, and prints out the section as a C array of eBPF instructions.
-Embed the C array in your TAP PMD tree.
+4. Recompile the TAP PMD.
 
 The C arrays are uploaded to the kernel using BPF system calls.
 
diff --git a/drivers/net/tap/bpf/.gitignore b/drivers/net/tap/bpf/.gitignore
new file mode 100644
index 0000000000..30a258f1af
--- /dev/null
+++ b/drivers/net/tap/bpf/.gitignore
@@ -0,0 +1 @@
+tap_bpf_program.o
diff --git a/drivers/net/tap/bpf/Makefile b/drivers/net/tap/bpf/Makefile
new file mode 100644
index 0000000000..59844c616f
--- /dev/null
+++ b/drivers/net/tap/bpf/Makefile
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# This file is not built as part of normal DPDK build.
+# It is used to generate the eBPF code for TAP RSS.
+CLANG=clang
+CLANG_OPTS=-O2
+TARGET=../tap_bpf_insns.h
+
+all: $(TARGET)
+
+clean:
+	rm tap_bpf_program.o $(TARGET)
+
+tap_bpf_program.o: tap_bpf_program.c
+	$(CLANG) $(CLANG_OPTS) -emit-llvm -c $< -o - | \
+	llc -march=bpf -filetype=obj -o $@
+
+$(TARGET): tap_bpf_program.o
+	python3 bpf_extract.py -stap_bpf_program.c -o $@ $<
diff --git a/drivers/net/tap/bpf/bpf_api.h b/drivers/net/tap/bpf/bpf_api.h
new file mode 100644
index 0000000000..5887d3a851
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_api.h
@@ -0,0 +1,275 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_API__
+#define __BPF_API__
+
+/* Note:
+ *
+ * This file can be included into eBPF kernel programs. It contains
+ * a couple of useful helper functions, map/section ABI (bpf_elf.h),
+ * misc macros and some eBPF specific LLVM built-ins.
+ */
+
+#include <stdint.h>
+
+#include <linux/pkt_cls.h>
+#include <linux/bpf.h>
+#include <linux/filter.h>
+
+#include <asm/byteorder.h>
+
+#include "bpf_elf.h"
+
+/** libbpf pin type. */
+enum libbpf_pin_type {
+	LIBBPF_PIN_NONE,
+	/* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
+	LIBBPF_PIN_BY_NAME,
+};
+
+/** Type helper macros. */
+
+#define __uint(name, val) int (*name)[val]
+#define __type(name, val) typeof(val) *name
+#define __array(name, val) typeof(val) *name[]
+
+/** Misc macros. */
+
+#ifndef __stringify
+# define __stringify(X)		#X
+#endif
+
+#ifndef __maybe_unused
+# define __maybe_unused		__attribute__((__unused__))
+#endif
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER)	__builtin_offsetof(TYPE, MEMBER)
+#endif
+
+#ifndef likely
+# define likely(X)		__builtin_expect(!!(X), 1)
+#endif
+
+#ifndef unlikely
+# define unlikely(X)		__builtin_expect(!!(X), 0)
+#endif
+
+#ifndef htons
+# define htons(X)		__constant_htons((X))
+#endif
+
+#ifndef ntohs
+# define ntohs(X)		__constant_ntohs((X))
+#endif
+
+#ifndef htonl
+# define htonl(X)		__constant_htonl((X))
+#endif
+
+#ifndef ntohl
+# define ntohl(X)		__constant_ntohl((X))
+#endif
+
+#ifndef __inline__
+# define __inline__		__attribute__((always_inline))
+#endif
+
+/** Section helper macros. */
+
+#ifndef __section
+# define __section(NAME)						\
+	__attribute__((section(NAME), used))
+#endif
+
+#ifndef __section_tail
+# define __section_tail(ID, KEY)					\
+	__section(__stringify(ID) "/" __stringify(KEY))
+#endif
+
+#ifndef __section_xdp_entry
+# define __section_xdp_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_cls_entry
+# define __section_cls_entry						\
+	__section(ELF_SECTION_CLASSIFIER)
+#endif
+
+#ifndef __section_act_entry
+# define __section_act_entry						\
+	__section(ELF_SECTION_ACTION)
+#endif
+
+#ifndef __section_lwt_entry
+# define __section_lwt_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_license
+# define __section_license						\
+	__section(ELF_SECTION_LICENSE)
+#endif
+
+#ifndef __section_maps
+# define __section_maps							\
+	__section(ELF_SECTION_MAPS)
+#endif
+
+/** Declaration helper macros. */
+
+#ifndef BPF_LICENSE
+# define BPF_LICENSE(NAME)						\
+	char ____license[] __section_license = NAME
+#endif
+
+/** Classifier helper */
+
+#ifndef BPF_H_DEFAULT
+# define BPF_H_DEFAULT	-1
+#endif
+
+/** BPF helper functions for tc. Individual flags are in linux/bpf.h */
+
+#ifndef __BPF_FUNC
+# define __BPF_FUNC(NAME, ...)						\
+	(* NAME)(__VA_ARGS__) __maybe_unused
+#endif
+
+#ifndef BPF_FUNC
+# define BPF_FUNC(NAME, ...)						\
+	__BPF_FUNC(NAME, __VA_ARGS__) = (void *) BPF_FUNC_##NAME
+#endif
+
+/* Map access/manipulation */
+static void *BPF_FUNC(map_lookup_elem, void *map, const void *key);
+static int BPF_FUNC(map_update_elem, void *map, const void *key,
+		    const void *value, uint32_t flags);
+static int BPF_FUNC(map_delete_elem, void *map, const void *key);
+
+/* Time access */
+static uint64_t BPF_FUNC(ktime_get_ns);
+
+/* Debugging */
+
+/* FIXME: __attribute__ ((format(printf, 1, 3))) not possible unless
+ * llvm bug https://llvm.org/bugs/show_bug.cgi?id=26243 gets resolved.
+ * It would require ____fmt to be made const, which generates a reloc
+ * entry (non-map).
+ */
+static void BPF_FUNC(trace_printk, const char *fmt, int fmt_size, ...);
+
+#ifndef printt
+# define printt(fmt, ...)						\
+	({								\
+		char ____fmt[] = fmt;					\
+		trace_printk(____fmt, sizeof(____fmt), ##__VA_ARGS__);	\
+	})
+#endif
+
+/* Random numbers */
+static uint32_t BPF_FUNC(get_prandom_u32);
+
+/* Tail calls */
+static void BPF_FUNC(tail_call, struct __sk_buff *skb, void *map,
+		     uint32_t index);
+
+/* System helpers */
+static uint32_t BPF_FUNC(get_smp_processor_id);
+static uint32_t BPF_FUNC(get_numa_node_id);
+
+/* Packet misc meta data */
+static uint32_t BPF_FUNC(get_cgroup_classid, struct __sk_buff *skb);
+static int BPF_FUNC(skb_under_cgroup, void *map, uint32_t index);
+
+static uint32_t BPF_FUNC(get_route_realm, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(get_hash_recalc, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(set_hash_invalid, struct __sk_buff *skb);
+
+/* Packet redirection */
+static int BPF_FUNC(redirect, int ifindex, uint32_t flags);
+static int BPF_FUNC(clone_redirect, struct __sk_buff *skb, int ifindex,
+		    uint32_t flags);
+
+/* Packet manipulation */
+static int BPF_FUNC(skb_load_bytes, struct __sk_buff *skb, uint32_t off,
+		    void *to, uint32_t len);
+static int BPF_FUNC(skb_store_bytes, struct __sk_buff *skb, uint32_t off,
+		    const void *from, uint32_t len, uint32_t flags);
+
+static int BPF_FUNC(l3_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(l4_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(csum_diff, const void *from, uint32_t from_size,
+		    const void *to, uint32_t to_size, uint32_t seed);
+static int BPF_FUNC(csum_update, struct __sk_buff *skb, uint32_t wsum);
+
+static int BPF_FUNC(skb_change_type, struct __sk_buff *skb, uint32_t type);
+static int BPF_FUNC(skb_change_proto, struct __sk_buff *skb, uint32_t proto,
+		    uint32_t flags);
+static int BPF_FUNC(skb_change_tail, struct __sk_buff *skb, uint32_t nlen,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_pull_data, struct __sk_buff *skb, uint32_t len);
+
+/* Event notification */
+static int __BPF_FUNC(skb_event_output, struct __sk_buff *skb, void *map,
+		      uint64_t index, const void *data, uint32_t size) =
+		      (void *) BPF_FUNC_perf_event_output;
+
+/* Packet vlan encap/decap */
+static int BPF_FUNC(skb_vlan_push, struct __sk_buff *skb, uint16_t proto,
+		    uint16_t vlan_tci);
+static int BPF_FUNC(skb_vlan_pop, struct __sk_buff *skb);
+
+/* Packet tunnel encap/decap */
+static int BPF_FUNC(skb_get_tunnel_key, struct __sk_buff *skb,
+		    struct bpf_tunnel_key *to, uint32_t size, uint32_t flags);
+static int BPF_FUNC(skb_set_tunnel_key, struct __sk_buff *skb,
+		    const struct bpf_tunnel_key *from, uint32_t size,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_get_tunnel_opt, struct __sk_buff *skb,
+		    void *to, uint32_t size);
+static int BPF_FUNC(skb_set_tunnel_opt, struct __sk_buff *skb,
+		    const void *from, uint32_t size);
+
+/** LLVM built-ins, mem*() routines work for constant size */
+
+#ifndef lock_xadd
+# define lock_xadd(ptr, val)	((void) __sync_fetch_and_add(ptr, val))
+#endif
+
+#ifndef memset
+# define memset(s, c, n)	__builtin_memset((s), (c), (n))
+#endif
+
+#ifndef memcpy
+# define memcpy(d, s, n)	__builtin_memcpy((d), (s), (n))
+#endif
+
+#ifndef memmove
+# define memmove(d, s, n)	__builtin_memmove((d), (s), (n))
+#endif
+
+/* FIXME: __builtin_memcmp() is not yet fully useable unless llvm bug
+ * https://llvm.org/bugs/show_bug.cgi?id=26218 gets resolved. Also
+ * this one would generate a reloc entry (non-map), otherwise.
+ */
+#if 0
+#ifndef memcmp
+# define memcmp(a, b, n)	__builtin_memcmp((a), (b), (n))
+#endif
+#endif
+
+unsigned long long load_byte(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.byte");
+
+unsigned long long load_half(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.half");
+
+unsigned long long load_word(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.word");
+
+#endif /* __BPF_API__ */
diff --git a/drivers/net/tap/bpf/bpf_elf.h b/drivers/net/tap/bpf/bpf_elf.h
new file mode 100644
index 0000000000..ea8a11c95c
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_elf.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_ELF__
+#define __BPF_ELF__
+
+#include <asm/types.h>
+
+/* Note:
+ *
+ * Below ELF section names and bpf_elf_map structure definition
+ * are not (!) kernel ABI. It's rather a "contract" between the
+ * application and the BPF loader in tc. For compatibility, the
+ * section names should stay as-is. Introduction of aliases, if
+ * needed, are a possibility, though.
+ */
+
+/* ELF section names, etc */
+#define ELF_SECTION_LICENSE	"license"
+#define ELF_SECTION_MAPS	"maps"
+#define ELF_SECTION_PROG	"prog"
+#define ELF_SECTION_CLASSIFIER	"classifier"
+#define ELF_SECTION_ACTION	"action"
+
+#define ELF_MAX_MAPS		64
+#define ELF_MAX_LICENSE_LEN	128
+
+/* Object pinning settings */
+#define PIN_NONE		0
+#define PIN_OBJECT_NS		1
+#define PIN_GLOBAL_NS		2
+
+/* ELF map definition */
+struct bpf_elf_map {
+	__u32 type;
+	__u32 size_key;
+	__u32 size_value;
+	__u32 max_elem;
+	__u32 flags;
+	__u32 id;
+	__u32 pinning;
+	__u32 inner_id;
+	__u32 inner_idx;
+};
+
+#define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val)		\
+	struct ____btf_map_##name {				\
+		type_key key;					\
+		type_val value;					\
+	};							\
+	struct ____btf_map_##name				\
+	    __attribute__ ((section(".maps." #name), used))	\
+	    ____btf_map_##name = { }
+
+#endif /* __BPF_ELF__ */
diff --git a/drivers/net/tap/bpf/bpf_extract.py b/drivers/net/tap/bpf/bpf_extract.py
new file mode 100644
index 0000000000..b630c42b80
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_extract.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Stephen Hemminger <stephen@networkplumber.org>
+
+import argparse
+import sys
+import struct
+from tempfile import TemporaryFile
+from elftools.elf.elffile import ELFFile
+
+
+def load_sections(elffile):
+    """Get sections of interest from ELF"""
+    result = []
+    parts = [("cls_q", "cls_q_insns"), ("l3_l4", "l3_l4_hash_insns")]
+    for name, tag in parts:
+        section = elffile.get_section_by_name(name)
+        if section:
+            insns = struct.iter_unpack('<BBhL', section.data())
+            result.append([tag, insns])
+    return result
+
+
+def dump_section(name, insns, out):
+    """Dump the array of BPF instructions"""
+    print(f'\nstatic struct bpf_insn {name}[] = {{', file=out)
+    for bpf in insns:
+        code = bpf[0]
+        src = bpf[1] >> 4
+        dst = bpf[1] & 0xf
+        off = bpf[2]
+        imm = bpf[3]
+        print(f'\t{{{code:#04x}, {dst:4d}, {src:4d}, {off:8d}, {imm:#010x}}},',
+              file=out)
+    print('};', file=out)
+
+
+def parse_args():
+    """Parse command line arguments"""
+    parser = argparse.ArgumentParser()
+    parser.add_argument('-s',
+                        '--source',
+                        type=str,
+                        help="original source file")
+    parser.add_argument('-o', '--out', type=str, help="output C file path")
+    parser.add_argument("file",
+                        nargs='+',
+                        help="object file path or '-' for stdin")
+    return parser.parse_args()
+
+
+def open_input(path):
+    """Open the file or stdin"""
+    if path == "-":
+        temp = TemporaryFile()
+        temp.write(sys.stdin.buffer.read())
+        return temp
+    return open(path, 'rb')
+
+
+def write_header(out, source):
+    """Write file intro header"""
+    print("/* SPDX-License-Identifier: BSD-3-Clause", file=out)
+    if source:
+        print(f' * Auto-generated from {source}', file=out)
+    print(" * This not the original source file. Do NOT edit it.", file=out)
+    print(" */\n", file=out)
+    print("#include <tap_bpf.h>", file=out)
+
+
+def main():
+    '''program main function'''
+    args = parse_args()
+
+    with open(args.out, 'w',
+              encoding="utf-8") if args.out else sys.stdout as out:
+        write_header(out, args.source)
+        for path in args.file:
+            elffile = ELFFile(open_input(path))
+            sections = load_sections(elffile)
+            for name, insns in sections:
+                dump_section(name, insns, out)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/bpf/tap_bpf_program.c
similarity index 96%
rename from drivers/net/tap/tap_bpf_program.c
rename to drivers/net/tap/bpf/tap_bpf_program.c
index 20c310e5e7..d65021d8a1 100644
--- a/drivers/net/tap/tap_bpf_program.c
+++ b/drivers/net/tap/bpf/tap_bpf_program.c
@@ -14,9 +14,10 @@
 #include <linux/ipv6.h>
 #include <linux/if_tunnel.h>
 #include <linux/filter.h>
-#include <linux/bpf.h>
 
-#include "tap_rss.h"
+#include "bpf_api.h"
+#include "bpf_elf.h"
+#include "../tap_rss.h"
 
 /** Create IPv4 address */
 #define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \
@@ -56,6 +57,7 @@ __section("cls_q") int
 match_q(struct __sk_buff *skb)
 {
 	__u32 queue = skb->cb[1];
+	/* queue is set by tap_flow_bpf_cls_q() before load */
 	volatile __u32 q = 0xdeadbeef;
 	__u32 match_queue = QUEUE_OFFSET + q;
 
@@ -75,14 +77,14 @@ struct ipv4_l3_l4_tuple {
 	__u32    dst_addr;
 	__u16    dport;
 	__u16    sport;
-} __rte_packed;
+} __attribute__((packed));
 
 struct ipv6_l3_l4_tuple {
 	__u8        src_addr[16];
 	__u8        dst_addr[16];
 	__u16       dport;
 	__u16       sport;
-} __rte_packed;
+} __attribute__((packed));
 
 static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
 	0xd1, 0x81, 0xc6, 0x2c,
diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h
index 48c151cf6b..dff46a012f 100644
--- a/drivers/net/tap/tap_rss.h
+++ b/drivers/net/tap/tap_rss.h
@@ -35,6 +35,6 @@ struct rss_key {
 	__u32 key_size;
 	__u32 queues[TAP_MAX_QUEUES];
 	__u32 nb_queues;
-} __rte_packed;
+} __attribute__((packed));
 
 #endif /* _TAP_RSS_H_ */
-- 
2.41.0


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm
  2023-11-01  7:40  4%   ` [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-11-01 13:36  3%     ` Ferruh Yigit
  2023-11-02  6:58  0%       ` Jie Hai
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-11-01 13:36 UTC (permalink / raw)
  To: Jie Hai, dev, Thomas Monjalon, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

On 11/1/2023 7:40 AM, Jie Hai wrote:
> Currently, rte_eth_rss_conf supports configuring and querying
> RSS hash functions, rss key and it's length, but not RSS hash
> algorithm.
> 
> The structure ``rte_eth_dev_info`` is extended by adding a new
> field "rss_algo_capa". Drivers are responsible for reporting this
> capa and configurations of RSS hash algorithm can be verified based
> on the capability. The default value of "rss_algo_capa" is
> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.
> 
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "algorithm". This represents the RSS algorithms to apply.
> If the value of "algorithm" used for configuration is a gibberish
> value, drivers should report the error.
> 
> To check whether the drivers report valid "algorithm", it is set
> to default value before querying in rte_eth_dev_rss_hash_conf_get().
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> Acked-by: Huisong Li <lihuisong@huawei.com>
> ---
>  doc/guides/rel_notes/release_23_11.rst |  5 +++++
>  lib/ethdev/rte_ethdev.c                | 26 +++++++++++++++++++++++
>  lib/ethdev/rte_ethdev.h                | 29 ++++++++++++++++++++++++++
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 26 ++---------------------
>  5 files changed, 62 insertions(+), 25 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index 95db98d098d8..e207786044f9 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -372,6 +372,11 @@ ABI Changes
>  * security: struct ``rte_security_ipsec_sa_options`` was updated
>    due to inline out-of-place feature addition.
>  
> +* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
> +* reporting RSS hash algorithm capability.
> +
> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
> +  hash algorithm.
>  

As well as ABI change, can you also update the "New Features", to
document getting hash algorithm capability and setting hash algorithm
support added?

Also please add an empty line here.

>  Known Issues
>  ------------
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 07bb35833ba6..f9bd99d07eb1 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -1269,6 +1269,7 @@ int
>  rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>  		      const struct rte_eth_conf *dev_conf)
>  {
> +	enum rte_eth_hash_function algorithm;
>  	struct rte_eth_dev *dev;
>  	struct rte_eth_dev_info dev_info;
>  	struct rte_eth_conf orig_conf;
> @@ -1510,6 +1511,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>  		goto rollback;
>  	}
>  
> +	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
> +	if (RTE_ETH_HASH_ALGO_TO_CAPA(algorithm) == 0 ||
>

"RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)" can't be zero for valid "enum
rte_eth_hash_function" values, I assume above check is for the case
algorith > 31, as it will result zero.
My concern is, this is undefined behaviour (shift left >= 32) and some
compiler can complain about it, instead of relying this can you please
add explicit "0 <= algorithm < 32" check?




^ permalink raw reply	[relevance 3%]

* Re: [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm
  2023-10-28  3:01  3%               ` lihuisong (C)
@ 2023-11-01 12:55  5%                 ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-11-01 12:55 UTC (permalink / raw)
  To: lihuisong (C), Jie Hai, dev, Thomas Monjalon, Andrew Rybchenko, Ori Kam
  Cc: fengchengwen, liudongdong3

On 10/28/2023 4:01 AM, lihuisong (C) wrote:
> With belows to changes,
> Acked-by: Huisong Li <lihuisong@huawei.com>
> 
> 
> 在 2023/10/28 9:46, Jie Hai 写道:
>> Currently, rte_eth_rss_conf supports configuring and querying
>> RSS hash functions, rss key and it's length, but not RSS hash
>> algorithm.
>>
>> The structure ``rte_eth_dev_info`` is extended by adding a new
>> field "rss_algo_capa". Drivers are responsible for reporting this
>> capa and configurations of RSS hash algorithm can be verified based
>> on the capability. The default value of "rss_algo_capa" is
>> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "algorithm". This represents the RSS algorithms to apply.
>> If the value of "algorithm" used for configuration is a gibberish
>> value, drivers should report the error.
>>
>> To check whether the drivers report valid "algorithm", it is set
>> to default value before querying in rte_eth_dev_rss_hash_conf_get().
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> ---
>>   doc/guides/rel_notes/release_23_11.rst |  5 ++++
>>   lib/ethdev/rte_ethdev.c                | 26 ++++++++++++++++++++
>>   lib/ethdev/rte_ethdev.h                | 33 +++++++++++++++++++++++++-
>>   lib/ethdev/rte_flow.c                  |  1 -
>>   lib/ethdev/rte_flow.h                  | 26 ++------------------
>>   5 files changed, 65 insertions(+), 26 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_23_11.rst
>> b/doc/guides/rel_notes/release_23_11.rst
>> index 0a6fc76a9d02..a35d729d2cc7 100644
>> --- a/doc/guides/rel_notes/release_23_11.rst
>> +++ b/doc/guides/rel_notes/release_23_11.rst
>> @@ -360,6 +360,11 @@ ABI Changes
>>   * security: struct ``rte_security_ipsec_sa_options`` was updated
>>     due to inline out-of-place feature addition.
>>   +* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info``
>> structure for
>> +* reporting RSS hash algorithm capability.
>> +
>> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure
>> for RSS
>> +  hash algorithm.
>>     Known Issues
>>   ------------
>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>> index 9dabcb5ae28e..90bfbf14d1f7 100644
>> --- a/lib/ethdev/rte_ethdev.c
>> +++ b/lib/ethdev/rte_ethdev.c
>> @@ -1269,6 +1269,7 @@ int
>>   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t
>> nb_tx_q,
>>                 const struct rte_eth_conf *dev_conf)
>>   {
>> +    enum rte_eth_hash_function algorithm;
>>       struct rte_eth_dev *dev;
>>       struct rte_eth_dev_info dev_info;
>>       struct rte_eth_conf orig_conf;
>> @@ -1500,6 +1501,18 @@ rte_eth_dev_configure(uint16_t port_id,
>> uint16_t nb_rx_q, uint16_t nb_tx_q,
>>           goto rollback;
>>       }
>>   +    algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
>> +    if ((dev_info.rss_algo_capa &
>> +         RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
> need to check the algorithm.
> its value should be in range of 0 to 31.
>> +        RTE_ETHDEV_LOG(ERR,
>> +            "Ethdev port_id=%u config unsupported RSS hash algorithm:
>> %u "
>> +            "with rss_algo_capa: %x\n",
> It seems that this log is not friendly to user.
> Configured RSS hash algorithm (%u) is not in the algorithm capability ().
> Anything ok like that.
> 
> %x --> 0x%" PRIx32 "
>> +            port_id, algorithm,
>> +            dev_info.rss_algo_capa);
>> +        ret = -EINVAL;
>> +        goto rollback;
>> +    }
>> +
>>       /*
>>        * Setup new number of Rx/Tx queues and reconfigure device.
>>        */
>> @@ -3757,6 +3770,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct
>> rte_eth_dev_info *dev_info)
>>       dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
>>           RTE_ETHER_CRC_LEN;
>>       dev_info->max_mtu = UINT16_MAX;
>> +    dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
>>         if (*dev->dev_ops->dev_infos_get == NULL)
>>           return -ENOTSUP;
>> @@ -4698,6 +4712,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
>>           return -ENOTSUP;
>>       }
>>   +    if ((dev_info.rss_algo_capa &
>> +         RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
>> +        RTE_ETHDEV_LOG(ERR,
>> +            "Ethdev port_id=%u config unsupported RSS hash algorithm:
>> %u "
>> +            "with rss_algo_capa: %x\n",
>> +            port_id, rss_conf->algorithm,
>> +            dev_info.rss_algo_capa);
>> +        return -EINVAL;
>> +    }
>> +
>>       if (*dev->dev_ops->rss_hash_update == NULL)
>>           return -ENOTSUP;
>>       ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
>> @@ -4725,6 +4749,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>>           return -EINVAL;
>>       }
>>   +    rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
>> +
>>       if (*dev->dev_ops->rss_hash_conf_get == NULL)
>>           return -ENOTSUP;
>>       ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
>> index 37fd5afef48a..2f639edd8218 100644
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> @@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
>>       uint64_t ids[64];
>>   };
>>   +/**
>> + * Hash function types.
>> + */
>> +enum rte_eth_hash_function {
>> +    /** DEFAULT means driver decides which hash algorithm to pick. */
>> +    RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
>> +    RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
>> +    RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
>> +    /**
>> +     * Symmetric Toeplitz: src, dst will be replaced by
>> +     * xor(src, dst). For the case with src/dst only,
>> +     * src or dst address will xor with zero pair.
>> +     */
>> +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>> +    /**
>> +     * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
>> +     * the hash function.
>> +     *  If src_ip > dst_ip, swap src_ip and dst_ip.
>> +     *  If src_port > dst_port, swap src_port and dst_port.
>> +     */
>> +    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>> +    RTE_ETH_HASH_FUNCTION_MAX,
>> +};
>> +
>> +#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
>> +#define RTE_ETH_HASH_ALGO_CAPA_MASK(x)
>> RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
>> +
>>   /**
>>    * A structure used to configure the Receive Side Scaling (RSS) feature
>>    * of an Ethernet port.
>> @@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
>>        * which RSS hashing is to be applied.
>>        */
>>       uint64_t rss_hf;
>> +    enum rte_eth_hash_function algorithm;    /**< Hash algorithm. */
>>   };
>>     /*
>> @@ -1783,7 +1811,10 @@ struct rte_eth_dev_info {
>>       /** Supported error handling mode. */
>>       enum rte_eth_err_handle_mode err_handle_mode;
>>   -    uint64_t reserved_64s[2]; /**< Reserved for future fields */
>> +    /** RSS hash algorithms capabilities */
>> +    uint32_t rss_algo_capa;
>>
> Please move this new field to "hash_key_size" and
> "flow_type_rss_offloads" in this struct.
> Because this version allows ABI break.
>

Technically, even LTS release is an ABI break release, an ABI break
should be discussed, approved and documented in the deprecation.rst in
advance.

For this patch, design evolved to update "struct rte_eth_dev_info" as
discussions go on, so I think we can make an exception,


But I would like to clarify that we shouldn't just break the ABI since
it is an LTS release.

A way to prevent exception happening in the patch is conclude design and
document ABI breakage *before* LTS release cycle start.


>> +
>> +    uint32_t reserved_32s[3]; /**< Reserved for future fields */
>>       void *reserved_ptrs[2];   /**< Reserved for future fields */
>>   };
>>   diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
>> index 3a67f1aaba9d..c13a2a391c37 100644
>> --- a/lib/ethdev/rte_flow.c
>> +++ b/lib/ethdev/rte_flow.c
>> @@ -13,7 +13,6 @@
>>   #include <rte_branch_prediction.h>
>>   #include <rte_string_fns.h>
>>   #include <rte_mbuf_dyn.h>
>> -#include "rte_ethdev.h"
>>   #include "rte_flow_driver.h"
>>   #include "rte_flow.h"
>>   diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
>> index 25f1dffd1f30..c94f553ae06f 100644
>> --- a/lib/ethdev/rte_flow.h
>> +++ b/lib/ethdev/rte_flow.h
>> @@ -40,6 +40,8 @@
>>   #include <rte_macsec.h>
>>   #include <rte_ib.h>
>>   +#include "rte_ethdev.h"
>> +
>>   #ifdef __cplusplus
>>   extern "C" {
>>   #endif
>> @@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
>>       uint64_t bytes; /**< Number of bytes through this rule [out]. */
>>   };
>>   -/**
>> - * Hash function types.
>> - */
>> -enum rte_eth_hash_function {
>> -    /** DEFAULT means driver decides which hash algorithm to pick. */
>> -    RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
>> -    RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
>> -    RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
>> -    /**
>> -     * Symmetric Toeplitz: src, dst will be replaced by
>> -     * xor(src, dst). For the case with src/dst only,
>> -     * src or dst address will xor with zero pair.
>> -     */
>> -    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>> -    /**
>> -     * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
>> -     * the hash function.
>> -     *  If src_ip > dst_ip, swap src_ip and dst_ip.
>> -     *  If src_port > dst_port, swap src_port and dst_port.
>> -     */
>> -    RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
>> -    RTE_ETH_HASH_FUNCTION_MAX,
>> -};
>> -
>>   /**
>>    * RTE_FLOW_ACTION_TYPE_RSS
>>    *


^ permalink raw reply	[relevance 5%]

* Re: [PATCH v8 00/10] support setting and querying RSS algorithms
  2023-11-01  7:40  3% ` [PATCH v8 00/10] " Jie Hai
  2023-11-01  7:40  4%   ` [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-11-01  9:44  0%   ` fengchengwen
  1 sibling, 0 replies; 200+ results
From: fengchengwen @ 2023-11-01  9:44 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, liudongdong3

LGTM
Series-acked-by: Chengwen Feng <fengchengwen@huawei.com>


On 2023/11/1 15:40, Jie Hai wrote:
> This patchset is to support setting and querying RSS algorithms.
> For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
> and field "algorithm" is added to ``rte_eth_rss_conf``.
> The drivers should reports their "rss_algo_capa" if they support
> updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
> by field "algorithm" and the related API should verify "algorithm" with
> "rss_algo_capa".
> 
> --
> v8:
> 1. rewrite some comments.
> 2. add check for rss_key_len in ethdev level.
> 3. add Acked-by: Huisong Li <lihuisong@huawei.com>.
> 4. fix log on RSS hash algorithm.
> 5. add rte_eth_dev_rss_algo_name to lib/ethdev/version.map.
> 6. fix RSS algorithm display on testpmd.
> 
> v7:
> 1. fix compile error.
> 2. add signed-off-by to patch[4/9].
> v6:
> 1. rewrite some comments.
> 2. add "rss_algo_capa" for `rte_eth_dev_info``.
> 3. add new API to get name of RSS algorithms
> 
> v5:
> 1. rewrite some comments.
> 2. check RSS algorithm for drivers supporting RSS.
> 3. change field "func" of rss_conf to "algorithm".
> 4. fix commit log for [PATCH v4 4/7].
> 5. add Acked-by Reshma Pattan.
> 6. add symmetric_toeplitz_sort for showing.
> 7. change "hf" to "hash function" for showing.
> 
> v4:
> 1. recomment some definitions related to RSS.
> 2. allocate static memory for rss_key instead of dynamic.
> 3. use array of strings to get the name of rss algorithm.
> 4. add display of rss algorithm with testpmd.
> 
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> 
> Huisong Li (1):
>   net/hns3: support setting and querying RSS hash function
> 
> Jie Hai (9):
>   ethdev: overwrite some comment related to RSS
>   lib/ethdev: check RSS key length
>   ethdev: support setting and querying RSS algorithm
>   net/hns3: report RSS hash algorithms capability
>   app/proc-info: fix never show RSS info
>   app/proc-info: adjust the display format of RSS info
>   ethdev: add API to get RSS algorithm names
>   app/proc-info: support querying RSS hash algorithm
>   app/testpmd: add RSS hash algorithms display
> 
>  app/proc-info/main.c                   | 24 +++++---
>  app/test-pmd/cmdline.c                 | 29 +++++++--
>  app/test-pmd/config.c                  | 29 ++++-----
>  app/test-pmd/testpmd.h                 |  2 +-
>  doc/guides/rel_notes/release_23_11.rst |  9 +++
>  drivers/net/hns3/hns3_common.c         |  4 ++
>  drivers/net/hns3/hns3_rss.c            | 47 ++++++++-------
>  lib/ethdev/rte_ethdev.c                | 82 ++++++++++++++++++++++++++
>  lib/ethdev/rte_ethdev.h                | 79 ++++++++++++++++++++-----
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 25 +-------
>  lib/ethdev/version.map                 |  1 +
>  12 files changed, 239 insertions(+), 93 deletions(-)
> 

^ permalink raw reply	[relevance 0%]

* [PATCH v8 00/10] support setting and querying RSS algorithms
    @ 2023-11-01  7:40  3% ` Jie Hai
  2023-11-01  7:40  4%   ` [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-11-01  9:44  0%   ` [PATCH v8 00/10] support setting and querying RSS algorithms fengchengwen
  2023-11-02  8:20  3% ` [PATCH v9 0/9] " Jie Hai
  2 siblings, 2 replies; 200+ results
From: Jie Hai @ 2023-11-01  7:40 UTC (permalink / raw)
  To: haijie1, dev; +Cc: lihuisong, fengchengwen, liudongdong3

This patchset is to support setting and querying RSS algorithms.
For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
and field "algorithm" is added to ``rte_eth_rss_conf``.
The drivers should reports their "rss_algo_capa" if they support
updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
by field "algorithm" and the related API should verify "algorithm" with
"rss_algo_capa".

--
v8:
1. rewrite some comments.
2. add check for rss_key_len in ethdev level.
3. add Acked-by: Huisong Li <lihuisong@huawei.com>.
4. fix log on RSS hash algorithm.
5. add rte_eth_dev_rss_algo_name to lib/ethdev/version.map.
6. fix RSS algorithm display on testpmd.

v7:
1. fix compile error.
2. add signed-off-by to patch[4/9].
v6:
1. rewrite some comments.
2. add "rss_algo_capa" for `rte_eth_dev_info``.
3. add new API to get name of RSS algorithms

v5:
1. rewrite some comments.
2. check RSS algorithm for drivers supporting RSS.
3. change field "func" of rss_conf to "algorithm".
4. fix commit log for [PATCH v4 4/7].
5. add Acked-by Reshma Pattan.
6. add symmetric_toeplitz_sort for showing.
7. change "hf" to "hash function" for showing.

v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.

Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (9):
  ethdev: overwrite some comment related to RSS
  lib/ethdev: check RSS key length
  ethdev: support setting and querying RSS algorithm
  net/hns3: report RSS hash algorithms capability
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  ethdev: add API to get RSS algorithm names
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                   | 24 +++++---
 app/test-pmd/cmdline.c                 | 29 +++++++--
 app/test-pmd/config.c                  | 29 ++++-----
 app/test-pmd/testpmd.h                 |  2 +-
 doc/guides/rel_notes/release_23_11.rst |  9 +++
 drivers/net/hns3/hns3_common.c         |  4 ++
 drivers/net/hns3/hns3_rss.c            | 47 ++++++++-------
 lib/ethdev/rte_ethdev.c                | 82 ++++++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 79 ++++++++++++++++++++-----
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 25 +-------
 lib/ethdev/version.map                 |  1 +
 12 files changed, 239 insertions(+), 93 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm
  2023-11-01  7:40  3% ` [PATCH v8 00/10] " Jie Hai
@ 2023-11-01  7:40  4%   ` Jie Hai
  2023-11-01 13:36  3%     ` Ferruh Yigit
  2023-11-01  9:44  0%   ` [PATCH v8 00/10] support setting and querying RSS algorithms fengchengwen
  1 sibling, 1 reply; 200+ results
From: Jie Hai @ 2023-11-01  7:40 UTC (permalink / raw)
  To: haijie1, dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_dev_info`` is extended by adding a new
field "rss_algo_capa". Drivers are responsible for reporting this
capa and configurations of RSS hash algorithm can be verified based
on the capability. The default value of "rss_algo_capa" is
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "algorithm". This represents the RSS algorithms to apply.
If the value of "algorithm" used for configuration is a gibberish
value, drivers should report the error.

To check whether the drivers report valid "algorithm", it is set
to default value before querying in rte_eth_dev_rss_hash_conf_get().

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  5 +++++
 lib/ethdev/rte_ethdev.c                | 26 +++++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 29 ++++++++++++++++++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 26 ++---------------------
 5 files changed, 62 insertions(+), 25 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 95db98d098d8..e207786044f9 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -372,6 +372,11 @@ ABI Changes
 * security: struct ``rte_security_ipsec_sa_options`` was updated
   due to inline out-of-place feature addition.
 
+* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
+* reporting RSS hash algorithm capability.
+
+* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
+  hash algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 07bb35833ba6..f9bd99d07eb1 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1269,6 +1269,7 @@ int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
 {
+	enum rte_eth_hash_function algorithm;
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf orig_conf;
@@ -1510,6 +1511,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
+	if (RTE_ETH_HASH_ALGO_TO_CAPA(algorithm) == 0 ||
+	    (dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u configured RSS hash algorithm (%u)"
+			"is not in the algorithm capability (0x%" PRIx32 ")\n",
+			port_id, algorithm, dev_info.rss_algo_capa);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of Rx/Tx queues and reconfigure device.
 	 */
@@ -3767,6 +3780,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
 		RTE_ETHER_CRC_LEN;
 	dev_info->max_mtu = UINT16_MAX;
+	dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
 
 	if (*dev->dev_ops->dev_infos_get == NULL)
 		return -ENOTSUP;
@@ -4716,6 +4730,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	if (RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm) == 0 ||
+	    (dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u configured RSS hash algorithm (%u)"
+			"is not in the algorithm capability (0x%" PRIx32 ")\n",
+			port_id, rss_conf->algorithm, dev_info.rss_algo_capa);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4756,6 +4780,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 343a134fdd12..76c45bd759e4 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -470,6 +497,7 @@ struct rte_eth_rss_conf {
 	 * which RSS hashing is to be applied.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
@@ -1750,6 +1778,7 @@ struct rte_eth_dev_info {
 	/** Device redirection table size, the total number of entries. */
 	uint16_t reta_size;
 	uint8_t hash_key_size; /**< Hash key size in bytes */
+	uint32_t rss_algo_capa; /** RSS hash algorithms capabilities */
 	/** Bit mask of RSS offloads, the bit offset also means flow type */
 	uint64_t flow_type_rss_offloads;
 	struct rte_eth_rxconf default_rxconf; /**< Default Rx configuration */
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 4d6c28ee0eb2..e2468cd351ab 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 751c29a0f3f3..affdc8121b57 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/** DEFAULT means driver decides which hash algorithm to pick. */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v7 0/9] support setting and querying RSS algorithms
  2023-10-28  1:46  3%           ` [PATCH v7 0/9] support setting and querying RSS algorithms Jie Hai
  2023-10-28  1:46  4%             ` [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-11-01  2:04  0%             ` Ferruh Yigit
  1 sibling, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-11-01  2:04 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 10/28/2023 2:46 AM, Jie Hai wrote:
> This patchset is to support setting and querying RSS algorithms.
> For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
> and field "algorithm" is added to ``rte_eth_rss_conf``.
> The drivers should reports their "rss_algo_capa" if they support
> updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
> by field "algorithm" and the related API should verify "algorithm" with
> "rss_algo_capa".
> 
> --
> v7:
> 1. fix compile error.
> 2. add signed-off-by to patch[4/9].
> v6:
> 1. rewrite some comments.
> 2. add "rss_algo_capa" for `rte_eth_dev_info``.
> 3. add new API to get name of RSS algorithms
> 
> v5:
> 1. rewrite some comments.
> 2. check RSS algorithm for drivers supporting RSS.
> 3. change field "func" of rss_conf to "algorithm".
> 4. fix commit log for [PATCH v4 4/7].
> 5. add Acked-by Reshma Pattan.
> 6. add symmetric_toeplitz_sort for showing.
> 7. change "hf" to "hash function" for showing.
> 
> v4:
> 1. recomment some definitions related to RSS.
> 2. allocate static memory for rss_key instead of dynamic.
> 3. use array of strings to get the name of rss algorithm.
> 4. add display of rss algorithm with testpmd.
> 
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> 
> Huisong Li (1):
>   net/hns3: support setting and querying RSS hash function
> 
> Jie Hai (8):
>   ethdev: overwrite some comment related to RSS
>   ethdev: support setting and querying RSS algorithm
>   net/hns3: report RSS hash algorithms capability
>   app/proc-info: fix never show RSS info
>   app/proc-info: adjust the display format of RSS info
>   lib/ethdev: add API to get RSS algorithm names
>   app/proc-info: support querying RSS hash algorithm
>   app/testpmd: add RSS hash algorithms display
> 

Hi Jie,

Patchset mostly looks good to me, new capability in dev_info approach is
better, but only I put some comments in the new API patch, can you
please check it, rest looks good but please send new version as whole
patchset.

Thanks,
ferruh

^ permalink raw reply	[relevance 0%]

* Re: release candidate 23.11-rc1
  2023-10-17 20:36  4% release candidate 23.11-rc1 Thomas Monjalon
       [not found]     ` <MW4PR11MB5912D298978501DAC2092EA49FD4A@MW4PR11MB5912.namprd11.prod.outlook.com>
@ 2023-10-31 23:15  0% ` Thinh Tran
  1 sibling, 0 replies; 200+ results
From: Thinh Tran @ 2023-10-31 23:15 UTC (permalink / raw)
  To: Thomas Monjalon, dpdk-dev

IBM - Power Systems
DPDK v23.11-rc1-29-g32faaf3073


* Build CI on Fedora 30,31,34,36,37,38 for ppc64le
* Basic PF on Mellanox: No issue found
* Performance: not tested.
* OS: RHEL 9.2  kernel: 5.14.0-284.25.1.el9_2.ppc64le
         with gcc version 11.3.1 20221121 (Red Hat 11.3.1-4) (GCC)
       RHEL 8.6  kernel: 4.18.0-348.el8.ppc64le
         with gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)


Systems tested:
  - LPARs on IBM Power10 CHRP IBM,9105-22A
     NICs:
     - Mellanox Mellanox Technologies MT2894 Family [ConnectX-6 Lx]
     - firmware version: 26.38.1002
     - MMLNX_OFED_LINUX-23.07-0.5.0.2


Regards,
Thinh Tran

On 10/17/2023 3:36 PM, Thomas Monjalon wrote:
> A new DPDK release candidate is ready for testing:
> 	https://git.dpdk.org/dpdk/tag/?id=v23.11-rc1
> 
> There are 617 new patches in this snapshot,
> including many API/ABI compatibility breakages.
> This release won't be ABI-compatible with previous ones.
> 
> Release notes:
> 	https://doc.dpdk.org/guides/rel_notes/release_23_11.html
> 
> Highlights of 23.11-rc1:
> 	- build requires C11 compiler
> 	- early support of MSVC build
> 	- new atomic operations API
> 	- power management on AMD CPU
> 	- mbuf recycling
> 	- flow action type for P4-defined actions
> 	- flow group miss action
> 	- flow item for packet type matching
> 	- TLS record offload
> 	- security Rx inject
> 	- eventdev link profiles
> 	- eventdev adapter for dmadev
> 	- event dispatcher library
> 
> Please test and report issues on bugs.dpdk.org.
> 
> DPDK 23.11-rc2 is expected in approximately two weeks.
> 
> Thank you everyone
> 
> 

^ permalink raw reply	[relevance 0%]

* [PATCH v5 1/3] net/tap: support infrastructure to build the BPF filter
  @ 2023-10-31 22:42  4%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-31 22:42 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Move the BPF program related code into a subdirectory.
And add a Makefile for building it.

The code depends on include files from iproute2.
But these are not public headers which iproute2 exports
as a package API. Therefore make a local copy here.

The standalone build was also broken because by
commit ef5baf3486e0 ("replace packed attributes")
which introduced __rte_packed into this code.

Add a python program to extract the resulting BPF into
a format that can be consumed by the TAP driver.

Update the documentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/nics/tap.rst                     |  11 +-
 drivers/net/tap/bpf/.gitignore              |   1 +
 drivers/net/tap/bpf/Makefile                |  18 ++
 drivers/net/tap/bpf/bpf_api.h               | 275 ++++++++++++++++++++
 drivers/net/tap/bpf/bpf_elf.h               |  53 ++++
 drivers/net/tap/bpf/bpf_extract.py          |  86 ++++++
 drivers/net/tap/{ => bpf}/tap_bpf_program.c |  10 +-
 drivers/net/tap/tap_rss.h                   |   2 +-
 8 files changed, 444 insertions(+), 12 deletions(-)
 create mode 100644 drivers/net/tap/bpf/.gitignore
 create mode 100644 drivers/net/tap/bpf/Makefile
 create mode 100644 drivers/net/tap/bpf/bpf_api.h
 create mode 100644 drivers/net/tap/bpf/bpf_elf.h
 create mode 100644 drivers/net/tap/bpf/bpf_extract.py
 rename drivers/net/tap/{ => bpf}/tap_bpf_program.c (96%)

diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst
index 07df0d35a2..449e747994 100644
--- a/doc/guides/nics/tap.rst
+++ b/doc/guides/nics/tap.rst
@@ -256,15 +256,12 @@ C functions under different ELF sections.
 
 2. Install ``LLVM`` library and ``clang`` compiler versions 3.7 and above
 
-3. Compile ``tap_bpf_program.c`` via ``LLVM`` into an object file::
+3. Use make to compile  `tap_bpf_program.c`` via ``LLVM`` into an object file
+   and extract the resulting instructions into ``tap_bpf_insn.h``.
 
-    clang -O2 -emit-llvm -c tap_bpf_program.c -o - | llc -march=bpf \
-    -filetype=obj -o <tap_bpf_program.o>
+    cd bpf; make
 
-
-4. Use a tool that receives two parameters: an eBPF object file and a section
-name, and prints out the section as a C array of eBPF instructions.
-Embed the C array in your TAP PMD tree.
+4. Recompile the TAP PMD.
 
 The C arrays are uploaded to the kernel using BPF system calls.
 
diff --git a/drivers/net/tap/bpf/.gitignore b/drivers/net/tap/bpf/.gitignore
new file mode 100644
index 0000000000..30a258f1af
--- /dev/null
+++ b/drivers/net/tap/bpf/.gitignore
@@ -0,0 +1 @@
+tap_bpf_program.o
diff --git a/drivers/net/tap/bpf/Makefile b/drivers/net/tap/bpf/Makefile
new file mode 100644
index 0000000000..e5ae4e1f5a
--- /dev/null
+++ b/drivers/net/tap/bpf/Makefile
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# This file is not built as part of normal DPDK build.
+# It is used to generate the eBPF code for TAP RSS.
+CLANG=clang
+CLANG_OPTS=-O2
+TARGET=../tap_bpf_insns.h
+
+all: $(TARGET)
+
+clean:
+	rm tap_bpf_program.o $(TARGET)
+
+tap_bpf_program.o: tap_bpf_program.c
+	$(CLANG) $(CLANG_OPTS) -emit-llvm -c $< -o - | \
+	llc -march=bpf -filetype=obj -o $@
+
+$(TARGET): bpf_extract.py tap_bpf_program.o
+	python3 bpf_extract.py tap_bpf_program.o $@
diff --git a/drivers/net/tap/bpf/bpf_api.h b/drivers/net/tap/bpf/bpf_api.h
new file mode 100644
index 0000000000..5887d3a851
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_api.h
@@ -0,0 +1,275 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_API__
+#define __BPF_API__
+
+/* Note:
+ *
+ * This file can be included into eBPF kernel programs. It contains
+ * a couple of useful helper functions, map/section ABI (bpf_elf.h),
+ * misc macros and some eBPF specific LLVM built-ins.
+ */
+
+#include <stdint.h>
+
+#include <linux/pkt_cls.h>
+#include <linux/bpf.h>
+#include <linux/filter.h>
+
+#include <asm/byteorder.h>
+
+#include "bpf_elf.h"
+
+/** libbpf pin type. */
+enum libbpf_pin_type {
+	LIBBPF_PIN_NONE,
+	/* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
+	LIBBPF_PIN_BY_NAME,
+};
+
+/** Type helper macros. */
+
+#define __uint(name, val) int (*name)[val]
+#define __type(name, val) typeof(val) *name
+#define __array(name, val) typeof(val) *name[]
+
+/** Misc macros. */
+
+#ifndef __stringify
+# define __stringify(X)		#X
+#endif
+
+#ifndef __maybe_unused
+# define __maybe_unused		__attribute__((__unused__))
+#endif
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER)	__builtin_offsetof(TYPE, MEMBER)
+#endif
+
+#ifndef likely
+# define likely(X)		__builtin_expect(!!(X), 1)
+#endif
+
+#ifndef unlikely
+# define unlikely(X)		__builtin_expect(!!(X), 0)
+#endif
+
+#ifndef htons
+# define htons(X)		__constant_htons((X))
+#endif
+
+#ifndef ntohs
+# define ntohs(X)		__constant_ntohs((X))
+#endif
+
+#ifndef htonl
+# define htonl(X)		__constant_htonl((X))
+#endif
+
+#ifndef ntohl
+# define ntohl(X)		__constant_ntohl((X))
+#endif
+
+#ifndef __inline__
+# define __inline__		__attribute__((always_inline))
+#endif
+
+/** Section helper macros. */
+
+#ifndef __section
+# define __section(NAME)						\
+	__attribute__((section(NAME), used))
+#endif
+
+#ifndef __section_tail
+# define __section_tail(ID, KEY)					\
+	__section(__stringify(ID) "/" __stringify(KEY))
+#endif
+
+#ifndef __section_xdp_entry
+# define __section_xdp_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_cls_entry
+# define __section_cls_entry						\
+	__section(ELF_SECTION_CLASSIFIER)
+#endif
+
+#ifndef __section_act_entry
+# define __section_act_entry						\
+	__section(ELF_SECTION_ACTION)
+#endif
+
+#ifndef __section_lwt_entry
+# define __section_lwt_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_license
+# define __section_license						\
+	__section(ELF_SECTION_LICENSE)
+#endif
+
+#ifndef __section_maps
+# define __section_maps							\
+	__section(ELF_SECTION_MAPS)
+#endif
+
+/** Declaration helper macros. */
+
+#ifndef BPF_LICENSE
+# define BPF_LICENSE(NAME)						\
+	char ____license[] __section_license = NAME
+#endif
+
+/** Classifier helper */
+
+#ifndef BPF_H_DEFAULT
+# define BPF_H_DEFAULT	-1
+#endif
+
+/** BPF helper functions for tc. Individual flags are in linux/bpf.h */
+
+#ifndef __BPF_FUNC
+# define __BPF_FUNC(NAME, ...)						\
+	(* NAME)(__VA_ARGS__) __maybe_unused
+#endif
+
+#ifndef BPF_FUNC
+# define BPF_FUNC(NAME, ...)						\
+	__BPF_FUNC(NAME, __VA_ARGS__) = (void *) BPF_FUNC_##NAME
+#endif
+
+/* Map access/manipulation */
+static void *BPF_FUNC(map_lookup_elem, void *map, const void *key);
+static int BPF_FUNC(map_update_elem, void *map, const void *key,
+		    const void *value, uint32_t flags);
+static int BPF_FUNC(map_delete_elem, void *map, const void *key);
+
+/* Time access */
+static uint64_t BPF_FUNC(ktime_get_ns);
+
+/* Debugging */
+
+/* FIXME: __attribute__ ((format(printf, 1, 3))) not possible unless
+ * llvm bug https://llvm.org/bugs/show_bug.cgi?id=26243 gets resolved.
+ * It would require ____fmt to be made const, which generates a reloc
+ * entry (non-map).
+ */
+static void BPF_FUNC(trace_printk, const char *fmt, int fmt_size, ...);
+
+#ifndef printt
+# define printt(fmt, ...)						\
+	({								\
+		char ____fmt[] = fmt;					\
+		trace_printk(____fmt, sizeof(____fmt), ##__VA_ARGS__);	\
+	})
+#endif
+
+/* Random numbers */
+static uint32_t BPF_FUNC(get_prandom_u32);
+
+/* Tail calls */
+static void BPF_FUNC(tail_call, struct __sk_buff *skb, void *map,
+		     uint32_t index);
+
+/* System helpers */
+static uint32_t BPF_FUNC(get_smp_processor_id);
+static uint32_t BPF_FUNC(get_numa_node_id);
+
+/* Packet misc meta data */
+static uint32_t BPF_FUNC(get_cgroup_classid, struct __sk_buff *skb);
+static int BPF_FUNC(skb_under_cgroup, void *map, uint32_t index);
+
+static uint32_t BPF_FUNC(get_route_realm, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(get_hash_recalc, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(set_hash_invalid, struct __sk_buff *skb);
+
+/* Packet redirection */
+static int BPF_FUNC(redirect, int ifindex, uint32_t flags);
+static int BPF_FUNC(clone_redirect, struct __sk_buff *skb, int ifindex,
+		    uint32_t flags);
+
+/* Packet manipulation */
+static int BPF_FUNC(skb_load_bytes, struct __sk_buff *skb, uint32_t off,
+		    void *to, uint32_t len);
+static int BPF_FUNC(skb_store_bytes, struct __sk_buff *skb, uint32_t off,
+		    const void *from, uint32_t len, uint32_t flags);
+
+static int BPF_FUNC(l3_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(l4_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(csum_diff, const void *from, uint32_t from_size,
+		    const void *to, uint32_t to_size, uint32_t seed);
+static int BPF_FUNC(csum_update, struct __sk_buff *skb, uint32_t wsum);
+
+static int BPF_FUNC(skb_change_type, struct __sk_buff *skb, uint32_t type);
+static int BPF_FUNC(skb_change_proto, struct __sk_buff *skb, uint32_t proto,
+		    uint32_t flags);
+static int BPF_FUNC(skb_change_tail, struct __sk_buff *skb, uint32_t nlen,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_pull_data, struct __sk_buff *skb, uint32_t len);
+
+/* Event notification */
+static int __BPF_FUNC(skb_event_output, struct __sk_buff *skb, void *map,
+		      uint64_t index, const void *data, uint32_t size) =
+		      (void *) BPF_FUNC_perf_event_output;
+
+/* Packet vlan encap/decap */
+static int BPF_FUNC(skb_vlan_push, struct __sk_buff *skb, uint16_t proto,
+		    uint16_t vlan_tci);
+static int BPF_FUNC(skb_vlan_pop, struct __sk_buff *skb);
+
+/* Packet tunnel encap/decap */
+static int BPF_FUNC(skb_get_tunnel_key, struct __sk_buff *skb,
+		    struct bpf_tunnel_key *to, uint32_t size, uint32_t flags);
+static int BPF_FUNC(skb_set_tunnel_key, struct __sk_buff *skb,
+		    const struct bpf_tunnel_key *from, uint32_t size,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_get_tunnel_opt, struct __sk_buff *skb,
+		    void *to, uint32_t size);
+static int BPF_FUNC(skb_set_tunnel_opt, struct __sk_buff *skb,
+		    const void *from, uint32_t size);
+
+/** LLVM built-ins, mem*() routines work for constant size */
+
+#ifndef lock_xadd
+# define lock_xadd(ptr, val)	((void) __sync_fetch_and_add(ptr, val))
+#endif
+
+#ifndef memset
+# define memset(s, c, n)	__builtin_memset((s), (c), (n))
+#endif
+
+#ifndef memcpy
+# define memcpy(d, s, n)	__builtin_memcpy((d), (s), (n))
+#endif
+
+#ifndef memmove
+# define memmove(d, s, n)	__builtin_memmove((d), (s), (n))
+#endif
+
+/* FIXME: __builtin_memcmp() is not yet fully useable unless llvm bug
+ * https://llvm.org/bugs/show_bug.cgi?id=26218 gets resolved. Also
+ * this one would generate a reloc entry (non-map), otherwise.
+ */
+#if 0
+#ifndef memcmp
+# define memcmp(a, b, n)	__builtin_memcmp((a), (b), (n))
+#endif
+#endif
+
+unsigned long long load_byte(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.byte");
+
+unsigned long long load_half(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.half");
+
+unsigned long long load_word(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.word");
+
+#endif /* __BPF_API__ */
diff --git a/drivers/net/tap/bpf/bpf_elf.h b/drivers/net/tap/bpf/bpf_elf.h
new file mode 100644
index 0000000000..ea8a11c95c
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_elf.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_ELF__
+#define __BPF_ELF__
+
+#include <asm/types.h>
+
+/* Note:
+ *
+ * Below ELF section names and bpf_elf_map structure definition
+ * are not (!) kernel ABI. It's rather a "contract" between the
+ * application and the BPF loader in tc. For compatibility, the
+ * section names should stay as-is. Introduction of aliases, if
+ * needed, are a possibility, though.
+ */
+
+/* ELF section names, etc */
+#define ELF_SECTION_LICENSE	"license"
+#define ELF_SECTION_MAPS	"maps"
+#define ELF_SECTION_PROG	"prog"
+#define ELF_SECTION_CLASSIFIER	"classifier"
+#define ELF_SECTION_ACTION	"action"
+
+#define ELF_MAX_MAPS		64
+#define ELF_MAX_LICENSE_LEN	128
+
+/* Object pinning settings */
+#define PIN_NONE		0
+#define PIN_OBJECT_NS		1
+#define PIN_GLOBAL_NS		2
+
+/* ELF map definition */
+struct bpf_elf_map {
+	__u32 type;
+	__u32 size_key;
+	__u32 size_value;
+	__u32 max_elem;
+	__u32 flags;
+	__u32 id;
+	__u32 pinning;
+	__u32 inner_id;
+	__u32 inner_idx;
+};
+
+#define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val)		\
+	struct ____btf_map_##name {				\
+		type_key key;					\
+		type_val value;					\
+	};							\
+	struct ____btf_map_##name				\
+	    __attribute__ ((section(".maps." #name), used))	\
+	    ____btf_map_##name = { }
+
+#endif /* __BPF_ELF__ */
diff --git a/drivers/net/tap/bpf/bpf_extract.py b/drivers/net/tap/bpf/bpf_extract.py
new file mode 100644
index 0000000000..5e1aee38c8
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_extract.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Stephen Hemminger <stephen@networkplumber.org>
+
+import argparse
+import sys
+import struct
+from tempfile import TemporaryFile
+from elftools.elf.elffile import ELFFile
+
+
+def load_sections(elffile):
+    """Get sections of interest from ELF"""
+    result = []
+    DATA = [("cls_q", "cls_q_insns"), ("l3_l4", "l3_l4_hash_insns")]
+    for name, tag in DATA:
+        section = elffile.get_section_by_name(name)
+        if section:
+            insns = struct.iter_unpack('<BBhL', section.data())
+            result.append([tag, insns])
+    return result
+
+
+def dump_section(name, insns, out):
+    """Dump the array of BPF instructructions"""
+    print(f'\nstatic struct bpf_insn {name}[] = {{', file=out)
+    for bpf in insns:
+        code = bpf[0]
+        src = bpf[1] >> 4
+        dst = bpf[1] & 0xf
+        off = bpf[2]
+        imm = bpf[3]
+        print(f'\t{{{code:#02x}, {dst:4d}, {src:4d}, {off:8d}, {imm:#010x}}},',
+              file=out)
+    print('};', file=out)
+
+
+def parse_args():
+    """Parse command line arguments"""
+    parser = argparse.ArgumentParser()
+    parser.add_argument("input",
+                        nargs='+',
+                        help="input object file path or '-' for stdin")
+    parser.add_argument("output", help="output C file path or '-' for stdout")
+    return parser.parse_args()
+
+
+def open_input(path):
+    """Open the input file or stdin"""
+    if path == "-":
+        temp = TemporaryFile()
+        temp.write(sys.stdin.buffer.read())
+        return temp
+    return open(path, "rb")
+
+
+def open_output(path):
+    """Open the output file or stdout"""
+    if path == "-":
+        return sys.stdout
+    return open(path, "w")
+
+
+def write_header(output):
+    """Write file intro header"""
+    print("/* SPDX-License-Identifier: BSD-3-Clause", file=output)
+    print(" * Compiled BPF instructions do not edit", file=output)
+    print(" */\n", file=output)
+    print("#include <tap_bpf.h>", file=output)
+
+
+def main():
+    '''program main function'''
+    args = parse_args()
+
+    output = open_output(args.output)
+    write_header(output)
+    for path in args.input:
+        elffile = ELFFile(open_input(path))
+        sections = load_sections(elffile)
+        for name, insns in sections:
+            dump_section(name, insns, output)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/bpf/tap_bpf_program.c
similarity index 96%
rename from drivers/net/tap/tap_bpf_program.c
rename to drivers/net/tap/bpf/tap_bpf_program.c
index 20c310e5e7..d65021d8a1 100644
--- a/drivers/net/tap/tap_bpf_program.c
+++ b/drivers/net/tap/bpf/tap_bpf_program.c
@@ -14,9 +14,10 @@
 #include <linux/ipv6.h>
 #include <linux/if_tunnel.h>
 #include <linux/filter.h>
-#include <linux/bpf.h>
 
-#include "tap_rss.h"
+#include "bpf_api.h"
+#include "bpf_elf.h"
+#include "../tap_rss.h"
 
 /** Create IPv4 address */
 #define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \
@@ -56,6 +57,7 @@ __section("cls_q") int
 match_q(struct __sk_buff *skb)
 {
 	__u32 queue = skb->cb[1];
+	/* queue is set by tap_flow_bpf_cls_q() before load */
 	volatile __u32 q = 0xdeadbeef;
 	__u32 match_queue = QUEUE_OFFSET + q;
 
@@ -75,14 +77,14 @@ struct ipv4_l3_l4_tuple {
 	__u32    dst_addr;
 	__u16    dport;
 	__u16    sport;
-} __rte_packed;
+} __attribute__((packed));
 
 struct ipv6_l3_l4_tuple {
 	__u8        src_addr[16];
 	__u8        dst_addr[16];
 	__u16       dport;
 	__u16       sport;
-} __rte_packed;
+} __attribute__((packed));
 
 static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
 	0xd1, 0x81, 0xc6, 0x2c,
diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h
index 48c151cf6b..dff46a012f 100644
--- a/drivers/net/tap/tap_rss.h
+++ b/drivers/net/tap/tap_rss.h
@@ -35,6 +35,6 @@ struct rss_key {
 	__u32 key_size;
 	__u32 queues[TAP_MAX_QUEUES];
 	__u32 nb_queues;
-} __rte_packed;
+} __attribute__((packed));
 
 #endif /* _TAP_RSS_H_ */
-- 
2.41.0


^ permalink raw reply	[relevance 4%]

* [PATCH 1/3] net/tap: support infrastructure to build the BPF filter
  @ 2023-10-31 22:08  4%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-31 22:08 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Move the BPF program related code into a subdirectory.
And add a Makefile for building it.

The code depends on include files from iproute2.
But these are not public headers which iproute2 exports
as a package API. Therefore make a local copy here.

The standalone build was also broken because by
commit ef5baf3486e0 ("replace packed attributes")
which introduced __rte_packed into this code.

Add a python program to extract the resulting BPF into
a format that can be consumed by the TAP driver.

Update the documentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/nics/tap.rst                     |  11 +-
 drivers/net/tap/bpf/.gitignore              |   1 +
 drivers/net/tap/bpf/Makefile                |  18 ++
 drivers/net/tap/bpf/bpf_api.h               | 275 ++++++++++++++++++++
 drivers/net/tap/bpf/bpf_elf.h               |  53 ++++
 drivers/net/tap/bpf/bpf_extract.py          |  80 ++++++
 drivers/net/tap/{ => bpf}/tap_bpf_program.c |   9 +-
 drivers/net/tap/tap_rss.h                   |   2 +-
 8 files changed, 437 insertions(+), 12 deletions(-)
 create mode 100644 drivers/net/tap/bpf/.gitignore
 create mode 100644 drivers/net/tap/bpf/Makefile
 create mode 100644 drivers/net/tap/bpf/bpf_api.h
 create mode 100644 drivers/net/tap/bpf/bpf_elf.h
 create mode 100644 drivers/net/tap/bpf/bpf_extract.py
 rename drivers/net/tap/{ => bpf}/tap_bpf_program.c (97%)

diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst
index 07df0d35a2..449e747994 100644
--- a/doc/guides/nics/tap.rst
+++ b/doc/guides/nics/tap.rst
@@ -256,15 +256,12 @@ C functions under different ELF sections.
 
 2. Install ``LLVM`` library and ``clang`` compiler versions 3.7 and above
 
-3. Compile ``tap_bpf_program.c`` via ``LLVM`` into an object file::
+3. Use make to compile  `tap_bpf_program.c`` via ``LLVM`` into an object file
+   and extract the resulting instructions into ``tap_bpf_insn.h``.
 
-    clang -O2 -emit-llvm -c tap_bpf_program.c -o - | llc -march=bpf \
-    -filetype=obj -o <tap_bpf_program.o>
+    cd bpf; make
 
-
-4. Use a tool that receives two parameters: an eBPF object file and a section
-name, and prints out the section as a C array of eBPF instructions.
-Embed the C array in your TAP PMD tree.
+4. Recompile the TAP PMD.
 
 The C arrays are uploaded to the kernel using BPF system calls.
 
diff --git a/drivers/net/tap/bpf/.gitignore b/drivers/net/tap/bpf/.gitignore
new file mode 100644
index 0000000000..30a258f1af
--- /dev/null
+++ b/drivers/net/tap/bpf/.gitignore
@@ -0,0 +1 @@
+tap_bpf_program.o
diff --git a/drivers/net/tap/bpf/Makefile b/drivers/net/tap/bpf/Makefile
new file mode 100644
index 0000000000..e5ae4e1f5a
--- /dev/null
+++ b/drivers/net/tap/bpf/Makefile
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# This file is not built as part of normal DPDK build.
+# It is used to generate the eBPF code for TAP RSS.
+CLANG=clang
+CLANG_OPTS=-O2
+TARGET=../tap_bpf_insns.h
+
+all: $(TARGET)
+
+clean:
+	rm tap_bpf_program.o $(TARGET)
+
+tap_bpf_program.o: tap_bpf_program.c
+	$(CLANG) $(CLANG_OPTS) -emit-llvm -c $< -o - | \
+	llc -march=bpf -filetype=obj -o $@
+
+$(TARGET): bpf_extract.py tap_bpf_program.o
+	python3 bpf_extract.py tap_bpf_program.o $@
diff --git a/drivers/net/tap/bpf/bpf_api.h b/drivers/net/tap/bpf/bpf_api.h
new file mode 100644
index 0000000000..5887d3a851
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_api.h
@@ -0,0 +1,275 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_API__
+#define __BPF_API__
+
+/* Note:
+ *
+ * This file can be included into eBPF kernel programs. It contains
+ * a couple of useful helper functions, map/section ABI (bpf_elf.h),
+ * misc macros and some eBPF specific LLVM built-ins.
+ */
+
+#include <stdint.h>
+
+#include <linux/pkt_cls.h>
+#include <linux/bpf.h>
+#include <linux/filter.h>
+
+#include <asm/byteorder.h>
+
+#include "bpf_elf.h"
+
+/** libbpf pin type. */
+enum libbpf_pin_type {
+	LIBBPF_PIN_NONE,
+	/* PIN_BY_NAME: pin maps by name (in /sys/fs/bpf by default) */
+	LIBBPF_PIN_BY_NAME,
+};
+
+/** Type helper macros. */
+
+#define __uint(name, val) int (*name)[val]
+#define __type(name, val) typeof(val) *name
+#define __array(name, val) typeof(val) *name[]
+
+/** Misc macros. */
+
+#ifndef __stringify
+# define __stringify(X)		#X
+#endif
+
+#ifndef __maybe_unused
+# define __maybe_unused		__attribute__((__unused__))
+#endif
+
+#ifndef offsetof
+# define offsetof(TYPE, MEMBER)	__builtin_offsetof(TYPE, MEMBER)
+#endif
+
+#ifndef likely
+# define likely(X)		__builtin_expect(!!(X), 1)
+#endif
+
+#ifndef unlikely
+# define unlikely(X)		__builtin_expect(!!(X), 0)
+#endif
+
+#ifndef htons
+# define htons(X)		__constant_htons((X))
+#endif
+
+#ifndef ntohs
+# define ntohs(X)		__constant_ntohs((X))
+#endif
+
+#ifndef htonl
+# define htonl(X)		__constant_htonl((X))
+#endif
+
+#ifndef ntohl
+# define ntohl(X)		__constant_ntohl((X))
+#endif
+
+#ifndef __inline__
+# define __inline__		__attribute__((always_inline))
+#endif
+
+/** Section helper macros. */
+
+#ifndef __section
+# define __section(NAME)						\
+	__attribute__((section(NAME), used))
+#endif
+
+#ifndef __section_tail
+# define __section_tail(ID, KEY)					\
+	__section(__stringify(ID) "/" __stringify(KEY))
+#endif
+
+#ifndef __section_xdp_entry
+# define __section_xdp_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_cls_entry
+# define __section_cls_entry						\
+	__section(ELF_SECTION_CLASSIFIER)
+#endif
+
+#ifndef __section_act_entry
+# define __section_act_entry						\
+	__section(ELF_SECTION_ACTION)
+#endif
+
+#ifndef __section_lwt_entry
+# define __section_lwt_entry						\
+	__section(ELF_SECTION_PROG)
+#endif
+
+#ifndef __section_license
+# define __section_license						\
+	__section(ELF_SECTION_LICENSE)
+#endif
+
+#ifndef __section_maps
+# define __section_maps							\
+	__section(ELF_SECTION_MAPS)
+#endif
+
+/** Declaration helper macros. */
+
+#ifndef BPF_LICENSE
+# define BPF_LICENSE(NAME)						\
+	char ____license[] __section_license = NAME
+#endif
+
+/** Classifier helper */
+
+#ifndef BPF_H_DEFAULT
+# define BPF_H_DEFAULT	-1
+#endif
+
+/** BPF helper functions for tc. Individual flags are in linux/bpf.h */
+
+#ifndef __BPF_FUNC
+# define __BPF_FUNC(NAME, ...)						\
+	(* NAME)(__VA_ARGS__) __maybe_unused
+#endif
+
+#ifndef BPF_FUNC
+# define BPF_FUNC(NAME, ...)						\
+	__BPF_FUNC(NAME, __VA_ARGS__) = (void *) BPF_FUNC_##NAME
+#endif
+
+/* Map access/manipulation */
+static void *BPF_FUNC(map_lookup_elem, void *map, const void *key);
+static int BPF_FUNC(map_update_elem, void *map, const void *key,
+		    const void *value, uint32_t flags);
+static int BPF_FUNC(map_delete_elem, void *map, const void *key);
+
+/* Time access */
+static uint64_t BPF_FUNC(ktime_get_ns);
+
+/* Debugging */
+
+/* FIXME: __attribute__ ((format(printf, 1, 3))) not possible unless
+ * llvm bug https://llvm.org/bugs/show_bug.cgi?id=26243 gets resolved.
+ * It would require ____fmt to be made const, which generates a reloc
+ * entry (non-map).
+ */
+static void BPF_FUNC(trace_printk, const char *fmt, int fmt_size, ...);
+
+#ifndef printt
+# define printt(fmt, ...)						\
+	({								\
+		char ____fmt[] = fmt;					\
+		trace_printk(____fmt, sizeof(____fmt), ##__VA_ARGS__);	\
+	})
+#endif
+
+/* Random numbers */
+static uint32_t BPF_FUNC(get_prandom_u32);
+
+/* Tail calls */
+static void BPF_FUNC(tail_call, struct __sk_buff *skb, void *map,
+		     uint32_t index);
+
+/* System helpers */
+static uint32_t BPF_FUNC(get_smp_processor_id);
+static uint32_t BPF_FUNC(get_numa_node_id);
+
+/* Packet misc meta data */
+static uint32_t BPF_FUNC(get_cgroup_classid, struct __sk_buff *skb);
+static int BPF_FUNC(skb_under_cgroup, void *map, uint32_t index);
+
+static uint32_t BPF_FUNC(get_route_realm, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(get_hash_recalc, struct __sk_buff *skb);
+static uint32_t BPF_FUNC(set_hash_invalid, struct __sk_buff *skb);
+
+/* Packet redirection */
+static int BPF_FUNC(redirect, int ifindex, uint32_t flags);
+static int BPF_FUNC(clone_redirect, struct __sk_buff *skb, int ifindex,
+		    uint32_t flags);
+
+/* Packet manipulation */
+static int BPF_FUNC(skb_load_bytes, struct __sk_buff *skb, uint32_t off,
+		    void *to, uint32_t len);
+static int BPF_FUNC(skb_store_bytes, struct __sk_buff *skb, uint32_t off,
+		    const void *from, uint32_t len, uint32_t flags);
+
+static int BPF_FUNC(l3_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(l4_csum_replace, struct __sk_buff *skb, uint32_t off,
+		    uint32_t from, uint32_t to, uint32_t flags);
+static int BPF_FUNC(csum_diff, const void *from, uint32_t from_size,
+		    const void *to, uint32_t to_size, uint32_t seed);
+static int BPF_FUNC(csum_update, struct __sk_buff *skb, uint32_t wsum);
+
+static int BPF_FUNC(skb_change_type, struct __sk_buff *skb, uint32_t type);
+static int BPF_FUNC(skb_change_proto, struct __sk_buff *skb, uint32_t proto,
+		    uint32_t flags);
+static int BPF_FUNC(skb_change_tail, struct __sk_buff *skb, uint32_t nlen,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_pull_data, struct __sk_buff *skb, uint32_t len);
+
+/* Event notification */
+static int __BPF_FUNC(skb_event_output, struct __sk_buff *skb, void *map,
+		      uint64_t index, const void *data, uint32_t size) =
+		      (void *) BPF_FUNC_perf_event_output;
+
+/* Packet vlan encap/decap */
+static int BPF_FUNC(skb_vlan_push, struct __sk_buff *skb, uint16_t proto,
+		    uint16_t vlan_tci);
+static int BPF_FUNC(skb_vlan_pop, struct __sk_buff *skb);
+
+/* Packet tunnel encap/decap */
+static int BPF_FUNC(skb_get_tunnel_key, struct __sk_buff *skb,
+		    struct bpf_tunnel_key *to, uint32_t size, uint32_t flags);
+static int BPF_FUNC(skb_set_tunnel_key, struct __sk_buff *skb,
+		    const struct bpf_tunnel_key *from, uint32_t size,
+		    uint32_t flags);
+
+static int BPF_FUNC(skb_get_tunnel_opt, struct __sk_buff *skb,
+		    void *to, uint32_t size);
+static int BPF_FUNC(skb_set_tunnel_opt, struct __sk_buff *skb,
+		    const void *from, uint32_t size);
+
+/** LLVM built-ins, mem*() routines work for constant size */
+
+#ifndef lock_xadd
+# define lock_xadd(ptr, val)	((void) __sync_fetch_and_add(ptr, val))
+#endif
+
+#ifndef memset
+# define memset(s, c, n)	__builtin_memset((s), (c), (n))
+#endif
+
+#ifndef memcpy
+# define memcpy(d, s, n)	__builtin_memcpy((d), (s), (n))
+#endif
+
+#ifndef memmove
+# define memmove(d, s, n)	__builtin_memmove((d), (s), (n))
+#endif
+
+/* FIXME: __builtin_memcmp() is not yet fully useable unless llvm bug
+ * https://llvm.org/bugs/show_bug.cgi?id=26218 gets resolved. Also
+ * this one would generate a reloc entry (non-map), otherwise.
+ */
+#if 0
+#ifndef memcmp
+# define memcmp(a, b, n)	__builtin_memcmp((a), (b), (n))
+#endif
+#endif
+
+unsigned long long load_byte(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.byte");
+
+unsigned long long load_half(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.half");
+
+unsigned long long load_word(void *skb, unsigned long long off)
+	asm ("llvm.bpf.load.word");
+
+#endif /* __BPF_API__ */
diff --git a/drivers/net/tap/bpf/bpf_elf.h b/drivers/net/tap/bpf/bpf_elf.h
new file mode 100644
index 0000000000..ea8a11c95c
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_elf.h
@@ -0,0 +1,53 @@
+/* SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause */
+#ifndef __BPF_ELF__
+#define __BPF_ELF__
+
+#include <asm/types.h>
+
+/* Note:
+ *
+ * Below ELF section names and bpf_elf_map structure definition
+ * are not (!) kernel ABI. It's rather a "contract" between the
+ * application and the BPF loader in tc. For compatibility, the
+ * section names should stay as-is. Introduction of aliases, if
+ * needed, are a possibility, though.
+ */
+
+/* ELF section names, etc */
+#define ELF_SECTION_LICENSE	"license"
+#define ELF_SECTION_MAPS	"maps"
+#define ELF_SECTION_PROG	"prog"
+#define ELF_SECTION_CLASSIFIER	"classifier"
+#define ELF_SECTION_ACTION	"action"
+
+#define ELF_MAX_MAPS		64
+#define ELF_MAX_LICENSE_LEN	128
+
+/* Object pinning settings */
+#define PIN_NONE		0
+#define PIN_OBJECT_NS		1
+#define PIN_GLOBAL_NS		2
+
+/* ELF map definition */
+struct bpf_elf_map {
+	__u32 type;
+	__u32 size_key;
+	__u32 size_value;
+	__u32 max_elem;
+	__u32 flags;
+	__u32 id;
+	__u32 pinning;
+	__u32 inner_id;
+	__u32 inner_idx;
+};
+
+#define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val)		\
+	struct ____btf_map_##name {				\
+		type_key key;					\
+		type_val value;					\
+	};							\
+	struct ____btf_map_##name				\
+	    __attribute__ ((section(".maps." #name), used))	\
+	    ____btf_map_##name = { }
+
+#endif /* __BPF_ELF__ */
diff --git a/drivers/net/tap/bpf/bpf_extract.py b/drivers/net/tap/bpf/bpf_extract.py
new file mode 100644
index 0000000000..d79fc61020
--- /dev/null
+++ b/drivers/net/tap/bpf/bpf_extract.py
@@ -0,0 +1,80 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2023 Stephen Hemminger <stephen@networkplumber.org>
+
+import argparse
+import sys
+import struct
+from tempfile import TemporaryFile
+from elftools.elf.elffile import ELFFile
+
+
+def load_sections(elffile):
+    result = []
+    DATA = [("cls_q", "cls_q_insns"), ("l3_l4", "l3_l4_hash_insns")]
+    for name, tag in DATA:
+        section = elffile.get_section_by_name(name)
+        if section:
+            insns = struct.iter_unpack('<BBhL', section.data())
+            result.append([tag, insns])
+    return result
+
+
+def dump_sections(sections, out):
+    for name, insns in sections:
+        print(f'\nstatic const struct bpf_insn {name} = {{', file=out)
+        for bpf in insns:
+            code = bpf[0]
+            src = bpf[1] >> 4
+            dst = bpf[1] & 0xf
+            off = bpf[2]
+            imm = bpf[3]
+            print('\t{{{:#02x}, {:4d}, {:4d}, {:8d}, {:#010x}}},'.format(
+                code, dst, src, off, imm),
+                  file=out)
+        print('};', file=out)
+
+
+def parse_args():
+    parser = argparse.ArgumentParser()
+    parser.add_argument("input",
+                        nargs='+',
+                        help="input object file path or '-' for stdin")
+    parser.add_argument("output", help="output C file path or '-' for stdout")
+    return parser.parse_args()
+
+
+def open_input(path):
+    if path == "-":
+        temp = TemporaryFile()
+        temp.write(sys.stdin.buffer.read())
+        return temp
+    return open(path, "rb")
+
+
+def open_output(path):
+    if path == "-":
+        return sys.stdout
+    return open(path, "w")
+
+
+def write_header(output):
+    print("/* SPDX-License-Identifier: BSD-3-Clause", file=output)
+    print(" * Compiled BPF instructions do not edit", file=output)
+    print(" */\n", file=output)
+    print("#include <tap_bpf.h>", file=output)
+
+
+def main():
+    args = parse_args()
+
+    output = open_output(args.output)
+    write_header(output)
+    for path in args.input:
+        elffile = ELFFile(open_input(path))
+        sections = load_sections(elffile)
+        dump_sections(sections, output)
+
+
+if __name__ == "__main__":
+    main()
diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/bpf/tap_bpf_program.c
similarity index 97%
rename from drivers/net/tap/tap_bpf_program.c
rename to drivers/net/tap/bpf/tap_bpf_program.c
index 20c310e5e7..ff6f1606fb 100644
--- a/drivers/net/tap/tap_bpf_program.c
+++ b/drivers/net/tap/bpf/tap_bpf_program.c
@@ -14,9 +14,10 @@
 #include <linux/ipv6.h>
 #include <linux/if_tunnel.h>
 #include <linux/filter.h>
-#include <linux/bpf.h>
 
-#include "tap_rss.h"
+#include "bpf_api.h"
+#include "bpf_elf.h"
+#include "../tap_rss.h"
 
 /** Create IPv4 address */
 #define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \
@@ -75,14 +76,14 @@ struct ipv4_l3_l4_tuple {
 	__u32    dst_addr;
 	__u16    dport;
 	__u16    sport;
-} __rte_packed;
+} __attribute__((packed));
 
 struct ipv6_l3_l4_tuple {
 	__u8        src_addr[16];
 	__u8        dst_addr[16];
 	__u16       dport;
 	__u16       sport;
-} __rte_packed;
+} __attribute__((packed));
 
 static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
 	0xd1, 0x81, 0xc6, 0x2c,
diff --git a/drivers/net/tap/tap_rss.h b/drivers/net/tap/tap_rss.h
index 48c151cf6b..dff46a012f 100644
--- a/drivers/net/tap/tap_rss.h
+++ b/drivers/net/tap/tap_rss.h
@@ -35,6 +35,6 @@ struct rss_key {
 	__u32 key_size;
 	__u32 queues[TAP_MAX_QUEUES];
 	__u32 nb_queues;
-} __rte_packed;
+} __attribute__((packed));
 
 #endif /* _TAP_RSS_H_ */
-- 
2.41.0


^ permalink raw reply	[relevance 4%]

* Re: [PATCH RESEND v6 0/5] app/testpmd: support multiple process attach and detach port
  2023-10-09 10:34  0%   ` lihuisong (C)
@ 2023-10-30 12:17  0%     ` lihuisong (C)
  0 siblings, 0 replies; 200+ results
From: lihuisong (C) @ 2023-10-30 12:17 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, andrew.rybchenko, fengchengwen,
	liudongdong3, liuyonglong

Hi Ferruh and Thomas,

This series have been discussing more than one year.
Kindly ping for reivew.


在 2023/10/9 18:34, lihuisong (C) 写道:
> Hi Ferruh and Thomas,
>
> Can you take a look at this series? They've been over a year on 
> disscussion.
>
>
> 在 2023/8/2 11:15, Huisong Li 写道:
>> This patchset fix some bugs and support attaching and detaching port
>> in primary and secondary.
>>
>> ---
>>   -v6: adjust rte_eth_dev_is_used position based on alphabetical order
>>        in version.map
>>   -v5: move 'ALLOCATED' state to the back of 'REMOVED' to avoid abi 
>> break.
>>   -v4: fix a misspelling.
>>   -v3:
>>     #1 merge patch 1/6 and patch 2/6 into patch 1/5, and add 
>> modification
>>        for other bus type.
>>     #2 add a RTE_ETH_DEV_ALLOCATED state in rte_eth_dev_state to resolve
>>        the probelm in patch 2/5.
>>   -v2: resend due to CI unexplained failure.
>>
>> Huisong Li (5):
>>    drivers/bus: restore driver assignment at front of probing
>>    ethdev: fix skip valid port in probing callback
>>    app/testpmd: check the validity of the port
>>    app/testpmd: add attach and detach port for multiple process
>>    app/testpmd: stop forwarding in new or destroy event
>>
>>   app/test-pmd/testpmd.c                   | 47 +++++++++++++++---------
>>   app/test-pmd/testpmd.h                   |  1 -
>>   drivers/bus/auxiliary/auxiliary_common.c |  9 ++++-
>>   drivers/bus/dpaa/dpaa_bus.c              |  9 ++++-
>>   drivers/bus/fslmc/fslmc_bus.c            |  8 +++-
>>   drivers/bus/ifpga/ifpga_bus.c            | 12 ++++--
>>   drivers/bus/pci/pci_common.c             |  9 ++++-
>>   drivers/bus/vdev/vdev.c                  | 10 ++++-
>>   drivers/bus/vmbus/vmbus_common.c         |  9 ++++-
>>   drivers/net/bnxt/bnxt_ethdev.c           |  3 +-
>>   drivers/net/bonding/bonding_testpmd.c    |  1 -
>>   drivers/net/mlx5/mlx5.c                  |  2 +-
>>   lib/ethdev/ethdev_driver.c               | 13 +++++--
>>   lib/ethdev/ethdev_driver.h               | 12 ++++++
>>   lib/ethdev/ethdev_pci.h                  |  2 +-
>>   lib/ethdev/rte_class_eth.c               |  2 +-
>>   lib/ethdev/rte_ethdev.c                  |  4 +-
>>   lib/ethdev/rte_ethdev.h                  |  4 +-
>>   lib/ethdev/version.map                   |  1 +
>>   19 files changed, 114 insertions(+), 44 deletions(-)
>>
>
> .

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
                       ` (3 preceding siblings ...)
  2023-10-25  1:22  0%   ` Jie Hai
@ 2023-10-28  9:50  0%   ` Jie Hai
  2023-11-08  2:55  0%   ` lihuisong (C)
  5 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-10-28  9:50 UTC (permalink / raw)
  To: Thomas Monjalon, David Marchand; +Cc: dev, liudongdong3

Hi, all maintainers,

Is there any other problem with this patchset?
Please let me know if there is any, thank you.

Thanks,
Jie Hai

On 2023/7/4 17:04, Jie Hai wrote:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
> 
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
> 
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
> 
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
> 
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
> 
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
> 
> v6->v7:
> 1. Remove prod/consumer head/tail info.
> 
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
> 
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm
  2023-10-28  1:46  4%             ` [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-10-28  3:01  3%               ` lihuisong (C)
  2023-11-01 12:55  5%                 ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: lihuisong (C) @ 2023-10-28  3:01 UTC (permalink / raw)
  To: Jie Hai, dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: fengchengwen, liudongdong3

With belows to changes,
Acked-by: Huisong Li <lihuisong@huawei.com>


在 2023/10/28 9:46, Jie Hai 写道:
> Currently, rte_eth_rss_conf supports configuring and querying
> RSS hash functions, rss key and it's length, but not RSS hash
> algorithm.
>
> The structure ``rte_eth_dev_info`` is extended by adding a new
> field "rss_algo_capa". Drivers are responsible for reporting this
> capa and configurations of RSS hash algorithm can be verified based
> on the capability. The default value of "rss_algo_capa" is
> RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.
>
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "algorithm". This represents the RSS algorithms to apply.
> If the value of "algorithm" used for configuration is a gibberish
> value, drivers should report the error.
>
> To check whether the drivers report valid "algorithm", it is set
> to default value before querying in rte_eth_dev_rss_hash_conf_get().
>
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
>   doc/guides/rel_notes/release_23_11.rst |  5 ++++
>   lib/ethdev/rte_ethdev.c                | 26 ++++++++++++++++++++
>   lib/ethdev/rte_ethdev.h                | 33 +++++++++++++++++++++++++-
>   lib/ethdev/rte_flow.c                  |  1 -
>   lib/ethdev/rte_flow.h                  | 26 ++------------------
>   5 files changed, 65 insertions(+), 26 deletions(-)
>
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index 0a6fc76a9d02..a35d729d2cc7 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -360,6 +360,11 @@ ABI Changes
>   * security: struct ``rte_security_ipsec_sa_options`` was updated
>     due to inline out-of-place feature addition.
>   
> +* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
> +* reporting RSS hash algorithm capability.
> +
> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
> +  hash algorithm.
>   
>   Known Issues
>   ------------
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 9dabcb5ae28e..90bfbf14d1f7 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -1269,6 +1269,7 @@ int
>   rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		      const struct rte_eth_conf *dev_conf)
>   {
> +	enum rte_eth_hash_function algorithm;
>   	struct rte_eth_dev *dev;
>   	struct rte_eth_dev_info dev_info;
>   	struct rte_eth_conf orig_conf;
> @@ -1500,6 +1501,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
>   
> +	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
> +	if ((dev_info.rss_algo_capa &
> +	     RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
need to check the algorithm.
its value should be in range of 0 to 31.
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
> +			"with rss_algo_capa: %x\n",
It seems that this log is not friendly to user.
Configured RSS hash algorithm (%u) is not in the algorithm capability ().
Anything ok like that.

%x --> 0x%" PRIx32 "
> +			port_id, algorithm,
> +			dev_info.rss_algo_capa);
> +		ret = -EINVAL;
> +		goto rollback;
> +	}
> +
>   	/*
>   	 * Setup new number of Rx/Tx queues and reconfigure device.
>   	 */
> @@ -3757,6 +3770,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
>   	dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
>   		RTE_ETHER_CRC_LEN;
>   	dev_info->max_mtu = UINT16_MAX;
> +	dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
>   
>   	if (*dev->dev_ops->dev_infos_get == NULL)
>   		return -ENOTSUP;
> @@ -4698,6 +4712,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
>   		return -ENOTSUP;
>   	}
>   
> +	if ((dev_info.rss_algo_capa &
> +	     RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
> +			"with rss_algo_capa: %x\n",
> +			port_id, rss_conf->algorithm,
> +			dev_info.rss_algo_capa);
> +		return -EINVAL;
> +	}
> +
>   	if (*dev->dev_ops->rss_hash_update == NULL)
>   		return -ENOTSUP;
>   	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
> @@ -4725,6 +4749,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>   		return -EINVAL;
>   	}
>   
> +	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
> +
>   	if (*dev->dev_ops->rss_hash_conf_get == NULL)
>   		return -ENOTSUP;
>   	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 37fd5afef48a..2f639edd8218 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
>   	uint64_t ids[64];
>   };
>   
> +/**
> + * Hash function types.
> + */
> +enum rte_eth_hash_function {
> +	/** DEFAULT means driver decides which hash algorithm to pick. */
> +	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
> +	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
> +	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
> +	/**
> +	 * Symmetric Toeplitz: src, dst will be replaced by
> +	 * xor(src, dst). For the case with src/dst only,
> +	 * src or dst address will xor with zero pair.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> +	/**
> +	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> +	 * the hash function.
> +	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> +	 *  If src_port > dst_port, swap src_port and dst_port.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> +	RTE_ETH_HASH_FUNCTION_MAX,
> +};
> +
> +#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
> +#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
> +
>   /**
>    * A structure used to configure the Receive Side Scaling (RSS) feature
>    * of an Ethernet port.
> @@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
>   	 * which RSS hashing is to be applied.
>   	 */
>   	uint64_t rss_hf;
> +	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
>   };
>   
>   /*
> @@ -1783,7 +1811,10 @@ struct rte_eth_dev_info {
>   	/** Supported error handling mode. */
>   	enum rte_eth_err_handle_mode err_handle_mode;
>   
> -	uint64_t reserved_64s[2]; /**< Reserved for future fields */
> +	/** RSS hash algorithms capabilities */
> +	uint32_t rss_algo_capa;
Please move this new field to "hash_key_size" and 
"flow_type_rss_offloads" in this struct.
Because this version allows ABI break.
> +
> +	uint32_t reserved_32s[3]; /**< Reserved for future fields */
>   	void *reserved_ptrs[2];   /**< Reserved for future fields */
>   };
>   
> diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
> index 3a67f1aaba9d..c13a2a391c37 100644
> --- a/lib/ethdev/rte_flow.c
> +++ b/lib/ethdev/rte_flow.c
> @@ -13,7 +13,6 @@
>   #include <rte_branch_prediction.h>
>   #include <rte_string_fns.h>
>   #include <rte_mbuf_dyn.h>
> -#include "rte_ethdev.h"
>   #include "rte_flow_driver.h"
>   #include "rte_flow.h"
>   
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 25f1dffd1f30..c94f553ae06f 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -40,6 +40,8 @@
>   #include <rte_macsec.h>
>   #include <rte_ib.h>
>   
> +#include "rte_ethdev.h"
> +
>   #ifdef __cplusplus
>   extern "C" {
>   #endif
> @@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
>   	uint64_t bytes; /**< Number of bytes through this rule [out]. */
>   };
>   
> -/**
> - * Hash function types.
> - */
> -enum rte_eth_hash_function {
> -	/** DEFAULT means driver decides which hash algorithm to pick. */
> -	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
> -	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
> -	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
> -	/**
> -	 * Symmetric Toeplitz: src, dst will be replaced by
> -	 * xor(src, dst). For the case with src/dst only,
> -	 * src or dst address will xor with zero pair.
> -	 */
> -	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> -	/**
> -	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
> -	 * the hash function.
> -	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
> -	 *  If src_port > dst_port, swap src_port and dst_port.
> -	 */
> -	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
> -	RTE_ETH_HASH_FUNCTION_MAX,
> -};
> -
>   /**
>    * RTE_FLOW_ACTION_TYPE_RSS
>    *

^ permalink raw reply	[relevance 3%]

* [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm
  2023-10-28  1:46  3%           ` [PATCH v7 0/9] support setting and querying RSS algorithms Jie Hai
@ 2023-10-28  1:46  4%             ` Jie Hai
  2023-10-28  3:01  3%               ` lihuisong (C)
  2023-11-01  2:04  0%             ` [PATCH v7 0/9] support setting and querying RSS algorithms Ferruh Yigit
  1 sibling, 1 reply; 200+ results
From: Jie Hai @ 2023-10-28  1:46 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3, haijie1

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_dev_info`` is extended by adding a new
field "rss_algo_capa". Drivers are responsible for reporting this
capa and configurations of RSS hash algorithm can be verified based
on the capability. The default value of "rss_algo_capa" is
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "algorithm". This represents the RSS algorithms to apply.
If the value of "algorithm" used for configuration is a gibberish
value, drivers should report the error.

To check whether the drivers report valid "algorithm", it is set
to default value before querying in rte_eth_dev_rss_hash_conf_get().

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  5 ++++
 lib/ethdev/rte_ethdev.c                | 26 ++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 33 +++++++++++++++++++++++++-
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 26 ++------------------
 5 files changed, 65 insertions(+), 26 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 0a6fc76a9d02..a35d729d2cc7 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -360,6 +360,11 @@ ABI Changes
 * security: struct ``rte_security_ipsec_sa_options`` was updated
   due to inline out-of-place feature addition.
 
+* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
+* reporting RSS hash algorithm capability.
+
+* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
+  hash algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9dabcb5ae28e..90bfbf14d1f7 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1269,6 +1269,7 @@ int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
 {
+	enum rte_eth_hash_function algorithm;
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf orig_conf;
@@ -1500,6 +1501,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
+	if ((dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
+			"with rss_algo_capa: %x\n",
+			port_id, algorithm,
+			dev_info.rss_algo_capa);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of Rx/Tx queues and reconfigure device.
 	 */
@@ -3757,6 +3770,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
 		RTE_ETHER_CRC_LEN;
 	dev_info->max_mtu = UINT16_MAX;
+	dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
 
 	if (*dev->dev_ops->dev_infos_get == NULL)
 		return -ENOTSUP;
@@ -4698,6 +4712,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if ((dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
+			"with rss_algo_capa: %x\n",
+			port_id, rss_conf->algorithm,
+			dev_info.rss_algo_capa);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4725,6 +4749,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 37fd5afef48a..2f639edd8218 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
 	 * which RSS hashing is to be applied.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
@@ -1783,7 +1811,10 @@ struct rte_eth_dev_info {
 	/** Supported error handling mode. */
 	enum rte_eth_err_handle_mode err_handle_mode;
 
-	uint64_t reserved_64s[2]; /**< Reserved for future fields */
+	/** RSS hash algorithms capabilities */
+	uint32_t rss_algo_capa;
+
+	uint32_t reserved_32s[3]; /**< Reserved for future fields */
 	void *reserved_ptrs[2];   /**< Reserved for future fields */
 };
 
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 3a67f1aaba9d..c13a2a391c37 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 25f1dffd1f30..c94f553ae06f 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/** DEFAULT means driver decides which hash algorithm to pick. */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* [PATCH v7 0/9] support setting and querying RSS algorithms
  2023-10-27  9:28  3%         ` [PATCH 0/9] " Jie Hai
  2023-10-27  9:28  4%           ` [PATCH 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-10-28  1:46  3%           ` Jie Hai
  2023-10-28  1:46  4%             ` [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-11-01  2:04  0%             ` [PATCH v7 0/9] support setting and querying RSS algorithms Ferruh Yigit
  1 sibling, 2 replies; 200+ results
From: Jie Hai @ 2023-10-28  1:46 UTC (permalink / raw)
  To: dev; +Cc: lihuisong, fengchengwen, liudongdong3, haijie1

This patchset is to support setting and querying RSS algorithms.
For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
and field "algorithm" is added to ``rte_eth_rss_conf``.
The drivers should reports their "rss_algo_capa" if they support
updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
by field "algorithm" and the related API should verify "algorithm" with
"rss_algo_capa".

--
v7:
1. fix compile error.
2. add signed-off-by to patch[4/9].
v6:
1. rewrite some comments.
2. add "rss_algo_capa" for `rte_eth_dev_info``.
3. add new API to get name of RSS algorithms

v5:
1. rewrite some comments.
2. check RSS algorithm for drivers supporting RSS.
3. change field "func" of rss_conf to "algorithm".
4. fix commit log for [PATCH v4 4/7].
5. add Acked-by Reshma Pattan.
6. add symmetric_toeplitz_sort for showing.
7. change "hf" to "hash function" for showing.

v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.

Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (8):
  ethdev: overwrite some comment related to RSS
  ethdev: support setting and querying RSS algorithm
  net/hns3: report RSS hash algorithms capability
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  lib/ethdev: add API to get RSS algorithm names
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                   | 24 +++++----
 app/test-pmd/cmdline.c                 | 29 +++++++++--
 app/test-pmd/config.c                  | 29 ++++-------
 app/test-pmd/testpmd.h                 |  2 +-
 doc/guides/rel_notes/release_23_11.rst |  8 +++
 drivers/net/hns3/hns3_common.c         |  4 ++
 drivers/net/hns3/hns3_rss.c            | 47 +++++++++--------
 lib/ethdev/rte_ethdev.c                | 51 +++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 70 ++++++++++++++++++++------
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 25 +--------
 11 files changed, 196 insertions(+), 94 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* [PATCH 0/9] support setting and querying RSS algorithms
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
                           ` (3 preceding siblings ...)
  @ 2023-10-27  9:28  3%         ` Jie Hai
  2023-10-27  9:28  4%           ` [PATCH 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-10-28  1:46  3%           ` [PATCH v7 0/9] support setting and querying RSS algorithms Jie Hai
  4 siblings, 2 replies; 200+ results
From: Jie Hai @ 2023-10-27  9:28 UTC (permalink / raw)
  To: dev; +Cc: lihuisong, fengchengwen, liudongdong3

This patchset is to support setting and querying RSS algorithms.
For this purpose, field "rss_algo_capa" is added to ``rte_eth_dev_info``
and field "algorithm" is added to ``rte_eth_rss_conf``.
The drivers should reports their "rss_algo_capa" if they support
updating RSS algorithms. Otherwise, the "rss_algo_capa" is set to
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT). The app configures RSS algorithms
by field "algorithm" and the related API should verify "algorithm" with
"rss_algo_capa".

--
v6:
1. rewrite some comments.
2. add "rss_algo_capa" for `rte_eth_dev_info``.
3. add new API to get name of RSS algorithms

v5:
1. rewrite some comments.
2. check RSS algorithm for drivers supporting RSS.
3. change field "func" of rss_conf to "algorithm".
4. fix commit log for [PATCH v4 4/7].
5. add Acked-by Reshma Pattan.
6. add symmetric_toeplitz_sort for showing.
7. change "hf" to "hash function" for showing.

v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.


Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (8):
  ethdev: overwrite some comment related to RSS
  ethdev: support setting and querying RSS algorithm
  net/hns3: report RSS hash algorithms capability
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  lib/ethdev: add API to get RSS algorithm names
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                   | 24 +++++----
 app/test-pmd/cmdline.c                 | 29 +++++++++--
 app/test-pmd/config.c                  | 29 ++++-------
 app/test-pmd/testpmd.h                 |  2 +-
 doc/guides/rel_notes/release_23_11.rst |  8 +++
 drivers/net/hns3/hns3_common.c         |  4 ++
 drivers/net/hns3/hns3_rss.c            | 47 +++++++++--------
 lib/ethdev/rte_ethdev.c                | 51 +++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 70 ++++++++++++++++++++------
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 25 +--------
 11 files changed, 196 insertions(+), 94 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* [PATCH 2/9] ethdev: support setting and querying RSS algorithm
  2023-10-27  9:28  3%         ` [PATCH 0/9] " Jie Hai
@ 2023-10-27  9:28  4%           ` Jie Hai
  2023-10-28  1:46  3%           ` [PATCH v7 0/9] support setting and querying RSS algorithms Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-10-27  9:28 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_dev_info`` is extended by adding a new
field "rss_algo_capa". Drivers are responsible for reporting this
capa and configurations of RSS hash algorithm can be verified based
on the capability. The default value of "rss_algo_capa" is
RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT) if drivers do not report it.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "algorithm". This represents the RSS algorithms to apply.
If the value of "algorithm" used for configuration is a gibberish
value, drivers should report the error.

To check whether the drivers report valid "algorithm", it is set
to default value before querying in rte_eth_dev_rss_hash_conf_get().

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  5 ++++
 lib/ethdev/rte_ethdev.c                | 26 ++++++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 33 +++++++++++++++++++++++++-
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 26 ++------------------
 5 files changed, 65 insertions(+), 26 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 0a6fc76a9d02..a35d729d2cc7 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -360,6 +360,11 @@ ABI Changes
 * security: struct ``rte_security_ipsec_sa_options`` was updated
   due to inline out-of-place feature addition.
 
+* ethdev: Added "rss_algo_capa" field to ``rte_eth_dev_info`` structure for
+* reporting RSS hash algorithm capability.
+
+* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
+  hash algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9dabcb5ae28e..7af163b8a4b3 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1269,6 +1269,7 @@ int
 rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		      const struct rte_eth_conf *dev_conf)
 {
+	enum rte_eth_hash_function algorithm;
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
 	struct rte_eth_conf orig_conf;
@@ -1500,6 +1501,18 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	algorithm = dev_conf->rx_adv_conf.rss_conf.algorithm;
+	if ((dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
+			"with rss_algo_capa: 0x%"PRIx64"\n",
+			algorithm,
+			dev_info.rss_algo_capa);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of Rx/Tx queues and reconfigure device.
 	 */
@@ -3757,6 +3770,7 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->min_mtu = RTE_ETHER_MIN_LEN - RTE_ETHER_HDR_LEN -
 		RTE_ETHER_CRC_LEN;
 	dev_info->max_mtu = UINT16_MAX;
+	dev_info->rss_algo_capa = RTE_ETH_HASH_ALGO_CAPA_MASK(DEFAULT);
 
 	if (*dev->dev_ops->dev_infos_get == NULL)
 		return -ENOTSUP;
@@ -4698,6 +4712,16 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if ((dev_info.rss_algo_capa &
+	     RTE_ETH_HASH_ALGO_TO_CAPA(rss_conf->algorithm)) == 0) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config unsupported RSS hash algorithm: %u "
+			"with rss_algo_capa: 0x%"PRIx64"\n",
+			rss_conf->algorithm,
+			dev_info.rss_algo_capa);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4725,6 +4749,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 37fd5afef48a..2f639edd8218 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,33 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/** DEFAULT means driver decides which hash algorithm to pick. */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
+#define RTE_ETH_HASH_ALGO_TO_CAPA(x) RTE_BIT32(x)
+#define RTE_ETH_HASH_ALGO_CAPA_MASK(x) RTE_BIT32(RTE_ETH_HASH_FUNCTION_ ## x)
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -469,6 +496,7 @@ struct rte_eth_rss_conf {
 	 * which RSS hashing is to be applied.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
@@ -1783,7 +1811,10 @@ struct rte_eth_dev_info {
 	/** Supported error handling mode. */
 	enum rte_eth_err_handle_mode err_handle_mode;
 
-	uint64_t reserved_64s[2]; /**< Reserved for future fields */
+	/** RSS hash algorithms capabilities */
+	uint32_t rss_algo_capa;
+
+	uint32_t reserved_32s[3]; /**< Reserved for future fields */
 	void *reserved_ptrs[2];   /**< Reserved for future fields */
 };
 
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 3a67f1aaba9d..c13a2a391c37 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 25f1dffd1f30..c94f553ae06f 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3222,30 +3224,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/** DEFAULT means driver decides which hash algorithm to pick. */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* RE: release candidate 23.11-rc1
       [not found]     ` <MW4PR11MB5912D298978501DAC2092EA49FD4A@MW4PR11MB5912.namprd11.prod.outlook.com>
@ 2023-10-27  9:19  0%   ` Xu, HailinX
  0 siblings, 0 replies; 200+ results
From: Xu, HailinX @ 2023-10-27  9:19 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: Kovacevic, Marko, Mcnamara, John, Richardson, Bruce, Ferruh Yigit

[-- Attachment #1: Type: text/plain, Size: 7574 bytes --]

> -----Original Message-----

> From: Xu, HailinX

> Sent: Thursday, October 19, 2023 3:58 PM

> To: Thomas Monjalon <thomas@monjalon.net>; announce@dpdk.org

> Cc: Kovacevic, Marko <Marko.Kovacevic@intel.com>; Mcnamara, John

> <john.mcnamara@intel.com>; Richardson, Bruce

> <bruce.richardson@intel.com>; Ferruh Yigit <ferruh.yigit@xilinx.com>

> Subject: RE: release candidate 23.11-rc1

>

> > -----Original Message-----

> > From: Thomas Monjalon <thomas@monjalon.net<mailto:thomas@monjalon.net>>

> > Sent: Wednesday, October 18, 2023 4:37 AM

> > To: announce@dpdk.org<mailto:announce@dpdk.org>

> > Subject: release candidate 23.11-rc1

> >

> > A new DPDK release candidate is ready for testing:

> >         https://git.dpdk.org/dpdk/tag/?id=v23.11-rc1

> >

> > There are 617 new patches in this snapshot, including many API/ABI

> > compatibility breakages.

> > This release won't be ABI-compatible with previous ones.

> >

> > Release notes:

> >         https://doc.dpdk.org/guides/rel_notes/release_23_11.html

> >

> > Highlights of 23.11-rc1:

> >         - build requires C11 compiler

> >         - early support of MSVC build

> >         - new atomic operations API

> >         - power management on AMD CPU

> >         - mbuf recycling

> >         - flow action type for P4-defined actions

> >         - flow group miss action

> >         - flow item for packet type matching

> >         - TLS record offload

> >         - security Rx inject

> >         - eventdev link profiles

> >         - eventdev adapter for dmadev

> >         - event dispatcher library

> >

> > Please test and report issues on bugs.dpdk.org.

> >

> > DPDK 23.11-rc2 is expected in approximately two weeks.

> >

> > Thank you everyone

> >

> Update the test status for Intel part. Till now dpdk23.11-rc1 test execution rate

> is 30%. No new issue is found.

>

> # Basic Intel(R) NIC testing

> * Build or compile:

>  *Build: cover the build test combination with latest GCC/Clang version and

> the popular OS revision such as Ubuntu20.04.5, Ubuntu22.04.3, Fedora38,

> RHEL8.7/9.2, Centos7.9, OpenAnolis8.8, CBL-Mariner2.0 etc.

>   - All test passed.

>  *Compile: cover the CFLAGES(O0/O1/O2/O3) with popular OS such as

> Ubuntu22.04.3 and RHEL9.2.

>   - All test passed with latest dpdk.

> * Meson test & Asan test:

>     known issue:

>            - https://bugs.dpdk.org/show_bug.cgi?id=1107 [22.11-rc1][meson

> test] seqlock_autotest test failed

>            - https://bugs.dpdk.org/show_bug.cgi?id=1123 [dpdk-22.11][asan]

> the stack-buffer-overflow was found when quit testpmd in Redhat9

> * PF/VF(i40e, ixgbe): test scenarios including PF/VF-

> RTE_FLOW/TSO/Jumboframe/checksum offload/VLAN/VXLAN, etc.

>            - Execution rate is 50%. No new issue is found.

> * PF/VF(ice): test scenarios including Switch features/Package

> Management/Flow Director/Advanced Tx/Advanced RSS/ACL/DCF/Flexible

> Descriptor, etc.

>            - Execution rate is 30%. No new issue is found.

> * Intel NIC single core/NIC performance: test scenarios including PF/VF single

> core performance test, RFC2544 Zero packet loss performance test, etc.

>            - Execution rate is 20%. No new issue is found.

> * Power and IPsec:

>  * Power: test scenarios including bi-direction/Telemetry/Empty Poll

> Lib/Priority Base Frequency, etc.

>            - on going. No new issue is found.

>  * IPsec: test scenarios including ipsec/ipsec-gw/ipsec library basic test -

> QAT&SW/FIB library, etc.

>            - On going. No new issue is found.

> # Basic cryptodev and virtio testing

> * Virtio: both function and performance test are covered. Such as

> PVP/Virtio_loopback/virtio-user loopback/virtio-net VM2VM perf

> testing/VMAWARE ESXI 8.0 U1, etc.

>            - Execution rate is 50%. No new issue is found.

> * Cryptodev:

>  *Function test: test scenarios including Cryptodev API testing/CompressDev

> ISA-L/QAT/ZLIB PMD Testing/FIPS, etc.

>            - On going. No new issue is found.

>  *Performance test: test scenarios including Throughput Performance

> /Cryptodev Latency, etc.

>            - On going. No performance drop.

>

> Regards,

> Xu, Hailin

Update the test status for Intel part. dpdk23.11-rc1 all test execution is done. found 8 new issues.



New issues:

1. kernelpf_dcf/dcf_information: port stats cannot be reset in dcf. -> Intel dev is under investigating

2. Fix Tx offloading flags check. -> Has fix patch

3. core dumped occurred when exit testpmd with representor port. -> Has fix patch

4. core dumped occurred after test csum fwd. -> Has fix patch

5. https://bugs.dpdk.org/show_bug.cgi?id=1303 hotplug_mp/attach_detach_dev_primary_cross_loop: re-attach dev failed in multiple processes. -> Has fix patch

6. vm2vm_virtio_user_dsa/test_split_non_mergeable_multi_queues_payload_check_with_kernel_driver: virtio-user1 not receive packet. -> Intel dev is under investigating

7. [mev] Core dumped when starting testpmd with representor port. -> Has fix patch

8. https://bugs.dpdk.org/show_bug.cgi?id=1304: l3fwd-power example fails to run with uncore options, -U -u and -i. -> has fix patch



# Basic Intel(R) NIC testing

* Build or compile:

 *Build: cover the build test combination with latest GCC/Clang version and the popular OS revision such as Ubuntu20.04.5, Ubuntu22.04.3, Fedora38, RHEL8.7/9.2, Centos7.9, OpenAnolis8.8, CBL-Mariner2.0 etc.

              - All test passed.

*Compile: cover the CFLAGES(O0/O1/O2/O3) with popular OS such as Ubuntu22.04.2 and RHEL9.0.

              - All test passed with latest dpdk.

* PF/VF(i40e, ixgbe): test scenarios including PF/VF-RTE_FLOW/TSO/Jumboframe/checksum offload/VLAN/VXLAN, etc.

- Execution rate is done. No new issue is found.

* PF/VF(ice): test scenarios including Switch features/Package Management/Flow Director/Advanced Tx/Advanced RSS/ACL/DCF/Flexible Descriptor, etc.

              - Execution rate is done. found 1&3&4&5 issues.

* MEV test: test scenarios including PF/TSO/MTU/Jumboframe/checksum offload, etc

              - Execution rate is done. found 7 issue.

* Intel NIC single core/NIC performance: test scenarios including PF/VF single core performance test, RFC2544 Zero packet loss performance test, etc.

             - Execution rate is done. No new issue is found.

* Power and IPsec:

 * Power: test scenarios including bi-direction/Telemetry/Empty Poll Lib/Priority Base Frequency, etc.

              - Execution rate is done. found 8 issue.

* IPsec: test scenarios including ipsec/ipsec-gw/ipsec library basic test - QAT&SW/FIB library, etc.

              - Execution rate is done. found 2 issue.

# Basic cryptodev and virtio testing

* Virtio: both function and performance test are covered. Such as PVP/Virtio_loopback/virtio-user loopback/virtio-net VM2VM perf testing/VMAWARE ESXI 8.0, etc.

              - Execution rate is done. found 6 issue.

* Cryptodev:

 *Function test: test scenarios including Cryptodev API testing/CompressDev ISA-L/QAT/ZLIB PMD Testing/FIPS, etc.

              - Execution rate is done. No new issue is found.

*Performance test: test scenarios including Throughput Performance /Cryptodev Latency, etc.

              - Execution rate is done. No performance drop.





Regards,

Xu, Hailin

[-- Attachment #2: Type: text/html, Size: 17835 bytes --]

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 00/40] support setting and querying RSS algorithms
  2023-10-24 12:57  3%             ` lihuisong (C)
@ 2023-10-26  8:53  0%               ` Thomas Monjalon
  0 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-10-26  8:53 UTC (permalink / raw)
  To: Ferruh Yigit, Jie Hai, lihuisong (C)
  Cc: dev, fengchengwen, liudongdong3, stephen

24/10/2023 14:57, lihuisong (C):
> 在 2023/10/17 22:26, Ferruh Yigit 写道:
> > On 10/17/2023 3:06 PM, Thomas Monjalon wrote:
> >> 11/10/2023 11:27, Jie Hai:
> >>>   55 files changed, 395 insertions(+), 106 deletions(-)
> >> 
> >> Changing all drivers is suspicious.
> >> It shows that something is missing in ethdev.
> >> Please can you add the checks in ethdev only?
> >>
> > That is kind of request from me, let me try to summarize what is going on,
> >
> > there is a new config item added to "struct rte_eth_rss_conf" introduced
> > in this set, which is RSS hashing algorithm to use.
> >
> > Problem is none of the existing drivers are taking account this new
> > config item, so application will request it but drivers silently ignore it.
> >
> > This is a generic problem when adding a new config item to existing
> > config struct.
> >
> > So my request was if drivers not supporting it, and it is requested by
> > the application, driver should return an error to let application know
> > that it is not supported, that is why bunch of drivers updated.
> >
> >
> > One option can be adding a new, specific API and dev_ops for this, for
> > this case new config item is related to the existing RSS API, so I think
> > it can be part of the existing API.
> >
> > Other can be to have some kind of capability reporting by drivers, and
> > application will detect it and won't request this new config item, I
> > think Stephen already suggested something like this. This capability
> > flag is again a generic requirement, and `rte_eth_dev_info_get()`
> > partially used for this purpose. I think it will be odd from application
> > perspective to have a capability for just one config item of a feature set.
> >
> >
> > Anyway, I think updating drivers to report they are not supporting new
> > config item is best option to me, but also I think we should discuss
> > this capability reporting in ethdev in a wider context.
> IMO, it is more better to report RSS algorithm capability.
> It can avoid the later ABI break successfully as Stephen said.

Yes we should add a capability for RSS algorithm.





^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
                       ` (2 preceding siblings ...)
  2023-10-10  2:25  0%   ` Jie Hai
@ 2023-10-25  1:22  0%   ` Jie Hai
  2023-10-28  9:50  0%   ` Jie Hai
  2023-11-08  2:55  0%   ` lihuisong (C)
  5 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-10-25  1:22 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, liudongdong3


Hi, Thomas,

Kindly ping for review.

Thanks,
Jie Hai
On 2023/7/4 17:04, Jie Hai wrote:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
> 
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
> 
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
> 
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
> 
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
> 
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
> 
> v6->v7:
> 1. Remove prod/consumer head/tail info.
> 
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
> 
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 00/40] support setting and querying RSS algorithms
  @ 2023-10-24 12:57  3%             ` lihuisong (C)
  2023-10-26  8:53  0%               ` Thomas Monjalon
  0 siblings, 1 reply; 200+ results
From: lihuisong (C) @ 2023-10-24 12:57 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon, Jie Hai
  Cc: dev, fengchengwen, liudongdong3, stephen


在 2023/10/17 22:26, Ferruh Yigit 写道:
> On 10/17/2023 3:06 PM, Thomas Monjalon wrote:
>> Hello,
>>
>> 11/10/2023 11:27, Jie Hai:
>>>   app/proc-info/main.c                   | 32 ++++++++++-----
>>>   app/test-pmd/cmdline.c                 | 29 ++++++++++---
>>>   app/test-pmd/config.c                  | 38 ++++++++---------
>>>   app/test-pmd/testpmd.h                 |  2 +-
>>>   doc/guides/rel_notes/release_23_11.rst |  2 +
>>>   drivers/net/atlantic/atl_ethdev.c      |  2 +
>>>   drivers/net/axgbe/axgbe_ethdev.c       |  9 +++++
>>>   drivers/net/bnx2x/bnx2x_ethdev.c       |  4 ++
>>>   drivers/net/bnxt/bnxt_ethdev.c         |  6 +++
>>>   drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++
>>>   drivers/net/cnxk/cnxk_ethdev.c         |  5 +++
>>>   drivers/net/cnxk/cnxk_ethdev_ops.c     |  3 ++
>>>   drivers/net/cpfl/cpfl_ethdev.c         |  6 +++
>>>   drivers/net/cxgbe/cxgbe_ethdev.c       |  9 ++++-
>>>   drivers/net/dpaa/dpaa_ethdev.c         |  7 ++++
>>>   drivers/net/dpaa2/dpaa2_ethdev.c       |  7 ++++
>>>   drivers/net/ena/ena_rss.c              |  3 ++
>>>   drivers/net/enic/enic_ethdev.c         |  1 +
>>>   drivers/net/enic/enic_main.c           |  3 ++
>>>   drivers/net/fm10k/fm10k_ethdev.c       |  9 ++++-
>>>   drivers/net/hinic/hinic_pmd_ethdev.c   |  3 ++
>>>   drivers/net/hinic/hinic_pmd_rx.c       |  3 ++
>>>   drivers/net/hns3/hns3_rss.c            | 47 ++++++++++++---------
>>>   drivers/net/i40e/i40e_ethdev.c         |  7 ++++
>>>   drivers/net/iavf/iavf_ethdev.c         |  6 +++
>>>   drivers/net/ice/ice_dcf.c              |  3 ++
>>>   drivers/net/ice/ice_dcf_ethdev.c       |  3 ++
>>>   drivers/net/ice/ice_ethdev.c           |  7 ++++
>>>   drivers/net/idpf/idpf_ethdev.c         |  6 +++
>>>   drivers/net/igc/igc_ethdev.c           |  4 ++
>>>   drivers/net/igc/igc_txrx.c             |  5 +++
>>>   drivers/net/ionic/ionic_ethdev.c       |  6 +++
>>>   drivers/net/ixgbe/ixgbe_ethdev.c       | 12 +++++-
>>>   drivers/net/ixgbe/ixgbe_rxtx.c         |  4 ++
>>>   drivers/net/mana/mana.c                | 11 ++++-
>>>   drivers/net/mlx5/mlx5_ethdev.c         |  4 ++
>>>   drivers/net/mlx5/mlx5_rss.c            |  3 +-
>>>   drivers/net/mvpp2/mrvl_ethdev.c        |  3 ++
>>>   drivers/net/netvsc/hn_ethdev.c         |  6 +++
>>>   drivers/net/nfp/nfp_common.c           |  9 ++++-
>>>   drivers/net/ngbe/ngbe_ethdev.c         |  6 ++-
>>>   drivers/net/ngbe/ngbe_rxtx.c           |  3 ++
>>>   drivers/net/null/rte_eth_null.c        |  8 ++++
>>>   drivers/net/qede/qede_ethdev.c         |  9 ++++-
>>>   drivers/net/sfc/sfc_ethdev.c           |  3 ++
>>>   drivers/net/sfc/sfc_rx.c               |  3 ++
>>>   drivers/net/tap/rte_eth_tap.c          |  8 ++++
>>>   drivers/net/thunderx/nicvf_ethdev.c    | 10 ++++-
>>>   drivers/net/txgbe/txgbe_ethdev.c       |  7 +++-
>>>   drivers/net/txgbe/txgbe_ethdev_vf.c    |  7 +++-
>>>   drivers/net/txgbe/txgbe_rxtx.c         |  3 ++
>>>   lib/ethdev/rte_ethdev.c                | 17 ++++++++
>>>   lib/ethdev/rte_ethdev.h                | 56 +++++++++++++++++++-------
>>>   lib/ethdev/rte_flow.c                  |  1 -
>>>   lib/ethdev/rte_flow.h                  | 25 +-----------
>>>   55 files changed, 395 insertions(+), 106 deletions(-)
>> Changing all drivers is suspicious.
>> It shows that something is missing in ethdev.
>> Please can you add the checks in ethdev only?
>>
> That is kind of request from me, let me try to summarize what is going on,
>
> there is a new config item added to "struct rte_eth_rss_conf" introduced
> in this set, which is RSS hashing algorithm to use.
>
> Problem is none of the existing drivers are taking account this new
> config item, so application will request it but drivers silently ignore it.
>
> This is a generic problem when adding a new config item to existing
> config struct.
>
> So my request was if drivers not supporting it, and it is requested by
> the application, driver should return an error to let application know
> that it is not supported, that is why bunch of drivers updated.
>
>
> One option can be adding a new, specific API and dev_ops for this, for
> this case new config item is related to the existing RSS API, so I think
> it can be part of the existing API.
>
> Other can be to have some kind of capability reporting by drivers, and
> application will detect it and won't request this new config item, I
> think Stephen already suggested something like this. This capability
> flag is again a generic requirement, and `rte_eth_dev_info_get()`
> partially used for this purpose. I think it will be odd from application
> perspective to have a capability for just one config item of a feature set.
>
>
> Anyway, I think updating drivers to report they are not supporting new
> config item is best option to me, but also I think we should discuss
> this capability reporting in ethdev in a wider context.
IMO, it is more better to report RSS algorithm capability.
It can avoid the later ABI break successfully as Stephen said.
>
>
>
> .

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm
  2023-10-12  2:21  0%             ` fengchengwen
  2023-10-12 15:23  0%               ` Stephen Hemminger
@ 2023-10-24 12:54  0%               ` Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-10-24 12:54 UTC (permalink / raw)
  To: fengchengwen, Stephen Hemminger
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam,
	lihuisong, liudongdong3

On 2023/10/12 10:21, fengchengwen wrote:
> 
> 
> On 2023/10/12 1:39, Stephen Hemminger wrote:
>> On Wed, 11 Oct 2023 17:27:27 +0800
>> Jie Hai <haijie1@huawei.com> wrote:
>>
>>> Currently, rte_eth_rss_conf supports configuring and querying
>>> RSS hash functions, rss key and it's length, but not RSS hash
>>> algorithm.
>>>
>>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>>> field "algorithm". This represents the RSS algorithms to apply.
>>> The following API will be affected:
>>> 	- rte_eth_dev_configure
>>> 	- rte_eth_dev_rss_hash_update
>>> 	- rte_eth_dev_rss_hash_conf_get
>>>
>>> If the value of "algorithm" used for configuration is a gibberish
>>> value, report the error and return. Do the same for
>>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
>>>
>>> To check whether the drivers report valid "algorithm", it is set
>>> to default value before querying.
>>>
>>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>>> ---
>>>   doc/guides/rel_notes/release_23_11.rst |  2 ++
>>>   lib/ethdev/rte_ethdev.c                | 17 ++++++++++++++++
>>>   lib/ethdev/rte_ethdev.h                | 27 +++++++++++++++++++++++++
>>>   lib/ethdev/rte_flow.c                  |  1 -
>>>   lib/ethdev/rte_flow.h                  | 28 ++------------------------
>>>   5 files changed, 48 insertions(+), 27 deletions(-)
>>>
>>> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
>>> index e13d57728071..92a445ab2ed3 100644
>>> --- a/doc/guides/rel_notes/release_23_11.rst
>>> +++ b/doc/guides/rel_notes/release_23_11.rst
>>> @@ -197,6 +197,8 @@ ABI Changes
>>>     fields, to move ``rxq`` and ``txq`` fields, to change the size of
>>>     ``reserved1`` and ``reserved2`` fields.
>>>   
>>> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
>>> +  hash algorithm.
>>>   
>>>   Known Issues
>>>   ------------
>>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>>> index 18a4b950b184..2eda1b8072e5 100644
>>> --- a/lib/ethdev/rte_ethdev.c
>>> +++ b/lib/ethdev/rte_ethdev.c
>>> @@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>>>   		goto rollback;
>>>   	}
>>>   
>>> +	if (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {
>>> +		RTE_ETHDEV_LOG(ERR,
>>> +			"Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n",
>>> +			port_id, dev_conf->rx_adv_conf.rss_conf.algorithm);
>>> +		ret = -EINVAL;
>>> +		goto rollback;
>>> +	}
>>> +
>>
>> Rather than having every driver check the algorithm, why not handle this like
>> other features in DPDK (which may mean API/ABI changes).
>>
>> Add a field rss_algo_capa which is bit field of available RSS functions.
>> Then the check for algorithm can be done in generic code. There a couple
>> of reserved fields that could be used.
> 
> +1 for add a field
> 
> But there are two ways to config rss: ethdev-ops, ethdev-rteflow-ops, should distinguish them ? or just define for ethdev-ops ?
> 
The rte_flow API does not distinguish RSS rule and FDIR rule,
the actual implementation of rss configuration depends on drivers.
I think if we had this "rss_algo_capa ", it can be just for ethdev-ops 
for ethdev API level use.
>>
>> It would mean updating all the drivers once with the capa field but
>> would provide way for application to know what fields are possible.
>>
>> It has proved to be a problem in later ABI changes if a maximum value
>> is exposed. I.e don't expose RTE_ETH_HASH_FUNCTION_MAX.
> 
> +1
> 
>>
>> .
>>
> .

^ permalink raw reply	[relevance 0%]

* Re: [PATCH 00/20] remove experimental flag from some API's
                     ` (5 preceding siblings ...)
  2023-10-24  2:53  3% ` [PATCH v7 00/25] Promote 22.11 and older " Stephen Hemminger
@ 2023-10-24  7:20  0% ` Maxime Coquelin
  6 siblings, 0 replies; 200+ results
From: Maxime Coquelin @ 2023-10-24  7:20 UTC (permalink / raw)
  To: Stephen Hemminger, dev



On 8/8/23 19:35, Stephen Hemminger wrote:
> Since 23.11 is an LTS release it is time to remove the experimental
> bandaid off many API's. There are about 850 API's marked with experimental
> on current main branch. This addresses the easy to remove ones and
> gets it down to about 690 places.
> 
> The rule is any API that has been in since 22.11 needs to have
> experimental removed (or deleted). The experimental flag is not a
> "get out of ABI stability for free" card.
> 
> Stephen Hemminger (20):
>    bpf: make rte_bpf_dump and rte_bpf_convert stable API's
>    cmdline: make experimental API's stable
>    ethdev: mark rte_mtr API's as stable
>    ethdev: mark rte_tm API's as stable
>    pdump: make API's stable
>    pcapng: mark API's as stable
>    net: remove experimental from functions
>    rcu: remove experimental from rte_rcu_qbsr
>    lpm: remove experimental
>    mbuf: remove experimental from create_extbuf
>    hash: remove experimental from toeplitz hash
>    timer: remove experimental from rte_timer_next_ticks
>    sched: remove experimental
>    dmadev: mark API's as not experimental
>    meter: remove experimental warning from comments
>    power: remove experimental from API's
>    kvargs: remove experimental flag
>    ip_frag: mark a couple of functions stable
>    member: remove experimental tag
>    security: remove experimental flag
> 
>   lib/bpf/rte_bpf.h                   |  2 -
>   lib/bpf/version.map                 |  9 +--
>   lib/cmdline/cmdline.h               |  1 -
>   lib/cmdline/cmdline_parse.h         |  4 --
>   lib/cmdline/cmdline_rdline.h        |  4 --
>   lib/cmdline/version.map             | 26 +++------
>   lib/dmadev/rte_dmadev.h             | 85 ----------------------------
>   lib/dmadev/version.map              |  2 +-
>   lib/ethdev/rte_mtr.h                | 25 +-------
>   lib/ethdev/rte_tm.h                 | 34 -----------
>   lib/ethdev/version.map              | 88 ++++++++++++++---------------
>   lib/hash/rte_thash.h                | 44 ---------------
>   lib/hash/rte_thash_gfni.h           |  8 ---
>   lib/hash/rte_thash_x86_gfni.h       |  8 ---
>   lib/hash/version.map                | 16 ++----
>   lib/ip_frag/rte_ip_frag.h           |  2 -
>   lib/ip_frag/version.map             |  9 +--
>   lib/kvargs/rte_kvargs.h             |  4 --
>   lib/kvargs/version.map              |  8 +--
>   lib/lpm/rte_lpm.h                   |  4 --
>   lib/lpm/version.map                 |  7 +--
>   lib/mbuf/rte_mbuf.h                 |  1 -
>   lib/mbuf/version.map                |  8 +--
>   lib/member/rte_member.h             | 54 ------------------
>   lib/member/version.map              | 12 +---
>   lib/meter/rte_meter.h               | 12 ----
>   lib/net/rte_ip.h                    | 19 -------
>   lib/pcapng/rte_pcapng.h             | 11 ----
>   lib/pcapng/version.map              |  6 +-
>   lib/pdump/rte_pdump.h               | 12 ----
>   lib/pdump/version.map               | 11 +---
>   lib/power/rte_power.h               |  4 --
>   lib/power/rte_power_guest_channel.h |  4 --
>   lib/power/rte_power_intel_uncore.h  |  9 ---
>   lib/power/rte_power_pmd_mgmt.h      | 40 -------------
>   lib/power/version.map               | 33 ++++-------
>   lib/rcu/rte_rcu_qsbr.h              | 20 -------
>   lib/rcu/version.map                 | 15 ++---
>   lib/sched/rte_pie.h                 |  8 ---
>   lib/sched/rte_sched.h               |  5 --
>   lib/sched/version.map               | 18 ++----
>   lib/security/rte_security.h         | 35 ------------
>   lib/security/version.map            | 17 ++----
>   lib/timer/rte_timer.h               |  4 --
>   lib/timer/version.map               |  7 +--
>   45 files changed, 97 insertions(+), 658 deletions(-)
> 

You removed Vhost changes altogether, but I only asked for the Vhost
Async API changes to be removed, i.e. the APIs in rte_vhost_async.h.

Maxime


^ permalink raw reply	[relevance 0%]

* [PATCH v7 22/25] compressdev: remove experimental flag
  2023-10-24  2:53  3% ` [PATCH v7 00/25] Promote 22.11 and older " Stephen Hemminger
@ 2023-10-24  2:54  2%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-24  2:54 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Bruce Richardson, Thomas Monjalon, Fan Zhang,
	Ashish Gupta

The compressdev was added back in 2018.
Remove the experimental flag and make ABI stable.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
---
 MAINTAINERS                           |  2 +-
 lib/compressdev/rte_comp.h            |  6 ------
 lib/compressdev/rte_compressdev.h     | 26 --------------------------
 lib/compressdev/rte_compressdev_pmd.h |  6 ------
 lib/compressdev/version.map           |  2 +-
 5 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2f1ab5a0f328..789507ddccb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -459,7 +459,7 @@ F: lib/security/
 F: doc/guides/prog_guide/rte_security.rst
 F: app/test/test_security*
 
-Compression API - EXPERIMENTAL
+Compression API
 M: Fan Zhang <fanzhang.oss@gmail.com>
 M: Ashish Gupta <ashish.gupta@marvell.com>
 T: git://dpdk.org/next/dpdk-next-crypto
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index bf896d07223c..232564cf5e9a 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -499,7 +499,6 @@ struct rte_comp_op {
  *  - On success pointer to mempool
  *  - On failure NULL
  */
-__rte_experimental
 struct rte_mempool *
 rte_comp_op_pool_create(const char *name,
 		unsigned int nb_elts, unsigned int cache_size,
@@ -515,7 +514,6 @@ rte_comp_op_pool_create(const char *name,
  * - On success returns a valid rte_comp_op structure
  * - On failure returns NULL
  */
-__rte_experimental
 struct rte_comp_op *
 rte_comp_op_alloc(struct rte_mempool *mempool);
 
@@ -532,7 +530,6 @@ rte_comp_op_alloc(struct rte_mempool *mempool);
  *   - nb_ops: Success, the nb_ops requested was allocated
  *   - 0: Not enough entries in the mempool; no ops are retrieved.
  */
-__rte_experimental
 int
 rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -546,7 +543,6 @@ rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
  *   Compress operation pointer allocated from rte_comp_op_alloc()
  *   If op is NULL, no operation is performed.
  */
-__rte_experimental
 void
 rte_comp_op_free(struct rte_comp_op *op);
 
@@ -561,7 +557,6 @@ rte_comp_op_free(struct rte_comp_op *op);
  * @param nb_ops
  *   Number of operations to free
  */
-__rte_experimental
 void
 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
 
@@ -574,7 +569,6 @@ rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_comp_get_feature_name(uint64_t flag);
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 13a418631893..8cb5db0e3f7d 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -10,10 +10,6 @@
  *
  * RTE Compression Device APIs.
  *
- * @warning
- * @b EXPERIMENTAL:
- * All functions in this file may be changed or removed without prior notice.
- *
  * Defines comp device APIs for the provisioning of compression operations.
  */
 
@@ -54,7 +50,6 @@ struct rte_compressdev_capabilities {
 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
 	{ RTE_COMP_ALGO_UNSPECIFIED }
 
-__rte_experimental
 const struct rte_compressdev_capabilities *
 rte_compressdev_capability_get(uint8_t dev_id,
 			enum rte_comp_algorithm algo);
@@ -94,7 +89,6 @@ rte_compressdev_capability_get(uint8_t dev_id,
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_compressdev_get_feature_name(uint64_t flag);
 
@@ -133,7 +127,6 @@ struct rte_compressdev_stats {
  *   - Returns compress device identifier on success.
  *   - Return -1 on failure to find named compress device.
  */
-__rte_experimental
 int
 rte_compressdev_get_dev_id(const char *name);
 
@@ -146,7 +139,6 @@ rte_compressdev_get_dev_id(const char *name);
  *   - Returns compress device name.
  *   - Returns NULL if compress device is not present.
  */
-__rte_experimental
 const char *
 rte_compressdev_name_get(uint8_t dev_id);
 
@@ -157,7 +149,6 @@ rte_compressdev_name_get(uint8_t dev_id);
  * @return
  *   - The total number of usable compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_count(void);
 
@@ -175,7 +166,6 @@ rte_compressdev_count(void);
  * @return
  *   Returns number of attached compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
 		uint8_t nb_devices);
@@ -190,7 +180,6 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
  *   a default of zero if the socket could not be determined.
  *   -1 if returned is the dev_id value is out of range.
  */
-__rte_experimental
 int
 rte_compressdev_socket_id(uint8_t dev_id);
 
@@ -221,7 +210,6 @@ struct rte_compressdev_config {
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
-__rte_experimental
 int
 rte_compressdev_configure(uint8_t dev_id,
 			struct rte_compressdev_config *config);
@@ -240,7 +228,6 @@ rte_compressdev_configure(uint8_t dev_id,
  *   - 0: Success, device started.
  *   - <0: Error code of the driver device start function.
  */
-__rte_experimental
 int
 rte_compressdev_start(uint8_t dev_id);
 
@@ -251,7 +238,6 @@ rte_compressdev_start(uint8_t dev_id);
  * @param dev_id
  *   Compress device identifier
  */
-__rte_experimental
 void
 rte_compressdev_stop(uint8_t dev_id);
 
@@ -269,7 +255,6 @@ rte_compressdev_stop(uint8_t dev_id);
  *  - 0 on successfully closing device
  *  - <0 on failure to close device
  */
-__rte_experimental
 int
 rte_compressdev_close(uint8_t dev_id);
 
@@ -296,7 +281,6 @@ rte_compressdev_close(uint8_t dev_id);
  *   - 0: Success, queue pair correctly set up.
  *   - <0: Queue pair configuration failed
  */
-__rte_experimental
 int
 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 		uint32_t max_inflight_ops, int socket_id);
@@ -309,7 +293,6 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
  * @return
  *   - The number of configured queue pairs.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_queue_pair_count(uint8_t dev_id);
 
@@ -327,7 +310,6 @@ rte_compressdev_queue_pair_count(uint8_t dev_id);
  *   - Zero if successful.
  *   - Non-zero otherwise.
  */
-__rte_experimental
 int
 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
 
@@ -337,7 +319,6 @@ rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
  * @param dev_id
  *   The identifier of the device.
  */
-__rte_experimental
 void
 rte_compressdev_stats_reset(uint8_t dev_id);
 
@@ -355,7 +336,6 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * The element after the last valid element has it's op field set to
  * RTE_COMP_ALGO_UNSPECIFIED.
  */
-__rte_experimental
 void
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
 
@@ -413,7 +393,6 @@ rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
  *   of pointers to *rte_comp_op* structures effectively supplied to the
  *   *ops* array.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -468,7 +447,6 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
  *   comp devices queue is full or if invalid parameters are specified in
  *   a *rte_comp_op*.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -496,7 +474,6 @@ rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private stream could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_stream_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -518,7 +495,6 @@ rte_compressdev_stream_create(uint8_t dev_id,
  *  - Returns -ENOTSUP if comp device does not support STATEFUL operations.
  *  - Returns -EBUSY if can't free stream as there are inflight operations
  */
-__rte_experimental
 int
 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
 
@@ -545,7 +521,6 @@ rte_compressdev_stream_free(uint8_t dev_id, void *stream);
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private_xform could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -567,7 +542,6 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
  *  - <0 in error cases
  *  - Returns -EINVAL if input parameters are invalid.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index ea012908b783..fa233492fe1f 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -59,7 +59,6 @@ struct rte_compressdev_global {
  * @return
  *   - The rte_compressdev structure pointer for the given device identifier.
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_get_named_dev(const char *name);
 
@@ -292,7 +291,6 @@ struct rte_compressdev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_allocate(const char *name, int socket_id);
 
@@ -308,7 +306,6 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
-__rte_experimental
 int
 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
 
@@ -331,7 +328,6 @@ rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_parse_input_args(
 		struct rte_compressdev_pmd_init_params *params,
@@ -353,7 +349,6 @@ rte_compressdev_pmd_parse_input_args(
  *  - comp device instance on success
  *  - NULL on creation failure
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -372,7 +367,6 @@ rte_compressdev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
 
diff --git a/lib/compressdev/version.map b/lib/compressdev/version.map
index e2a108b6509f..fa891f669b5d 100644
--- a/lib/compressdev/version.map
+++ b/lib/compressdev/version.map
@@ -1,4 +1,4 @@
-EXPERIMENTAL {
+DPDK_24 {
 	global:
 
 	rte_compressdev_capability_get;
-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* [PATCH v7 00/25] Promote 22.11 and older API's to stable
                     ` (4 preceding siblings ...)
  2023-10-24  2:39  3% ` [PATCH v6 00/25] Promite many experimental API's to stable Stephen Hemminger
@ 2023-10-24  2:53  3% ` Stephen Hemminger
  2023-10-24  2:54  2%   ` [PATCH v7 22/25] compressdev: remove experimental flag Stephen Hemminger
  2023-10-24  7:20  0% ` [PATCH 00/20] remove experimental flag from some API's Maxime Coquelin
  6 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-24  2:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since 23.11 is an LTS release it is time to remove the experimental
bandaid off many API's. There are about 890 API's marked with experimental
on current main branch. This addresses the easy to remove ones and
gets it down to about 510 places.

The rule is any API that has been in since 22.11 needs to have
experimental removed (or have API deleted). The experimental flag is not a
"get out of ABI stability for free" card

v7 - fix missing rte_experimental dropped in lib/power

v6 - incorporate review comments
     drop regexdev

Stephen Hemminger (25):
  bpf: make rte_bpf_dump and rte_bpf_convert stable API's
  cmdline: make experimental API's stable
  ethdev: mark rte_tm API's as stable
  pdump: make API's stable
  pcapng: mark API's as stable
  net: remove experimental from functions
  rcu: remove experimental from rte_rcu_qbsr
  lpm: remove experimental
  mbuf: remove experimental from create_extbuf
  hash: remove experimental from toeplitz hash
  timer: remove experimental from rte_timer_next_ticks
  sched: remove experimental
  dmadev: mark API's as not experimental
  meter: remove experimental warning from comments
  power: remove experimental from API's
  kvargs: remove experimental flag
  ip_frag: mark a couple of functions stable
  member: remove experimental tag
  security: remove experimental flag
  bbdev: remove experimental tag
  ipsec: remove experimental from SA API
  compressdev: remove experimental flag
  node: remove some of the experimental tags
  eventdev: make many API's stable
  cryptodev: mark older API's stable

 MAINTAINERS                             |  8 +--
 lib/bbdev/rte_bbdev.h                   |  4 --
 lib/bbdev/rte_bbdev_op.h                |  2 -
 lib/bbdev/version.map                   | 15 ++---
 lib/bpf/rte_bpf.h                       |  2 -
 lib/bpf/version.map                     |  9 +--
 lib/cmdline/cmdline.h                   |  1 -
 lib/cmdline/cmdline_parse.h             |  4 --
 lib/cmdline/cmdline_rdline.h            |  4 --
 lib/cmdline/version.map                 | 26 +++-----
 lib/compressdev/rte_comp.h              |  6 --
 lib/compressdev/rte_compressdev.h       | 26 --------
 lib/compressdev/rte_compressdev_pmd.h   |  6 --
 lib/compressdev/version.map             |  2 +-
 lib/cryptodev/rte_cryptodev.h           | 31 ---------
 lib/cryptodev/version.map               | 77 ++++++++++------------
 lib/dmadev/rte_dmadev.h                 | 85 -------------------------
 lib/dmadev/version.map                  |  2 +-
 lib/ethdev/rte_tm.h                     | 34 ----------
 lib/ethdev/version.map                  | 62 +++++++++---------
 lib/eventdev/rte_event_crypto_adapter.h |  4 --
 lib/eventdev/rte_event_eth_rx_adapter.h |  6 --
 lib/eventdev/rte_event_eth_tx_adapter.h |  3 -
 lib/eventdev/rte_event_timer_adapter.h  |  3 -
 lib/eventdev/rte_eventdev.h             |  4 --
 lib/eventdev/version.map                | 34 ++++------
 lib/hash/rte_thash.h                    | 44 -------------
 lib/hash/rte_thash_gfni.h               |  8 ---
 lib/hash/rte_thash_x86_gfni.h           |  8 ---
 lib/hash/version.map                    | 16 ++---
 lib/ip_frag/rte_ip_frag.h               |  2 -
 lib/ip_frag/version.map                 |  9 +--
 lib/ipsec/rte_ipsec.h                   |  2 -
 lib/ipsec/version.map                   |  9 +--
 lib/kvargs/rte_kvargs.h                 |  4 --
 lib/kvargs/version.map                  |  8 +--
 lib/lpm/rte_lpm.h                       |  4 --
 lib/lpm/version.map                     |  7 +-
 lib/mbuf/rte_mbuf.h                     |  1 -
 lib/mbuf/version.map                    |  8 +--
 lib/member/rte_member.h                 | 54 ----------------
 lib/member/version.map                  | 12 +---
 lib/meter/rte_meter.h                   | 12 ----
 lib/net/rte_ip.h                        | 19 ------
 lib/node/rte_node_eth_api.h             |  1 -
 lib/node/rte_node_ip4_api.h             |  2 -
 lib/node/version.map                    | 16 +++--
 lib/pcapng/rte_pcapng.h                 | 11 ----
 lib/pcapng/version.map                  |  6 +-
 lib/pdump/rte_pdump.h                   | 12 ----
 lib/pdump/version.map                   | 11 +---
 lib/power/rte_power.h                   |  4 --
 lib/power/rte_power_guest_channel.h     |  4 --
 lib/power/rte_power_pmd_mgmt.h          | 40 ------------
 lib/power/rte_power_uncore.h            |  2 -
 lib/power/version.map                   | 37 +++++------
 lib/rcu/rte_rcu_qsbr.h                  | 20 ------
 lib/rcu/version.map                     | 15 ++---
 lib/sched/rte_pie.h                     |  8 ---
 lib/sched/rte_sched.h                   |  5 --
 lib/sched/version.map                   | 18 ++----
 lib/security/rte_security.h             | 35 ----------
 lib/security/version.map                | 18 +++---
 lib/timer/rte_timer.h                   |  4 --
 lib/timer/version.map                   |  7 +-
 65 files changed, 161 insertions(+), 802 deletions(-)

-- 
2.39.2


^ permalink raw reply	[relevance 3%]

* [PATCH v6 00/25] Promite many experimental API's to stable
                     ` (3 preceding siblings ...)
  2023-10-20 20:57  3% ` [PATCH v5 00/26] Promote many experimental API's to stable Stephen Hemminger
@ 2023-10-24  2:39  3% ` Stephen Hemminger
  2023-10-24  2:53  3% ` [PATCH v7 00/25] Promote 22.11 and older " Stephen Hemminger
  2023-10-24  7:20  0% ` [PATCH 00/20] remove experimental flag from some API's Maxime Coquelin
  6 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-24  2:39 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since 23.11 is an LTS release it is time to remove the experimental
bandaid off many API's. There are about 890 API's marked with experimental
on current main branch. This addresses the easy to remove ones and
gets it down to about 510 places.

The rule is any API that has been in since 22.11 needs to have
experimental removed (or have API deleted). The experimental flag is not a
"get out of ABI stability for free" card

v6 - incorporate review comments
     drop regexdev

Stephen Hemminger (25):
  bpf: make rte_bpf_dump and rte_bpf_convert stable API's
  cmdline: make experimental API's stable
  ethdev: mark rte_tm API's as stable
  pdump: make API's stable
  pcapng: mark API's as stable
  net: remove experimental from functions
  rcu: remove experimental from rte_rcu_qbsr
  lpm: remove experimental
  mbuf: remove experimental from create_extbuf
  hash: remove experimental from toeplitz hash
  timer: remove experimental from rte_timer_next_ticks
  sched: remove experimental
  dmadev: mark API's as not experimental
  meter: remove experimental warning from comments
  power: remove experimental from API's
  kvargs: remove experimental flag
  ip_frag: mark a couple of functions stable
  member: remove experimental tag
  security: remove experimental flag
  bbdev: remove experimental tag
  ipsec: remove experimental from SA API
  compressdev: remove experimental flag
  node: remove some of the experimental tags
  eventdev: make many API's stable
  cryptodev: mark older API's stable

 MAINTAINERS                             |  8 +--
 lib/bbdev/rte_bbdev.h                   |  4 --
 lib/bbdev/rte_bbdev_op.h                |  2 -
 lib/bbdev/version.map                   | 15 ++---
 lib/bpf/rte_bpf.h                       |  2 -
 lib/bpf/version.map                     |  9 +--
 lib/cmdline/cmdline.h                   |  1 -
 lib/cmdline/cmdline_parse.h             |  4 --
 lib/cmdline/cmdline_rdline.h            |  4 --
 lib/cmdline/version.map                 | 26 +++-----
 lib/compressdev/rte_comp.h              |  6 --
 lib/compressdev/rte_compressdev.h       | 26 --------
 lib/compressdev/rte_compressdev_pmd.h   |  6 --
 lib/compressdev/version.map             |  2 +-
 lib/cryptodev/rte_cryptodev.h           | 31 ---------
 lib/cryptodev/version.map               | 77 ++++++++++------------
 lib/dmadev/rte_dmadev.h                 | 85 -------------------------
 lib/dmadev/version.map                  |  2 +-
 lib/ethdev/rte_tm.h                     | 34 ----------
 lib/ethdev/version.map                  | 62 +++++++++---------
 lib/eventdev/rte_event_crypto_adapter.h |  4 --
 lib/eventdev/rte_event_eth_rx_adapter.h |  6 --
 lib/eventdev/rte_event_eth_tx_adapter.h |  3 -
 lib/eventdev/rte_event_timer_adapter.h  |  3 -
 lib/eventdev/rte_eventdev.h             |  4 --
 lib/eventdev/version.map                | 34 ++++------
 lib/hash/rte_thash.h                    | 44 -------------
 lib/hash/rte_thash_gfni.h               |  8 ---
 lib/hash/rte_thash_x86_gfni.h           |  8 ---
 lib/hash/version.map                    | 16 ++---
 lib/ip_frag/rte_ip_frag.h               |  2 -
 lib/ip_frag/version.map                 |  9 +--
 lib/ipsec/rte_ipsec.h                   |  2 -
 lib/ipsec/version.map                   |  9 +--
 lib/kvargs/rte_kvargs.h                 |  4 --
 lib/kvargs/version.map                  |  8 +--
 lib/lpm/rte_lpm.h                       |  4 --
 lib/lpm/version.map                     |  7 +-
 lib/mbuf/rte_mbuf.h                     |  1 -
 lib/mbuf/version.map                    |  8 +--
 lib/member/rte_member.h                 | 54 ----------------
 lib/member/version.map                  | 12 +---
 lib/meter/rte_meter.h                   | 12 ----
 lib/net/rte_ip.h                        | 19 ------
 lib/node/rte_node_eth_api.h             |  1 -
 lib/node/rte_node_ip4_api.h             |  2 -
 lib/node/version.map                    | 16 +++--
 lib/pcapng/rte_pcapng.h                 | 11 ----
 lib/pcapng/version.map                  |  6 +-
 lib/pdump/rte_pdump.h                   | 12 ----
 lib/pdump/version.map                   | 11 +---
 lib/power/rte_power.h                   |  4 --
 lib/power/rte_power_guest_channel.h     |  4 --
 lib/power/rte_power_pmd_mgmt.h          | 40 ------------
 lib/power/rte_power_uncore.h            |  3 -
 lib/power/version.map                   | 37 +++++------
 lib/rcu/rte_rcu_qsbr.h                  | 20 ------
 lib/rcu/version.map                     | 15 ++---
 lib/sched/rte_pie.h                     |  8 ---
 lib/sched/rte_sched.h                   |  5 --
 lib/sched/version.map                   | 18 ++----
 lib/security/rte_security.h             | 35 ----------
 lib/security/version.map                | 18 +++---
 lib/timer/rte_timer.h                   |  4 --
 lib/timer/version.map                   |  7 +-
 65 files changed, 161 insertions(+), 803 deletions(-)

-- 
2.39.2


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 22/26] compressdev: remove experimental flag
  2023-10-20 20:57  2%   ` [PATCH v5 22/26] compressdev: remove experimental flag Stephen Hemminger
@ 2023-10-23  9:12  0%     ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-10-23  9:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Thomas Monjalon, Fan Zhang, Ashish Gupta

On Fri, Oct 20, 2023 at 01:57:55PM -0700, Stephen Hemminger wrote:
> The compressdev can not hide under the experimental flag.
> Remove the experimental flag and require ABI to be stable.
>

Not sure about the wording of the commit log. Better to just point out that
compressdev was added back in 2018, and, as such, should now be a stable
API.
 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v8 0/3] Split logging functionality out of EAL
  @ 2023-10-23  7:37  0%     ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2023-10-23  7:37 UTC (permalink / raw)
  To: Bruce Richardson, Thomas Monjalon; +Cc: dev, Morten Brørup

On Fri, Aug 11, 2023 at 2:46 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Aug 9, 2023 at 3:36 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > There is a general desire to reduce the size and scope of EAL. To this
> > end, this patchset makes a (very) small step in that direction by taking
> > the logging functionality out of EAL and putting it into its own library
> > that can be built and maintained separately.
> >
> > As with the first RFC for this, the main obstacle is the "fnmatch"
> > function which is needed by both EAL and the new log function when
> > building on windows. While the function cannot stay in EAL - or we would
> > have a circular dependency, moving it to a new library or just putting
> > it in the log library have the disadvantages that it then "leaks" into
> > the public namespace without an rte_prefix, which could cause issues.
> > Since only a single function is involved, subsequent versions take a
> > different approach to v1, and just moves the offending function to be a
> > static function in a header file. This allows use by multiple libs
> > without conflicting names or making it public.
> >
> > The other complication, as explained in v1 RFC was that of multiple
> > implementations for different OS's. This is solved here in the same
> > way as v1, by including the OS in the name and having meson pick the
> > correct file for each build. Since only one file is involved, there
> > seemed little need for replicating EAL's separate subdirectories
> > per-OS.
>
> Series applied, thanks Bruce for this first step.
>
> As mentionned during the maintainers weekly call yesterday, this is
> only a first "easy" step but, thinking of next steps, more splitting
> may not be that easy.
>
> At least, on the libabigail topic, as we need the ABI check to handle
> libraries splits, a new feature has been cooked in (not yet released)
> 2.4 libabigail.
> https://sourceware.org/git/?p=libabigail.git;a=commitdiff;h=0b338dfaf690993e123b6433201b3a8b8204d662
> Hopefully, we will have a libabigail release available by the time we
> start the v24.03 release (and re-enable ABI checks).

For the record, libabigail 2.4 got released last Friday.
I had already prepared a patch to use this new feature, I can send it
when needed.


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* [PATCH v5 22/26] compressdev: remove experimental flag
  2023-10-20 20:57  3% ` [PATCH v5 00/26] Promote many experimental API's to stable Stephen Hemminger
@ 2023-10-20 20:57  2%   ` Stephen Hemminger
  2023-10-23  9:12  0%     ` Bruce Richardson
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-20 20:57 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Fan Zhang, Ashish Gupta

The compressdev can not hide under the experimental flag.
Remove the experimental flag and require ABI to be stable.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 MAINTAINERS                           |  2 +-
 lib/compressdev/rte_comp.h            |  6 ------
 lib/compressdev/rte_compressdev.h     | 26 --------------------------
 lib/compressdev/rte_compressdev_pmd.h |  6 ------
 lib/compressdev/version.map           |  2 +-
 5 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2f1ab5a0f328..789507ddccb7 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -459,7 +459,7 @@ F: lib/security/
 F: doc/guides/prog_guide/rte_security.rst
 F: app/test/test_security*
 
-Compression API - EXPERIMENTAL
+Compression API
 M: Fan Zhang <fanzhang.oss@gmail.com>
 M: Ashish Gupta <ashish.gupta@marvell.com>
 T: git://dpdk.org/next/dpdk-next-crypto
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index bf896d07223c..232564cf5e9a 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -499,7 +499,6 @@ struct rte_comp_op {
  *  - On success pointer to mempool
  *  - On failure NULL
  */
-__rte_experimental
 struct rte_mempool *
 rte_comp_op_pool_create(const char *name,
 		unsigned int nb_elts, unsigned int cache_size,
@@ -515,7 +514,6 @@ rte_comp_op_pool_create(const char *name,
  * - On success returns a valid rte_comp_op structure
  * - On failure returns NULL
  */
-__rte_experimental
 struct rte_comp_op *
 rte_comp_op_alloc(struct rte_mempool *mempool);
 
@@ -532,7 +530,6 @@ rte_comp_op_alloc(struct rte_mempool *mempool);
  *   - nb_ops: Success, the nb_ops requested was allocated
  *   - 0: Not enough entries in the mempool; no ops are retrieved.
  */
-__rte_experimental
 int
 rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -546,7 +543,6 @@ rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
  *   Compress operation pointer allocated from rte_comp_op_alloc()
  *   If op is NULL, no operation is performed.
  */
-__rte_experimental
 void
 rte_comp_op_free(struct rte_comp_op *op);
 
@@ -561,7 +557,6 @@ rte_comp_op_free(struct rte_comp_op *op);
  * @param nb_ops
  *   Number of operations to free
  */
-__rte_experimental
 void
 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
 
@@ -574,7 +569,6 @@ rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_comp_get_feature_name(uint64_t flag);
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 13a418631893..8cb5db0e3f7d 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -10,10 +10,6 @@
  *
  * RTE Compression Device APIs.
  *
- * @warning
- * @b EXPERIMENTAL:
- * All functions in this file may be changed or removed without prior notice.
- *
  * Defines comp device APIs for the provisioning of compression operations.
  */
 
@@ -54,7 +50,6 @@ struct rte_compressdev_capabilities {
 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
 	{ RTE_COMP_ALGO_UNSPECIFIED }
 
-__rte_experimental
 const struct rte_compressdev_capabilities *
 rte_compressdev_capability_get(uint8_t dev_id,
 			enum rte_comp_algorithm algo);
@@ -94,7 +89,6 @@ rte_compressdev_capability_get(uint8_t dev_id,
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_compressdev_get_feature_name(uint64_t flag);
 
@@ -133,7 +127,6 @@ struct rte_compressdev_stats {
  *   - Returns compress device identifier on success.
  *   - Return -1 on failure to find named compress device.
  */
-__rte_experimental
 int
 rte_compressdev_get_dev_id(const char *name);
 
@@ -146,7 +139,6 @@ rte_compressdev_get_dev_id(const char *name);
  *   - Returns compress device name.
  *   - Returns NULL if compress device is not present.
  */
-__rte_experimental
 const char *
 rte_compressdev_name_get(uint8_t dev_id);
 
@@ -157,7 +149,6 @@ rte_compressdev_name_get(uint8_t dev_id);
  * @return
  *   - The total number of usable compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_count(void);
 
@@ -175,7 +166,6 @@ rte_compressdev_count(void);
  * @return
  *   Returns number of attached compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
 		uint8_t nb_devices);
@@ -190,7 +180,6 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
  *   a default of zero if the socket could not be determined.
  *   -1 if returned is the dev_id value is out of range.
  */
-__rte_experimental
 int
 rte_compressdev_socket_id(uint8_t dev_id);
 
@@ -221,7 +210,6 @@ struct rte_compressdev_config {
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
-__rte_experimental
 int
 rte_compressdev_configure(uint8_t dev_id,
 			struct rte_compressdev_config *config);
@@ -240,7 +228,6 @@ rte_compressdev_configure(uint8_t dev_id,
  *   - 0: Success, device started.
  *   - <0: Error code of the driver device start function.
  */
-__rte_experimental
 int
 rte_compressdev_start(uint8_t dev_id);
 
@@ -251,7 +238,6 @@ rte_compressdev_start(uint8_t dev_id);
  * @param dev_id
  *   Compress device identifier
  */
-__rte_experimental
 void
 rte_compressdev_stop(uint8_t dev_id);
 
@@ -269,7 +255,6 @@ rte_compressdev_stop(uint8_t dev_id);
  *  - 0 on successfully closing device
  *  - <0 on failure to close device
  */
-__rte_experimental
 int
 rte_compressdev_close(uint8_t dev_id);
 
@@ -296,7 +281,6 @@ rte_compressdev_close(uint8_t dev_id);
  *   - 0: Success, queue pair correctly set up.
  *   - <0: Queue pair configuration failed
  */
-__rte_experimental
 int
 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 		uint32_t max_inflight_ops, int socket_id);
@@ -309,7 +293,6 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
  * @return
  *   - The number of configured queue pairs.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_queue_pair_count(uint8_t dev_id);
 
@@ -327,7 +310,6 @@ rte_compressdev_queue_pair_count(uint8_t dev_id);
  *   - Zero if successful.
  *   - Non-zero otherwise.
  */
-__rte_experimental
 int
 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
 
@@ -337,7 +319,6 @@ rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
  * @param dev_id
  *   The identifier of the device.
  */
-__rte_experimental
 void
 rte_compressdev_stats_reset(uint8_t dev_id);
 
@@ -355,7 +336,6 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * The element after the last valid element has it's op field set to
  * RTE_COMP_ALGO_UNSPECIFIED.
  */
-__rte_experimental
 void
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
 
@@ -413,7 +393,6 @@ rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
  *   of pointers to *rte_comp_op* structures effectively supplied to the
  *   *ops* array.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -468,7 +447,6 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
  *   comp devices queue is full or if invalid parameters are specified in
  *   a *rte_comp_op*.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -496,7 +474,6 @@ rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private stream could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_stream_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -518,7 +495,6 @@ rte_compressdev_stream_create(uint8_t dev_id,
  *  - Returns -ENOTSUP if comp device does not support STATEFUL operations.
  *  - Returns -EBUSY if can't free stream as there are inflight operations
  */
-__rte_experimental
 int
 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
 
@@ -545,7 +521,6 @@ rte_compressdev_stream_free(uint8_t dev_id, void *stream);
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private_xform could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -567,7 +542,6 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
  *  - <0 in error cases
  *  - Returns -EINVAL if input parameters are invalid.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index ea012908b783..fa233492fe1f 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -59,7 +59,6 @@ struct rte_compressdev_global {
  * @return
  *   - The rte_compressdev structure pointer for the given device identifier.
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_get_named_dev(const char *name);
 
@@ -292,7 +291,6 @@ struct rte_compressdev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_allocate(const char *name, int socket_id);
 
@@ -308,7 +306,6 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
-__rte_experimental
 int
 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
 
@@ -331,7 +328,6 @@ rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_parse_input_args(
 		struct rte_compressdev_pmd_init_params *params,
@@ -353,7 +349,6 @@ rte_compressdev_pmd_parse_input_args(
  *  - comp device instance on success
  *  - NULL on creation failure
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -372,7 +367,6 @@ rte_compressdev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
 
diff --git a/lib/compressdev/version.map b/lib/compressdev/version.map
index e2a108b6509f..fa891f669b5d 100644
--- a/lib/compressdev/version.map
+++ b/lib/compressdev/version.map
@@ -1,4 +1,4 @@
-EXPERIMENTAL {
+DPDK_24 {
 	global:
 
 	rte_compressdev_capability_get;
-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* [PATCH v5 00/26] Promote many experimental API's to stable
                     ` (2 preceding siblings ...)
  2023-10-19 19:09  3% ` [PATCH v4 00/28] Promote many experimental API's to stable Stephen Hemminger
@ 2023-10-20 20:57  3% ` Stephen Hemminger
  2023-10-20 20:57  2%   ` [PATCH v5 22/26] compressdev: remove experimental flag Stephen Hemminger
  2023-10-24  2:39  3% ` [PATCH v6 00/25] Promite many experimental API's to stable Stephen Hemminger
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-20 20:57 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since 23.11 is an LTS release it is time to remove the experimental
bandaid off many API's. There are about 890 API's marked with experimental
on current main branch. This addresses the easy to remove ones and
gets it down to about 510 places.

The rule is any API that has been in since 22.11 needs to have
experimental removed (or have API deleted). The experimental flag is not a
"get out of ABI stability for free" card

v5 - fix missing symbol in power version map
     drop mtr, vhost, port and table changes
     add eventdev and cryptodev

Stephen Hemminger (26):
  bpf: make rte_bpf_dump and rte_bpf_convert stable API's
  cmdline: make experimental API's stable
  ethdev: mark rte_tm API's as stable
  pdump: make API's stable
  pcapng: mark API's as stable
  net: remove experimental from functions
  rcu: remove experimental from rte_rcu_qbsr
  lpm: remove experimental
  mbuf: remove experimental from create_extbuf
  hash: remove experimental from toeplitz hash
  timer: remove experimental from rte_timer_next_ticks
  sched: remove experimental
  dmadev: mark API's as not experimental
  meter: remove experimental warning from comments
  power: remove experimental from API's
  kvargs: remove experimental flag
  ip_frag: mark a couple of functions stable
  member: remove experimental tag
  security: remove experimental flag from macsec
  bbdev: remove experimental tag
  ipsec: remove experimental from SA API
  compressdev: remove experimental flag
  regexdev: remove experimental tag
  node: remove some of the experimental tags
  eventdev: make many API's stable
  cryptodev: mark older API's stable

 MAINTAINERS                             |  8 +--
 lib/bbdev/rte_bbdev.h                   |  4 --
 lib/bbdev/rte_bbdev_op.h                |  2 -
 lib/bbdev/version.map                   | 15 ++--
 lib/bpf/rte_bpf.h                       |  2 -
 lib/bpf/version.map                     |  9 +--
 lib/cmdline/cmdline.h                   |  1 -
 lib/cmdline/cmdline_parse.h             |  4 --
 lib/cmdline/cmdline_rdline.h            |  4 --
 lib/cmdline/version.map                 | 26 +++----
 lib/compressdev/rte_comp.h              |  6 --
 lib/compressdev/rte_compressdev.h       | 26 -------
 lib/compressdev/rte_compressdev_pmd.h   |  6 --
 lib/compressdev/version.map             |  2 +-
 lib/cryptodev/rte_cryptodev.h           | 31 ---------
 lib/cryptodev/version.map               | 77 +++++++++------------
 lib/dmadev/rte_dmadev.h                 | 85 -----------------------
 lib/dmadev/version.map                  |  2 +-
 lib/ethdev/rte_tm.h                     | 34 ---------
 lib/ethdev/version.map                  | 62 ++++++++---------
 lib/eventdev/rte_event_crypto_adapter.h |  4 --
 lib/eventdev/rte_event_eth_rx_adapter.h |  6 --
 lib/eventdev/rte_event_eth_tx_adapter.h |  3 -
 lib/eventdev/rte_event_timer_adapter.h  |  3 -
 lib/eventdev/rte_eventdev.h             |  4 --
 lib/eventdev/version.map                | 34 ++++-----
 lib/hash/rte_thash.h                    | 44 ------------
 lib/hash/rte_thash_gfni.h               |  8 ---
 lib/hash/rte_thash_x86_gfni.h           |  8 ---
 lib/hash/version.map                    | 16 ++---
 lib/ip_frag/rte_ip_frag.h               |  2 -
 lib/ip_frag/version.map                 |  9 +--
 lib/ipsec/rte_ipsec.h                   |  2 -
 lib/ipsec/version.map                   |  9 +--
 lib/kvargs/rte_kvargs.h                 |  4 --
 lib/kvargs/version.map                  |  8 +--
 lib/lpm/rte_lpm.h                       |  4 --
 lib/lpm/version.map                     |  7 +-
 lib/mbuf/rte_mbuf.h                     |  1 -
 lib/mbuf/version.map                    |  8 +--
 lib/member/rte_member.h                 | 54 ---------------
 lib/member/version.map                  | 12 +---
 lib/meter/rte_meter.h                   | 12 ----
 lib/net/rte_ip.h                        | 19 -----
 lib/node/rte_node_eth_api.h             |  1 -
 lib/node/rte_node_ip4_api.h             |  2 -
 lib/node/version.map                    | 16 +++--
 lib/pcapng/rte_pcapng.h                 | 11 ---
 lib/pcapng/version.map                  |  6 +-
 lib/pdump/rte_pdump.h                   | 12 ----
 lib/pdump/version.map                   | 11 +--
 lib/power/rte_power.h                   |  4 --
 lib/power/rte_power_guest_channel.h     |  4 --
 lib/power/rte_power_pmd_mgmt.h          | 40 -----------
 lib/power/rte_power_uncore.h            |  5 --
 lib/power/version.map                   | 41 ++++-------
 lib/rcu/rte_rcu_qsbr.h                  | 20 ------
 lib/rcu/version.map                     | 15 ++--
 lib/regexdev/rte_regexdev.h             | 92 -------------------------
 lib/regexdev/version.map                |  2 +-
 lib/sched/rte_pie.h                     |  8 ---
 lib/sched/rte_sched.h                   |  5 --
 lib/sched/version.map                   | 18 ++---
 lib/security/rte_security.h             | 27 --------
 lib/security/version.map                | 18 ++---
 lib/timer/rte_timer.h                   |  4 --
 lib/timer/version.map                   |  7 +-
 67 files changed, 161 insertions(+), 895 deletions(-)

-- 
2.39.2


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v4] app/test: add support for skipping tests
  @ 2023-10-20 15:08  3%               ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-10-20 15:08 UTC (permalink / raw)
  To: Patrick Robb
  Cc: Aaron Conole, David Marchand, dev, Thomas Monjalon,
	Kevin Traynor, Lincoln Lavoie, stable

+stable on CC, to allow it be considered for possible backport. It's a
change to the unit test app, so not affecting any ABI or any end-user app.

On Fri, Oct 20, 2023 at 11:02:07AM -0400, Patrick Robb wrote:
>    On Mon, Oct 9, 2023 at 4:03 PM Patrick Robb <[1]probb@iol.unh.edu>
>    wrote:
> 
>    Hello,
>    Yes, backporting would be ideal from a CI perspective because without
>    it we can't run arm64 testing on LTS tests. But I know there are other
>    considerations which also have to be weighed.
>    David also has a patch[1] which should resolve the underlying issue
>    which introduces the failures on the unit test we want to skip. If that
>    patch is accepted, and backported, fixing our original problem with
>    unit testing on our arm testbeds, that's another solution, at least for
>    this specific unit test issue.
>    It would still be nice to have this feature in case we need it
>    otherwise.
>    [1] [2]https://patches.dpdk.org/project/dpdk/patch/20230821085806.30626
>    13-4-david.marchand@redhat.com/
> 
>    Hi. just to close the loops on this, yes David's aforementioned patch
>    did resolve the unit test failure which was preventing us from running
>    fast-tests on our arm64 test beds. But, it is not (yet, at least)
>    backported for LTS releases.
>    Even if it were, having Bruce's patch here backported would mean the CI
>    testing approach could be common across releases in situations where
>    testcases have to be skipped.
>    Anyways, whether it's possible or "worth it" is ultimately down to the
>    community's bandwidth, but I didn't want to let the conversation lapse
>    without an update, and raising what the benefits would be.
>    In any case, thanks again Bruce for the rework, it's a great addition.
> 
> References
> 
>    1. mailto:probb@iol.unh.edu
>    2. https://patches.dpdk.org/project/dpdk/patch/20230821085806.3062613-4-david.marchand@redhat.com/

^ permalink raw reply	[relevance 3%]

* [PATCH] docs: add note about experimental API in LTS
@ 2023-10-20 14:19  7% Kevin Traynor
  0 siblings, 0 replies; 200+ results
From: Kevin Traynor @ 2023-10-20 14:19 UTC (permalink / raw)
  To: dev; +Cc: Kevin Traynor, David Marchand

The justification and impact for changing experimental API on LTS
branches is different from the main branch. So the policy that is
being used for allowing experimental APIs to change is stricter on
the LTS branches.

This was not documented anywhere, so add some documentation.

Suggested-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 doc/guides/contributing/stable.rst | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/guides/contributing/stable.rst b/doc/guides/contributing/stable.rst
index 9ee7b4b7cc..8156b72b20 100644
--- a/doc/guides/contributing/stable.rst
+++ b/doc/guides/contributing/stable.rst
@@ -127,4 +127,12 @@ but may be considered in some cases where:
 * An existing feature in LTS is not usable as intended without it.
 
+APIs marked as ``experimental`` are not considered part of the ABI version
+and can be changed without prior notice. This is necessary for the API to be
+improved and stabilized and become part of the ABI version in the future.
+
+However, in LTS releases ``experimental`` API should not be changed as there
+will not be a future ABI version on the branch and compatibility with previous
+release of an LTS version is of the highest importance.
+
 The Stable Mailing List
 -----------------------
-- 
2.41.0


^ permalink raw reply	[relevance 7%]

* [PATCH v4 24/28] compressdev: remove experimental flag
  2023-10-19 19:09  3% ` [PATCH v4 00/28] Promote many experimental API's to stable Stephen Hemminger
@ 2023-10-19 19:10  2%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-19 19:10 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Fan Zhang, Ashish Gupta

The compressdev can not hide under the experimental flag.
Remove the experimental flag and require ABI to be stable.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 MAINTAINERS                           |  2 +-
 lib/compressdev/rte_comp.h            |  6 ------
 lib/compressdev/rte_compressdev.h     | 26 --------------------------
 lib/compressdev/rte_compressdev_pmd.h |  6 ------
 lib/compressdev/version.map           |  2 +-
 5 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1534a414f754..a1d4d57107a3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -459,7 +459,7 @@ F: lib/security/
 F: doc/guides/prog_guide/rte_security.rst
 F: app/test/test_security*
 
-Compression API - EXPERIMENTAL
+Compression API
 M: Fan Zhang <fanzhang.oss@gmail.com>
 M: Ashish Gupta <ashish.gupta@marvell.com>
 T: git://dpdk.org/next/dpdk-next-crypto
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index bf896d07223c..232564cf5e9a 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -499,7 +499,6 @@ struct rte_comp_op {
  *  - On success pointer to mempool
  *  - On failure NULL
  */
-__rte_experimental
 struct rte_mempool *
 rte_comp_op_pool_create(const char *name,
 		unsigned int nb_elts, unsigned int cache_size,
@@ -515,7 +514,6 @@ rte_comp_op_pool_create(const char *name,
  * - On success returns a valid rte_comp_op structure
  * - On failure returns NULL
  */
-__rte_experimental
 struct rte_comp_op *
 rte_comp_op_alloc(struct rte_mempool *mempool);
 
@@ -532,7 +530,6 @@ rte_comp_op_alloc(struct rte_mempool *mempool);
  *   - nb_ops: Success, the nb_ops requested was allocated
  *   - 0: Not enough entries in the mempool; no ops are retrieved.
  */
-__rte_experimental
 int
 rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -546,7 +543,6 @@ rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
  *   Compress operation pointer allocated from rte_comp_op_alloc()
  *   If op is NULL, no operation is performed.
  */
-__rte_experimental
 void
 rte_comp_op_free(struct rte_comp_op *op);
 
@@ -561,7 +557,6 @@ rte_comp_op_free(struct rte_comp_op *op);
  * @param nb_ops
  *   Number of operations to free
  */
-__rte_experimental
 void
 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
 
@@ -574,7 +569,6 @@ rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_comp_get_feature_name(uint64_t flag);
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 13a418631893..8cb5db0e3f7d 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -10,10 +10,6 @@
  *
  * RTE Compression Device APIs.
  *
- * @warning
- * @b EXPERIMENTAL:
- * All functions in this file may be changed or removed without prior notice.
- *
  * Defines comp device APIs for the provisioning of compression operations.
  */
 
@@ -54,7 +50,6 @@ struct rte_compressdev_capabilities {
 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
 	{ RTE_COMP_ALGO_UNSPECIFIED }
 
-__rte_experimental
 const struct rte_compressdev_capabilities *
 rte_compressdev_capability_get(uint8_t dev_id,
 			enum rte_comp_algorithm algo);
@@ -94,7 +89,6 @@ rte_compressdev_capability_get(uint8_t dev_id,
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_compressdev_get_feature_name(uint64_t flag);
 
@@ -133,7 +127,6 @@ struct rte_compressdev_stats {
  *   - Returns compress device identifier on success.
  *   - Return -1 on failure to find named compress device.
  */
-__rte_experimental
 int
 rte_compressdev_get_dev_id(const char *name);
 
@@ -146,7 +139,6 @@ rte_compressdev_get_dev_id(const char *name);
  *   - Returns compress device name.
  *   - Returns NULL if compress device is not present.
  */
-__rte_experimental
 const char *
 rte_compressdev_name_get(uint8_t dev_id);
 
@@ -157,7 +149,6 @@ rte_compressdev_name_get(uint8_t dev_id);
  * @return
  *   - The total number of usable compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_count(void);
 
@@ -175,7 +166,6 @@ rte_compressdev_count(void);
  * @return
  *   Returns number of attached compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
 		uint8_t nb_devices);
@@ -190,7 +180,6 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
  *   a default of zero if the socket could not be determined.
  *   -1 if returned is the dev_id value is out of range.
  */
-__rte_experimental
 int
 rte_compressdev_socket_id(uint8_t dev_id);
 
@@ -221,7 +210,6 @@ struct rte_compressdev_config {
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
-__rte_experimental
 int
 rte_compressdev_configure(uint8_t dev_id,
 			struct rte_compressdev_config *config);
@@ -240,7 +228,6 @@ rte_compressdev_configure(uint8_t dev_id,
  *   - 0: Success, device started.
  *   - <0: Error code of the driver device start function.
  */
-__rte_experimental
 int
 rte_compressdev_start(uint8_t dev_id);
 
@@ -251,7 +238,6 @@ rte_compressdev_start(uint8_t dev_id);
  * @param dev_id
  *   Compress device identifier
  */
-__rte_experimental
 void
 rte_compressdev_stop(uint8_t dev_id);
 
@@ -269,7 +255,6 @@ rte_compressdev_stop(uint8_t dev_id);
  *  - 0 on successfully closing device
  *  - <0 on failure to close device
  */
-__rte_experimental
 int
 rte_compressdev_close(uint8_t dev_id);
 
@@ -296,7 +281,6 @@ rte_compressdev_close(uint8_t dev_id);
  *   - 0: Success, queue pair correctly set up.
  *   - <0: Queue pair configuration failed
  */
-__rte_experimental
 int
 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 		uint32_t max_inflight_ops, int socket_id);
@@ -309,7 +293,6 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
  * @return
  *   - The number of configured queue pairs.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_queue_pair_count(uint8_t dev_id);
 
@@ -327,7 +310,6 @@ rte_compressdev_queue_pair_count(uint8_t dev_id);
  *   - Zero if successful.
  *   - Non-zero otherwise.
  */
-__rte_experimental
 int
 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
 
@@ -337,7 +319,6 @@ rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
  * @param dev_id
  *   The identifier of the device.
  */
-__rte_experimental
 void
 rte_compressdev_stats_reset(uint8_t dev_id);
 
@@ -355,7 +336,6 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * The element after the last valid element has it's op field set to
  * RTE_COMP_ALGO_UNSPECIFIED.
  */
-__rte_experimental
 void
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
 
@@ -413,7 +393,6 @@ rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
  *   of pointers to *rte_comp_op* structures effectively supplied to the
  *   *ops* array.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -468,7 +447,6 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
  *   comp devices queue is full or if invalid parameters are specified in
  *   a *rte_comp_op*.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -496,7 +474,6 @@ rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private stream could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_stream_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -518,7 +495,6 @@ rte_compressdev_stream_create(uint8_t dev_id,
  *  - Returns -ENOTSUP if comp device does not support STATEFUL operations.
  *  - Returns -EBUSY if can't free stream as there are inflight operations
  */
-__rte_experimental
 int
 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
 
@@ -545,7 +521,6 @@ rte_compressdev_stream_free(uint8_t dev_id, void *stream);
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private_xform could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -567,7 +542,6 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
  *  - <0 in error cases
  *  - Returns -EINVAL if input parameters are invalid.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index ea012908b783..fa233492fe1f 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -59,7 +59,6 @@ struct rte_compressdev_global {
  * @return
  *   - The rte_compressdev structure pointer for the given device identifier.
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_get_named_dev(const char *name);
 
@@ -292,7 +291,6 @@ struct rte_compressdev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_allocate(const char *name, int socket_id);
 
@@ -308,7 +306,6 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
-__rte_experimental
 int
 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
 
@@ -331,7 +328,6 @@ rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_parse_input_args(
 		struct rte_compressdev_pmd_init_params *params,
@@ -353,7 +349,6 @@ rte_compressdev_pmd_parse_input_args(
  *  - comp device instance on success
  *  - NULL on creation failure
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -372,7 +367,6 @@ rte_compressdev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
 
diff --git a/lib/compressdev/version.map b/lib/compressdev/version.map
index e2a108b6509f..fa891f669b5d 100644
--- a/lib/compressdev/version.map
+++ b/lib/compressdev/version.map
@@ -1,4 +1,4 @@
-EXPERIMENTAL {
+DPDK_24 {
 	global:
 
 	rte_compressdev_capability_get;
-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* [PATCH v4 00/28] Promote many experimental API's to stable
      2023-10-19 16:55  3% ` [PATCH v3 00/29] Promote experimental " Stephen Hemminger
@ 2023-10-19 19:09  3% ` Stephen Hemminger
  2023-10-19 19:10  2%   ` [PATCH v4 24/28] compressdev: remove experimental flag Stephen Hemminger
  2023-10-20 20:57  3% ` [PATCH v5 00/26] Promote many experimental API's to stable Stephen Hemminger
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-19 19:09 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since 23.11 is an LTS release it is time to remove the experimental
bandaid off many API's. There are about 890 API's marked with experimental
on current main branch. This addresses the easy to remove ones and
gets it down to about 510 places.

The rule is any API that has been in since 22.11 needs to have
experimental removed (or have API deleted). The experimental flag is not a
"get out of ABI stability for free" card

v4 - fix build in security and squash one fixup
v3 - rebase and skip cryptodev

Stephen Hemminger (28):
  bpf: make rte_bpf_dump and rte_bpf_convert stable API's
  cmdline: make experimental API's stable
  ethdev: mark rte_mtr API's as stable
  ethdev: mark rte_tm API's as stable
  pdump: make API's stable
  pcapng: mark API's as stable
  net: remove experimental from functions
  rcu: remove experimental from rte_rcu_qbsr
  lpm: remove experimental
  mbuf: remove experimental from create_extbuf
  hash: remove experimental from toeplitz hash
  timer: remove experimental from rte_timer_next_ticks
  sched: remove experimental
  dmadev: mark API's as not experimental
  meter: remove experimental warning from comments
  power: remove experimental from API's
  kvargs: remove experimental flag
  ip_frag: mark a couple of functions stable
  member: remove experimental tag
  security: remove experimental flag from macsec
  vhost: remove experimental from some API's
  bbdev: remove experimental tag
  ipsec: remove experimental from SA API
  compressdev: remove experimental flag
  regexdev: remove experimental tag
  node: remove some of the experimental tags
  table: remove experimental from API
  port: make API's stable

 MAINTAINERS                           |  10 +-
 doc/guides/rel_notes/deprecation.rst  |   6 --
 lib/bbdev/rte_bbdev.h                 |   4 -
 lib/bbdev/rte_bbdev_op.h              |   2 -
 lib/bbdev/version.map                 |  15 ++-
 lib/bpf/rte_bpf.h                     |   2 -
 lib/bpf/version.map                   |   9 +-
 lib/cmdline/cmdline.h                 |   1 -
 lib/cmdline/cmdline_parse.h           |   4 -
 lib/cmdline/cmdline_rdline.h          |   4 -
 lib/cmdline/version.map               |  26 ++---
 lib/compressdev/rte_comp.h            |   6 --
 lib/compressdev/rte_compressdev.h     |  26 -----
 lib/compressdev/rte_compressdev_pmd.h |   6 --
 lib/compressdev/version.map           |   2 +-
 lib/dmadev/rte_dmadev.h               |  85 ----------------
 lib/dmadev/version.map                |   2 +-
 lib/ethdev/rte_mtr.h                  |  25 +----
 lib/ethdev/rte_tm.h                   |  34 -------
 lib/ethdev/version.map                |  88 ++++++++--------
 lib/hash/rte_thash.h                  |  44 --------
 lib/hash/rte_thash_gfni.h             |   8 --
 lib/hash/rte_thash_x86_gfni.h         |   8 --
 lib/hash/version.map                  |  16 +--
 lib/ip_frag/rte_ip_frag.h             |   2 -
 lib/ip_frag/version.map               |   9 +-
 lib/ipsec/rte_ipsec.h                 |   2 -
 lib/ipsec/version.map                 |   9 +-
 lib/kvargs/rte_kvargs.h               |   4 -
 lib/kvargs/version.map                |   8 +-
 lib/lpm/rte_lpm.h                     |   4 -
 lib/lpm/version.map                   |   7 +-
 lib/mbuf/rte_mbuf.h                   |   1 -
 lib/mbuf/version.map                  |   8 +-
 lib/member/rte_member.h               |  54 ----------
 lib/member/version.map                |  12 +--
 lib/meter/rte_meter.h                 |  12 ---
 lib/net/rte_ip.h                      |  19 ----
 lib/node/rte_node_eth_api.h           |   1 -
 lib/node/rte_node_ip4_api.h           |   2 -
 lib/node/version.map                  |  16 ++-
 lib/pcapng/rte_pcapng.h               |  11 --
 lib/pcapng/version.map                |   6 +-
 lib/pdump/rte_pdump.h                 |  12 ---
 lib/pdump/version.map                 |  11 +-
 lib/pipeline/rte_port_in_action.h     |   8 --
 lib/pipeline/rte_swx_ctl.h            |  57 -----------
 lib/pipeline/rte_swx_pipeline.h       |  29 ------
 lib/pipeline/rte_table_action.h       |  16 ---
 lib/pipeline/version.map              | 140 ++++++++++++--------------
 lib/port/version.map                  |  24 ++---
 lib/power/rte_power.h                 |   4 -
 lib/power/rte_power_guest_channel.h   |   4 -
 lib/power/rte_power_pmd_mgmt.h        |  40 --------
 lib/power/rte_power_uncore.h          |   5 -
 lib/power/version.map                 |  40 +++-----
 lib/rcu/rte_rcu_qsbr.h                |  20 ----
 lib/rcu/version.map                   |  15 +--
 lib/regexdev/rte_regexdev.h           |  92 -----------------
 lib/regexdev/version.map              |   2 +-
 lib/sched/rte_pie.h                   |   8 --
 lib/sched/rte_sched.h                 |   5 -
 lib/sched/version.map                 |  18 +---
 lib/security/rte_security.h           |  27 -----
 lib/security/version.map              |  18 ++--
 lib/table/rte_swx_table_learner.h     |  10 --
 lib/table/rte_swx_table_selector.h    |   6 --
 lib/table/rte_table_hash_func.h       |   9 --
 lib/table/version.map                 |  18 +---
 lib/timer/rte_timer.h                 |   4 -
 lib/timer/version.map                 |   7 +-
 lib/vhost/rte_vhost.h                 |   5 -
 lib/vhost/rte_vhost_async.h           |  19 ----
 lib/vhost/rte_vhost_crypto.h          |   1 -
 lib/vhost/version.map                 |  51 ++++------
 75 files changed, 219 insertions(+), 1126 deletions(-)

-- 
2.39.2


^ permalink raw reply	[relevance 3%]

* [PATCH v3 25/29] compressdev: remove experimental flag
  2023-10-19 16:55  3% ` [PATCH v3 00/29] Promote experimental " Stephen Hemminger
@ 2023-10-19 16:55  2%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-19 16:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon, Fan Zhang, Ashish Gupta

The compressdev can not hide under the experimental flag.
Remove the experimental flag and require ABI to be stable.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 MAINTAINERS                           |  2 +-
 lib/compressdev/rte_comp.h            |  6 ------
 lib/compressdev/rte_compressdev.h     | 26 --------------------------
 lib/compressdev/rte_compressdev_pmd.h |  6 ------
 lib/compressdev/version.map           |  2 +-
 5 files changed, 2 insertions(+), 40 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 1534a414f754..a1d4d57107a3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -459,7 +459,7 @@ F: lib/security/
 F: doc/guides/prog_guide/rte_security.rst
 F: app/test/test_security*
 
-Compression API - EXPERIMENTAL
+Compression API
 M: Fan Zhang <fanzhang.oss@gmail.com>
 M: Ashish Gupta <ashish.gupta@marvell.com>
 T: git://dpdk.org/next/dpdk-next-crypto
diff --git a/lib/compressdev/rte_comp.h b/lib/compressdev/rte_comp.h
index bf896d07223c..232564cf5e9a 100644
--- a/lib/compressdev/rte_comp.h
+++ b/lib/compressdev/rte_comp.h
@@ -499,7 +499,6 @@ struct rte_comp_op {
  *  - On success pointer to mempool
  *  - On failure NULL
  */
-__rte_experimental
 struct rte_mempool *
 rte_comp_op_pool_create(const char *name,
 		unsigned int nb_elts, unsigned int cache_size,
@@ -515,7 +514,6 @@ rte_comp_op_pool_create(const char *name,
  * - On success returns a valid rte_comp_op structure
  * - On failure returns NULL
  */
-__rte_experimental
 struct rte_comp_op *
 rte_comp_op_alloc(struct rte_mempool *mempool);
 
@@ -532,7 +530,6 @@ rte_comp_op_alloc(struct rte_mempool *mempool);
  *   - nb_ops: Success, the nb_ops requested was allocated
  *   - 0: Not enough entries in the mempool; no ops are retrieved.
  */
-__rte_experimental
 int
 rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -546,7 +543,6 @@ rte_comp_op_bulk_alloc(struct rte_mempool *mempool,
  *   Compress operation pointer allocated from rte_comp_op_alloc()
  *   If op is NULL, no operation is performed.
  */
-__rte_experimental
 void
 rte_comp_op_free(struct rte_comp_op *op);
 
@@ -561,7 +557,6 @@ rte_comp_op_free(struct rte_comp_op *op);
  * @param nb_ops
  *   Number of operations to free
  */
-__rte_experimental
 void
 rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
 
@@ -574,7 +569,6 @@ rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_comp_get_feature_name(uint64_t flag);
 
diff --git a/lib/compressdev/rte_compressdev.h b/lib/compressdev/rte_compressdev.h
index 13a418631893..8cb5db0e3f7d 100644
--- a/lib/compressdev/rte_compressdev.h
+++ b/lib/compressdev/rte_compressdev.h
@@ -10,10 +10,6 @@
  *
  * RTE Compression Device APIs.
  *
- * @warning
- * @b EXPERIMENTAL:
- * All functions in this file may be changed or removed without prior notice.
- *
  * Defines comp device APIs for the provisioning of compression operations.
  */
 
@@ -54,7 +50,6 @@ struct rte_compressdev_capabilities {
 #define RTE_COMP_END_OF_CAPABILITIES_LIST() \
 	{ RTE_COMP_ALGO_UNSPECIFIED }
 
-__rte_experimental
 const struct rte_compressdev_capabilities *
 rte_compressdev_capability_get(uint8_t dev_id,
 			enum rte_comp_algorithm algo);
@@ -94,7 +89,6 @@ rte_compressdev_capability_get(uint8_t dev_id,
  * @return
  *   The name of this flag, or NULL if it's not a valid feature flag.
  */
-__rte_experimental
 const char *
 rte_compressdev_get_feature_name(uint64_t flag);
 
@@ -133,7 +127,6 @@ struct rte_compressdev_stats {
  *   - Returns compress device identifier on success.
  *   - Return -1 on failure to find named compress device.
  */
-__rte_experimental
 int
 rte_compressdev_get_dev_id(const char *name);
 
@@ -146,7 +139,6 @@ rte_compressdev_get_dev_id(const char *name);
  *   - Returns compress device name.
  *   - Returns NULL if compress device is not present.
  */
-__rte_experimental
 const char *
 rte_compressdev_name_get(uint8_t dev_id);
 
@@ -157,7 +149,6 @@ rte_compressdev_name_get(uint8_t dev_id);
  * @return
  *   - The total number of usable compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_count(void);
 
@@ -175,7 +166,6 @@ rte_compressdev_count(void);
  * @return
  *   Returns number of attached compress devices.
  */
-__rte_experimental
 uint8_t
 rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
 		uint8_t nb_devices);
@@ -190,7 +180,6 @@ rte_compressdev_devices_get(const char *driver_name, uint8_t *devices,
  *   a default of zero if the socket could not be determined.
  *   -1 if returned is the dev_id value is out of range.
  */
-__rte_experimental
 int
 rte_compressdev_socket_id(uint8_t dev_id);
 
@@ -221,7 +210,6 @@ struct rte_compressdev_config {
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
-__rte_experimental
 int
 rte_compressdev_configure(uint8_t dev_id,
 			struct rte_compressdev_config *config);
@@ -240,7 +228,6 @@ rte_compressdev_configure(uint8_t dev_id,
  *   - 0: Success, device started.
  *   - <0: Error code of the driver device start function.
  */
-__rte_experimental
 int
 rte_compressdev_start(uint8_t dev_id);
 
@@ -251,7 +238,6 @@ rte_compressdev_start(uint8_t dev_id);
  * @param dev_id
  *   Compress device identifier
  */
-__rte_experimental
 void
 rte_compressdev_stop(uint8_t dev_id);
 
@@ -269,7 +255,6 @@ rte_compressdev_stop(uint8_t dev_id);
  *  - 0 on successfully closing device
  *  - <0 on failure to close device
  */
-__rte_experimental
 int
 rte_compressdev_close(uint8_t dev_id);
 
@@ -296,7 +281,6 @@ rte_compressdev_close(uint8_t dev_id);
  *   - 0: Success, queue pair correctly set up.
  *   - <0: Queue pair configuration failed
  */
-__rte_experimental
 int
 rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
 		uint32_t max_inflight_ops, int socket_id);
@@ -309,7 +293,6 @@ rte_compressdev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
  * @return
  *   - The number of configured queue pairs.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_queue_pair_count(uint8_t dev_id);
 
@@ -327,7 +310,6 @@ rte_compressdev_queue_pair_count(uint8_t dev_id);
  *   - Zero if successful.
  *   - Non-zero otherwise.
  */
-__rte_experimental
 int
 rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
 
@@ -337,7 +319,6 @@ rte_compressdev_stats_get(uint8_t dev_id, struct rte_compressdev_stats *stats);
  * @param dev_id
  *   The identifier of the device.
  */
-__rte_experimental
 void
 rte_compressdev_stats_reset(uint8_t dev_id);
 
@@ -355,7 +336,6 @@ rte_compressdev_stats_reset(uint8_t dev_id);
  * The element after the last valid element has it's op field set to
  * RTE_COMP_ALGO_UNSPECIFIED.
  */
-__rte_experimental
 void
 rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
 
@@ -413,7 +393,6 @@ rte_compressdev_info_get(uint8_t dev_id, struct rte_compressdev_info *dev_info);
  *   of pointers to *rte_comp_op* structures effectively supplied to the
  *   *ops* array.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -468,7 +447,6 @@ rte_compressdev_dequeue_burst(uint8_t dev_id, uint16_t qp_id,
  *   comp devices queue is full or if invalid parameters are specified in
  *   a *rte_comp_op*.
  */
-__rte_experimental
 uint16_t
 rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 		struct rte_comp_op **ops, uint16_t nb_ops);
@@ -496,7 +474,6 @@ rte_compressdev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private stream could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_stream_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -518,7 +495,6 @@ rte_compressdev_stream_create(uint8_t dev_id,
  *  - Returns -ENOTSUP if comp device does not support STATEFUL operations.
  *  - Returns -EBUSY if can't free stream as there are inflight operations
  */
-__rte_experimental
 int
 rte_compressdev_stream_free(uint8_t dev_id, void *stream);
 
@@ -545,7 +521,6 @@ rte_compressdev_stream_free(uint8_t dev_id, void *stream);
  *  - Returns -ENOTSUP if comp device does not support the comp transform.
  *  - Returns -ENOMEM if the private_xform could not be allocated.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_create(uint8_t dev_id,
 		const struct rte_comp_xform *xform,
@@ -567,7 +542,6 @@ rte_compressdev_private_xform_create(uint8_t dev_id,
  *  - <0 in error cases
  *  - Returns -EINVAL if input parameters are invalid.
  */
-__rte_experimental
 int
 rte_compressdev_private_xform_free(uint8_t dev_id, void *private_xform);
 
diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h
index ea012908b783..fa233492fe1f 100644
--- a/lib/compressdev/rte_compressdev_pmd.h
+++ b/lib/compressdev/rte_compressdev_pmd.h
@@ -59,7 +59,6 @@ struct rte_compressdev_global {
  * @return
  *   - The rte_compressdev structure pointer for the given device identifier.
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_get_named_dev(const char *name);
 
@@ -292,7 +291,6 @@ struct rte_compressdev_ops {
  * @return
  *   - Slot in the rte_dev_devices array for a new device;
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_allocate(const char *name, int socket_id);
 
@@ -308,7 +306,6 @@ rte_compressdev_pmd_allocate(const char *name, int socket_id);
  * @return
  *   - 0 on success, negative on error
  */
-__rte_experimental
 int
 rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
 
@@ -331,7 +328,6 @@ rte_compressdev_pmd_release_device(struct rte_compressdev *dev);
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_parse_input_args(
 		struct rte_compressdev_pmd_init_params *params,
@@ -353,7 +349,6 @@ rte_compressdev_pmd_parse_input_args(
  *  - comp device instance on success
  *  - NULL on creation failure
  */
-__rte_experimental
 struct rte_compressdev *
 rte_compressdev_pmd_create(const char *name,
 		struct rte_device *device,
@@ -372,7 +367,6 @@ rte_compressdev_pmd_create(const char *name,
  *  - 0 on success
  *  - errno on failure
  */
-__rte_experimental
 int
 rte_compressdev_pmd_destroy(struct rte_compressdev *dev);
 
diff --git a/lib/compressdev/version.map b/lib/compressdev/version.map
index e2a108b6509f..fa891f669b5d 100644
--- a/lib/compressdev/version.map
+++ b/lib/compressdev/version.map
@@ -1,4 +1,4 @@
-EXPERIMENTAL {
+DPDK_24 {
 	global:
 
 	rte_compressdev_capability_get;
-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* [PATCH v3 00/29] Promote experimental API's to stable.
    @ 2023-10-19 16:55  3% ` Stephen Hemminger
  2023-10-19 16:55  2%   ` [PATCH v3 25/29] compressdev: remove experimental flag Stephen Hemminger
  2023-10-19 19:09  3% ` [PATCH v4 00/28] Promote many experimental API's to stable Stephen Hemminger
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-19 16:55 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Since 23.11 is an LTS release it is time to remove the experimental
bandaid off many API's. There are about 890 API's marked with experimental
on current main branch. This addresses the easy to remove ones and
gets it down to about 510 places.

The rule is any API that has been in since 22.11 needs to have
experimental removed (or have API deleted). The experimental flag is not a
"get out of ABI stability for free" card.

In a couple places experimental was being used where internal
would have been more appropriate.

v3 - rebase and skip cryptodev

Stephen Hemminger (29):
  bpf: make rte_bpf_dump and rte_bpf_convert stable API's
  cmdline: make experimental API's stable
  ethdev: mark rte_mtr API's as stable
  ethdev: mark rte_tm API's as stable
  pdump: make API's stable
  pcapng: mark API's as stable
  net: remove experimental from functions
  rcu: remove experimental from rte_rcu_qbsr
  lpm: remove experimental
  mbuf: remove experimental from create_extbuf
  hash: remove experimental from toeplitz hash
  timer: remove experimental from rte_timer_next_ticks
  sched: remove experimental
  dmadev: mark API's as not experimental
  meter: remove experimental warning from comments
  power: remove experimental from API's
  kvargs: remove experimental flag
  ip_frag: mark a couple of functions stable
  member: remove experimental tag
  power fix
  security: remove experimental flag from macsec
  vhost: remove experimental from some API's
  bbdev: remove experimental tag
  ipsec: remove experimental from SA API
  compressdev: remove experimental flag
  regexdev: remove experimental tag
  node: remove some of the experimental tags
  table: remove experimental from API
  port: make API's stable

 MAINTAINERS                           |  10 +-
 doc/guides/rel_notes/deprecation.rst  |   6 --
 lib/bbdev/rte_bbdev.h                 |   4 -
 lib/bbdev/rte_bbdev_op.h              |   2 -
 lib/bbdev/version.map                 |  15 ++-
 lib/bpf/rte_bpf.h                     |   2 -
 lib/bpf/version.map                   |   9 +-
 lib/cmdline/cmdline.h                 |   1 -
 lib/cmdline/cmdline_parse.h           |   4 -
 lib/cmdline/cmdline_rdline.h          |   4 -
 lib/cmdline/version.map               |  26 ++---
 lib/compressdev/rte_comp.h            |   6 --
 lib/compressdev/rte_compressdev.h     |  26 -----
 lib/compressdev/rte_compressdev_pmd.h |   6 --
 lib/compressdev/version.map           |   2 +-
 lib/dmadev/rte_dmadev.h               |  85 ----------------
 lib/dmadev/version.map                |   2 +-
 lib/ethdev/rte_mtr.h                  |  25 +----
 lib/ethdev/rte_tm.h                   |  34 -------
 lib/ethdev/version.map                |  88 ++++++++--------
 lib/hash/rte_thash.h                  |  44 --------
 lib/hash/rte_thash_gfni.h             |   8 --
 lib/hash/rte_thash_x86_gfni.h         |   8 --
 lib/hash/version.map                  |  16 +--
 lib/ip_frag/rte_ip_frag.h             |   2 -
 lib/ip_frag/version.map               |   9 +-
 lib/ipsec/rte_ipsec.h                 |   2 -
 lib/ipsec/version.map                 |   9 +-
 lib/kvargs/rte_kvargs.h               |   4 -
 lib/kvargs/version.map                |   8 +-
 lib/lpm/rte_lpm.h                     |   4 -
 lib/lpm/version.map                   |   7 +-
 lib/mbuf/rte_mbuf.h                   |   1 -
 lib/mbuf/version.map                  |   8 +-
 lib/member/rte_member.h               |  54 ----------
 lib/member/version.map                |  12 +--
 lib/meter/rte_meter.h                 |  12 ---
 lib/net/rte_ip.h                      |  19 ----
 lib/node/rte_node_eth_api.h           |   1 -
 lib/node/rte_node_ip4_api.h           |   2 -
 lib/node/version.map                  |  16 ++-
 lib/pcapng/rte_pcapng.h               |  11 --
 lib/pcapng/version.map                |   6 +-
 lib/pdump/rte_pdump.h                 |  12 ---
 lib/pdump/version.map                 |  11 +-
 lib/pipeline/rte_port_in_action.h     |   8 --
 lib/pipeline/rte_swx_ctl.h            |  57 -----------
 lib/pipeline/rte_swx_pipeline.h       |  29 ------
 lib/pipeline/rte_table_action.h       |  16 ---
 lib/pipeline/version.map              | 140 ++++++++++++--------------
 lib/port/version.map                  |  24 ++---
 lib/power/rte_power.h                 |   4 -
 lib/power/rte_power_guest_channel.h   |   4 -
 lib/power/rte_power_pmd_mgmt.h        |  40 --------
 lib/power/rte_power_uncore.h          |   5 -
 lib/power/version.map                 |  40 +++-----
 lib/rcu/rte_rcu_qsbr.h                |  20 ----
 lib/rcu/version.map                   |  15 +--
 lib/regexdev/rte_regexdev.h           |  92 -----------------
 lib/regexdev/version.map              |   2 +-
 lib/sched/rte_pie.h                   |   8 --
 lib/sched/rte_sched.h                 |   5 -
 lib/sched/version.map                 |  18 +---
 lib/security/rte_security.h           |  28 +-----
 lib/security/version.map              |  18 ++--
 lib/table/rte_swx_table_learner.h     |  10 --
 lib/table/rte_swx_table_selector.h    |   6 --
 lib/table/rte_table_hash_func.h       |   9 --
 lib/table/version.map                 |  18 +---
 lib/timer/rte_timer.h                 |   4 -
 lib/timer/version.map                 |   7 +-
 lib/vhost/rte_vhost.h                 |   5 -
 lib/vhost/rte_vhost_async.h           |  19 ----
 lib/vhost/rte_vhost_crypto.h          |   1 -
 lib/vhost/version.map                 |  51 ++++------
 75 files changed, 220 insertions(+), 1126 deletions(-)

-- 
2.39.2


^ permalink raw reply	[relevance 3%]

* RE: [EXT] Re: [PATCH v6 18/34] ml/cnxk: support config and close of tvmdp library
  2023-10-18 18:34  5%     ` Jerin Jacob
@ 2023-10-19  6:44  0%       ` Srikanth Yalavarthi
  0 siblings, 0 replies; 200+ results
From: Srikanth Yalavarthi @ 2023-10-19  6:44 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: dev, Shivah Shankar Shankar Narayan Rao, Anup Prabhu,
	Prince Takkar, Srikanth Yalavarthi


> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: 19 October 2023 00:04
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Anup Prabhu <aprabhu@marvell.com>;
> Prince Takkar <ptakkar@marvell.com>; Srikanth Yalavarthi
> <syalavarthi@marvell.com>
> Subject: [EXT] Re: [PATCH v6 18/34] ml/cnxk: support config and close of
> tvmdp library
> 
> External Email
> 
> ----------------------------------------------------------------------
> On Wed, Oct 18, 2023 at 7:52 PM Srikanth Yalavarthi
> <syalavarthi@marvell.com> wrote:
> >
> > Added support to configure and close TVMDP library based on ML device
> > configuration options.
> >
> > Updated meson build to enable Jansson, TVM runtime, TVMDP library as
> > build dependencies.
> >
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > ---
> 
> >
> > +Compilation Prerequisites
> > +-------------------------
> > +
> > +This driver requires external libraries to optionally enable support
> > +for models compiled using Apache TVM framework. The following
> > +dependencies are not part of DPDK and must be installed separately:
> > +
> > +- **Jansson**
> > +
> > +  This library enables support to parse and read JSON files.
> > +
> > +- **DLPack**
> > +
> > +  This library provides headers for open in-memory tensor structures.
> > +
> > +.. note::
> > +
> > +    DPDK CNXK ML driver requires DLPack version 0.7
> > +
> > +.. code-block:: console
> 
> 
> Please add sections for cross and native.
> 
> > +    git clone https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__github.com_dmlc_dlpack.git&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ
> &r=SNPqUkGl0n_Ms1iJa_6wD6LBwX8efL_NOyXvAX-
> iCMI&m=Af3Vz7Jwj42zg2TmQe6-
> BpsSzCWoeRVDxlAtzIB9e_Rtv6KG1mT0_Lq0_HnJyz1E&s=d5Yn2kMNnw-
> GyGXVRyExfsC8-Uy9S3TKnW0boz8mlsI&e=
> > +    cd dlpack
> > +    git checkout v0.7 -b v0.7
> > +    cmake -S ./ -B build \
> > +      -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
> > +      -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
> > +      -DBUILD_MOCK=OFF
> > +    make -C build
> > +    make -C build install
> > +
> > +- **TVM**
> > +
> > +  Apache TVM provides a runtime library (libtvm_runtime) used to
> > + execute  models on CPU cores or hardware accelerators.
> > +
> > +.. note::
> > +
> > +    DPDK CNXK ML driver requires TVM version 0.10.0
> > +
> > +.. code-block:: console
> > +
> > +    git clone
> > + https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__github.com_apac
> > +
> he_tvm.git&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=SNPqUkGl0n_Ms1
> iJa_6wD
> > + 6LBwX8efL_NOyXvAX-iCMI&m=Af3Vz7Jwj42zg2TmQe6-
> BpsSzCWoeRVDxlAtzIB9e_R
> > + tv6KG1mT0_Lq0_HnJyz1E&s=pj_HUWALTg49rW1wRTyzB-yWSyuHzWr-
> XzPycb8UtlI&
> > + e=
> 
> I need to use --recursive to avoid
> CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:3176
> (message):
>   No download info given for 'project_libbacktrace' and its source directory:

Updated build steps in version 7. Added steps to initialize submodules.
> 
> 
> > +    cd tvm
> > +    git checkout v0.10.0 -b v0.10.0
> > +    cmake -S ./ -B build \
> > +      -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
> > +      -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
> > +      -DMACHINE_NAME=aarch64-linux-gnu \
> > +      -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
> > +      -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
> > +    make -C build
> > +    make -C build install
> > +
> > +- **TVMDP**
> > +
> > +  Marvell's `TVM Dataplane Library
> > + <https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__github.com_Mar
> > +
> vellEmbeddedProcessors_tvmdp&d=DwIFaQ&c=nKjWec2b6R0mOyPaz7xtfQ
> &r=SNPqUkGl0n_Ms1iJa_6wD6LBwX8efL_NOyXvAX-
> iCMI&m=Af3Vz7Jwj42zg2TmQe6-
> BpsSzCWoeRVDxlAtzIB9e_Rtv6KG1mT0_Lq0_HnJyz1E&s=kqu82cbMqOdusys
> dSYmp2cCwH9VTwcVvmMK0wqy04w0&e= >`_  works as an interface
> between TVM runtime and DPDK drivers. TVMDP library  provides a
> simplified C interface for TVM's runtime based on C++.
> > +
> > +.. code-block:: console
> > +
> > +    git clone https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__github.com_MarvellEmbeddedProcessors_tvmdp.git&d=DwIFaQ&c=nK
> jWec2b6R0mOyPaz7xtfQ&r=SNPqUkGl0n_Ms1iJa_6wD6LBwX8efL_NOyXvAX
> -iCMI&m=Af3Vz7Jwj42zg2TmQe6-
> BpsSzCWoeRVDxlAtzIB9e_Rtv6KG1mT0_Lq0_HnJyz1E&s=pR-
> 2iG1huVG6g7jrnjHx-nhJVQHnJWu-UJxrd6ziFx4&e=
> > +    cd tvmdp
> > +    git checkout main
> > +    cmake -S ./ -B build \
> > +      -
> DCMAKE_TOOLCHAIN_FILE=config/toolchains/arm64_linux_gcc.cmake \
> > +      -DBUILD_SHARED_LIBS=ON \
> > +      -DBUILD_TESTING=OFF
> 
> [main]dell[tvmdp] $ cmake -S ./ -B build -
> DCMAKE_INSTALL_PREFIX=/export/cross_prefix/prefix
> -DCMAKE_TOOLCHAIN_FILE=config/toolchains/arm64_linux_gcc.cmake
> -DBUILD_SHARED_LIBS=ON  -DBUILD_TESTING=OFF
> -- The CXX compiler identification is GNU 13.2.0
> -- The C compiler identification is GNU 13.2.0
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> CMake Error at CMakeLists.txt:53 (find_package):
>   By not providing "Finddmlc.cmake" in CMAKE_MODULE_PATH this project
> has
>   asked CMake to find a package configuration file provided by "dmlc", but
>   CMake did not find one.
> 
>   Could not find a package configuration file provided by "dmlc" with any of
>   the following names:
> 
>     dmlcConfig.cmake
>     dmlc-config.cmake
> 
>   Add the installation prefix of "dmlc" to CMAKE_PREFIX_PATH or set
>   "dmlc_DIR" to a directory containing one of the above files.  If "dmlc"
>   provides a separate development package or SDK, be sure it has been
>   installed.
> 
> 
> -- Configuring incomplete, errors occurred!

This is bug in TVMDP CMakeLists.txt. This issue is fixed now and change is pushed to TVMDP's github repo.
> 
> 
> > +enable_mvtvm = true
> > +
> > +if not jansson_dep.found()
> > +        message('drivers/ml/cnxk: jansson not found')
> > +        enable_mvtvm = false
> > +endif
> > +
> > +if not cc.check_header('dlpack/dlpack.h')
> > +        message('drivers/ml/cnxk: dlpack.h not found')
> > +        enable_mvtvm = false
> > +endif
> > +
> > +tvmrt_lib = cc.find_library('tvm_runtime', required: false) if
> > +tvmrt_lib.found()
> > +        tvmrt_dep = declare_dependency(dependencies: tvmrt_lib) else
> > +        message('drivers/ml/cnxk: tvm_runtime not found')
> > +        enable_mvtvm = false
> > +endif
> > +
> > +tvmdp_dep = dependency('tvmdp', required: false) if not
> > +tvmdp_dep.found()
> > +        message('drivers/ml/cnxk: tvmdp not found')
> > +        enable_mvtvm = false
> > +endif
> > +
> >  sources = files(
> >          'cn10k_ml_dev.c',
> >          'cn10k_ml_ops.c',
> > @@ -21,6 +47,39 @@ sources = files(
> >
> >  deps += ['mldev', 'common_cnxk', 'kvargs', 'hash']
> >
> > +if enable_mvtvm
> > +
> > +dpdk_conf.set('RTE_MLDEV_CNXK_ENABLE_MVTVM', 1)
> > +
> > +driver_sdk_headers += files(
> > +        'mvtvm_ml_ops.h',
> > +)
> 
> Remove this
Done. Change part of version 7.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 00/29] promote many API's to stable
  2023-10-18 19:14  0%   ` David Marchand
@ 2023-10-18 19:41  3%     ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2023-10-18 19:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Tyler Retzlaff, Thomas Monjalon

On Wed, Oct 18, 2023 at 9:14 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> Hello Stephen,
>
> On Wed, Aug 9, 2023 at 2:10 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > Since 23.11 is an LTS release it is time to remove the experimental
> > bandaid off many API's. There are about 850 API's marked with experimental
> > on current main branch. This addresses the easy to remove ones and
> > gets it down to about 690 places.
> >
> > The rule is any API that has been in since 22.11 needs to have
> > experimental removed (or deleted). The experimental flag is
> > intended to be temporary not a "get out of ABI stability for free" card.
> >
> > v2 - add more libraries to the mix
> >    - remove EXPERIMENTAL where tagged in MAINTAINERS
>
> There were some API updates merged in -rc1.
> Could you please rebase this series?

Some additional comments to this request.

rte_compat.h is only needed for __rte_experimental and __rte_internal tags.
There is probably some unnecessary #include <rte_compat.h> left behind
after this series.

About version.map content, I recommend using ./devtools/update-abi.sh
$(cat ABI_VERSION) as it sorts the stable symbols for you (but leave
experimental and internal sections untouched).


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 00/29] promote many API's to stable
  @ 2023-10-18 19:14  0%   ` David Marchand
  2023-10-18 19:41  3%     ` David Marchand
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-10-18 19:14 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev, Tyler Retzlaff, Thomas Monjalon

Hello Stephen,

On Wed, Aug 9, 2023 at 2:10 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> Since 23.11 is an LTS release it is time to remove the experimental
> bandaid off many API's. There are about 850 API's marked with experimental
> on current main branch. This addresses the easy to remove ones and
> gets it down to about 690 places.
>
> The rule is any API that has been in since 22.11 needs to have
> experimental removed (or deleted). The experimental flag is
> intended to be temporary not a "get out of ABI stability for free" card.
>
> v2 - add more libraries to the mix
>    - remove EXPERIMENTAL where tagged in MAINTAINERS

There were some API updates merged in -rc1.
Could you please rebase this series?

Thanks.

-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v6 18/34] ml/cnxk: support config and close of tvmdp library
  @ 2023-10-18 18:34  5%     ` Jerin Jacob
  2023-10-19  6:44  0%       ` [EXT] " Srikanth Yalavarthi
  0 siblings, 1 reply; 200+ results
From: Jerin Jacob @ 2023-10-18 18:34 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara, aprabhu, ptakkar

On Wed, Oct 18, 2023 at 7:52 PM Srikanth Yalavarthi
<syalavarthi@marvell.com> wrote:
>
> Added support to configure and close TVMDP library based
> on ML device configuration options.
>
> Updated meson build to enable Jansson, TVM runtime, TVMDP
> library as build dependencies.
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---

>
> +Compilation Prerequisites
> +-------------------------
> +
> +This driver requires external libraries to optionally enable support for
> +models compiled using Apache TVM framework. The following dependencies are
> +not part of DPDK and must be installed separately:
> +
> +- **Jansson**
> +
> +  This library enables support to parse and read JSON files.
> +
> +- **DLPack**
> +
> +  This library provides headers for open in-memory tensor structures.
> +
> +.. note::
> +
> +    DPDK CNXK ML driver requires DLPack version 0.7
> +
> +.. code-block:: console


Please add sections for cross and native.

> +    git clone https://github.com/dmlc/dlpack.git
> +    cd dlpack
> +    git checkout v0.7 -b v0.7
> +    cmake -S ./ -B build \
> +      -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
> +      -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
> +      -DBUILD_MOCK=OFF
> +    make -C build
> +    make -C build install
> +
> +- **TVM**
> +
> +  Apache TVM provides a runtime library (libtvm_runtime) used to execute
> +  models on CPU cores or hardware accelerators.
> +
> +.. note::
> +
> +    DPDK CNXK ML driver requires TVM version 0.10.0
> +
> +.. code-block:: console
> +
> +    git clone https://github.com/apache/tvm.git

I need to use --recursive to avoid
CMake Error at /usr/share/cmake/Modules/ExternalProject.cmake:3176 (message):
  No download info given for 'project_libbacktrace' and its source directory:


> +    cd tvm
> +    git checkout v0.10.0 -b v0.10.0
> +    cmake -S ./ -B build \
> +      -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \
> +      -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \
> +      -DMACHINE_NAME=aarch64-linux-gnu \
> +      -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
> +      -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY
> +    make -C build
> +    make -C build install
> +
> +- **TVMDP**
> +
> +  Marvell's `TVM Dataplane Library <https://github.com/MarvellEmbeddedProcessors/tvmdp>`_
> +  works as an interface between TVM runtime and DPDK drivers. TVMDP library
> +  provides a simplified C interface for TVM's runtime based on C++.
> +
> +.. code-block:: console
> +
> +    git clone https://github.com/MarvellEmbeddedProcessors/tvmdp.git
> +    cd tvmdp
> +    git checkout main
> +    cmake -S ./ -B build \
> +      -DCMAKE_TOOLCHAIN_FILE=config/toolchains/arm64_linux_gcc.cmake \
> +      -DBUILD_SHARED_LIBS=ON \
> +      -DBUILD_TESTING=OFF

[main]dell[tvmdp] $ cmake -S ./ -B build
-DCMAKE_INSTALL_PREFIX=/export/cross_prefix/prefix
-DCMAKE_TOOLCHAIN_FILE=config/toolchains/arm64_linux_gcc.cmake
-DBUILD_SHARED_LIBS=ON  -DBUILD_TESTING=OFF
-- The CXX compiler identification is GNU 13.2.0
-- The C compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:53 (find_package):
  By not providing "Finddmlc.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "dmlc", but
  CMake did not find one.

  Could not find a package configuration file provided by "dmlc" with any of
  the following names:

    dmlcConfig.cmake
    dmlc-config.cmake

  Add the installation prefix of "dmlc" to CMAKE_PREFIX_PATH or set
  "dmlc_DIR" to a directory containing one of the above files.  If "dmlc"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!


> +enable_mvtvm = true
> +
> +if not jansson_dep.found()
> +        message('drivers/ml/cnxk: jansson not found')
> +        enable_mvtvm = false
> +endif
> +
> +if not cc.check_header('dlpack/dlpack.h')
> +        message('drivers/ml/cnxk: dlpack.h not found')
> +        enable_mvtvm = false
> +endif
> +
> +tvmrt_lib = cc.find_library('tvm_runtime', required: false)
> +if tvmrt_lib.found()
> +        tvmrt_dep = declare_dependency(dependencies: tvmrt_lib)
> +else
> +        message('drivers/ml/cnxk: tvm_runtime not found')
> +        enable_mvtvm = false
> +endif
> +
> +tvmdp_dep = dependency('tvmdp', required: false)
> +if not tvmdp_dep.found()
> +        message('drivers/ml/cnxk: tvmdp not found')
> +        enable_mvtvm = false
> +endif
> +
>  sources = files(
>          'cn10k_ml_dev.c',
>          'cn10k_ml_ops.c',
> @@ -21,6 +47,39 @@ sources = files(
>
>  deps += ['mldev', 'common_cnxk', 'kvargs', 'hash']
>
> +if enable_mvtvm
> +
> +dpdk_conf.set('RTE_MLDEV_CNXK_ENABLE_MVTVM', 1)
> +
> +driver_sdk_headers += files(
> +        'mvtvm_ml_ops.h',
> +)

Remove this

^ permalink raw reply	[relevance 5%]

* Re: [PATCH v1 5/6] power: add eventdev support for power management
  2023-10-18  7:08  3%       ` Tummala, Sivaprasad
@ 2023-10-18  7:13  0%         ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2023-10-18  7:13 UTC (permalink / raw)
  To: Tummala, Sivaprasad
  Cc: harry.van.haaren, anatoly.burakov, dev, Yigit, Ferruh, david.hunt

On Wed, Oct 18, 2023 at 12:38 PM Tummala, Sivaprasad
<Sivaprasad.Tummala@amd.com> wrote:
>
> [AMD Official Use Only - General]
>
> Hi Jerin,
>
> > -----Original Message-----
> > From: Jerin Jacob <jerinjacobk@gmail.com>
> > Sent: Tuesday, October 17, 2023 8:53 AM
> > To: Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>
> > Cc: harry.van.haaren@intel.com; anatoly.burakov@intel.com; dev@dpdk.org; Yigit,
> > Ferruh <Ferruh.Yigit@amd.com>; david.hunt@intel.com
> > Subject: Re: [PATCH v1 5/6] power: add eventdev support for power management
> >
> > Caution: This message originated from an External Source. Use proper caution
> > when opening attachments, clicking links, or responding.
> >
> >
> > On Tue, Oct 17, 2023 at 2:27 AM Sivaprasad Tummala
> > <sivaprasad.tummala@amd.com> wrote:
> > >
> > > Add eventdev support to enable power saving when no events are
> > > arriving. It is based on counting the number of empty polls and, when
> > > the number reaches a certain threshold, entering an
> > > architecture-defined optimized power state that will either wait until
> > > a TSC timestamp expires, or when events arrive.
> > >
> > > This API mandates a core-to-single-port mapping (i.e. one core polling
> > > multiple ports of event device is not supported). This should be ok as
> > > the general use case will have one CPU core using one port to
> > > enqueue/dequeue events from an eventdev.
> > >
> > > This design is using Eventdev PMD Dequeue callbacks.
> > >
> > > 1. MWAITX/MONITORX:
> > >
> > >    When a certain threshold of empty polls is reached, the core will go
> > >    into a power optimized sleep while waiting on an address of next RX
> > >    descriptor to be written to.
> > >
> > > 2. Pause instruction
> > >
> > >    This method uses the pause instruction to avoid busy polling.
> > >
> > > Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> >
> >
> > Hi Siva,
> >
> > It does not look it is aligned with previous discussion.
> >
> > I spend a couple of minutes to draft semantics. Please treat as reference.
> >
> > # IMO, only following public SLOW PATH eventdev API required.(Just share the
> > concept)
> >
> > enum rte_event_pmgmt_modes {
> >        /** Default power management scheme */
> >     RTE_EVENT_POWER_MGMT_TYPE_DEFAULT;
> >    /** Use power-optimized monitoring to wait for incoming traffic */
> >         RTE_EVENT_POWER_MGMT_TYPE_F_CPU_MONITOR = RTE_BIT(0),
> >         /** Use power-optimized sleep to avoid busy polling */
> >         RTE_EVENT_POWER_MGMT_TYPE_F_CPU_PAUSE = RTE_BIT(1),
> >        /** HW based power management scheme found in ARM64 machines, where
> > core goes to sleep state till event available on dequeue */
> > RTE_EVENT_POWER_MGMT_TYPE_F_HW_WFE_ON_DEQUEUE = RTE_BIT(2),
> >
> > };
> >
> > int rte_event_port_pmgmt_type_supported_get(uint8_t dev_id, enum
> > rte_event_pmgmt_modes *mode_flags)
> > /** Device must be in stop state */
> > int rte_event_port_pmgmt_enable(uint8_t dev_id, uint8_t port_id, enum
> > rte_event_pmgmt_modes mode); int rte_event_port_pmgmt_disable(uint8_t
> > dev_id, uint8_t port_id);
> >
> > # It should be self-contained, No need to add to rte_power as it is CPU only power
> > mgmt.(See RTE_EVENT_POWER_MGMT_TYPE_F_HW_WFE_ON_DEQUEUE
> > above)
> >
> > # Add: lib/eventdev/eventdev_pmd_pmgmt.c or so and have CPU based on power
> > management helper functions so that all SW PMD can be reused.
> > example:
> > eventdev_pmd_pmgmt_handle_monitor(uint8_t dev_id, uint8_t port_id, struct
> > rte_event ev[], uint16_t nb_events);
> > eventdev_pmd_pmgmt_handle_pause(uint8_t dev_id, uint8_t port_id, struct
> > rte_event ev[], uint16_t nb_events);
> >
> >
> > # In rte_event_dev_start(), Fixup dev->dequeue_burst if CPU based power
> > management is applicable,and it is selected.
> > ie. new dev->dequeue_burst is existing PMD's  dev->dequeue_burst +
> > eventdev_pmd_pmgmt_handle_.. (based on power management mode selected)
>
> Thanks for the clarification. Will incorporate the changes in next version of the patch (to support power management on event port).
> With the time constraints, I will defer the power management support on event port to next release. However to avoid ABI breakage,
> I will split the Patchset and push the patches to support callbacks in this release, so we don't have to wait for next stable release to
> get these changes integrated.

if you follow this scheme, public callback API is not needed.

 # In rte_event_dev_start(), Fixup dev->dequeue_burst if CPU based power
 management is applicable,and it is selected.
ie. new dev->dequeue_burst is existing PMD's  dev->dequeue_burst +
 eventdev_pmd_pmgmt_handle_.. (based on power management mode selected)


>
> Please let me know your thoughts.
>
> Thanks & Regards,
> Sivaprasad

^ permalink raw reply	[relevance 0%]

* RE: [PATCH v1 5/6] power: add eventdev support for power management
  @ 2023-10-18  7:08  3%       ` Tummala, Sivaprasad
  2023-10-18  7:13  0%         ` Jerin Jacob
  0 siblings, 1 reply; 200+ results
From: Tummala, Sivaprasad @ 2023-10-18  7:08 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: harry.van.haaren, anatoly.burakov, dev, Yigit, Ferruh, david.hunt

[AMD Official Use Only - General]

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Tuesday, October 17, 2023 8:53 AM
> To: Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>
> Cc: harry.van.haaren@intel.com; anatoly.burakov@intel.com; dev@dpdk.org; Yigit,
> Ferruh <Ferruh.Yigit@amd.com>; david.hunt@intel.com
> Subject: Re: [PATCH v1 5/6] power: add eventdev support for power management
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Tue, Oct 17, 2023 at 2:27 AM Sivaprasad Tummala
> <sivaprasad.tummala@amd.com> wrote:
> >
> > Add eventdev support to enable power saving when no events are
> > arriving. It is based on counting the number of empty polls and, when
> > the number reaches a certain threshold, entering an
> > architecture-defined optimized power state that will either wait until
> > a TSC timestamp expires, or when events arrive.
> >
> > This API mandates a core-to-single-port mapping (i.e. one core polling
> > multiple ports of event device is not supported). This should be ok as
> > the general use case will have one CPU core using one port to
> > enqueue/dequeue events from an eventdev.
> >
> > This design is using Eventdev PMD Dequeue callbacks.
> >
> > 1. MWAITX/MONITORX:
> >
> >    When a certain threshold of empty polls is reached, the core will go
> >    into a power optimized sleep while waiting on an address of next RX
> >    descriptor to be written to.
> >
> > 2. Pause instruction
> >
> >    This method uses the pause instruction to avoid busy polling.
> >
> > Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
>
>
> Hi Siva,
>
> It does not look it is aligned with previous discussion.
>
> I spend a couple of minutes to draft semantics. Please treat as reference.
>
> # IMO, only following public SLOW PATH eventdev API required.(Just share the
> concept)
>
> enum rte_event_pmgmt_modes {
>        /** Default power management scheme */
>     RTE_EVENT_POWER_MGMT_TYPE_DEFAULT;
>    /** Use power-optimized monitoring to wait for incoming traffic */
>         RTE_EVENT_POWER_MGMT_TYPE_F_CPU_MONITOR = RTE_BIT(0),
>         /** Use power-optimized sleep to avoid busy polling */
>         RTE_EVENT_POWER_MGMT_TYPE_F_CPU_PAUSE = RTE_BIT(1),
>        /** HW based power management scheme found in ARM64 machines, where
> core goes to sleep state till event available on dequeue */
> RTE_EVENT_POWER_MGMT_TYPE_F_HW_WFE_ON_DEQUEUE = RTE_BIT(2),
>
> };
>
> int rte_event_port_pmgmt_type_supported_get(uint8_t dev_id, enum
> rte_event_pmgmt_modes *mode_flags)
> /** Device must be in stop state */
> int rte_event_port_pmgmt_enable(uint8_t dev_id, uint8_t port_id, enum
> rte_event_pmgmt_modes mode); int rte_event_port_pmgmt_disable(uint8_t
> dev_id, uint8_t port_id);
>
> # It should be self-contained, No need to add to rte_power as it is CPU only power
> mgmt.(See RTE_EVENT_POWER_MGMT_TYPE_F_HW_WFE_ON_DEQUEUE
> above)
>
> # Add: lib/eventdev/eventdev_pmd_pmgmt.c or so and have CPU based on power
> management helper functions so that all SW PMD can be reused.
> example:
> eventdev_pmd_pmgmt_handle_monitor(uint8_t dev_id, uint8_t port_id, struct
> rte_event ev[], uint16_t nb_events);
> eventdev_pmd_pmgmt_handle_pause(uint8_t dev_id, uint8_t port_id, struct
> rte_event ev[], uint16_t nb_events);
>
>
> # In rte_event_dev_start(), Fixup dev->dequeue_burst if CPU based power
> management is applicable,and it is selected.
> ie. new dev->dequeue_burst is existing PMD's  dev->dequeue_burst +
> eventdev_pmd_pmgmt_handle_.. (based on power management mode selected)

Thanks for the clarification. Will incorporate the changes in next version of the patch (to support power management on event port).
With the time constraints, I will defer the power management support on event port to next release. However to avoid ABI breakage,
I will split the Patchset and push the patches to support callbacks in this release, so we don't have to wait for next stable release to
get these changes integrated.

Please let me know your thoughts.

Thanks & Regards,
Sivaprasad

^ permalink raw reply	[relevance 3%]

* release candidate 23.11-rc1
@ 2023-10-17 20:36  4% Thomas Monjalon
       [not found]     ` <MW4PR11MB5912D298978501DAC2092EA49FD4A@MW4PR11MB5912.namprd11.prod.outlook.com>
  2023-10-31 23:15  0% ` Thinh Tran
  0 siblings, 2 replies; 200+ results
From: Thomas Monjalon @ 2023-10-17 20:36 UTC (permalink / raw)
  To: announce

A new DPDK release candidate is ready for testing:
	https://git.dpdk.org/dpdk/tag/?id=v23.11-rc1

There are 617 new patches in this snapshot,
including many API/ABI compatibility breakages.
This release won't be ABI-compatible with previous ones.

Release notes:
	https://doc.dpdk.org/guides/rel_notes/release_23_11.html

Highlights of 23.11-rc1:
	- build requires C11 compiler
	- early support of MSVC build
	- new atomic operations API
	- power management on AMD CPU
	- mbuf recycling
	- flow action type for P4-defined actions
	- flow group miss action
	- flow item for packet type matching
	- TLS record offload
	- security Rx inject
	- eventdev link profiles
	- eventdev adapter for dmadev
	- event dispatcher library

Please test and report issues on bugs.dpdk.org.

DPDK 23.11-rc2 is expected in approximately two weeks.

Thank you everyone



^ permalink raw reply	[relevance 4%]

* RE: [EXT] [PATCH] event/cnxk: fix symbol map
  2023-10-17 12:35  3% [PATCH] event/cnxk: fix symbol map David Marchand
@ 2023-10-17 12:38  0% ` Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 200+ results
From: Pavan Nikhilesh Bhagavatula @ 2023-10-17 12:38 UTC (permalink / raw)
  To: David Marchand, dev, thomas; +Cc: Shijith Thotton, Jerin Jacob Kollanukkaran

> Caught while rebasing a series that check map files.
> 
> Remove superfluous whitespace.
> Current ABI number is 24.
> Sort experimental symbols and annotate them with the version they are
> introduced in.
> 
> Fixes: 03714a41bd26 ("event/cnxk: add event port flow context API")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Thank you.

Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

> ---
>  drivers/event/cnxk/version.map | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/event/cnxk/version.map
> b/drivers/event/cnxk/version.map
> index 9dbf8eb59d..3dd9a8fdd1 100644
> --- a/drivers/event/cnxk/version.map
> +++ b/drivers/event/cnxk/version.map
> @@ -1,9 +1,11 @@
> - DPDK_23 {
> +DPDK_24 {
>  	local: *;
> - };
> +};
> 
> - EXPERIMENTAL {
> +EXPERIMENTAL {
>  	global:
> -	rte_pmd_cnxk_eventdev_wait_head;
> +
> +	# added in 23.11
>  	rte_pmd_cnxk_eventdev_is_head;
> - };
> +	rte_pmd_cnxk_eventdev_wait_head;
> +};
> --
> 2.41.0


^ permalink raw reply	[relevance 0%]

* [PATCH] event/cnxk: fix symbol map
@ 2023-10-17 12:35  3% David Marchand
  2023-10-17 12:38  0% ` [EXT] " Pavan Nikhilesh Bhagavatula
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-10-17 12:35 UTC (permalink / raw)
  To: dev, thomas; +Cc: Pavan Nikhilesh, Shijith Thotton, Jerin Jacob

Caught while rebasing a series that check map files.

Remove superfluous whitespace.
Current ABI number is 24.
Sort experimental symbols and annotate them with the version they are
introduced in.

Fixes: 03714a41bd26 ("event/cnxk: add event port flow context API")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/event/cnxk/version.map | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/event/cnxk/version.map b/drivers/event/cnxk/version.map
index 9dbf8eb59d..3dd9a8fdd1 100644
--- a/drivers/event/cnxk/version.map
+++ b/drivers/event/cnxk/version.map
@@ -1,9 +1,11 @@
- DPDK_23 {
+DPDK_24 {
 	local: *;
- };
+};
 
- EXPERIMENTAL {
+EXPERIMENTAL {
 	global:
-	rte_pmd_cnxk_eventdev_wait_head;
+
+	# added in 23.11
 	rte_pmd_cnxk_eventdev_is_head;
- };
+	rte_pmd_cnxk_eventdev_wait_head;
+};
-- 
2.41.0


^ permalink raw reply	[relevance 3%]

* [PATCH v2] ci: test stdatomic API
  @ 2023-10-17  7:15  4% ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2023-10-17  7:15 UTC (permalink / raw)
  To: dev; +Cc: thomas, Aaron Conole, Michael Santana, Bruce Richardson

Add some compilation tests with C11 atomics enabled.
The headers check can't be enabled (as gcc and clang don't provide
stdatomic before C++23).

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Aaron Conole <aconole@redhat.com>
---
Changelog from v1:
- following Thomas offlist review, tweaked coverage in
  test-meson-builds.sh to reduce the number of build targets,

---
 .ci/linux-build.sh            | 6 +++++-
 .github/workflows/build.yml   | 8 ++++++++
 devtools/test-meson-builds.sh | 4 +++-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index e0b62bac90..b09df07b55 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -92,7 +92,11 @@ fi
 OPTS="$OPTS -Dplatform=generic"
 OPTS="$OPTS -Ddefault_library=$DEF_LIB"
 OPTS="$OPTS -Dbuildtype=$buildtype"
-OPTS="$OPTS -Dcheck_includes=true"
+if [ "$STDATOMIC" = "true" ]; then
+	OPTS="$OPTS -Denable_stdatomic=true"
+else
+	OPTS="$OPTS -Dcheck_includes=true"
+fi
 if [ "$MINI" = "true" ]; then
     OPTS="$OPTS -Denable_drivers=net/null"
     OPTS="$OPTS -Ddisable_libs=*"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 7a2ac0ceee..14328622fb 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -30,6 +30,7 @@ jobs:
       REF_GIT_TAG: none
       RISCV64: ${{ matrix.config.cross == 'riscv64' }}
       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
+      STDATOMIC: ${{ contains(matrix.config.checks, 'stdatomic') }}
 
     strategy:
       fail-fast: false
@@ -38,6 +39,12 @@ jobs:
           - os: ubuntu-20.04
             compiler: gcc
             mini: mini
+          - os: ubuntu-20.04
+            compiler: gcc
+            checks: stdatomic
+          - os: ubuntu-20.04
+            compiler: clang
+            checks: stdatomic
           - os: ubuntu-20.04
             compiler: gcc
             checks: debug+doc+examples+tests
@@ -241,6 +248,7 @@ jobs:
         > ~/env
         echo CC=ccache ${{ matrix.config.compiler }} >> ~/env
         echo DEF_LIB=${{ matrix.config.library }} >> ~/env
+        echo STDATOMIC=false >> ~/env
     - name: Load the cached image
       run: |
         docker load -i ~/.image/${{ matrix.config.image }}.tar
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 605a855999..5c07063cbd 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -227,11 +227,13 @@ for c in gcc clang ; do
 	for s in static shared ; do
 		if [ $s = shared ] ; then
 			abicheck=ABI
+			stdatomic=-Denable_stdatomic=true
 		else
 			abicheck=skipABI # save time and disk space
+			stdatomic=-Denable_stdatomic=false
 		fi
 		export CC="$CCACHE $c"
-		build build-$c-$s $c $abicheck --default-library=$s
+		build build-$c-$s $c $abicheck $stdatomic --default-library=$s
 		unset CC
 	done
 done
-- 
2.41.0


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v3] bus/cdx: provide driver flag for optional resource mapping
  2023-10-13 11:51  0%         ` Gangurde, Abhijit
@ 2023-10-13 12:15  0%           ` David Marchand
  0 siblings, 0 replies; 200+ results
From: David Marchand @ 2023-10-13 12:15 UTC (permalink / raw)
  To: Gangurde, Abhijit
  Cc: Gupta, Nipun, Agarwal, Nikhil, dev, Yigit, Ferruh, thomas

On Fri, Oct 13, 2023 at 1:52 PM Gangurde, Abhijit
<abhijit.gangurde@amd.com> wrote:
>
> > > > > +/**
> > > > > + * Map the CDX device resources in user space virtual memory address.
> > > > > + *
> > > > > + * Note that driver should not call this function when flag
> > > > > + * RTE_CDX_DRV_NEED_MAPPING is set, as EAL will do that for
> > > > > + * you when it's on.
> > > >
> > > > Why should we export this function in the application ABI, if it is
> > > > only used by drivers?
> > >
> > > This can be called from an application as well if this flag is not set hence, we
> > need to export this function.
> >
> > What kind of applications / in which usecase, one would need to map
> > the device resources?
> > Except a driver?
>
> I understand that it is probably not the ideal use case, but some of the customers
> are using a single application which also registers itself as driver. Probably such
> applications need to use internal APIs instead of making these APIs external.
> Will analyze it further and send another rev of this patch.

External drivers should be supported with current code.
DPDK must be built with enable_driver_sdk option, and the external
driver code can include bus_cdx_driver.h.
Possibly compiling this code with -DENABLE_INTERNAL_API cflag will be necessary.


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* RE: [PATCH v3] bus/cdx: provide driver flag for optional resource mapping
  2023-10-04 12:54  0%       ` David Marchand
@ 2023-10-13 11:51  0%         ` Gangurde, Abhijit
  2023-10-13 12:15  0%           ` David Marchand
  0 siblings, 1 reply; 200+ results
From: Gangurde, Abhijit @ 2023-10-13 11:51 UTC (permalink / raw)
  To: David Marchand; +Cc: Gupta, Nipun, Agarwal, Nikhil, dev, Yigit, Ferruh, thomas

> > > > +/**
> > > > + * Map the CDX device resources in user space virtual memory address.
> > > > + *
> > > > + * Note that driver should not call this function when flag
> > > > + * RTE_CDX_DRV_NEED_MAPPING is set, as EAL will do that for
> > > > + * you when it's on.
> > >
> > > Why should we export this function in the application ABI, if it is
> > > only used by drivers?
> >
> > This can be called from an application as well if this flag is not set hence, we
> need to export this function.
> 
> What kind of applications / in which usecase, one would need to map
> the device resources?
> Except a driver?

I understand that it is probably not the ideal use case, but some of the customers
are using a single application which also registers itself as driver. Probably such
applications need to use internal APIs instead of making these APIs external.
Will analyze it further and send another rev of this patch.

Thanks,
Abhijit

^ permalink raw reply	[relevance 0%]

* [PATCH v2 3/3] doc: add a relax rx mode requirement option
  @ 2023-10-13  4:27  9% ` Trevor Tao
  0 siblings, 0 replies; 200+ results
From: Trevor Tao @ 2023-10-13  4:27 UTC (permalink / raw)
  To: dev; +Cc: Trevor Tao

Add an option to enable the RX mode requirement relax
in release notes and l3fwd sample guide.

Signed-off-by: Trevor Tao <taozj888@163.com>
---
 doc/guides/rel_notes/release_23_11.rst  | 251 +++++++++++++++++++++---
 doc/guides/sample_app_ug/l3_forward.rst |   4 +-
 2 files changed, 230 insertions(+), 25 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index f09ecd50fe..3f1d5039c3 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -20,26 +20,14 @@ DPDK Release 23.11
       ninja -C build doc
       xdg-open build/doc/guides/html/rel_notes/release_23_11.html
 
-* Build Requirements: From DPDK 23.11 onwards,
-  building DPDK will require a C compiler which supports the C11 standard,
-  including support for C11 standard atomics.
-
-  More specifically, the requirements will be:
 
-  * Support for flag "-std=c11" (or similar)
-  * __STDC_NO_ATOMICS__ is *not defined* when using c11 flag
+New Features
+------------
 
-  Please note:
+   * **Added support for models with multiple I/O in mldev library.**
 
-  * C11, including standard atomics, is supported from GCC version 5 onwards,
-    and is the default language version in that release
-    (Ref: https://gcc.gnu.org/gcc-5/changes.html)
-  * C11 is the default compilation mode in Clang from version 3.6,
-    which also added support for standard atomics
-    (Ref: https://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html)
+     Added support in mldev library for models with multiple inputs and outputs.
 
-New Features
-------------
 
 .. This section should contain new features added in this release.
    Sample format:
@@ -72,18 +60,177 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
-* build: Enabling deprecated libraries is now done using the new
-  ``enable_deprecated_libraries`` build option.
+* **Build requirements increased for C11.**
+
+  From DPDK 23.11 onwards,
+  building DPDK will require a C compiler which supports the C11 standard,
+  including support for C11 standard atomics.
+
+  More specifically, the requirements will be:
 
-* build: Optional libraries can now be selected with the new ``enable_libs``
-  build option similarly to the existing ``enable_drivers`` build option.
+  * Support for flag "-std=c11" (or similar)
+  * __STDC_NO_ATOMICS__ is *not defined* when using c11 flag
 
-* eal: Introduced a new API for atomic operations. This new API serves as a
-  wrapper for transitioning to standard atomic operations as described in the
-  C11 standard. This API implementation points at the compiler intrinsics by
-  default. The implementation using C11 standard atomic operations is enabled
+  Please note:
+
+  * C11, including standard atomics, is supported from GCC version 5 onwards,
+    and is the default language version in that release
+    (Ref: https://gcc.gnu.org/gcc-5/changes.html)
+  * C11 is the default compilation mode in Clang from version 3.6,
+    which also added support for standard atomics
+    (Ref: https://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html)
+
+* **Added new build options.**
+
+  * Enabling deprecated libraries is now done using
+    the new ``enable_deprecated_libraries`` build option.
+  * Optional libraries can now be selected with the new ``enable_libs``
+    build option similarly to the existing ``enable_drivers`` build option.
+
+* **Introduced a new API for atomic operations.**
+
+  This new API serves as a wrapper for transitioning
+  to standard atomic operations as described in the C11 standard.
+  This API implementation points at the compiler intrinsics by default.
+  The implementation using C11 standard atomic operations is enabled
   via the ``enable_stdatomic`` build option.
 
+* **Added support for power intrinsics with AMD processors.**
+
+* **Added support for allow/block list in vmbus bus driver.***
+
+  The ``vmbus`` bus driver now supports -a and -b EAL options for selecting
+  devices.
+
+* **Added mbuf recycling support.**
+
+  Added ``rte_eth_recycle_rx_queue_info_get`` and ``rte_eth_recycle_mbufs``
+  functions which allow the user to copy used mbufs from the Tx mbuf ring
+  into the Rx mbuf ring. This feature supports the case that the Rx Ethernet
+  device is different from the Tx Ethernet device with respective driver
+  callback functions in ``rte_eth_recycle_mbufs``.
+
+* **Added amd-pstate driver support to the power management library.**
+
+  Added support for amd-pstate driver which works on AMD EPYC processors.
+
+* **Added a flow action type for P4-defined actions.**
+
+  For P4-programmable devices, hardware pipeline can be configured through
+  a new "PROG" action type and its associated custom arguments.
+  Such P4 pipeline, not using the standard blocks of the flow API,
+  can be managed with ``RTE_FLOW_ITEM_TYPE_FLEX`` and ``RTE_FLOW_ACTION_TYPE_PROG``.
+
+* **Added flow group set miss actions.**
+
+  Introduced ``rte_flow_group_set_miss_actions()`` API to explicitly set
+  a group's miss actions, which are the actions to be performed on packets
+  that didn't match any of the flow rules in the group.
+
+* **Updated Marvell cnxk net driver.**
+
+  * Added support for ``RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT`` flow item.
+  * Added support for ``RTE_FLOW_ACTION_TYPE_AGE`` flow action.
+
+* **Updated Solarflare net driver.**
+
+  * Added support for transfer flow action ``INDIRECT`` with subtype ``VXLAN_ENCAP``.
+  * Supported packet replay (multi-count / multi-delivery) in transfer flows.
+
+* **Updated Netronome/Corigine nfp driver.**
+
+  * Added inline IPsec offload based on the security framework.
+
+* **Updated Wangxun ngbe driver.**
+
+  * Added 100M and auto-neg support in YT PHY fiber mode.
+
+* **Added support for TLS and DTLS record processing.**
+
+  Added TLS and DTLS record transform for security session
+  and added enhancements to ``rte_crypto_op`` fields
+  to handle all datapath requirements of TLS and DTLS.
+  The support was added for TLS 1.2, TLS 1.3 and DTLS 1.2.
+
+* **Added out of place processing support for inline ingress security session.**
+
+  Similar to out of place processing support for lookaside security session,
+  added the same support for inline ingress security session.
+
+* **Added security Rx inject API.**
+
+  Added Rx inject API to allow applications to submit packets
+  for protocol offload and have them injected back to ethdev Rx
+  so that further ethdev Rx actions (IP reassembly, packet parsing and flow lookups)
+  can happen based on inner packet.
+
+  The API when implemented by an ethdev, application would be able to process
+  packets that are received without/failed inline offload processing
+  (such as fragmented ESP packets with inline IPsec offload).
+  The API when implemented by a cryptodev, can be used for injecting packets
+  to ethdev Rx after IPsec processing and take advantage of ethdev Rx actions
+  for the inner packet which cannot be accelerated in inline protocol offload mode.
+
+* **Updated cryptodev scheduler driver.**
+
+  * Added support for DOCSIS security protocol
+    through the ``rte_security`` API callbacks.
+
+* **Updated ipsec_mb crypto driver.**
+
+  * Added support for digest encrypted to AESNI_MB asynchronous crypto driver.
+
+* **Updated Intel QuickAssist Technology driver.**
+
+  * Enabled support for QAT 2.0c (4944) devices in QAT crypto driver.
+
+* **Updated Marvell cnxk crypto driver.**
+
+  * Added SM2 algorithm support in asymmetric crypto operations.
+
+* **Updated Intel vRAN Boost baseband driver.**
+
+  * Added support for the new Intel vRAN Boost v2 device variant (GNR-D)
+    within the unified driver.
+
+* **Added new eventdev Ethernet Rx adapter create API.**
+
+  Added new function ``rte_event_eth_rx_adapter_create_ext_with_params()``
+  for creating Rx adapter instance for the applications desire to
+  control both the event port allocation and event buffer size.
+
+* **Added event DMA adapter library.**
+
+  * Added the Event DMA Adapter Library. This library extends the event-based
+    model by introducing APIs that allow applications to enqueue/dequeue DMA
+    operations to/from dmadev as events scheduled by an event device.
+
+* **Added eventdev support to link queues to port with link profile.**
+
+  Introduced event link profiles that can be used to associated links between
+  event queues and an event port with a unique identifier termed as link profile.
+  The profile can be used to switch between the associated links in fast-path
+  without the additional overhead of linking/unlinking and waiting for unlinking.
+
+  * Added ``rte_event_port_profile_links_set``, ``rte_event_port_profile_unlink``
+    ``rte_event_port_profile_links_get`` and ``rte_event_port_profile_switch``
+    functions to enable this feature.
+
+* **Updated Marvell cnxk eventdev driver.**
+
+  * Added support for ``remaining_ticks_get`` timer adapter PMD callback
+    to get the remaining ticks to expire for a given event timer.
+  * Added link profiles support, up to two link profiles are supported.
+
+* **Added dispatcher library.**
+
+  Added dispatcher library which purpose is to help decouple different
+  parts (modules) of an eventdev-based application.
+
+* **Added a command option ``--relax-rx-mode`` in l3fwd example.**
+
+  Added a command option ``--relax-rx-mode`` in l3fwd example
+  to relax the rx RSS/Offload mode requirement if needed.
 
 Removed Items
 -------------
@@ -99,10 +246,23 @@ Removed Items
 
 * eal: Removed deprecated ``RTE_FUNC_PTR_OR_*`` macros.
 
+* ethdev: Removed deprecated macro ``RTE_ETH_DEV_BONDED_SLAVE``.
+
 * flow_classify: Removed flow classification library and examples.
 
 * kni: Removed the Kernel Network Interface (KNI) library and driver.
 
+* cryptodev: Removed the arrays of algorithm strings ``rte_crypto_cipher_algorithm_strings``,
+  ``rte_crypto_auth_algorithm_strings``, ``rte_crypto_aead_algorithm_strings`` and
+  ``rte_crypto_asym_xform_strings``.
+
+* cryptodev: Removed explicit SM2 xform parameter in asymmetric xform.
+
+* security: Removed deprecated field ``reserved_opts``
+  from struct ``rte_security_ipsec_sa_options``.
+
+* mldev: Removed functions ``rte_ml_io_input_size_get`` and ``rte_ml_io_output_size_get``.
+
 
 API Changes
 -----------
@@ -125,6 +285,38 @@ API Changes
   except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
   replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
+* eal: Removed ``RTE_CPUFLAG_NUMFLAGS`` to avoid misusage and theoretical ABI
+  compatibility issue when adding new cpuflags.
+
+* bonding: Replaced master/slave to main/member. The data structure
+  ``struct rte_eth_bond_8023ad_slave_info`` was renamed to
+  ``struct rte_eth_bond_8023ad_member_info`` in DPDK 23.11.
+  The following functions were removed in DPDK 23.11.
+  The old functions:
+  ``rte_eth_bond_8023ad_slave_info``,
+  ``rte_eth_bond_active_slaves_get``,
+  ``rte_eth_bond_slave_add``,
+  ``rte_eth_bond_slave_remove``, and
+  ``rte_eth_bond_slaves_get``
+  will be replaced by:
+  ``rte_eth_bond_8023ad_member_info``,
+  ``rte_eth_bond_active_members_get``,
+  ``rte_eth_bond_member_add``,
+  ``rte_eth_bond_member_remove``, and
+  ``rte_eth_bond_members_get``.
+
+* cryptodev: The elliptic curve asymmetric private and public keys can be maintained
+  per session. These keys are moved from per packet ``rte_crypto_ecdsa_op_param`` and
+  ``rte_crypto_sm2_op_param`` to generic EC xform ``rte_crypto_ec_xform``.
+
+* security: Structures ``rte_security_ops`` and ``rte_security_ctx`` were moved to
+  internal library headers not visible to application.
+
+* mldev: Updated the structure ``rte_ml_model_info`` to support input and output
+  with arbitrary shapes.
+  Updated ``rte_ml_op``, ``rte_ml_io_quantize`` and ``rte_ml_io_dequantize``
+  to support an array of ``rte_ml_buff_seg``.
+
 
 ABI Changes
 -----------
@@ -141,6 +333,17 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields to ``rte_eth_dev`` structure.
+
+* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
+  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields, to move ``rxq`` and ``txq`` fields, to change the size of
+  ``reserved1`` and ``reserved2`` fields.
+
+* security: struct ``rte_security_ipsec_sa_options`` was updated
+  due to inline out-of-place feature addition.
+
 
 Known Issues
 ------------
diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst
index 1cc2c1dd1d..00283f070c 100644
--- a/doc/guides/sample_app_ug/l3_forward.rst
+++ b/doc/guides/sample_app_ug/l3_forward.rst
@@ -126,6 +126,8 @@ Where,
 
 * ``--parse-ptype:`` Optional, set to use software to analyze packet type. Without this option, hardware will check the packet type.
 
+* ``--relax-rx-mode:`` Optional, set to enable rx mode relax when RSS/offload is not fully supported by the hardware. When the IPv4 cksum offload is relaxed, it is calculated by the software instead. Without this option, the RSS and cksum offload will be forced.
+
 * ``--per-port-pool:`` Optional, set to use independent buffer pools per port. Without this option, single buffer pool is used for all ports.
 
 * ``--mode:`` Optional, Packet transfer mode for I/O, poll or eventdev.
@@ -140,7 +142,7 @@ Where,
 
 * ``--event-vector-tmo:`` Optional, Max timeout to form vector in nanoseconds if event vectorization is enabled.
 
-* ``--alg=<val>:`` optional, ACL classify method to use, one of:
+* ``--alg=<val>:`` Optional, ACL classify method to use, one of:
   ``scalar|sse|avx2|neon|altivec|avx512x16|avx512x32``
 
 * ``-E:`` Optional, enable exact match,
-- 
2.34.1


^ permalink raw reply	[relevance 9%]

* Re: [PATCH v5 00/40] support setting and querying RSS algorithms
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
  2023-10-11  9:27  4%         ` [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-10-11 18:19  0%         ` [PATCH v5 00/40] support setting and querying RSS algorithms Ferruh Yigit
@ 2023-10-12 16:49  0%         ` Stephen Hemminger
    2023-10-27  9:28  3%         ` [PATCH 0/9] " Jie Hai
  4 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-12 16:49 UTC (permalink / raw)
  To: Jie Hai; +Cc: dev, lihuisong, fengchengwen, liudongdong3

On Wed, 11 Oct 2023 17:27:25 +0800
Jie Hai <haijie1@huawei.com> wrote:

> This patchset is to support setting and querying RSS algorithms.
> 
> --
> v5:
> 1. rewrite some comments.
> 2. check RSS algorithm for drivers supporting RSS.
> 3. change field "func" of rss_conf to "algorithm".
> 4. fix commit log for [PATCH v4 4/7].
> 5. add Acked-by Reshma Pattan.
> 6. add symmetric_toeplitz_sort for showing.
> 7. change "hf" to "hash function" for showing.
> 
> v4:
> 1. recomment some definitions related to RSS.
> 2. allocate static memory for rss_key instead of dynamic.
> 3. use array of strings to get the name of rss algorithm.
> 4. add display of rss algorithm with testpmd.
> 
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> 
> Huisong Li (1):
>   net/hns3: support setting and querying RSS hash function
> 
> Jie Hai (39):
>   ethdev: overwrite some comment related to RSS
>   ethdev: support setting and querying RSS algorithm
>   net/atlantic: check RSS hash algorithms
>   net/axgbe: check RSS hash algorithms
>   net/bnx2x: check RSS hash algorithms
>   net/bnxt: check RSS hash algorithms
>   net/bonding: check RSS hash algorithms
>   net/cnxk: check RSS hash algorithms
>   net/cpfl: check RSS hash algorithms
>   net/cxgbe: check RSS hash algorithms
>   net/dpaa: check RSS hash algorithms
>   net/dpaa2: check RSS hash algorithms
>   net/ena: check RSS hash algorithms
>   net/enic: check RSS hash algorithms
>   net/fm10k: check RSS hash algorithms
>   net/hinic: check RSS hash algorithms
>   net/i40e: check RSS hash algorithms
>   net/iavf: check RSS hash algorithms
>   net/ice: check RSS hash algorithms
>   net/idpf: check RSS hash algorithms
>   net/igc: check RSS hash algorithms
>   net/ionic: check RSS hash algorithms
>   net/ixgbe: check RSS hash algorithms
>   net/mana: check RSS hash algorithms
>   net/mlx5: check RSS hash algorithms
>   net/mvpp2: check RSS hash algorithms
>   net/netvsc: check RSS hash algorithms
>   net/ngbe: : check RSS hash algorithms
>   net/nfp: check RSS hash algorithms
>   net/null: check RSS hash algorithms
>   net/qede: check RSS hash algorithms
>   net/sfc: check RSS hash algorithms
>   net/tap: check RSS hash algorithms
>   net/thunderx: check RSS hash algorithms
>   net/txgbe: check RSS hash algorithms
>   app/proc-info: fix never show RSS info
>   app/proc-info: adjust the display format of RSS info
>   app/proc-info: support querying RSS hash algorithm
>   app/testpmd: add RSS hash algorithms display
> 
>  app/proc-info/main.c                   | 32 ++++++++++-----
>  app/test-pmd/cmdline.c                 | 29 ++++++++++---
>  app/test-pmd/config.c                  | 38 ++++++++---------
>  app/test-pmd/testpmd.h                 |  2 +-
>  doc/guides/rel_notes/release_23_11.rst |  2 +
>  drivers/net/atlantic/atl_ethdev.c      |  2 +
>  drivers/net/axgbe/axgbe_ethdev.c       |  9 +++++
>  drivers/net/bnx2x/bnx2x_ethdev.c       |  4 ++
>  drivers/net/bnxt/bnxt_ethdev.c         |  6 +++
>  drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++
>  drivers/net/cnxk/cnxk_ethdev.c         |  5 +++
>  drivers/net/cnxk/cnxk_ethdev_ops.c     |  3 ++
>  drivers/net/cpfl/cpfl_ethdev.c         |  6 +++
>  drivers/net/cxgbe/cxgbe_ethdev.c       |  9 ++++-
>  drivers/net/dpaa/dpaa_ethdev.c         |  7 ++++
>  drivers/net/dpaa2/dpaa2_ethdev.c       |  7 ++++
>  drivers/net/ena/ena_rss.c              |  3 ++
>  drivers/net/enic/enic_ethdev.c         |  1 +
>  drivers/net/enic/enic_main.c           |  3 ++
>  drivers/net/fm10k/fm10k_ethdev.c       |  9 ++++-
>  drivers/net/hinic/hinic_pmd_ethdev.c   |  3 ++
>  drivers/net/hinic/hinic_pmd_rx.c       |  3 ++
>  drivers/net/hns3/hns3_rss.c            | 47 ++++++++++++---------
>  drivers/net/i40e/i40e_ethdev.c         |  7 ++++
>  drivers/net/iavf/iavf_ethdev.c         |  6 +++
>  drivers/net/ice/ice_dcf.c              |  3 ++
>  drivers/net/ice/ice_dcf_ethdev.c       |  3 ++
>  drivers/net/ice/ice_ethdev.c           |  7 ++++
>  drivers/net/idpf/idpf_ethdev.c         |  6 +++
>  drivers/net/igc/igc_ethdev.c           |  4 ++
>  drivers/net/igc/igc_txrx.c             |  5 +++
>  drivers/net/ionic/ionic_ethdev.c       |  6 +++
>  drivers/net/ixgbe/ixgbe_ethdev.c       | 12 +++++-
>  drivers/net/ixgbe/ixgbe_rxtx.c         |  4 ++
>  drivers/net/mana/mana.c                | 11 ++++-
>  drivers/net/mlx5/mlx5_ethdev.c         |  4 ++
>  drivers/net/mlx5/mlx5_rss.c            |  3 +-
>  drivers/net/mvpp2/mrvl_ethdev.c        |  3 ++
>  drivers/net/netvsc/hn_ethdev.c         |  6 +++
>  drivers/net/nfp/nfp_common.c           |  9 ++++-
>  drivers/net/ngbe/ngbe_ethdev.c         |  6 ++-
>  drivers/net/ngbe/ngbe_rxtx.c           |  3 ++
>  drivers/net/null/rte_eth_null.c        |  8 ++++
>  drivers/net/qede/qede_ethdev.c         |  9 ++++-
>  drivers/net/sfc/sfc_ethdev.c           |  3 ++
>  drivers/net/sfc/sfc_rx.c               |  3 ++
>  drivers/net/tap/rte_eth_tap.c          |  8 ++++
>  drivers/net/thunderx/nicvf_ethdev.c    | 10 ++++-
>  drivers/net/txgbe/txgbe_ethdev.c       |  7 +++-
>  drivers/net/txgbe/txgbe_ethdev_vf.c    |  7 +++-
>  drivers/net/txgbe/txgbe_rxtx.c         |  3 ++
>  lib/ethdev/rte_ethdev.c                | 17 ++++++++
>  lib/ethdev/rte_ethdev.h                | 56 +++++++++++++++++++-------
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 25 +-----------
>  55 files changed, 395 insertions(+), 106 deletions(-)
> 

In future, it would be good to report the hash algorithm in the PCAPNG
output from dumpcap.  The current code always reports it as Toeplitz.

One issue is that the PCAPNG standard:
  https://www.ietf.org/staging/draft-tuexen-opsawg-pcapng-02.html#name-enhanced-packet-block
Only has values for a few types:

epb_hash:

	The epb_hash option contains a hash of the packet. The first octet
	specifies the hashing algorithm, while the following octets contain the
	actual hash, whose size depends on the hashing algorithm, and hence
	from the value in the first octet. The hashing algorithm can be: 2s
	complement (algorithm octet = 0, size = XXX), XOR (algorithm octet = 1,
	size=XXX), CRC32 (algorithm octet = 2, size = 4), MD-5 (algorithm octet
	= 3, size = 16), SHA-1 (algorithm octet = 4, size = 20), Toeplitz
	(algorithm octet = 5, size = 4). The hash covers only the packet, not
	the header added by the capture driver: this gives the possibility to
	calculate it inside the network card. The hash allows easier
	comparison/merging of different capture files, and reliable data
	transfer between the data acquisition system and the capture library.

I added the Toeplitz one when pcapng was being managed via github.
Now that it is more in IETF/RFC standard process adding new values probably
would take more effort.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm
  2023-10-12  2:21  0%             ` fengchengwen
@ 2023-10-12 15:23  0%               ` Stephen Hemminger
  2023-10-24 12:54  0%               ` Jie Hai
  1 sibling, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-10-12 15:23 UTC (permalink / raw)
  To: fengchengwen
  Cc: Jie Hai, dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko,
	Ori Kam, lihuisong, liudongdong3

On Thu, 12 Oct 2023 10:21:51 +0800
fengchengwen <fengchengwen@huawei.com> wrote:

> > Rather than having every driver check the algorithm, why not handle this like
> > other features in DPDK (which may mean API/ABI changes). 
> > 
> > Add a field rss_algo_capa which is bit field of available RSS functions.
> > Then the check for algorithm can be done in generic code. There a couple
> > of reserved fields that could be used.  
> 
> +1 for add a field
> 
> But there are two ways to config rss: ethdev-ops, ethdev-rteflow-ops, should distinguish them ? or just define for ethdev-ops ?

One field is likely to be enough.
I would expect that if driver accepts RSS for rte flow, it would also take same RSS setting for non flow case.

^ permalink raw reply	[relevance 0%]

* Re: [EXT] Re: [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code
  2023-10-10 14:48  0%   ` [EXT] " Akhil Goyal
@ 2023-10-12  9:32  0%     ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-10-12  9:32 UTC (permalink / raw)
  To: Akhil Goyal, Nithin Kumar Dabilpuram, Anoob Joseph
  Cc: Jerin Jacob Kollanukkaran, dev, Thomas Monjalon, Andrew Rybchenko

On 10/10/2023 3:48 PM, Akhil Goyal wrote:
>> On 10/4/2023 1:59 PM, Nithin Dabilpuram wrote:
>>> Add IPsec event subtype range for PMD specific code in order
>>> to accommodate wide range of errors that PMD supports.
>>> These IPsec event subtypes are used when an error doesn't
>>> match the spec defined subtypes between
>> RTE_ETH_EVENT_IPSEC_UNKNOWN
>>> and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range
>>> to avoid ABI breakage.
>>>
>>> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
>>> ---
>>>  lib/ethdev/rte_ethdev.h | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
>>> index 8542257721..f949dfc83d 100644
>>> --- a/lib/ethdev/rte_ethdev.h
>>> +++ b/lib/ethdev/rte_ethdev.h
>>> @@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
>>>   * eth device.
>>>   */
>>>  enum rte_eth_event_ipsec_subtype {
>>> +	/**  PMD specific error start */
>>> +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
>>> +	/**  PMD specific error end */
>>> +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
>>>  	/** Unknown event type */
>>>  	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
>>>  	/** Sequence number overflow */
>>>
>>
>> I don't see any problem to extend event subtype with custom error range,
>> @Akhil, @Anoob what do you think?
> 
> I believe it is ok to add the custom error range.
> It is just that the user will need to check the negative values too, which I believe is ok.
> 
> Acked-by: Akhil Goyal <gakhil@marvell.com>
> 
>
> Acked-by: Anoob Joseph <anoobj@marvell.com>
>


Series applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm
  2023-10-11 17:39  4%           ` Stephen Hemminger
@ 2023-10-12  2:21  0%             ` fengchengwen
  2023-10-12 15:23  0%               ` Stephen Hemminger
  2023-10-24 12:54  0%               ` Jie Hai
  0 siblings, 2 replies; 200+ results
From: fengchengwen @ 2023-10-12  2:21 UTC (permalink / raw)
  To: Stephen Hemminger, Jie Hai
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam,
	lihuisong, liudongdong3



On 2023/10/12 1:39, Stephen Hemminger wrote:
> On Wed, 11 Oct 2023 17:27:27 +0800
> Jie Hai <haijie1@huawei.com> wrote:
> 
>> Currently, rte_eth_rss_conf supports configuring and querying
>> RSS hash functions, rss key and it's length, but not RSS hash
>> algorithm.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "algorithm". This represents the RSS algorithms to apply.
>> The following API will be affected:
>> 	- rte_eth_dev_configure
>> 	- rte_eth_dev_rss_hash_update
>> 	- rte_eth_dev_rss_hash_conf_get
>>
>> If the value of "algorithm" used for configuration is a gibberish
>> value, report the error and return. Do the same for
>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
>>
>> To check whether the drivers report valid "algorithm", it is set
>> to default value before querying.
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> ---
>>  doc/guides/rel_notes/release_23_11.rst |  2 ++
>>  lib/ethdev/rte_ethdev.c                | 17 ++++++++++++++++
>>  lib/ethdev/rte_ethdev.h                | 27 +++++++++++++++++++++++++
>>  lib/ethdev/rte_flow.c                  |  1 -
>>  lib/ethdev/rte_flow.h                  | 28 ++------------------------
>>  5 files changed, 48 insertions(+), 27 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
>> index e13d57728071..92a445ab2ed3 100644
>> --- a/doc/guides/rel_notes/release_23_11.rst
>> +++ b/doc/guides/rel_notes/release_23_11.rst
>> @@ -197,6 +197,8 @@ ABI Changes
>>    fields, to move ``rxq`` and ``txq`` fields, to change the size of
>>    ``reserved1`` and ``reserved2`` fields.
>>  
>> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
>> +  hash algorithm.
>>  
>>  Known Issues
>>  ------------
>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>> index 18a4b950b184..2eda1b8072e5 100644
>> --- a/lib/ethdev/rte_ethdev.c
>> +++ b/lib/ethdev/rte_ethdev.c
>> @@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>>  		goto rollback;
>>  	}
>>  
>> +	if (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n",
>> +			port_id, dev_conf->rx_adv_conf.rss_conf.algorithm);
>> +		ret = -EINVAL;
>> +		goto rollback;
>> +	}
>> +
> 
> Rather than having every driver check the algorithm, why not handle this like
> other features in DPDK (which may mean API/ABI changes). 
> 
> Add a field rss_algo_capa which is bit field of available RSS functions.
> Then the check for algorithm can be done in generic code. There a couple
> of reserved fields that could be used.

+1 for add a field

But there are two ways to config rss: ethdev-ops, ethdev-rteflow-ops, should distinguish them ? or just define for ethdev-ops ?

> 
> It would mean updating all the drivers once with the capa field but
> would provide way for application to know what fields are possible.
> 
> It has proved to be a problem in later ABI changes if a maximum value
> is exposed. I.e don't expose RTE_ETH_HASH_FUNCTION_MAX.

+1

> 
> .
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 1/3] lib: introduce dispatcher library
  @ 2023-10-11 20:51  3%                   ` Mattias Rönnblom
  0 siblings, 0 replies; 200+ results
From: Mattias Rönnblom @ 2023-10-11 20:51 UTC (permalink / raw)
  To: David Marchand
  Cc: Mattias Rönnblom, dev, Jerin Jacob, techboard,
	harry.van.haaren, Peter Nilsson, Heng Wang, Naga Harish K S V,
	Pavan Nikhilesh, Gujjar Abhinandan S, Erik Gabriel Carrillo,
	Shijith Thotton, Hemant Agrawal, Sachin Saxena, Liang Ma,
	Peter Mccarthy, Zhirun Yan

On 2023-10-11 16:57, David Marchand wrote:
> On Mon, Oct 9, 2023 at 6:50 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
> 
> [snip]
> 
>>>>>> +static int
>>>>>> +evd_set_service_runstate(struct rte_dispatcher *dispatcher, int state)
>>>>>> +{
>>>>>> +       int rc;
>>>>>> +
>>>>>> +       rc = rte_service_component_runstate_set(dispatcher->service_id,
>>>>>> +                                               state);
>>>>>> +
>>>>>> +       if (rc != 0) {
>>>>>> +               RTE_EDEV_LOG_ERR("Unexpected error %d occurred while setting "
>>>>>> +                                "service component run state to %d\n", rc,
>>>>>> +                                state);
>>>>>> +               RTE_ASSERT(0);
>>>>>
>>>>> Why not propagating the error to callers?
>>>>>
>>>>>
>>>>
>>>> The root cause would be a programming error, hence an assertion is more
>>>> appropriate way to deal with the situation.
>>>
>>> Without building RTE_ENABLE_ASSERT (disabled by default), the code
>>> later in this function will still be executed.
>>>
>>
>> If RTE_ASSERT() is not the way to assure a consistent internal library
>> state, what is? RTE_VERIFY()?
> 
> The usual way in DPDK is to use RTE_VERIFY or rte_panic with the error message.
> There is also libc assert().
> 
> RTE_ASSERT is more of a debug macro since it is under a build option.
> 
> 
> But by making the library "panic" on some assertion, I have followup comments:
> - what is the point of returning an int for rte_dispatcher_start() /
> rte_dispatcher_stop()?
> - rte_dispatcher_start() and rte_dispatcher_stop() (doxygen)
> documentation needs updating, as they can't return anything but 0.
> 
> 

Those return vales are purely there for reasons of symmetry, or maybe 
you can call it API consistent, with Eventdev APIs (e.g., the event 
ethernet RX adapter). I guess that's less of an issue now, when it's a 
separate library, but still relevant, since the programmer will be 
familiar with those APIs.

You could also argue that in the future, there may be errors which needs 
to be signaled to the caller. But that's a weak argument, since we don't 
know exactly what those would be (and thus they can't be documented), so 
it's still an API/ABI change, even though the function signature doesn't 
change.

Now I'm leaning toward removing the return value. Please advise. Over.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 00/40] support setting and querying RSS algorithms
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
  2023-10-11  9:27  4%         ` [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-10-11 18:19  0%         ` Ferruh Yigit
  2023-10-12 16:49  0%         ` Stephen Hemminger
                           ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-10-11 18:19 UTC (permalink / raw)
  To: Jie Hai, dev; +Cc: lihuisong, fengchengwen, liudongdong3

On 10/11/2023 10:27 AM, Jie Hai wrote:
> This patchset is to support setting and querying RSS algorithms.
> 
> --
> v5:
> 1. rewrite some comments.
> 2. check RSS algorithm for drivers supporting RSS.
> 3. change field "func" of rss_conf to "algorithm".
> 4. fix commit log for [PATCH v4 4/7].
> 5. add Acked-by Reshma Pattan.
> 6. add symmetric_toeplitz_sort for showing.
> 7. change "hf" to "hash function" for showing.
> 
> v4:
> 1. recomment some definitions related to RSS.
> 2. allocate static memory for rss_key instead of dynamic.
> 3. use array of strings to get the name of rss algorithm.
> 4. add display of rss algorithm with testpmd.
> 
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> 
> Huisong Li (1):
>   net/hns3: support setting and querying RSS hash function
> 
> Jie Hai (39):
>   ethdev: overwrite some comment related to RSS
>   ethdev: support setting and querying RSS algorithm
>   net/atlantic: check RSS hash algorithms
>   net/axgbe: check RSS hash algorithms
>   net/bnx2x: check RSS hash algorithms
>   net/bnxt: check RSS hash algorithms
>   net/bonding: check RSS hash algorithms
>   net/cnxk: check RSS hash algorithms
>   net/cpfl: check RSS hash algorithms
>   net/cxgbe: check RSS hash algorithms
>   net/dpaa: check RSS hash algorithms
>   net/dpaa2: check RSS hash algorithms
>   net/ena: check RSS hash algorithms
>   net/enic: check RSS hash algorithms
>   net/fm10k: check RSS hash algorithms
>   net/hinic: check RSS hash algorithms
>   net/i40e: check RSS hash algorithms
>   net/iavf: check RSS hash algorithms
>   net/ice: check RSS hash algorithms
>   net/idpf: check RSS hash algorithms
>   net/igc: check RSS hash algorithms
>   net/ionic: check RSS hash algorithms
>   net/ixgbe: check RSS hash algorithms
>   net/mana: check RSS hash algorithms
>   net/mlx5: check RSS hash algorithms
>   net/mvpp2: check RSS hash algorithms
>   net/netvsc: check RSS hash algorithms
>   net/ngbe: : check RSS hash algorithms
>   net/nfp: check RSS hash algorithms
>   net/null: check RSS hash algorithms
>   net/qede: check RSS hash algorithms
>   net/sfc: check RSS hash algorithms
>   net/tap: check RSS hash algorithms
>   net/thunderx: check RSS hash algorithms
>   net/txgbe: check RSS hash algorithms
>   app/proc-info: fix never show RSS info
>   app/proc-info: adjust the display format of RSS info
>   app/proc-info: support querying RSS hash algorithm
>   app/testpmd: add RSS hash algorithms display
> 
>  app/proc-info/main.c                   | 32 ++++++++++-----
>  app/test-pmd/cmdline.c                 | 29 ++++++++++---
>  app/test-pmd/config.c                  | 38 ++++++++---------
>  app/test-pmd/testpmd.h                 |  2 +-
>  doc/guides/rel_notes/release_23_11.rst |  2 +
>  drivers/net/atlantic/atl_ethdev.c      |  2 +
>  drivers/net/axgbe/axgbe_ethdev.c       |  9 +++++
>  drivers/net/bnx2x/bnx2x_ethdev.c       |  4 ++
>  drivers/net/bnxt/bnxt_ethdev.c         |  6 +++
>  drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++
>  drivers/net/cnxk/cnxk_ethdev.c         |  5 +++
>  drivers/net/cnxk/cnxk_ethdev_ops.c     |  3 ++
>  drivers/net/cpfl/cpfl_ethdev.c         |  6 +++
>  drivers/net/cxgbe/cxgbe_ethdev.c       |  9 ++++-
>  drivers/net/dpaa/dpaa_ethdev.c         |  7 ++++
>  drivers/net/dpaa2/dpaa2_ethdev.c       |  7 ++++
>  drivers/net/ena/ena_rss.c              |  3 ++
>  drivers/net/enic/enic_ethdev.c         |  1 +
>  drivers/net/enic/enic_main.c           |  3 ++
>  drivers/net/fm10k/fm10k_ethdev.c       |  9 ++++-
>  drivers/net/hinic/hinic_pmd_ethdev.c   |  3 ++
>  drivers/net/hinic/hinic_pmd_rx.c       |  3 ++
>  drivers/net/hns3/hns3_rss.c            | 47 ++++++++++++---------
>  drivers/net/i40e/i40e_ethdev.c         |  7 ++++
>  drivers/net/iavf/iavf_ethdev.c         |  6 +++
>  drivers/net/ice/ice_dcf.c              |  3 ++
>  drivers/net/ice/ice_dcf_ethdev.c       |  3 ++
>  drivers/net/ice/ice_ethdev.c           |  7 ++++
>  drivers/net/idpf/idpf_ethdev.c         |  6 +++
>  drivers/net/igc/igc_ethdev.c           |  4 ++
>  drivers/net/igc/igc_txrx.c             |  5 +++
>  drivers/net/ionic/ionic_ethdev.c       |  6 +++
>  drivers/net/ixgbe/ixgbe_ethdev.c       | 12 +++++-
>  drivers/net/ixgbe/ixgbe_rxtx.c         |  4 ++
>  drivers/net/mana/mana.c                | 11 ++++-
>  drivers/net/mlx5/mlx5_ethdev.c         |  4 ++
>  drivers/net/mlx5/mlx5_rss.c            |  3 +-
>  drivers/net/mvpp2/mrvl_ethdev.c        |  3 ++
>  drivers/net/netvsc/hn_ethdev.c         |  6 +++
>  drivers/net/nfp/nfp_common.c           |  9 ++++-
>  drivers/net/ngbe/ngbe_ethdev.c         |  6 ++-
>  drivers/net/ngbe/ngbe_rxtx.c           |  3 ++
>  drivers/net/null/rte_eth_null.c        |  8 ++++
>  drivers/net/qede/qede_ethdev.c         |  9 ++++-
>  drivers/net/sfc/sfc_ethdev.c           |  3 ++
>  drivers/net/sfc/sfc_rx.c               |  3 ++
>  drivers/net/tap/rte_eth_tap.c          |  8 ++++
>  drivers/net/thunderx/nicvf_ethdev.c    | 10 ++++-
>  drivers/net/txgbe/txgbe_ethdev.c       |  7 +++-
>  drivers/net/txgbe/txgbe_ethdev_vf.c    |  7 +++-
>  drivers/net/txgbe/txgbe_rxtx.c         |  3 ++
>  lib/ethdev/rte_ethdev.c                | 17 ++++++++
>  lib/ethdev/rte_ethdev.h                | 56 +++++++++++++++++++-------
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 25 +-----------
>  55 files changed, 395 insertions(+), 106 deletions(-)
> 

Can update following drivers too:
- igb (drivers/net/e1000/igb_ethdev.c)
- octeontx, configure(), as it checks RSS mode there
- virtio
- vmxnet3, as it configures RSS

Thanks,
ferruh

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm
  2023-10-11  9:27  4%         ` [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-10-11 17:39  4%           ` Stephen Hemminger
  2023-10-12  2:21  0%             ` fengchengwen
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-10-11 17:39 UTC (permalink / raw)
  To: Jie Hai
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam,
	lihuisong, fengchengwen, liudongdong3

On Wed, 11 Oct 2023 17:27:27 +0800
Jie Hai <haijie1@huawei.com> wrote:

> Currently, rte_eth_rss_conf supports configuring and querying
> RSS hash functions, rss key and it's length, but not RSS hash
> algorithm.
> 
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "algorithm". This represents the RSS algorithms to apply.
> The following API will be affected:
> 	- rte_eth_dev_configure
> 	- rte_eth_dev_rss_hash_update
> 	- rte_eth_dev_rss_hash_conf_get
> 
> If the value of "algorithm" used for configuration is a gibberish
> value, report the error and return. Do the same for
> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
> 
> To check whether the drivers report valid "algorithm", it is set
> to default value before querying.
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
>  doc/guides/rel_notes/release_23_11.rst |  2 ++
>  lib/ethdev/rte_ethdev.c                | 17 ++++++++++++++++
>  lib/ethdev/rte_ethdev.h                | 27 +++++++++++++++++++++++++
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 28 ++------------------------
>  5 files changed, 48 insertions(+), 27 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index e13d57728071..92a445ab2ed3 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -197,6 +197,8 @@ ABI Changes
>    fields, to move ``rxq`` and ``txq`` fields, to change the size of
>    ``reserved1`` and ``reserved2`` fields.
>  
> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
> +  hash algorithm.
>  
>  Known Issues
>  ------------
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 18a4b950b184..2eda1b8072e5 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>  		goto rollback;
>  	}
>  
> +	if (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n",
> +			port_id, dev_conf->rx_adv_conf.rss_conf.algorithm);
> +		ret = -EINVAL;
> +		goto rollback;
> +	}
> +

Rather than having every driver check the algorithm, why not handle this like
other features in DPDK (which may mean API/ABI changes). 

Add a field rss_algo_capa which is bit field of available RSS functions.
Then the check for algorithm can be done in generic code. There a couple
of reserved fields that could be used.

It would mean updating all the drivers once with the capa field but
would provide way for application to know what fields are possible.

It has proved to be a problem in later ABI changes if a maximum value
is exposed. I.e don't expose RTE_ETH_HASH_FUNCTION_MAX.

^ permalink raw reply	[relevance 4%]

* [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
@ 2023-10-11  9:27  4%         ` Jie Hai
  2023-10-11 17:39  4%           ` Stephen Hemminger
  2023-10-11 18:19  0%         ` [PATCH v5 00/40] support setting and querying RSS algorithms Ferruh Yigit
                           ` (3 subsequent siblings)
  4 siblings, 1 reply; 200+ results
From: Jie Hai @ 2023-10-11  9:27 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: lihuisong, fengchengwen, liudongdong3

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "algorithm". This represents the RSS algorithms to apply.
The following API will be affected:
	- rte_eth_dev_configure
	- rte_eth_dev_rss_hash_update
	- rte_eth_dev_rss_hash_conf_get

If the value of "algorithm" used for configuration is a gibberish
value, report the error and return. Do the same for
rte_eth_dev_rss_hash_update and rte_eth_dev_configure.

To check whether the drivers report valid "algorithm", it is set
to default value before querying.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 lib/ethdev/rte_ethdev.c                | 17 ++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 27 +++++++++++++++++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 28 ++------------------------
 5 files changed, 48 insertions(+), 27 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index e13d57728071..92a445ab2ed3 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -197,6 +197,8 @@ ABI Changes
   fields, to move ``rxq`` and ``txq`` fields, to change the size of
   ``reserved1`` and ``reserved2`` fields.
 
+* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS
+  hash algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 18a4b950b184..2eda1b8072e5 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n",
+			port_id, dev_conf->rx_adv_conf.rss_conf.algorithm);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
 	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
 	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
@@ -4673,6 +4681,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->algorithm >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n",
+			port_id, rss_conf->algorithm);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4700,6 +4715,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->algorithm = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index b9e4e21189d2..42c4250bd509 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,32 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/**
+	 * DEFAULT means driver decides which hash algorithm to pick.
+	 */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	/**
+	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
+	 * the hash function.
+	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
+	 *  If src_port > dst_port, swap src_port and dst_port.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -465,6 +491,7 @@ struct rte_eth_rss_conf {
 	 * Setting *rss_hf* to zero disables the RSS feature.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function algorithm;	/**< Hash algorithm. */
 };
 
 /*
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index ba8bf27090fb..deedce08fb0a 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -13,7 +13,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 5d9e3c68af7b..877a2e1d6ad3 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3223,32 +3225,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/**
-	 * DEFAULT means driver decides which hash algorithm to pick.
-	 */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	/**
-	 * Symmetric Toeplitz: L3 and L4 fields are sorted prior to
-	 * the hash function.
-	 *  If src_ip > dst_ip, swap src_ip and dst_ip.
-	 *  If src_port > dst_port, swap src_port and dst_port.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ_SORT,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* [PATCH v5 00/40] support setting and querying RSS algorithms
  2023-09-08  8:00  3%     ` [PATCH v4 0/7] support setting and querying RSS algorithms Jie Hai
  2023-09-08  8:00  4%       ` [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-10-11  9:27  2%       ` Jie Hai
  2023-10-11  9:27  4%         ` [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm Jie Hai
                           ` (4 more replies)
  1 sibling, 5 replies; 200+ results
From: Jie Hai @ 2023-10-11  9:27 UTC (permalink / raw)
  To: dev; +Cc: lihuisong, fengchengwen, liudongdong3

This patchset is to support setting and querying RSS algorithms.

--
v5:
1. rewrite some comments.
2. check RSS algorithm for drivers supporting RSS.
3. change field "func" of rss_conf to "algorithm".
4. fix commit log for [PATCH v4 4/7].
5. add Acked-by Reshma Pattan.
6. add symmetric_toeplitz_sort for showing.
7. change "hf" to "hash function" for showing.

v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.

Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (39):
  ethdev: overwrite some comment related to RSS
  ethdev: support setting and querying RSS algorithm
  net/atlantic: check RSS hash algorithms
  net/axgbe: check RSS hash algorithms
  net/bnx2x: check RSS hash algorithms
  net/bnxt: check RSS hash algorithms
  net/bonding: check RSS hash algorithms
  net/cnxk: check RSS hash algorithms
  net/cpfl: check RSS hash algorithms
  net/cxgbe: check RSS hash algorithms
  net/dpaa: check RSS hash algorithms
  net/dpaa2: check RSS hash algorithms
  net/ena: check RSS hash algorithms
  net/enic: check RSS hash algorithms
  net/fm10k: check RSS hash algorithms
  net/hinic: check RSS hash algorithms
  net/i40e: check RSS hash algorithms
  net/iavf: check RSS hash algorithms
  net/ice: check RSS hash algorithms
  net/idpf: check RSS hash algorithms
  net/igc: check RSS hash algorithms
  net/ionic: check RSS hash algorithms
  net/ixgbe: check RSS hash algorithms
  net/mana: check RSS hash algorithms
  net/mlx5: check RSS hash algorithms
  net/mvpp2: check RSS hash algorithms
  net/netvsc: check RSS hash algorithms
  net/ngbe: : check RSS hash algorithms
  net/nfp: check RSS hash algorithms
  net/null: check RSS hash algorithms
  net/qede: check RSS hash algorithms
  net/sfc: check RSS hash algorithms
  net/tap: check RSS hash algorithms
  net/thunderx: check RSS hash algorithms
  net/txgbe: check RSS hash algorithms
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                   | 32 ++++++++++-----
 app/test-pmd/cmdline.c                 | 29 ++++++++++---
 app/test-pmd/config.c                  | 38 ++++++++---------
 app/test-pmd/testpmd.h                 |  2 +-
 doc/guides/rel_notes/release_23_11.rst |  2 +
 drivers/net/atlantic/atl_ethdev.c      |  2 +
 drivers/net/axgbe/axgbe_ethdev.c       |  9 +++++
 drivers/net/bnx2x/bnx2x_ethdev.c       |  4 ++
 drivers/net/bnxt/bnxt_ethdev.c         |  6 +++
 drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++
 drivers/net/cnxk/cnxk_ethdev.c         |  5 +++
 drivers/net/cnxk/cnxk_ethdev_ops.c     |  3 ++
 drivers/net/cpfl/cpfl_ethdev.c         |  6 +++
 drivers/net/cxgbe/cxgbe_ethdev.c       |  9 ++++-
 drivers/net/dpaa/dpaa_ethdev.c         |  7 ++++
 drivers/net/dpaa2/dpaa2_ethdev.c       |  7 ++++
 drivers/net/ena/ena_rss.c              |  3 ++
 drivers/net/enic/enic_ethdev.c         |  1 +
 drivers/net/enic/enic_main.c           |  3 ++
 drivers/net/fm10k/fm10k_ethdev.c       |  9 ++++-
 drivers/net/hinic/hinic_pmd_ethdev.c   |  3 ++
 drivers/net/hinic/hinic_pmd_rx.c       |  3 ++
 drivers/net/hns3/hns3_rss.c            | 47 ++++++++++++---------
 drivers/net/i40e/i40e_ethdev.c         |  7 ++++
 drivers/net/iavf/iavf_ethdev.c         |  6 +++
 drivers/net/ice/ice_dcf.c              |  3 ++
 drivers/net/ice/ice_dcf_ethdev.c       |  3 ++
 drivers/net/ice/ice_ethdev.c           |  7 ++++
 drivers/net/idpf/idpf_ethdev.c         |  6 +++
 drivers/net/igc/igc_ethdev.c           |  4 ++
 drivers/net/igc/igc_txrx.c             |  5 +++
 drivers/net/ionic/ionic_ethdev.c       |  6 +++
 drivers/net/ixgbe/ixgbe_ethdev.c       | 12 +++++-
 drivers/net/ixgbe/ixgbe_rxtx.c         |  4 ++
 drivers/net/mana/mana.c                | 11 ++++-
 drivers/net/mlx5/mlx5_ethdev.c         |  4 ++
 drivers/net/mlx5/mlx5_rss.c            |  3 +-
 drivers/net/mvpp2/mrvl_ethdev.c        |  3 ++
 drivers/net/netvsc/hn_ethdev.c         |  6 +++
 drivers/net/nfp/nfp_common.c           |  9 ++++-
 drivers/net/ngbe/ngbe_ethdev.c         |  6 ++-
 drivers/net/ngbe/ngbe_rxtx.c           |  3 ++
 drivers/net/null/rte_eth_null.c        |  8 ++++
 drivers/net/qede/qede_ethdev.c         |  9 ++++-
 drivers/net/sfc/sfc_ethdev.c           |  3 ++
 drivers/net/sfc/sfc_rx.c               |  3 ++
 drivers/net/tap/rte_eth_tap.c          |  8 ++++
 drivers/net/thunderx/nicvf_ethdev.c    | 10 ++++-
 drivers/net/txgbe/txgbe_ethdev.c       |  7 +++-
 drivers/net/txgbe/txgbe_ethdev_vf.c    |  7 +++-
 drivers/net/txgbe/txgbe_rxtx.c         |  3 ++
 lib/ethdev/rte_ethdev.c                | 17 ++++++++
 lib/ethdev/rte_ethdev.h                | 56 +++++++++++++++++++-------
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 25 +-----------
 55 files changed, 395 insertions(+), 106 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 2%]

* RE: [EXT] Re: [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code
  2023-10-10 13:10  0% ` Ferruh Yigit
  2023-10-10 14:48  0%   ` [EXT] " Akhil Goyal
@ 2023-10-10 14:50  0%   ` Anoob Joseph
  1 sibling, 0 replies; 200+ results
From: Anoob Joseph @ 2023-10-10 14:50 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Jerin Jacob Kollanukkaran, dev, Thomas Monjalon,
	Nithin Kumar Dabilpuram, Andrew Rybchenko, Akhil Goyal

Hi Ferruh,

> 
> ----------------------------------------------------------------------
> On 10/4/2023 1:59 PM, Nithin Dabilpuram wrote:
> > Add IPsec event subtype range for PMD specific code in order to
> > accommodate wide range of errors that PMD supports.
> > These IPsec event subtypes are used when an error doesn't match the
> > spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN and
> > RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI
> > breakage.
> >
> > Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> > ---
> >  lib/ethdev/rte_ethdev.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> > 8542257721..f949dfc83d 100644
> > --- a/lib/ethdev/rte_ethdev.h
> > +++ b/lib/ethdev/rte_ethdev.h
> > @@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
> >   * eth device.
> >   */
> >  enum rte_eth_event_ipsec_subtype {
> > +	/**  PMD specific error start */
> > +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
> > +	/**  PMD specific error end */
> > +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
> >  	/** Unknown event type */
> >  	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
> >  	/** Sequence number overflow */
> >
> 
> I don't see any problem to extend event subtype with custom error range,
> @Akhil, @Anoob what do you think?

[Anoob] Thanks for looping in. I do not see an issue with the approach either.

Acked-by: Anoob Joseph <anoobj@marvell.com>

Thanks,
Anoob



^ permalink raw reply	[relevance 0%]

* RE: [EXT] Re: [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code
  2023-10-10 13:10  0% ` Ferruh Yigit
@ 2023-10-10 14:48  0%   ` Akhil Goyal
  2023-10-12  9:32  0%     ` Ferruh Yigit
  2023-10-10 14:50  0%   ` Anoob Joseph
  1 sibling, 1 reply; 200+ results
From: Akhil Goyal @ 2023-10-10 14:48 UTC (permalink / raw)
  To: Ferruh Yigit, Nithin Kumar Dabilpuram, Anoob Joseph
  Cc: Jerin Jacob Kollanukkaran, dev, Thomas Monjalon, Andrew Rybchenko

> On 10/4/2023 1:59 PM, Nithin Dabilpuram wrote:
> > Add IPsec event subtype range for PMD specific code in order
> > to accommodate wide range of errors that PMD supports.
> > These IPsec event subtypes are used when an error doesn't
> > match the spec defined subtypes between
> RTE_ETH_EVENT_IPSEC_UNKNOWN
> > and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range
> > to avoid ABI breakage.
> >
> > Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> > ---
> >  lib/ethdev/rte_ethdev.h | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> > index 8542257721..f949dfc83d 100644
> > --- a/lib/ethdev/rte_ethdev.h
> > +++ b/lib/ethdev/rte_ethdev.h
> > @@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
> >   * eth device.
> >   */
> >  enum rte_eth_event_ipsec_subtype {
> > +	/**  PMD specific error start */
> > +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
> > +	/**  PMD specific error end */
> > +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
> >  	/** Unknown event type */
> >  	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
> >  	/** Sequence number overflow */
> >
> 
> I don't see any problem to extend event subtype with custom error range,
> @Akhil, @Anoob what do you think?

I believe it is ok to add the custom error range.
It is just that the user will need to check the negative values too, which I believe is ok.

Acked-by: Akhil Goyal <gakhil@marvell.com>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code
  2023-10-04 12:59  3% [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code Nithin Dabilpuram
@ 2023-10-10 13:10  0% ` Ferruh Yigit
  2023-10-10 14:48  0%   ` [EXT] " Akhil Goyal
  2023-10-10 14:50  0%   ` Anoob Joseph
  0 siblings, 2 replies; 200+ results
From: Ferruh Yigit @ 2023-10-10 13:10 UTC (permalink / raw)
  To: Nithin Dabilpuram, Akhil Goyal, Anoob Joseph
  Cc: jerinj, dev, Thomas Monjalon, Andrew Rybchenko

On 10/4/2023 1:59 PM, Nithin Dabilpuram wrote:
> Add IPsec event subtype range for PMD specific code in order
> to accommodate wide range of errors that PMD supports.
> These IPsec event subtypes are used when an error doesn't
> match the spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN
> and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range
> to avoid ABI breakage.
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
>  lib/ethdev/rte_ethdev.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 8542257721..f949dfc83d 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
>   * eth device.
>   */
>  enum rte_eth_event_ipsec_subtype {
> +	/**  PMD specific error start */
> +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
> +	/**  PMD specific error end */
> +	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
>  	/** Unknown event type */
>  	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
>  	/** Sequence number overflow */
>

I don't see any problem to extend event subtype with custom error range,
@Akhil, @Anoob what do you think?


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
    2023-08-18  6:53  0%   ` Jie Hai
  2023-09-12  1:52  0%   ` Jie Hai
@ 2023-10-10  2:25  0%   ` Jie Hai
  2023-10-25  1:22  0%   ` Jie Hai
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-10-10  2:25 UTC (permalink / raw)
  Cc: dev, liudongdong3

Hi, Thomas,

Kindly ping for review.

Thanks,
Jie Hai

On 2023/7/4 17:04, Jie Hai wrote:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
> 
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
> 
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
> 
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
> 
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
> 
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
> 
> v6->v7:
> 1. Remove prod/consumer head/tail info.
> 
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
> 
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH RESEND v6 0/5] app/testpmd: support multiple process attach and detach port
  @ 2023-10-09 10:34  0%   ` lihuisong (C)
  2023-10-30 12:17  0%     ` lihuisong (C)
  0 siblings, 1 reply; 200+ results
From: lihuisong (C) @ 2023-10-09 10:34 UTC (permalink / raw)
  To: dev
  Cc: thomas, ferruh.yigit, andrew.rybchenko, fengchengwen,
	liudongdong3, liuyonglong

Hi Ferruh and Thomas,

Can you take a look at this series? They've been over a year on 
disscussion.


在 2023/8/2 11:15, Huisong Li 写道:
> This patchset fix some bugs and support attaching and detaching port
> in primary and secondary.
>
> ---
>   -v6: adjust rte_eth_dev_is_used position based on alphabetical order
>        in version.map
>   -v5: move 'ALLOCATED' state to the back of 'REMOVED' to avoid abi break.
>   -v4: fix a misspelling.
>   -v3:
>     #1 merge patch 1/6 and patch 2/6 into patch 1/5, and add modification
>        for other bus type.
>     #2 add a RTE_ETH_DEV_ALLOCATED state in rte_eth_dev_state to resolve
>        the probelm in patch 2/5.
>   -v2: resend due to CI unexplained failure.
>
> Huisong Li (5):
>    drivers/bus: restore driver assignment at front of probing
>    ethdev: fix skip valid port in probing callback
>    app/testpmd: check the validity of the port
>    app/testpmd: add attach and detach port for multiple process
>    app/testpmd: stop forwarding in new or destroy event
>
>   app/test-pmd/testpmd.c                   | 47 +++++++++++++++---------
>   app/test-pmd/testpmd.h                   |  1 -
>   drivers/bus/auxiliary/auxiliary_common.c |  9 ++++-
>   drivers/bus/dpaa/dpaa_bus.c              |  9 ++++-
>   drivers/bus/fslmc/fslmc_bus.c            |  8 +++-
>   drivers/bus/ifpga/ifpga_bus.c            | 12 ++++--
>   drivers/bus/pci/pci_common.c             |  9 ++++-
>   drivers/bus/vdev/vdev.c                  | 10 ++++-
>   drivers/bus/vmbus/vmbus_common.c         |  9 ++++-
>   drivers/net/bnxt/bnxt_ethdev.c           |  3 +-
>   drivers/net/bonding/bonding_testpmd.c    |  1 -
>   drivers/net/mlx5/mlx5.c                  |  2 +-
>   lib/ethdev/ethdev_driver.c               | 13 +++++--
>   lib/ethdev/ethdev_driver.h               | 12 ++++++
>   lib/ethdev/ethdev_pci.h                  |  2 +-
>   lib/ethdev/rte_class_eth.c               |  2 +-
>   lib/ethdev/rte_ethdev.c                  |  4 +-
>   lib/ethdev/rte_ethdev.h                  |  4 +-
>   lib/ethdev/version.map                   |  1 +
>   19 files changed, 114 insertions(+), 44 deletions(-)
>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH 4/4] pcapng: move timestamp calculation into pdump
  2023-10-06  9:10  3%       ` David Marchand
@ 2023-10-06 14:59  0%         ` Kevin Traynor
  0 siblings, 0 replies; 200+ results
From: Kevin Traynor @ 2023-10-06 14:59 UTC (permalink / raw)
  To: David Marchand, Stephen Hemminger
  Cc: dev, Reshma Pattan, Quentin Armitage, Thomas Monjalon,
	Luca Boccassi, Xueming(Steven) Li, Christian Ehrhardt

On 06/10/2023 10:10, David Marchand wrote:
> On Wed, Oct 4, 2023 at 7:13 PM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
>>
>> On Mon, 2 Oct 2023 10:15:25 +0200
>> David Marchand <david.marchand@redhat.com> wrote:
>>
>>>>
>>>
>>> Bugzilla ID: 1291 ?
>>>
>>> This patch (and patch 3) updates some pcapng API, is it worth a RN update?
>>>
>>>> Fixes: c882eb544842 ("pcapng: fix timestamp wrapping in output files")
>>>
>>> Is it worth backporting?
>>> I would say no, as some API update was needed to fix the issue.
>>> But on the other hand, this is an experimental API, so I prefer to ask.
>>>
>>>
>>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>
>> Good question.
>> Is experimental API allowed to change in a stable release?
> 
> I don't think this is cleary described in our ABI policy.
> An experimental API may be changed at any time, but nothing is said
> wrt backports.
> 
> Breaking an API is always a pain, and for a LTS release it would
> probably be badly accepted by users.
> 

yes, I agree. IIRC, this arose sometime in the past with a branch that 
Luca was maintaining and I think the consensus among LTS maintainers was 
not to change experimental API on stable branches.

> Cc: Kevin for his opinion.
> 
> We may need a clarification on this topic in the doc.
> 
> 

Perhaps it's not a "rule" since experimental API comes with no 
guarantee, but I can add something to the docs that it is a guideline 
not to break experimental API on stable branch.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-10-06  8:27  3%     ` David Marchand
@ 2023-10-06 11:19  0%       ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-10-06 11:19 UTC (permalink / raw)
  To: David Marchand, Sivaprasad Tummala
  Cc: ruifeng.wang, zhoumin, drc, kda, bruce.richardson,
	konstantin.v.ananyev, dev

On 10/6/2023 9:27 AM, David Marchand wrote:
> On Fri, Aug 11, 2023 at 8:08 AM Sivaprasad Tummala
> <sivaprasad.tummala@amd.com> wrote:
>>
>> This patch removes RTE_CPUFLAG_NUMFLAGS to allow new CPU
>> features without breaking ABI each time.
>>
>> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> 
> I relooked at the API and I see one case (that I had missed in my
> previous reply) where an ABI issue may be present so I updated the
> commitlog in this regard.
> 
> And then I merged this patch, with a few modifications.
> - removed the deprecation notice and updated RN,
> - removed leftover "Last item" comments in arch cpuflag headers,
> 
> I hope everyone is happy with this.
> 
> 


Looks good to me, thanks David.


^ permalink raw reply	[relevance 0%]

* [PATCH v4] eventdev: ensure 16-byte alignment for events
                     ` (2 preceding siblings ...)
  2023-10-06  9:45  8% ` [PATCH v3] " Bruce Richardson
@ 2023-10-06 10:29  8% ` Bruce Richardson
  3 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-10-06 10:29 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup, Jerin Jacob

The event structure in DPDK is 16-bytes in size, and events are
regularly passed as parameters directly rather than being passed as
pointers. To help compiler optimize correctly, we can explicitly request
16-byte alignment for events, which means that we should be able
to do aligned vector loads/stores (e.g. with SSE or Neon) when working
with those events.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>

---
v4: change _Static_assert to static_assert for fwd compatibility
    moved size check on event structure to C file from header file

v3: Fix spelling mistake in RN entry
    rebase on latest eventdev tree HEAD

v2: added release note entry for ABI change
    added structure comment on 16-byte size and alignment
    added static assert for structure size
---
 doc/guides/rel_notes/release_23_11.rst | 4 ++++
 lib/eventdev/rte_eventdev.c            | 3 +++
 lib/eventdev/rte_eventdev.h            | 4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 0903046b0c..33fed3e433 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -209,6 +209,10 @@ ABI Changes
   fields, to move ``rxq`` and ``txq`` fields, to change the size of
   ``reserved1`` and ``reserved2`` fields.
 
+* The ``rte_event`` structure, used by eventdev library and DPDK "event" class drivers,
+  is now 16-byte aligned, as well as being 16-bytes in size.
+  In previous releases, the structure only required 8-byte alignment.
+
 
 Known Issues
 ------------
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 95373bbaad..adc9751cef 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -9,6 +9,7 @@
 #include <errno.h>
 #include <stdint.h>
 #include <inttypes.h>
+#include <assert.h>
 
 #include <rte_string_fns.h>
 #include <rte_log.h>
@@ -28,6 +29,8 @@
 #include "eventdev_pmd.h"
 #include "eventdev_trace.h"
 
+static_assert(sizeof(struct rte_event) == 16, "Event structure size is not 16-bytes in size");
+
 static struct rte_eventdev rte_event_devices[RTE_EVENT_MAX_DEVS];
 
 struct rte_eventdev *rte_eventdevs = rte_event_devices;
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 2ea98302b8..758ee83a3f 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1284,6 +1284,8 @@ struct rte_event_vector {
 /**
  * The generic *rte_event* structure to hold the event attributes
  * for dequeue and enqueue operation
+ *
+ * This structure must be kept at 16-bytes in size, and has 16-byte alignment.
  */
 struct rte_event {
 	/** WORD0 */
@@ -1356,7 +1358,7 @@ struct rte_event {
 		struct rte_event_vector *vec;
 		/**< Event vector pointer. */
 	};
-};
+} __rte_aligned(16);
 
 /* Ethdev Rx adapter capability bitmap flags */
 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT	0x1
-- 
2.39.2


^ permalink raw reply	[relevance 8%]

* [PATCH v3] eventdev: ensure 16-byte alignment for events
    2023-10-05 12:06  3% ` Bruce Richardson
  2023-10-06  9:37  5% ` [PATCH v2] " Bruce Richardson
@ 2023-10-06  9:45  8% ` Bruce Richardson
  2023-10-06 10:29  8% ` [PATCH v4] " Bruce Richardson
  3 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-10-06  9:45 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup, Jerin Jacob

The event structure in DPDK is 16-bytes in size, and events are
regularly passed as parameters directly rather than being passed as
pointers. To help compiler optimize correctly, we can explicitly request
16-byte alignment for events, which means that we should be able
to do aligned vector loads/stores (e.g. with SSE or Neon) when working
with those events.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>

---
v3: Fix spelling mistake in RN entry
    rebase on latest eventdev tree HEAD

v2: added release note entry for ABI change
    added structure comment on 16-byte size and alignment
    added static assert for structure size
---
 doc/guides/rel_notes/release_23_11.rst | 4 ++++
 lib/eventdev/rte_eventdev.h            | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 0903046b0c..33fed3e433 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -209,6 +209,10 @@ ABI Changes
   fields, to move ``rxq`` and ``txq`` fields, to change the size of
   ``reserved1`` and ``reserved2`` fields.
 
+* The ``rte_event`` structure, used by eventdev library and DPDK "event" class drivers,
+  is now 16-byte aligned, as well as being 16-bytes in size.
+  In previous releases, the structure only required 8-byte alignment.
+
 
 Known Issues
 ------------
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 2ea98302b8..5b7c5b3399 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1284,6 +1284,8 @@ struct rte_event_vector {
 /**
  * The generic *rte_event* structure to hold the event attributes
  * for dequeue and enqueue operation
+ *
+ * This structure must be kept at 16-bytes in size, and has 16-byte alignment.
  */
 struct rte_event {
 	/** WORD0 */
@@ -1356,7 +1358,9 @@ struct rte_event {
 		struct rte_event_vector *vec;
 		/**< Event vector pointer. */
 	};
-};
+} __rte_aligned(16);
+
+_Static_assert(sizeof(struct rte_event) == 16, "Event structure size is not 16-bytes in size");
 
 /* Ethdev Rx adapter capability bitmap flags */
 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT	0x1
-- 
2.39.2


^ permalink raw reply	[relevance 8%]

* [PATCH v2] eventdev: ensure 16-byte alignment for events
    2023-10-05 12:06  3% ` Bruce Richardson
@ 2023-10-06  9:37  5% ` Bruce Richardson
  2023-10-06  9:45  8% ` [PATCH v3] " Bruce Richardson
  2023-10-06 10:29  8% ` [PATCH v4] " Bruce Richardson
  3 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-10-06  9:37 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Morten Brørup, Jerin Jacob

The event structure in DPDK is 16-bytes in size, and events are
regularly passed as parameters directly rather than being passed as
pointers. To help compiler optimize correctly, we can explicitly request
16-byte alignment for events, which means that we should be able
to do aligned vector loads/stores (e.g. with SSE or Neon) when working
with those events.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 doc/guides/rel_notes/release_23_11.rst | 4 ++++
 lib/eventdev/rte_eventdev.h            | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 261594aacc..48c19ae52a 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -158,6 +158,10 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* The ``rte_event`` structure, used by eventdev library and DPDK "event" class drivers,
+  is now 16-byte aligned, as well as being 16-bytes in size.
+  In previous releases, the structure only required 8-byte alignement.
+
 
 Known Issues
 ------------
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 2ea98302b8..5b7c5b3399 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1284,6 +1284,8 @@ struct rte_event_vector {
 /**
  * The generic *rte_event* structure to hold the event attributes
  * for dequeue and enqueue operation
+ *
+ * This structure must be kept at 16-bytes in size, and has 16-byte alignment.
  */
 struct rte_event {
 	/** WORD0 */
@@ -1356,7 +1358,9 @@ struct rte_event {
 		struct rte_event_vector *vec;
 		/**< Event vector pointer. */
 	};
-};
+} __rte_aligned(16);
+
+_Static_assert(sizeof(struct rte_event) == 16, "Event structure size is not 16-bytes in size");
 
 /* Ethdev Rx adapter capability bitmap flags */
 #define RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT	0x1
-- 
2.39.2


^ permalink raw reply	[relevance 5%]

* Re: [PATCH 4/4] pcapng: move timestamp calculation into pdump
  @ 2023-10-06  9:10  3%       ` David Marchand
  2023-10-06 14:59  0%         ` Kevin Traynor
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-10-06  9:10 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Reshma Pattan, Quentin Armitage, Thomas Monjalon, Kevin Traynor

On Wed, Oct 4, 2023 at 7:13 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Mon, 2 Oct 2023 10:15:25 +0200
> David Marchand <david.marchand@redhat.com> wrote:
>
> > >
> >
> > Bugzilla ID: 1291 ?
> >
> > This patch (and patch 3) updates some pcapng API, is it worth a RN update?
> >
> > > Fixes: c882eb544842 ("pcapng: fix timestamp wrapping in output files")
> >
> > Is it worth backporting?
> > I would say no, as some API update was needed to fix the issue.
> > But on the other hand, this is an experimental API, so I prefer to ask.
> >
> >
> > > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>
> Good question.
> Is experimental API allowed to change in a stable release?

I don't think this is cleary described in our ABI policy.
An experimental API may be changed at any time, but nothing is said
wrt backports.

Breaking an API is always a pain, and for a LTS release it would
probably be badly accepted by users.

Cc: Kevin for his opinion.

We may need a clarification on this topic in the doc.


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
      2023-09-27 13:13  0%     ` Ferruh Yigit
@ 2023-10-06  8:27  3%     ` David Marchand
  2023-10-06 11:19  0%       ` Ferruh Yigit
  2 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-10-06  8:27 UTC (permalink / raw)
  To: Sivaprasad Tummala
  Cc: ruifeng.wang, zhoumin, drc, kda, bruce.richardson,
	konstantin.v.ananyev, dev, Ferruh Yigit

On Fri, Aug 11, 2023 at 8:08 AM Sivaprasad Tummala
<sivaprasad.tummala@amd.com> wrote:
>
> This patch removes RTE_CPUFLAG_NUMFLAGS to allow new CPU
> features without breaking ABI each time.
>
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>

I relooked at the API and I see one case (that I had missed in my
previous reply) where an ABI issue may be present so I updated the
commitlog in this regard.

And then I merged this patch, with a few modifications.
- removed the deprecation notice and updated RN,
- removed leftover "Last item" comments in arch cpuflag headers,

I hope everyone is happy with this.


Thanks.

-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [RFC PATCH] eventdev: ensure 16-byte alignment for events
  @ 2023-10-06  7:19  3%       ` Jerin Jacob
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob @ 2023-10-06  7:19 UTC (permalink / raw)
  To: Bruce Richardson, Thomas Monjalon
  Cc: dev, Jerin Jacob, Pavan Nikhilesh, Abdullah Sevincer,
	Shijith Thotton, Hemant Agrawal, Sachin Saxena, Van Haaren,
	Harry, Mattias Rönnblom, Liang Ma, Peter Mccarthy,
	Honnappa Nagarahalli

On Thu, Oct 5, 2023 at 6:52 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Oct 05, 2023 at 06:41:34PM +0530, Jerin Jacob wrote:
> > On Thu, Oct 5, 2023 at 6:01 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > >
> > > On Thu, Oct 05, 2023 at 12:51:00PM +0100, Bruce Richardson wrote:
> > > > The event structure in DPDK is 16-bytes in size, and events are
> > > > regularly passed as parameters directly rather than being passed as
> > > > pointers. To help compiler optimize correctly, we can explicitly request
> > > > 16-byte alignment for events, which means that we should be able
> > > > to do aligned vector loads/stores (e.g. with SSE or Neon) when working
> > > > with those events.
> > > >
> > > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > > ---
> > > >  lib/eventdev/rte_eventdev.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> > > > index 2ba8a7b090..bb0d59b059 100644
> > > > --- a/lib/eventdev/rte_eventdev.h
> > > > +++ b/lib/eventdev/rte_eventdev.h
> > > > @@ -1344,7 +1344,7 @@ struct rte_event {
> > > >               struct rte_event_vector *vec;
> > > >               /**< Event vector pointer. */
> > > >       };
> > > > -};
> > > > +} __rte_aligned(16);
> > > >
> > >
> >
> > + Eventdev driver maintainers for review and for performance testing.
> >
> > > Looking for feedback on this idea - hence the fact this is going as an RFC.
> >
> > Are you seeing any performance improvement ? Look like only DLB2
> > driver only using SEE or AVX512 instructions.
> >
>
> The idea would be that the driver code (and eventdev code) should not need
> to use SSE directly. If we mark the event struct as aligned, it should help
> encourage the compiler to use these instructions under-the-hood. For
> example, when copying an event, the compiler should be emitting 128-bit
> loads and stores for most platforms.

With limited testing, there is no performance regression is seen. In
fact, the compiler is generating the
same instruction stream on both cases.

If there are no objections from others, Please send v1 with "ABI
change" update in doc/guides/rel_notes/release_23_11.rst.

With above change,
Acked-by: Jerin Jacob <jerinj@marvell.com>

NOTE: I already made PR to Thomas for rc1. Since is needs to part of
rc1, I need to sync with @Thomas Monjalon  as well.







>
> /Bruce

^ permalink raw reply	[relevance 3%]

* Re: [RFC PATCH] eventdev: ensure 16-byte alignment for events
  2023-10-05 12:06  3% ` Bruce Richardson
@ 2023-10-05 13:11  0%   ` Jerin Jacob
    0 siblings, 1 reply; 200+ results
From: Jerin Jacob @ 2023-10-05 13:11 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: dev, Jerin Jacob, Pavan Nikhilesh, Abdullah Sevincer,
	Shijith Thotton, Hemant Agrawal, Sachin Saxena, Van Haaren,
	Harry, Mattias Rönnblom, Liang Ma, Peter Mccarthy,
	Honnappa Nagarahalli

On Thu, Oct 5, 2023 at 6:01 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Thu, Oct 05, 2023 at 12:51:00PM +0100, Bruce Richardson wrote:
> > The event structure in DPDK is 16-bytes in size, and events are
> > regularly passed as parameters directly rather than being passed as
> > pointers. To help compiler optimize correctly, we can explicitly request
> > 16-byte alignment for events, which means that we should be able
> > to do aligned vector loads/stores (e.g. with SSE or Neon) when working
> > with those events.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  lib/eventdev/rte_eventdev.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> > index 2ba8a7b090..bb0d59b059 100644
> > --- a/lib/eventdev/rte_eventdev.h
> > +++ b/lib/eventdev/rte_eventdev.h
> > @@ -1344,7 +1344,7 @@ struct rte_event {
> >               struct rte_event_vector *vec;
> >               /**< Event vector pointer. */
> >       };
> > -};
> > +} __rte_aligned(16);
> >
>

+ Eventdev driver maintainers for review and for performance testing.

> Looking for feedback on this idea - hence the fact this is going as an RFC.

Are you seeing any performance improvement ? Look like only DLB2
driver only using SEE or AVX512 instructions.

> It seems to me something that should be done for performance reasons, but
> I'm not sure if there are any negative consequences of doing this.

In general, it looks OK, However, We may need more testing.
I can only speculate the following as of now, Since event memory is
allocated from stack most case,
there may stack pointer fix up in code for desired alignment ie. some
add/sub instructions which comes for free most likely due to pipeline.

We will test on Marvel HW. Request others to test on their HWs.


>
> Since this is an ABI-affecting change, a decision on this needs to be made
> for 23.11, or else it will be locked in for at least another year. Hence me
> sending it now as an RFC late in the release cycle, rather than deferring
> to next release.
>
> /Bruce

^ permalink raw reply	[relevance 0%]

* Re: [RFC PATCH] eventdev: ensure 16-byte alignment for events
  @ 2023-10-05 12:06  3% ` Bruce Richardson
  2023-10-05 13:11  0%   ` Jerin Jacob
  2023-10-06  9:37  5% ` [PATCH v2] " Bruce Richardson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 200+ results
From: Bruce Richardson @ 2023-10-05 12:06 UTC (permalink / raw)
  To: dev; +Cc: Jerin Jacob

On Thu, Oct 05, 2023 at 12:51:00PM +0100, Bruce Richardson wrote:
> The event structure in DPDK is 16-bytes in size, and events are
> regularly passed as parameters directly rather than being passed as
> pointers. To help compiler optimize correctly, we can explicitly request
> 16-byte alignment for events, which means that we should be able
> to do aligned vector loads/stores (e.g. with SSE or Neon) when working
> with those events.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  lib/eventdev/rte_eventdev.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
> index 2ba8a7b090..bb0d59b059 100644
> --- a/lib/eventdev/rte_eventdev.h
> +++ b/lib/eventdev/rte_eventdev.h
> @@ -1344,7 +1344,7 @@ struct rte_event {
>  		struct rte_event_vector *vec;
>  		/**< Event vector pointer. */
>  	};
> -};
> +} __rte_aligned(16);
>  

Looking for feedback on this idea - hence the fact this is going as an RFC.
It seems to me something that should be done for performance reasons, but
I'm not sure if there are any negative consequences of doing this.

Since this is an ABI-affecting change, a decision on this needs to be made
for 23.11, or else it will be locked in for at least another year. Hence me
sending it now as an RFC late in the release cycle, rather than deferring
to next release.

/Bruce

^ permalink raw reply	[relevance 3%]

* Minutes of Technical Board Meeting, 2023-05-31
@ 2023-10-04 15:11  4% Aaron Conole
  0 siblings, 0 replies; 200+ results
From: Aaron Conole @ 2023-10-04 15:11 UTC (permalink / raw)
  To: techboard, dev

Attendees:
- Aaron
- Bruce
- David
- Ferruh
- Jerin
- Kevin
- Konstantin 
- Maxime
- Nathan
- Patrick
- Stephen
- Tyler


Minutes:
- Bruce will be moderator on June 14, 2023

- Call for additional items

- Userspace Dublin
 - CFP - Ready to go.
   - Awaiting on final TB review, feedback received from
     Kevin, Thomas
 - Virtual Speakers
   - Do we exclude or include? Reality is we will need to include
   - In-person is always the most desirable, we can't exclude virtual
     speakers
   - Quality of Virtual experience needs to improve
     Any feedback to the LF team re: virtual experience
 - Form review from Evi with Nathan
   - Submit all the changes
 - Review process is open for the entire board, to be sent out by
   Nathan.
   - Nathan to send out an invite for Thu, July 6
 - Submit expenses ASAP


- LF hires
  - Ben Thomas to solicit feedback from others and building more
    content to promote project
    - Feel free to reach out and help Ben with this effort
  - David Young starts on June 12


- Discuss on how to align the next LTS release for
 - From https://mails.dpdk.org/archives/dev/2023-May/269411.html
 - YAGNI vs reserved fields with init()
   - Discussion with Jerin, should we follow YAGNI which will need
     to use next-abi.
   - Testing concerns with next-abi.  Needs even more CI runs to ensure
     proper coverage
     - More time, and additional matrix functions
   - Adding checks for reserved fields as a key.
     - Checks are needed for the old code + new library case
   - Reserved fields also cause bad behavior w.r.t. development
   - Reserved fields also take up space that may never be needed
 - General discussions about ABIs
   - Thomas prefers the two versions approach (current, next)
   - Have a single define and just removing it should work.
   - NEXT abi is "cleaner" in some cases
   - NEXT ABI is probably the best approach and we will try it out when
     going forward on a case-by-case basis
 - What it takes to Extend the API breaking release more than a
   year as first step.
   - Cannot discuss today, but we need to discuss the period of
     compatibility that we currently support
   - Maybe it can be extended based on some other approach


- Discuss how to better share tree maintenance work for the main
  libraries.
 - new maintainers?
  - Need for more maintainers in the libraries / examples, not enough
    reviewers, etc.
  - Reach out to existing maintainers for additional subtree splitting
  - Always depends on the library, and some have plenty of coverage
  - Maybe also doing some restructuring of the libraries
 - new tree maintainers
  - lack of faster merging because there aren't enough tree
    maintainers
  - Create more subtrees?
   - Creates a more maintainership burden
 - Next step to start looking at what to split, who to do the work,
   etc.  Needs more discussions, though.


(Didn't get to...)
- Thomas requests people read email on Power management brainstorm


^ permalink raw reply	[relevance 4%]

* [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code
@ 2023-10-04 12:59  3% Nithin Dabilpuram
  2023-10-10 13:10  0% ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Nithin Dabilpuram @ 2023-10-04 12:59 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: jerinj, dev, Nithin Dabilpuram

Add IPsec event subtype range for PMD specific code in order
to accommodate wide range of errors that PMD supports.
These IPsec event subtypes are used when an error doesn't
match the spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN
and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range
to avoid ABI breakage.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 8542257721..f949dfc83d 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v3] bus/cdx: provide driver flag for optional resource mapping
  2023-10-04 10:06  0%     ` Gangurde, Abhijit
@ 2023-10-04 12:54  0%       ` David Marchand
  2023-10-13 11:51  0%         ` Gangurde, Abhijit
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-10-04 12:54 UTC (permalink / raw)
  To: Gangurde, Abhijit
  Cc: Gupta, Nipun, Agarwal, Nikhil, dev, Yigit, Ferruh, thomas

On Wed, Oct 4, 2023 at 12:06 PM Gangurde, Abhijit
<abhijit.gangurde@amd.com> wrote:
> > > +/**
> > > + * Map the CDX device resources in user space virtual memory address.
> > > + *
> > > + * Note that driver should not call this function when flag
> > > + * RTE_CDX_DRV_NEED_MAPPING is set, as EAL will do that for
> > > + * you when it's on.
> >
> > Why should we export this function in the application ABI, if it is
> > only used by drivers?
>
> This can be called from an application as well if this flag is not set hence, we need to export this function.

What kind of applications / in which usecase, one would need to map
the device resources?
Except a driver?


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* RE: [PATCH v3] bus/cdx: provide driver flag for optional resource mapping
  2023-09-29 15:17  3%   ` David Marchand
@ 2023-10-04 10:06  0%     ` Gangurde, Abhijit
  2023-10-04 12:54  0%       ` David Marchand
  0 siblings, 1 reply; 200+ results
From: Gangurde, Abhijit @ 2023-10-04 10:06 UTC (permalink / raw)
  To: David Marchand; +Cc: Gupta, Nipun, Agarwal, Nikhil, dev, Yigit, Ferruh, thomas

[AMD Official Use Only - General]

> <abhijit.gangurde@amd.com> wrote:
> > @@ -383,10 +384,12 @@ cdx_probe_one_driver(struct rte_cdx_driver *dr,
> >         CDX_BUS_DEBUG("  probe device %s using driver: %s", dev_name,
> >                 dr->driver.name);
> >
> > -       ret = cdx_vfio_map_resource(dev);
> > -       if (ret != 0) {
> > -               CDX_BUS_ERR("CDX map device failed: %d", ret);
> > -               goto error_map_device;
> > +       if (dr->drv_flags & RTE_CDX_DRV_NEED_MAPPING) {
> > +               ret = cdx_vfio_map_resource(dev);
> > +               if (ret != 0) {
> > +                       CDX_BUS_ERR("CDX map device failed: %d", ret);
> > +                       goto error_map_device;
> > +               }
> >         }
> >
> >         /* call the driver probe() function */
> > diff --git a/drivers/bus/cdx/rte_bus_cdx.h b/drivers/bus/cdx/rte_bus_cdx.h
> > new file mode 100644
> > index 0000000000..4ca12f90c4
> > --- /dev/null
> > +++ b/drivers/bus/cdx/rte_bus_cdx.h
> > @@ -0,0 +1,52 @@
> > +/* SPDX-License-Identifier: BSD-3-Clause
> > + * Copyright (C) 2023, Advanced Micro Devices, Inc.
> > + */
> > +
> > +#ifndef RTE_BUS_CDX_H
> > +#define RTE_BUS_CDX_H
> > +
> > +/**
> > + * @file
> > + * CDX device & driver interface
> > + */
> > +
> > +#ifdef __cplusplus
> > +extern "C" {
> > +#endif
> > +
> > +/* Forward declarations */
> > +struct rte_cdx_device;
> > +
> > +/**
> > + * Map the CDX device resources in user space virtual memory address.
> > + *
> > + * Note that driver should not call this function when flag
> > + * RTE_CDX_DRV_NEED_MAPPING is set, as EAL will do that for
> > + * you when it's on.
>
> Why should we export this function in the application ABI, if it is
> only used by drivers?

This can be called from an application as well if this flag is not set hence, we need to export this function.
If needed, I can update the description of the API.

Thanks,
Abhijit

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/3] lib: introduce dispatcher library
  2023-09-27  8:13  3%         ` Bruce Richardson
  2023-09-28  7:44  0%           ` Mattias Rönnblom
@ 2023-10-03 17:31  0%           ` Jerin Jacob
  1 sibling, 0 replies; 200+ results
From: Jerin Jacob @ 2023-10-03 17:31 UTC (permalink / raw)
  To: Bruce Richardson
  Cc: Mattias Rönnblom, Mattias Rönnblom, dev, Jerin Jacob,
	techboard, harry.van.haaren, Peter Nilsson, Heng Wang,
	Naga Harish K S V, Pavan Nikhilesh, Gujjar Abhinandan S,
	Erik Gabriel Carrillo, Shijith Thotton, Hemant Agrawal,
	Sachin Saxena, Liang Ma, Peter Mccarthy, Zhirun Yan

On Wed, Sep 27, 2023 at 1:43 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Tue, Sep 26, 2023 at 11:58:37PM +0530, Jerin Jacob wrote:
> > On Mon, Sep 25, 2023 at 12:41 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
> > >
> > > On 2023-09-22 09:38, Mattias Rönnblom wrote:
> > >
> > > <snip>
> > >
> > > > +int
> > > > +rte_dispatcher_create(uint8_t id, uint8_t event_dev_id)
> > > > +{
> > >
> > >
> > > There are two changes I'm considering:
> > >
> > > 1) Removing the "id" to identify the dispatcher, replacing it with an
> > > forward-declared rte_dispatcher struct pointer.
> > >
> > > struct rte_dispatcher;
> > >
> > > struct rte_dispatcher *
> > > rte_dispatcher_create(uint8_t event_dev_id);
> > >
> > >
> > > The original reason for using an integer id to identify a dispatcher is
> > > to make it look like everything else in Eventdev. I find this pattern a
> > > little awkward to use - in particular the fact the id is
> > > application-allocated (and thus require coordination between different
> > > part of the application in case multiple instances are used).
> > >
> > > 2) Adding a flags field to the create function "for future use". But
> > > since the API is experimental, there may not be that much need to
> > > attempt to be future-proof?
> > >
> > > Any thoughts are appreciated.
> >
> > IMO, better to have rte_dispatcher_create(struct
> > rte_dispatch_create_params *params)
> > for better future proofing with specific
> > rte_dispatch_crearte_params_init() API(No need to add reserved fields
> > in rte_dispatch_create_params  now, may need only for before removing
> > experimental status)
> >
> > Just 2c.
> >
>
> I don't like using structs in those cases, I'd much rather have a flags
> parameter, as flags can be checked for explicit zeros for future proofing,
> while a struct cannot be checked for extra space on the end for future
> fields added.

For lib/dispatcher library, I have don't have specific preference. So
anything is fine for me.
However, I thought of understanding your rationale for arguments vs
structure(Looks like more of vi vs emac discussion) for _my
understanding_.

In my view,
# Use flags for setting up to express specific behavior, not as
inputting a lot of input parameters.
#  Do we need to check extra space if struct have reserved fields and
having init() functions for filling default

>
> Furthermore, if we need to add new parameters to the create function, I
> actually believe it is better to add them as explicit parameters rather
> than new fields to the struct. Struct fields can be missed by a user just
> recompiling, while new function parameters will be flagged by the compiler

I would see this as on the positive side, when

- Same code base needs to support multiple DPDK versions.
- A lot of times, API consumer may need only  _default_ values. Like
local_cache value in mempool_create API. So struct with _init() get
required values in easy way.

My views are based mostly used existing rte_mempool_create() APIs. For
some reason, I don't like this scheme.
struct rte_mempool *
rte_mempool_create(const char *name, unsigned n, unsigned elt_size,
                   unsigned cache_size, unsigned private_data_size,
                   rte_mempool_ctor_t *mp_init, void *mp_init_arg,
                   rte_mempool_obj_cb_t *obj_init, void *obj_init_arg,
                   int socket_id, unsigned flags);


> to make the user aware of the change. [There would be no change for ABI
> compatibility as function versioning would be usable in both cases]

Yes. But need to too much template code via VERSION_SYMBOL where
structure scheme does not need.




>
> /Bruce

^ permalink raw reply	[relevance 0%]

* [PATCH v4 2/3] mldev: introduce support for IO layout
    2023-10-02  9:58  2%   ` [PATCH v4 1/3] mldev: add support for arbitrary shape dimensions Srikanth Yalavarthi
@ 2023-10-02  9:58  1%   ` Srikanth Yalavarthi
  1 sibling, 0 replies; 200+ results
From: Srikanth Yalavarthi @ 2023-10-02  9:58 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara, aprabhu, ptakkar

Introduce IO layout in ML device specification. IO layout
defines the expected arrangement of model input and output
buffers in the memory. Packed and Split layout support is
added in the specification.

Updated rte_ml_op to support array of rte_ml_buff_seg
pointers to support packed and split I/O layouts. Updated
ML quantize and dequantize APIs to support rte_ml_buff_seg
pointer arrays. Replaced batch_size with min_batches and
max_batches in rte_ml_model_info.

Implement support for model IO layout in ml/cnxk driver.
Updated the ML test application to support IO layout and
dropped support for '--batches' in test application.

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 app/test-mldev/ml_options.c            |  16 --
 app/test-mldev/ml_options.h            |   2 -
 app/test-mldev/test_inference_common.c | 327 +++++++++++++++++++++----
 app/test-mldev/test_inference_common.h |   6 +
 app/test-mldev/test_model_common.c     |   6 -
 app/test-mldev/test_model_common.h     |   1 -
 doc/guides/rel_notes/release_23_11.rst |  10 +
 doc/guides/tools/testmldev.rst         |   6 -
 drivers/ml/cnxk/cn10k_ml_dev.h         |   3 +
 drivers/ml/cnxk/cn10k_ml_model.c       |   6 +-
 drivers/ml/cnxk/cn10k_ml_ops.c         |  74 +++---
 lib/mldev/meson.build                  |   2 +-
 lib/mldev/rte_mldev.c                  |  12 +-
 lib/mldev/rte_mldev.h                  |  90 +++++--
 lib/mldev/rte_mldev_core.h             |  14 +-
 15 files changed, 428 insertions(+), 147 deletions(-)

diff --git a/app/test-mldev/ml_options.c b/app/test-mldev/ml_options.c
index d068b30df5..eeaffec399 100644
--- a/app/test-mldev/ml_options.c
+++ b/app/test-mldev/ml_options.c
@@ -28,7 +28,6 @@ ml_options_default(struct ml_options *opt)
 	opt->burst_size = 1;
 	opt->queue_pairs = 1;
 	opt->queue_size = 1;
-	opt->batches = 0;
 	opt->tolerance = 0.0;
 	opt->stats = false;
 	opt->debug = false;
@@ -213,18 +212,6 @@ ml_parse_queue_size(struct ml_options *opt, const char *arg)
 	return ret;
 }
 
-static int
-ml_parse_batches(struct ml_options *opt, const char *arg)
-{
-	int ret;
-
-	ret = parser_read_uint16(&opt->batches, arg);
-	if (ret != 0)
-		ml_err("Invalid option, batches = %s\n", arg);
-
-	return ret;
-}
-
 static int
 ml_parse_tolerance(struct ml_options *opt, const char *arg)
 {
@@ -255,7 +242,6 @@ ml_dump_test_options(const char *testname)
 		       "\t\t--burst_size       : inference burst size\n"
 		       "\t\t--queue_pairs      : number of queue pairs to create\n"
 		       "\t\t--queue_size       : size of queue-pair\n"
-		       "\t\t--batches          : number of batches of input\n"
 		       "\t\t--tolerance        : maximum tolerance (%%) for output validation\n"
 		       "\t\t--stats            : enable reporting device and model statistics\n");
 		printf("\n");
@@ -287,7 +273,6 @@ static struct option lgopts[] = {
 	{ML_BURST_SIZE, 1, 0, 0},
 	{ML_QUEUE_PAIRS, 1, 0, 0},
 	{ML_QUEUE_SIZE, 1, 0, 0},
-	{ML_BATCHES, 1, 0, 0},
 	{ML_TOLERANCE, 1, 0, 0},
 	{ML_STATS, 0, 0, 0},
 	{ML_DEBUG, 0, 0, 0},
@@ -309,7 +294,6 @@ ml_opts_parse_long(int opt_idx, struct ml_options *opt)
 		{ML_BURST_SIZE, ml_parse_burst_size},
 		{ML_QUEUE_PAIRS, ml_parse_queue_pairs},
 		{ML_QUEUE_SIZE, ml_parse_queue_size},
-		{ML_BATCHES, ml_parse_batches},
 		{ML_TOLERANCE, ml_parse_tolerance},
 	};
 
diff --git a/app/test-mldev/ml_options.h b/app/test-mldev/ml_options.h
index 622a4c05fc..90e22adeac 100644
--- a/app/test-mldev/ml_options.h
+++ b/app/test-mldev/ml_options.h
@@ -21,7 +21,6 @@
 #define ML_BURST_SIZE  ("burst_size")
 #define ML_QUEUE_PAIRS ("queue_pairs")
 #define ML_QUEUE_SIZE  ("queue_size")
-#define ML_BATCHES     ("batches")
 #define ML_TOLERANCE   ("tolerance")
 #define ML_STATS       ("stats")
 #define ML_DEBUG       ("debug")
@@ -44,7 +43,6 @@ struct ml_options {
 	uint16_t burst_size;
 	uint16_t queue_pairs;
 	uint16_t queue_size;
-	uint16_t batches;
 	float tolerance;
 	bool stats;
 	bool debug;
diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c
index b40519b5e3..846f71abb1 100644
--- a/app/test-mldev/test_inference_common.c
+++ b/app/test-mldev/test_inference_common.c
@@ -47,7 +47,10 @@ ml_enqueue_single(void *arg)
 	uint64_t start_cycle;
 	uint32_t burst_enq;
 	uint32_t lcore_id;
+	uint64_t offset;
+	uint64_t bufsz;
 	uint16_t fid;
+	uint32_t i;
 	int ret;
 
 	lcore_id = rte_lcore_id();
@@ -66,24 +69,64 @@ ml_enqueue_single(void *arg)
 	if (ret != 0)
 		goto next_model;
 
-retry:
+retry_req:
 	ret = rte_mempool_get(t->model[fid].io_pool, (void **)&req);
 	if (ret != 0)
-		goto retry;
+		goto retry_req;
+
+retry_inp_segs:
+	ret = rte_mempool_get_bulk(t->buf_seg_pool, (void **)req->inp_buf_segs,
+				   t->model[fid].info.nb_inputs);
+	if (ret != 0)
+		goto retry_inp_segs;
+
+retry_out_segs:
+	ret = rte_mempool_get_bulk(t->buf_seg_pool, (void **)req->out_buf_segs,
+				   t->model[fid].info.nb_outputs);
+	if (ret != 0)
+		goto retry_out_segs;
 
 	op->model_id = t->model[fid].id;
-	op->nb_batches = t->model[fid].nb_batches;
+	op->nb_batches = t->model[fid].info.min_batches;
 	op->mempool = t->op_pool;
+	op->input = req->inp_buf_segs;
+	op->output = req->out_buf_segs;
+	op->user_ptr = req;
 
-	op->input.addr = req->input;
-	op->input.length = t->model[fid].inp_qsize;
-	op->input.next = NULL;
+	if (t->model[fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED) {
+		op->input[0]->addr = req->input;
+		op->input[0]->iova_addr = rte_mem_virt2iova(req->input);
+		op->input[0]->length = t->model[fid].inp_qsize;
+		op->input[0]->next = NULL;
+
+		op->output[0]->addr = req->output;
+		op->output[0]->iova_addr = rte_mem_virt2iova(req->output);
+		op->output[0]->length = t->model[fid].out_qsize;
+		op->output[0]->next = NULL;
+	} else {
+		offset = 0;
+		for (i = 0; i < t->model[fid].info.nb_inputs; i++) {
+			bufsz = RTE_ALIGN_CEIL(t->model[fid].info.input_info[i].size,
+					       t->cmn.dev_info.align_size);
+			op->input[i]->addr = req->input + offset;
+			op->input[i]->iova_addr = rte_mem_virt2iova(req->input + offset);
+			op->input[i]->length = bufsz;
+			op->input[i]->next = NULL;
+			offset += bufsz;
+		}
 
-	op->output.addr = req->output;
-	op->output.length = t->model[fid].out_qsize;
-	op->output.next = NULL;
+		offset = 0;
+		for (i = 0; i < t->model[fid].info.nb_outputs; i++) {
+			bufsz = RTE_ALIGN_CEIL(t->model[fid].info.output_info[i].size,
+					       t->cmn.dev_info.align_size);
+			op->output[i]->addr = req->output + offset;
+			op->output[i]->iova_addr = rte_mem_virt2iova(req->output + offset);
+			op->output[i]->length = bufsz;
+			op->output[i]->next = NULL;
+			offset += bufsz;
+		}
+	}
 
-	op->user_ptr = req;
 	req->niters++;
 	req->fid = fid;
 
@@ -143,6 +186,10 @@ ml_dequeue_single(void *arg)
 		}
 		req = (struct ml_request *)op->user_ptr;
 		rte_mempool_put(t->model[req->fid].io_pool, req);
+		rte_mempool_put_bulk(t->buf_seg_pool, (void **)op->input,
+				     t->model[req->fid].info.nb_inputs);
+		rte_mempool_put_bulk(t->buf_seg_pool, (void **)op->output,
+				     t->model[req->fid].info.nb_outputs);
 		rte_mempool_put(t->op_pool, op);
 	}
 
@@ -164,9 +211,12 @@ ml_enqueue_burst(void *arg)
 	uint16_t burst_enq;
 	uint32_t lcore_id;
 	uint16_t pending;
+	uint64_t offset;
+	uint64_t bufsz;
 	uint16_t idx;
 	uint16_t fid;
 	uint16_t i;
+	uint16_t j;
 	int ret;
 
 	lcore_id = rte_lcore_id();
@@ -186,25 +236,70 @@ ml_enqueue_burst(void *arg)
 	if (ret != 0)
 		goto next_model;
 
-retry:
+retry_reqs:
 	ret = rte_mempool_get_bulk(t->model[fid].io_pool, (void **)args->reqs, ops_count);
 	if (ret != 0)
-		goto retry;
+		goto retry_reqs;
 
 	for (i = 0; i < ops_count; i++) {
+retry_inp_segs:
+		ret = rte_mempool_get_bulk(t->buf_seg_pool, (void **)args->reqs[i]->inp_buf_segs,
+					   t->model[fid].info.nb_inputs);
+		if (ret != 0)
+			goto retry_inp_segs;
+
+retry_out_segs:
+		ret = rte_mempool_get_bulk(t->buf_seg_pool, (void **)args->reqs[i]->out_buf_segs,
+					   t->model[fid].info.nb_outputs);
+		if (ret != 0)
+			goto retry_out_segs;
+
 		args->enq_ops[i]->model_id = t->model[fid].id;
-		args->enq_ops[i]->nb_batches = t->model[fid].nb_batches;
+		args->enq_ops[i]->nb_batches = t->model[fid].info.min_batches;
 		args->enq_ops[i]->mempool = t->op_pool;
+		args->enq_ops[i]->input = args->reqs[i]->inp_buf_segs;
+		args->enq_ops[i]->output = args->reqs[i]->out_buf_segs;
+		args->enq_ops[i]->user_ptr = args->reqs[i];
 
-		args->enq_ops[i]->input.addr = args->reqs[i]->input;
-		args->enq_ops[i]->input.length = t->model[fid].inp_qsize;
-		args->enq_ops[i]->input.next = NULL;
+		if (t->model[fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED) {
+			args->enq_ops[i]->input[0]->addr = args->reqs[i]->input;
+			args->enq_ops[i]->input[0]->iova_addr =
+				rte_mem_virt2iova(args->reqs[i]->input);
+			args->enq_ops[i]->input[0]->length = t->model[fid].inp_qsize;
+			args->enq_ops[i]->input[0]->next = NULL;
+
+			args->enq_ops[i]->output[0]->addr = args->reqs[i]->output;
+			args->enq_ops[i]->output[0]->iova_addr =
+				rte_mem_virt2iova(args->reqs[i]->output);
+			args->enq_ops[i]->output[0]->length = t->model[fid].out_qsize;
+			args->enq_ops[i]->output[0]->next = NULL;
+		} else {
+			offset = 0;
+			for (j = 0; j < t->model[fid].info.nb_inputs; j++) {
+				bufsz = RTE_ALIGN_CEIL(t->model[fid].info.input_info[i].size,
+						       t->cmn.dev_info.align_size);
+
+				args->enq_ops[i]->input[j]->addr = args->reqs[i]->input + offset;
+				args->enq_ops[i]->input[j]->iova_addr =
+					rte_mem_virt2iova(args->reqs[i]->input + offset);
+				args->enq_ops[i]->input[j]->length = t->model[fid].inp_qsize;
+				args->enq_ops[i]->input[j]->next = NULL;
+				offset += bufsz;
+			}
 
-		args->enq_ops[i]->output.addr = args->reqs[i]->output;
-		args->enq_ops[i]->output.length = t->model[fid].out_qsize;
-		args->enq_ops[i]->output.next = NULL;
+			offset = 0;
+			for (j = 0; j < t->model[fid].info.nb_outputs; j++) {
+				bufsz = RTE_ALIGN_CEIL(t->model[fid].info.output_info[i].size,
+						       t->cmn.dev_info.align_size);
+				args->enq_ops[i]->output[j]->addr = args->reqs[i]->output + offset;
+				args->enq_ops[i]->output[j]->iova_addr =
+					rte_mem_virt2iova(args->reqs[i]->output + offset);
+				args->enq_ops[i]->output[j]->length = t->model[fid].out_qsize;
+				args->enq_ops[i]->output[j]->next = NULL;
+				offset += bufsz;
+			}
+		}
 
-		args->enq_ops[i]->user_ptr = args->reqs[i];
 		args->reqs[i]->niters++;
 		args->reqs[i]->fid = fid;
 	}
@@ -275,8 +370,15 @@ ml_dequeue_burst(void *arg)
 				t->error_count[lcore_id]++;
 			}
 			req = (struct ml_request *)args->deq_ops[i]->user_ptr;
-			if (req != NULL)
+			if (req != NULL) {
 				rte_mempool_put(t->model[req->fid].io_pool, req);
+				rte_mempool_put_bulk(t->buf_seg_pool,
+						     (void **)args->deq_ops[i]->input,
+						     t->model[req->fid].info.nb_inputs);
+				rte_mempool_put_bulk(t->buf_seg_pool,
+						     (void **)args->deq_ops[i]->output,
+						     t->model[req->fid].info.nb_outputs);
+			}
 		}
 		rte_mempool_put_bulk(t->op_pool, (void *)args->deq_ops, burst_deq);
 	}
@@ -315,6 +417,12 @@ test_inference_cap_check(struct ml_options *opt)
 		return false;
 	}
 
+	if (dev_info.max_io < ML_TEST_MAX_IO_SIZE) {
+		ml_err("Insufficient capabilities:  Max I/O, count = %u > (max limit = %u)",
+		       ML_TEST_MAX_IO_SIZE, dev_info.max_io);
+		return false;
+	}
+
 	return true;
 }
 
@@ -403,11 +511,6 @@ test_inference_opt_dump(struct ml_options *opt)
 	ml_dump("tolerance", "%-7.3f", opt->tolerance);
 	ml_dump("stats", "%s", (opt->stats ? "true" : "false"));
 
-	if (opt->batches == 0)
-		ml_dump("batches", "%u (default batch size)", opt->batches);
-	else
-		ml_dump("batches", "%u", opt->batches);
-
 	ml_dump_begin("filelist");
 	for (i = 0; i < opt->nb_filelist; i++) {
 		ml_dump_list("model", i, opt->filelist[i].model);
@@ -492,10 +595,18 @@ void
 test_inference_destroy(struct ml_test *test, struct ml_options *opt)
 {
 	struct test_inference *t;
+	uint32_t lcore_id;
 
 	RTE_SET_USED(opt);
 
 	t = ml_test_priv(test);
+
+	for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {
+		rte_free(t->args[lcore_id].enq_ops);
+		rte_free(t->args[lcore_id].deq_ops);
+		rte_free(t->args[lcore_id].reqs);
+	}
+
 	rte_free(t);
 }
 
@@ -572,19 +683,62 @@ ml_request_initialize(struct rte_mempool *mp, void *opaque, void *obj, unsigned
 {
 	struct test_inference *t = ml_test_priv((struct ml_test *)opaque);
 	struct ml_request *req = (struct ml_request *)obj;
+	struct rte_ml_buff_seg dbuff_seg[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg qbuff_seg[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg *q_segs[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg *d_segs[ML_TEST_MAX_IO_SIZE];
+	uint64_t offset;
+	uint64_t bufsz;
+	uint32_t i;
 
 	RTE_SET_USED(mp);
 	RTE_SET_USED(obj_idx);
 
 	req->input = (uint8_t *)obj +
-		     RTE_ALIGN_CEIL(sizeof(struct ml_request), t->cmn.dev_info.min_align_size);
-	req->output = req->input +
-		      RTE_ALIGN_CEIL(t->model[t->fid].inp_qsize, t->cmn.dev_info.min_align_size);
+		     RTE_ALIGN_CEIL(sizeof(struct ml_request), t->cmn.dev_info.align_size);
+	req->output =
+		req->input + RTE_ALIGN_CEIL(t->model[t->fid].inp_qsize, t->cmn.dev_info.align_size);
 	req->niters = 0;
 
+	if (t->model[t->fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED) {
+		dbuff_seg[0].addr = t->model[t->fid].input;
+		dbuff_seg[0].iova_addr = rte_mem_virt2iova(t->model[t->fid].input);
+		dbuff_seg[0].length = t->model[t->fid].inp_dsize;
+		dbuff_seg[0].next = NULL;
+		d_segs[0] = &dbuff_seg[0];
+
+		qbuff_seg[0].addr = req->input;
+		qbuff_seg[0].iova_addr = rte_mem_virt2iova(req->input);
+		qbuff_seg[0].length = t->model[t->fid].inp_qsize;
+		qbuff_seg[0].next = NULL;
+		q_segs[0] = &qbuff_seg[0];
+	} else {
+		offset = 0;
+		for (i = 0; i < t->model[t->fid].info.nb_inputs; i++) {
+			bufsz = t->model[t->fid].info.input_info[i].nb_elements * sizeof(float);
+			dbuff_seg[i].addr = t->model[t->fid].input + offset;
+			dbuff_seg[i].iova_addr = rte_mem_virt2iova(t->model[t->fid].input + offset);
+			dbuff_seg[i].length = bufsz;
+			dbuff_seg[i].next = NULL;
+			d_segs[i] = &dbuff_seg[i];
+			offset += bufsz;
+		}
+
+		offset = 0;
+		for (i = 0; i < t->model[t->fid].info.nb_inputs; i++) {
+			bufsz = RTE_ALIGN_CEIL(t->model[t->fid].info.input_info[i].size,
+					       t->cmn.dev_info.align_size);
+			qbuff_seg[i].addr = req->input + offset;
+			qbuff_seg[i].iova_addr = rte_mem_virt2iova(req->input + offset);
+			qbuff_seg[i].length = bufsz;
+			qbuff_seg[i].next = NULL;
+			q_segs[i] = &qbuff_seg[i];
+			offset += bufsz;
+		}
+	}
+
 	/* quantize data */
-	rte_ml_io_quantize(t->cmn.opt->dev_id, t->model[t->fid].id, t->model[t->fid].nb_batches,
-			   t->model[t->fid].input, req->input);
+	rte_ml_io_quantize(t->cmn.opt->dev_id, t->model[t->fid].id, d_segs, q_segs);
 }
 
 int
@@ -599,24 +753,39 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, uint16_t
 	uint32_t buff_size;
 	uint32_t mz_size;
 	size_t fsize;
+	uint32_t i;
 	int ret;
 
 	/* get input buffer size */
-	ret = rte_ml_io_input_size_get(opt->dev_id, t->model[fid].id, t->model[fid].nb_batches,
-				       &t->model[fid].inp_qsize, &t->model[fid].inp_dsize);
-	if (ret != 0) {
-		ml_err("Failed to get input size, model : %s\n", opt->filelist[fid].model);
-		return ret;
+	t->model[fid].inp_qsize = 0;
+	for (i = 0; i < t->model[fid].info.nb_inputs; i++) {
+		if (t->model[fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED)
+			t->model[fid].inp_qsize += t->model[fid].info.input_info[i].size;
+		else
+			t->model[fid].inp_qsize += RTE_ALIGN_CEIL(
+				t->model[fid].info.input_info[i].size, t->cmn.dev_info.align_size);
 	}
 
 	/* get output buffer size */
-	ret = rte_ml_io_output_size_get(opt->dev_id, t->model[fid].id, t->model[fid].nb_batches,
-					&t->model[fid].out_qsize, &t->model[fid].out_dsize);
-	if (ret != 0) {
-		ml_err("Failed to get input size, model : %s\n", opt->filelist[fid].model);
-		return ret;
+	t->model[fid].out_qsize = 0;
+	for (i = 0; i < t->model[fid].info.nb_outputs; i++) {
+		if (t->model[fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED)
+			t->model[fid].out_qsize += t->model[fid].info.output_info[i].size;
+		else
+			t->model[fid].out_qsize += RTE_ALIGN_CEIL(
+				t->model[fid].info.output_info[i].size, t->cmn.dev_info.align_size);
 	}
 
+	t->model[fid].inp_dsize = 0;
+	for (i = 0; i < t->model[fid].info.nb_inputs; i++)
+		t->model[fid].inp_dsize +=
+			t->model[fid].info.input_info[i].nb_elements * sizeof(float);
+
+	t->model[fid].out_dsize = 0;
+	for (i = 0; i < t->model[fid].info.nb_outputs; i++)
+		t->model[fid].out_dsize +=
+			t->model[fid].info.output_info[i].nb_elements * sizeof(float);
+
 	/* allocate buffer for user data */
 	mz_size = t->model[fid].inp_dsize + t->model[fid].out_dsize;
 	if (strcmp(opt->filelist[fid].reference, "\0") != 0)
@@ -675,9 +844,9 @@ ml_inference_iomem_setup(struct ml_test *test, struct ml_options *opt, uint16_t
 	/* create mempool for quantized input and output buffers. ml_request_initialize is
 	 * used as a callback for object creation.
 	 */
-	buff_size = RTE_ALIGN_CEIL(sizeof(struct ml_request), t->cmn.dev_info.min_align_size) +
-		    RTE_ALIGN_CEIL(t->model[fid].inp_qsize, t->cmn.dev_info.min_align_size) +
-		    RTE_ALIGN_CEIL(t->model[fid].out_qsize, t->cmn.dev_info.min_align_size);
+	buff_size = RTE_ALIGN_CEIL(sizeof(struct ml_request), t->cmn.dev_info.align_size) +
+		    RTE_ALIGN_CEIL(t->model[fid].inp_qsize, t->cmn.dev_info.align_size) +
+		    RTE_ALIGN_CEIL(t->model[fid].out_qsize, t->cmn.dev_info.align_size);
 	nb_buffers = RTE_MIN((uint64_t)ML_TEST_MAX_POOL_SIZE, opt->repetitions);
 
 	t->fid = fid;
@@ -740,6 +909,18 @@ ml_inference_mem_setup(struct ml_test *test, struct ml_options *opt)
 		return -ENOMEM;
 	}
 
+	/* create buf_segs pool of with element of uint8_t. external buffers are attached to the
+	 * buf_segs while queuing inference requests.
+	 */
+	t->buf_seg_pool = rte_mempool_create("ml_test_mbuf_pool", ML_TEST_MAX_POOL_SIZE * 2,
+					     sizeof(struct rte_ml_buff_seg), 0, 0, NULL, NULL, NULL,
+					     NULL, opt->socket_id, 0);
+	if (t->buf_seg_pool == NULL) {
+		ml_err("Failed to create buf_segs pool : %s\n", "ml_test_mbuf_pool");
+		rte_ml_op_pool_free(t->op_pool);
+		return -ENOMEM;
+	}
+
 	return 0;
 }
 
@@ -752,6 +933,9 @@ ml_inference_mem_destroy(struct ml_test *test, struct ml_options *opt)
 
 	/* release op pool */
 	rte_mempool_free(t->op_pool);
+
+	/* release buf_segs pool */
+	rte_mempool_free(t->buf_seg_pool);
 }
 
 static bool
@@ -781,8 +965,10 @@ ml_inference_validation(struct ml_test *test, struct ml_request *req)
 		j = 0;
 next_element:
 		match = false;
-		deviation =
-			(*reference == 0 ? 0 : 100 * fabs(*output - *reference) / fabs(*reference));
+		if ((*reference == 0) && (*output == 0))
+			deviation = 0;
+		else
+			deviation = 100 * fabs(*output - *reference) / fabs(*reference);
 		if (deviation <= t->cmn.opt->tolerance)
 			match = true;
 		else
@@ -817,14 +1003,59 @@ ml_request_finish(struct rte_mempool *mp, void *opaque, void *obj, unsigned int
 	bool error = false;
 	char *dump_path;
 
+	struct rte_ml_buff_seg qbuff_seg[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg dbuff_seg[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg *q_segs[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg *d_segs[ML_TEST_MAX_IO_SIZE];
+	uint64_t offset;
+	uint64_t bufsz;
+	uint32_t i;
+
 	RTE_SET_USED(mp);
 
 	if (req->niters == 0)
 		return;
 
 	t->nb_used++;
-	rte_ml_io_dequantize(t->cmn.opt->dev_id, model->id, t->model[req->fid].nb_batches,
-			     req->output, model->output);
+
+	if (t->model[req->fid].info.io_layout == RTE_ML_IO_LAYOUT_PACKED) {
+		qbuff_seg[0].addr = req->output;
+		qbuff_seg[0].iova_addr = rte_mem_virt2iova(req->output);
+		qbuff_seg[0].length = t->model[req->fid].out_qsize;
+		qbuff_seg[0].next = NULL;
+		q_segs[0] = &qbuff_seg[0];
+
+		dbuff_seg[0].addr = model->output;
+		dbuff_seg[0].iova_addr = rte_mem_virt2iova(model->output);
+		dbuff_seg[0].length = t->model[req->fid].out_dsize;
+		dbuff_seg[0].next = NULL;
+		d_segs[0] = &dbuff_seg[0];
+	} else {
+		offset = 0;
+		for (i = 0; i < t->model[req->fid].info.nb_outputs; i++) {
+			bufsz = RTE_ALIGN_CEIL(t->model[req->fid].info.output_info[i].size,
+					       t->cmn.dev_info.align_size);
+			qbuff_seg[i].addr = req->output + offset;
+			qbuff_seg[i].iova_addr = rte_mem_virt2iova(req->output + offset);
+			qbuff_seg[i].length = bufsz;
+			qbuff_seg[i].next = NULL;
+			q_segs[i] = &qbuff_seg[i];
+			offset += bufsz;
+		}
+
+		offset = 0;
+		for (i = 0; i < t->model[req->fid].info.nb_outputs; i++) {
+			bufsz = t->model[req->fid].info.output_info[i].nb_elements * sizeof(float);
+			dbuff_seg[i].addr = model->output + offset;
+			dbuff_seg[i].iova_addr = rte_mem_virt2iova(model->output + offset);
+			dbuff_seg[i].length = bufsz;
+			dbuff_seg[i].next = NULL;
+			d_segs[i] = &dbuff_seg[i];
+			offset += bufsz;
+		}
+	}
+
+	rte_ml_io_dequantize(t->cmn.opt->dev_id, model->id, q_segs, d_segs);
 
 	if (model->reference == NULL)
 		goto dump_output_pass;
diff --git a/app/test-mldev/test_inference_common.h b/app/test-mldev/test_inference_common.h
index 8f27af25e4..3f4ba3219b 100644
--- a/app/test-mldev/test_inference_common.h
+++ b/app/test-mldev/test_inference_common.h
@@ -11,11 +11,16 @@
 
 #include "test_model_common.h"
 
+#define ML_TEST_MAX_IO_SIZE 32
+
 struct ml_request {
 	uint8_t *input;
 	uint8_t *output;
 	uint16_t fid;
 	uint64_t niters;
+
+	struct rte_ml_buff_seg *inp_buf_segs[ML_TEST_MAX_IO_SIZE];
+	struct rte_ml_buff_seg *out_buf_segs[ML_TEST_MAX_IO_SIZE];
 };
 
 struct ml_core_args {
@@ -38,6 +43,7 @@ struct test_inference {
 
 	/* test specific data */
 	struct ml_model model[ML_TEST_MAX_MODELS];
+	struct rte_mempool *buf_seg_pool;
 	struct rte_mempool *op_pool;
 
 	uint64_t nb_used;
diff --git a/app/test-mldev/test_model_common.c b/app/test-mldev/test_model_common.c
index 8dbb0ff89f..c517a50611 100644
--- a/app/test-mldev/test_model_common.c
+++ b/app/test-mldev/test_model_common.c
@@ -50,12 +50,6 @@ ml_model_load(struct ml_test *test, struct ml_options *opt, struct ml_model *mod
 		return ret;
 	}
 
-	/* Update number of batches */
-	if (opt->batches == 0)
-		model->nb_batches = model->info.batch_size;
-	else
-		model->nb_batches = opt->batches;
-
 	model->state = MODEL_LOADED;
 
 	return 0;
diff --git a/app/test-mldev/test_model_common.h b/app/test-mldev/test_model_common.h
index c1021ef1b6..a207e54ab7 100644
--- a/app/test-mldev/test_model_common.h
+++ b/app/test-mldev/test_model_common.h
@@ -31,7 +31,6 @@ struct ml_model {
 	uint8_t *reference;
 
 	struct rte_mempool *io_pool;
-	uint32_t nb_batches;
 };
 
 int ml_model_load(struct ml_test *test, struct ml_options *opt, struct ml_model *model,
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index e553554b3a..8562bac77c 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -41,6 +41,11 @@ DPDK Release 23.11
 New Features
 ------------
 
+   * **Added support for models with multiple I/O in mldev library.**
+
+     Added support in mldev library for models with multiple inputs and outputs.
+
+
 .. This section should contain new features added in this release.
    Sample format:
 
@@ -122,6 +127,11 @@ API Changes
 * mldev: Updated mldev API to support models with multiple inputs and outputs
   Updated the structure ``rte_ml_model_info`` to support input and output with
   arbitrary shapes.
+  Added support for ``rte_ml_io_layout``. Two layout types split and packed are
+  supported by the specification, which enables higher control in handling models
+  with multiple inputs and outputs. Updated ``rte_ml_op``, ``rte_ml_io_quantize``
+  and ``rte_ml_io_dequantize`` to support an array of ``rte_ml_buff_seg`` for
+  inputs and outputs and removed use of batches argument.
 
 ABI Changes
 -----------
diff --git a/doc/guides/tools/testmldev.rst b/doc/guides/tools/testmldev.rst
index 741abd722e..9b1565a457 100644
--- a/doc/guides/tools/testmldev.rst
+++ b/doc/guides/tools/testmldev.rst
@@ -106,11 +106,6 @@ The following are the command-line options supported by the test application.
   Queue size would translate into ``rte_ml_dev_qp_conf::nb_desc`` field during queue-pair creation.
   Default value is ``1``.
 
-``--batches <n>``
-  Set the number batches in the input file provided for inference run.
-  When not specified, the test would assume the number of batches
-  is the batch size of the model.
-
 ``--tolerance <n>``
   Set the tolerance value in percentage to be used for output validation.
   Default value is ``0``.
@@ -282,7 +277,6 @@ Supported command line options for inference tests are following::
    --burst_size
    --queue_pairs
    --queue_size
-   --batches
    --tolerance
    --stats
 
diff --git a/drivers/ml/cnxk/cn10k_ml_dev.h b/drivers/ml/cnxk/cn10k_ml_dev.h
index 6ca0b0bb6e..c73bf7d001 100644
--- a/drivers/ml/cnxk/cn10k_ml_dev.h
+++ b/drivers/ml/cnxk/cn10k_ml_dev.h
@@ -30,6 +30,9 @@
 /* Maximum number of descriptors per queue-pair */
 #define ML_CN10K_MAX_DESC_PER_QP 1024
 
+/* Maximum number of inputs / outputs per model */
+#define ML_CN10K_MAX_INPUT_OUTPUT 32
+
 /* Maximum number of segments for IO data */
 #define ML_CN10K_MAX_SEGMENTS 1
 
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index 26df8d9ff9..e0b750cd8e 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -520,9 +520,11 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 	struct rte_ml_model_info *info;
 	struct rte_ml_io_info *output;
 	struct rte_ml_io_info *input;
+	struct cn10k_ml_dev *mldev;
 	uint8_t i;
 	uint8_t j;
 
+	mldev = dev->data->dev_private;
 	metadata = &model->metadata;
 	info = PLT_PTR_CAST(model->info);
 	input = PLT_PTR_ADD(info, sizeof(struct rte_ml_model_info));
@@ -537,7 +539,9 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 		 metadata->model.version[3]);
 	info->model_id = model->model_id;
 	info->device_id = dev->data->dev_id;
-	info->batch_size = model->batch_size;
+	info->io_layout = RTE_ML_IO_LAYOUT_PACKED;
+	info->min_batches = model->batch_size;
+	info->max_batches = mldev->fw.req->jd.fw_load.cap.s.max_num_batches / model->batch_size;
 	info->nb_inputs = metadata->model.num_input;
 	info->input_info = input;
 	info->nb_outputs = metadata->model.num_output;
diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index e3faab81ba..1d72fb52a6 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -471,9 +471,9 @@ cn10k_ml_prep_fp_job_descriptor(struct rte_ml_dev *dev, struct cn10k_ml_req *req
 	req->jd.hdr.sp_flags = 0x0;
 	req->jd.hdr.result = roc_ml_addr_ap2mlip(&mldev->roc, &req->result);
 	req->jd.model_run.input_ddr_addr =
-		PLT_U64_CAST(roc_ml_addr_ap2mlip(&mldev->roc, op->input.addr));
+		PLT_U64_CAST(roc_ml_addr_ap2mlip(&mldev->roc, op->input[0]->addr));
 	req->jd.model_run.output_ddr_addr =
-		PLT_U64_CAST(roc_ml_addr_ap2mlip(&mldev->roc, op->output.addr));
+		PLT_U64_CAST(roc_ml_addr_ap2mlip(&mldev->roc, op->output[0]->addr));
 	req->jd.model_run.num_batches = op->nb_batches;
 }
 
@@ -856,7 +856,11 @@ cn10k_ml_model_xstats_reset(struct rte_ml_dev *dev, int32_t model_id, const uint
 static int
 cn10k_ml_cache_model_data(struct rte_ml_dev *dev, uint16_t model_id)
 {
+	struct rte_ml_model_info *info;
 	struct cn10k_ml_model *model;
+	struct rte_ml_buff_seg seg[2];
+	struct rte_ml_buff_seg *inp;
+	struct rte_ml_buff_seg *out;
 	struct rte_ml_op op;
 
 	char str[RTE_MEMZONE_NAMESIZE];
@@ -864,12 +868,22 @@ cn10k_ml_cache_model_data(struct rte_ml_dev *dev, uint16_t model_id)
 	uint64_t isize = 0;
 	uint64_t osize = 0;
 	int ret = 0;
+	uint32_t i;
 
 	model = dev->data->models[model_id];
+	info = (struct rte_ml_model_info *)model->info;
+	inp = &seg[0];
+	out = &seg[1];
 
 	/* Create input and output buffers. */
-	rte_ml_io_input_size_get(dev->data->dev_id, model_id, model->batch_size, &isize, NULL);
-	rte_ml_io_output_size_get(dev->data->dev_id, model_id, model->batch_size, &osize, NULL);
+	for (i = 0; i < info->nb_inputs; i++)
+		isize += info->input_info[i].size;
+
+	for (i = 0; i < info->nb_outputs; i++)
+		osize += info->output_info[i].size;
+
+	isize = model->batch_size * isize;
+	osize = model->batch_size * osize;
 
 	snprintf(str, RTE_MEMZONE_NAMESIZE, "%s_%u", "ml_dummy_io", model_id);
 	mz = plt_memzone_reserve_aligned(str, isize + osize, 0, ML_CN10K_ALIGN_SIZE);
@@ -877,17 +891,22 @@ cn10k_ml_cache_model_data(struct rte_ml_dev *dev, uint16_t model_id)
 		return -ENOMEM;
 	memset(mz->addr, 0, isize + osize);
 
+	seg[0].addr = mz->addr;
+	seg[0].iova_addr = mz->iova;
+	seg[0].length = isize;
+	seg[0].next = NULL;
+
+	seg[1].addr = PLT_PTR_ADD(mz->addr, isize);
+	seg[1].iova_addr = mz->iova + isize;
+	seg[1].length = osize;
+	seg[1].next = NULL;
+
 	op.model_id = model_id;
 	op.nb_batches = model->batch_size;
 	op.mempool = NULL;
 
-	op.input.addr = mz->addr;
-	op.input.length = isize;
-	op.input.next = NULL;
-
-	op.output.addr = PLT_PTR_ADD(op.input.addr, isize);
-	op.output.length = osize;
-	op.output.next = NULL;
+	op.input = &inp;
+	op.output = &out;
 
 	memset(model->req, 0, sizeof(struct cn10k_ml_req));
 	ret = cn10k_ml_inference_sync(dev, &op);
@@ -919,8 +938,9 @@ cn10k_ml_dev_info_get(struct rte_ml_dev *dev, struct rte_ml_dev_info *dev_info)
 	else if (strcmp(mldev->fw.poll_mem, "ddr") == 0)
 		dev_info->max_desc = ML_CN10K_MAX_DESC_PER_QP;
 
+	dev_info->max_io = ML_CN10K_MAX_INPUT_OUTPUT;
 	dev_info->max_segments = ML_CN10K_MAX_SEGMENTS;
-	dev_info->min_align_size = ML_CN10K_ALIGN_SIZE;
+	dev_info->align_size = ML_CN10K_ALIGN_SIZE;
 
 	return 0;
 }
@@ -2139,15 +2159,14 @@ cn10k_ml_io_output_size_get(struct rte_ml_dev *dev, uint16_t model_id, uint32_t
 }
 
 static int
-cn10k_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batches, void *dbuffer,
-		     void *qbuffer)
+cn10k_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_buff_seg **dbuffer,
+		     struct rte_ml_buff_seg **qbuffer)
 {
 	struct cn10k_ml_model *model;
 	uint8_t model_input_type;
 	uint8_t *lcl_dbuffer;
 	uint8_t *lcl_qbuffer;
 	uint8_t input_type;
-	uint32_t batch_id;
 	float qscale;
 	uint32_t i;
 	uint32_t j;
@@ -2160,11 +2179,9 @@ cn10k_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batc
 		return -EINVAL;
 	}
 
-	lcl_dbuffer = dbuffer;
-	lcl_qbuffer = qbuffer;
-	batch_id = 0;
+	lcl_dbuffer = dbuffer[0]->addr;
+	lcl_qbuffer = qbuffer[0]->addr;
 
-next_batch:
 	for (i = 0; i < model->metadata.model.num_input; i++) {
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
 			input_type = model->metadata.input1[i].input_type;
@@ -2218,23 +2235,18 @@ cn10k_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batc
 		lcl_qbuffer += model->addr.input[i].sz_q;
 	}
 
-	batch_id++;
-	if (batch_id < PLT_DIV_CEIL(nb_batches, model->batch_size))
-		goto next_batch;
-
 	return 0;
 }
 
 static int
-cn10k_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batches,
-		       void *qbuffer, void *dbuffer)
+cn10k_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, struct rte_ml_buff_seg **qbuffer,
+		       struct rte_ml_buff_seg **dbuffer)
 {
 	struct cn10k_ml_model *model;
 	uint8_t model_output_type;
 	uint8_t *lcl_qbuffer;
 	uint8_t *lcl_dbuffer;
 	uint8_t output_type;
-	uint32_t batch_id;
 	float dscale;
 	uint32_t i;
 	uint32_t j;
@@ -2247,11 +2259,9 @@ cn10k_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_ba
 		return -EINVAL;
 	}
 
-	lcl_dbuffer = dbuffer;
-	lcl_qbuffer = qbuffer;
-	batch_id = 0;
+	lcl_dbuffer = dbuffer[0]->addr;
+	lcl_qbuffer = qbuffer[0]->addr;
 
-next_batch:
 	for (i = 0; i < model->metadata.model.num_output; i++) {
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
 			output_type = model->metadata.output1[i].output_type;
@@ -2306,10 +2316,6 @@ cn10k_ml_io_dequantize(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_ba
 		lcl_dbuffer += model->addr.output[i].sz_d;
 	}
 
-	batch_id++;
-	if (batch_id < PLT_DIV_CEIL(nb_batches, model->batch_size))
-		goto next_batch;
-
 	return 0;
 }
 
diff --git a/lib/mldev/meson.build b/lib/mldev/meson.build
index 5769b0640a..0079ccd205 100644
--- a/lib/mldev/meson.build
+++ b/lib/mldev/meson.build
@@ -35,7 +35,7 @@ driver_sdk_headers += files(
         'mldev_utils.h',
 )
 
-deps += ['mempool']
+deps += ['mempool', 'mbuf']
 
 if get_option('buildtype').contains('debug')
         cflags += [ '-DRTE_LIBRTE_ML_DEV_DEBUG' ]
diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c
index 0d8ccd3212..9a48ed3e94 100644
--- a/lib/mldev/rte_mldev.c
+++ b/lib/mldev/rte_mldev.c
@@ -730,8 +730,8 @@ rte_ml_io_output_size_get(int16_t dev_id, uint16_t model_id, uint32_t nb_batches
 }
 
 int
-rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void *dbuffer,
-		   void *qbuffer)
+rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **dbuffer,
+		   struct rte_ml_buff_seg **qbuffer)
 {
 	struct rte_ml_dev *dev;
 
@@ -754,12 +754,12 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void
 		return -EINVAL;
 	}
 
-	return (*dev->dev_ops->io_quantize)(dev, model_id, nb_batches, dbuffer, qbuffer);
+	return (*dev->dev_ops->io_quantize)(dev, model_id, dbuffer, qbuffer);
 }
 
 int
-rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void *qbuffer,
-		     void *dbuffer)
+rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **qbuffer,
+		     struct rte_ml_buff_seg **dbuffer)
 {
 	struct rte_ml_dev *dev;
 
@@ -782,7 +782,7 @@ rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, voi
 		return -EINVAL;
 	}
 
-	return (*dev->dev_ops->io_dequantize)(dev, model_id, nb_batches, qbuffer, dbuffer);
+	return (*dev->dev_ops->io_dequantize)(dev, model_id, qbuffer, dbuffer);
 }
 
 /** Initialise rte_ml_op mempool element */
diff --git a/lib/mldev/rte_mldev.h b/lib/mldev/rte_mldev.h
index 6204df0930..316c6fd018 100644
--- a/lib/mldev/rte_mldev.h
+++ b/lib/mldev/rte_mldev.h
@@ -228,12 +228,14 @@ struct rte_ml_dev_info {
 	/**< Maximum allowed number of descriptors for queue pair by the device.
 	 * @see struct rte_ml_dev_qp_conf::nb_desc
 	 */
+	uint16_t max_io;
+	/**< Maximum number of inputs/outputs supported per model. */
 	uint16_t max_segments;
 	/**< Maximum number of scatter-gather entries supported by the device.
 	 * @see struct rte_ml_buff_seg  struct rte_ml_buff_seg::next
 	 */
-	uint16_t min_align_size;
-	/**< Minimum alignment size of IO buffers used by the device. */
+	uint16_t align_size;
+	/**< Alignment size of IO buffers used by the device. */
 };
 
 /**
@@ -429,10 +431,28 @@ struct rte_ml_op {
 	/**< Reserved for future use. */
 	struct rte_mempool *mempool;
 	/**< Pool from which operation is allocated. */
-	struct rte_ml_buff_seg input;
-	/**< Input buffer to hold the inference data. */
-	struct rte_ml_buff_seg output;
-	/**< Output buffer to hold the inference output by the driver. */
+	struct rte_ml_buff_seg **input;
+	/**< Array of buffer segments to hold the inference input data.
+	 *
+	 * When the model supports IO layout RTE_ML_IO_LAYOUT_PACKED, size of
+	 * the array is 1.
+	 *
+	 * When the model supports IO layout RTE_ML_IO_LAYOUT_SPLIT, size of
+	 * the array is rte_ml_model_info::nb_inputs.
+	 *
+	 * @see struct rte_ml_dev_info::io_layout
+	 */
+	struct rte_ml_buff_seg **output;
+	/**< Array of buffer segments to hold the inference output data.
+	 *
+	 * When the model supports IO layout RTE_ML_IO_LAYOUT_PACKED, size of
+	 * the array is 1.
+	 *
+	 * When the model supports IO layout RTE_ML_IO_LAYOUT_SPLIT, size of
+	 * the array is rte_ml_model_info::nb_outputs.
+	 *
+	 * @see struct rte_ml_dev_info::io_layout
+	 */
 	union {
 		uint64_t user_u64;
 		/**< User data as uint64_t.*/
@@ -863,7 +883,37 @@ enum rte_ml_io_type {
 	/**< 16-bit brain floating point number. */
 };
 
-/** Input and output data information structure
+/** ML I/O buffer layout */
+enum rte_ml_io_layout {
+	RTE_ML_IO_LAYOUT_PACKED,
+	/**< All inputs for the model should packed in a single buffer with
+	 * no padding between individual inputs. The buffer is expected to
+	 * be aligned to rte_ml_dev_info::align_size.
+	 *
+	 * When I/O segmentation is supported by the device, the packed
+	 * data can be split into multiple segments. In this case, each
+	 * segment is expected to be aligned to rte_ml_dev_info::align_size
+	 *
+	 * Same applies to output.
+	 *
+	 * @see struct rte_ml_dev_info::max_segments
+	 */
+	RTE_ML_IO_LAYOUT_SPLIT
+	/**< Each input for the model should be stored as separate buffers
+	 * and each input should be aligned to rte_ml_dev_info::align_size.
+	 *
+	 * When I/O segmentation is supported, each input can be split into
+	 * multiple segments. In this case, each segment is expected to be
+	 * aligned to rte_ml_dev_info::align_size
+	 *
+	 * Same applies to output.
+	 *
+	 * @see struct rte_ml_dev_info::max_segments
+	 */
+};
+
+/**
+ * Input and output data information structure
  *
  * Specifies the type and shape of input and output data.
  */
@@ -873,7 +923,7 @@ struct rte_ml_io_info {
 	uint32_t nb_dims;
 	/**< Number of dimensions in shape */
 	uint32_t *shape;
-	/**< Shape of the tensor */
+	/**< Shape of the tensor for rte_ml_model_info::min_batches of the model. */
 	enum rte_ml_io_type type;
 	/**< Type of data
 	 * @see enum rte_ml_io_type
@@ -894,8 +944,16 @@ struct rte_ml_model_info {
 	/**< Model ID */
 	uint16_t device_id;
 	/**< Device ID */
-	uint16_t batch_size;
-	/**< Maximum number of batches that the model can process simultaneously */
+	enum rte_ml_io_layout io_layout;
+	/**< I/O buffer layout for the model */
+	uint16_t min_batches;
+	/**< Minimum number of batches that the model can process
+	 * in one inference request
+	 */
+	uint16_t max_batches;
+	/**< Maximum number of batches that the model can process
+	 * in one inference request
+	 */
 	uint32_t nb_inputs;
 	/**< Number of inputs */
 	const struct rte_ml_io_info *input_info;
@@ -1021,8 +1079,6 @@ rte_ml_io_output_size_get(int16_t dev_id, uint16_t model_id, uint32_t nb_batches
  *   The identifier of the device.
  * @param[in] model_id
  *   Identifier for the model
- * @param[in] nb_batches
- *   Number of batches in the dequantized input buffer
  * @param[in] dbuffer
  *   Address of dequantized input data
  * @param[in] qbuffer
@@ -1034,8 +1090,8 @@ rte_ml_io_output_size_get(int16_t dev_id, uint16_t model_id, uint32_t nb_batches
  */
 __rte_experimental
 int
-rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void *dbuffer,
-		   void *qbuffer);
+rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **dbuffer,
+		   struct rte_ml_buff_seg **qbuffer);
 
 /**
  * Dequantize output data.
@@ -1047,8 +1103,6 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void
  *   The identifier of the device.
  * @param[in] model_id
  *   Identifier for the model
- * @param[in] nb_batches
- *   Number of batches in the dequantized output buffer
  * @param[in] qbuffer
  *   Address of quantized output data
  * @param[in] dbuffer
@@ -1060,8 +1114,8 @@ rte_ml_io_quantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void
  */
 __rte_experimental
 int
-rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, uint16_t nb_batches, void *qbuffer,
-		     void *dbuffer);
+rte_ml_io_dequantize(int16_t dev_id, uint16_t model_id, struct rte_ml_buff_seg **qbuffer,
+		     struct rte_ml_buff_seg **dbuffer);
 
 /* ML op pool operations */
 
diff --git a/lib/mldev/rte_mldev_core.h b/lib/mldev/rte_mldev_core.h
index 78b8b7633d..8530b07316 100644
--- a/lib/mldev/rte_mldev_core.h
+++ b/lib/mldev/rte_mldev_core.h
@@ -523,8 +523,6 @@ typedef int (*mldev_io_output_size_get_t)(struct rte_ml_dev *dev, uint16_t model
  *	ML device pointer.
  * @param model_id
  *	Model ID to use.
- * @param nb_batches
- *	Number of batches.
  * @param dbuffer
  *	Pointer t de-quantized data buffer.
  * @param qbuffer
@@ -534,8 +532,9 @@ typedef int (*mldev_io_output_size_get_t)(struct rte_ml_dev *dev, uint16_t model
  *	- 0 on success.
  *	- <0, error on failure.
  */
-typedef int (*mldev_io_quantize_t)(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batches,
-				   void *dbuffer, void *qbuffer);
+typedef int (*mldev_io_quantize_t)(struct rte_ml_dev *dev, uint16_t model_id,
+				   struct rte_ml_buff_seg **dbuffer,
+				   struct rte_ml_buff_seg **qbuffer);
 
 /**
  * @internal
@@ -546,8 +545,6 @@ typedef int (*mldev_io_quantize_t)(struct rte_ml_dev *dev, uint16_t model_id, ui
  *	ML device pointer.
  * @param model_id
  *	Model ID to use.
- * @param nb_batches
- *	Number of batches.
  * @param qbuffer
  *	Pointer t de-quantized data buffer.
  * @param dbuffer
@@ -557,8 +554,9 @@ typedef int (*mldev_io_quantize_t)(struct rte_ml_dev *dev, uint16_t model_id, ui
  *	- 0 on success.
  *	- <0, error on failure.
  */
-typedef int (*mldev_io_dequantize_t)(struct rte_ml_dev *dev, uint16_t model_id, uint16_t nb_batches,
-				     void *qbuffer, void *dbuffer);
+typedef int (*mldev_io_dequantize_t)(struct rte_ml_dev *dev, uint16_t model_id,
+				     struct rte_ml_buff_seg **qbuffer,
+				     struct rte_ml_buff_seg **dbuffer);
 
 /**
  * @internal
-- 
2.41.0


^ permalink raw reply	[relevance 1%]

* [PATCH v4 1/3] mldev: add support for arbitrary shape dimensions
  @ 2023-10-02  9:58  2%   ` Srikanth Yalavarthi
  2023-10-02  9:58  1%   ` [PATCH v4 2/3] mldev: introduce support for IO layout Srikanth Yalavarthi
  1 sibling, 0 replies; 200+ results
From: Srikanth Yalavarthi @ 2023-10-02  9:58 UTC (permalink / raw)
  To: Srikanth Yalavarthi; +Cc: dev, sshankarnara, aprabhu, ptakkar

Updated rte_ml_io_info to support shape of arbitrary
number of dimensions. Dropped use of rte_ml_io_shape
and rte_ml_io_format. Introduced new fields nb_elements
and size in rte_ml_io_info.

Updated drivers and app/mldev to support the changes.

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 app/test-mldev/test_inference_common.c | 97 +++++---------------------
 doc/guides/rel_notes/release_23_11.rst |  3 +
 drivers/ml/cnxk/cn10k_ml_model.c       | 78 +++++++++++++--------
 drivers/ml/cnxk/cn10k_ml_model.h       | 12 ++++
 drivers/ml/cnxk/cn10k_ml_ops.c         | 11 +--
 lib/mldev/mldev_utils.c                | 30 --------
 lib/mldev/mldev_utils.h                | 16 -----
 lib/mldev/rte_mldev.h                  | 59 ++++------------
 lib/mldev/version.map                  |  1 -
 9 files changed, 97 insertions(+), 210 deletions(-)

diff --git a/app/test-mldev/test_inference_common.c b/app/test-mldev/test_inference_common.c
index 05b221401b..b40519b5e3 100644
--- a/app/test-mldev/test_inference_common.c
+++ b/app/test-mldev/test_inference_common.c
@@ -3,6 +3,7 @@
  */
 
 #include <errno.h>
+#include <math.h>
 #include <stdio.h>
 #include <unistd.h>
 
@@ -18,11 +19,6 @@
 #include "ml_common.h"
 #include "test_inference_common.h"
 
-#define ML_TEST_READ_TYPE(buffer, type) (*((type *)buffer))
-
-#define ML_TEST_CHECK_OUTPUT(output, reference, tolerance) \
-	(((float)output - (float)reference) <= (((float)reference * tolerance) / 100.0))
-
 #define ML_OPEN_WRITE_GET_ERR(name, buffer, size, err) \
 	do { \
 		FILE *fp = fopen(name, "w+"); \
@@ -763,9 +759,9 @@ ml_inference_validation(struct ml_test *test, struct ml_request *req)
 {
 	struct test_inference *t = ml_test_priv((struct ml_test *)test);
 	struct ml_model *model;
-	uint32_t nb_elements;
-	uint8_t *reference;
-	uint8_t *output;
+	float *reference;
+	float *output;
+	float deviation;
 	bool match;
 	uint32_t i;
 	uint32_t j;
@@ -777,89 +773,30 @@ ml_inference_validation(struct ml_test *test, struct ml_request *req)
 		match = (rte_hash_crc(model->output, model->out_dsize, 0) ==
 			 rte_hash_crc(model->reference, model->out_dsize, 0));
 	} else {
-		output = model->output;
-		reference = model->reference;
+		output = (float *)model->output;
+		reference = (float *)model->reference;
 
 		i = 0;
 next_output:
-		nb_elements =
-			model->info.output_info[i].shape.w * model->info.output_info[i].shape.x *
-			model->info.output_info[i].shape.y * model->info.output_info[i].shape.z;
 		j = 0;
 next_element:
 		match = false;
-		switch (model->info.output_info[i].dtype) {
-		case RTE_ML_IO_TYPE_INT8:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int8_t),
-						 ML_TEST_READ_TYPE(reference, int8_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(int8_t);
-			reference += sizeof(int8_t);
-			break;
-		case RTE_ML_IO_TYPE_UINT8:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint8_t),
-						 ML_TEST_READ_TYPE(reference, uint8_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(float);
-			reference += sizeof(float);
-			break;
-		case RTE_ML_IO_TYPE_INT16:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int16_t),
-						 ML_TEST_READ_TYPE(reference, int16_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(int16_t);
-			reference += sizeof(int16_t);
-			break;
-		case RTE_ML_IO_TYPE_UINT16:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint16_t),
-						 ML_TEST_READ_TYPE(reference, uint16_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(uint16_t);
-			reference += sizeof(uint16_t);
-			break;
-		case RTE_ML_IO_TYPE_INT32:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, int32_t),
-						 ML_TEST_READ_TYPE(reference, int32_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(int32_t);
-			reference += sizeof(int32_t);
-			break;
-		case RTE_ML_IO_TYPE_UINT32:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, uint32_t),
-						 ML_TEST_READ_TYPE(reference, uint32_t),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(uint32_t);
-			reference += sizeof(uint32_t);
-			break;
-		case RTE_ML_IO_TYPE_FP32:
-			if (ML_TEST_CHECK_OUTPUT(ML_TEST_READ_TYPE(output, float),
-						 ML_TEST_READ_TYPE(reference, float),
-						 t->cmn.opt->tolerance))
-				match = true;
-
-			output += sizeof(float);
-			reference += sizeof(float);
-			break;
-		default: /* other types, fp8, fp16, bfloat16 */
+		deviation =
+			(*reference == 0 ? 0 : 100 * fabs(*output - *reference) / fabs(*reference));
+		if (deviation <= t->cmn.opt->tolerance)
 			match = true;
-		}
+		else
+			ml_err("id = %d, element = %d, output = %f, reference = %f, deviation = %f %%\n",
+			       i, j, *output, *reference, deviation);
+
+		output++;
+		reference++;
 
 		if (!match)
 			goto done;
+
 		j++;
-		if (j < nb_elements)
+		if (j < model->info.output_info[i].nb_elements)
 			goto next_element;
 
 		i++;
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 9746809a66..e553554b3a 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -119,6 +119,9 @@ API Changes
   except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
   replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
+* mldev: Updated mldev API to support models with multiple inputs and outputs
+  Updated the structure ``rte_ml_model_info`` to support input and output with
+  arbitrary shapes.
 
 ABI Changes
 -----------
diff --git a/drivers/ml/cnxk/cn10k_ml_model.c b/drivers/ml/cnxk/cn10k_ml_model.c
index 92c47d39ba..26df8d9ff9 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.c
+++ b/drivers/ml/cnxk/cn10k_ml_model.c
@@ -366,6 +366,12 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_
 	addr->total_input_sz_q = 0;
 	for (i = 0; i < metadata->model.num_input; i++) {
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
+			addr->input[i].nb_dims = 4;
+			addr->input[i].shape[0] = metadata->input1[i].shape.w;
+			addr->input[i].shape[1] = metadata->input1[i].shape.x;
+			addr->input[i].shape[2] = metadata->input1[i].shape.y;
+			addr->input[i].shape[3] = metadata->input1[i].shape.z;
+
 			addr->input[i].nb_elements =
 				metadata->input1[i].shape.w * metadata->input1[i].shape.x *
 				metadata->input1[i].shape.y * metadata->input1[i].shape.z;
@@ -386,6 +392,13 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_
 				addr->input[i].sz_q);
 		} else {
 			j = i - MRVL_ML_NUM_INPUT_OUTPUT_1;
+
+			addr->input[i].nb_dims = 4;
+			addr->input[i].shape[0] = metadata->input2[j].shape.w;
+			addr->input[i].shape[1] = metadata->input2[j].shape.x;
+			addr->input[i].shape[2] = metadata->input2[j].shape.y;
+			addr->input[i].shape[3] = metadata->input2[j].shape.z;
+
 			addr->input[i].nb_elements =
 				metadata->input2[j].shape.w * metadata->input2[j].shape.x *
 				metadata->input2[j].shape.y * metadata->input2[j].shape.z;
@@ -412,6 +425,8 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_
 	addr->total_output_sz_d = 0;
 	for (i = 0; i < metadata->model.num_output; i++) {
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
+			addr->output[i].nb_dims = 1;
+			addr->output[i].shape[0] = metadata->output1[i].size;
 			addr->output[i].nb_elements = metadata->output1[i].size;
 			addr->output[i].sz_d =
 				addr->output[i].nb_elements *
@@ -426,6 +441,9 @@ cn10k_ml_model_addr_update(struct cn10k_ml_model *model, uint8_t *buffer, uint8_
 				   model->model_id, i, addr->output[i].sz_d, addr->output[i].sz_q);
 		} else {
 			j = i - MRVL_ML_NUM_INPUT_OUTPUT_1;
+
+			addr->output[i].nb_dims = 1;
+			addr->output[i].shape[0] = metadata->output2[j].size;
 			addr->output[i].nb_elements = metadata->output2[j].size;
 			addr->output[i].sz_d =
 				addr->output[i].nb_elements *
@@ -498,6 +516,7 @@ void
 cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 {
 	struct cn10k_ml_model_metadata *metadata;
+	struct cn10k_ml_model_addr *addr;
 	struct rte_ml_model_info *info;
 	struct rte_ml_io_info *output;
 	struct rte_ml_io_info *input;
@@ -508,6 +527,7 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 	info = PLT_PTR_CAST(model->info);
 	input = PLT_PTR_ADD(info, sizeof(struct rte_ml_model_info));
 	output = PLT_PTR_ADD(input, metadata->model.num_input * sizeof(struct rte_ml_io_info));
+	addr = &model->addr;
 
 	/* Set model info */
 	memset(info, 0, sizeof(struct rte_ml_model_info));
@@ -529,24 +549,25 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
 			rte_memcpy(input[i].name, metadata->input1[i].input_name,
 				   MRVL_ML_INPUT_NAME_LEN);
-			input[i].dtype = metadata->input1[i].input_type;
-			input[i].qtype = metadata->input1[i].model_input_type;
-			input[i].shape.format = metadata->input1[i].shape.format;
-			input[i].shape.w = metadata->input1[i].shape.w;
-			input[i].shape.x = metadata->input1[i].shape.x;
-			input[i].shape.y = metadata->input1[i].shape.y;
-			input[i].shape.z = metadata->input1[i].shape.z;
+			input[i].nb_dims = addr->input[i].nb_dims;
+			input[i].shape = addr->input[i].shape;
+			input[i].type = metadata->input1[i].model_input_type;
+			input[i].nb_elements = addr->input[i].nb_elements;
+			input[i].size =
+				addr->input[i].nb_elements *
+				rte_ml_io_type_size_get(metadata->input1[i].model_input_type);
 		} else {
 			j = i - MRVL_ML_NUM_INPUT_OUTPUT_1;
+
 			rte_memcpy(input[i].name, metadata->input2[j].input_name,
 				   MRVL_ML_INPUT_NAME_LEN);
-			input[i].dtype = metadata->input2[j].input_type;
-			input[i].qtype = metadata->input2[j].model_input_type;
-			input[i].shape.format = metadata->input2[j].shape.format;
-			input[i].shape.w = metadata->input2[j].shape.w;
-			input[i].shape.x = metadata->input2[j].shape.x;
-			input[i].shape.y = metadata->input2[j].shape.y;
-			input[i].shape.z = metadata->input2[j].shape.z;
+			input[i].nb_dims = addr->input[i].nb_dims;
+			input[i].shape = addr->input[i].shape;
+			input[i].type = metadata->input2[j].model_input_type;
+			input[i].nb_elements = addr->input[i].nb_elements;
+			input[i].size =
+				addr->input[i].nb_elements *
+				rte_ml_io_type_size_get(metadata->input2[j].model_input_type);
 		}
 	}
 
@@ -555,24 +576,25 @@ cn10k_ml_model_info_set(struct rte_ml_dev *dev, struct cn10k_ml_model *model)
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
 			rte_memcpy(output[i].name, metadata->output1[i].output_name,
 				   MRVL_ML_OUTPUT_NAME_LEN);
-			output[i].dtype = metadata->output1[i].output_type;
-			output[i].qtype = metadata->output1[i].model_output_type;
-			output[i].shape.format = RTE_ML_IO_FORMAT_1D;
-			output[i].shape.w = metadata->output1[i].size;
-			output[i].shape.x = 1;
-			output[i].shape.y = 1;
-			output[i].shape.z = 1;
+			output[i].nb_dims = addr->output[i].nb_dims;
+			output[i].shape = addr->output[i].shape;
+			output[i].type = metadata->output1[i].model_output_type;
+			output[i].nb_elements = addr->output[i].nb_elements;
+			output[i].size =
+				addr->output[i].nb_elements *
+				rte_ml_io_type_size_get(metadata->output1[i].model_output_type);
 		} else {
 			j = i - MRVL_ML_NUM_INPUT_OUTPUT_1;
+
 			rte_memcpy(output[i].name, metadata->output2[j].output_name,
 				   MRVL_ML_OUTPUT_NAME_LEN);
-			output[i].dtype = metadata->output2[j].output_type;
-			output[i].qtype = metadata->output2[j].model_output_type;
-			output[i].shape.format = RTE_ML_IO_FORMAT_1D;
-			output[i].shape.w = metadata->output2[j].size;
-			output[i].shape.x = 1;
-			output[i].shape.y = 1;
-			output[i].shape.z = 1;
+			output[i].nb_dims = addr->output[i].nb_dims;
+			output[i].shape = addr->output[i].shape;
+			output[i].type = metadata->output2[j].model_output_type;
+			output[i].nb_elements = addr->output[i].nb_elements;
+			output[i].size =
+				addr->output[i].nb_elements *
+				rte_ml_io_type_size_get(metadata->output2[j].model_output_type);
 		}
 	}
 }
diff --git a/drivers/ml/cnxk/cn10k_ml_model.h b/drivers/ml/cnxk/cn10k_ml_model.h
index 1f689363fc..4cc0744891 100644
--- a/drivers/ml/cnxk/cn10k_ml_model.h
+++ b/drivers/ml/cnxk/cn10k_ml_model.h
@@ -409,6 +409,12 @@ struct cn10k_ml_model_addr {
 
 	/* Input address and size */
 	struct {
+		/* Number of dimensions in shape */
+		uint32_t nb_dims;
+
+		/* Shape of input */
+		uint32_t shape[4];
+
 		/* Number of elements */
 		uint32_t nb_elements;
 
@@ -421,6 +427,12 @@ struct cn10k_ml_model_addr {
 
 	/* Output address and size */
 	struct {
+		/* Number of dimensions in shape */
+		uint32_t nb_dims;
+
+		/* Shape of input */
+		uint32_t shape[4];
+
 		/* Number of elements */
 		uint32_t nb_elements;
 
diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c
index 656467d891..e3faab81ba 100644
--- a/drivers/ml/cnxk/cn10k_ml_ops.c
+++ b/drivers/ml/cnxk/cn10k_ml_ops.c
@@ -321,8 +321,8 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)
 	fprintf(fp, "\n");
 
 	print_line(fp, LINE_LEN);
-	fprintf(fp, "%8s  %16s  %12s  %18s  %12s  %14s\n", "input", "input_name", "input_type",
-		"model_input_type", "quantize", "format");
+	fprintf(fp, "%8s  %16s  %12s  %18s  %12s\n", "input", "input_name", "input_type",
+		"model_input_type", "quantize");
 	print_line(fp, LINE_LEN);
 	for (i = 0; i < model->metadata.model.num_input; i++) {
 		if (i < MRVL_ML_NUM_INPUT_OUTPUT_1) {
@@ -335,12 +335,10 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)
 			fprintf(fp, "%*s  ", 18, str);
 			fprintf(fp, "%*s", 12,
 				(model->metadata.input1[i].quantize == 1 ? "Yes" : "No"));
-			rte_ml_io_format_to_str(model->metadata.input1[i].shape.format, str,
-						STR_LEN);
-			fprintf(fp, "%*s", 16, str);
 			fprintf(fp, "\n");
 		} else {
 			j = i - MRVL_ML_NUM_INPUT_OUTPUT_1;
+
 			fprintf(fp, "%8u  ", i);
 			fprintf(fp, "%*s  ", 16, model->metadata.input2[j].input_name);
 			rte_ml_io_type_to_str(model->metadata.input2[j].input_type, str, STR_LEN);
@@ -350,9 +348,6 @@ cn10k_ml_model_print(struct rte_ml_dev *dev, uint16_t model_id, FILE *fp)
 			fprintf(fp, "%*s  ", 18, str);
 			fprintf(fp, "%*s", 12,
 				(model->metadata.input2[j].quantize == 1 ? "Yes" : "No"));
-			rte_ml_io_format_to_str(model->metadata.input2[j].shape.format, str,
-						STR_LEN);
-			fprintf(fp, "%*s", 16, str);
 			fprintf(fp, "\n");
 		}
 	}
diff --git a/lib/mldev/mldev_utils.c b/lib/mldev/mldev_utils.c
index d2442b123b..ccd2c39ca8 100644
--- a/lib/mldev/mldev_utils.c
+++ b/lib/mldev/mldev_utils.c
@@ -86,33 +86,3 @@ rte_ml_io_type_to_str(enum rte_ml_io_type type, char *str, int len)
 		rte_strlcpy(str, "invalid", len);
 	}
 }
-
-void
-rte_ml_io_format_to_str(enum rte_ml_io_format format, char *str, int len)
-{
-	switch (format) {
-	case RTE_ML_IO_FORMAT_NCHW:
-		rte_strlcpy(str, "NCHW", len);
-		break;
-	case RTE_ML_IO_FORMAT_NHWC:
-		rte_strlcpy(str, "NHWC", len);
-		break;
-	case RTE_ML_IO_FORMAT_CHWN:
-		rte_strlcpy(str, "CHWN", len);
-		break;
-	case RTE_ML_IO_FORMAT_3D:
-		rte_strlcpy(str, "3D", len);
-		break;
-	case RTE_ML_IO_FORMAT_2D:
-		rte_strlcpy(str, "Matrix", len);
-		break;
-	case RTE_ML_IO_FORMAT_1D:
-		rte_strlcpy(str, "Vector", len);
-		break;
-	case RTE_ML_IO_FORMAT_SCALAR:
-		rte_strlcpy(str, "Scalar", len);
-		break;
-	default:
-		rte_strlcpy(str, "invalid", len);
-	}
-}
diff --git a/lib/mldev/mldev_utils.h b/lib/mldev/mldev_utils.h
index 5bc8020453..220afb42f0 100644
--- a/lib/mldev/mldev_utils.h
+++ b/lib/mldev/mldev_utils.h
@@ -52,22 +52,6 @@ __rte_internal
 void
 rte_ml_io_type_to_str(enum rte_ml_io_type type, char *str, int len);
 
-/**
- * @internal
- *
- * Get the name of an ML IO format.
- *
- * @param[in] type
- *	Enumeration of ML IO format.
- * @param[in] str
- *	Address of character array.
- * @param[in] len
- *	Length of character array.
- */
-__rte_internal
-void
-rte_ml_io_format_to_str(enum rte_ml_io_format format, char *str, int len);
-
 /**
  * @internal
  *
diff --git a/lib/mldev/rte_mldev.h b/lib/mldev/rte_mldev.h
index fc3525c1ab..6204df0930 100644
--- a/lib/mldev/rte_mldev.h
+++ b/lib/mldev/rte_mldev.h
@@ -863,47 +863,6 @@ enum rte_ml_io_type {
 	/**< 16-bit brain floating point number. */
 };
 
-/**
- * Input and output format. This is used to represent the encoding type of multi-dimensional
- * used by ML models.
- */
-enum rte_ml_io_format {
-	RTE_ML_IO_FORMAT_NCHW = 1,
-	/**< Batch size (N) x channels (C) x height (H) x width (W) */
-	RTE_ML_IO_FORMAT_NHWC,
-	/**< Batch size (N) x height (H) x width (W) x channels (C) */
-	RTE_ML_IO_FORMAT_CHWN,
-	/**< Channels (C) x height (H) x width (W) x batch size (N) */
-	RTE_ML_IO_FORMAT_3D,
-	/**< Format to represent a 3 dimensional data */
-	RTE_ML_IO_FORMAT_2D,
-	/**< Format to represent matrix data */
-	RTE_ML_IO_FORMAT_1D,
-	/**< Format to represent vector data */
-	RTE_ML_IO_FORMAT_SCALAR,
-	/**< Format to represent scalar data */
-};
-
-/**
- * Input and output shape. This structure represents the encoding format and dimensions
- * of the tensor or vector.
- *
- * The data can be a 4D / 3D tensor, matrix, vector or a scalar. Number of dimensions used
- * for the data would depend on the format. Unused dimensions to be set to 1.
- */
-struct rte_ml_io_shape {
-	enum rte_ml_io_format format;
-	/**< Format of the data */
-	uint32_t w;
-	/**< First dimension */
-	uint32_t x;
-	/**< Second dimension */
-	uint32_t y;
-	/**< Third dimension */
-	uint32_t z;
-	/**< Fourth dimension */
-};
-
 /** Input and output data information structure
  *
  * Specifies the type and shape of input and output data.
@@ -911,12 +870,18 @@ struct rte_ml_io_shape {
 struct rte_ml_io_info {
 	char name[RTE_ML_STR_MAX];
 	/**< Name of data */
-	struct rte_ml_io_shape shape;
-	/**< Shape of data */
-	enum rte_ml_io_type qtype;
-	/**< Type of quantized data */
-	enum rte_ml_io_type dtype;
-	/**< Type of de-quantized data */
+	uint32_t nb_dims;
+	/**< Number of dimensions in shape */
+	uint32_t *shape;
+	/**< Shape of the tensor */
+	enum rte_ml_io_type type;
+	/**< Type of data
+	 * @see enum rte_ml_io_type
+	 */
+	uint64_t nb_elements;
+	/** Number of elements in tensor */
+	uint64_t size;
+	/** Size of tensor in bytes */
 };
 
 /** Model information structure */
diff --git a/lib/mldev/version.map b/lib/mldev/version.map
index 0706b565be..40ff27f4b9 100644
--- a/lib/mldev/version.map
+++ b/lib/mldev/version.map
@@ -51,7 +51,6 @@ INTERNAL {
 
 	rte_ml_io_type_size_get;
 	rte_ml_io_type_to_str;
-	rte_ml_io_format_to_str;
 	rte_ml_io_float32_to_int8;
 	rte_ml_io_int8_to_float32;
 	rte_ml_io_float32_to_uint8;
-- 
2.41.0


^ permalink raw reply	[relevance 2%]

* Re: [PATCH v3] bus/cdx: provide driver flag for optional resource mapping
  @ 2023-09-29 15:17  3%   ` David Marchand
  2023-10-04 10:06  0%     ` Gangurde, Abhijit
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-09-29 15:17 UTC (permalink / raw)
  To: Abhijit Gangurde; +Cc: Nipun.Gupta, nikhil.agarwal, dev, Ferruh.Yigit, thomas

On Tue, Jul 11, 2023 at 7:52 AM Abhijit Gangurde
<abhijit.gangurde@amd.com> wrote:
> @@ -383,10 +384,12 @@ cdx_probe_one_driver(struct rte_cdx_driver *dr,
>         CDX_BUS_DEBUG("  probe device %s using driver: %s", dev_name,
>                 dr->driver.name);
>
> -       ret = cdx_vfio_map_resource(dev);
> -       if (ret != 0) {
> -               CDX_BUS_ERR("CDX map device failed: %d", ret);
> -               goto error_map_device;
> +       if (dr->drv_flags & RTE_CDX_DRV_NEED_MAPPING) {
> +               ret = cdx_vfio_map_resource(dev);
> +               if (ret != 0) {
> +                       CDX_BUS_ERR("CDX map device failed: %d", ret);
> +                       goto error_map_device;
> +               }
>         }
>
>         /* call the driver probe() function */
> diff --git a/drivers/bus/cdx/rte_bus_cdx.h b/drivers/bus/cdx/rte_bus_cdx.h
> new file mode 100644
> index 0000000000..4ca12f90c4
> --- /dev/null
> +++ b/drivers/bus/cdx/rte_bus_cdx.h
> @@ -0,0 +1,52 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + * Copyright (C) 2023, Advanced Micro Devices, Inc.
> + */
> +
> +#ifndef RTE_BUS_CDX_H
> +#define RTE_BUS_CDX_H
> +
> +/**
> + * @file
> + * CDX device & driver interface
> + */
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/* Forward declarations */
> +struct rte_cdx_device;
> +
> +/**
> + * Map the CDX device resources in user space virtual memory address.
> + *
> + * Note that driver should not call this function when flag
> + * RTE_CDX_DRV_NEED_MAPPING is set, as EAL will do that for
> + * you when it's on.

Why should we export this function in the application ABI, if it is
only used by drivers?


> + *
> + * @param dev
> + *   A pointer to a rte_cdx_device structure describing the device
> + *   to use.
> + *
> + * @return
> + *   0 on success, negative on error and positive if no driver
> + *   is found for the device.
> + */
> +__rte_experimental
> +int rte_cdx_map_device(struct rte_cdx_device *dev);
>


-- 
David Marchand


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v6 0/6] rte atomics API for optional stdatomic
  2023-08-22 21:00  3% ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
  2023-08-22 21:00  2%   ` [PATCH v6 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
  2023-08-29 15:57  0%   ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
@ 2023-09-29 14:09  0%   ` David Marchand
  2 siblings, 0 replies; 200+ results
From: David Marchand @ 2023-09-29 14:09 UTC (permalink / raw)
  To: Tyler Retzlaff
  Cc: dev, techboard, Bruce Richardson, Honnappa Nagarahalli,
	Ruifeng Wang, Jerin Jacob, Sunil Kumar Kori,
	Mattias Rönnblom, Joyce Kong, David Christensen,
	Konstantin Ananyev, David Hunt, Thomas Monjalon

Hello,

On Tue, Aug 22, 2023 at 11:00 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> This series introduces API additions prefixed in the rte namespace that allow
> the optional use of stdatomics.h from C11 using enable_stdatomics=true for
> targets where enable_stdatomics=false no functional change is intended.
>
> Be aware this does not contain all changes to use stdatomics across the DPDK
> tree it only introduces the minimum to allow the option to be used which is
> a pre-requisite for a clean CI (probably using clang) that can be run
> with enable_stdatomics=true enabled.
>
> It is planned that subsequent series will be introduced per lib/driver as
> appropriate to further enable stdatomics use when enable_stdatomics=true.
>
> Notes:
>
> * Additional libraries beyond EAL make visible atomics use across the
>   API/ABI surface they will be converted in the subsequent series.
>
> * The eal: add rte atomic qualifier with casts patch needs some discussion
>   as to whether or not the legacy rte_atomic APIs should be converted to
>   work with enable_stdatomic=true right now some implementation dependent
>   casts are used to prevent cascading / having to convert too much in
>   the intial series.
>
> * Windows will obviously need complete conversion of libraries including
>   atomics that are not crossing API/ABI boundaries. those conversions will
>   introduced in separate series as new along side the existing msvc series.
>
> Please keep in mind we would like to prioritize the review / acceptance of
> this patch since it needs to be completed in the 23.11 merge window.
>
> Thank you all for the discussion that lead to the formation of this series.

I did a number of updates on this v6:
- moved rte_stdatomic.h from patch 1 to later patches where needed,
- added a RN entry,
- tried to consistently/adjusted indent,
- fixed mentions of stdatomic*s* to simple atomic, like in the build
option name,
- removed unneded comments (Thomas review on patch 1),

Series applied, thanks Tyler.


Two things are missing:
- add doxygen tags in the new API (this can be fixed later in this
release, can you look at it?),
- add compilation tests for enable_stdatomic (I'll send a patch soon
for devtools and GHA),


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-27 13:13  0%     ` Ferruh Yigit
@ 2023-09-28  9:31  0%       ` Tummala, Sivaprasad
  0 siblings, 0 replies; 200+ results
From: Tummala, Sivaprasad @ 2023-09-28  9:31 UTC (permalink / raw)
  To: Yigit, Ferruh, ruifeng.wang, zhoumin, drc, kda, bruce.richardson,
	konstantin.v.ananyev
  Cc: dev

[AMD Official Use Only - General]

> -----Original Message-----
> From: Yigit, Ferruh <Ferruh.Yigit@amd.com>
> Sent: Wednesday, September 27, 2023 6:44 PM
> To: Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>;
> ruifeng.wang@arm.com; zhoumin@loongson.cn; drc@linux.vnet.ibm.com;
> kda@semihalf.com; bruce.richardson@intel.com; konstantin.v.ananyev@yandex.ru
> Cc: dev@dpdk.org
> Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
>
> On 8/11/2023 7:07 AM, Sivaprasad Tummala wrote:
> > This patch removes RTE_CPUFLAG_NUMFLAGS to allow new CPU features
> > without breaking ABI each time.
> >
> > Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> > ---
> >  lib/eal/arm/include/rte_cpuflags_32.h    | 1 -
> >  lib/eal/arm/include/rte_cpuflags_64.h    | 1 -
> >  lib/eal/arm/rte_cpuflags.c               | 7 +++++--
> >  lib/eal/loongarch/include/rte_cpuflags.h | 1 -
> >  lib/eal/loongarch/rte_cpuflags.c         | 7 +++++--
> >  lib/eal/ppc/include/rte_cpuflags.h       | 1 -
> >  lib/eal/ppc/rte_cpuflags.c               | 7 +++++--
> >  lib/eal/riscv/include/rte_cpuflags.h     | 1 -
> >  lib/eal/riscv/rte_cpuflags.c             | 7 +++++--
> >  lib/eal/x86/include/rte_cpuflags.h       | 1 -
> >  lib/eal/x86/rte_cpuflags.c               | 7 +++++--
> >  11 files changed, 25 insertions(+), 16 deletions(-)
> >
>
> Hi Sivaprasad,
>
> Is the relevant deprecation notice removed somewhere, if not can you please
> remove it in this set?
>
> Thanks,
> Ferruh
Sure, will do the needful

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v4 1/3] lib: introduce dispatcher library
  2023-09-27  8:13  3%         ` Bruce Richardson
@ 2023-09-28  7:44  0%           ` Mattias Rönnblom
  2023-10-03 17:31  0%           ` Jerin Jacob
  1 sibling, 0 replies; 200+ results
From: Mattias Rönnblom @ 2023-09-28  7:44 UTC (permalink / raw)
  To: Bruce Richardson, Jerin Jacob
  Cc: Mattias Rönnblom, dev, Jerin Jacob, techboard,
	harry.van.haaren, Peter Nilsson, Heng Wang, Naga Harish K S V,
	Pavan Nikhilesh, Gujjar Abhinandan S, Erik Gabriel Carrillo,
	Shijith Thotton, Hemant Agrawal, Sachin Saxena, Liang Ma,
	Peter Mccarthy, Zhirun Yan

On 2023-09-27 10:13, Bruce Richardson wrote:
> On Tue, Sep 26, 2023 at 11:58:37PM +0530, Jerin Jacob wrote:
>> On Mon, Sep 25, 2023 at 12:41 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
>>>
>>> On 2023-09-22 09:38, Mattias Rönnblom wrote:
>>>
>>> <snip>
>>>
>>>> +int
>>>> +rte_dispatcher_create(uint8_t id, uint8_t event_dev_id)
>>>> +{
>>>
>>>
>>> There are two changes I'm considering:
>>>
>>> 1) Removing the "id" to identify the dispatcher, replacing it with an
>>> forward-declared rte_dispatcher struct pointer.
>>>
>>> struct rte_dispatcher;
>>>
>>> struct rte_dispatcher *
>>> rte_dispatcher_create(uint8_t event_dev_id);
>>>
>>>
>>> The original reason for using an integer id to identify a dispatcher is
>>> to make it look like everything else in Eventdev. I find this pattern a
>>> little awkward to use - in particular the fact the id is
>>> application-allocated (and thus require coordination between different
>>> part of the application in case multiple instances are used).
>>>
>>> 2) Adding a flags field to the create function "for future use". But
>>> since the API is experimental, there may not be that much need to
>>> attempt to be future-proof?
>>>
>>> Any thoughts are appreciated.
>>
>> IMO, better to have rte_dispatcher_create(struct
>> rte_dispatch_create_params *params)
>> for better future proofing with specific
>> rte_dispatch_crearte_params_init() API(No need to add reserved fields
>> in rte_dispatch_create_params  now, may need only for before removing
>> experimental status)
>>
>> Just 2c.
>>
> 
> I don't like using structs in those cases, I'd much rather have a flags
> parameter, as flags can be checked for explicit zeros for future proofing,
> while a struct cannot be checked for extra space on the end for future
> fields added.
> 
> Furthermore, if we need to add new parameters to the create function, I
> actually believe it is better to add them as explicit parameters rather
> than new fields to the struct. Struct fields can be missed by a user just
> recompiling, while new function parameters will be flagged by the compiler
> to make the user aware of the change. [There would be no change for ABI
> compatibility as function versioning would be usable in both cases]
> 

I will just have the create() function take the eventdev id, only, and 
thus make no attempt at "future-proofing". Then we will see what the 
future holds; flags, function parameters, or function parameters packed 
into structs.

^ permalink raw reply	[relevance 0%]

* [PATCH v3 4/4] mldev: update release notes for 23.11
  @ 2023-09-27 18:11  4%   ` Srikanth Yalavarthi
  0 siblings, 0 replies; 200+ results
From: Srikanth Yalavarthi @ 2023-09-27 18:11 UTC (permalink / raw)
  Cc: dev, syalavarthi, sshankarnara, aprabhu, ptakkar

Updated 23.11 release notes for mldev spec.

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 doc/guides/rel_notes/release_23_11.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 9746809a66..ca31ac5985 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -41,6 +41,11 @@ DPDK Release 23.11
 New Features
 ------------
 
+   * **Added support for models with multiple I/O in mldev library.**
+
+     Added support in mldev library for models with multiple inputs and outputs.
+
+
 .. This section should contain new features added in this release.
    Sample format:
 
@@ -97,6 +102,8 @@ Removed Items
 
 * kni: Removed the Kernel Network Interface (KNI) library and driver.
 
+* mldev: Removed APIs ``rte_ml_io_input_size_get`` and ``rte_ml_io_output_size_get``.
+
 
 API Changes
 -----------
@@ -119,6 +126,14 @@ API Changes
   except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
   replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
+* mldev: Updated mldev API to support models with multiple inputs and outputs.
+  Updated the structure ``rte_ml_model_info`` to support input and output with
+  arbitrary shapes. Introduced support for ``rte_ml_io_layout``. Two layout types
+  split and packed are supported by the specification, which enables higher
+  control in handling models with multiple inputs and outputs. Updated ``rte_ml_op``,
+  ``rte_ml_io_quantize`` and ``rte_ml_io_dequantize`` to support an array of
+  ``rte_ml_buff_seg`` for inputs and outputs and removed use of batches argument.
+
 
 ABI Changes
 -----------
-- 
2.41.0


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-27 15:03  0%                       ` Stanisław Kardach
@ 2023-09-27 16:13  0%                         ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-09-27 16:13 UTC (permalink / raw)
  To: Stanisław Kardach
  Cc: Tummala, Sivaprasad, David Marchand, Ruifeng Wang, Min Zhou,
	David Christensen, Bruce Richardson, Konstantin Ananyev, dev,
	Thomas Monjalon

On 9/27/2023 4:03 PM, Stanisław Kardach wrote:
> 
> 
> On Wed, Sep 27, 2023, 16:09 Ferruh Yigit <ferruh.yigit@amd.com
> <mailto:ferruh.yigit@amd.com>> wrote:
> 
>     On 9/27/2023 2:48 PM, Stanisław Kardach wrote:
>     > On Wed, Sep 27, 2023 at 1:55 PM Ferruh Yigit <ferruh.yigit@amd.com
>     <mailto:ferruh.yigit@amd.com>> wrote:
>     >>
>     >> On 9/21/2023 3:49 PM, Stanisław Kardach wrote:
>     >>> On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad
>     >>> <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>
>     <mailto:Sivaprasad.Tummala@amd.com
>     <mailto:Sivaprasad.Tummala@amd.com>>> wrote:
>     >>>
>     >>>     [AMD Official Use Only - General]
>     >>>
>     >>>     > -----Original Message-----
>     >>>     > From: David Marchand <david.marchand@redhat.com
>     <mailto:david.marchand@redhat.com>
>     >>>     <mailto:david.marchand@redhat.com
>     <mailto:david.marchand@redhat.com>>>
>     >>>     > Sent: Wednesday, September 20, 2023 1:05 PM
>     >>>     > To: Stanisław Kardach <kda@semihalf.com
>     <mailto:kda@semihalf.com>
>     >>>     <mailto:kda@semihalf.com <mailto:kda@semihalf.com>>>;
>     Tummala, Sivaprasad
>     >>>     > <Sivaprasad.Tummala@amd.com
>     <mailto:Sivaprasad.Tummala@amd.com>
>     <mailto:Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>>
>     >>>     > Cc: Ruifeng Wang <ruifeng.wang@arm.com
>     <mailto:ruifeng.wang@arm.com>
>     >>>     <mailto:ruifeng.wang@arm.com
>     <mailto:ruifeng.wang@arm.com>>>; Min Zhou <zhoumin@loongson.cn
>     <mailto:zhoumin@loongson.cn>
>     >>>     <mailto:zhoumin@loongson.cn <mailto:zhoumin@loongson.cn>>>;
>     >>>     > David Christensen <drc@linux.vnet.ibm.com
>     <mailto:drc@linux.vnet.ibm.com>
>     >>>     <mailto:drc@linux.vnet.ibm.com
>     <mailto:drc@linux.vnet.ibm.com>>>; Bruce Richardson
>     >>>     > <bruce.richardson@intel.com
>     <mailto:bruce.richardson@intel.com>
>     <mailto:bruce.richardson@intel.com
>     <mailto:bruce.richardson@intel.com>>>;
>     >>>     Konstantin Ananyev
>     >>>     > <konstantin.v.ananyev@yandex.ru
>     <mailto:konstantin.v.ananyev@yandex.ru>
>     >>>     <mailto:konstantin.v.ananyev@yandex.ru
>     <mailto:konstantin.v.ananyev@yandex.ru>>>; dev <dev@dpdk.org
>     <mailto:dev@dpdk.org>
>     >>>     <mailto:dev@dpdk.org <mailto:dev@dpdk.org>>>; Yigit, Ferruh
>     >>>     > <Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>
>     <mailto:Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>>>; Thomas
>     >>>     Monjalon <thomas@monjalon.net <mailto:thomas@monjalon.net>
>     <mailto:thomas@monjalon.net <mailto:thomas@monjalon.net>>>
>     >>>     > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
>     >>>     >
>     >>>     > Caution: This message originated from an External Source. Use
>     >>>     proper caution
>     >>>     > when opening attachments, clicking links, or responding.
>     >>>     >
>     >>>     >
>     >>>     > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach
>     >>>     <kda@semihalf.com <mailto:kda@semihalf.com>
>     <mailto:kda@semihalf.com <mailto:kda@semihalf.com>>> wrote:
>     >>>     > >
>     >>>     > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
>     >>>     > <david.marchand@redhat.com
>     <mailto:david.marchand@redhat.com> <mailto:david.marchand@redhat.com
>     <mailto:david.marchand@redhat.com>>> wrote:
>     >>>     > > <snip>
>     >>>     > > > > Also I see you're still removing the
>     RTE_CPUFLAG_NUMFLAGS
>     >>>     (what I call a
>     >>>     > last element canary). Why? If you're concerned with ABI, then
>     >>>     we're talking about
>     >>>     > an application linking dynamically with DPDK or talking
>     via some
>     >>>     RPC channel with
>     >>>     > another DPDK application. So clashing with this definition
>     does
>     >>>     not come into
>     >>>     > question. One should rather use rte_cpu_get_flag_enabled().
>     >>>     > > > > Also if you want to introduce new features, one
>     would add
>     >>>     them yo the
>     >>>     > rte_cpuflags headers, unless you'd like to not add those
>     and keep an
>     >>>     > undocumented list "above" the last defined element.
>     >>>     > > > > Could you explain a bit more Your use-case?
>     >>>     > > >
>     >>>     > > > Hey Stanislaw,
>     >>>     > > >
>     >>>     > > > Talking generically, one problem with such pattern
>     (having a LAST,
>     >>>     > > > or MAX enum) is when an array sized with such a symbol
>     is exposed.
>     >>>     > > > As I mentionned in the past, this can have unwanted
>     effects:
>     >>>     > > >
>     >>>   
>      https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493 <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>     >>>   
>      <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493 <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>>
>     >>>     > > > -1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>
>     >>>     <http://1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>>
>     >>>     >
>     >>>     > Argh... who broke copy/paste in my browser ?!
>     >>>     > Wrt to MAX and arrays, I wanted to point at:
>     >>>     >
>     >>>   
>      http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR> <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR>>
>     >>>     > TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>
>     <http://TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>>
>     >>>     >
>     >>>     > > I agree, though I'd argue "LAST" and "MAX" semantics are
>     a bit
>     >>>     different. "LAST"
>     >>>     > delimits the known enumeration territory while "MAX" is
>     more of a
>     >>>     `constepxr`
>     >>>     > value type.
>     >>>     > > >
>     >>>     > > > Another issue is when an existing enum meaning
>     changes: from the
>     >>>     > > > application pov, the (old) MAX value is incorrect, but
>     for the
>     >>>     > > > library pov, a new meaning has been associated.
>     >>>     > > > This may trigger bugs in the application when calling
>     a function
>     >>>     > > > that returns such an enum which never return this MAX
>     value in
>     >>>     the past.
>     >>>     > > >
>     >>>     > > > For at least those two reasons, removing those canary
>     elements is
>     >>>     > > > being done in DPDK.
>     >>>     > > >
>     >>>     > > > This specific removal has been announced:
>     >>>     > > >
>     >>>   
>      https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493 <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>     >>>   
>      <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493 <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>>
>     >>>     > > > -1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>
>     >>>     <http://1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>>
>     >>>     > > Thanks for pointing this out but did you mean to link to the
>     >>>     patch again here?
>     >>>     >
>     >>>     > Sorry, same here, bad copy/paste :-(.
>     >>>     >
>     >>>     > The intended link is:
>     >>>     https://git.dpdk.org/dpdk/commit/?id=5da7c13521
>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>
>     >>>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521
>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>>
>     >>>     > The deprecation notice was badly formulated and this patch
>     here is
>     >>>     consistent with
>     >>>     > it.
>     >>>     >
>     >>>     >
>     >>>     > > >
>     >>>     > > > Now, practically, when I look at the cpuflags API, I
>     don't see us
>     >>>     > > > exposed to those two issues wrt rte_cpu_flag_t, so
>     maybe this
>     >>>     change
>     >>>     > > > is unneeded.
>     >>>     > > > But on the other hand, is it really an issue for an
>     application to
>     >>>     > > > lose this (internal) information?
>     >>>     > > I doubt it, maybe it could be used as a sanity check for
>     >>>     choosing proper functors
>     >>>     > in the application. Though the initial description of the
>     reason
>     >>>     behind this patch was
>     >>>     > to not break the ABI and I don't think it does that. What
>     it does
>     >>>     is enforces users to
>     >>>     > use explicit cpu flag values which is a good thing. Though
>     if so,
>     >>>     then it should be
>     >>>     > stated in the commit description.
>     >>>     >
>     >>>     > I agree.
>     >>>     > Siva, can you work on a new revision?
>     >>>     >
>     >>>     David, Stanislaw,
>     >>>
>     >>>     The original motivation of this patch was to avoid ABI
>     breakage with
>     >>>     the introduction of new CPU flag
>     >>>     "RTE_CPUFLAG_MONITORX"
>     >>>   
>      (http://mails.dpdk.org/archives/test-report/2023-April/382489.html
>     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html>
>     >>>   
>      <http://mails.dpdk.org/archives/test-report/2023-April/382489.html
>     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html>>).
>     >>>
>     >>>     Because of ABI breakage, the feature was postponed to this
>     release.
>     >>>   
>      https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/ <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/> <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/ <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/>>
>     >>>
>     >>> This test is flawed, reason being that the NUMFLAGS should not be
>     >>> treated as a flag value and instead as a canary but this test is not
>     >>> taking into account.
>     >>>
>     >>
>     >> Hi Stanislaw,
>     >>
>     >> Why test is flawed?
>     >>
>     >> The enum in in the public header, so the 'RTE_CPUFLAG_NUMFLAGS' enum
>     >> item, and there are APIs using the enum, so the enum exchanged
>     between
>     >> shared library and the application.
>     > In a similar way lots of Linux uapi headers contain bits that should
>     > not be used directly, even though they are defined there. The reason
>     > for that is the C language syntax, not necessarily the intent of a
>     > developer.
>     > Since NUMFLAGS was a canary to make the flag handling code easier, it
>     > should not be treated as a "real" value and hence my suggestion of a
>     > flawed test. That said, NUMFLAGS does not bring enough value to not
>     > remove it. :)
>     >
> 
>     Both it doesn't enough value to hang on, and we don't have control on
>     how it is used by the application once it is exposed by the library.
> 
> 
>     >>
>     >> Similar thing discussed before and when enum exchanged between
>     >> application and shared library, there is an ABI breakage risk
>     when enum
>     >> extended and general tendency is to eliminate the MAX value to reduce
>     >> the risk.
>     > Agreed though as I have mentioned before, "MAX" has a different
>     > semantics than "NUM". Then again since we have rte_cpu_feature_table,
>     > we can RTE_DIM to check the user input.
>     >
> 
>     Their usage and intention on having them is same I think, can you please
>     elaborate what is the difference between MAX and NUM enum items that is
>     added as last item in an enum?
> 
> MAX specifies a semantic numerical value, such as MTU. NUM counts
> elements in an enumeration where elements describe some items and their
> value is just an implementation detail.
> 
> 

Ahh, I see your point now.

Most of the times, in enums, last item with name MAX is indeed used as
count of elements more than maximum semantic value, and sometimes LAST
is used for the same. So we are using them interchangeably with NUM.

I agree, for a MAX value as you are referring semantics is different,
but the one mentioned in this context is not an instance for that case.


> 
>     >>
>     >>
>     >> When enum value sent from library to application, it is more
>     clear that
>     >> this can cause an ABI breakage, because application can receive a
>     value
>     >> that it is not aware in the build time, which can cause
>     unexpected behavior.
>     >> Simply think about a case application allocated array in
>     >> 'RTE_CPUFLAG_NUMFLAGS' size and directly accessing the array
>     index based
>     >> on returned enum item value, if the enum extended in the new
>     version of
>     >> the shared library, this can cause invalid memory access in
>     application.
>     > Using the NUM enum element (which serves as a last item canary) to
>     > size an array is not a good idea unless it's returned from a runtime
>     > call. Otherwise one hits issues that you've described.
>     >
> 
>     I agree :), but that is a way to describe how it can be a problem.
>     Also last time I argued similar to what you said, that application
>     should check against MAX value before using it but I have been told
>     not to assume what application does. My take from it is, expect worst
>     from application as a library side developer.
> 
> 
>     >>
>     >> When enum value sent from application to library, I am not quite sure
>     >> how problematic it is to be honest. Like being in the
>     >> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' in question.
>     >> Only when application sends 'RTE_CPUFLAG_NUMFLAGS' to
>     >> 'rte_cpu_get_flag_name()', it expects a NULL returned, but this won't
>     >> happen in new version of the shared library, not sure if this can
>     cause
>     >> any problem for the application.
>     >> But as I mentioned, general guidance is to eliminate this kind of MAX
>     >> enum value usage.
>     >>
>     >>
>     >> And for this specific issue, although usage of the enum in
>     >> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' APIs is not
>     >> clear if it cause ABI breakage,
>     >> enum being embedded into the 'struct rte_bbdev_driver_info' struct
>     >> doesn't leave a question, since this struct is returned from
>     library to
>     >> the application and change in the enum causes an ABI breakage.
>     > Enum size does not change irrespective of changing its values. So
>     > size-wise it's not an ABI breakage. Re-ordering values is an ABI
>     > breakage.>
> 
>     Agree it is not size-wise issue. But still an issue.
> 
> 
>     >>
>     >>
>     >> Briefly, I think even appending to the end of 'enum rte_cpu_flag_t'
>     >> cause ABI breakage and removing 'RTE_CPUFLAG_NUMFLAGS' helps to
>     extend
>     >> this enum in the future.
>     >> And an outstanding deprecation notice already exists for this:
>     >>
>     https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63 <https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63>
>     >>
>     >>
>     >>> Your change did not break the ABI because you have properly
>     added the
>     >>> new flag at the end.
>     >>> So I would ask to change the commit description to mention that
>     NUMFLAGS
>     >>> is removed to:
>     >>> 1. Prevent users from treating it as a usable value or an array
>     size.
>     >>> 2. Prevent false-positive failures in the ABI test.
>     >>>
>     >>> Also it would be good to link to the aforementioned ABI test
>     failure to
>     >>> give readers some context when inspecting the git tree.
>     >>>
>     >>>
>     >>>
>     >>>     Can you please add what exactly needs to be reworked in the
>     new version.
>     >>>
>     >>>     >
>     >>>     > Thanks.
>     >>>     >
>     >>>     > --
>     >>>     > David Marchand
>     >>>
>     >>
>     >
>     >
> 


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-27 14:09  0%                     ` Ferruh Yigit
@ 2023-09-27 15:03  0%                       ` Stanisław Kardach
  2023-09-27 16:13  0%                         ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Stanisław Kardach @ 2023-09-27 15:03 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Tummala, Sivaprasad, David Marchand, Ruifeng Wang, Min Zhou,
	David Christensen, Bruce Richardson, Konstantin Ananyev, dev,
	Thomas Monjalon

[-- Attachment #1: Type: text/plain, Size: 12535 bytes --]

On Wed, Sep 27, 2023, 16:09 Ferruh Yigit <ferruh.yigit@amd.com> wrote:

> On 9/27/2023 2:48 PM, Stanisław Kardach wrote:
> > On Wed, Sep 27, 2023 at 1:55 PM Ferruh Yigit <ferruh.yigit@amd.com>
> wrote:
> >>
> >> On 9/21/2023 3:49 PM, Stanisław Kardach wrote:
> >>> On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad
> >>> <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>
> wrote:
> >>>
> >>>     [AMD Official Use Only - General]
> >>>
> >>>     > -----Original Message-----
> >>>     > From: David Marchand <david.marchand@redhat.com
> >>>     <mailto:david.marchand@redhat.com>>
> >>>     > Sent: Wednesday, September 20, 2023 1:05 PM
> >>>     > To: Stanisław Kardach <kda@semihalf.com
> >>>     <mailto:kda@semihalf.com>>; Tummala, Sivaprasad
> >>>     > <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>
> >>>     > Cc: Ruifeng Wang <ruifeng.wang@arm.com
> >>>     <mailto:ruifeng.wang@arm.com>>; Min Zhou <zhoumin@loongson.cn
> >>>     <mailto:zhoumin@loongson.cn>>;
> >>>     > David Christensen <drc@linux.vnet.ibm.com
> >>>     <mailto:drc@linux.vnet.ibm.com>>; Bruce Richardson
> >>>     > <bruce.richardson@intel.com <mailto:bruce.richardson@intel.com
> >>;
> >>>     Konstantin Ananyev
> >>>     > <konstantin.v.ananyev@yandex.ru
> >>>     <mailto:konstantin.v.ananyev@yandex.ru>>; dev <dev@dpdk.org
> >>>     <mailto:dev@dpdk.org>>; Yigit, Ferruh
> >>>     > <Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>>; Thomas
> >>>     Monjalon <thomas@monjalon.net <mailto:thomas@monjalon.net>>
> >>>     > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
> >>>     >
> >>>     > Caution: This message originated from an External Source. Use
> >>>     proper caution
> >>>     > when opening attachments, clicking links, or responding.
> >>>     >
> >>>     >
> >>>     > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach
> >>>     <kda@semihalf.com <mailto:kda@semihalf.com>> wrote:
> >>>     > >
> >>>     > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
> >>>     > <david.marchand@redhat.com <mailto:david.marchand@redhat.com>>
> wrote:
> >>>     > > <snip>
> >>>     > > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS
> >>>     (what I call a
> >>>     > last element canary). Why? If you're concerned with ABI, then
> >>>     we're talking about
> >>>     > an application linking dynamically with DPDK or talking via some
> >>>     RPC channel with
> >>>     > another DPDK application. So clashing with this definition does
> >>>     not come into
> >>>     > question. One should rather use rte_cpu_get_flag_enabled().
> >>>     > > > > Also if you want to introduce new features, one would add
> >>>     them yo the
> >>>     > rte_cpuflags headers, unless you'd like to not add those and
> keep an
> >>>     > undocumented list "above" the last defined element.
> >>>     > > > > Could you explain a bit more Your use-case?
> >>>     > > >
> >>>     > > > Hey Stanislaw,
> >>>     > > >
> >>>     > > > Talking generically, one problem with such pattern (having a
> LAST,
> >>>     > > > or MAX enum) is when an array sized with such a symbol is
> exposed.
> >>>     > > > As I mentionned in the past, this can have unwanted effects:
> >>>     > > >
> >>>
> https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> >>>     <
> https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
> >>>     > > > -1-david.marchand@redhat.com/
> >>>     <http://1-david.marchand@redhat.com/>
> >>>     >
> >>>     > Argh... who broke copy/paste in my browser ?!
> >>>     > Wrt to MAX and arrays, I wanted to point at:
> >>>     >
> >>>
> http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR
> <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR
> >
> >>>     > TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>
> >>>     >
> >>>     > > I agree, though I'd argue "LAST" and "MAX" semantics are a bit
> >>>     different. "LAST"
> >>>     > delimits the known enumeration territory while "MAX" is more of a
> >>>     `constepxr`
> >>>     > value type.
> >>>     > > >
> >>>     > > > Another issue is when an existing enum meaning changes: from
> the
> >>>     > > > application pov, the (old) MAX value is incorrect, but for
> the
> >>>     > > > library pov, a new meaning has been associated.
> >>>     > > > This may trigger bugs in the application when calling a
> function
> >>>     > > > that returns such an enum which never return this MAX value
> in
> >>>     the past.
> >>>     > > >
> >>>     > > > For at least those two reasons, removing those canary
> elements is
> >>>     > > > being done in DPDK.
> >>>     > > >
> >>>     > > > This specific removal has been announced:
> >>>     > > >
> >>>
> https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> >>>     <
> https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
> >>>     > > > -1-david.marchand@redhat.com/
> >>>     <http://1-david.marchand@redhat.com/>
> >>>     > > Thanks for pointing this out but did you mean to link to the
> >>>     patch again here?
> >>>     >
> >>>     > Sorry, same here, bad copy/paste :-(.
> >>>     >
> >>>     > The intended link is:
> >>>     https://git.dpdk.org/dpdk/commit/?id=5da7c13521
> >>>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>
> >>>     > The deprecation notice was badly formulated and this patch here
> is
> >>>     consistent with
> >>>     > it.
> >>>     >
> >>>     >
> >>>     > > >
> >>>     > > > Now, practically, when I look at the cpuflags API, I don't
> see us
> >>>     > > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this
> >>>     change
> >>>     > > > is unneeded.
> >>>     > > > But on the other hand, is it really an issue for an
> application to
> >>>     > > > lose this (internal) information?
> >>>     > > I doubt it, maybe it could be used as a sanity check for
> >>>     choosing proper functors
> >>>     > in the application. Though the initial description of the reason
> >>>     behind this patch was
> >>>     > to not break the ABI and I don't think it does that. What it does
> >>>     is enforces users to
> >>>     > use explicit cpu flag values which is a good thing. Though if so,
> >>>     then it should be
> >>>     > stated in the commit description.
> >>>     >
> >>>     > I agree.
> >>>     > Siva, can you work on a new revision?
> >>>     >
> >>>     David, Stanislaw,
> >>>
> >>>     The original motivation of this patch was to avoid ABI breakage
> with
> >>>     the introduction of new CPU flag
> >>>     "RTE_CPUFLAG_MONITORX"
> >>>     (http://mails.dpdk.org/archives/test-report/2023-April/382489.html
> >>>     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html
> >).
> >>>
> >>>     Because of ABI breakage, the feature was postponed to this release.
> >>>
> https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/
> <
> https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/
> >
> >>>
> >>> This test is flawed, reason being that the NUMFLAGS should not be
> >>> treated as a flag value and instead as a canary but this test is not
> >>> taking into account.
> >>>
> >>
> >> Hi Stanislaw,
> >>
> >> Why test is flawed?
> >>
> >> The enum in in the public header, so the 'RTE_CPUFLAG_NUMFLAGS' enum
> >> item, and there are APIs using the enum, so the enum exchanged between
> >> shared library and the application.
> > In a similar way lots of Linux uapi headers contain bits that should
> > not be used directly, even though they are defined there. The reason
> > for that is the C language syntax, not necessarily the intent of a
> > developer.
> > Since NUMFLAGS was a canary to make the flag handling code easier, it
> > should not be treated as a "real" value and hence my suggestion of a
> > flawed test. That said, NUMFLAGS does not bring enough value to not
> > remove it. :)
> >
>
> Both it doesn't enough value to hang on, and we don't have control on
> how it is used by the application once it is exposed by the library.
>
>
> >>
> >> Similar thing discussed before and when enum exchanged between
> >> application and shared library, there is an ABI breakage risk when enum
> >> extended and general tendency is to eliminate the MAX value to reduce
> >> the risk.
> > Agreed though as I have mentioned before, "MAX" has a different
> > semantics than "NUM". Then again since we have rte_cpu_feature_table,
> > we can RTE_DIM to check the user input.
> >
>
> Their usage and intention on having them is same I think, can you please
> elaborate what is the difference between MAX and NUM enum items that is
> added as last item in an enum?
>
MAX specifies a semantic numerical value, such as MTU. NUM counts elements
in an enumeration where elements describe some items and their value is
just an implementation detail.

>
>
> >>
> >>
> >> When enum value sent from library to application, it is more clear that
> >> this can cause an ABI breakage, because application can receive a value
> >> that it is not aware in the build time, which can cause unexpected
> behavior.
> >> Simply think about a case application allocated array in
> >> 'RTE_CPUFLAG_NUMFLAGS' size and directly accessing the array index based
> >> on returned enum item value, if the enum extended in the new version of
> >> the shared library, this can cause invalid memory access in application.
> > Using the NUM enum element (which serves as a last item canary) to
> > size an array is not a good idea unless it's returned from a runtime
> > call. Otherwise one hits issues that you've described.
> >
>
> I agree :), but that is a way to describe how it can be a problem.
> Also last time I argued similar to what you said, that application
> should check against MAX value before using it but I have been told
> not to assume what application does. My take from it is, expect worst
> from application as a library side developer.
>
>
> >>
> >> When enum value sent from application to library, I am not quite sure
> >> how problematic it is to be honest. Like being in the
> >> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' in question.
> >> Only when application sends 'RTE_CPUFLAG_NUMFLAGS' to
> >> 'rte_cpu_get_flag_name()', it expects a NULL returned, but this won't
> >> happen in new version of the shared library, not sure if this can cause
> >> any problem for the application.
> >> But as I mentioned, general guidance is to eliminate this kind of MAX
> >> enum value usage.
> >>
> >>
> >> And for this specific issue, although usage of the enum in
> >> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' APIs is not
> >> clear if it cause ABI breakage,
> >> enum being embedded into the 'struct rte_bbdev_driver_info' struct
> >> doesn't leave a question, since this struct is returned from library to
> >> the application and change in the enum causes an ABI breakage.
> > Enum size does not change irrespective of changing its values. So
> > size-wise it's not an ABI breakage. Re-ordering values is an ABI
> > breakage.>
>
> Agree it is not size-wise issue. But still an issue.
>
>
> >>
> >>
> >> Briefly, I think even appending to the end of 'enum rte_cpu_flag_t'
> >> cause ABI breakage and removing 'RTE_CPUFLAG_NUMFLAGS' helps to extend
> >> this enum in the future.
> >> And an outstanding deprecation notice already exists for this:
> >>
> https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63
> >>
> >>
> >>> Your change did not break the ABI because you have properly added the
> >>> new flag at the end.
> >>> So I would ask to change the commit description to mention that
> NUMFLAGS
> >>> is removed to:
> >>> 1. Prevent users from treating it as a usable value or an array size.
> >>> 2. Prevent false-positive failures in the ABI test.
> >>>
> >>> Also it would be good to link to the aforementioned ABI test failure to
> >>> give readers some context when inspecting the git tree.
> >>>
> >>>
> >>>
> >>>     Can you please add what exactly needs to be reworked in the new
> version.
> >>>
> >>>     >
> >>>     > Thanks.
> >>>     >
> >>>     > --
> >>>     > David Marchand
> >>>
> >>
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 21051 bytes --]

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-27 13:48  4%                   ` Stanisław Kardach
@ 2023-09-27 14:09  0%                     ` Ferruh Yigit
  2023-09-27 15:03  0%                       ` Stanisław Kardach
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-27 14:09 UTC (permalink / raw)
  To: Stanisław Kardach
  Cc: Tummala, Sivaprasad, David Marchand, Ruifeng Wang, Min Zhou,
	David Christensen, Bruce Richardson, Konstantin Ananyev, dev,
	Thomas Monjalon

On 9/27/2023 2:48 PM, Stanisław Kardach wrote:
> On Wed, Sep 27, 2023 at 1:55 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>>
>> On 9/21/2023 3:49 PM, Stanisław Kardach wrote:
>>> On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad
>>> <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>> wrote:
>>>
>>>     [AMD Official Use Only - General]
>>>
>>>     > -----Original Message-----
>>>     > From: David Marchand <david.marchand@redhat.com
>>>     <mailto:david.marchand@redhat.com>>
>>>     > Sent: Wednesday, September 20, 2023 1:05 PM
>>>     > To: Stanisław Kardach <kda@semihalf.com
>>>     <mailto:kda@semihalf.com>>; Tummala, Sivaprasad
>>>     > <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>
>>>     > Cc: Ruifeng Wang <ruifeng.wang@arm.com
>>>     <mailto:ruifeng.wang@arm.com>>; Min Zhou <zhoumin@loongson.cn
>>>     <mailto:zhoumin@loongson.cn>>;
>>>     > David Christensen <drc@linux.vnet.ibm.com
>>>     <mailto:drc@linux.vnet.ibm.com>>; Bruce Richardson
>>>     > <bruce.richardson@intel.com <mailto:bruce.richardson@intel.com>>;
>>>     Konstantin Ananyev
>>>     > <konstantin.v.ananyev@yandex.ru
>>>     <mailto:konstantin.v.ananyev@yandex.ru>>; dev <dev@dpdk.org
>>>     <mailto:dev@dpdk.org>>; Yigit, Ferruh
>>>     > <Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>>; Thomas
>>>     Monjalon <thomas@monjalon.net <mailto:thomas@monjalon.net>>
>>>     > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
>>>     >
>>>     > Caution: This message originated from an External Source. Use
>>>     proper caution
>>>     > when opening attachments, clicking links, or responding.
>>>     >
>>>     >
>>>     > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach
>>>     <kda@semihalf.com <mailto:kda@semihalf.com>> wrote:
>>>     > >
>>>     > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
>>>     > <david.marchand@redhat.com <mailto:david.marchand@redhat.com>> wrote:
>>>     > > <snip>
>>>     > > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS
>>>     (what I call a
>>>     > last element canary). Why? If you're concerned with ABI, then
>>>     we're talking about
>>>     > an application linking dynamically with DPDK or talking via some
>>>     RPC channel with
>>>     > another DPDK application. So clashing with this definition does
>>>     not come into
>>>     > question. One should rather use rte_cpu_get_flag_enabled().
>>>     > > > > Also if you want to introduce new features, one would add
>>>     them yo the
>>>     > rte_cpuflags headers, unless you'd like to not add those and keep an
>>>     > undocumented list "above" the last defined element.
>>>     > > > > Could you explain a bit more Your use-case?
>>>     > > >
>>>     > > > Hey Stanislaw,
>>>     > > >
>>>     > > > Talking generically, one problem with such pattern (having a LAST,
>>>     > > > or MAX enum) is when an array sized with such a symbol is exposed.
>>>     > > > As I mentionned in the past, this can have unwanted effects:
>>>     > > >
>>>     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
>>>     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>>>     > > > -1-david.marchand@redhat.com/
>>>     <http://1-david.marchand@redhat.com/>
>>>     >
>>>     > Argh... who broke copy/paste in my browser ?!
>>>     > Wrt to MAX and arrays, I wanted to point at:
>>>     >
>>>     http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR>
>>>     > TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>
>>>     >
>>>     > > I agree, though I'd argue "LAST" and "MAX" semantics are a bit
>>>     different. "LAST"
>>>     > delimits the known enumeration territory while "MAX" is more of a
>>>     `constepxr`
>>>     > value type.
>>>     > > >
>>>     > > > Another issue is when an existing enum meaning changes: from the
>>>     > > > application pov, the (old) MAX value is incorrect, but for the
>>>     > > > library pov, a new meaning has been associated.
>>>     > > > This may trigger bugs in the application when calling a function
>>>     > > > that returns such an enum which never return this MAX value in
>>>     the past.
>>>     > > >
>>>     > > > For at least those two reasons, removing those canary elements is
>>>     > > > being done in DPDK.
>>>     > > >
>>>     > > > This specific removal has been announced:
>>>     > > >
>>>     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
>>>     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>>>     > > > -1-david.marchand@redhat.com/
>>>     <http://1-david.marchand@redhat.com/>
>>>     > > Thanks for pointing this out but did you mean to link to the
>>>     patch again here?
>>>     >
>>>     > Sorry, same here, bad copy/paste :-(.
>>>     >
>>>     > The intended link is:
>>>     https://git.dpdk.org/dpdk/commit/?id=5da7c13521
>>>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>
>>>     > The deprecation notice was badly formulated and this patch here is
>>>     consistent with
>>>     > it.
>>>     >
>>>     >
>>>     > > >
>>>     > > > Now, practically, when I look at the cpuflags API, I don't see us
>>>     > > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this
>>>     change
>>>     > > > is unneeded.
>>>     > > > But on the other hand, is it really an issue for an application to
>>>     > > > lose this (internal) information?
>>>     > > I doubt it, maybe it could be used as a sanity check for
>>>     choosing proper functors
>>>     > in the application. Though the initial description of the reason
>>>     behind this patch was
>>>     > to not break the ABI and I don't think it does that. What it does
>>>     is enforces users to
>>>     > use explicit cpu flag values which is a good thing. Though if so,
>>>     then it should be
>>>     > stated in the commit description.
>>>     >
>>>     > I agree.
>>>     > Siva, can you work on a new revision?
>>>     >
>>>     David, Stanislaw,
>>>
>>>     The original motivation of this patch was to avoid ABI breakage with
>>>     the introduction of new CPU flag
>>>     "RTE_CPUFLAG_MONITORX"
>>>     (http://mails.dpdk.org/archives/test-report/2023-April/382489.html
>>>     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html>).
>>>
>>>     Because of ABI breakage, the feature was postponed to this release.
>>>     https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/ <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/>
>>>
>>> This test is flawed, reason being that the NUMFLAGS should not be
>>> treated as a flag value and instead as a canary but this test is not
>>> taking into account.
>>>
>>
>> Hi Stanislaw,
>>
>> Why test is flawed?
>>
>> The enum in in the public header, so the 'RTE_CPUFLAG_NUMFLAGS' enum
>> item, and there are APIs using the enum, so the enum exchanged between
>> shared library and the application.
> In a similar way lots of Linux uapi headers contain bits that should
> not be used directly, even though they are defined there. The reason
> for that is the C language syntax, not necessarily the intent of a
> developer.
> Since NUMFLAGS was a canary to make the flag handling code easier, it
> should not be treated as a "real" value and hence my suggestion of a
> flawed test. That said, NUMFLAGS does not bring enough value to not
> remove it. :)
>

Both it doesn't enough value to hang on, and we don't have control on
how it is used by the application once it is exposed by the library.


>>
>> Similar thing discussed before and when enum exchanged between
>> application and shared library, there is an ABI breakage risk when enum
>> extended and general tendency is to eliminate the MAX value to reduce
>> the risk.
> Agreed though as I have mentioned before, "MAX" has a different
> semantics than "NUM". Then again since we have rte_cpu_feature_table,
> we can RTE_DIM to check the user input.
>

Their usage and intention on having them is same I think, can you please
elaborate what is the difference between MAX and NUM enum items that is
added as last item in an enum?


>>
>>
>> When enum value sent from library to application, it is more clear that
>> this can cause an ABI breakage, because application can receive a value
>> that it is not aware in the build time, which can cause unexpected behavior.
>> Simply think about a case application allocated array in
>> 'RTE_CPUFLAG_NUMFLAGS' size and directly accessing the array index based
>> on returned enum item value, if the enum extended in the new version of
>> the shared library, this can cause invalid memory access in application.
> Using the NUM enum element (which serves as a last item canary) to
> size an array is not a good idea unless it's returned from a runtime
> call. Otherwise one hits issues that you've described.
>

I agree :), but that is a way to describe how it can be a problem.
Also last time I argued similar to what you said, that application
should check against MAX value before using it but I have been told
not to assume what application does. My take from it is, expect worst
from application as a library side developer.


>>
>> When enum value sent from application to library, I am not quite sure
>> how problematic it is to be honest. Like being in the
>> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' in question.
>> Only when application sends 'RTE_CPUFLAG_NUMFLAGS' to
>> 'rte_cpu_get_flag_name()', it expects a NULL returned, but this won't
>> happen in new version of the shared library, not sure if this can cause
>> any problem for the application.
>> But as I mentioned, general guidance is to eliminate this kind of MAX
>> enum value usage.
>>
>>
>> And for this specific issue, although usage of the enum in
>> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' APIs is not
>> clear if it cause ABI breakage,
>> enum being embedded into the 'struct rte_bbdev_driver_info' struct
>> doesn't leave a question, since this struct is returned from library to
>> the application and change in the enum causes an ABI breakage.
> Enum size does not change irrespective of changing its values. So
> size-wise it's not an ABI breakage. Re-ordering values is an ABI
> breakage.>

Agree it is not size-wise issue. But still an issue.


>>
>>
>> Briefly, I think even appending to the end of 'enum rte_cpu_flag_t'
>> cause ABI breakage and removing 'RTE_CPUFLAG_NUMFLAGS' helps to extend
>> this enum in the future.
>> And an outstanding deprecation notice already exists for this:
>> https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63
>>
>>
>>> Your change did not break the ABI because you have properly added the
>>> new flag at the end.
>>> So I would ask to change the commit description to mention that NUMFLAGS
>>> is removed to:
>>> 1. Prevent users from treating it as a usable value or an array size.
>>> 2. Prevent false-positive failures in the ABI test.
>>>
>>> Also it would be good to link to the aforementioned ABI test failure to
>>> give readers some context when inspecting the git tree.
>>>
>>>
>>>
>>>     Can you please add what exactly needs to be reworked in the new version.
>>>
>>>     >
>>>     > Thanks.
>>>     >
>>>     > --
>>>     > David Marchand
>>>
>>
> 
> 


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-27 11:55  5%                 ` Ferruh Yigit
@ 2023-09-27 13:48  4%                   ` Stanisław Kardach
  2023-09-27 14:09  0%                     ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Stanisław Kardach @ 2023-09-27 13:48 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Tummala, Sivaprasad, David Marchand, Ruifeng Wang, Min Zhou,
	David Christensen, Bruce Richardson, Konstantin Ananyev, dev,
	Thomas Monjalon

On Wed, Sep 27, 2023 at 1:55 PM Ferruh Yigit <ferruh.yigit@amd.com> wrote:
>
> On 9/21/2023 3:49 PM, Stanisław Kardach wrote:
> > On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad
> > <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>> wrote:
> >
> >     [AMD Official Use Only - General]
> >
> >     > -----Original Message-----
> >     > From: David Marchand <david.marchand@redhat.com
> >     <mailto:david.marchand@redhat.com>>
> >     > Sent: Wednesday, September 20, 2023 1:05 PM
> >     > To: Stanisław Kardach <kda@semihalf.com
> >     <mailto:kda@semihalf.com>>; Tummala, Sivaprasad
> >     > <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>
> >     > Cc: Ruifeng Wang <ruifeng.wang@arm.com
> >     <mailto:ruifeng.wang@arm.com>>; Min Zhou <zhoumin@loongson.cn
> >     <mailto:zhoumin@loongson.cn>>;
> >     > David Christensen <drc@linux.vnet.ibm.com
> >     <mailto:drc@linux.vnet.ibm.com>>; Bruce Richardson
> >     > <bruce.richardson@intel.com <mailto:bruce.richardson@intel.com>>;
> >     Konstantin Ananyev
> >     > <konstantin.v.ananyev@yandex.ru
> >     <mailto:konstantin.v.ananyev@yandex.ru>>; dev <dev@dpdk.org
> >     <mailto:dev@dpdk.org>>; Yigit, Ferruh
> >     > <Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>>; Thomas
> >     Monjalon <thomas@monjalon.net <mailto:thomas@monjalon.net>>
> >     > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
> >     >
> >     > Caution: This message originated from an External Source. Use
> >     proper caution
> >     > when opening attachments, clicking links, or responding.
> >     >
> >     >
> >     > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach
> >     <kda@semihalf.com <mailto:kda@semihalf.com>> wrote:
> >     > >
> >     > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
> >     > <david.marchand@redhat.com <mailto:david.marchand@redhat.com>> wrote:
> >     > > <snip>
> >     > > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS
> >     (what I call a
> >     > last element canary). Why? If you're concerned with ABI, then
> >     we're talking about
> >     > an application linking dynamically with DPDK or talking via some
> >     RPC channel with
> >     > another DPDK application. So clashing with this definition does
> >     not come into
> >     > question. One should rather use rte_cpu_get_flag_enabled().
> >     > > > > Also if you want to introduce new features, one would add
> >     them yo the
> >     > rte_cpuflags headers, unless you'd like to not add those and keep an
> >     > undocumented list "above" the last defined element.
> >     > > > > Could you explain a bit more Your use-case?
> >     > > >
> >     > > > Hey Stanislaw,
> >     > > >
> >     > > > Talking generically, one problem with such pattern (having a LAST,
> >     > > > or MAX enum) is when an array sized with such a symbol is exposed.
> >     > > > As I mentionned in the past, this can have unwanted effects:
> >     > > >
> >     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> >     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
> >     > > > -1-david.marchand@redhat.com/
> >     <http://1-david.marchand@redhat.com/>
> >     >
> >     > Argh... who broke copy/paste in my browser ?!
> >     > Wrt to MAX and arrays, I wanted to point at:
> >     >
> >     http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR>
> >     > TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>
> >     >
> >     > > I agree, though I'd argue "LAST" and "MAX" semantics are a bit
> >     different. "LAST"
> >     > delimits the known enumeration territory while "MAX" is more of a
> >     `constepxr`
> >     > value type.
> >     > > >
> >     > > > Another issue is when an existing enum meaning changes: from the
> >     > > > application pov, the (old) MAX value is incorrect, but for the
> >     > > > library pov, a new meaning has been associated.
> >     > > > This may trigger bugs in the application when calling a function
> >     > > > that returns such an enum which never return this MAX value in
> >     the past.
> >     > > >
> >     > > > For at least those two reasons, removing those canary elements is
> >     > > > being done in DPDK.
> >     > > >
> >     > > > This specific removal has been announced:
> >     > > >
> >     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> >     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
> >     > > > -1-david.marchand@redhat.com/
> >     <http://1-david.marchand@redhat.com/>
> >     > > Thanks for pointing this out but did you mean to link to the
> >     patch again here?
> >     >
> >     > Sorry, same here, bad copy/paste :-(.
> >     >
> >     > The intended link is:
> >     https://git.dpdk.org/dpdk/commit/?id=5da7c13521
> >     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>
> >     > The deprecation notice was badly formulated and this patch here is
> >     consistent with
> >     > it.
> >     >
> >     >
> >     > > >
> >     > > > Now, practically, when I look at the cpuflags API, I don't see us
> >     > > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this
> >     change
> >     > > > is unneeded.
> >     > > > But on the other hand, is it really an issue for an application to
> >     > > > lose this (internal) information?
> >     > > I doubt it, maybe it could be used as a sanity check for
> >     choosing proper functors
> >     > in the application. Though the initial description of the reason
> >     behind this patch was
> >     > to not break the ABI and I don't think it does that. What it does
> >     is enforces users to
> >     > use explicit cpu flag values which is a good thing. Though if so,
> >     then it should be
> >     > stated in the commit description.
> >     >
> >     > I agree.
> >     > Siva, can you work on a new revision?
> >     >
> >     David, Stanislaw,
> >
> >     The original motivation of this patch was to avoid ABI breakage with
> >     the introduction of new CPU flag
> >     "RTE_CPUFLAG_MONITORX"
> >     (http://mails.dpdk.org/archives/test-report/2023-April/382489.html
> >     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html>).
> >
> >     Because of ABI breakage, the feature was postponed to this release.
> >     https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/ <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/>
> >
> > This test is flawed, reason being that the NUMFLAGS should not be
> > treated as a flag value and instead as a canary but this test is not
> > taking into account.
> >
>
> Hi Stanislaw,
>
> Why test is flawed?
>
> The enum in in the public header, so the 'RTE_CPUFLAG_NUMFLAGS' enum
> item, and there are APIs using the enum, so the enum exchanged between
> shared library and the application.
In a similar way lots of Linux uapi headers contain bits that should
not be used directly, even though they are defined there. The reason
for that is the C language syntax, not necessarily the intent of a
developer.
Since NUMFLAGS was a canary to make the flag handling code easier, it
should not be treated as a "real" value and hence my suggestion of a
flawed test. That said, NUMFLAGS does not bring enough value to not
remove it. :)
>
> Similar thing discussed before and when enum exchanged between
> application and shared library, there is an ABI breakage risk when enum
> extended and general tendency is to eliminate the MAX value to reduce
> the risk.
Agreed though as I have mentioned before, "MAX" has a different
semantics than "NUM". Then again since we have rte_cpu_feature_table,
we can RTE_DIM to check the user input.
>
>
> When enum value sent from library to application, it is more clear that
> this can cause an ABI breakage, because application can receive a value
> that it is not aware in the build time, which can cause unexpected behavior.
> Simply think about a case application allocated array in
> 'RTE_CPUFLAG_NUMFLAGS' size and directly accessing the array index based
> on returned enum item value, if the enum extended in the new version of
> the shared library, this can cause invalid memory access in application.
Using the NUM enum element (which serves as a last item canary) to
size an array is not a good idea unless it's returned from a runtime
call. Otherwise one hits issues that you've described.
>
> When enum value sent from application to library, I am not quite sure
> how problematic it is to be honest. Like being in the
> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' in question.
> Only when application sends 'RTE_CPUFLAG_NUMFLAGS' to
> 'rte_cpu_get_flag_name()', it expects a NULL returned, but this won't
> happen in new version of the shared library, not sure if this can cause
> any problem for the application.
> But as I mentioned, general guidance is to eliminate this kind of MAX
> enum value usage.
>
>
> And for this specific issue, although usage of the enum in
> 'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' APIs is not
> clear if it cause ABI breakage,
> enum being embedded into the 'struct rte_bbdev_driver_info' struct
> doesn't leave a question, since this struct is returned from library to
> the application and change in the enum causes an ABI breakage.
Enum size does not change irrespective of changing its values. So
size-wise it's not an ABI breakage. Re-ordering values is an ABI
breakage.
>
>
> Briefly, I think even appending to the end of 'enum rte_cpu_flag_t'
> cause ABI breakage and removing 'RTE_CPUFLAG_NUMFLAGS' helps to extend
> this enum in the future.
> And an outstanding deprecation notice already exists for this:
> https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63
>
>
> > Your change did not break the ABI because you have properly added the
> > new flag at the end.
> > So I would ask to change the commit description to mention that NUMFLAGS
> > is removed to:
> > 1. Prevent users from treating it as a usable value or an array size.
> > 2. Prevent false-positive failures in the ABI test.
> >
> > Also it would be good to link to the aforementioned ABI test failure to
> > give readers some context when inspecting the git tree.
> >
> >
> >
> >     Can you please add what exactly needs to be reworked in the new version.
> >
> >     >
> >     > Thanks.
> >     >
> >     > --
> >     > David Marchand
> >
>


-- 
Best Regards,
Stanisław Kardach

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
    @ 2023-09-27 13:13  0%     ` Ferruh Yigit
  2023-09-28  9:31  0%       ` Tummala, Sivaprasad
  2023-10-06  8:27  3%     ` David Marchand
  2 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-27 13:13 UTC (permalink / raw)
  To: Sivaprasad Tummala, ruifeng.wang, zhoumin, drc, kda,
	bruce.richardson, konstantin.v.ananyev
  Cc: dev

On 8/11/2023 7:07 AM, Sivaprasad Tummala wrote:
> This patch removes RTE_CPUFLAG_NUMFLAGS to allow new CPU
> features without breaking ABI each time.
> 
> Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala@amd.com>
> ---
>  lib/eal/arm/include/rte_cpuflags_32.h    | 1 -
>  lib/eal/arm/include/rte_cpuflags_64.h    | 1 -
>  lib/eal/arm/rte_cpuflags.c               | 7 +++++--
>  lib/eal/loongarch/include/rte_cpuflags.h | 1 -
>  lib/eal/loongarch/rte_cpuflags.c         | 7 +++++--
>  lib/eal/ppc/include/rte_cpuflags.h       | 1 -
>  lib/eal/ppc/rte_cpuflags.c               | 7 +++++--
>  lib/eal/riscv/include/rte_cpuflags.h     | 1 -
>  lib/eal/riscv/rte_cpuflags.c             | 7 +++++--
>  lib/eal/x86/include/rte_cpuflags.h       | 1 -
>  lib/eal/x86/rte_cpuflags.c               | 7 +++++--
>  11 files changed, 25 insertions(+), 16 deletions(-)
> 

Hi Sivaprasad,

Is the relevant deprecation notice removed somewhere, if not can you
please remove it in this set?

Thanks,
ferruh

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-21 14:49  4%               ` Stanisław Kardach
@ 2023-09-27 11:55  5%                 ` Ferruh Yigit
  2023-09-27 13:48  4%                   ` Stanisław Kardach
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-27 11:55 UTC (permalink / raw)
  To: Stanisław Kardach, Tummala, Sivaprasad
  Cc: David Marchand, Ruifeng Wang, Min Zhou, David Christensen,
	Bruce Richardson, Konstantin Ananyev, dev, Thomas Monjalon

On 9/21/2023 3:49 PM, Stanisław Kardach wrote:
> On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad
> <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>> wrote:
> 
>     [AMD Official Use Only - General]
> 
>     > -----Original Message-----
>     > From: David Marchand <david.marchand@redhat.com
>     <mailto:david.marchand@redhat.com>>
>     > Sent: Wednesday, September 20, 2023 1:05 PM
>     > To: Stanisław Kardach <kda@semihalf.com
>     <mailto:kda@semihalf.com>>; Tummala, Sivaprasad
>     > <Sivaprasad.Tummala@amd.com <mailto:Sivaprasad.Tummala@amd.com>>
>     > Cc: Ruifeng Wang <ruifeng.wang@arm.com
>     <mailto:ruifeng.wang@arm.com>>; Min Zhou <zhoumin@loongson.cn
>     <mailto:zhoumin@loongson.cn>>;
>     > David Christensen <drc@linux.vnet.ibm.com
>     <mailto:drc@linux.vnet.ibm.com>>; Bruce Richardson
>     > <bruce.richardson@intel.com <mailto:bruce.richardson@intel.com>>;
>     Konstantin Ananyev
>     > <konstantin.v.ananyev@yandex.ru
>     <mailto:konstantin.v.ananyev@yandex.ru>>; dev <dev@dpdk.org
>     <mailto:dev@dpdk.org>>; Yigit, Ferruh
>     > <Ferruh.Yigit@amd.com <mailto:Ferruh.Yigit@amd.com>>; Thomas
>     Monjalon <thomas@monjalon.net <mailto:thomas@monjalon.net>>
>     > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
>     >
>     > Caution: This message originated from an External Source. Use
>     proper caution
>     > when opening attachments, clicking links, or responding.
>     >
>     >
>     > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach
>     <kda@semihalf.com <mailto:kda@semihalf.com>> wrote:
>     > >
>     > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
>     > <david.marchand@redhat.com <mailto:david.marchand@redhat.com>> wrote:
>     > > <snip>
>     > > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS
>     (what I call a
>     > last element canary). Why? If you're concerned with ABI, then
>     we're talking about
>     > an application linking dynamically with DPDK or talking via some
>     RPC channel with
>     > another DPDK application. So clashing with this definition does
>     not come into
>     > question. One should rather use rte_cpu_get_flag_enabled().
>     > > > > Also if you want to introduce new features, one would add
>     them yo the
>     > rte_cpuflags headers, unless you'd like to not add those and keep an
>     > undocumented list "above" the last defined element.
>     > > > > Could you explain a bit more Your use-case?
>     > > >
>     > > > Hey Stanislaw,
>     > > >
>     > > > Talking generically, one problem with such pattern (having a LAST,
>     > > > or MAX enum) is when an array sized with such a symbol is exposed.
>     > > > As I mentionned in the past, this can have unwanted effects:
>     > > >
>     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
>     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>     > > > -1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>
>     >
>     > Argh... who broke copy/paste in my browser ?!
>     > Wrt to MAX and arrays, I wanted to point at:
>     >
>     http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR <http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR>
>     > TsUw@mail.gmail.com/ <http://TsUw@mail.gmail.com/>
>     >
>     > > I agree, though I'd argue "LAST" and "MAX" semantics are a bit
>     different. "LAST"
>     > delimits the known enumeration territory while "MAX" is more of a
>     `constepxr`
>     > value type.
>     > > >
>     > > > Another issue is when an existing enum meaning changes: from the
>     > > > application pov, the (old) MAX value is incorrect, but for the
>     > > > library pov, a new meaning has been associated.
>     > > > This may trigger bugs in the application when calling a function
>     > > > that returns such an enum which never return this MAX value in
>     the past.
>     > > >
>     > > > For at least those two reasons, removing those canary elements is
>     > > > being done in DPDK.
>     > > >
>     > > > This specific removal has been announced:
>     > > >
>     https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
>     <https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493>
>     > > > -1-david.marchand@redhat.com/
>     <http://1-david.marchand@redhat.com/>
>     > > Thanks for pointing this out but did you mean to link to the
>     patch again here?
>     >
>     > Sorry, same here, bad copy/paste :-(.
>     >
>     > The intended link is:
>     https://git.dpdk.org/dpdk/commit/?id=5da7c13521
>     <https://git.dpdk.org/dpdk/commit/?id=5da7c13521>
>     > The deprecation notice was badly formulated and this patch here is
>     consistent with
>     > it.
>     >
>     >
>     > > >
>     > > > Now, practically, when I look at the cpuflags API, I don't see us
>     > > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this
>     change
>     > > > is unneeded.
>     > > > But on the other hand, is it really an issue for an application to
>     > > > lose this (internal) information?
>     > > I doubt it, maybe it could be used as a sanity check for
>     choosing proper functors
>     > in the application. Though the initial description of the reason
>     behind this patch was
>     > to not break the ABI and I don't think it does that. What it does
>     is enforces users to
>     > use explicit cpu flag values which is a good thing. Though if so,
>     then it should be
>     > stated in the commit description.
>     >
>     > I agree.
>     > Siva, can you work on a new revision?
>     >
>     David, Stanislaw,
> 
>     The original motivation of this patch was to avoid ABI breakage with
>     the introduction of new CPU flag
>     "RTE_CPUFLAG_MONITORX"
>     (http://mails.dpdk.org/archives/test-report/2023-April/382489.html
>     <http://mails.dpdk.org/archives/test-report/2023-April/382489.html>).
> 
>     Because of ABI breakage, the feature was postponed to this release.
>     https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/ <https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/>
> 
> This test is flawed, reason being that the NUMFLAGS should not be
> treated as a flag value and instead as a canary but this test is not
> taking into account.
>

Hi Stanislaw,

Why test is flawed?

The enum in in the public header, so the 'RTE_CPUFLAG_NUMFLAGS' enum
item, and there are APIs using the enum, so the enum exchanged between
shared library and the application.

Similar thing discussed before and when enum exchanged between
application and shared library, there is an ABI breakage risk when enum
extended and general tendency is to eliminate the MAX value to reduce
the risk.


When enum value sent from library to application, it is more clear that
this can cause an ABI breakage, because application can receive a value
that it is not aware in the build time, which can cause unexpected behavior.
Simply think about a case application allocated array in
'RTE_CPUFLAG_NUMFLAGS' size and directly accessing the array index based
on returned enum item value, if the enum extended in the new version of
the shared library, this can cause invalid memory access in application.

When enum value sent from application to library, I am not quite sure
how problematic it is to be honest. Like being in the
'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' in question.
Only when application sends 'RTE_CPUFLAG_NUMFLAGS' to
'rte_cpu_get_flag_name()', it expects a NULL returned, but this won't
happen in new version of the shared library, not sure if this can cause
any problem for the application.
But as I mentioned, general guidance is to eliminate this kind of MAX
enum value usage.


And for this specific issue, although usage of the enum in
'rte_cpu_get_flag_enabled()' & 'rte_cpu_get_flag_name()' APIs is not
clear if it cause ABI breakage,
enum being embedded into the 'struct rte_bbdev_driver_info' struct
doesn't leave a question, since this struct is returned from library to
the application and change in the enum causes an ABI breakage.


Briefly, I think even appending to the end of 'enum rte_cpu_flag_t'
cause ABI breakage and removing 'RTE_CPUFLAG_NUMFLAGS' helps to extend
this enum in the future.
And an outstanding deprecation notice already exists for this:
https://git.dpdk.org/dpdk/tree/doc/guides/rel_notes/deprecation.rst?h=v23.07#n63


> Your change did not break the ABI because you have properly added the
> new flag at the end.
> So I would ask to change the commit description to mention that NUMFLAGS
> is removed to:
> 1. Prevent users from treating it as a usable value or an array size.
> 2. Prevent false-positive failures in the ABI test.
> 
> Also it would be good to link to the aforementioned ABI test failure to
> give readers some context when inspecting the git tree.
> 
> 
> 
>     Can you please add what exactly needs to be reworked in the new version.
> 
>     >
>     > Thanks.
>     >
>     > --
>     > David Marchand
> 


^ permalink raw reply	[relevance 5%]

* Re: [PATCH v4 1/3] lib: introduce dispatcher library
  @ 2023-09-27  8:13  3%         ` Bruce Richardson
  2023-09-28  7:44  0%           ` Mattias Rönnblom
  2023-10-03 17:31  0%           ` Jerin Jacob
  0 siblings, 2 replies; 200+ results
From: Bruce Richardson @ 2023-09-27  8:13 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: Mattias Rönnblom, Mattias Rönnblom, dev, Jerin Jacob,
	techboard, harry.van.haaren, Peter Nilsson, Heng Wang,
	Naga Harish K S V, Pavan Nikhilesh, Gujjar Abhinandan S,
	Erik Gabriel Carrillo, Shijith Thotton, Hemant Agrawal,
	Sachin Saxena, Liang Ma, Peter Mccarthy, Zhirun Yan

On Tue, Sep 26, 2023 at 11:58:37PM +0530, Jerin Jacob wrote:
> On Mon, Sep 25, 2023 at 12:41 PM Mattias Rönnblom <hofors@lysator.liu.se> wrote:
> >
> > On 2023-09-22 09:38, Mattias Rönnblom wrote:
> >
> > <snip>
> >
> > > +int
> > > +rte_dispatcher_create(uint8_t id, uint8_t event_dev_id)
> > > +{
> >
> >
> > There are two changes I'm considering:
> >
> > 1) Removing the "id" to identify the dispatcher, replacing it with an
> > forward-declared rte_dispatcher struct pointer.
> >
> > struct rte_dispatcher;
> >
> > struct rte_dispatcher *
> > rte_dispatcher_create(uint8_t event_dev_id);
> >
> >
> > The original reason for using an integer id to identify a dispatcher is
> > to make it look like everything else in Eventdev. I find this pattern a
> > little awkward to use - in particular the fact the id is
> > application-allocated (and thus require coordination between different
> > part of the application in case multiple instances are used).
> >
> > 2) Adding a flags field to the create function "for future use". But
> > since the API is experimental, there may not be that much need to
> > attempt to be future-proof?
> >
> > Any thoughts are appreciated.
> 
> IMO, better to have rte_dispatcher_create(struct
> rte_dispatch_create_params *params)
> for better future proofing with specific
> rte_dispatch_crearte_params_init() API(No need to add reserved fields
> in rte_dispatch_create_params  now, may need only for before removing
> experimental status)
> 
> Just 2c.
> 

I don't like using structs in those cases, I'd much rather have a flags
parameter, as flags can be checked for explicit zeros for future proofing,
while a struct cannot be checked for extra space on the end for future
fields added.

Furthermore, if we need to add new parameters to the create function, I
actually believe it is better to add them as explicit parameters rather
than new fields to the struct. Struct fields can be missed by a user just
recompiling, while new function parameters will be flagged by the compiler
to make the user aware of the change. [There would be no change for ABI
compatibility as function versioning would be usable in both cases]

/Bruce

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm
  2023-09-20 16:39  3%         ` Ferruh Yigit
@ 2023-09-26 13:23  0%           ` Jie Hai
  0 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-09-26 13:23 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Thomas Monjalon, Andrew Rybchenko, Ori Kam; +Cc: lihuisong

On 2023/9/21 0:39, Ferruh Yigit wrote:
> On 9/8/2023 9:00 AM, Jie Hai wrote:
>> Currently, rte_eth_rss_conf supports configuring and querying
>> RSS hash functions, rss key and it's length, but not RSS hash
>> algorithm.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "func". This represents the RSS algorithms to apply. The
>> following API will be affected:
>> 	- rte_eth_dev_configure
>> 	- rte_eth_dev_rss_hash_update
>> 	- rte_eth_dev_rss_hash_conf_get
>>
> 
> The problem with adding new configuration fields is, none of the drivers
> are using it.
> 
> I can see you are updating hns3 driver in next patch, but what about
> others, application will set this field and almost all drivers will
> ignore it for now.
> And in near future, some will be supporting it and some won't, still
> frustrating for the application perspective.
> 
> In the past I was gathering list of these items and follow
> implementation of them with drivers, but as the number of drivers
> increased this became very hard to manage.
> 
> Another way to manage this is go and update all drivers, and if the
> configuration requests anything other than
> 'RTE_ETH_HASH_FUNCTION_DEFAULT', return error. So that application can
> know this is not supported by this driver.
> Do you have better solution for this?
> 
I know this may not be reasonable, how about adding new ops to
the query and configuration of the RSS algorithm?
> 
>> If the value of "func" used for configuration is a gibberish
>> value, report the error and return. Do the same for
>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
>>
>> To check whether the drivers report the "func" field, it is set
>> to default value before querying.
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>> ---
>>   doc/guides/rel_notes/release_23_11.rst |  2 ++
>>   lib/ethdev/rte_ethdev.c                | 17 +++++++++++++++++
>>   lib/ethdev/rte_ethdev.h                | 21 +++++++++++++++++++++
>>   lib/ethdev/rte_flow.c                  |  1 -
>>   lib/ethdev/rte_flow.h                  | 22 ++--------------------
>>   5 files changed, 42 insertions(+), 21 deletions(-)
>>
>> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
>> index 333e1d95a283..deb019fbe4c1 100644
>> --- a/doc/guides/rel_notes/release_23_11.rst
>> +++ b/doc/guides/rel_notes/release_23_11.rst
>> @@ -129,6 +129,8 @@ ABI Changes
>>      Also, make sure to start the actual text at the margin.
>>      =======================================================
>>   
>> +* ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
>> +  algorithm.
>>   
>>   Known Issues
>>   ------------
>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
>> index 0840d2b5942a..4cbcdb344cac 100644
>> --- a/lib/ethdev/rte_ethdev.c
>> +++ b/lib/ethdev/rte_ethdev.c
>> @@ -1445,6 +1445,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   		goto rollback;
>>   	}
>>   
>> +	if (dev_conf->rx_adv_conf.rss_conf.func >= RTE_ETH_HASH_FUNCTION_MAX) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Ethdev port_id=%u invalid rss hash function (%u)\n",
>> +			port_id, dev_conf->rx_adv_conf.rss_conf.func);
>> +		ret = -EINVAL;
>> +		goto rollback;
>> +	}
>> +
>>   	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>>   	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
>>   	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
>> @@ -4630,6 +4638,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
>>   		return -ENOTSUP;
>>   	}
>>   
>> +	if (rss_conf->func >= RTE_ETH_HASH_FUNCTION_MAX) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Ethdev port_id=%u invalid rss hash function (%u)\n",
>> +			port_id, rss_conf->func);
>> +		return -EINVAL;
>> +	}
>> +
>>   	if (*dev->dev_ops->rss_hash_update == NULL)
>>   		return -ENOTSUP;
>>   	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
>> @@ -4657,6 +4672,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>>   		return -EINVAL;
>>   	}
>>   
>> +	rss_conf->func = RTE_ETH_HASH_FUNCTION_DEFAULT;
>> +
>>
> 
> I think setting this in ethdev level is not required if you update all
> drivers to not accept anything other than DEFAULT.
> 
> 
I initialized this field to prevent some drivers from not reporting RSS 
algorithms.
If an improper parameter is transferred before an API is invoked, the 
query result will be incorrect.
>>   	if (*dev->dev_ops->rss_hash_conf_get == NULL)
>>   		return -ENOTSUP;
>>   	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
>> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
>> index 40cfbb7efddd..33cec3570f85 100644
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> @@ -445,6 +445,26 @@ struct rte_vlan_filter_conf {
>>   	uint64_t ids[64];
>>   };
>>   
>> +/**
>> + * Hash function types.
>> + */
>> +enum rte_eth_hash_function {
>> +	/**
>> +	 * DEFAULT means that conformance to a specific hash algorithm is
>> +	 * uncared to the caller. The driver can pick the one it deems optimal.
>> +	 */
>> +	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
>> +	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
>> +	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
>> +	/**
>> +	 * Symmetric Toeplitz: src, dst will be replaced by
>> +	 * xor(src, dst). For the case with src/dst only,
>> +	 * src or dst address will xor with zero pair.
>> +	 */
>> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>> +	RTE_ETH_HASH_FUNCTION_MAX,
> 
> As we are moving this to ethdev.h, when we want to add a new algorithm,
> it will cause ABI break because of the 'RTE_ETH_HASH_FUNCTION_MAX', and
> it will need to wait. Is there a way to eliminate this MAX enum?
> 
How about assigning RTE_ETH_HASH_FUNCTION_MAX a larger value, e.g. 255 ?
>> +};
>> +
>>   /**
>>    * A structure used to configure the Receive Side Scaling (RSS) feature
>>    * of an Ethernet port.
>> @@ -464,6 +484,7 @@ struct rte_eth_rss_conf {
>>   	 * Supplying an *rss_hf* equal to zero disables the RSS feature.
>>   	 */
>>   	uint64_t rss_hf;
>> +	enum rte_eth_hash_function func;	/**< Hash algorithm. */
> 
> Can we use 'algorithm' as the field name?
> 
> I know it won't exactly match type name (rte_eth_hash_function) but I
> think this will be more accurate also less confusing for "rss_hf (rss
> hash function)" and "func (function)"?
> 
Considering the comprehensibility, I agree with the proposal.

>>   };
>>   
>>   /*
>> diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
>> index 271d854f7807..d3f2d466d841 100644
>> --- a/lib/ethdev/rte_flow.c
>> +++ b/lib/ethdev/rte_flow.c
>> @@ -12,7 +12,6 @@
>>   #include <rte_branch_prediction.h>
>>   #include <rte_string_fns.h>
>>   #include <rte_mbuf_dyn.h>
>> -#include "rte_ethdev.h"
>>   #include "rte_flow_driver.h"
>>   #include "rte_flow.h"
>>   
>> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
>> index 3bd0dc64fbe2..a7578b1d2eff 100644
>> --- a/lib/ethdev/rte_flow.h
>> +++ b/lib/ethdev/rte_flow.h
>> @@ -40,6 +40,8 @@
>>   #include <rte_macsec.h>
>>   #include <rte_ib.h>
>>   
>> +#include "rte_ethdev.h"
>> +
>>   #ifdef __cplusplus
>>   extern "C" {
>>   #endif
>> @@ -3183,26 +3185,6 @@ struct rte_flow_query_count {
>>   	uint64_t bytes; /**< Number of bytes through this rule [out]. */
>>   };
>>   
>> -/**
>> - * Hash function types.
>> - */
>> -enum rte_eth_hash_function {
>> -	/**
>> -	 * DEFAULT means that conformance to a specific hash algorithm is
>> -	 * uncared to the caller. The driver can pick the one it deems optimal.
>> -	 */
>> -	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
>> -	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
>> -	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
>> -	/**
>> -	 * Symmetric Toeplitz: src, dst will be replaced by
>> -	 * xor(src, dst). For the case with src/dst only,
>> -	 * src or dst address will xor with zero pair.
>> -	 */
>> -	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
>> -	RTE_ETH_HASH_FUNCTION_MAX,
>> -};
>> -
>>   /**
>>    * RTE_FLOW_ACTION_TYPE_RSS
>>    *
> 
> .

^ permalink raw reply	[relevance 0%]

* [PATCH v4] security: hide security context
  2023-09-26  7:19  2% ` [PATCH v3] " Akhil Goyal
@ 2023-09-26  8:08  1%   ` Akhil Goyal
  0 siblings, 0 replies; 200+ results
From: Akhil Goyal @ 2023-09-26  8:08 UTC (permalink / raw)
  To: dev
  Cc: thomas, david.marchand, hemant.agrawal, anoobj,
	pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
	g.singh, fanzhang.oss, jianjay.zhou, asomalap, ruifeng.wang,
	konstantin.v.ananyev, radu.nicolau, ajit.khaparde, rnagadheeraj,
	adwivedi, ciara.power, Akhil Goyal

rte_security_ctx is used by all security APIs to identify
which device security_op it need to call and hence it should
be opaque to the application.
Hence, it is now moved to internal header file and all
APIs will now take an opaque pointer for it.
The fast path inline APIs like set metadata need to get flags
from security_ctx. The flags are now retrieved using inline APIs
which use macros to get the offset of flags in security_ctx.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
Changes in v4: Updated rte_security doc.
Changes in v3: Updated release notes and removed deprecation notice.
Changes in v2: Rebased.

 app/test-crypto-perf/cperf_ops.c              |  9 +--
 app/test-crypto-perf/cperf_test_latency.c     |  3 +-
 .../cperf_test_pmd_cyclecount.c               |  8 +-
 app/test-crypto-perf/cperf_test_throughput.c  |  9 +--
 app/test-crypto-perf/cperf_test_verify.c      |  4 +-
 app/test-security-perf/test_security_perf.c   |  2 +-
 app/test/test_cryptodev.c                     | 22 ++----
 app/test/test_cryptodev_security_ipsec.c      |  2 +-
 app/test/test_cryptodev_security_ipsec.h      |  2 +-
 app/test/test_security_inline_macsec.c        | 10 +--
 app/test/test_security_inline_proto.c         | 14 ++--
 doc/guides/prog_guide/rte_security.rst        |  2 +-
 doc/guides/rel_notes/deprecation.rst          |  3 -
 doc/guides/rel_notes/release_23_11.rst        |  3 +
 examples/ipsec-secgw/ipsec-secgw.c            |  2 +-
 examples/ipsec-secgw/ipsec.c                  | 15 ++--
 examples/ipsec-secgw/ipsec.h                  |  2 +-
 examples/ipsec-secgw/ipsec_worker.c           |  2 +-
 examples/ipsec-secgw/ipsec_worker.h           |  4 +-
 lib/security/rte_security.c                   | 61 +++++++++------
 lib/security/rte_security.h                   | 77 +++++++++----------
 lib/security/rte_security_driver.h            | 24 ++++++
 22 files changed, 144 insertions(+), 136 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 93b9bfb240..84945d1313 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -749,8 +749,7 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 	else
 		sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(dev_id);
+	void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 	/* Create security session */
 	return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -853,8 +852,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
 			.crypto_xform = &cipher_xform
 		};
 
-		struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(dev_id);
+		void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 		/* Create security session */
 		return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -901,8 +899,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
 			} },
 			.crypto_xform = &cipher_xform
 		};
-		struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(dev_id);
+		void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 		/* Create security session */
 		return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index f1676a9aa9..484bc9eb4e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -53,8 +53,7 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
 			rte_security_session_destroy(sec_ctx, ctx->sess);
 		}
 #endif
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 0307e82996..4a60f6d558 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -67,11 +67,9 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
 #ifdef RTE_LIB_SECURITY
 		if (ctx->options->op_type == CPERF_PDCP ||
 				ctx->options->op_type == CPERF_DOCSIS) {
-			struct rte_security_ctx *sec_ctx =
-				(struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
-			rte_security_session_destroy(sec_ctx,
-				(void *)ctx->sess);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
+			rte_security_session_destroy(sec_ctx, (void *)ctx->sess);
 		} else
 #endif
 			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index e892a70699..f8f8bd717f 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -44,12 +44,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				(struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(ctx->dev_id);
-			rte_security_session_destroy(
-				sec_ctx,
-				(void *)ctx->sess);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
+			rte_security_session_destroy(sec_ctx, (void *)ctx->sess);
 		}
 #endif
 		else
diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index 8042c94e04..a6c0ffe813 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -48,8 +48,8 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
 			rte_security_session_destroy(sec_ctx, ctx->sess);
 		}
 #endif
diff --git a/app/test-security-perf/test_security_perf.c b/app/test-security-perf/test_security_perf.c
index 9bb50689e3..4dfaca4800 100644
--- a/app/test-security-perf/test_security_perf.c
+++ b/app/test-security-perf/test_security_perf.c
@@ -344,7 +344,7 @@ test_security_session_perf(void *arg)
 	struct rte_security_session_conf sess_conf;
 	int i, ret, nb_sessions, nb_sess_total;
 	struct rte_security_session **sess;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	double setup_rate, destroy_rate;
 	uint64_t setup_ms, destroy_ms;
 	struct lcore_conf *conf = arg;
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 3a51a5d00f..fcac108511 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8931,9 +8931,7 @@ security_proto_supported(enum rte_security_session_action_type action,
 	const struct rte_security_capability *capability;
 	uint16_t i = 0;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 
 	capabilities = rte_security_capabilities_get(ctx);
@@ -8973,9 +8971,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	uint8_t *plaintext;
 	int ret = TEST_SUCCESS;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 	struct rte_cryptodev_info dev_info;
 	uint64_t feat_flags;
 
@@ -9180,9 +9176,7 @@ test_pdcp_proto_SGL(int i, int oop,
 	unsigned int trn_data = 0;
 	struct rte_cryptodev_info dev_info;
 	uint64_t feat_flags;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 	struct rte_mbuf *temp_mbuf;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
@@ -9905,7 +9899,7 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],
 	struct ipsec_test_data *res_d_tmp = NULL;
 	uint8_t input_text[IPSEC_TEXT_MAX_LEN];
 	int salt_len, i, ret = TEST_SUCCESS;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	uint32_t src, dst;
 	uint32_t verify;
 
@@ -11088,9 +11082,7 @@ test_docsis_proto_uplink(const void *data)
 	uint32_t crc_data_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
@@ -11272,9 +11264,7 @@ test_docsis_proto_downlink(const void *data)
 	int32_t cipher_len, crc_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c
index be9e246bfe..205714b270 100644
--- a/app/test/test_cryptodev_security_ipsec.c
+++ b/app/test/test_cryptodev_security_ipsec.c
@@ -1249,7 +1249,7 @@ test_ipsec_status_check(const struct ipsec_test_data *td,
 }
 
 int
-test_ipsec_stats_verify(struct rte_security_ctx *ctx,
+test_ipsec_stats_verify(void *ctx,
 			void *sess,
 			const struct ipsec_test_flags *flags,
 			enum rte_security_ipsec_sa_direction dir)
diff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h
index e7903e9334..8587fc4577 100644
--- a/app/test/test_cryptodev_security_ipsec.h
+++ b/app/test/test_cryptodev_security_ipsec.h
@@ -302,7 +302,7 @@ int test_ipsec_status_check(const struct ipsec_test_data *td,
 			    enum rte_security_ipsec_sa_direction dir,
 			    int pkt_num);
 
-int test_ipsec_stats_verify(struct rte_security_ctx *ctx,
+int test_ipsec_stats_verify(void *ctx,
 			    void *sess,
 			    const struct ipsec_test_flags *flags,
 			    enum rte_security_ipsec_sa_direction dir);
diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c
index 40fdfda942..59b1b8a6a6 100644
--- a/app/test/test_security_inline_macsec.c
+++ b/app/test/test_security_inline_macsec.c
@@ -136,7 +136,7 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len)
 static int
 init_mempools(unsigned int nb_mbuf)
 {
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint16_t nb_sess = 512;
 	uint32_t sess_sz;
 	char s[64];
@@ -482,7 +482,7 @@ test_macsec_post_process(struct rte_mbuf *m, const struct mcs_test_vector *td,
 }
 
 static void
-mcs_stats_dump(struct rte_security_ctx *ctx, enum mcs_op op,
+mcs_stats_dump(void *ctx, enum mcs_op op,
 	       void *rx_sess, void *tx_sess,
 	       uint8_t rx_sc_id, uint8_t tx_sc_id,
 	       uint16_t rx_sa_id[], uint16_t tx_sa_id[])
@@ -667,7 +667,7 @@ mcs_stats_dump(struct rte_security_ctx *ctx, enum mcs_op op,
 }
 
 static int
-mcs_stats_check(struct rte_security_ctx *ctx, enum mcs_op op,
+mcs_stats_check(void *ctx, enum mcs_op op,
 		const struct mcs_test_opts *opts,
 		const struct mcs_test_vector *td,
 		void *rx_sess, void *tx_sess,
@@ -900,7 +900,7 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
 	struct rte_security_macsec_sa sa_conf = {0};
 	struct rte_security_macsec_sc sc_conf = {0};
 	struct mcs_err_vector err_vector = {0};
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	int nb_rx = 0, nb_sent;
 	int i, j = 0, ret, id, an = 0;
 	uint8_t tci_off;
@@ -908,7 +908,7 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
 
 	memset(rx_pkts_burst, 0, sizeof(rx_pkts_burst[0]) * opts->nb_td);
 
-	ctx = (struct rte_security_ctx *)rte_eth_dev_get_sec_ctx(port_id);
+	ctx = rte_eth_dev_get_sec_ctx(port_id);
 	if (ctx == NULL) {
 		printf("Ethernet device doesn't support security features.\n");
 		return TEST_SKIPPED;
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 33eb1dd201..78a2064b65 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -136,7 +136,7 @@ static struct rte_flow *default_flow[RTE_MAX_ETHPORTS];
 /* Create Inline IPsec session */
 static int
 create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
-		void **sess, struct rte_security_ctx **ctx,
+		void **sess, void **ctx,
 		uint32_t *ol_flags, const struct ipsec_test_flags *flags,
 		struct rte_security_session_conf *sess_conf)
 {
@@ -149,7 +149,7 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
 	struct rte_security_capability_idx sec_cap_idx;
 	const struct rte_security_capability *sec_cap;
 	enum rte_security_ipsec_sa_direction dir;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint32_t verify;
 
 	sess_conf->action_type = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL;
@@ -221,7 +221,7 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
 
 	sess_conf->userdata = (void *) sa;
 
-	sec_ctx = (struct rte_security_ctx *)rte_eth_dev_get_sec_ctx(portid);
+	sec_ctx = rte_eth_dev_get_sec_ctx(portid);
 	if (sec_ctx == NULL) {
 		printf("Ethernet device doesn't support security features.\n");
 		return TEST_SKIPPED;
@@ -503,7 +503,7 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, bool
 static int
 init_mempools(unsigned int nb_mbuf)
 {
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint16_t nb_sess = 512;
 	uint32_t sess_sz;
 	char s[64];
@@ -846,7 +846,7 @@ test_ipsec_with_reassembly(struct reassembly_vector *vector,
 	struct rte_crypto_sym_xform auth_in = {0};
 	struct rte_crypto_sym_xform aead_in = {0};
 	struct ipsec_test_data sa_data;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	unsigned int i, nb_rx = 0, j;
 	uint32_t ol_flags;
 	bool outer_ipv4;
@@ -1113,7 +1113,7 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td,
 	struct rte_crypto_sym_xform auth = {0};
 	struct rte_crypto_sym_xform aead = {0};
 	struct sa_expiry_vector vector = {0};
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	int nb_rx = 0, nb_sent;
 	uint32_t ol_flags;
 	int i, j = 0, ret;
@@ -1398,7 +1398,7 @@ test_ipsec_inline_proto_process_with_esn(struct ipsec_test_data td[],
 	struct rte_mbuf *tx_pkt = NULL;
 	int nb_rx, nb_sent;
 	void *ses;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	uint32_t ol_flags;
 	bool outer_ipv4;
 	int i, ret;
diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst
index b4db4a7bfd..ad8c6374bd 100644
--- a/doc/guides/prog_guide/rte_security.rst
+++ b/doc/guides/prog_guide/rte_security.rst
@@ -637,7 +637,7 @@ And the session mempool object size should be enough to accommodate
 Once the session mempools have been created, ``rte_security_session_create()``
 is used to allocate and initialize a session for the required crypto/ethernet device.
 
-Session APIs need a parameter ``rte_security_ctx`` to identify the crypto/ethernet
+Session APIs need an opaque handle to identify the crypto/ethernet
 security ops. This parameter can be retrieved using the APIs
 ``rte_cryptodev_get_sec_ctx()`` (for crypto device) or ``rte_eth_dev_get_sec_ctx``
 (for ethernet port).
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 4ec4953f6e..c776efebd9 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -139,9 +139,6 @@ Deprecation Notices
   which got error interrupt to the application,
   so that application can reset that particular queue pair.
 
-* security: Hide structures ``rte_security_ops`` and ``rte_security_ctx``
-  as these are internal to DPDK library and drivers.
-
 * eventdev: The single-event (non-burst) enqueue and dequeue operations,
   used by static inline burst enqueue and dequeue functions in ``rte_eventdev.h``,
   will be removed in DPDK 23.11.
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d0bfb7f5d2..250735efa9 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -144,6 +144,9 @@ API Changes
   except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
   replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
+* security: Structures ``rte_security_ops`` and ``rte_security_ctx`` were moved to
+  internal library headers not visible to application.
+
 
 ABI Changes
 -----------
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 3ab7995fd5..bf98d2618b 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -568,7 +568,7 @@ process_pkts_outbound_nosp(struct ipsec_ctx *ipsec_ctx,
 
 static inline void
 process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts,
-	     uint8_t nb_pkts, uint16_t portid, struct rte_security_ctx *ctx)
+	     uint8_t nb_pkts, uint16_t portid, void *ctx)
 {
 	struct ipsec_traffic traffic;
 
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index a5706bed24..f5cec4a928 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -205,7 +205,7 @@ verify_ipsec_capabilities(struct rte_security_ipsec_xform *ipsec_xform,
 
 
 static inline int
-verify_security_capabilities(struct rte_security_ctx *ctx,
+verify_security_capabilities(void *ctx,
 		struct rte_security_session_conf *sess_conf,
 		uint32_t *ol_flags)
 {
@@ -327,9 +327,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
 		};
 
 		if (ips->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
-			struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-							rte_cryptodev_get_sec_ctx(
-							cdev_id);
+			void *ctx = rte_cryptodev_get_sec_ctx(cdev_id);
 
 			/* Set IPsec parameters in conf */
 			set_ipsec_conf(sa, &(sess_conf.ipsec));
@@ -411,7 +409,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 		struct rte_ipsec_session *ips)
 {
 	int32_t ret = 0;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	struct rte_security_session_conf sess_conf = {
 		.action_type = ips->type,
 		.protocol = RTE_SECURITY_PROTOCOL_IPSEC,
@@ -490,9 +488,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 		struct rte_flow_error err;
 		int ret = 0;
 
-		sec_ctx = (struct rte_security_ctx *)
-					rte_eth_dev_get_sec_ctx(
-					sa->portid);
+		sec_ctx = rte_eth_dev_get_sec_ctx(sa->portid);
 		if (sec_ctx == NULL) {
 			RTE_LOG(ERR, IPSEC,
 				" rte_eth_dev_get_sec_ctx failed\n");
@@ -657,8 +653,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 			return -1;
 		}
 	} else if (ips->type ==	RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) {
-		sec_ctx = (struct rte_security_ctx *)
-				rte_eth_dev_get_sec_ctx(sa->portid);
+		sec_ctx = rte_eth_dev_get_sec_ctx(sa->portid);
 
 		if (sec_ctx == NULL) {
 			RTE_LOG(ERR, IPSEC,
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 6bef2a7285..5059418456 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -279,7 +279,7 @@ struct cnt_blk {
 struct lcore_rx_queue {
 	uint16_t port_id;
 	uint8_t queue_id;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 } __rte_cache_aligned;
 
 struct buffer {
diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index 58c80c73f0..8d122e8519 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -20,7 +20,7 @@
 
 struct port_drv_mode_data {
 	void *sess;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 };
 
 typedef void (*ipsec_worker_fn_t)(void);
diff --git a/examples/ipsec-secgw/ipsec_worker.h b/examples/ipsec-secgw/ipsec_worker.h
index cf59b9b5ab..ac980b8bcf 100644
--- a/examples/ipsec-secgw/ipsec_worker.h
+++ b/examples/ipsec-secgw/ipsec_worker.h
@@ -119,7 +119,7 @@ adjust_ipv6_pktlen(struct rte_mbuf *m, const struct rte_ipv6_hdr *iph,
 }
 
 static __rte_always_inline void
-prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt,
+prepare_one_packet(void *ctx, struct rte_mbuf *pkt,
 		   struct ipsec_traffic *t)
 {
 	uint32_t ptype = pkt->packet_type;
@@ -230,7 +230,7 @@ prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt,
 }
 
 static __rte_always_inline void
-prepare_traffic(struct rte_security_ctx *ctx, struct rte_mbuf **pkts,
+prepare_traffic(void *ctx, struct rte_mbuf **pkts,
 		struct ipsec_traffic *t, uint16_t nb_pkts)
 {
 	int32_t i;
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 42af4a2c35..ab44bbe0f0 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -60,11 +60,12 @@ rte_security_oop_dynfield_register(void)
 }
 
 void *
-rte_security_session_create(struct rte_security_ctx *instance,
+rte_security_session_create(void *ctx,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
 	struct rte_security_session *sess = NULL;
+	struct rte_security_ctx *instance = ctx;
 	uint32_t sess_priv_size;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_create, NULL, NULL);
@@ -93,10 +94,10 @@ rte_security_session_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_session_update(struct rte_security_ctx *instance,
-			    void *sess,
-			    struct rte_security_session_conf *conf)
+rte_security_session_update(void *ctx, void *sess, struct rte_security_session_conf *conf)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_update, -EINVAL,
 			-ENOTSUP);
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
@@ -106,8 +107,10 @@ rte_security_session_update(struct rte_security_ctx *instance,
 }
 
 unsigned int
-rte_security_session_get_size(struct rte_security_ctx *instance)
+rte_security_session_get_size(void *ctx)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_get_size, 0, 0);
 
 	return (sizeof(struct rte_security_session) +
@@ -115,10 +118,10 @@ rte_security_session_get_size(struct rte_security_ctx *instance)
 }
 
 int
-rte_security_session_stats_get(struct rte_security_ctx *instance,
-			       void *sess,
-			       struct rte_security_stats *stats)
+rte_security_session_stats_get(void *ctx, void *sess, struct rte_security_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_stats_get, -EINVAL,
 			-ENOTSUP);
 	/* Parameter sess can be NULL in case of getting global statistics. */
@@ -128,8 +131,9 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_session_destroy(struct rte_security_ctx *instance, void *sess)
+rte_security_session_destroy(void *ctx, void *sess)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_destroy, -EINVAL,
@@ -149,9 +153,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance, void *sess)
 }
 
 int
-rte_security_macsec_sc_create(struct rte_security_ctx *instance,
-			      struct rte_security_macsec_sc *conf)
+rte_security_macsec_sc_create(void *ctx, struct rte_security_macsec_sc *conf)
 {
+	struct rte_security_ctx *instance = ctx;
 	int sc_id;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_create, -EINVAL, -ENOTSUP);
@@ -165,9 +169,9 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_macsec_sa_create(struct rte_security_ctx *instance,
-			      struct rte_security_macsec_sa *conf)
+rte_security_macsec_sa_create(void *ctx, struct rte_security_macsec_sa *conf)
 {
+	struct rte_security_ctx *instance = ctx;
 	int sa_id;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_create, -EINVAL, -ENOTSUP);
@@ -181,9 +185,10 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_destroy(void *ctx, uint16_t sc_id,
 			       enum rte_security_macsec_direction dir)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_destroy, -EINVAL, -ENOTSUP);
@@ -199,9 +204,10 @@ rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id
 }
 
 int
-rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_destroy(void *ctx, uint16_t sa_id,
 			       enum rte_security_macsec_direction dir)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_destroy, -EINVAL, -ENOTSUP);
@@ -217,10 +223,12 @@ rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id
 }
 
 int
-rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_stats_get(void *ctx, uint16_t sc_id,
 				 enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sc_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_stats_get, -EINVAL, -ENOTSUP);
 	RTE_PTR_OR_ERR_RET(stats, -EINVAL);
 
@@ -228,10 +236,12 @@ rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_
 }
 
 int
-rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_stats_get(void *ctx, uint16_t sa_id,
 				 enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sa_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_stats_get, -EINVAL, -ENOTSUP);
 	RTE_PTR_OR_ERR_RET(stats, -EINVAL);
 
@@ -239,10 +249,9 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_
 }
 
 int
-__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
-				void *sess,
-				struct rte_mbuf *m, void *params)
+__rte_security_set_pkt_metadata(void *ctx, void *sess, struct rte_mbuf *m, void *params)
 {
+	struct rte_security_ctx *instance = ctx;
 #ifdef RTE_DEBUG
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
 	RTE_PTR_OR_ERR_RET(instance, -EINVAL);
@@ -255,19 +264,21 @@ __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 }
 
 const struct rte_security_capability *
-rte_security_capabilities_get(struct rte_security_ctx *instance)
+rte_security_capabilities_get(void *ctx)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, capabilities_get, NULL, NULL);
 
 	return instance->ops->capabilities_get(instance->device);
 }
 
 const struct rte_security_capability *
-rte_security_capability_get(struct rte_security_ctx *instance,
-			    struct rte_security_capability_idx *idx)
+rte_security_capability_get(void *ctx, struct rte_security_capability_idx *idx)
 {
 	const struct rte_security_capability *capabilities;
 	const struct rte_security_capability *capability;
+	struct rte_security_ctx *instance = ctx;
 	uint16_t i = 0;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, capabilities_get, NULL, NULL);
@@ -401,12 +412,12 @@ static int
 security_capabilities_from_dev_id(int dev_id, const void **caps)
 {
 	const struct rte_security_capability *capabilities;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 
 	if (rte_cryptodev_is_valid_dev(dev_id) == 0)
 		return -EINVAL;
 
-	sec_ctx = (struct rte_security_ctx *)rte_cryptodev_get_sec_ctx(dev_id);
+	sec_ctx = rte_cryptodev_get_sec_ctx(dev_id);
 	RTE_PTR_OR_ERR_RET(sec_ctx, -EINVAL);
 
 	capabilities = rte_security_capabilities_get(sec_ctx);
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index da58fe1f14..c9cc7a45a6 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -56,30 +56,6 @@ enum rte_security_ipsec_tunnel_type {
 #define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR     0x1
 #define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
 
-/**
- * Security context for crypto/eth devices
- *
- * Security instance for each driver to register security operations.
- * The application can get the security context from the crypto/eth device id
- * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx()
- * This structure is used to identify the device(crypto/eth) for which the
- * security operations need to be performed.
- */
-struct rte_security_ctx {
-	void *device;
-	/**< Crypto/ethernet device attached */
-	const struct rte_security_ops *ops;
-	/**< Pointer to security ops for the device */
-	uint16_t sess_cnt;
-	/**< Number of sessions attached to this context */
-	uint16_t macsec_sc_cnt;
-	/**< Number of MACsec SC attached to this context */
-	uint16_t macsec_sa_cnt;
-	/**< Number of MACsec SA attached to this context */
-	uint32_t flags;
-	/**< Flags for security context */
-};
-
 #define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
 /**< Driver uses fast metadata update without using driver specific callback.
  * For fast mdata, mbuf dynamic field would be registered by driver
@@ -695,7 +671,7 @@ struct rte_security_session_conf {
  *  - On failure, NULL
  */
 void *
-rte_security_session_create(struct rte_security_ctx *instance,
+rte_security_session_create(void *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
 
@@ -711,7 +687,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_session_update(struct rte_security_ctx *instance,
+rte_security_session_update(void *instance,
 			    void *sess,
 			    struct rte_security_session_conf *conf);
 
@@ -725,7 +701,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *   - 0 if device is invalid or does not support the operation.
  */
 unsigned int
-rte_security_session_get_size(struct rte_security_ctx *instance);
+rte_security_session_get_size(void *instance);
 
 /**
  * Free security session header and the session private data and
@@ -742,7 +718,7 @@ rte_security_session_get_size(struct rte_security_ctx *instance);
  *  - other negative values in case of freeing private data errors.
  */
 int
-rte_security_session_destroy(struct rte_security_ctx *instance, void *sess);
+rte_security_session_destroy(void *instance, void *sess);
 
 /**
  * @warning
@@ -761,7 +737,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance, void *sess);
  */
 __rte_experimental
 int
-rte_security_macsec_sc_create(struct rte_security_ctx *instance,
+rte_security_macsec_sc_create(void *instance,
 			      struct rte_security_macsec_sc *conf);
 
 /**
@@ -780,7 +756,7 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_destroy(void *instance, uint16_t sc_id,
 			       enum rte_security_macsec_direction dir);
 
 /**
@@ -800,7 +776,7 @@ rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id
  */
 __rte_experimental
 int
-rte_security_macsec_sa_create(struct rte_security_ctx *instance,
+rte_security_macsec_sa_create(void *instance,
 			      struct rte_security_macsec_sa *conf);
 
 /**
@@ -819,7 +795,7 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_destroy(void *instance, uint16_t sa_id,
 			       enum rte_security_macsec_direction dir);
 
 /** Device-specific metadata field type */
@@ -889,6 +865,27 @@ static inline bool rte_security_dynfield_is_registered(void)
 	return rte_security_dynfield_offset >= 0;
 }
 
+#define RTE_SECURITY_CTX_FLAGS_OFF		4
+/**
+ * Get security flags from security instance.
+ */
+static inline uint32_t
+rte_security_ctx_flags_get(void *ctx)
+{
+	return *((uint32_t *)ctx + RTE_SECURITY_CTX_FLAGS_OFF);
+}
+
+/**
+ * Set security flags in security instance.
+ */
+static inline void
+rte_security_ctx_flags_set(void *ctx, uint32_t flags)
+{
+	uint32_t *data;
+	data = (((uint32_t *)ctx) + RTE_SECURITY_CTX_FLAGS_OFF);
+	*data = flags;
+}
+
 #define RTE_SECURITY_SESS_OPAQUE_DATA_OFF	0
 #define RTE_SECURITY_SESS_FAST_MDATA_OFF	1
 /**
@@ -933,7 +930,7 @@ rte_security_session_fast_mdata_set(void *sess, uint64_t fdata)
 
 /** Function to call PMD specific function pointer set_pkt_metadata() */
 __rte_experimental
-int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+int __rte_security_set_pkt_metadata(void *instance,
 				    void *sess,
 				    struct rte_mbuf *m, void *params);
 
@@ -951,12 +948,12 @@ int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  *  - On failure, a negative value.
  */
 static inline int
-rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+rte_security_set_pkt_metadata(void *instance,
 			      void *sess,
 			      struct rte_mbuf *mb, void *params)
 {
 	/* Fast Path */
-	if (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {
+	if (rte_security_ctx_flags_get(instance) & RTE_SEC_CTX_F_FAST_SET_MDATA) {
 		*rte_security_dynfield(mb) = (rte_security_dynfield_t)
 			rte_security_session_fast_mdata_get(sess);
 		return 0;
@@ -1105,7 +1102,7 @@ struct rte_security_stats {
  */
 __rte_experimental
 int
-rte_security_session_stats_get(struct rte_security_ctx *instance,
+rte_security_session_stats_get(void *instance,
 			       void *sess,
 			       struct rte_security_stats *stats);
 
@@ -1125,7 +1122,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance,
+rte_security_macsec_sa_stats_get(void *instance,
 				 uint16_t sa_id, enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sa_stats *stats);
 
@@ -1145,7 +1142,7 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance,
+rte_security_macsec_sc_stats_get(void *instance,
 				 uint16_t sc_id, enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sc_stats *stats);
 
@@ -1296,7 +1293,7 @@ struct rte_security_capability_idx {
  *   - Return NULL if no capabilities available.
  */
 const struct rte_security_capability *
-rte_security_capabilities_get(struct rte_security_ctx *instance);
+rte_security_capabilities_get(void *instance);
 
 /**
  * Query if a specific capability is available on security instance
@@ -1310,7 +1307,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *   - Return NULL if the capability not matched on security instance.
  */
 const struct rte_security_capability *
-rte_security_capability_get(struct rte_security_ctx *instance,
+rte_security_capability_get(void *instance,
 			    struct rte_security_capability_idx *idx);
 
 #ifdef __cplusplus
diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h
index 1e6a6ef8e3..e5e1c4cfe8 100644
--- a/lib/security/rte_security_driver.h
+++ b/lib/security/rte_security_driver.h
@@ -37,6 +37,30 @@ struct rte_security_session {
 	/**< Private session material, variable size (depends on driver) */
 };
 
+/**
+ * Security context for crypto/eth devices
+ *
+ * Security instance for each driver to register security operations.
+ * The application can get the security context from the crypto/eth device id
+ * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx()
+ * This structure is used to identify the device(crypto/eth) for which the
+ * security operations need to be performed.
+ */
+struct rte_security_ctx {
+	void *device;
+	/**< Crypto/ethernet device attached */
+	const struct rte_security_ops *ops;
+	/**< Pointer to security ops for the device */
+	uint32_t flags;
+	/**< Flags for security context */
+	uint16_t sess_cnt;
+	/**< Number of sessions attached to this context */
+	uint16_t macsec_sc_cnt;
+	/**< Number of MACsec SC attached to this context */
+	uint16_t macsec_sa_cnt;
+	/**< Number of MACsec SA attached to this context */
+};
+
 /**
  * Helper macro to get driver private data
  */
-- 
2.25.1


^ permalink raw reply	[relevance 1%]

* [PATCH v3] security: hide security context
  @ 2023-09-26  7:19  2% ` Akhil Goyal
  2023-09-26  8:08  1%   ` [PATCH v4] " Akhil Goyal
  0 siblings, 1 reply; 200+ results
From: Akhil Goyal @ 2023-09-26  7:19 UTC (permalink / raw)
  To: dev
  Cc: thomas, david.marchand, hemant.agrawal, anoobj,
	pablo.de.lara.guarch, fiona.trahe, declan.doherty, matan,
	g.singh, fanzhang.oss, jianjay.zhou, asomalap, ruifeng.wang,
	konstantin.v.ananyev, radu.nicolau, ajit.khaparde, rnagadheeraj,
	adwivedi, ciara.power, Akhil Goyal

rte_security_ctx is used by all security APIs to identify
which device security_op it need to call and hence it should
be opaque to the application.
Hence, it is now moved to internal header file and all
APIs will now take an opaque pointer for it.
The fast path inline APIs like set metadata need to get flags
from security_ctx. The flags are now retrieved using inline APIs
which use macros to get the offset of flags in security_ctx.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
Changes in v3: Updated release notes and removed deprecation notice.
Changes in v2: Rebased.

 app/test-crypto-perf/cperf_ops.c              |  9 +--
 app/test-crypto-perf/cperf_test_latency.c     |  3 +-
 .../cperf_test_pmd_cyclecount.c               |  8 +-
 app/test-crypto-perf/cperf_test_throughput.c  |  9 +--
 app/test-crypto-perf/cperf_test_verify.c      |  4 +-
 app/test-security-perf/test_security_perf.c   |  2 +-
 app/test/test_cryptodev.c                     | 22 ++----
 app/test/test_cryptodev_security_ipsec.c      |  2 +-
 app/test/test_cryptodev_security_ipsec.h      |  2 +-
 app/test/test_security_inline_macsec.c        | 10 +--
 app/test/test_security_inline_proto.c         | 14 ++--
 doc/guides/rel_notes/deprecation.rst          |  3 -
 doc/guides/rel_notes/release_23_11.rst        |  3 +
 examples/ipsec-secgw/ipsec-secgw.c            |  2 +-
 examples/ipsec-secgw/ipsec.c                  | 15 ++--
 examples/ipsec-secgw/ipsec.h                  |  2 +-
 examples/ipsec-secgw/ipsec_worker.c           |  2 +-
 examples/ipsec-secgw/ipsec_worker.h           |  4 +-
 lib/security/rte_security.c                   | 61 +++++++++------
 lib/security/rte_security.h                   | 77 +++++++++----------
 lib/security/rte_security_driver.h            | 24 ++++++
 21 files changed, 143 insertions(+), 135 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 93b9bfb240..84945d1313 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -749,8 +749,7 @@ create_ipsec_session(struct rte_mempool *sess_mp,
 	else
 		sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(dev_id);
+	void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 	/* Create security session */
 	return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -853,8 +852,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
 			.crypto_xform = &cipher_xform
 		};
 
-		struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(dev_id);
+		void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 		/* Create security session */
 		return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -901,8 +899,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
 			} },
 			.crypto_xform = &cipher_xform
 		};
-		struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(dev_id);
+		void *ctx = rte_cryptodev_get_sec_ctx(dev_id);
 
 		/* Create security session */
 		return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c
index f1676a9aa9..484bc9eb4e 100644
--- a/app/test-crypto-perf/cperf_test_latency.c
+++ b/app/test-crypto-perf/cperf_test_latency.c
@@ -53,8 +53,7 @@ cperf_latency_test_free(struct cperf_latency_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
 			rte_security_session_destroy(sec_ctx, ctx->sess);
 		}
 #endif
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 0307e82996..4a60f6d558 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -67,11 +67,9 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
 #ifdef RTE_LIB_SECURITY
 		if (ctx->options->op_type == CPERF_PDCP ||
 				ctx->options->op_type == CPERF_DOCSIS) {
-			struct rte_security_ctx *sec_ctx =
-				(struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
-			rte_security_session_destroy(sec_ctx,
-				(void *)ctx->sess);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
+			rte_security_session_destroy(sec_ctx, (void *)ctx->sess);
 		} else
 #endif
 			rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index e892a70699..f8f8bd717f 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -44,12 +44,9 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				(struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(ctx->dev_id);
-			rte_security_session_destroy(
-				sec_ctx,
-				(void *)ctx->sess);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
+			rte_security_session_destroy(sec_ctx, (void *)ctx->sess);
 		}
 #endif
 		else
diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c
index 8042c94e04..a6c0ffe813 100644
--- a/app/test-crypto-perf/cperf_test_verify.c
+++ b/app/test-crypto-perf/cperf_test_verify.c
@@ -48,8 +48,8 @@ cperf_verify_test_free(struct cperf_verify_ctx *ctx)
 		else if (ctx->options->op_type == CPERF_PDCP ||
 			 ctx->options->op_type == CPERF_DOCSIS ||
 			 ctx->options->op_type == CPERF_IPSEC) {
-			struct rte_security_ctx *sec_ctx =
-				rte_cryptodev_get_sec_ctx(ctx->dev_id);
+			void *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
+
 			rte_security_session_destroy(sec_ctx, ctx->sess);
 		}
 #endif
diff --git a/app/test-security-perf/test_security_perf.c b/app/test-security-perf/test_security_perf.c
index 9bb50689e3..4dfaca4800 100644
--- a/app/test-security-perf/test_security_perf.c
+++ b/app/test-security-perf/test_security_perf.c
@@ -344,7 +344,7 @@ test_security_session_perf(void *arg)
 	struct rte_security_session_conf sess_conf;
 	int i, ret, nb_sessions, nb_sess_total;
 	struct rte_security_session **sess;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	double setup_rate, destroy_rate;
 	uint64_t setup_ms, destroy_ms;
 	struct lcore_conf *conf = arg;
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 3a51a5d00f..fcac108511 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8931,9 +8931,7 @@ security_proto_supported(enum rte_security_session_action_type action,
 	const struct rte_security_capability *capability;
 	uint16_t i = 0;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 
 	capabilities = rte_security_capabilities_get(ctx);
@@ -8973,9 +8971,7 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,
 	struct crypto_unittest_params *ut_params = &unittest_params;
 	uint8_t *plaintext;
 	int ret = TEST_SUCCESS;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 	struct rte_cryptodev_info dev_info;
 	uint64_t feat_flags;
 
@@ -9180,9 +9176,7 @@ test_pdcp_proto_SGL(int i, int oop,
 	unsigned int trn_data = 0;
 	struct rte_cryptodev_info dev_info;
 	uint64_t feat_flags;
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-				rte_cryptodev_get_sec_ctx(
-				ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 	struct rte_mbuf *temp_mbuf;
 
 	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
@@ -9905,7 +9899,7 @@ test_ipsec_proto_process(const struct ipsec_test_data td[],
 	struct ipsec_test_data *res_d_tmp = NULL;
 	uint8_t input_text[IPSEC_TEXT_MAX_LEN];
 	int salt_len, i, ret = TEST_SUCCESS;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	uint32_t src, dst;
 	uint32_t verify;
 
@@ -11088,9 +11082,7 @@ test_docsis_proto_uplink(const void *data)
 	uint32_t crc_data_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
@@ -11272,9 +11264,7 @@ test_docsis_proto_downlink(const void *data)
 	int32_t cipher_len, crc_len;
 	int ret = TEST_SUCCESS;
 
-	struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-					rte_cryptodev_get_sec_ctx(
-						ts_params->valid_devs[0]);
+	void *ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
 
 	/* Verify the capabilities */
 	struct rte_security_capability_idx sec_cap_idx;
diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c
index be9e246bfe..205714b270 100644
--- a/app/test/test_cryptodev_security_ipsec.c
+++ b/app/test/test_cryptodev_security_ipsec.c
@@ -1249,7 +1249,7 @@ test_ipsec_status_check(const struct ipsec_test_data *td,
 }
 
 int
-test_ipsec_stats_verify(struct rte_security_ctx *ctx,
+test_ipsec_stats_verify(void *ctx,
 			void *sess,
 			const struct ipsec_test_flags *flags,
 			enum rte_security_ipsec_sa_direction dir)
diff --git a/app/test/test_cryptodev_security_ipsec.h b/app/test/test_cryptodev_security_ipsec.h
index e7903e9334..8587fc4577 100644
--- a/app/test/test_cryptodev_security_ipsec.h
+++ b/app/test/test_cryptodev_security_ipsec.h
@@ -302,7 +302,7 @@ int test_ipsec_status_check(const struct ipsec_test_data *td,
 			    enum rte_security_ipsec_sa_direction dir,
 			    int pkt_num);
 
-int test_ipsec_stats_verify(struct rte_security_ctx *ctx,
+int test_ipsec_stats_verify(void *ctx,
 			    void *sess,
 			    const struct ipsec_test_flags *flags,
 			    enum rte_security_ipsec_sa_direction dir);
diff --git a/app/test/test_security_inline_macsec.c b/app/test/test_security_inline_macsec.c
index 40fdfda942..59b1b8a6a6 100644
--- a/app/test/test_security_inline_macsec.c
+++ b/app/test/test_security_inline_macsec.c
@@ -136,7 +136,7 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len)
 static int
 init_mempools(unsigned int nb_mbuf)
 {
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint16_t nb_sess = 512;
 	uint32_t sess_sz;
 	char s[64];
@@ -482,7 +482,7 @@ test_macsec_post_process(struct rte_mbuf *m, const struct mcs_test_vector *td,
 }
 
 static void
-mcs_stats_dump(struct rte_security_ctx *ctx, enum mcs_op op,
+mcs_stats_dump(void *ctx, enum mcs_op op,
 	       void *rx_sess, void *tx_sess,
 	       uint8_t rx_sc_id, uint8_t tx_sc_id,
 	       uint16_t rx_sa_id[], uint16_t tx_sa_id[])
@@ -667,7 +667,7 @@ mcs_stats_dump(struct rte_security_ctx *ctx, enum mcs_op op,
 }
 
 static int
-mcs_stats_check(struct rte_security_ctx *ctx, enum mcs_op op,
+mcs_stats_check(void *ctx, enum mcs_op op,
 		const struct mcs_test_opts *opts,
 		const struct mcs_test_vector *td,
 		void *rx_sess, void *tx_sess,
@@ -900,7 +900,7 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
 	struct rte_security_macsec_sa sa_conf = {0};
 	struct rte_security_macsec_sc sc_conf = {0};
 	struct mcs_err_vector err_vector = {0};
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	int nb_rx = 0, nb_sent;
 	int i, j = 0, ret, id, an = 0;
 	uint8_t tci_off;
@@ -908,7 +908,7 @@ test_macsec(const struct mcs_test_vector *td[], enum mcs_op op, const struct mcs
 
 	memset(rx_pkts_burst, 0, sizeof(rx_pkts_burst[0]) * opts->nb_td);
 
-	ctx = (struct rte_security_ctx *)rte_eth_dev_get_sec_ctx(port_id);
+	ctx = rte_eth_dev_get_sec_ctx(port_id);
 	if (ctx == NULL) {
 		printf("Ethernet device doesn't support security features.\n");
 		return TEST_SKIPPED;
diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c
index 33eb1dd201..78a2064b65 100644
--- a/app/test/test_security_inline_proto.c
+++ b/app/test/test_security_inline_proto.c
@@ -136,7 +136,7 @@ static struct rte_flow *default_flow[RTE_MAX_ETHPORTS];
 /* Create Inline IPsec session */
 static int
 create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
-		void **sess, struct rte_security_ctx **ctx,
+		void **sess, void **ctx,
 		uint32_t *ol_flags, const struct ipsec_test_flags *flags,
 		struct rte_security_session_conf *sess_conf)
 {
@@ -149,7 +149,7 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
 	struct rte_security_capability_idx sec_cap_idx;
 	const struct rte_security_capability *sec_cap;
 	enum rte_security_ipsec_sa_direction dir;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint32_t verify;
 
 	sess_conf->action_type = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL;
@@ -221,7 +221,7 @@ create_inline_ipsec_session(struct ipsec_test_data *sa, uint16_t portid,
 
 	sess_conf->userdata = (void *) sa;
 
-	sec_ctx = (struct rte_security_ctx *)rte_eth_dev_get_sec_ctx(portid);
+	sec_ctx = rte_eth_dev_get_sec_ctx(portid);
 	if (sec_ctx == NULL) {
 		printf("Ethernet device doesn't support security features.\n");
 		return TEST_SKIPPED;
@@ -503,7 +503,7 @@ init_packet(struct rte_mempool *mp, const uint8_t *data, unsigned int len, bool
 static int
 init_mempools(unsigned int nb_mbuf)
 {
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	uint16_t nb_sess = 512;
 	uint32_t sess_sz;
 	char s[64];
@@ -846,7 +846,7 @@ test_ipsec_with_reassembly(struct reassembly_vector *vector,
 	struct rte_crypto_sym_xform auth_in = {0};
 	struct rte_crypto_sym_xform aead_in = {0};
 	struct ipsec_test_data sa_data;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	unsigned int i, nb_rx = 0, j;
 	uint32_t ol_flags;
 	bool outer_ipv4;
@@ -1113,7 +1113,7 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td,
 	struct rte_crypto_sym_xform auth = {0};
 	struct rte_crypto_sym_xform aead = {0};
 	struct sa_expiry_vector vector = {0};
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	int nb_rx = 0, nb_sent;
 	uint32_t ol_flags;
 	int i, j = 0, ret;
@@ -1398,7 +1398,7 @@ test_ipsec_inline_proto_process_with_esn(struct ipsec_test_data td[],
 	struct rte_mbuf *tx_pkt = NULL;
 	int nb_rx, nb_sent;
 	void *ses;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 	uint32_t ol_flags;
 	bool outer_ipv4;
 	int i, ret;
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 4ec4953f6e..c776efebd9 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -139,9 +139,6 @@ Deprecation Notices
   which got error interrupt to the application,
   so that application can reset that particular queue pair.
 
-* security: Hide structures ``rte_security_ops`` and ``rte_security_ctx``
-  as these are internal to DPDK library and drivers.
-
 * eventdev: The single-event (non-burst) enqueue and dequeue operations,
   used by static inline burst enqueue and dequeue functions in ``rte_eventdev.h``,
   will be removed in DPDK 23.11.
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d0bfb7f5d2..250735efa9 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -144,6 +144,9 @@ API Changes
   except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
   replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
+* security: Structures ``rte_security_ops`` and ``rte_security_ctx`` were moved to
+  internal library headers not visible to application.
+
 
 ABI Changes
 -----------
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 3ab7995fd5..bf98d2618b 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -568,7 +568,7 @@ process_pkts_outbound_nosp(struct ipsec_ctx *ipsec_ctx,
 
 static inline void
 process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts,
-	     uint8_t nb_pkts, uint16_t portid, struct rte_security_ctx *ctx)
+	     uint8_t nb_pkts, uint16_t portid, void *ctx)
 {
 	struct ipsec_traffic traffic;
 
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index a5706bed24..f5cec4a928 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -205,7 +205,7 @@ verify_ipsec_capabilities(struct rte_security_ipsec_xform *ipsec_xform,
 
 
 static inline int
-verify_security_capabilities(struct rte_security_ctx *ctx,
+verify_security_capabilities(void *ctx,
 		struct rte_security_session_conf *sess_conf,
 		uint32_t *ol_flags)
 {
@@ -327,9 +327,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
 		};
 
 		if (ips->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
-			struct rte_security_ctx *ctx = (struct rte_security_ctx *)
-							rte_cryptodev_get_sec_ctx(
-							cdev_id);
+			void *ctx = rte_cryptodev_get_sec_ctx(cdev_id);
 
 			/* Set IPsec parameters in conf */
 			set_ipsec_conf(sa, &(sess_conf.ipsec));
@@ -411,7 +409,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 		struct rte_ipsec_session *ips)
 {
 	int32_t ret = 0;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 	struct rte_security_session_conf sess_conf = {
 		.action_type = ips->type,
 		.protocol = RTE_SECURITY_PROTOCOL_IPSEC,
@@ -490,9 +488,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 		struct rte_flow_error err;
 		int ret = 0;
 
-		sec_ctx = (struct rte_security_ctx *)
-					rte_eth_dev_get_sec_ctx(
-					sa->portid);
+		sec_ctx = rte_eth_dev_get_sec_ctx(sa->portid);
 		if (sec_ctx == NULL) {
 			RTE_LOG(ERR, IPSEC,
 				" rte_eth_dev_get_sec_ctx failed\n");
@@ -657,8 +653,7 @@ create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
 			return -1;
 		}
 	} else if (ips->type ==	RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) {
-		sec_ctx = (struct rte_security_ctx *)
-				rte_eth_dev_get_sec_ctx(sa->portid);
+		sec_ctx = rte_eth_dev_get_sec_ctx(sa->portid);
 
 		if (sec_ctx == NULL) {
 			RTE_LOG(ERR, IPSEC,
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 6bef2a7285..5059418456 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -279,7 +279,7 @@ struct cnt_blk {
 struct lcore_rx_queue {
 	uint16_t port_id;
 	uint8_t queue_id;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 } __rte_cache_aligned;
 
 struct buffer {
diff --git a/examples/ipsec-secgw/ipsec_worker.c b/examples/ipsec-secgw/ipsec_worker.c
index 58c80c73f0..8d122e8519 100644
--- a/examples/ipsec-secgw/ipsec_worker.c
+++ b/examples/ipsec-secgw/ipsec_worker.c
@@ -20,7 +20,7 @@
 
 struct port_drv_mode_data {
 	void *sess;
-	struct rte_security_ctx *ctx;
+	void *ctx;
 };
 
 typedef void (*ipsec_worker_fn_t)(void);
diff --git a/examples/ipsec-secgw/ipsec_worker.h b/examples/ipsec-secgw/ipsec_worker.h
index cf59b9b5ab..ac980b8bcf 100644
--- a/examples/ipsec-secgw/ipsec_worker.h
+++ b/examples/ipsec-secgw/ipsec_worker.h
@@ -119,7 +119,7 @@ adjust_ipv6_pktlen(struct rte_mbuf *m, const struct rte_ipv6_hdr *iph,
 }
 
 static __rte_always_inline void
-prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt,
+prepare_one_packet(void *ctx, struct rte_mbuf *pkt,
 		   struct ipsec_traffic *t)
 {
 	uint32_t ptype = pkt->packet_type;
@@ -230,7 +230,7 @@ prepare_one_packet(struct rte_security_ctx *ctx, struct rte_mbuf *pkt,
 }
 
 static __rte_always_inline void
-prepare_traffic(struct rte_security_ctx *ctx, struct rte_mbuf **pkts,
+prepare_traffic(void *ctx, struct rte_mbuf **pkts,
 		struct ipsec_traffic *t, uint16_t nb_pkts)
 {
 	int32_t i;
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 42af4a2c35..ab44bbe0f0 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -60,11 +60,12 @@ rte_security_oop_dynfield_register(void)
 }
 
 void *
-rte_security_session_create(struct rte_security_ctx *instance,
+rte_security_session_create(void *ctx,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp)
 {
 	struct rte_security_session *sess = NULL;
+	struct rte_security_ctx *instance = ctx;
 	uint32_t sess_priv_size;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_create, NULL, NULL);
@@ -93,10 +94,10 @@ rte_security_session_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_session_update(struct rte_security_ctx *instance,
-			    void *sess,
-			    struct rte_security_session_conf *conf)
+rte_security_session_update(void *ctx, void *sess, struct rte_security_session_conf *conf)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_update, -EINVAL,
 			-ENOTSUP);
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
@@ -106,8 +107,10 @@ rte_security_session_update(struct rte_security_ctx *instance,
 }
 
 unsigned int
-rte_security_session_get_size(struct rte_security_ctx *instance)
+rte_security_session_get_size(void *ctx)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_get_size, 0, 0);
 
 	return (sizeof(struct rte_security_session) +
@@ -115,10 +118,10 @@ rte_security_session_get_size(struct rte_security_ctx *instance)
 }
 
 int
-rte_security_session_stats_get(struct rte_security_ctx *instance,
-			       void *sess,
-			       struct rte_security_stats *stats)
+rte_security_session_stats_get(void *ctx, void *sess, struct rte_security_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_stats_get, -EINVAL,
 			-ENOTSUP);
 	/* Parameter sess can be NULL in case of getting global statistics. */
@@ -128,8 +131,9 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_session_destroy(struct rte_security_ctx *instance, void *sess)
+rte_security_session_destroy(void *ctx, void *sess)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_destroy, -EINVAL,
@@ -149,9 +153,9 @@ rte_security_session_destroy(struct rte_security_ctx *instance, void *sess)
 }
 
 int
-rte_security_macsec_sc_create(struct rte_security_ctx *instance,
-			      struct rte_security_macsec_sc *conf)
+rte_security_macsec_sc_create(void *ctx, struct rte_security_macsec_sc *conf)
 {
+	struct rte_security_ctx *instance = ctx;
 	int sc_id;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_create, -EINVAL, -ENOTSUP);
@@ -165,9 +169,9 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_macsec_sa_create(struct rte_security_ctx *instance,
-			      struct rte_security_macsec_sa *conf)
+rte_security_macsec_sa_create(void *ctx, struct rte_security_macsec_sa *conf)
 {
+	struct rte_security_ctx *instance = ctx;
 	int sa_id;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_create, -EINVAL, -ENOTSUP);
@@ -181,9 +185,10 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance,
 }
 
 int
-rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_destroy(void *ctx, uint16_t sc_id,
 			       enum rte_security_macsec_direction dir)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_destroy, -EINVAL, -ENOTSUP);
@@ -199,9 +204,10 @@ rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id
 }
 
 int
-rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_destroy(void *ctx, uint16_t sa_id,
 			       enum rte_security_macsec_direction dir)
 {
+	struct rte_security_ctx *instance = ctx;
 	int ret;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_destroy, -EINVAL, -ENOTSUP);
@@ -217,10 +223,12 @@ rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id
 }
 
 int
-rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_stats_get(void *ctx, uint16_t sc_id,
 				 enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sc_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sc_stats_get, -EINVAL, -ENOTSUP);
 	RTE_PTR_OR_ERR_RET(stats, -EINVAL);
 
@@ -228,10 +236,12 @@ rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance, uint16_t sc_
 }
 
 int
-rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_stats_get(void *ctx, uint16_t sa_id,
 				 enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sa_stats *stats)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, macsec_sa_stats_get, -EINVAL, -ENOTSUP);
 	RTE_PTR_OR_ERR_RET(stats, -EINVAL);
 
@@ -239,10 +249,9 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance, uint16_t sa_
 }
 
 int
-__rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
-				void *sess,
-				struct rte_mbuf *m, void *params)
+__rte_security_set_pkt_metadata(void *ctx, void *sess, struct rte_mbuf *m, void *params)
 {
+	struct rte_security_ctx *instance = ctx;
 #ifdef RTE_DEBUG
 	RTE_PTR_OR_ERR_RET(sess, -EINVAL);
 	RTE_PTR_OR_ERR_RET(instance, -EINVAL);
@@ -255,19 +264,21 @@ __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
 }
 
 const struct rte_security_capability *
-rte_security_capabilities_get(struct rte_security_ctx *instance)
+rte_security_capabilities_get(void *ctx)
 {
+	struct rte_security_ctx *instance = ctx;
+
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, capabilities_get, NULL, NULL);
 
 	return instance->ops->capabilities_get(instance->device);
 }
 
 const struct rte_security_capability *
-rte_security_capability_get(struct rte_security_ctx *instance,
-			    struct rte_security_capability_idx *idx)
+rte_security_capability_get(void *ctx, struct rte_security_capability_idx *idx)
 {
 	const struct rte_security_capability *capabilities;
 	const struct rte_security_capability *capability;
+	struct rte_security_ctx *instance = ctx;
 	uint16_t i = 0;
 
 	RTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, capabilities_get, NULL, NULL);
@@ -401,12 +412,12 @@ static int
 security_capabilities_from_dev_id(int dev_id, const void **caps)
 {
 	const struct rte_security_capability *capabilities;
-	struct rte_security_ctx *sec_ctx;
+	void *sec_ctx;
 
 	if (rte_cryptodev_is_valid_dev(dev_id) == 0)
 		return -EINVAL;
 
-	sec_ctx = (struct rte_security_ctx *)rte_cryptodev_get_sec_ctx(dev_id);
+	sec_ctx = rte_cryptodev_get_sec_ctx(dev_id);
 	RTE_PTR_OR_ERR_RET(sec_ctx, -EINVAL);
 
 	capabilities = rte_security_capabilities_get(sec_ctx);
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index da58fe1f14..c9cc7a45a6 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -56,30 +56,6 @@ enum rte_security_ipsec_tunnel_type {
 #define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_DST_ADDR     0x1
 #define RTE_SECURITY_IPSEC_TUNNEL_VERIFY_SRC_DST_ADDR 0x2
 
-/**
- * Security context for crypto/eth devices
- *
- * Security instance for each driver to register security operations.
- * The application can get the security context from the crypto/eth device id
- * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx()
- * This structure is used to identify the device(crypto/eth) for which the
- * security operations need to be performed.
- */
-struct rte_security_ctx {
-	void *device;
-	/**< Crypto/ethernet device attached */
-	const struct rte_security_ops *ops;
-	/**< Pointer to security ops for the device */
-	uint16_t sess_cnt;
-	/**< Number of sessions attached to this context */
-	uint16_t macsec_sc_cnt;
-	/**< Number of MACsec SC attached to this context */
-	uint16_t macsec_sa_cnt;
-	/**< Number of MACsec SA attached to this context */
-	uint32_t flags;
-	/**< Flags for security context */
-};
-
 #define RTE_SEC_CTX_F_FAST_SET_MDATA 0x00000001
 /**< Driver uses fast metadata update without using driver specific callback.
  * For fast mdata, mbuf dynamic field would be registered by driver
@@ -695,7 +671,7 @@ struct rte_security_session_conf {
  *  - On failure, NULL
  */
 void *
-rte_security_session_create(struct rte_security_ctx *instance,
+rte_security_session_create(void *instance,
 			    struct rte_security_session_conf *conf,
 			    struct rte_mempool *mp);
 
@@ -711,7 +687,7 @@ rte_security_session_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_session_update(struct rte_security_ctx *instance,
+rte_security_session_update(void *instance,
 			    void *sess,
 			    struct rte_security_session_conf *conf);
 
@@ -725,7 +701,7 @@ rte_security_session_update(struct rte_security_ctx *instance,
  *   - 0 if device is invalid or does not support the operation.
  */
 unsigned int
-rte_security_session_get_size(struct rte_security_ctx *instance);
+rte_security_session_get_size(void *instance);
 
 /**
  * Free security session header and the session private data and
@@ -742,7 +718,7 @@ rte_security_session_get_size(struct rte_security_ctx *instance);
  *  - other negative values in case of freeing private data errors.
  */
 int
-rte_security_session_destroy(struct rte_security_ctx *instance, void *sess);
+rte_security_session_destroy(void *instance, void *sess);
 
 /**
  * @warning
@@ -761,7 +737,7 @@ rte_security_session_destroy(struct rte_security_ctx *instance, void *sess);
  */
 __rte_experimental
 int
-rte_security_macsec_sc_create(struct rte_security_ctx *instance,
+rte_security_macsec_sc_create(void *instance,
 			      struct rte_security_macsec_sc *conf);
 
 /**
@@ -780,7 +756,7 @@ rte_security_macsec_sc_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id,
+rte_security_macsec_sc_destroy(void *instance, uint16_t sc_id,
 			       enum rte_security_macsec_direction dir);
 
 /**
@@ -800,7 +776,7 @@ rte_security_macsec_sc_destroy(struct rte_security_ctx *instance, uint16_t sc_id
  */
 __rte_experimental
 int
-rte_security_macsec_sa_create(struct rte_security_ctx *instance,
+rte_security_macsec_sa_create(void *instance,
 			      struct rte_security_macsec_sa *conf);
 
 /**
@@ -819,7 +795,7 @@ rte_security_macsec_sa_create(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sa_destroy(struct rte_security_ctx *instance, uint16_t sa_id,
+rte_security_macsec_sa_destroy(void *instance, uint16_t sa_id,
 			       enum rte_security_macsec_direction dir);
 
 /** Device-specific metadata field type */
@@ -889,6 +865,27 @@ static inline bool rte_security_dynfield_is_registered(void)
 	return rte_security_dynfield_offset >= 0;
 }
 
+#define RTE_SECURITY_CTX_FLAGS_OFF		4
+/**
+ * Get security flags from security instance.
+ */
+static inline uint32_t
+rte_security_ctx_flags_get(void *ctx)
+{
+	return *((uint32_t *)ctx + RTE_SECURITY_CTX_FLAGS_OFF);
+}
+
+/**
+ * Set security flags in security instance.
+ */
+static inline void
+rte_security_ctx_flags_set(void *ctx, uint32_t flags)
+{
+	uint32_t *data;
+	data = (((uint32_t *)ctx) + RTE_SECURITY_CTX_FLAGS_OFF);
+	*data = flags;
+}
+
 #define RTE_SECURITY_SESS_OPAQUE_DATA_OFF	0
 #define RTE_SECURITY_SESS_FAST_MDATA_OFF	1
 /**
@@ -933,7 +930,7 @@ rte_security_session_fast_mdata_set(void *sess, uint64_t fdata)
 
 /** Function to call PMD specific function pointer set_pkt_metadata() */
 __rte_experimental
-int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+int __rte_security_set_pkt_metadata(void *instance,
 				    void *sess,
 				    struct rte_mbuf *m, void *params);
 
@@ -951,12 +948,12 @@ int __rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
  *  - On failure, a negative value.
  */
 static inline int
-rte_security_set_pkt_metadata(struct rte_security_ctx *instance,
+rte_security_set_pkt_metadata(void *instance,
 			      void *sess,
 			      struct rte_mbuf *mb, void *params)
 {
 	/* Fast Path */
-	if (instance->flags & RTE_SEC_CTX_F_FAST_SET_MDATA) {
+	if (rte_security_ctx_flags_get(instance) & RTE_SEC_CTX_F_FAST_SET_MDATA) {
 		*rte_security_dynfield(mb) = (rte_security_dynfield_t)
 			rte_security_session_fast_mdata_get(sess);
 		return 0;
@@ -1105,7 +1102,7 @@ struct rte_security_stats {
  */
 __rte_experimental
 int
-rte_security_session_stats_get(struct rte_security_ctx *instance,
+rte_security_session_stats_get(void *instance,
 			       void *sess,
 			       struct rte_security_stats *stats);
 
@@ -1125,7 +1122,7 @@ rte_security_session_stats_get(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance,
+rte_security_macsec_sa_stats_get(void *instance,
 				 uint16_t sa_id, enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sa_stats *stats);
 
@@ -1145,7 +1142,7 @@ rte_security_macsec_sa_stats_get(struct rte_security_ctx *instance,
  */
 __rte_experimental
 int
-rte_security_macsec_sc_stats_get(struct rte_security_ctx *instance,
+rte_security_macsec_sc_stats_get(void *instance,
 				 uint16_t sc_id, enum rte_security_macsec_direction dir,
 				 struct rte_security_macsec_sc_stats *stats);
 
@@ -1296,7 +1293,7 @@ struct rte_security_capability_idx {
  *   - Return NULL if no capabilities available.
  */
 const struct rte_security_capability *
-rte_security_capabilities_get(struct rte_security_ctx *instance);
+rte_security_capabilities_get(void *instance);
 
 /**
  * Query if a specific capability is available on security instance
@@ -1310,7 +1307,7 @@ rte_security_capabilities_get(struct rte_security_ctx *instance);
  *   - Return NULL if the capability not matched on security instance.
  */
 const struct rte_security_capability *
-rte_security_capability_get(struct rte_security_ctx *instance,
+rte_security_capability_get(void *instance,
 			    struct rte_security_capability_idx *idx);
 
 #ifdef __cplusplus
diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h
index 1e6a6ef8e3..e5e1c4cfe8 100644
--- a/lib/security/rte_security_driver.h
+++ b/lib/security/rte_security_driver.h
@@ -37,6 +37,30 @@ struct rte_security_session {
 	/**< Private session material, variable size (depends on driver) */
 };
 
+/**
+ * Security context for crypto/eth devices
+ *
+ * Security instance for each driver to register security operations.
+ * The application can get the security context from the crypto/eth device id
+ * using the APIs rte_cryptodev_get_sec_ctx()/rte_eth_dev_get_sec_ctx()
+ * This structure is used to identify the device(crypto/eth) for which the
+ * security operations need to be performed.
+ */
+struct rte_security_ctx {
+	void *device;
+	/**< Crypto/ethernet device attached */
+	const struct rte_security_ops *ops;
+	/**< Pointer to security ops for the device */
+	uint32_t flags;
+	/**< Flags for security context */
+	uint16_t sess_cnt;
+	/**< Number of sessions attached to this context */
+	uint16_t macsec_sc_cnt;
+	/**< Number of MACsec SC attached to this context */
+	uint16_t macsec_sa_cnt;
+	/**< Number of MACsec SA attached to this context */
+};
+
 /**
  * Helper macro to get driver private data
  */
-- 
2.25.1


^ permalink raw reply	[relevance 2%]

* [PATCH v13 1/4] ethdev: add API for mbufs recycle mode
  @ 2023-09-25  3:19  3%   ` Feifei Wang
  0 siblings, 0 replies; 200+ results
From: Feifei Wang @ 2023-09-25  3:19 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, nd, Feifei Wang, Honnappa Nagarahalli, Ruifeng Wang,
	Morten Brørup, Konstantin Ananyev

Add 'rte_eth_recycle_rx_queue_info_get' and 'rte_eth_recycle_mbufs'
APIs to recycle used mbufs from a transmit queue of an Ethernet device,
and move these mbufs into a mbuf ring for a receive queue of an Ethernet
device. This can bypass mempool 'put/get' operations hence saving CPU
cycles.

For each recycling mbufs, the rte_eth_recycle_mbufs() function performs
the following operations:
- Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf
ring.
- Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
from the Tx mbuf ring.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 doc/guides/rel_notes/release_23_11.rst |  15 +++
 lib/ethdev/ethdev_driver.h             |  10 ++
 lib/ethdev/ethdev_private.c            |   2 +
 lib/ethdev/rte_ethdev.c                |  22 +++
 lib/ethdev/rte_ethdev.h                | 180 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_core.h           |  23 +++-
 lib/ethdev/version.map                 |   3 +
 7 files changed, 249 insertions(+), 6 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 9746809a66..3c2bed73aa 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -78,6 +78,13 @@ New Features
 * build: Optional libraries can now be selected with the new ``enable_libs``
   build option similarly to the existing ``enable_drivers`` build option.
 
+* **Add mbufs recycling support.**
+
+  Added ``rte_eth_recycle_rx_queue_info_get`` and ``rte_eth_recycle_mbufs``
+  APIs which allow the user to copy used mbufs from the Tx mbuf ring
+  into the Rx mbuf ring. This feature supports the case that the Rx Ethernet
+  device is different from the Tx Ethernet device with respective driver
+  callback functions in ``rte_eth_recycle_mbufs``.
 
 Removed Items
 -------------
@@ -135,6 +142,14 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields to ``rte_eth_dev`` structure.
+
+* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
+  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields, to move ``rxq`` and ``txq`` fields, to change the size of
+  ``reserved1`` and ``reserved2`` fields.
+
 
 Known Issues
 ------------
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 3fa8b309c1..deb23ada18 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -60,6 +60,10 @@ struct rte_eth_dev {
 	eth_rx_descriptor_status_t rx_descriptor_status;
 	/** Check the status of a Tx descriptor */
 	eth_tx_descriptor_status_t tx_descriptor_status;
+	/** Pointer to PMD transmit mbufs reuse function */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	/** Pointer to PMD receive descriptors refill function */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
 
 	/**
 	 * Device data that is shared between primary and secondary processes
@@ -509,6 +513,10 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
+typedef void (*eth_recycle_rxq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t rx_queue_id,
+	struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
 	uint16_t queue_id, struct rte_eth_burst_mode *mode);
 
@@ -1252,6 +1260,8 @@ struct eth_dev_ops {
 	eth_rxq_info_get_t         rxq_info_get;
 	/** Retrieve Tx queue information */
 	eth_txq_info_get_t         txq_info_get;
+	/** Retrieve mbufs recycle Rx queue information */
+	eth_recycle_rxq_info_get_t recycle_rxq_info_get;
 	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst mode */
 	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst mode */
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version */
diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c
index 14ec8c6ccf..f8ab64f195 100644
--- a/lib/ethdev/ethdev_private.c
+++ b/lib/ethdev/ethdev_private.c
@@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
 	fpo->rx_queue_count = dev->rx_queue_count;
 	fpo->rx_descriptor_status = dev->rx_descriptor_status;
 	fpo->tx_descriptor_status = dev->tx_descriptor_status;
+	fpo->recycle_tx_mbufs_reuse = dev->recycle_tx_mbufs_reuse;
+	fpo->recycle_rx_descriptors_refill = dev->recycle_rx_descriptors_refill;
 
 	fpo->rxq.data = dev->data->rx_queues;
 	fpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 46eaed6467..92d7fc41a1 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5876,6 +5876,28 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	return 0;
 }
 
+int
+rte_eth_recycle_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_dev *dev;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	ret = eth_dev_validate_rx_queue(dev, queue_id);
+	if (unlikely(ret != 0))
+		return ret;
+
+	if (*dev->dev_ops->recycle_rxq_info_get == NULL)
+		return -ENOTSUP;
+
+	dev->dev_ops->recycle_rxq_info_get(dev, queue_id, recycle_rxq_info);
+
+	return 0;
+}
+
 int
 rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 			  struct rte_eth_burst_mode *mode)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 04a2564f22..9ea639852d 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -1820,6 +1820,30 @@ struct rte_eth_txq_info {
 	uint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */
 } __rte_cache_min_aligned;
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice.
+ *
+ * Ethernet device Rx queue information structure for recycling mbufs.
+ * Used to retrieve Rx queue information when Tx queue reusing mbufs and moving
+ * them into Rx mbuf ring.
+ */
+struct rte_eth_recycle_rxq_info {
+	struct rte_mbuf **mbuf_ring; /**< mbuf ring of Rx queue. */
+	struct rte_mempool *mp;     /**< mempool of Rx queue. */
+	uint16_t *refill_head;      /**< head of Rx queue refilling mbufs. */
+	uint16_t *receive_tail;     /**< tail of Rx queue receiving pkts. */
+	uint16_t mbuf_ring_size;     /**< configured number of mbuf ring size. */
+	/**
+	 * Requirement on mbuf refilling batch size of Rx mbuf ring.
+	 * For some PMD drivers, the number of Rx mbuf ring refilling mbufs
+	 * should be aligned with mbuf ring size, in order to simplify
+	 * ring wrapping around.
+	 * Value 0 means that PMD drivers have no requirement for this.
+	 */
+	uint16_t refill_requirement;
+} __rte_cache_min_aligned;
+
 /* Generic Burst mode flag definition, values can be ORed. */
 
 /**
@@ -4853,6 +4877,31 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Retrieve information about given ports's Rx queue for recycling mbufs.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The Rx queue on the Ethernet devicefor which information
+ *   will be retrieved.
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* to be filled.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENODEV:  If *port_id* is invalid.
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The queue_id is out of range.
+ */
+__rte_experimental
+int rte_eth_recycle_rx_queue_info_get(uint16_t port_id,
+		uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 /**
  * Retrieve information about the Rx packet burst mode.
  *
@@ -6527,6 +6576,137 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
 	return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Recycle used mbufs from a transmit queue of an Ethernet device, and move
+ * these mbufs into a mbuf ring for a receive queue of an Ethernet device.
+ * This can bypass mempool path to save CPU cycles.
+ *
+ * The rte_eth_recycle_mbufs() function loops, with rte_eth_rx_burst() and
+ * rte_eth_tx_burst() functions, freeing Tx used mbufs and replenishing Rx
+ * descriptors. The number of recycling mbufs depends on the request of Rx mbuf
+ * ring, with the constraint of enough used mbufs from Tx mbuf ring.
+ *
+ * For each recycling mbufs, the rte_eth_recycle_mbufs() function performs the
+ * following operations:
+ *
+ * - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf ring.
+ *
+ * - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
+ *   from the Tx mbuf ring.
+ *
+ * This function spilts Rx and Tx path with different callback functions. The
+ * callback function recycle_tx_mbufs_reuse is for Tx driver. The callback
+ * function recycle_rx_descriptors_refill is for Rx driver. rte_eth_recycle_mbufs()
+ * can support the case that Rx Ethernet device is different from Tx Ethernet device.
+ *
+ * It is the responsibility of users to select the Rx/Tx queue pair to recycle
+ * mbufs. Before call this function, users must call rte_eth_recycle_rxq_info_get
+ * function to retrieve selected Rx queue information.
+ * @see rte_eth_recycle_rxq_info_get, struct rte_eth_recycle_rxq_info
+ *
+ * Currently, the rte_eth_recycle_mbufs() function can support to feed 1 Rx queue from
+ * 2 Tx queues in the same thread. Do not pair the Rx queue and Tx queue in different
+ * threads, in order to avoid memory error rewriting.
+ *
+ * @param rx_port_id
+ *   Port identifying the receive side.
+ * @param rx_queue_id
+ *   The index of the receive queue identifying the receive side.
+ *   The value must be in the range [0, nb_rx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param tx_port_id
+ *   Port identifying the transmit side.
+ * @param tx_queue_id
+ *   The index of the transmit queue identifying the transmit side.
+ *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* which contains
+ *   the information of the Rx queue mbuf ring.
+ * @return
+ *   The number of recycling mbufs.
+ */
+__rte_experimental
+static inline uint16_t
+rte_eth_recycle_mbufs(uint16_t rx_port_id, uint16_t rx_queue_id,
+		uint16_t tx_port_id, uint16_t tx_queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_fp_ops *p1, *p2;
+	void *qd1, *qd2;
+	uint16_t nb_mbufs;
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	if (tx_port_id >= RTE_MAX_ETHPORTS ||
+			tx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR,
+				"Invalid tx_port_id=%u or tx_queue_id=%u\n",
+				tx_port_id, tx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to Tx queue data */
+	p1 = &rte_eth_fp_ops[tx_port_id];
+	qd1 = p1->txq.data[tx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port_id, 0);
+
+	if (qd1 == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u for port_id=%u\n",
+				tx_queue_id, tx_port_id);
+		return 0;
+	}
+#endif
+	if (p1->recycle_tx_mbufs_reuse == NULL)
+		return 0;
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	if (rx_port_id >= RTE_MAX_ETHPORTS ||
+			rx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR, "Invalid rx_port_id=%u or rx_queue_id=%u\n",
+				rx_port_id, rx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to Rx queue data */
+	p2 = &rte_eth_fp_ops[rx_port_id];
+	qd2 = p2->rxq.data[rx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port_id, 0);
+
+	if (qd2 == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u for port_id=%u\n",
+				rx_queue_id, rx_port_id);
+		return 0;
+	}
+#endif
+	if (p2->recycle_rx_descriptors_refill == NULL)
+		return 0;
+
+	/* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
+	 * into Rx mbuf ring.
+	 */
+	nb_mbufs = p1->recycle_tx_mbufs_reuse(qd1, recycle_rxq_info);
+
+	/* If no recycling mbufs, return 0. */
+	if (nb_mbufs == 0)
+		return 0;
+
+	/* Replenish the Rx descriptors with the recycling
+	 * into Rx mbuf ring.
+	 */
+	p2->recycle_rx_descriptors_refill(qd2, nb_mbufs);
+
+	return nb_mbufs;
+}
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index 8d260584b4..32f5f7376a 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -53,6 +53,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
 /** @internal Check the status of a Tx descriptor */
 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
 
+/** @internal Copy used mbufs from Tx mbuf ring into Rx mbuf ring */
+typedef uint16_t (*eth_recycle_tx_mbufs_reuse_t)(void *txq,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
+/** @internal Refill Rx descriptors with the recycling mbufs */
+typedef void (*eth_recycle_rx_descriptors_refill_t)(void *rxq, uint16_t nb);
+
 /**
  * @internal
  * Structure used to hold opaque pointers to internal ethdev Rx/Tx
@@ -81,15 +88,17 @@ struct rte_eth_fp_ops {
 	 * Rx fast-path functions and related data.
 	 * 64-bit systems: occupies first 64B line
 	 */
+	/** Rx queues data. */
+	struct rte_ethdev_qdata rxq;
 	/** PMD receive function. */
 	eth_rx_burst_t rx_pkt_burst;
 	/** Get the number of used Rx descriptors. */
 	eth_rx_queue_count_t rx_queue_count;
 	/** Check the status of a Rx descriptor. */
 	eth_rx_descriptor_status_t rx_descriptor_status;
-	/** Rx queues data. */
-	struct rte_ethdev_qdata rxq;
-	uintptr_t reserved1[3];
+	/** Refill Rx descriptors with the recycling mbufs. */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
+	uintptr_t reserved1[2];
 	/**@}*/
 
 	/**@{*/
@@ -97,15 +106,17 @@ struct rte_eth_fp_ops {
 	 * Tx fast-path functions and related data.
 	 * 64-bit systems: occupies second 64B line
 	 */
+	/** Tx queues data. */
+	struct rte_ethdev_qdata txq;
 	/** PMD transmit function. */
 	eth_tx_burst_t tx_pkt_burst;
 	/** PMD transmit prepare function. */
 	eth_tx_prep_t tx_pkt_prepare;
 	/** Check the status of a Tx descriptor. */
 	eth_tx_descriptor_status_t tx_descriptor_status;
-	/** Tx queues data. */
-	struct rte_ethdev_qdata txq;
-	uintptr_t reserved2[3];
+	/** Copy used mbufs from Tx mbuf ring into Rx. */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	uintptr_t reserved2[2];
 	/**@}*/
 
 } __rte_cache_aligned;
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index b965d6aa52..eec159dfdd 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -312,6 +312,9 @@ EXPERIMENTAL {
 	rte_flow_async_action_list_handle_query_update;
 	rte_flow_async_actions_update;
 	rte_flow_restore_info_dynflag;
+
+	# added in 23.11
+	rte_eth_recycle_rx_queue_info_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH] ethdev: validate reserved fields
  2023-09-21 16:33  0%     ` Ferruh Yigit
@ 2023-09-22 15:23  0%       ` Ferruh Yigit
  0 siblings, 0 replies; 200+ results
From: Ferruh Yigit @ 2023-09-22 15:23 UTC (permalink / raw)
  To: Bruce Richardson, Stephen Hemminger; +Cc: dev, thomas, Andrew Rybchenko

On 9/21/2023 5:33 PM, Ferruh Yigit wrote:
> On 9/21/2023 4:12 PM, Ferruh Yigit wrote:
>> On 5/26/2023 9:15 AM, Bruce Richardson wrote:
>>> On Thu, May 25, 2023 at 01:39:42PM -0700, Stephen Hemminger wrote:
>>>> The various reserved fields added to ethdev could not be
>>>> safely used for future extensions because they were never
>>>> checked on input. Therefore ABI would be broken if these
>>>> fields were added in a future DPDK release.
>>>>
>>>> Fixes: 436b3a6b6e62 ("ethdev: reserve space in main structs for extension")
>>>> Cc: thomas@monjalon.net
>>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>>> ---
>>>>  lib/ethdev/rte_ethdev.c | 41 +++++++++++++++++++++++++++++++++++++++++
>>>>  1 file changed, 41 insertions(+)
>>>>
>>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>>>
>>
>> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
>>
>> Applied to dpdk-next-net/main, thanks.
>>
> 
> some unit tests are failing with this patch, both iol and github actions
> reports it, need to investigate the root cause.
> 
> Based on findings, we may need to drop the patch from next-net, fyi.
> 

Unit test failures caused by segfault, because in
'rte_eth_rx_queue_setup()' & 'rte_eth_tx_queue_setup()' accepts
'rx_conf' & 'tx_conf' to be NULL, but checks doesn't take this into account.

Adding "rx_conf != NULL && (..)" check for Rx, and similar for Tx.

I will update in next-net, and force push.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH] ethdev: validate reserved fields
  2023-09-21 15:12  0%   ` Ferruh Yigit
@ 2023-09-21 16:33  0%     ` Ferruh Yigit
  2023-09-22 15:23  0%       ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-21 16:33 UTC (permalink / raw)
  To: Bruce Richardson, Stephen Hemminger; +Cc: dev, thomas, Andrew Rybchenko

On 9/21/2023 4:12 PM, Ferruh Yigit wrote:
> On 5/26/2023 9:15 AM, Bruce Richardson wrote:
>> On Thu, May 25, 2023 at 01:39:42PM -0700, Stephen Hemminger wrote:
>>> The various reserved fields added to ethdev could not be
>>> safely used for future extensions because they were never
>>> checked on input. Therefore ABI would be broken if these
>>> fields were added in a future DPDK release.
>>>
>>> Fixes: 436b3a6b6e62 ("ethdev: reserve space in main structs for extension")
>>> Cc: thomas@monjalon.net
>>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>>> ---
>>>  lib/ethdev/rte_ethdev.c | 41 +++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 41 insertions(+)
>>>
>> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
> 
> Applied to dpdk-next-net/main, thanks.
>

some unit tests are failing with this patch, both iol and github actions
reports it, need to investigate the root cause.

Based on findings, we may need to drop the patch from next-net, fyi.


^ permalink raw reply	[relevance 0%]

* Re: [PATCH] ethdev: validate reserved fields
  @ 2023-09-21 15:12  0%   ` Ferruh Yigit
  2023-09-21 16:33  0%     ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-21 15:12 UTC (permalink / raw)
  To: Bruce Richardson, Stephen Hemminger; +Cc: dev, thomas, Andrew Rybchenko

On 5/26/2023 9:15 AM, Bruce Richardson wrote:
> On Thu, May 25, 2023 at 01:39:42PM -0700, Stephen Hemminger wrote:
>> The various reserved fields added to ethdev could not be
>> safely used for future extensions because they were never
>> checked on input. Therefore ABI would be broken if these
>> fields were added in a future DPDK release.
>>
>> Fixes: 436b3a6b6e62 ("ethdev: reserve space in main structs for extension")
>> Cc: thomas@monjalon.net
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>> ---
>>  lib/ethdev/rte_ethdev.c | 41 +++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 41 insertions(+)
>>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-21 13:18  4%             ` Tummala, Sivaprasad
@ 2023-09-21 14:49  4%               ` Stanisław Kardach
  2023-09-27 11:55  5%                 ` Ferruh Yigit
  0 siblings, 1 reply; 200+ results
From: Stanisław Kardach @ 2023-09-21 14:49 UTC (permalink / raw)
  To: Tummala, Sivaprasad
  Cc: David Marchand, Ruifeng Wang, Min Zhou, David Christensen,
	Bruce Richardson, Konstantin Ananyev, dev, Yigit, Ferruh,
	Thomas Monjalon

[-- Attachment #1: Type: text/plain, Size: 5540 bytes --]

On Thu, Sep 21, 2023, 15:18 Tummala, Sivaprasad <Sivaprasad.Tummala@amd.com>
wrote:

> [AMD Official Use Only - General]
>
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Wednesday, September 20, 2023 1:05 PM
> > To: Stanisław Kardach <kda@semihalf.com>; Tummala, Sivaprasad
> > <Sivaprasad.Tummala@amd.com>
> > Cc: Ruifeng Wang <ruifeng.wang@arm.com>; Min Zhou <zhoumin@loongson.cn>;
> > David Christensen <drc@linux.vnet.ibm.com>; Bruce Richardson
> > <bruce.richardson@intel.com>; Konstantin Ananyev
> > <konstantin.v.ananyev@yandex.ru>; dev <dev@dpdk.org>; Yigit, Ferruh
> > <Ferruh.Yigit@amd.com>; Thomas Monjalon <thomas@monjalon.net>
> > Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
> >
> > Caution: This message originated from an External Source. Use proper
> caution
> > when opening attachments, clicking links, or responding.
> >
> >
> > On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach <kda@semihalf.com>
> wrote:
> > >
> > > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
> > <david.marchand@redhat.com> wrote:
> > > <snip>
> > > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I
> call a
> > last element canary). Why? If you're concerned with ABI, then we're
> talking about
> > an application linking dynamically with DPDK or talking via some RPC
> channel with
> > another DPDK application. So clashing with this definition does not come
> into
> > question. One should rather use rte_cpu_get_flag_enabled().
> > > > > Also if you want to introduce new features, one would add them yo
> the
> > rte_cpuflags headers, unless you'd like to not add those and keep an
> > undocumented list "above" the last defined element.
> > > > > Could you explain a bit more Your use-case?
> > > >
> > > > Hey Stanislaw,
> > > >
> > > > Talking generically, one problem with such pattern (having a LAST,
> > > > or MAX enum) is when an array sized with such a symbol is exposed.
> > > > As I mentionned in the past, this can have unwanted effects:
> > > > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> > > > -1-david.marchand@redhat.com/
> >
> > Argh... who broke copy/paste in my browser ?!
> > Wrt to MAX and arrays, I wanted to point at:
> >
> http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR
> > TsUw@mail.gmail.com/
> >
> > > I agree, though I'd argue "LAST" and "MAX" semantics are a bit
> different. "LAST"
> > delimits the known enumeration territory while "MAX" is more of a
> `constepxr`
> > value type.
> > > >
> > > > Another issue is when an existing enum meaning changes: from the
> > > > application pov, the (old) MAX value is incorrect, but for the
> > > > library pov, a new meaning has been associated.
> > > > This may trigger bugs in the application when calling a function
> > > > that returns such an enum which never return this MAX value in the
> past.
> > > >
> > > > For at least those two reasons, removing those canary elements is
> > > > being done in DPDK.
> > > >
> > > > This specific removal has been announced:
> > > > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> > > > -1-david.marchand@redhat.com/
> > > Thanks for pointing this out but did you mean to link to the patch
> again here?
> >
> > Sorry, same here, bad copy/paste :-(.
> >
> > The intended link is: https://git.dpdk.org/dpdk/commit/?id=5da7c13521
> > The deprecation notice was badly formulated and this patch here is
> consistent with
> > it.
> >
> >
> > > >
> > > > Now, practically, when I look at the cpuflags API, I don't see us
> > > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
> > > > is unneeded.
> > > > But on the other hand, is it really an issue for an application to
> > > > lose this (internal) information?
> > > I doubt it, maybe it could be used as a sanity check for choosing
> proper functors
> > in the application. Though the initial description of the reason behind
> this patch was
> > to not break the ABI and I don't think it does that. What it does is
> enforces users to
> > use explicit cpu flag values which is a good thing. Though if so, then
> it should be
> > stated in the commit description.
> >
> > I agree.
> > Siva, can you work on a new revision?
> >
> David, Stanislaw,
>
> The original motivation of this patch was to avoid ABI breakage with the
> introduction of new CPU flag
> "RTE_CPUFLAG_MONITORX" (
> http://mails.dpdk.org/archives/test-report/2023-April/382489.html).
>
> Because of ABI breakage, the feature was postponed to this release.
>
> https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/

This test is flawed, reason being that the NUMFLAGS should not be treated
as a flag value and instead as a canary but this test is not taking into
account.
Your change did not break the ABI because you have properly added the new
flag at the end.
So I would ask to change the commit description to mention that NUMFLAGS is
removed to:
1. Prevent users from treating it as a usable value or an array size.
2. Prevent false-positive failures in the ABI test.

Also it would be good to link to the aforementioned ABI test failure to
give readers some context when inspecting the git tree.

>
>
> Can you please add what exactly needs to be reworked in the new version.
>
> >
> > Thanks.
> >
> > --
> > David Marchand
>
>

[-- Attachment #2: Type: text/html, Size: 8942 bytes --]

^ permalink raw reply	[relevance 4%]

* RE: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-20  7:34  0%           ` David Marchand
@ 2023-09-21 13:18  4%             ` Tummala, Sivaprasad
  2023-09-21 14:49  4%               ` Stanisław Kardach
  0 siblings, 1 reply; 200+ results
From: Tummala, Sivaprasad @ 2023-09-21 13:18 UTC (permalink / raw)
  To: David Marchand, Stanisław Kardach
  Cc: Ruifeng Wang, Min Zhou, David Christensen, Bruce Richardson,
	Konstantin Ananyev, dev, Yigit, Ferruh, Thomas Monjalon

[AMD Official Use Only - General]

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Wednesday, September 20, 2023 1:05 PM
> To: Stanisław Kardach <kda@semihalf.com>; Tummala, Sivaprasad
> <Sivaprasad.Tummala@amd.com>
> Cc: Ruifeng Wang <ruifeng.wang@arm.com>; Min Zhou <zhoumin@loongson.cn>;
> David Christensen <drc@linux.vnet.ibm.com>; Bruce Richardson
> <bruce.richardson@intel.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; dev <dev@dpdk.org>; Yigit, Ferruh
> <Ferruh.Yigit@amd.com>; Thomas Monjalon <thomas@monjalon.net>
> Subject: Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach <kda@semihalf.com> wrote:
> >
> > On Tue, Sep 19, 2023 at 4:47 PM David Marchand
> <david.marchand@redhat.com> wrote:
> > <snip>
> > > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I call a
> last element canary). Why? If you're concerned with ABI, then we're talking about
> an application linking dynamically with DPDK or talking via some RPC channel with
> another DPDK application. So clashing with this definition does not come into
> question. One should rather use rte_cpu_get_flag_enabled().
> > > > Also if you want to introduce new features, one would add them yo the
> rte_cpuflags headers, unless you'd like to not add those and keep an
> undocumented list "above" the last defined element.
> > > > Could you explain a bit more Your use-case?
> > >
> > > Hey Stanislaw,
> > >
> > > Talking generically, one problem with such pattern (having a LAST,
> > > or MAX enum) is when an array sized with such a symbol is exposed.
> > > As I mentionned in the past, this can have unwanted effects:
> > > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> > > -1-david.marchand@redhat.com/
>
> Argh... who broke copy/paste in my browser ?!
> Wrt to MAX and arrays, I wanted to point at:
> http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuR
> TsUw@mail.gmail.com/
>
> > I agree, though I'd argue "LAST" and "MAX" semantics are a bit different. "LAST"
> delimits the known enumeration territory while "MAX" is more of a `constepxr`
> value type.
> > >
> > > Another issue is when an existing enum meaning changes: from the
> > > application pov, the (old) MAX value is incorrect, but for the
> > > library pov, a new meaning has been associated.
> > > This may trigger bugs in the application when calling a function
> > > that returns such an enum which never return this MAX value in the past.
> > >
> > > For at least those two reasons, removing those canary elements is
> > > being done in DPDK.
> > >
> > > This specific removal has been announced:
> > > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493
> > > -1-david.marchand@redhat.com/
> > Thanks for pointing this out but did you mean to link to the patch again here?
>
> Sorry, same here, bad copy/paste :-(.
>
> The intended link is: https://git.dpdk.org/dpdk/commit/?id=5da7c13521
> The deprecation notice was badly formulated and this patch here is consistent with
> it.
>
>
> > >
> > > Now, practically, when I look at the cpuflags API, I don't see us
> > > exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
> > > is unneeded.
> > > But on the other hand, is it really an issue for an application to
> > > lose this (internal) information?
> > I doubt it, maybe it could be used as a sanity check for choosing proper functors
> in the application. Though the initial description of the reason behind this patch was
> to not break the ABI and I don't think it does that. What it does is enforces users to
> use explicit cpu flag values which is a good thing. Though if so, then it should be
> stated in the commit description.
>
> I agree.
> Siva, can you work on a new revision?
>
David, Stanislaw,

The original motivation of this patch was to avoid ABI breakage with the introduction of new CPU flag
"RTE_CPUFLAG_MONITORX" (http://mails.dpdk.org/archives/test-report/2023-April/382489.html).

Because of ABI breakage, the feature was postponed to this release.
https://patchwork.dpdk.org/project/dpdk/patch/20230413115334.43172-3-sivaprasad.tummala@amd.com/

Can you please add what exactly needs to be reworked in the new version.

>
> Thanks.
>
> --
> David Marchand


^ permalink raw reply	[relevance 4%]

* RE: [RFC PATCH 2/3] security: add TLS record processing
  2023-09-20 11:51  0%     ` Anoob Joseph
@ 2023-09-21  8:38  0%       ` Van Haaren, Harry
  0 siblings, 0 replies; 200+ results
From: Van Haaren, Harry @ 2023-09-21  8:38 UTC (permalink / raw)
  To: Anoob Joseph
  Cc: Hemant Agrawal, dev, Matz, Olivier, Vidya Sagar Velumuri,
	Thomas Monjalon, Akhil Goyal, Jerin Jacob Kollanukkaran,
	Konstantin Ananyev

> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Wednesday, September 20, 2023 12:52 PM
> To: Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> <vvelumuri@marvell.com>; Thomas Monjalon <thomas@monjalon.net>; Akhil
> Goyal <gakhil@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
> Subject: RE: [RFC PATCH 2/3] security: add TLS record processing
> 
> Hi Harry,
> 
> Thanks for the review. Please see inline.
> 
> Thanks,
> Anoob
> 
> > -----Original Message-----
> > From: Van Haaren, Harry <harry.van.haaren@intel.com>
> > Sent: Wednesday, September 20, 2023 2:53 PM
> > To: Anoob Joseph <anoobj@marvell.com>; Thomas Monjalon
> > <thomas@monjalon.net>; Akhil Goyal <gakhil@marvell.com>; Jerin Jacob
> > Kollanukkaran <jerinj@marvell.com>; Konstantin Ananyev
> > <konstantin.v.ananyev@yandex.ru>
> > Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> > Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> > <vvelumuri@marvell.com>
> > Subject: [EXT] RE: [RFC PATCH 2/3] security: add TLS record processing
> >
> > External Email
> >
> > ----------------------------------------------------------------------
> > > -----Original Message-----
> > > From: Anoob Joseph <anoobj@marvell.com>
> > > Sent: Friday, August 11, 2023 8:17 AM
> > > To: Thomas Monjalon <thomas@monjalon.net>; Akhil Goyal
> > > <gakhil@marvell.com>; Jerin Jacob <jerinj@marvell.com>; Konstantin
> > > Ananyev <konstantin.v.ananyev@yandex.ru>
> > > Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> > > Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> > > <vvelumuri@marvell.com>
> > > Subject: [RFC PATCH 2/3] security: add TLS record processing
> > >
> > > Add Transport Layer Security (TLS) and Datagram Transport Layer
> > > Security (DTLS). The protocols provide communications privacy for L4
> > > protocols such as TCP & UDP.
> > >
> > > TLS (and DTLS) protocol is composed of two layers, 1. TLS Record
> > > Protocol 2. TLS Handshake Protocol
> > >
> > > While TLS Handshake Protocol helps in establishing security parameters
> > > by which client and server can communicate, TLS Record Protocol
> > > provides the connection security. TLS Record Protocol leverages
> > > symmetric cryptographic operations such as data encryption and
> > > authentication for providing security to the communications.
> > >
> > > Cryptodevs that are capable of offloading TLS Record Protocol may
> > > perform other operations like IV generation, header insertion, atomic
> > > sequence number updates and anti-replay window check in addition to
> > > cryptographic transformations.
> > >
> > > The support is added for TLS 1.2, TLS 1.3 and DTLS 1.2.
> >
> > From the code below, my understanding is that *ONLY* the record layer is
> > being added/supported? The difference is described well above, but the
> > intended support added is not clearly defined.
> >
> > Suggest reword the last line to clarify:
> > "Support for TLS record protocol is added for TLS 1.2, TLS 1.3 and DTLS 1.2."
> 
> [Anoob] Indeed. Will reword as suggested.

Thanks.

> > > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > > Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
> > > ---
> > >  doc/guides/prog_guide/rte_security.rst |  58 +++++++++++++
> > >  lib/security/rte_security.c            |   4 +
> > >  lib/security/rte_security.h            | 110 +++++++++++++++++++++++++
> > >  3 files changed, 172 insertions(+)
> > >
> > > diff --git a/doc/guides/prog_guide/rte_security.rst
> > > b/doc/guides/prog_guide/rte_security.rst
> > > index 7418e35c1b..7716d7239f 100644
> > > --- a/doc/guides/prog_guide/rte_security.rst
> > > +++ b/doc/guides/prog_guide/rte_security.rst
> > > @@ -399,6 +399,64 @@ The API ``rte_security_macsec_sc_create`` returns
> > > a handle for SC,  and this handle is set in
> > > ``rte_security_macsec_xform``  to create a MACsec session using
> > > ``rte_security_session_create``.
> > >
> > > +TLS-Record Protocol
> > > +~~~~~~~~~~~~~~~~~~~
> > > +
> > > +The Transport Layer Protocol provides communications security over
> > > +the
> > > Internet. The protocol
> > > +allows client/server applications to communicate in a way that is
> > > +designed to
> > > prevent eavesdropping,
> > > +tampering, or message forgery.
> > > +
> > > +TLS protocol is composed of two layers: the TLS Record Protocol and
> > > +the TLS
> > > Handshake Protocol. At
> > > +the lowest level, layered on top of some reliable transport protocol
> > > +(e.g., TCP),
> > > is the TLS Record
> > > +Protocol. The TLS Record Protocol provides connection security that
> > > +has two
> > > basic properties:
> > > +
> > > +   -  The connection is private.  Symmetric cryptography is used for data
> > > +      encryption (e.g., AES, DES, etc.).  The keys for this symmetric
> > encryption
> > > +      are generated uniquely for each connection and are based on a secret
> > > +      negotiated by another protocol (such as the TLS Handshake Protocol).
> > The
> > > +      Record Protocol can also be used without encryption.
> > > +
> > > +   -  The connection is reliable.  Message transport includes a message
> > > +      integrity check using a keyed MAC.  Secure hash functions (e.g.,
> > > +      SHA-1, etc.) are used for MAC computations.  The Record Protocol
> > > +      can operate without a MAC, but is generally only used in this mode
> > > +      while another protocol is using the Record Protocol as a transport
> > > +      for negotiating security parameters.
> > > +
> > > +.. code-block:: c
> >
> > The code block below isn't C? Is there a better code block type for a text
> > diagram?
> 
> [Anoob] Valid point. I was just following the general scheme followed in this file.
> May be, I'll introduce a .svg image for newly added code.

This was a nit-pick that perhaps "code-block:: text-diagram" or so exists.
No need to make a .svg in my opinion, the text-diagrams are clear.


> > > +             Record Write                   Record Read
> > > +             ------------                   -----------
> > > +
> > > +             TLSPlaintext                  TLSCiphertext
> > > +                  |                              |
> > > +                  ~                              ~
> > > +                  |                              |
> > > +                  V                              V
> > > +        +---------|----------+        +----------|---------+
> > > +        | Seq. no generation |        | Seq. no generation |
> > > +        +---------|----------+        +----------|---------+
> > > +                  |                              |
> > > +        +---------|----------+        +----------|---------+
> > > +        |  Header insertion  |        |    Decryption &    |
> > > +        +---------|----------+        |  MAC verification  |
> > > +                  |                   +----------|---------+
> > > +        +---------|----------+                   |
> > > +        |  MAC generation &  |        +----------|---------+
> > > +        |     Encryption     |        | TLS Header removal |
> > > +        +---------|----------+        +----------|---------+
> > > +                  |                              |
> > > +                  ~                              ~
> > > +                  |                              |
> > > +                  V                              V
> > > +            TLSCiphertext                  TLSPlaintext
> > > +
> > > +Supported Versions
> > > +^^^^^^^^^^^^^^^^^^
> > > +
> > > +* TLS 1.2
> > > +* TLS 1.3
> > > +* DTLS 1.2
> > >
> > >  Device Features and Capabilities
> > >  ---------------------------------
> > > diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
> > > index c4d64bb8e9..bd7b026547 100644
> > > --- a/lib/security/rte_security.c
> > > +++ b/lib/security/rte_security.c
> > > @@ -282,6 +282,10 @@ rte_security_capability_get(struct
> > > rte_security_ctx *instance,
> > >  				if (capability->docsis.direction ==
> > >  							idx->docsis.direction)
> > >  					return capability;
> > > +			} else if (idx->protocol ==
> > > RTE_SECURITY_PROTOCOL_TLS_RECORD) {
> > > +				if (capability->tls_record.ver == idx-
> > > >tls_record.ver &&
> > > +				    capability->tls_record.type == idx-
> > > >tls_record.type)
> > > +					return capability;
> > >  			}
> > >  		}
> > >  	}
> > > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> > > index 3b2df526ba..b9d064ed84 100644
> > > --- a/lib/security/rte_security.h
> > > +++ b/lib/security/rte_security.h
> > > @@ -620,6 +620,99 @@ struct rte_security_docsis_xform {
> > >  	/**< DOCSIS direction */
> > >  };
> > >
> > > +/** Salt len to be used with AEAD algos in TLS 1.2 */ #define
> > > +RTE_SECURITY_TLS_1_2_SALT_LEN 4
> > > +/** Salt len to be used with AEAD algos in TLS 1.3 */ #define
> > > +RTE_SECURITY_TLS_1_3_SALT_LEN 12
> > > +/** Salt len to be used with AEAD algos in DTLS 1.2 */ #define
> > > +RTE_SECURITY_DTLS_1_2_SALT_LEN 4
> > > +
> > > +/** TLS version */
> > > +enum rte_security_tls_version {
> > > +	RTE_SECURITY_VERSION_TLS_1_2,	/**< TLS 1.2 */
> > > +	RTE_SECURITY_VERSION_TLS_1_3,	/**< TLS 1.3 */
> > > +	RTE_SECURITY_VERSION_DTLS_1_2,	/**< DTLS 1.2 */
> > > +};
> > > +
> > > +/** TLS session type */
> > > +enum rte_security_tls_sess_type {
> > > +	/** Record read session
> > > +	 * - Decrypt & digest verification.
> > > +	 */
> > > +	RTE_SECURITY_TLS_SESS_TYPE_READ,
> > > +	/** Record write session
> > > +	 * - Encrypt & digest generation.
> > > +	 */
> > > +	RTE_SECURITY_TLS_SESS_TYPE_WRITE,
> > > +};
> > > +
> > > +/**
> > > + * Configure soft and hard lifetime of a TLS record session
> > > + *
> > > + * Lifetime of a TLS record session would specify the maximum number
> > > +of
> > > packets that can be
> > > + * processed. TLS record processing operations would start failing
> > > + once hard
> > > limit is reached.
> > > + *
> > > + * Soft limits can be specified to generate notification when the TLS
> > > + record
> > > session is approaching
> > > + * hard limits for lifetime. This would result in a warning returned
> > > + in
> > > ``rte_crypto_op.aux_flags``.
> >
> > Can we define "a warning" better? Perhaps an example of a soft-limit and
> > hard-limit, what the user can check aux_flags for, to identify? Or link to the
> > appropriate part of the crypto_op.aux_flags documentation to help the user.
> >
> 
> [Anoob] The concept of lifetime is present in most protocols. Idea is to limit the
> max number of operations performed with a session. Soft expiry notification is
> to help application prepare for an expiry and setup a new session before the
> current one expires.

Understood, yes.

> The idea was borrowed from IPsec which has the
> 'RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY' flag defined. But I realize, it
> should be better defined. I can rename the flag to
> 'RTE_CRYPTO_OP_AUX_FLAGS_SEC_SOFT_EXPIRY' to avoid redefining same flag
> for each security offload. Do you agree to this suggestion?
>
> https://elixir.bootlin.com/dpdk/latest/source/lib/cryptodev/rte_crypto.h#L67

So we cannot "just rename" the flag, its an API break. It likely is possible to add an
additional #define with the same value as IPSEC_SOFT_EXPIRY, and call it SEC_SOFT_EXPIRY.
Is that the best/most descriptive name? SYM_ALG_SOFT_EXPIRY? I'm not sure here, input welcomed.

Perhaps we can improve the doc-string there, to explain what it means a bit more verbosely.

> Do note that once hard expiry is hit, the operation would fail. Expectation is,
> cryptodev would return 'RTE_CRYPTO_OP_STATUS_ERROR' in case of errors.

That is good.


> > > + */
> > > +struct rte_security_tls_record_lifetime {
> > > +	/** Soft expiry limit in number of packets */
> > > +	uint64_t packets_soft_limit;
> > > +	/** Hard expiry limit in number of packets */
> > > +	uint64_t packets_hard_limit;
> > > +};
> > > +
> > > +/**
> > > + * TLS record protocol session configuration.
> > > + *
> > > + * This structure contains data required to create a TLS record security
> > session.
> > > + */
> > > +struct rte_security_tls_record_xform {
> > > +	/** TLS record version. */
> > > +	enum rte_security_tls_version ver;
> > > +	/** TLS record session type. */
> > > +	enum rte_security_tls_sess_type type;
> > > +	/** TLS record session lifetime. */
> > > +	struct rte_security_tls_record_lifetime life;
> > > +	union {
> > > +		/** TLS 1.2 parameters. */
> > > +		struct {
> > > +			/** Starting sequence number. */
> > > +			uint64_t seq_no;
> > > +			/** Salt to be used for AEAD algos. */
> > > +			uint8_t salt[RTE_SECURITY_TLS_1_2_SALT_LEN];
> > > +		} tls_1_2;
> > > +
> > > +		/** TLS 1.3 parameters. */
> > > +		struct {
> > > +			/** Starting sequence number. */
> > > +			uint64_t seq_no;
> > > +			/** Salt to be used for AEAD algos. */
> > > +			uint8_t salt[RTE_SECURITY_TLS_1_3_SALT_LEN];
> > > +			/**
> > > +			 * Minimum payload length (in case of write
> > sessions).
> > > For shorter inputs,
> > > +			 * the payload would be padded appropriately before
> > > performing crypto
> >
> > Replace "would be"  with "must be"? And who must do this step, is it the
> > application?
> 
> [Anoob] Padding is performed by the PMD/cryptodev device. I'll change "would
> be" to "will be". Would that address your concern?

I suppose my concern is "is it clear to PMD authors that they must implement X in their PMD",
and to ensure we (DPDK community) do our best to clarify API demands, and to ensure future
contributions are of high quality too.

For example, could we have a security library unit-test that checks the padding case, to
ensure correct & consistent behaviour across different crypto PMDs?

Same thoughts for SOFT and HARD error variants, (although they might take... hours?) to execute.
But it is nice to automate-and-test these "corner cases".

It's not about wording, its about clarity between PMD devs, security library devs, and application facing APIs,
to ensure that DPDK provides the most/best help it can to provide correctness. Does that clarify what I'd like to see?

For this patchset, could we document a list of "caveats" when implementing PMD functionality for TLS-record security offload, and indicate that:
1) Padding must be added by the PMD based on security library flags& algo in use, not application layer (I know this is demanded by the sym algos anyway, but let's make it explicit)
2) It is strongly recommended to build unit-tests for _SOFT and _HARD error cases (potentially by "fast forwarding" the internal counters via private APIs to avoid hours of enc/decryption)

I think that limits scope-impact to this patchset, but is clear for PMD implementations in future what expectations are.
Thoughts, is that a good way forward?

> >
> > > +			 * transformations.
> > > +			 */
> > > +			uint32_t min_payload_len;
> > > +		} tls_1_3;
> > > +
> > > +		/** DTLS 1.2 parameters */
> > > +		struct {
> > > +			/** Epoch value to be used. */
> > > +			uint16_t epoch;
> > > +			/** 6B starting sequence number to be used. */
> > > +			uint64_t seq_no;
> > > +			/** Salt to be used for AEAD algos. */
> > > +			uint8_t salt[RTE_SECURITY_DTLS_1_2_SALT_LEN];
> > > +			/** Anti replay window size to enable sequence
> > replay
> > > attack handling.
> > > +			 * Anti replay check is disabled if the window size is 0.
> > > +			 */
> > > +			uint32_t ar_win_sz;
> > > +		} dtls_1_2;
> > > +	};
> > > +};
> > > +
> > >  /**
> > >   * Security session action type.
> > >   */
> > > @@ -654,6 +747,8 @@ enum rte_security_session_protocol {
> > >  	/**< PDCP Protocol */
> > >  	RTE_SECURITY_PROTOCOL_DOCSIS,
> > >  	/**< DOCSIS Protocol */
> > > +	RTE_SECURITY_PROTOCOL_TLS_RECORD,
> > > +	/**< TLS Record Protocol */
> > >  };
> > >
> > >  /**
> > > @@ -670,6 +765,7 @@ struct rte_security_session_conf {
> > >  		struct rte_security_macsec_xform macsec;
> > >  		struct rte_security_pdcp_xform pdcp;
> > >  		struct rte_security_docsis_xform docsis;
> > > +		struct rte_security_tls_record_xform tls;
> >
> > Do we see TLS handshake xform being added in future? If so, is 'tls' a good
> > name, perhaps 'tls_record'?
> > That would allow 'tls_handshake' in future, with consistent naming scheme
> > without API/ABI break.
> 
> [Anoob] In the future, I would like to see TLS handshake also offloaded in a
> similar manner. But that would need some fundamental changes in security
> library. Like, current security library is pretty much tied to symmetric
> operations but a handshake would involve both symmetric & asymmetric
> operations.
> 
> Said that, I agree with your suggestion to rename the field. Will change it to
> 'tls_record' in next version.

Agreed, that handshake is significantly more complex, thanks for rename to "tls_record".


> 
> >
> >
> > >  	};
> > >  	/**< Configuration parameters for security session */
> > >  	struct rte_crypto_sym_xform *crypto_xform; @@ -1190,6 +1286,16
> > @@
> > > struct rte_security_capability {
> > >  			/**< DOCSIS direction */
> > >  		} docsis;
> > >  		/**< DOCSIS capability */
> > > +		struct {
> > > +			enum rte_security_tls_version ver;
> > > +			/**< TLS record version. */
> > > +			enum rte_security_tls_sess_type type;
> > > +			/**< TLS record session type. */
> > > +			uint32_t ar_win_size;
> > > +			/**< Maximum anti replay window size supported
> > for
> > > DTLS 1.2 record read
> > > +			 * operation. Value of 0 means anti replay check is
> > not
> > > supported.
> > > +			 */
> > > +		} tls_record;
> >
> > Missing      /**< TLS Record Capability */     docstring here.
> 
> [Anoob] Agreed. Will add in next version.

Thanks!

<snip>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 0/5] bbdev: API extension for 23.11
                     ` (3 preceding siblings ...)
  2023-09-06  6:20  0% ` Hemant Agrawal
@ 2023-09-21  7:35  0% ` Maxime Coquelin
  4 siblings, 0 replies; 200+ results
From: Maxime Coquelin @ 2023-09-21  7:35 UTC (permalink / raw)
  To: Nicolas Chautru, dev; +Cc: trix, hemant.agrawal, david.marchand, hernan.vargas



On 6/15/23 18:48, Nicolas Chautru wrote:
> v2: moving the new mld functions at the end of struct rte_bbdev to avoid
> ABI offset changes based on feedback with Maxime.
> Adding a commit to waive the FFT ABI warning since that experimental function
> could break ABI (let me know if preferred to be merged with the FFT
> commit causing the FFT change).
> 
> 
> Including v1 for extending the bbdev api for 23.11.
> The new MLD-TS is expected to be non ABI compatible, the other ones
> should not break ABI.
> I will send a deprecation notice in parallel.
> 
> This introduces a new operation (on top of FEC and FFT) to support
> equalization for MLD-TS. There also more modular API extension for
> existing FFT and FEC operation.
> 
> Thanks
> Nic
> 
> 
> Nicolas Chautru (5):
>    bbdev: add operation type for MLDTS procession
>    bbdev: add new capabilities for FFT processing
>    bbdev: add new capability for FEC 5G UL processing
>    bbdev: improving error handling for queue configuration
>    devtools: ignore changes into bbdev experimental API
> 
>   devtools/libabigail.abignore    |   4 +-
>   doc/guides/prog_guide/bbdev.rst |  83 ++++++++++++++++++
>   lib/bbdev/rte_bbdev.c           |  26 +++---
>   lib/bbdev/rte_bbdev.h           |  76 +++++++++++++++++
>   lib/bbdev/rte_bbdev_op.h        | 143 +++++++++++++++++++++++++++++++-
>   lib/bbdev/version.map           |   5 ++
>   6 files changed, 323 insertions(+), 14 deletions(-)
> 

Applied to next-baseband/for-main.

Thanks,
Maxime


^ permalink raw reply	[relevance 0%]

* [PATCH v2 1/3] security: introduce out of place support for inline ingress
  @ 2023-09-21  2:15  4% ` Nithin Dabilpuram
  0 siblings, 0 replies; 200+ results
From: Nithin Dabilpuram @ 2023-09-21  2:15 UTC (permalink / raw)
  To: gakhil, Cristian Dumitrescu; +Cc: jerinj, dev, Nithin Dabilpuram

Similar to out of place(OOP) processing support that exists for
Lookaside crypto/security sessions, Inline ingress security
sessions may also need out of place processing in usecases
where original encrypted packet needs to be retained for post
processing. So for NIC's which have such a kind of HW support,
a new SA option is provided to indicate whether OOP needs to
be enabled on that Inline ingress security session or not.

Since for inline ingress sessions, packet is not received by
CPU until the processing is done, we can only have per-SA
option and not per-packet option like Lookaside sessions.

Also remove reserved_opts field from the rte_security_ipsec_sa_options
struct as mentioned in deprecation notice.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---

v2:
- Fix documentation issue in 1/3 and update release notes

v1:
- Removed reserved_opts field from sa_options struct

 doc/guides/rel_notes/deprecation.rst   |  5 ----
 doc/guides/rel_notes/release_23_11.rst |  8 ++++++
 lib/pipeline/rte_swx_ipsec.c           |  1 -
 lib/security/rte_security.c            | 17 +++++++++++
 lib/security/rte_security.h            | 40 ++++++++++++++++++++++----
 lib/security/rte_security_driver.h     |  8 ++++++
 lib/security/version.map               |  2 ++
 7 files changed, 69 insertions(+), 12 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index bcd02e7762..8311035f2d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -147,11 +147,6 @@ Deprecation Notices
 * security: Hide structures ``rte_security_ops`` and ``rte_security_ctx``
   as these are internal to DPDK library and drivers.
 
-* security: New SA option ``ingress_oop`` would be added in structure
-  ``rte_security_ipsec_sa_options`` to support out of place processing
-  for inline inbound SA from DPDK 23.11. ``reserved_opts`` field in the
-  same struct would be removed as discussed in techboard meeting.
-
 * eventdev: The single-event (non-burst) enqueue and dequeue operations,
   used by static inline burst enqueue and dequeue functions in ``rte_eventdev.h``,
   will be removed in DPDK 23.11.
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 55ba7c16ae..85d4a929b0 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -86,6 +86,10 @@ New Features
 
   Enabled support for QAT 2.0c (4944) devices in QAT crypto driver.
 
+* **Added out of place processing support for inline ingress security session.**
+
+  Similar to out of place processing support for lookaside security session, added
+  the same support for inline ingress security session.
 
 Removed Items
 -------------
@@ -109,6 +113,8 @@ Removed Items
   ``rte_crypto_auth_algorithm_strings``, ``rte_crypto_aead_algorithm_strings`` and
   ``rte_crypto_asym_xform_strings``.
 
+* security: Removed deprecated field ``reserved_opts`` from struct
+  ``rte_security_ipsec_sa_options``.
 
 API Changes
 -----------
@@ -141,6 +147,8 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* security: struct ``rte_security_ipsec_sa_options`` was updated due to inline
+  out-of-place feature addition.
 
 Known Issues
 ------------
diff --git a/lib/pipeline/rte_swx_ipsec.c b/lib/pipeline/rte_swx_ipsec.c
index 6c217ee797..28576c2a48 100644
--- a/lib/pipeline/rte_swx_ipsec.c
+++ b/lib/pipeline/rte_swx_ipsec.c
@@ -1555,7 +1555,6 @@ ipsec_xform_get(struct rte_swx_ipsec_sa_params *p,
 	ipsec_xform->options.ip_csum_enable = 0;
 	ipsec_xform->options.l4_csum_enable = 0;
 	ipsec_xform->options.ip_reassembly_en = 0;
-	ipsec_xform->options.reserved_opts = 0;
 
 	ipsec_xform->direction = p->encrypt ?
 		RTE_SECURITY_IPSEC_SA_DIR_EGRESS :
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index 2d729b735b..42af4a2c35 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -27,7 +27,10 @@
 } while (0)
 
 #define RTE_SECURITY_DYNFIELD_NAME "rte_security_dynfield_metadata"
+#define RTE_SECURITY_OOP_DYNFIELD_NAME "rte_security_oop_dynfield_metadata"
+
 int rte_security_dynfield_offset = -1;
+int rte_security_oop_dynfield_offset = -1;
 
 int
 rte_security_dynfield_register(void)
@@ -42,6 +45,20 @@ rte_security_dynfield_register(void)
 	return rte_security_dynfield_offset;
 }
 
+int
+rte_security_oop_dynfield_register(void)
+{
+	static const struct rte_mbuf_dynfield dynfield_desc = {
+		.name = RTE_SECURITY_OOP_DYNFIELD_NAME,
+		.size = sizeof(rte_security_oop_dynfield_t),
+		.align = __alignof__(rte_security_oop_dynfield_t),
+	};
+
+	rte_security_oop_dynfield_offset =
+		rte_mbuf_dynfield_register(&dynfield_desc);
+	return rte_security_oop_dynfield_offset;
+}
+
 void *
 rte_security_session_create(struct rte_security_ctx *instance,
 			    struct rte_security_session_conf *conf,
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 439bbb957f..da58fe1f14 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -273,14 +273,16 @@ struct rte_security_ipsec_sa_options {
 	 */
 	uint32_t ip_reassembly_en : 1;
 
-	/** Reserved bit fields for future extension
+	/** Enable out of place processing on inline inbound packets.
 	 *
-	 * User should ensure reserved_opts is cleared as it may change in
-	 * subsequent releases to support new options.
-	 *
-	 * Note: Reduce number of bits in reserved_opts for every new option.
+	 * * 1: Enable driver to perform Out-of-place(OOP) processing for this inline
+	 *      inbound SA if supported by driver. PMD need to register mbuf
+	 *      dynamic field using rte_security_oop_dynfield_register()
+	 *      and security session creation would fail if dynfield is not
+	 *      registered successfully.
+	 * * 0: Disable OOP processing for this session (default).
 	 */
-	uint32_t reserved_opts : 17;
+	uint32_t ingress_oop : 1;
 };
 
 /** IPSec security association direction */
@@ -825,6 +827,13 @@ typedef uint64_t rte_security_dynfield_t;
 /** Dynamic mbuf field for device-specific metadata */
 extern int rte_security_dynfield_offset;
 
+/** Out-of-Place(OOP) processing field type */
+typedef struct rte_mbuf *rte_security_oop_dynfield_t;
+/** Dynamic mbuf field for pointer to original mbuf for
+ * OOP processing session.
+ */
+extern int rte_security_oop_dynfield_offset;
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice
@@ -847,6 +856,25 @@ rte_security_dynfield(struct rte_mbuf *mbuf)
 		rte_security_dynfield_t *);
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
+ * Get pointer to mbuf field for original mbuf pointer when
+ * Out-Of-Place(OOP) processing is enabled in security session.
+ *
+ * @param       mbuf    packet to access
+ * @return pointer to mbuf field
+ */
+__rte_experimental
+static inline rte_security_oop_dynfield_t *
+rte_security_oop_dynfield(struct rte_mbuf *mbuf)
+{
+	return RTE_MBUF_DYNFIELD(mbuf,
+			rte_security_oop_dynfield_offset,
+			rte_security_oop_dynfield_t *);
+}
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice
diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h
index 31444a05d3..1e6a6ef8e3 100644
--- a/lib/security/rte_security_driver.h
+++ b/lib/security/rte_security_driver.h
@@ -197,6 +197,14 @@ typedef int (*security_macsec_sa_stats_get_t)(void *device, uint16_t sa_id,
 __rte_internal
 int rte_security_dynfield_register(void);
 
+/**
+ * @internal
+ * Register mbuf dynamic field for security inline ingress Out-of-Place(OOP)
+ * processing.
+ */
+__rte_internal
+int rte_security_oop_dynfield_register(void);
+
 /**
  * Update the mbuf with provided metadata.
  *
diff --git a/lib/security/version.map b/lib/security/version.map
index b2097a969d..86f976a302 100644
--- a/lib/security/version.map
+++ b/lib/security/version.map
@@ -23,10 +23,12 @@ EXPERIMENTAL {
 	rte_security_macsec_sc_stats_get;
 	rte_security_session_stats_get;
 	rte_security_session_update;
+	rte_security_oop_dynfield_offset;
 };
 
 INTERNAL {
 	global:
 
 	rte_security_dynfield_register;
+	rte_security_oop_dynfield_register;
 };
-- 
2.25.1


^ permalink raw reply	[relevance 4%]

* Re: [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm
  2023-09-08  8:00  4%       ` [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-09-20 16:39  3%         ` Ferruh Yigit
  2023-09-26 13:23  0%           ` Jie Hai
  0 siblings, 1 reply; 200+ results
From: Ferruh Yigit @ 2023-09-20 16:39 UTC (permalink / raw)
  To: Jie Hai, dev, Thomas Monjalon, Andrew Rybchenko, Ori Kam; +Cc: lihuisong

On 9/8/2023 9:00 AM, Jie Hai wrote:
> Currently, rte_eth_rss_conf supports configuring and querying
> RSS hash functions, rss key and it's length, but not RSS hash
> algorithm.
> 
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "func". This represents the RSS algorithms to apply. The
> following API will be affected:
> 	- rte_eth_dev_configure
> 	- rte_eth_dev_rss_hash_update
> 	- rte_eth_dev_rss_hash_conf_get
> 

The problem with adding new configuration fields is, none of the drivers
are using it.

I can see you are updating hns3 driver in next patch, but what about
others, application will set this field and almost all drivers will
ignore it for now.
And in near future, some will be supporting it and some won't, still
frustrating for the application perspective.

In the past I was gathering list of these items and follow
implementation of them with drivers, but as the number of drivers
increased this became very hard to manage.

Another way to manage this is go and update all drivers, and if the
configuration requests anything other than
'RTE_ETH_HASH_FUNCTION_DEFAULT', return error. So that application can
know this is not supported by this driver.
Do you have better solution for this?


> If the value of "func" used for configuration is a gibberish
> value, report the error and return. Do the same for
> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
> 
> To check whether the drivers report the "func" field, it is set
> to default value before querying.
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
>  doc/guides/rel_notes/release_23_11.rst |  2 ++
>  lib/ethdev/rte_ethdev.c                | 17 +++++++++++++++++
>  lib/ethdev/rte_ethdev.h                | 21 +++++++++++++++++++++
>  lib/ethdev/rte_flow.c                  |  1 -
>  lib/ethdev/rte_flow.h                  | 22 ++--------------------
>  5 files changed, 42 insertions(+), 21 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index 333e1d95a283..deb019fbe4c1 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -129,6 +129,8 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
>  
> +* ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
> +  algorithm.
>  
>  Known Issues
>  ------------
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 0840d2b5942a..4cbcdb344cac 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -1445,6 +1445,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>  		goto rollback;
>  	}
>  
> +	if (dev_conf->rx_adv_conf.rss_conf.func >= RTE_ETH_HASH_FUNCTION_MAX) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u invalid rss hash function (%u)\n",
> +			port_id, dev_conf->rx_adv_conf.rss_conf.func);
> +		ret = -EINVAL;
> +		goto rollback;
> +	}
> +
>  	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
>  	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
>  	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
> @@ -4630,6 +4638,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
>  		return -ENOTSUP;
>  	}
>  
> +	if (rss_conf->func >= RTE_ETH_HASH_FUNCTION_MAX) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u invalid rss hash function (%u)\n",
> +			port_id, rss_conf->func);
> +		return -EINVAL;
> +	}
> +
>  	if (*dev->dev_ops->rss_hash_update == NULL)
>  		return -ENOTSUP;
>  	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
> @@ -4657,6 +4672,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
>  		return -EINVAL;
>  	}
>  
> +	rss_conf->func = RTE_ETH_HASH_FUNCTION_DEFAULT;
> +
>

I think setting this in ethdev level is not required if you update all
drivers to not accept anything other than DEFAULT.


>  	if (*dev->dev_ops->rss_hash_conf_get == NULL)
>  		return -ENOTSUP;
>  	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 40cfbb7efddd..33cec3570f85 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -445,6 +445,26 @@ struct rte_vlan_filter_conf {
>  	uint64_t ids[64];
>  };
>  
> +/**
> + * Hash function types.
> + */
> +enum rte_eth_hash_function {
> +	/**
> +	 * DEFAULT means that conformance to a specific hash algorithm is
> +	 * uncared to the caller. The driver can pick the one it deems optimal.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
> +	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
> +	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
> +	/**
> +	 * Symmetric Toeplitz: src, dst will be replaced by
> +	 * xor(src, dst). For the case with src/dst only,
> +	 * src or dst address will xor with zero pair.
> +	 */
> +	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> +	RTE_ETH_HASH_FUNCTION_MAX,

As we are moving this to ethdev.h, when we want to add a new algorithm,
it will cause ABI break because of the 'RTE_ETH_HASH_FUNCTION_MAX', and
it will need to wait. Is there a way to eliminate this MAX enum?

> +};
> +
>  /**
>   * A structure used to configure the Receive Side Scaling (RSS) feature
>   * of an Ethernet port.
> @@ -464,6 +484,7 @@ struct rte_eth_rss_conf {
>  	 * Supplying an *rss_hf* equal to zero disables the RSS feature.
>  	 */
>  	uint64_t rss_hf;
> +	enum rte_eth_hash_function func;	/**< Hash algorithm. */

Can we use 'algorithm' as the field name?

I know it won't exactly match type name (rte_eth_hash_function) but I
think this will be more accurate also less confusing for "rss_hf (rss
hash function)" and "func (function)"?

>  };
>  
>  /*
> diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
> index 271d854f7807..d3f2d466d841 100644
> --- a/lib/ethdev/rte_flow.c
> +++ b/lib/ethdev/rte_flow.c
> @@ -12,7 +12,6 @@
>  #include <rte_branch_prediction.h>
>  #include <rte_string_fns.h>
>  #include <rte_mbuf_dyn.h>
> -#include "rte_ethdev.h"
>  #include "rte_flow_driver.h"
>  #include "rte_flow.h"
>  
> diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
> index 3bd0dc64fbe2..a7578b1d2eff 100644
> --- a/lib/ethdev/rte_flow.h
> +++ b/lib/ethdev/rte_flow.h
> @@ -40,6 +40,8 @@
>  #include <rte_macsec.h>
>  #include <rte_ib.h>
>  
> +#include "rte_ethdev.h"
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> @@ -3183,26 +3185,6 @@ struct rte_flow_query_count {
>  	uint64_t bytes; /**< Number of bytes through this rule [out]. */
>  };
>  
> -/**
> - * Hash function types.
> - */
> -enum rte_eth_hash_function {
> -	/**
> -	 * DEFAULT means that conformance to a specific hash algorithm is
> -	 * uncared to the caller. The driver can pick the one it deems optimal.
> -	 */
> -	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
> -	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
> -	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
> -	/**
> -	 * Symmetric Toeplitz: src, dst will be replaced by
> -	 * xor(src, dst). For the case with src/dst only,
> -	 * src or dst address will xor with zero pair.
> -	 */
> -	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
> -	RTE_ETH_HASH_FUNCTION_MAX,
> -};
> -
>  /**
>   * RTE_FLOW_ACTION_TYPE_RSS
>   *


^ permalink raw reply	[relevance 3%]

* RE: [RFC PATCH 2/3] security: add TLS record processing
  2023-09-20  9:23  3%   ` Van Haaren, Harry
@ 2023-09-20 11:51  0%     ` Anoob Joseph
  2023-09-21  8:38  0%       ` Van Haaren, Harry
  0 siblings, 1 reply; 200+ results
From: Anoob Joseph @ 2023-09-20 11:51 UTC (permalink / raw)
  To: Van Haaren, Harry
  Cc: Hemant Agrawal, dev, Matz, Olivier, Vidya Sagar Velumuri,
	Thomas Monjalon, Akhil Goyal, Jerin Jacob Kollanukkaran,
	Konstantin Ananyev

Hi Harry,

Thanks for the review. Please see inline.

Thanks,
Anoob

> -----Original Message-----
> From: Van Haaren, Harry <harry.van.haaren@intel.com>
> Sent: Wednesday, September 20, 2023 2:53 PM
> To: Anoob Joseph <anoobj@marvell.com>; Thomas Monjalon
> <thomas@monjalon.net>; Akhil Goyal <gakhil@marvell.com>; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> <vvelumuri@marvell.com>
> Subject: [EXT] RE: [RFC PATCH 2/3] security: add TLS record processing
> 
> External Email
> 
> ----------------------------------------------------------------------
> > -----Original Message-----
> > From: Anoob Joseph <anoobj@marvell.com>
> > Sent: Friday, August 11, 2023 8:17 AM
> > To: Thomas Monjalon <thomas@monjalon.net>; Akhil Goyal
> > <gakhil@marvell.com>; Jerin Jacob <jerinj@marvell.com>; Konstantin
> > Ananyev <konstantin.v.ananyev@yandex.ru>
> > Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> > Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> > <vvelumuri@marvell.com>
> > Subject: [RFC PATCH 2/3] security: add TLS record processing
> >
> > Add Transport Layer Security (TLS) and Datagram Transport Layer
> > Security (DTLS). The protocols provide communications privacy for L4
> > protocols such as TCP & UDP.
> >
> > TLS (and DTLS) protocol is composed of two layers, 1. TLS Record
> > Protocol 2. TLS Handshake Protocol
> >
> > While TLS Handshake Protocol helps in establishing security parameters
> > by which client and server can communicate, TLS Record Protocol
> > provides the connection security. TLS Record Protocol leverages
> > symmetric cryptographic operations such as data encryption and
> > authentication for providing security to the communications.
> >
> > Cryptodevs that are capable of offloading TLS Record Protocol may
> > perform other operations like IV generation, header insertion, atomic
> > sequence number updates and anti-replay window check in addition to
> > cryptographic transformations.
> >
> > The support is added for TLS 1.2, TLS 1.3 and DTLS 1.2.
> 
> From the code below, my understanding is that *ONLY* the record layer is
> being added/supported? The difference is described well above, but the
> intended support added is not clearly defined.
> 
> Suggest reword the last line to clarify:
> "Support for TLS record protocol is added for TLS 1.2, TLS 1.3 and DTLS 1.2."

[Anoob] Indeed. Will reword as suggested.

> 
> 
> > Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
> > ---
> >  doc/guides/prog_guide/rte_security.rst |  58 +++++++++++++
> >  lib/security/rte_security.c            |   4 +
> >  lib/security/rte_security.h            | 110 +++++++++++++++++++++++++
> >  3 files changed, 172 insertions(+)
> >
> > diff --git a/doc/guides/prog_guide/rte_security.rst
> > b/doc/guides/prog_guide/rte_security.rst
> > index 7418e35c1b..7716d7239f 100644
> > --- a/doc/guides/prog_guide/rte_security.rst
> > +++ b/doc/guides/prog_guide/rte_security.rst
> > @@ -399,6 +399,64 @@ The API ``rte_security_macsec_sc_create`` returns
> > a handle for SC,  and this handle is set in
> > ``rte_security_macsec_xform``  to create a MACsec session using
> > ``rte_security_session_create``.
> >
> > +TLS-Record Protocol
> > +~~~~~~~~~~~~~~~~~~~
> > +
> > +The Transport Layer Protocol provides communications security over
> > +the
> > Internet. The protocol
> > +allows client/server applications to communicate in a way that is
> > +designed to
> > prevent eavesdropping,
> > +tampering, or message forgery.
> > +
> > +TLS protocol is composed of two layers: the TLS Record Protocol and
> > +the TLS
> > Handshake Protocol. At
> > +the lowest level, layered on top of some reliable transport protocol
> > +(e.g., TCP),
> > is the TLS Record
> > +Protocol. The TLS Record Protocol provides connection security that
> > +has two
> > basic properties:
> > +
> > +   -  The connection is private.  Symmetric cryptography is used for data
> > +      encryption (e.g., AES, DES, etc.).  The keys for this symmetric
> encryption
> > +      are generated uniquely for each connection and are based on a secret
> > +      negotiated by another protocol (such as the TLS Handshake Protocol).
> The
> > +      Record Protocol can also be used without encryption.
> > +
> > +   -  The connection is reliable.  Message transport includes a message
> > +      integrity check using a keyed MAC.  Secure hash functions (e.g.,
> > +      SHA-1, etc.) are used for MAC computations.  The Record Protocol
> > +      can operate without a MAC, but is generally only used in this mode
> > +      while another protocol is using the Record Protocol as a transport
> > +      for negotiating security parameters.
> > +
> > +.. code-block:: c
> 
> The code block below isn't C? Is there a better code block type for a text
> diagram?

[Anoob] Valid point. I was just following the general scheme followed in this file. May be, I'll introduce a .svg image for newly added code.

> 
> > +             Record Write                   Record Read
> > +             ------------                   -----------
> > +
> > +             TLSPlaintext                  TLSCiphertext
> > +                  |                              |
> > +                  ~                              ~
> > +                  |                              |
> > +                  V                              V
> > +        +---------|----------+        +----------|---------+
> > +        | Seq. no generation |        | Seq. no generation |
> > +        +---------|----------+        +----------|---------+
> > +                  |                              |
> > +        +---------|----------+        +----------|---------+
> > +        |  Header insertion  |        |    Decryption &    |
> > +        +---------|----------+        |  MAC verification  |
> > +                  |                   +----------|---------+
> > +        +---------|----------+                   |
> > +        |  MAC generation &  |        +----------|---------+
> > +        |     Encryption     |        | TLS Header removal |
> > +        +---------|----------+        +----------|---------+
> > +                  |                              |
> > +                  ~                              ~
> > +                  |                              |
> > +                  V                              V
> > +            TLSCiphertext                  TLSPlaintext
> > +
> > +Supported Versions
> > +^^^^^^^^^^^^^^^^^^
> > +
> > +* TLS 1.2
> > +* TLS 1.3
> > +* DTLS 1.2
> >
> >  Device Features and Capabilities
> >  ---------------------------------
> > diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
> > index c4d64bb8e9..bd7b026547 100644
> > --- a/lib/security/rte_security.c
> > +++ b/lib/security/rte_security.c
> > @@ -282,6 +282,10 @@ rte_security_capability_get(struct
> > rte_security_ctx *instance,
> >  				if (capability->docsis.direction ==
> >  							idx->docsis.direction)
> >  					return capability;
> > +			} else if (idx->protocol ==
> > RTE_SECURITY_PROTOCOL_TLS_RECORD) {
> > +				if (capability->tls_record.ver == idx-
> > >tls_record.ver &&
> > +				    capability->tls_record.type == idx-
> > >tls_record.type)
> > +					return capability;
> >  			}
> >  		}
> >  	}
> > diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> > index 3b2df526ba..b9d064ed84 100644
> > --- a/lib/security/rte_security.h
> > +++ b/lib/security/rte_security.h
> > @@ -620,6 +620,99 @@ struct rte_security_docsis_xform {
> >  	/**< DOCSIS direction */
> >  };
> >
> > +/** Salt len to be used with AEAD algos in TLS 1.2 */ #define
> > +RTE_SECURITY_TLS_1_2_SALT_LEN 4
> > +/** Salt len to be used with AEAD algos in TLS 1.3 */ #define
> > +RTE_SECURITY_TLS_1_3_SALT_LEN 12
> > +/** Salt len to be used with AEAD algos in DTLS 1.2 */ #define
> > +RTE_SECURITY_DTLS_1_2_SALT_LEN 4
> > +
> > +/** TLS version */
> > +enum rte_security_tls_version {
> > +	RTE_SECURITY_VERSION_TLS_1_2,	/**< TLS 1.2 */
> > +	RTE_SECURITY_VERSION_TLS_1_3,	/**< TLS 1.3 */
> > +	RTE_SECURITY_VERSION_DTLS_1_2,	/**< DTLS 1.2 */
> > +};
> > +
> > +/** TLS session type */
> > +enum rte_security_tls_sess_type {
> > +	/** Record read session
> > +	 * - Decrypt & digest verification.
> > +	 */
> > +	RTE_SECURITY_TLS_SESS_TYPE_READ,
> > +	/** Record write session
> > +	 * - Encrypt & digest generation.
> > +	 */
> > +	RTE_SECURITY_TLS_SESS_TYPE_WRITE,
> > +};
> > +
> > +/**
> > + * Configure soft and hard lifetime of a TLS record session
> > + *
> > + * Lifetime of a TLS record session would specify the maximum number
> > +of
> > packets that can be
> > + * processed. TLS record processing operations would start failing
> > + once hard
> > limit is reached.
> > + *
> > + * Soft limits can be specified to generate notification when the TLS
> > + record
> > session is approaching
> > + * hard limits for lifetime. This would result in a warning returned
> > + in
> > ``rte_crypto_op.aux_flags``.
> 
> Can we define "a warning" better? Perhaps an example of a soft-limit and
> hard-limit, what the user can check aux_flags for, to identify? Or link to the
> appropriate part of the crypto_op.aux_flags documentation to help the user.
> 

[Anoob] The concept of lifetime is present in most protocols. Idea is to limit the max number of operations performed with a session. Soft expiry notification is to help application prepare for an expiry and setup a new session before the current one expires. The idea was borrowed from IPsec which has the  'RTE_CRYPTO_OP_AUX_FLAGS_IPSEC_SOFT_EXPIRY' flag defined. But I realize, it should be better defined. I can rename the flag to 'RTE_CRYPTO_OP_AUX_FLAGS_SEC_SOFT_EXPIRY' to avoid redefining same flag for each security offload. Do you agree to this suggestion?

https://elixir.bootlin.com/dpdk/latest/source/lib/cryptodev/rte_crypto.h#L67

Do note that once hard expiry is hit, the operation would fail. Expectation is, cryptodev would return 'RTE_CRYPTO_OP_STATUS_ERROR' in case of errors.

> > + */
> > +struct rte_security_tls_record_lifetime {
> > +	/** Soft expiry limit in number of packets */
> > +	uint64_t packets_soft_limit;
> > +	/** Hard expiry limit in number of packets */
> > +	uint64_t packets_hard_limit;
> > +};
> > +
> > +/**
> > + * TLS record protocol session configuration.
> > + *
> > + * This structure contains data required to create a TLS record security
> session.
> > + */
> > +struct rte_security_tls_record_xform {
> > +	/** TLS record version. */
> > +	enum rte_security_tls_version ver;
> > +	/** TLS record session type. */
> > +	enum rte_security_tls_sess_type type;
> > +	/** TLS record session lifetime. */
> > +	struct rte_security_tls_record_lifetime life;
> > +	union {
> > +		/** TLS 1.2 parameters. */
> > +		struct {
> > +			/** Starting sequence number. */
> > +			uint64_t seq_no;
> > +			/** Salt to be used for AEAD algos. */
> > +			uint8_t salt[RTE_SECURITY_TLS_1_2_SALT_LEN];
> > +		} tls_1_2;
> > +
> > +		/** TLS 1.3 parameters. */
> > +		struct {
> > +			/** Starting sequence number. */
> > +			uint64_t seq_no;
> > +			/** Salt to be used for AEAD algos. */
> > +			uint8_t salt[RTE_SECURITY_TLS_1_3_SALT_LEN];
> > +			/**
> > +			 * Minimum payload length (in case of write
> sessions).
> > For shorter inputs,
> > +			 * the payload would be padded appropriately before
> > performing crypto
> 
> Replace "would be"  with "must be"? And who must do this step, is it the
> application?

[Anoob] Padding is performed by the PMD/cryptodev device. I'll change "would be" to "will be". Would that address your concern?

> 
> > +			 * transformations.
> > +			 */
> > +			uint32_t min_payload_len;
> > +		} tls_1_3;
> > +
> > +		/** DTLS 1.2 parameters */
> > +		struct {
> > +			/** Epoch value to be used. */
> > +			uint16_t epoch;
> > +			/** 6B starting sequence number to be used. */
> > +			uint64_t seq_no;
> > +			/** Salt to be used for AEAD algos. */
> > +			uint8_t salt[RTE_SECURITY_DTLS_1_2_SALT_LEN];
> > +			/** Anti replay window size to enable sequence
> replay
> > attack handling.
> > +			 * Anti replay check is disabled if the window size is 0.
> > +			 */
> > +			uint32_t ar_win_sz;
> > +		} dtls_1_2;
> > +	};
> > +};
> > +
> >  /**
> >   * Security session action type.
> >   */
> > @@ -654,6 +747,8 @@ enum rte_security_session_protocol {
> >  	/**< PDCP Protocol */
> >  	RTE_SECURITY_PROTOCOL_DOCSIS,
> >  	/**< DOCSIS Protocol */
> > +	RTE_SECURITY_PROTOCOL_TLS_RECORD,
> > +	/**< TLS Record Protocol */
> >  };
> >
> >  /**
> > @@ -670,6 +765,7 @@ struct rte_security_session_conf {
> >  		struct rte_security_macsec_xform macsec;
> >  		struct rte_security_pdcp_xform pdcp;
> >  		struct rte_security_docsis_xform docsis;
> > +		struct rte_security_tls_record_xform tls;
> 
> Do we see TLS handshake xform being added in future? If so, is 'tls' a good
> name, perhaps 'tls_record'?
> That would allow 'tls_handshake' in future, with consistent naming scheme
> without API/ABI break.

[Anoob] In the future, I would like to see TLS handshake also offloaded in a similar manner. But that would need some fundamental changes in security library. Like, current security library is pretty much tied to symmetric operations but a handshake would involve both symmetric & asymmetric operations.

Said that, I agree with your suggestion to rename the field. Will change it to 'tls_record' in next version.

> 
> 
> >  	};
> >  	/**< Configuration parameters for security session */
> >  	struct rte_crypto_sym_xform *crypto_xform; @@ -1190,6 +1286,16
> @@
> > struct rte_security_capability {
> >  			/**< DOCSIS direction */
> >  		} docsis;
> >  		/**< DOCSIS capability */
> > +		struct {
> > +			enum rte_security_tls_version ver;
> > +			/**< TLS record version. */
> > +			enum rte_security_tls_sess_type type;
> > +			/**< TLS record session type. */
> > +			uint32_t ar_win_size;
> > +			/**< Maximum anti replay window size supported
> for
> > DTLS 1.2 record read
> > +			 * operation. Value of 0 means anti replay check is
> not
> > supported.
> > +			 */
> > +		} tls_record;
> 
> Missing      /**< TLS Record Capability */     docstring here.

[Anoob] Agreed. Will add in next version.

> 
> >  	};
> >
> >  	const struct rte_cryptodev_capabilities *crypto_capabilities; @@
> > -1251,6 +1357,10 @@ struct rte_security_capability_idx {
> >  		struct {
> >  			enum rte_security_docsis_direction direction;
> >  		} docsis;
> > +		struct {
> > +			enum rte_security_tls_version ver;
> > +			enum rte_security_tls_sess_type type;
> > +		} tls_record;
> >  	};
> >  };
> >
> > --
> > 2.25.1


^ permalink raw reply	[relevance 0%]

* RE: [RFC PATCH 2/3] security: add TLS record processing
  @ 2023-09-20  9:23  3%   ` Van Haaren, Harry
  2023-09-20 11:51  0%     ` Anoob Joseph
  0 siblings, 1 reply; 200+ results
From: Van Haaren, Harry @ 2023-09-20  9:23 UTC (permalink / raw)
  To: Anoob Joseph, Thomas Monjalon, Akhil Goyal, Jerin Jacob,
	Konstantin Ananyev
  Cc: Hemant Agrawal, dev, Matz, Olivier, Vidya Sagar Velumuri

> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Friday, August 11, 2023 8:17 AM
> To: Thomas Monjalon <thomas@monjalon.net>; Akhil Goyal
> <gakhil@marvell.com>; Jerin Jacob <jerinj@marvell.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>
> Cc: Hemant Agrawal <hemant.agrawal@nxp.com>; dev@dpdk.org; Matz,
> Olivier <olivier.matz@6wind.com>; Vidya Sagar Velumuri
> <vvelumuri@marvell.com>
> Subject: [RFC PATCH 2/3] security: add TLS record processing
> 
> Add Transport Layer Security (TLS) and Datagram Transport Layer Security
> (DTLS). The protocols provide communications privacy for L4 protocols
> such as TCP & UDP.
> 
> TLS (and DTLS) protocol is composed of two layers,
> 1. TLS Record Protocol
> 2. TLS Handshake Protocol
> 
> While TLS Handshake Protocol helps in establishing security parameters
> by which client and server can communicate, TLS Record Protocol provides
> the connection security. TLS Record Protocol leverages symmetric
> cryptographic operations such as data encryption and authentication for
> providing security to the communications.
> 
> Cryptodevs that are capable of offloading TLS Record Protocol may
> perform other operations like IV generation, header insertion, atomic
> sequence number updates and anti-replay window check in addition to
> cryptographic transformations.
> 
> The support is added for TLS 1.2, TLS 1.3 and DTLS 1.2.

From the code below, my understanding is that *ONLY* the record layer is being
added/supported? The difference is described well above, but the intended
support added is not clearly defined.

Suggest reword the last line to clarify:
"Support for TLS record protocol is added for TLS 1.2, TLS 1.3 and DTLS 1.2."

 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Signed-off-by: Vidya Sagar Velumuri <vvelumuri@marvell.com>
> ---
>  doc/guides/prog_guide/rte_security.rst |  58 +++++++++++++
>  lib/security/rte_security.c            |   4 +
>  lib/security/rte_security.h            | 110 +++++++++++++++++++++++++
>  3 files changed, 172 insertions(+)
> 
> diff --git a/doc/guides/prog_guide/rte_security.rst
> b/doc/guides/prog_guide/rte_security.rst
> index 7418e35c1b..7716d7239f 100644
> --- a/doc/guides/prog_guide/rte_security.rst
> +++ b/doc/guides/prog_guide/rte_security.rst
> @@ -399,6 +399,64 @@ The API ``rte_security_macsec_sc_create`` returns a
> handle for SC,
>  and this handle is set in ``rte_security_macsec_xform``
>  to create a MACsec session using ``rte_security_session_create``.
> 
> +TLS-Record Protocol
> +~~~~~~~~~~~~~~~~~~~
> +
> +The Transport Layer Protocol provides communications security over the
> Internet. The protocol
> +allows client/server applications to communicate in a way that is designed to
> prevent eavesdropping,
> +tampering, or message forgery.
> +
> +TLS protocol is composed of two layers: the TLS Record Protocol and the TLS
> Handshake Protocol. At
> +the lowest level, layered on top of some reliable transport protocol (e.g., TCP),
> is the TLS Record
> +Protocol. The TLS Record Protocol provides connection security that has two
> basic properties:
> +
> +   -  The connection is private.  Symmetric cryptography is used for data
> +      encryption (e.g., AES, DES, etc.).  The keys for this symmetric encryption
> +      are generated uniquely for each connection and are based on a secret
> +      negotiated by another protocol (such as the TLS Handshake Protocol). The
> +      Record Protocol can also be used without encryption.
> +
> +   -  The connection is reliable.  Message transport includes a message
> +      integrity check using a keyed MAC.  Secure hash functions (e.g.,
> +      SHA-1, etc.) are used for MAC computations.  The Record Protocol
> +      can operate without a MAC, but is generally only used in this mode
> +      while another protocol is using the Record Protocol as a transport
> +      for negotiating security parameters.
> +
> +.. code-block:: c

The code block below isn't C? Is there a better code block type for a text diagram?

> +             Record Write                   Record Read
> +             ------------                   -----------
> +
> +             TLSPlaintext                  TLSCiphertext
> +                  |                              |
> +                  ~                              ~
> +                  |                              |
> +                  V                              V
> +        +---------|----------+        +----------|---------+
> +        | Seq. no generation |        | Seq. no generation |
> +        +---------|----------+        +----------|---------+
> +                  |                              |
> +        +---------|----------+        +----------|---------+
> +        |  Header insertion  |        |    Decryption &    |
> +        +---------|----------+        |  MAC verification  |
> +                  |                   +----------|---------+
> +        +---------|----------+                   |
> +        |  MAC generation &  |        +----------|---------+
> +        |     Encryption     |        | TLS Header removal |
> +        +---------|----------+        +----------|---------+
> +                  |                              |
> +                  ~                              ~
> +                  |                              |
> +                  V                              V
> +            TLSCiphertext                  TLSPlaintext
> +
> +Supported Versions
> +^^^^^^^^^^^^^^^^^^
> +
> +* TLS 1.2
> +* TLS 1.3
> +* DTLS 1.2
> 
>  Device Features and Capabilities
>  ---------------------------------
> diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
> index c4d64bb8e9..bd7b026547 100644
> --- a/lib/security/rte_security.c
> +++ b/lib/security/rte_security.c
> @@ -282,6 +282,10 @@ rte_security_capability_get(struct rte_security_ctx
> *instance,
>  				if (capability->docsis.direction ==
>  							idx->docsis.direction)
>  					return capability;
> +			} else if (idx->protocol ==
> RTE_SECURITY_PROTOCOL_TLS_RECORD) {
> +				if (capability->tls_record.ver == idx-
> >tls_record.ver &&
> +				    capability->tls_record.type == idx-
> >tls_record.type)
> +					return capability;
>  			}
>  		}
>  	}
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 3b2df526ba..b9d064ed84 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -620,6 +620,99 @@ struct rte_security_docsis_xform {
>  	/**< DOCSIS direction */
>  };
> 
> +/** Salt len to be used with AEAD algos in TLS 1.2 */
> +#define RTE_SECURITY_TLS_1_2_SALT_LEN 4
> +/** Salt len to be used with AEAD algos in TLS 1.3 */
> +#define RTE_SECURITY_TLS_1_3_SALT_LEN 12
> +/** Salt len to be used with AEAD algos in DTLS 1.2 */
> +#define RTE_SECURITY_DTLS_1_2_SALT_LEN 4
> +
> +/** TLS version */
> +enum rte_security_tls_version {
> +	RTE_SECURITY_VERSION_TLS_1_2,	/**< TLS 1.2 */
> +	RTE_SECURITY_VERSION_TLS_1_3,	/**< TLS 1.3 */
> +	RTE_SECURITY_VERSION_DTLS_1_2,	/**< DTLS 1.2 */
> +};
> +
> +/** TLS session type */
> +enum rte_security_tls_sess_type {
> +	/** Record read session
> +	 * - Decrypt & digest verification.
> +	 */
> +	RTE_SECURITY_TLS_SESS_TYPE_READ,
> +	/** Record write session
> +	 * - Encrypt & digest generation.
> +	 */
> +	RTE_SECURITY_TLS_SESS_TYPE_WRITE,
> +};
> +
> +/**
> + * Configure soft and hard lifetime of a TLS record session
> + *
> + * Lifetime of a TLS record session would specify the maximum number of
> packets that can be
> + * processed. TLS record processing operations would start failing once hard
> limit is reached.
> + *
> + * Soft limits can be specified to generate notification when the TLS record
> session is approaching
> + * hard limits for lifetime. This would result in a warning returned in
> ``rte_crypto_op.aux_flags``.

Can we define "a warning" better? Perhaps an example of a soft-limit and
hard-limit, what the user can check aux_flags for, to identify? Or link to the
appropriate part of the crypto_op.aux_flags documentation to help the user.

> + */
> +struct rte_security_tls_record_lifetime {
> +	/** Soft expiry limit in number of packets */
> +	uint64_t packets_soft_limit;
> +	/** Hard expiry limit in number of packets */
> +	uint64_t packets_hard_limit;
> +};
> +
> +/**
> + * TLS record protocol session configuration.
> + *
> + * This structure contains data required to create a TLS record security session.
> + */
> +struct rte_security_tls_record_xform {
> +	/** TLS record version. */
> +	enum rte_security_tls_version ver;
> +	/** TLS record session type. */
> +	enum rte_security_tls_sess_type type;
> +	/** TLS record session lifetime. */
> +	struct rte_security_tls_record_lifetime life;
> +	union {
> +		/** TLS 1.2 parameters. */
> +		struct {
> +			/** Starting sequence number. */
> +			uint64_t seq_no;
> +			/** Salt to be used for AEAD algos. */
> +			uint8_t salt[RTE_SECURITY_TLS_1_2_SALT_LEN];
> +		} tls_1_2;
> +
> +		/** TLS 1.3 parameters. */
> +		struct {
> +			/** Starting sequence number. */
> +			uint64_t seq_no;
> +			/** Salt to be used for AEAD algos. */
> +			uint8_t salt[RTE_SECURITY_TLS_1_3_SALT_LEN];
> +			/**
> +			 * Minimum payload length (in case of write sessions).
> For shorter inputs,
> +			 * the payload would be padded appropriately before
> performing crypto

Replace "would be"  with "must be"? And who must do this step, is it the application?

> +			 * transformations.
> +			 */
> +			uint32_t min_payload_len;
> +		} tls_1_3;
> +
> +		/** DTLS 1.2 parameters */
> +		struct {
> +			/** Epoch value to be used. */
> +			uint16_t epoch;
> +			/** 6B starting sequence number to be used. */
> +			uint64_t seq_no;
> +			/** Salt to be used for AEAD algos. */
> +			uint8_t salt[RTE_SECURITY_DTLS_1_2_SALT_LEN];
> +			/** Anti replay window size to enable sequence replay
> attack handling.
> +			 * Anti replay check is disabled if the window size is 0.
> +			 */
> +			uint32_t ar_win_sz;
> +		} dtls_1_2;
> +	};
> +};
> +
>  /**
>   * Security session action type.
>   */
> @@ -654,6 +747,8 @@ enum rte_security_session_protocol {
>  	/**< PDCP Protocol */
>  	RTE_SECURITY_PROTOCOL_DOCSIS,
>  	/**< DOCSIS Protocol */
> +	RTE_SECURITY_PROTOCOL_TLS_RECORD,
> +	/**< TLS Record Protocol */
>  };
> 
>  /**
> @@ -670,6 +765,7 @@ struct rte_security_session_conf {
>  		struct rte_security_macsec_xform macsec;
>  		struct rte_security_pdcp_xform pdcp;
>  		struct rte_security_docsis_xform docsis;
> +		struct rte_security_tls_record_xform tls;

Do we see TLS handshake xform being added in future? If so, is 'tls' a good name, perhaps 'tls_record'?
That would allow 'tls_handshake' in future, with consistent naming scheme without API/ABI break.


>  	};
>  	/**< Configuration parameters for security session */
>  	struct rte_crypto_sym_xform *crypto_xform;
> @@ -1190,6 +1286,16 @@ struct rte_security_capability {
>  			/**< DOCSIS direction */
>  		} docsis;
>  		/**< DOCSIS capability */
> +		struct {
> +			enum rte_security_tls_version ver;
> +			/**< TLS record version. */
> +			enum rte_security_tls_sess_type type;
> +			/**< TLS record session type. */
> +			uint32_t ar_win_size;
> +			/**< Maximum anti replay window size supported for
> DTLS 1.2 record read
> +			 * operation. Value of 0 means anti replay check is not
> supported.
> +			 */
> +		} tls_record;

Missing      /**< TLS Record Capability */     docstring here.

>  	};
> 
>  	const struct rte_cryptodev_capabilities *crypto_capabilities;
> @@ -1251,6 +1357,10 @@ struct rte_security_capability_idx {
>  		struct {
>  			enum rte_security_docsis_direction direction;
>  		} docsis;
> +		struct {
> +			enum rte_security_tls_version ver;
> +			enum rte_security_tls_sess_type type;
> +		} tls_record;
>  	};
>  };
> 
> --
> 2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-20  6:00  4%         ` Stanisław Kardach
@ 2023-09-20  7:34  0%           ` David Marchand
  2023-09-21 13:18  4%             ` Tummala, Sivaprasad
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-09-20  7:34 UTC (permalink / raw)
  To: Stanisław Kardach, Sivaprasad Tummala
  Cc: Ruifeng Wang, Min Zhou, David Christensen, Bruce Richardson,
	Konstantin Ananyev, dev, Ferruh Yigit, Thomas Monjalon

On Wed, Sep 20, 2023 at 8:01 AM Stanisław Kardach <kda@semihalf.com> wrote:
>
> On Tue, Sep 19, 2023 at 4:47 PM David Marchand <david.marchand@redhat.com> wrote:
> <snip>
> > > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I call a last element canary). Why? If you're concerned with ABI, then we're talking about an application linking dynamically with DPDK or talking via some RPC channel with another DPDK application. So clashing with this definition does not come into question. One should rather use rte_cpu_get_flag_enabled().
> > > Also if you want to introduce new features, one would add them yo the rte_cpuflags headers, unless you'd like to not add those and keep an undocumented list "above" the last defined element.
> > > Could you explain a bit more Your use-case?
> >
> > Hey Stanislaw,
> >
> > Talking generically, one problem with such pattern (having a LAST, or
> > MAX enum) is when an array sized with such a symbol is exposed.
> > As I mentionned in the past, this can have unwanted effects:
> > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/

Argh... who broke copy/paste in my browser ?!
Wrt to MAX and arrays, I wanted to point at:
http://inbox.dpdk.org/dev/CAJFAV8xs5CVdE2xwRtaxk5vE_PiQMV5LY5tKStk3R1gOuRTsUw@mail.gmail.com/

> I agree, though I'd argue "LAST" and "MAX" semantics are a bit different. "LAST" delimits the known enumeration territory while "MAX" is more of a `constepxr` value type.
> >
> > Another issue is when an existing enum meaning changes: from the
> > application pov, the (old) MAX value is incorrect, but for the library
> > pov, a new meaning has been associated.
> > This may trigger bugs in the application when calling a function that
> > returns such an enum which never return this MAX value in the past.
> >
> > For at least those two reasons, removing those canary elements is
> > being done in DPDK.
> >
> > This specific removal has been announced:
> > https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/
> Thanks for pointing this out but did you mean to link to the patch again here?

Sorry, same here, bad copy/paste :-(.

The intended link is: https://git.dpdk.org/dpdk/commit/?id=5da7c13521
The deprecation notice was badly formulated and this patch here is
consistent with it.


> >
> > Now, practically, when I look at the cpuflags API, I don't see us
> > exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
> > is unneeded.
> > But on the other hand, is it really an issue for an application to
> > lose this (internal) information?
> I doubt it, maybe it could be used as a sanity check for choosing proper functors in the application. Though the initial description of the reason behind this patch was to not break the ABI and I don't think it does that. What it does is enforces users to use explicit cpu flag values which is a good thing. Though if so, then it should be stated in the commit description.

I agree.
Siva, can you work on a new revision?


Thanks.

-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  2023-09-19 14:47  0%       ` David Marchand
@ 2023-09-20  6:00  4%         ` Stanisław Kardach
  2023-09-20  7:34  0%           ` David Marchand
  0 siblings, 1 reply; 200+ results
From: Stanisław Kardach @ 2023-09-20  6:00 UTC (permalink / raw)
  To: David Marchand
  Cc: Sivaprasad Tummala, Ruifeng Wang, Min Zhou, David Christensen,
	Bruce Richardson, Konstantin Ananyev, dev, Ferruh Yigit,
	Thomas Monjalon

[-- Attachment #1: Type: text/plain, Size: 2538 bytes --]

On Tue, Sep 19, 2023 at 4:47 PM David Marchand <david.marchand@redhat.com>
wrote:
<snip>
> > Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I call
a last element canary). Why? If you're concerned with ABI, then we're
talking about an application linking dynamically with DPDK or talking via
some RPC channel with another DPDK application. So clashing with this
definition does not come into question. One should rather use
rte_cpu_get_flag_enabled().
> > Also if you want to introduce new features, one would add them yo the
rte_cpuflags headers, unless you'd like to not add those and keep an
undocumented list "above" the last defined element.
> > Could you explain a bit more Your use-case?
>
> Hey Stanislaw,
>
> Talking generically, one problem with such pattern (having a LAST, or
> MAX enum) is when an array sized with such a symbol is exposed.
> As I mentionned in the past, this can have unwanted effects:
>
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/
I agree, though I'd argue "LAST" and "MAX" semantics are a bit different.
"LAST" delimits the known enumeration territory while "MAX" is more of a
`constepxr` value type.
>
> Another issue is when an existing enum meaning changes: from the
> application pov, the (old) MAX value is incorrect, but for the library
> pov, a new meaning has been associated.
> This may trigger bugs in the application when calling a function that
> returns such an enum which never return this MAX value in the past.
>
> For at least those two reasons, removing those canary elements is
> being done in DPDK.
>
> This specific removal has been announced:
>
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/
Thanks for pointing this out but did you mean to link to the patch again
here?
>
> Now, practically, when I look at the cpuflags API, I don't see us
> exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
> is unneeded.
> But on the other hand, is it really an issue for an application to
> lose this (internal) information?
I doubt it, maybe it could be used as a sanity check for choosing proper
functors in the application. Though the initial description of the reason
behind this patch was to not break the ABI and I don't think it does that.
What it does is enforces users to use explicit cpu flag values which is a
good thing. Though if so, then it should be stated in the commit
description.
>

[-- Attachment #2: Type: text/html, Size: 3334 bytes --]

^ permalink raw reply	[relevance 4%]

* Re: [PATCH v2 2/2] eal: remove NUMFLAGS enumeration
  @ 2023-09-19 14:47  0%       ` David Marchand
  2023-09-20  6:00  4%         ` Stanisław Kardach
  0 siblings, 1 reply; 200+ results
From: David Marchand @ 2023-09-19 14:47 UTC (permalink / raw)
  To: Stanisław Kardach, Sivaprasad Tummala
  Cc: Ruifeng Wang, Min Zhou, David Christensen, Bruce Richardson,
	Konstantin Ananyev, dev, Ferruh Yigit, Thomas Monjalon

Hello,

On Tue, Aug 15, 2023 at 8:10 AM Stanisław Kardach <kda@semihalf.com> wrote:
> On Fri, Aug 11, 2023, 08:08 Sivaprasad Tummala <sivaprasad.tummala@amd.com> wrote:
>> diff --git a/lib/eal/arm/include/rte_cpuflags_32.h b/lib/eal/arm/include/rte_cpuflags_32.h
>> index 4e254428a2..41ab0d5f21 100644
>> --- a/lib/eal/arm/include/rte_cpuflags_32.h
>> +++ b/lib/eal/arm/include/rte_cpuflags_32.h
>> @@ -43,7 +43,6 @@ enum rte_cpu_flag_t {
>>         RTE_CPUFLAG_V7L,
>>         RTE_CPUFLAG_V8L,
>>         /* The last item */
>> -       RTE_CPUFLAG_NUMFLAGS,/**< This should always be the last! */
>>  };
>
> Since there is no description of V1 to V2 changes, could you point me to what has changed?

Siva? I did not see a reply on this question.


> Also I see you're still removing the RTE_CPUFLAG_NUMFLAGS (what I call a last element canary). Why? If you're concerned with ABI, then we're talking about an application linking dynamically with DPDK or talking via some RPC channel with another DPDK application. So clashing with this definition does not come into question. One should rather use rte_cpu_get_flag_enabled().
> Also if you want to introduce new features, one would add them yo the rte_cpuflags headers, unless you'd like to not add those and keep an undocumented list "above" the last defined element.
> Could you explain a bit more Your use-case?

Hey Stanislaw,

Talking generically, one problem with such pattern (having a LAST, or
MAX enum) is when an array sized with such a symbol is exposed.
As I mentionned in the past, this can have unwanted effects:
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/

Another issue is when an existing enum meaning changes: from the
application pov, the (old) MAX value is incorrect, but for the library
pov, a new meaning has been associated.
This may trigger bugs in the application when calling a function that
returns such an enum which never return this MAX value in the past.

For at least those two reasons, removing those canary elements is
being done in DPDK.

This specific removal has been announced:
https://patchwork.dpdk.org/project/dpdk/patch/20230919140430.3251493-1-david.marchand@redhat.com/

Now, practically, when I look at the cpuflags API, I don't see us
exposed to those two issues wrt rte_cpu_flag_t, so maybe this change
is unneeded.
But on the other hand, is it really an issue for an application to
lose this (internal) information?


-- 
David Marchand


^ permalink raw reply	[relevance 0%]

* [PATCH v5 18/26] net/nfp: refact the nsp module
                             ` (2 preceding siblings ...)
  2023-09-19  9:54  1%         ` [PATCH v5 07/26] net/nfp: standard the comment style Chaoyong He
@ 2023-09-19  9:54  5%         ` Chaoyong He
  3 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-19  9:54 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He

Move the definition of data structure into the implement file.
Also sync the logic from kernel driver and remove the unneeded header
file include statements.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c           |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c      | 390 +++++++++++++++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h      | 140 ++++-----
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c |   4 -
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c  |  79 ++---
 5 files changed, 398 insertions(+), 217 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index e3ff3d8087..efb47c5d56 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -661,7 +661,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 static int
 nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	struct nfp_cpp *cpp = nfp_nsp_cpp(nsp);
 	void *fw_buf;
 	char fw_name[125];
 	char serial[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 0f67148907..5b804f6174 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -3,20 +3,127 @@
  * All rights reserved.
  */
 
-#define NFP_SUBSYS "nfp_nsp"
-
-#include <stdio.h>
-#include <time.h>
+#include "nfp_nsp.h"
 
 #include <rte_common.h>
 
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
-#include "nfp_nsp.h"
 #include "nfp_platform.h"
 #include "nfp_resource.h"
 
-int
+/* Offsets relative to the CSR base */
+#define NSP_STATUS              0x00
+#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
+#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
+#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
+#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
+#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
+#define   NSP_STATUS_BUSY       RTE_BIT64(0)
+
+#define NSP_COMMAND             0x08
+#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
+#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
+#define   NSP_COMMAND_DMA_BUF   RTE_BIT64(1)
+#define   NSP_COMMAND_START     RTE_BIT64(0)
+
+/* CPP address to retrieve the data from */
+#define NSP_BUFFER              0x10
+#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
+#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER         0x18
+#define   NSP_DFLT_BUFFER_CPP          GENMASK_ULL(63, 40)
+#define   NSP_DFLT_BUFFER_ADDRESS      GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER_CONFIG  0x20
+#define   NSP_DFLT_BUFFER_SIZE_4KB     GENMASK_ULL(15, 8)
+#define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
+
+#define NSP_MAGIC               0xab10
+#define NSP_MAJOR               0
+#define NSP_MINOR               8
+
+#define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
+#define NSP_CODE_MINOR          GENMASK_ULL(11, 0)
+
+#define NFP_FW_LOAD_RET_MAJOR   GENMASK_ULL(15, 8)
+#define NFP_FW_LOAD_RET_MINOR   GENMASK_ULL(23, 16)
+
+enum nfp_nsp_cmd {
+	SPCODE_NOOP             = 0, /* No operation */
+	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
+	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
+	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
+	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
+	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
+	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
+	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
+	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
+	SPCODE_NSP_WRITE_FLASH  = 11, /* Load and flash image from buffer */
+	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
+	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
+	SPCODE_FW_STORED        = 16, /* If no FW loaded, load flash app FW */
+	SPCODE_HWINFO_LOOKUP    = 17, /* Lookup HWinfo with overwrites etc. */
+	SPCODE_HWINFO_SET       = 18, /* Set HWinfo entry */
+	SPCODE_FW_LOADED        = 19, /* Is application firmware loaded */
+	SPCODE_VERSIONS         = 21, /* Report FW versions */
+	SPCODE_READ_SFF_EEPROM  = 22, /* Read module EEPROM */
+	SPCODE_READ_MEDIA       = 23, /* Get the supported/advertised media for a port */
+};
+
+static const struct {
+	uint32_t code;
+	const char *msg;
+} nsp_errors[] = {
+	{ 6010, "could not map to phy for port" },
+	{ 6011, "not an allowed rate/lanes for port" },
+	{ 6012, "not an allowed rate/lanes for port" },
+	{ 6013, "high/low error, change other port first" },
+	{ 6014, "config not found in flash" },
+};
+
+struct nfp_nsp {
+	struct nfp_cpp *cpp;
+	struct nfp_resource *res;
+	struct {
+		uint16_t major;
+		uint16_t minor;
+	} ver;
+
+	/** Eth table config state */
+	bool modified;
+	uint32_t idx;
+	void *entries;
+};
+
+/* NFP command argument structure */
+struct nfp_nsp_command_arg {
+	uint16_t code;         /**< NFP SP Command Code */
+	bool dma;              /**< @buf points to a host buffer, not NSP buffer */
+	bool error_quiet;      /**< Don't print command error/warning */
+	uint32_t timeout_sec;  /**< Timeout value to wait for completion in seconds */
+	uint32_t option;       /**< NSP Command Argument */
+	uint64_t buf;          /**< NSP Buffer Address */
+	/** Callback for interpreting option if error occurred */
+	void (*error_cb)(struct nfp_nsp *state, uint32_t ret_val);
+};
+
+/* NFP command with buffer argument structure */
+struct nfp_nsp_command_buf_arg {
+	struct nfp_nsp_command_arg arg;  /**< NFP command argument structure */
+	const void *in_buf;              /**< Buffer with data for input */
+	void *out_buf;                   /**< Buffer for output data */
+	uint32_t in_size;                /**< Size of @in_buf */
+	uint32_t out_size;               /**< Size of @out_buf */
+};
+
+struct nfp_cpp *
+nfp_nsp_cpp(struct nfp_nsp *state)
+{
+	return state->cpp;
+}
+
+bool
 nfp_nsp_config_modified(struct nfp_nsp *state)
 {
 	return state->modified;
@@ -24,7 +131,7 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 
 void
 nfp_nsp_config_set_modified(struct nfp_nsp *state,
-		int modified)
+		bool modified)
 {
 	state->modified = modified;
 }
@@ -66,7 +173,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 		return;
 
 	for (i = 0; i < RTE_DIM(nsp_errors); i++)
-		if (ret_val == (uint32_t)nsp_errors[i].code)
+		if (ret_val == nsp_errors[i].code)
 			PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg);
 }
 
@@ -222,11 +329,8 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
  *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state,
-		uint16_t code,
-		uint32_t option,
-		uint32_t buff_cpp,
-		uint64_t buff_addr)
+nfp_nsp_command_real(struct nfp_nsp *state,
+		const struct nfp_nsp_command_arg *arg)
 {
 	int err;
 	uint64_t reg;
@@ -250,22 +354,14 @@ nfp_nsp_command(struct nfp_nsp *state,
 		return err;
 	}
 
-	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
-		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-				buff_cpp, buff_addr);
-		return -EINVAL;
-	}
-
-	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer, arg->buf);
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+			FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
+			FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
 			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
@@ -275,7 +371,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -284,7 +380,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -296,84 +392,85 @@ nfp_nsp_command(struct nfp_nsp *state,
 
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-				-err, (int)ret_val, code);
-		nfp_nsp_print_extended_error(ret_val);
+		if (!arg->error_quiet)
+			PMD_DRV_LOG(WARNING, "Result (error) code set: %d (%d) command: %d",
+					-err, (int)ret_val, arg->code);
+
+		if (arg->error_cb != 0)
+			arg->error_cb(state, ret_val);
+		else
+			nfp_nsp_print_extended_error(ret_val);
+
 		return -err;
 	}
 
 	return ret_val;
 }
 
-#define SZ_1M 0x00100000
+static int
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code)
+{
+	const struct nfp_nsp_command_arg arg = {
+		.code = code,
+	};
+
+	return nfp_nsp_command_real(state, &arg);
+}
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp,
-		uint16_t code, uint32_t option,
-		const void *in_buf,
-		unsigned int in_size,
-		void *out_buf,
-		unsigned int out_size)
+nfp_nsp_command_buf_def(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
 {
 	int err;
 	int ret;
 	uint64_t reg;
-	size_t max_size;
 	uint32_t cpp_id;
 	uint64_t cpp_buf;
 	struct nfp_cpp *cpp = nsp->cpp;
 
-	if (nsp->ver.minor < 13) {
-		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-				code, nsp->ver.major, nsp->ver.minor);
-		return -EOPNOTSUPP;
-	}
-
-	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
-			&reg);
-	if (err < 0)
-		return err;
-
-	max_size = RTE_MAX(in_size, out_size);
-	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
-		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %zu)",
-				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
-		return -EINVAL;
-	}
-
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
 			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
 			&reg);
 	if (err < 0)
 		return err;
 
-	cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8;
-	cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg);
+	cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
+	cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
 
-	if (in_buf != NULL && in_size > 0) {
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
+	if (arg->in_buf != NULL && arg->in_size > 0) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf,
+				arg->in_buf, arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
 	/* Zero out remaining part of the buffer */
-	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
-		memset(out_buf, 0, out_size - in_size);
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				out_size - in_size);
+	if (arg->out_buf != NULL && arg->out_size > arg->in_size) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + arg->in_size,
+				arg->out_buf, arg->out_size - arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
-	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
+	if (!FIELD_FIT(NSP_BUFFER_CPP, cpp_id >> 8) ||
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, cpp_buf)) {
+		PMD_DRV_LOG(ERR, "Buffer out of reach %#08x %#016lx",
+				cpp_id, cpp_buf);
+		return -EINVAL;
+	}
+
+	arg->arg.buf = FIELD_PREP(NSP_BUFFER_CPP, cpp_id >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, cpp_buf);
+	ret = nfp_nsp_command_real(nsp, &arg->arg);
 	if (ret < 0) {
 		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
 	}
 
-	if (out_buf != NULL && out_size > 0) {
-		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
+	if (arg->out_buf != NULL && arg->out_size > 0) {
+		err = nfp_cpp_read(cpp, cpp_id, cpp_buf,
+				arg->out_buf, arg->out_size);
 		if (err < 0)
 			return err;
 	}
@@ -381,6 +478,43 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	return ret;
 }
 
+#define SZ_1M 0x00100000
+#define SZ_4K 0x00001000
+
+static int
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
+{
+	int err;
+	size_t size;
+	uint64_t reg;
+	size_t max_size;
+	struct nfp_cpp *cpp = nsp->cpp;
+
+	if (nsp->ver.minor < 13) {
+		PMD_DRV_LOG(ERR, "NSP: Code %#04x with buffer not supported ABI %hu.%hu)",
+				arg->arg.code, nsp->ver.major, nsp->ver.minor);
+		return -EOPNOTSUPP;
+	}
+
+	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
+	if (err < 0)
+		return err;
+
+	max_size = RTE_MAX(arg->in_size, arg->out_size);
+	size = FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M +
+			FIELD_GET(NSP_DFLT_BUFFER_SIZE_4KB, reg) * SZ_4K;
+	if (size < max_size) {
+		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command %#04x (%zu < %zu)",
+				arg->arg.code, size, max_size);
+		return -EINVAL;
+	}
+
+	return nfp_nsp_command_buf_def(nsp, arg);
+}
+
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
@@ -392,7 +526,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
-		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
+		err = nfp_nsp_command(state, SPCODE_NOOP);
 		if (err != -EAGAIN)
 			break;
 
@@ -413,13 +547,57 @@ nfp_nsp_wait(struct nfp_nsp *state)
 int
 nfp_nsp_device_soft_reset(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_SOFT_RESET, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_SOFT_RESET);
 }
 
 int
 nfp_nsp_mac_reinit(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_MAC_INIT, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_MAC_INIT);
+}
+
+static void
+nfp_nsp_load_fw_extended_msg(struct nfp_nsp *state,
+		uint32_t ret_val)
+{
+	uint32_t minor;
+	uint32_t major;
+	static const char * const major_msg[] = {
+		/* 0 */ "Firmware from driver loaded",
+		/* 1 */ "Firmware from flash loaded",
+		/* 2 */ "Firmware loading failure",
+	};
+	static const char * const minor_msg[] = {
+		/*  0 */ "",
+		/*  1 */ "no named partition on flash",
+		/*  2 */ "error reading from flash",
+		/*  3 */ "can not deflate",
+		/*  4 */ "not a trusted file",
+		/*  5 */ "can not parse FW file",
+		/*  6 */ "MIP not found in FW file",
+		/*  7 */ "null firmware name in MIP",
+		/*  8 */ "FW version none",
+		/*  9 */ "FW build number none",
+		/* 10 */ "no FW selection policy HWInfo key found",
+		/* 11 */ "static FW selection policy",
+		/* 12 */ "FW version has precedence",
+		/* 13 */ "different FW application load requested",
+		/* 14 */ "development build",
+	};
+
+	major = FIELD_GET(NFP_FW_LOAD_RET_MAJOR, ret_val);
+	minor = FIELD_GET(NFP_FW_LOAD_RET_MINOR, ret_val);
+
+	if (!nfp_nsp_has_stored_fw_load(state))
+		return;
+
+	if (major >= RTE_DIM(major_msg))
+		PMD_DRV_LOG(INFO, "FW loading status: %x", ret_val);
+	else if (minor >= RTE_DIM(minor_msg))
+		PMD_DRV_LOG(INFO, "%s, reason code: %d", major_msg[major], minor);
+	else
+		PMD_DRV_LOG(INFO, "%s%c %s", major_msg[major],
+				minor != 0 ? ',' : '.', minor_msg[minor]);
 }
 
 int
@@ -427,8 +605,24 @@ nfp_nsp_load_fw(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-			NULL, 0);
+	int ret;
+	struct nfp_nsp_command_buf_arg load_fw = {
+		{
+			.code     = SPCODE_FW_LOAD,
+			.option   = size,
+			.error_cb = nfp_nsp_load_fw_extended_msg,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	ret = nfp_nsp_command_buf(state, &load_fw);
+	if (ret < 0)
+		return ret;
+
+	nfp_nsp_load_fw_extended_msg(state, ret);
+
+	return 0;
 }
 
 int
@@ -436,8 +630,16 @@ nfp_nsp_read_eth_table(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg eth_rescan = {
+		{
+			.code   = SPCODE_ETH_RESCAN,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_rescan);
 }
 
 int
@@ -445,8 +647,16 @@ nfp_nsp_write_eth_table(struct nfp_nsp *state,
 		const void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-			NULL, 0);
+	struct nfp_nsp_command_buf_arg eth_ctrl = {
+		{
+			.code   = SPCODE_ETH_CONTROL,
+			.option = size,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_ctrl);
 }
 
 int
@@ -454,8 +664,16 @@ nfp_nsp_read_identify(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg identify = {
+		{
+			.code   = SPCODE_NSP_IDENTIFY,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &identify);
 }
 
 int
@@ -464,6 +682,14 @@ nfp_nsp_read_sensors(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-			0, buf, size);
+	struct nfp_nsp_command_buf_arg sensors = {
+		{
+			.code   = SPCODE_NSP_SENSORS,
+			.option = sensor_mask,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &sensors);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 14986a9130..fe52dffeb7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -7,78 +7,8 @@
 #define __NSP_NSP_H__
 
 #include "nfp_cpp.h"
-#include "nfp_nsp.h"
-
-/* Offsets relative to the CSR base */
-#define NSP_STATUS              0x00
-#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
-#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
-#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
-#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
-#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
-#define   NSP_STATUS_BUSY       RTE_BIT64(0)
-
-#define NSP_COMMAND             0x08
-#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
-#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
-#define   NSP_COMMAND_START     RTE_BIT64(0)
-
-/* CPP address to retrieve the data from */
-#define NSP_BUFFER              0x10
-#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
-#define   NSP_BUFFER_PCIE       GENMASK_ULL(39, 38)
-#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(37, 0)
-
-#define NSP_DFLT_BUFFER         0x18
-
-#define NSP_DFLT_BUFFER_CONFIG 0x20
-#define   NSP_DFLT_BUFFER_SIZE_MB    GENMASK_ULL(7, 0)
-
-#define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
-#define NSP_MINOR               8
-
-#define NSP_CODE_MAJOR          GENMASK(15, 12)
-#define NSP_CODE_MINOR          GENMASK(11, 0)
-
-enum nfp_nsp_cmd {
-	SPCODE_NOOP             = 0, /* No operation */
-	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
-	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
-	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
-	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
-	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
-	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
-	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
-	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
-	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
-	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
-};
-
-static const struct {
-	int code;
-	const char *msg;
-} nsp_errors[] = {
-	{ 6010, "could not map to phy for port" },
-	{ 6011, "not an allowed rate/lanes for port" },
-	{ 6012, "not an allowed rate/lanes for port" },
-	{ 6013, "high/low error, change other port first" },
-	{ 6014, "config not found in flash" },
-};
 
-struct nfp_nsp {
-	struct nfp_cpp *cpp;
-	struct nfp_resource *res;
-	struct {
-		uint16_t major;
-		uint16_t minor;
-	} ver;
-
-	/* Eth table config state */
-	int modified;
-	unsigned int idx;
-	void *entries;
-};
+struct nfp_nsp;
 
 struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp);
 void nfp_nsp_close(struct nfp_nsp *state);
@@ -92,18 +22,61 @@ int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, size_t size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, uint32_t sensor_mask,
 		void *buf, size_t size);
 
-static inline int
+static inline bool
 nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
 
+static inline bool
+nfp_nsp_has_stored_fw_load(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 23;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_lookup(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 24;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_set(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_fw_loaded(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_versions(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 27;
+}
+
+static inline bool
+nfp_nsp_has_read_module_eeprom(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 28;
+}
+
+static inline bool
+nfp_nsp_has_read_media(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 33;
+}
+
 enum nfp_eth_interface {
 	NFP_INTERFACE_NONE      = 0,
 	NFP_INTERFACE_SFP       = 1,
 	NFP_INTERFACE_SFPP      = 10,
 	NFP_INTERFACE_SFP28     = 28,
 	NFP_INTERFACE_QSFP      = 40,
+	NFP_INTERFACE_RJ45      = 45,
 	NFP_INTERFACE_CXP       = 100,
 	NFP_INTERFACE_QSFP28    = 112,
 };
@@ -151,6 +124,7 @@ struct nfp_eth_table {
 		enum nfp_eth_media media; /**< Media type of the @interface */
 
 		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_fec act_fec; /**< Active Forward Error Correction mode */
 		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
 		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
@@ -159,17 +133,18 @@ struct nfp_eth_table {
 		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;     /**< Enable port */
-		int tx_enabled;  /**< Enable TX */
-		int rx_enabled;  /**< Enable RX */
+		bool enabled;     /**< Enable port */
+		bool tx_enabled;  /**< Enable TX */
+		bool rx_enabled;  /**< Enable RX */
+		bool supp_aneg;   /**< Support auto negotiation */
 
-		int override_changed;  /**< Media reconfig pending */
+		bool override_changed;  /**< Media reconfig pending */
 
 		uint8_t port_type;    /**< One of %PORT_* */
 		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;   /**< Split port */
+		bool is_split;   /**< Split port */
 
 		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
 	} ports[]; /**< Table of ports */
@@ -177,8 +152,8 @@ struct nfp_eth_table {
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
-int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, int enable);
-int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, int configed);
+int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, bool enable);
+int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, bool configured);
 int nfp_eth_set_fec(struct nfp_cpp *cpp, uint32_t idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, size_t size);
@@ -187,12 +162,13 @@ int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
 		uint32_t idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
-void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
+void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
-int nfp_nsp_config_modified(struct nfp_nsp *state);
+struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
+bool nfp_nsp_config_modified(struct nfp_nsp *state);
 uint32_t nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int
+static inline bool
 nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return eth_port->fec_modes_supported != 0;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index f656f200f4..46fa5467de 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -3,12 +3,8 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
-#include "nfp_nffw.h"
 
 struct nsp_identify {
 	uint8_t version[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index eb30d8e779..cc472907ca 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -3,10 +3,6 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
 #include "nfp_platform.h"
@@ -21,6 +17,7 @@
 #define NSP_ETH_PORT_PHYLABEL           GENMASK_ULL(59, 54)
 #define NSP_ETH_PORT_FEC_SUPP_BASER     RTE_BIT64(60)
 #define NSP_ETH_PORT_FEC_SUPP_RS        RTE_BIT64(61)
+#define NSP_ETH_PORT_SUPP_ANEG          RTE_BIT64(63)
 
 #define NSP_ETH_PORT_LANES_MASK         rte_cpu_to_le_64(NSP_ETH_PORT_LANES)
 
@@ -34,6 +31,7 @@
 #define NSP_ETH_STATE_OVRD_CHNG         RTE_BIT64(22)
 #define NSP_ETH_STATE_ANEG              GENMASK_ULL(25, 23)
 #define NSP_ETH_STATE_FEC               GENMASK_ULL(27, 26)
+#define NSP_ETH_STATE_ACT_FEC           GENMASK_ULL(29, 28)
 
 #define NSP_ETH_CTRL_CONFIGURED         RTE_BIT64(0)
 #define NSP_ETH_CTRL_ENABLED            RTE_BIT64(1)
@@ -54,26 +52,12 @@
 #define PORT_NONE               0xef
 #define PORT_OTHER              0xff
 
-#define SPEED_10                10
-#define SPEED_100               100
-#define SPEED_1000              1000
-#define SPEED_2500              2500
-#define SPEED_5000              5000
-#define SPEED_10000             10000
-#define SPEED_14000             14000
-#define SPEED_20000             20000
-#define SPEED_25000             25000
-#define SPEED_40000             40000
-#define SPEED_50000             50000
-#define SPEED_56000             56000
-#define SPEED_100000            100000
-
 enum nfp_eth_raw {
 	NSP_ETH_RAW_PORT = 0,
 	NSP_ETH_RAW_STATE,
 	NSP_ETH_RAW_MAC,
 	NSP_ETH_RAW_CONTROL,
-	NSP_ETH_NUM_RAW
+	NSP_ETH_NUM_RAW,
 };
 
 enum nfp_eth_rate {
@@ -100,12 +84,12 @@ static const struct {
 	enum nfp_eth_rate rate;
 	uint32_t speed;
 } nsp_eth_rate_tbl[] = {
-	{ RATE_INVALID, 0, },
-	{ RATE_10M,     SPEED_10, },
-	{ RATE_100M,    SPEED_100, },
-	{ RATE_1G,      SPEED_1000, },
-	{ RATE_10G,     SPEED_10000, },
-	{ RATE_25G,     SPEED_25000, },
+	{ RATE_INVALID, RTE_ETH_SPEED_NUM_NONE, },
+	{ RATE_10M,     RTE_ETH_SPEED_NUM_10M, },
+	{ RATE_100M,    RTE_ETH_SPEED_NUM_100M, },
+	{ RATE_1G,      RTE_ETH_SPEED_NUM_1G, },
+	{ RATE_10G,     RTE_ETH_SPEED_NUM_10G, },
+	{ RATE_25G,     RTE_ETH_SPEED_NUM_25G, },
 };
 
 static uint32_t
@@ -193,7 +177,14 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 	if (dst->fec_modes_supported != 0)
 		dst->fec_modes_supported |= NFP_FEC_AUTO | NFP_FEC_DISABLED;
 
-	dst->fec = 1 << FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->fec = FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->act_fec = dst->fec;
+
+	if (nfp_nsp_get_abi_ver_minor(nsp) < 33)
+		return;
+
+	dst->act_fec = FIELD_GET(NSP_ETH_STATE_ACT_FEC, state);
+	dst->supp_aneg = FIELD_GET(NSP_ETH_PORT_SUPP_ANEG, port);
 }
 
 static void
@@ -222,7 +213,7 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 						table->ports[i].label_port,
 						table->ports[i].label_subport);
 
-			table->ports[i].is_split = 1;
+			table->ports[i].is_split = true;
 		}
 	}
 }
@@ -233,6 +224,9 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 	if (entry->interface == NFP_INTERFACE_NONE) {
 		entry->port_type = PORT_NONE;
 		return;
+	} else if (entry->interface == NFP_INTERFACE_RJ45) {
+		entry->port_type = PORT_TP;
+		return;
 	}
 
 	if (entry->media == NFP_MEDIA_FIBRE)
@@ -251,7 +245,6 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	uint32_t table_sz;
 	struct nfp_eth_table *table;
 	union eth_table_entry *entries;
-	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -264,16 +257,9 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/*
-	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
-	 * the rest 6 ports mac are all 0, ensure we don't use these port
-	 */
-	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
+	for (i = 0; i < NSP_ETH_MAX_COUNT; i++)
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
 			cnt++;
-	}
 
 	/*
 	 * Some versions of flash will give us 0 instead of port count. For
@@ -294,11 +280,8 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	memset(table, 0, table_sz);
 	table->count = cnt;
 	for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
-			nfp_eth_port_translate(nsp, &entries[i], i,
-					&table->ports[j++]);
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
+			nfp_eth_port_translate(nsp, &entries[i], i, &table->ports[j++]);
 	}
 
 	nfp_eth_calc_port_geometry(table);
@@ -440,7 +423,7 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int enable)
+		bool enable)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -448,7 +431,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
-		return -1;
+		return -EIO;
 
 	entries = nfp_nsp_config_entries(nsp);
 
@@ -460,7 +443,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_ENABLED, enable);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -484,7 +467,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int configured)
+		bool configured)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -513,7 +496,7 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -551,7 +534,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	entries[idx].control |= rte_cpu_to_le_64(ctrl_bit);
 
-	nfp_nsp_config_set_modified(nsp, 1);
+	nfp_nsp_config_set_modified(nsp, true);
 
 	return 0;
 }
-- 
2.39.1


^ permalink raw reply	[relevance 5%]

* [PATCH v5 07/26] net/nfp: standard the comment style
    2023-09-19  9:54  1%         ` [PATCH v5 02/26] net/nfp: unify the indent coding style Chaoyong He
  2023-09-19  9:54  3%         ` [PATCH v5 05/26] net/nfp: standard the local variable " Chaoyong He
@ 2023-09-19  9:54  1%         ` Chaoyong He
  2023-09-19  9:54  5%         ` [PATCH v5 18/26] net/nfp: refact the nsp module Chaoyong He
  3 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-19  9:54 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He

Follow the DPDK coding style, use the kdoc comment style.
Also move the comment of the functions to the implement file and
add some comment to help understand logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          | 504 ++++-----------------
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  39 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 484 ++++++++++++++++----
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  21 +-
 drivers/net/nfp/nfpcore/nfp_hwinfo.h       |   2 +
 drivers/net/nfp/nfpcore/nfp_mip.c          |  43 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  69 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  49 +-
 drivers/net/nfp/nfpcore/nfp_nffw.h         |   6 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          |  53 ++-
 drivers/net/nfp/nfpcore/nfp_nsp.h          | 108 ++---
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 170 ++++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 103 +++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |  28 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  59 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  12 +-
 drivers/net/nfp/nfpcore/nfp_target.c       |   2 +-
 17 files changed, 888 insertions(+), 864 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 139752f85a..82189e9910 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -10,9 +10,7 @@
 
 struct nfp_cpp_mutex;
 
-/*
- * NFP CPP handle
- */
+/* NFP CPP handle */
 struct nfp_cpp {
 	uint32_t model;
 	uint32_t interface;
@@ -37,9 +35,7 @@ struct nfp_cpp {
 	int driver_lock_needed;
 };
 
-/*
- * NFP CPP device area handle
- */
+/* NFP CPP device area handle */
 struct nfp_cpp_area {
 	struct nfp_cpp *cpp;
 	char *name;
@@ -127,35 +123,45 @@ struct nfp_cpp_operations {
 
 #define NFP_CPP_TARGET_ID_MASK 0x1f
 
-/*
+/**
  * Pack target, token, and action into a CPP ID.
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
  *
- * @return      NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ID(target, action, token)                               \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
 		(((action) & 0xff) << 8))
 
-/*
+/**
  * Pack target, token, action, and island into a CPP ID.
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
- * @island      NFP CPP island id
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @return      NFP CPP ID
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
+ * @param island
+ *   NFP CPP island id
+ *
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ISLAND_ID(target, action, token, island)                \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
@@ -163,9 +169,12 @@ struct nfp_cpp_operations {
 
 /**
  * Return the NFP CPP target of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP target
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP target
  */
 static inline uint8_t
 NFP_CPP_ID_TARGET_of(uint32_t id)
@@ -173,11 +182,14 @@ NFP_CPP_ID_TARGET_of(uint32_t id)
 	return (id >> 24) & NFP_CPP_TARGET_ID_MASK;
 }
 
-/*
+/**
  * Return the NFP CPP token of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP token
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP token
  */
 static inline uint8_t
 NFP_CPP_ID_TOKEN_of(uint32_t id)
@@ -185,11 +197,14 @@ NFP_CPP_ID_TOKEN_of(uint32_t id)
 	return (id >> 16) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP action of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP action
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP action
  */
 static inline uint8_t
 NFP_CPP_ID_ACTION_of(uint32_t id)
@@ -197,11 +212,14 @@ NFP_CPP_ID_ACTION_of(uint32_t id)
 	return (id >> 8) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP island of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP island
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP island
  */
 static inline uint8_t
 NFP_CPP_ID_ISLAND_of(uint32_t id)
@@ -215,109 +233,57 @@ NFP_CPP_ID_ISLAND_of(uint32_t id)
  */
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
 
-/*
- * Set the model id
- *
- * @param   cpp     NFP CPP operations structure
- * @param   model   Model ID
- */
 void nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   interface Interface ID
- */
 void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   serial  NFP serial byte array
- * @param   len     Length of the serial byte array
- */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
 		size_t serial_len);
 
-/*
- * Set the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv);
 
-/*
- * Return the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void *nfp_cpp_priv(struct nfp_cpp *cpp);
 
-/*
- * Get the privately allocated portion of a NFP CPP area handle
- *
- * @param   cpp_area    NFP CPP area handle
- * @return          Pointer to the private area, or NULL on failure
- */
 void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
 
 uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
 
-/*
- * NFP CPP core interface for CPP clients.
- */
-
-/*
- * Open a NFP CPP handle to a CPP device
- *
- * @param[in]	id	0-based ID for the CPP interface to use
- *
- * @return NFP CPP handle, or NULL on failure.
- */
+/* NFP CPP core interface for CPP clients */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed);
 
-/*
- * Free a NFP CPP handle
- *
- * @param[in]	cpp	NFP CPP handle
- */
 void nfp_cpp_free(struct nfp_cpp *cpp);
 
 #define NFP_CPP_MODEL_INVALID   0xffffffff
 
-/*
- * NFP_CPP_MODEL_CHIP_of - retrieve the chip ID from the model ID
+/**
+ * Retrieve the chip ID from the model ID
  *
  * The chip ID is a 16-bit BCD+A-F encoding for the chip type.
  *
- * @param[in]   model   NFP CPP model id
- * @return      NFP CPP chip id
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   NFP CPP chip id
  */
 #define NFP_CPP_MODEL_CHIP_of(model)        (((model) >> 16) & 0xffff)
 
-/*
- * NFP_CPP_MODEL_IS_6000 - Check for the NFP6000 family of devices
+/**
+ * Check for the NFP6000 family of devices
  *
  * NOTE: The NFP4000 series is considered as a NFP6000 series variant.
  *
- * @param[in]	model	NFP CPP model id
- * @return		true if model is in the NFP6000 family, false otherwise.
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   true if model is in the NFP6000 family, false otherwise.
  */
 #define NFP_CPP_MODEL_IS_6000(model)		     \
 		((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \
 		(NFP_CPP_MODEL_CHIP_of(model) < 0x7000))
 
-/*
- * nfp_cpp_model - Retrieve the Model ID of the NFP
- *
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Model ID
- */
 uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 
 /*
@@ -330,7 +296,7 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 #define NFP_CPP_INTERFACE_TYPE_RPC		0x3
 #define NFP_CPP_INTERFACE_TYPE_ILA		0x4
 
-/*
+/**
  * Construct a 16-bit NFP Interface ID
  *
  * Interface IDs consists of 4 bits of interface type, 4 bits of unit
@@ -340,422 +306,138 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
  * which use the MU Atomic CompareAndWrite operation - hence the limit to 16
  * bits to be able to use the NFP Interface ID as a lock owner.
  *
- * @param[in]	type	NFP Interface Type
- * @param[in]	unit	Unit identifier for the interface type
- * @param[in]	channel	Channel identifier for the interface unit
- * @return		Interface ID
+ * @param type
+ *   NFP Interface Type
+ * @param unit
+ *   Unit identifier for the interface type
+ * @param channel
+ *   Channel identifier for the interface unit
+ *
+ * @return
+ *   Interface ID
  */
 #define NFP_CPP_INTERFACE(type, unit, channel)	\
 	((((type) & 0xf) << 12) | \
 	 (((unit) & 0xf) <<  8) | \
 	 (((channel) & 0xff) << 0))
 
-/*
+/**
  * Get the interface type of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's type
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's type
  */
 #define NFP_CPP_INTERFACE_TYPE_of(interface)	(((interface) >> 12) & 0xf)
 
-/*
+/**
  * Get the interface unit of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's unit
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's unit
  */
 #define NFP_CPP_INTERFACE_UNIT_of(interface)	(((interface) >>  8) & 0xf)
 
-/*
+/**
  * Get the interface channel of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's channel
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's channel
  */
 #define NFP_CPP_INTERFACE_CHANNEL_of(interface)	(((interface) >>  0) & 0xff)
 
-/*
- * Retrieve the Interface ID of the NFP
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Interface ID
- */
+
 uint16_t nfp_cpp_interface(struct nfp_cpp *cpp);
 
-/*
- * Retrieve the NFP Serial Number (unique per NFP)
- * @param[in]	cpp	NFP CPP handle
- * @param[out]	serial	Pointer to reference the serial number array
- *
- * @return	size of the NFP6000 serial number, in bytes
- */
 int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, size_t size);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	name	Name of owner of the area
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint32_t cpp_id, const char *name, uint64_t address,
 		uint32_t size);
 
-/*
- * Free an allocated NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_free(struct nfp_cpp_area *area);
 
-/*
- * Acquire the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- *
- * @return 0 on success, -1 on failure.
- */
 int nfp_cpp_area_acquire(struct nfp_cpp_area *area);
 
-/*
- * Release the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release(struct nfp_cpp_area *area);
 
-/*
- * Allocate, then acquire the resources needed to access the NFP CPP area handle
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 		uint32_t cpp_id, uint64_t address, size_t size);
 
-/*
- * Release the resources, then free the NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t addr, uint32_t size, struct nfp_cpp_area **area);
 
-/*
- * Read from a NFP CPP area handle into a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer to receive the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes read on success, negative value on failure.
- *
- */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset,
 		void *buffer, size_t length);
 
-/*
- * Write to a NFP CPP area handle from a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer that holds the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes written on success, negative value on failure.
- */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset,
 		const void *buffer, size_t length);
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
- * @area:       CPP area handle
- *
- * Returns an iomem pointer for use with readl()/writel() style operations.
- *
- * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
- */
 void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
 
-/*
- * Get the NFP CPP handle that is the parent of a NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			NFP CPP handle
- */
 struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
 
-/*
- * Get the name passed during allocation of the NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			Pointer to the area's name
- */
 const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
 
-/*
- * Read a block of data from a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy read data to
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes read on success, -1 on failure.
- */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, void *kernel_vaddr, size_t length);
 
-/*
- * Write a block of data to a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy write data from
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes written on success, -1 on failure.
- */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, const void *kernel_vaddr, size_t length);
 
-/*
- * Read a single 32-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t *value);
 
-/*
- * Write a single 32-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t value);
 
-/*
- * Read a single 64-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t *value);
 
-/*
- * Write a single 64-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t value);
 
-/*
- * Write a single 32-bit value on the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t value);
 
-/*
- * Read a single 32-bit value from the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
 
-/*
- * Read a 32-bit word from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t *value);
 
-/*
- * Write a 32-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- *
- */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t value);
 
-/*
- * Read a 64-bit work from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t *value);
 
-/*
- * Write a 64-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t value);
 
-/*
- * Initialize a mutex location
-
- * The CPP target:address must point to a 64-bit aligned location, and will
- * initialize 64 bits of data at the location.
- *
- * This creates the initial mutex state, as locked by this nfp_cpp_interface().
- *
- * This function should only be called when setting up the initial lock state
- * upon boot-up of the system.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	Unique 32-bit value for this mutex
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Create a mutex handle from an address controlled by a MU Atomic engine
- *
- * The CPP target:address must point to a 64-bit aligned location, and reserve
- * 64 bits of data at the location for use by the handle.
- *
- * Only target/address pairs that point to entities that support the MU Atomic
- * Engine's CmpAndSwap32 command are supported.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	32-bit unique key (must match the key at this location)
- *
- * @return		A non-NULL struct nfp_cpp_mutex * on success, NULL on
- *                      failure.
- */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Free a mutex handle - does not alter the lock state
- *
- * @param mutex		NFP CPP Mutex handle
- */
 void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
 
-/*
- * Lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Unlock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- * @return		0 if the lock succeeded, negative value on failure.
- */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
 uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index bdf4a658f5..7e94bfb611 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -58,7 +58,7 @@
  * Minimal size of the PCIe cfg memory we depend on being mapped,
  * queue controller and DMA controller don't have to be covered.
  */
-#define NFP_PCI_MIN_MAP_SIZE				0x080000
+#define NFP_PCI_MIN_MAP_SIZE				0x080000        /* 512K */
 
 #define NFP_PCIE_P2C_FIXED_SIZE(bar)               (1 << (bar)->bitsize)
 #define NFP_PCIE_P2C_BULK_SIZE(bar)                (1 << (bar)->bitsize)
@@ -72,40 +72,25 @@
 #define NFP_PCIE_CPP_BAR_PCIETOCPPEXPBAR(bar, slot) \
 	(((bar) * 8 + (slot)) * 4)
 
-/*
- * Define to enable a bit more verbose debug output.
- * Set to 1 to enable a bit more verbose debug output.
- */
 struct nfp_pcie_user;
 struct nfp6000_area_priv;
 
-/*
- * struct nfp_bar - describes BAR configuration and usage
- * @nfp:	backlink to owner
- * @barcfg:	cached contents of BAR config CSR
- * @base:	the BAR's base CPP offset
- * @mask:       mask for the BAR aperture (read only)
- * @bitsize:	bitsize of BAR aperture (read only)
- * @index:	index of the BAR
- * @lock:	lock to specify if bar is in use
- * @refcnt:	number of current users
- * @iomem:	mapped IO memory
- */
+/* Describes BAR configuration and usage */
 #define NFP_BAR_MIN 1
 #define NFP_BAR_MID 5
 #define NFP_BAR_MAX 7
 
 struct nfp_bar {
-	struct nfp_pcie_user *nfp;
-	uint32_t barcfg;
-	uint64_t base;		/* CPP address base */
-	uint64_t mask;		/* Bit mask of the bar */
-	uint32_t bitsize;	/* Bit size of the bar */
-	uint32_t index;
-	int lock;
+	struct nfp_pcie_user *nfp;    /**< Backlink to owner */
+	uint32_t barcfg;     /**< BAR config CSR */
+	uint64_t base;       /**< Base CPP offset */
+	uint64_t mask;       /**< Mask of the BAR aperture (read only) */
+	uint32_t bitsize;    /**< Bit size of the BAR aperture (read only) */
+	uint32_t index;      /**< Index of the BAR */
+	int lock;            /**< If the BAR has been locked */
 
 	char *csr;
-	char *iomem;
+	char *iomem;         /**< mapped IO memory */
 };
 
 #define BUSDEV_SZ	13
@@ -360,9 +345,7 @@ nfp_disable_bars(struct nfp_pcie_user *nfp)
 	}
 }
 
-/*
- * Generic CPP bus access interface.
- */
+/* Generic CPP bus access interface. */
 
 struct nfp6000_area_priv {
 	struct nfp_bar *bar;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index e2af888a28..0e8372576e 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -26,6 +26,15 @@
 #define NFP_PL_DEVICE_MODEL_MASK               (NFP_PL_DEVICE_PART_MASK | \
 						NFP_PL_DEVICE_ID_MASK)
 
+/**
+ * Set the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void
 nfp_cpp_priv_set(struct nfp_cpp *cpp,
 		void *priv)
@@ -33,12 +42,29 @@ nfp_cpp_priv_set(struct nfp_cpp *cpp,
 	cpp->priv = priv;
 }
 
+/**
+ * Return the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void *
 nfp_cpp_priv(struct nfp_cpp *cpp)
 {
 	return cpp->priv;
 }
 
+/**
+ * Set the model id
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param model
+ *   Model ID
+ */
 void
 nfp_cpp_model_set(struct nfp_cpp *cpp,
 		uint32_t model)
@@ -46,6 +72,15 @@ nfp_cpp_model_set(struct nfp_cpp *cpp,
 	cpp->model = model;
 }
 
+/**
+ * Retrieve the Model ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Model ID
+ */
 uint32_t
 nfp_cpp_model(struct nfp_cpp *cpp)
 {
@@ -63,6 +98,14 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 	return model;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param interface
+ *   Interface ID
+ */
 void
 nfp_cpp_interface_set(struct nfp_cpp *cpp,
 		uint32_t interface)
@@ -70,6 +113,17 @@ nfp_cpp_interface_set(struct nfp_cpp *cpp,
 	cpp->interface = interface;
 }
 
+/**
+ * Retrieve the Serial ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param serial
+ *   Pointer to NFP serial number
+ *
+ * @return
+ *   Length of NFP serial number
+ */
 int
 nfp_cpp_serial(struct nfp_cpp *cpp,
 		const uint8_t **serial)
@@ -78,6 +132,16 @@ nfp_cpp_serial(struct nfp_cpp *cpp,
 	return cpp->serial_len;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param serial
+ *   NFP serial byte array
+ * @param serial_len
+ *   Length of the serial byte array
+ */
 int
 nfp_cpp_serial_set(struct nfp_cpp *cpp,
 		const uint8_t *serial,
@@ -96,6 +160,15 @@ nfp_cpp_serial_set(struct nfp_cpp *cpp,
 	return 0;
 }
 
+/**
+ * Retrieve the Interface ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Interface ID
+ */
 uint16_t
 nfp_cpp_interface(struct nfp_cpp *cpp)
 {
@@ -105,18 +178,45 @@ nfp_cpp_interface(struct nfp_cpp *cpp)
 	return cpp->interface;
 }
 
+/**
+ * Get the privately allocated portion of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the private area, or NULL on failure
+ */
 void *
 nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area)
 {
 	return &cpp_area[1];
 }
 
+/**
+ * Get the NFP CPP handle that is the pci_dev of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   NFP CPP handle
+ */
 struct nfp_cpp *
 nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area)
 {
 	return cpp_area->cpp;
 }
 
+/**
+ * Get the name passed during allocation of the NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the area's name
+ */
 const char *
 nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 {
@@ -153,15 +253,24 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
 	return cpp->mu_locality_lsb;
 }
 
-/*
- * nfp_cpp_area_alloc - allocate a new CPP area
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area in bytes
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
  *
- * Allocate and initialize a CPP area structure.  The area must later
- * be locked down with an 'acquire' before it can be safely accessed.
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param name
+ *   Name of region
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
  *
  * NOTE: @address and @size must be 32-bit aligned values.
  */
@@ -211,6 +320,25 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 	return area;
 }
 
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
+ * NOTE: @address and @size must be 32-bit aligned values.
+ */
 struct nfp_cpp_area *
 nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 		uint32_t dest,
@@ -220,17 +348,22 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
 
-/*
- * nfp_cpp_area_alloc_acquire - allocate a new CPP area and lock it down
- *
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area
- *
+/**
  * Allocate and initialize a CPP area structure, and lock it down so
  * that it can be accessed directly.
  *
+ * @param cpp
+ *   CPP device handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
  * NOTE: @address and @size must be 32-bit aligned values.
  *
  * NOTE: The area must also be 'released' when the structure is freed.
@@ -258,11 +391,11 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	return area;
 }
 
-/*
- * nfp_cpp_area_free - free up the CPP area
- * area:    CPP area handle
- *
+/**
  * Frees up memory resources held by the CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_free(struct nfp_cpp_area *area)
@@ -272,11 +405,11 @@ nfp_cpp_area_free(struct nfp_cpp_area *area)
 	free(area);
 }
 
-/*
- * nfp_cpp_area_release_free - release CPP area and free it
- * area:    CPP area handle
+/**
+ * Releases CPP area and frees up memory resources held by it.
  *
- * Releases CPP area and frees up memory resources held by the it.
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release_free(struct nfp_cpp_area *area)
@@ -285,12 +418,15 @@ nfp_cpp_area_release_free(struct nfp_cpp_area *area)
 	nfp_cpp_area_free(area);
 }
 
-/*
- * nfp_cpp_area_acquire - lock down a CPP area for access
- * @area:   CPP area handle
+/**
+ * Locks down the CPP area for a potential long term activity.
+ * Area must always be locked down before being accessed.
  *
- * Locks down the CPP area for a potential long term activity.  Area
- * must always be locked down before being accessed.
+ * @param area
+ *   CPP area handle
+ *
+ * @return
+ *   0 on success, -1 on failure.
  */
 int
 nfp_cpp_area_acquire(struct nfp_cpp_area *area)
@@ -307,11 +443,11 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	return 0;
 }
 
-/*
- * nfp_cpp_area_release - release a locked down CPP area
- * @area:   CPP area handle
- *
+/**
  * Releases a previously locked down CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release(struct nfp_cpp_area *area)
@@ -320,16 +456,16 @@ nfp_cpp_area_release(struct nfp_cpp_area *area)
 		area->cpp->op->area_release(area);
 }
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
+/**
+ * Returns an iomem pointer for use with readl()/writel() style operations.
  *
- * @area:       CPP area handle
+ * @param area
+ *   CPP area handle
  *
- * Returns an iomem pointer for use with readl()/writel() style operations.
+ * @return
+ *   Pointer to the area, or NULL
  *
  * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
  */
 void *
 nfp_cpp_area_iomem(struct nfp_cpp_area *area)
@@ -342,18 +478,22 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
 	return iomem;
 }
 
-/*
- * nfp_cpp_area_read - read data from CPP area
+/**
+ * Read data from indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to put data into
- * @length:     number of bytes to read
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Read data from indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -368,18 +508,22 @@ nfp_cpp_area_read(struct nfp_cpp_area *area,
 	return area->cpp->op->area_read(area, kernel_vaddr, offset, length);
 }
 
-/*
- * nfp_cpp_area_write - write data to CPP area
+/**
+ * Write data to indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to read data from
- * @length:     number of bytes to write
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Write data to indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -436,6 +580,19 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 	return xpb;
 }
 
+/**
+ * Read a uint32_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readl(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -450,6 +607,19 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writel(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -462,6 +632,19 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -476,6 +659,19 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -489,6 +685,21 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint32_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readl(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -504,6 +715,21 @@ nfp_cpp_readl(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writel(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -518,6 +744,21 @@ nfp_cpp_writel(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -533,6 +774,21 @@ nfp_cpp_readq(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writeq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -547,6 +803,19 @@ nfp_cpp_writeq(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t word to a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_writel(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -559,6 +828,19 @@ nfp_xpb_writel(struct nfp_cpp *cpp,
 	return nfp_cpp_writel(cpp, cpp_dest, xpb_addr, value);
 }
 
+/**
+ * Read a uint32_t value from a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_readl(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -625,9 +907,11 @@ nfp_cpp_alloc(struct rte_pci_device *dev,
 	return cpp;
 }
 
-/*
- * nfp_cpp_free - free the CPP handle
- * @cpp:    CPP handle
+/**
+ * Free the CPP handle
+ *
+ * @param cpp
+ *   CPP handle
  */
 void
 nfp_cpp_free(struct nfp_cpp *cpp)
@@ -641,6 +925,19 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 	free(cpp);
 }
 
+/**
+ * Create a NFP CPP handle from device
+ *
+ * @param dev
+ *   PCI device
+ * @param driver_lock_needed
+ *   Driver lock flag
+ *
+ * @return
+ *   NFP CPP handle on success, NULL on failure
+ *
+ * NOTE: On failure, cpp_ops->free will be called!
+ */
 struct nfp_cpp *
 nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed)
@@ -648,13 +945,22 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev,
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
 
-/*
- * nfp_cpp_read - read from CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer for result
- * @length:     number of bytes to read
+/**
+ * Read from CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer for result
+ * @param length
+ *   Number of bytes to read
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_read(struct nfp_cpp *cpp,
@@ -678,13 +984,22 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_cpp_write - write to CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer to read from
- * @length:     number of bytes to write
+/**
+ * Write to CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer to read from
+ * @param length
+ *   Number of bytes to write
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_write(struct nfp_cpp *cpp,
@@ -731,18 +1046,23 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
- * nfp_cpp_map_area() - Helper function to map an area
- * @cpp:    NFP CPP handler
- * @cpp_id: CPP ID
- * @addr:   CPP address
- * @size:   Size of the area
- * @area:   Area handle (output)
+/**
+ * Map an area of IOMEM access.
+ * To undo the effect of this function call @nfp_cpp_area_release_free(*area).
  *
- * Map an area of IOMEM access.  To undo the effect of this function call
- * @nfp_cpp_area_release_free(*area).
+ * @param cpp
+ *   NFP CPP handler
+ * @param cpp_id
+ *   CPP id
+ * @param addr
+ *   CPP address
+ * @param size
+ *   Size of the area
+ * @param area
+ *   Area handle (output)
  *
- * Return: Pointer to memory mapped area or NULL
+ * @return
+ *   Pointer to memory mapped area or NULL
  */
 uint8_t *
 nfp_cpp_map_area(struct nfp_cpp *cpp,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index b658b5e900..f5579ab60f 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -3,7 +3,8 @@
  * All rights reserved.
  */
 
-/* Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
+/*
+ * Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
  * after chip reset.
  *
  * Examples of the fields:
@@ -146,7 +147,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *db;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 10000000;
+	wait.tv_nsec = 10000000;    /* 10ms */
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -154,7 +155,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 			return db;
 
 		nanosleep(&wait, NULL);
-		if (count++ > 200) {
+		if (count++ > 200) {    /* 10ms * 200 = 2s */
 			PMD_DRV_LOG(ERR, "NFP access error");
 			return NULL;
 		}
@@ -180,12 +181,16 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
 	return db;
 }
 
-/*
- * nfp_hwinfo_lookup() - Find a value in the HWInfo table by name
- * @hwinfo:	NFP HWinfo table
- * @lookup:	HWInfo name to search for
+/**
+ * Find a value in the HWInfo table by name
+ *
+ * @param hwinfo
+ *   NFP HWInfo table
+ * @param lookup
+ *   HWInfo name to search for
  *
- * Return: Value of the HWInfo name, or NULL
+ * @return
+ *   Value of the HWInfo name, or NULL
  */
 const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
index a3da7512db..424db8035d 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
@@ -59,6 +59,8 @@
  * Packed UTF8Z strings, ie 'key1\000value1\000key2\000value2\000'
  *
  * Unsorted.
+ *
+ * Note: Only the HwInfo v2 Table be supported now.
  */
 
 #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 086e82db70..0892c99e96 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -87,15 +87,16 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_mip_open() - Get device MIP structure
- * @cpp:	NFP CPP Handle
- *
- * Copy MIP structure from NFP device and return it.  The returned
+/**
+ * Copy MIP structure from NFP device and return it. The returned
  * structure is handled internally by the library and should be
- * freed by calling nfp_mip_close().
+ * freed by calling @nfp_mip_close().
+ *
+ * @param cpp
+ *   NFP CPP Handle
  *
- * Return: pointer to mip, NULL on failure.
+ * @return
+ *   Pointer to MIP, NULL on failure.
  */
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
@@ -131,11 +132,15 @@ nfp_mip_name(const struct nfp_mip *mip)
 	return mip->name;
 }
 
-/*
- * nfp_mip_symtab() - Get the address and size of the MIP symbol table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol table
- * @size:	Location for size of MIP symbol table
+/**
+ * Get the address and size of the MIP symbol table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol table
+ * @param size
+ *   Location for size of MIP symbol table
  */
 void
 nfp_mip_symtab(const struct nfp_mip *mip,
@@ -146,11 +151,15 @@ nfp_mip_symtab(const struct nfp_mip *mip,
 	*size = rte_le_to_cpu_32(mip->symtab_size);
 }
 
-/*
- * nfp_mip_strtab() - Get the address and size of the MIP symbol name table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol name table
- * @size:	Location for size of MIP symbol name table
+/**
+ * Get the address and size of the MIP symbol name table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol name table
+ * @param size
+ *   Location for size of MIP symbol name table
  */
 void
 nfp_mip_strtab(const struct nfp_mip *mip,
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 82919d8270..404d4fa938 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -53,7 +53,7 @@ _nfp_cpp_mutex_validate(uint32_t model,
 	return 0;
 }
 
-/*
+/**
  * Initialize a mutex location
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -65,13 +65,17 @@ _nfp_cpp_mutex_validate(uint32_t model,
  * This function should only be called when setting up
  * the initial lock state upon boot-up of the system.
  *
- * @param mutex     NFP CPP Mutex handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       Unique 32-bit value for this mutex
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   Unique 32-bit value for this mutex
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_init(struct nfp_cpp *cpp,
@@ -99,7 +103,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
+/**
  * Create a mutex handle from an address controlled by a MU Atomic engine
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -108,13 +112,17 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
  * Only target/address pairs that point to entities that support the
  * MU Atomic Engine are supported.
  *
- * @param cpp       NFP CPP handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       32-bit unique key (must match the key at this location)
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   32-bit unique key (must match the key at this location)
  *
- * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
+ * @return
+ *   A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
 nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
@@ -178,10 +186,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	return mutex;
 }
 
-/*
+/**
  * Free a mutex handle - does not alter the lock state
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  */
 void
 nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
@@ -203,12 +212,14 @@ nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
 	free(mutex);
 }
 
-/*
+/**
  * Lock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure.
  */
 int
 nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
@@ -229,12 +240,14 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 	return 0;
 }
 
-/*
+/**
  * Unlock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
@@ -280,16 +293,18 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 	return err;
 }
 
-/*
+/**
  * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
  *
  * Valid lock states:
- *
  *      0x....0000      - Unlocked
  *      0x....000f      - Locked
  *
- * @param mutex     NFP CPP Mutex handle
- * @return      0 if the lock succeeded, negative value on failure.
+ * @param mutex
+ *   NFP CPP Mutex handle
+ *
+ * @return
+ *   0 if the lock succeeded, negative value on failure.
  */
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
@@ -352,7 +367,7 @@ nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 		 * If there was another contending for this lock, then
 		 * the lock state would be 0x....000f
 		 *
-		 * Write our owner ID into the lock
+		 * Write our owner ID into the lock.
 		 * While not strictly necessary, this helps with
 		 * debug and bookkeeping.
 		 */
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index b5a354137d..5f004e3b21 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -52,7 +52,7 @@ nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi)
 	return (fi->loaded__mu_da__mip_off_hi >> 8) & 1;
 }
 
-/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 8) | mip_offset_lo */
+/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */
 static uint64_t
 nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 {
@@ -112,11 +112,14 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 	}
 }
 
-/*
- * nfp_nffw_info_open() - Acquire the lock on the NFFW table
- * @cpp:	NFP CPP handle
+/**
+ * Acquire the lock on the NFFW table
+ *
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: nffw info pointer, or NULL on failure
+ * @return
+ *   NFFW info pointer, or NULL on failure
  */
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
@@ -168,11 +171,11 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_close() - Release the lock on the NFFW table
- * @state:	NFP FW info state
+/**
+ * Release the lock on the NFFW table
  *
- * Return: void
+ * @param state
+ *   NFFW info pointer
  */
 void
 nfp_nffw_info_close(struct nfp_nffw_info *state)
@@ -181,11 +184,14 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 	free(state);
 }
 
-/*
- * nfp_nffw_info_fwid_first() - Return the first firmware ID in the NFFW
- * @state:	NFP FW info state
+/**
+ * Return the first firmware ID in the NFFW
  *
- * Return: First NFFW firmware info, NULL on failure
+ * @param state
+ *   NFFW info pointer
+ *
+ * @return:
+ *   First NFFW firmware info, NULL on failure
  */
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
@@ -205,13 +211,18 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_mip_first() - Retrieve the location of the first FW's MIP
- * @state:	NFP FW info state
- * @cpp_id:	Pointer to the CPP ID of the MIP
- * @off:	Pointer to the CPP Address of the MIP
+/**
+ * Retrieve the location of the first FW's MIP
+ *
+ * @param state
+ *   NFFW info pointer
+ * @param cpp_id
+ *   Pointer to the CPP ID of the MIP
+ * @param off
+ *   Pointer to the CPP Address of the MIP
  *
- * Return: 0, or -ERRNO
+ * @return
+ *   0, or -ERRNO
  */
 int
 nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h
index 46ac8a8d07..e032b6cce7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.h
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.h
@@ -8,7 +8,8 @@
 
 #include "nfp_cpp.h"
 
-/* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
+/*
+ * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
  * Lower IDs are reserved for target and loader IDs.
  */
 #define NFFW_FWID_EXT   3 /* For active MEs that we didn't load. */
@@ -16,7 +17,7 @@
 
 #define NFFW_FWID_ALL   255
 
-/**
+/*
  * NFFW_INFO_VERSION history:
  * 0: This was never actually used (before versioning), but it refers to
  *    the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
@@ -35,6 +36,7 @@
 #define NFFW_MEINFO_CNT_V2 200
 #define NFFW_FWINFO_CNT_V2 200
 
+/* nfp.nffw meinfo */
 struct nffw_meinfo {
 	uint32_t ctxmask__fwid__meid;
 };
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index ff19446173..a96ccea38b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -109,9 +109,11 @@ nfp_nsp_check(struct nfp_nsp *state)
 	return 0;
 }
 
-/*
- * nfp_nsp_open() - Prepare for communication and lock the NSP resource.
- * @cpp:	NFP CPP Handle
+/**
+ * Prepare for communication and lock the NSP resource.
+ *
+ * @param cpp
+ *   NFP CPP Handle
  */
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
@@ -145,9 +147,11 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	return state;
 }
 
-/*
- * nfp_nsp_close() - Clean up and unlock the NSP resource.
- * @state:	NFP SP state
+/**
+ * Clean up and unlock the NSP resource.
+ *
+ * @param state
+ *   NFP SP state
  */
 void
 nfp_nsp_close(struct nfp_nsp *state)
@@ -181,7 +185,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;     /* 25ms */
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -194,28 +198,27 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 			return 0;
 
 		nanosleep(&wait, 0);
-		if (count++ > 1000)
+		if (count++ > 1000)     /* 25ms * 1000 = 25s */
 			return -ETIMEDOUT;
 	}
 }
 
-/*
- * nfp_nsp_command() - Execute a command on the NFP Service Processor
- * @state:	NFP SP state
- * @code:	NFP SP Command Code
- * @option:	NFP SP Command Argument
- * @buff_cpp:	NFP SP Buffer CPP Address info
- * @buff_addr:	NFP SP Buffer Host address
- *
- * Return: 0 for success with no result
+/**
+ * Execute a command on the NFP Service Processor
  *
- *	 positive value for NSP completion with a result code
+ * @param state
+ *   NFP SP state
+ * @param arg
+ *   NFP command argument structure
  *
- *	-EAGAIN if the NSP is not yet present
- *	-ENODEV if the NSP is not a supported model
- *	-EBUSY if the NSP is stuck
- *	-EINTR if interrupted while waiting for completion
- *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
+ * @return
+ *   - 0 for success with no result
+ *   - Positive value for NSP completion with a result code
+ *   - -EAGAIN if the NSP is not yet present
+ *   - -ENODEV if the NSP is not a supported model
+ *   - -EBUSY if the NSP is stuck
+ *   - -EINTR if interrupted while waiting for completion
+ *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
 nfp_nsp_command(struct nfp_nsp *state,
@@ -383,7 +386,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
@@ -392,7 +395,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 
 		nanosleep(&wait, 0);
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 25ms * 1000 = 25s */
 			err = -ETIMEDOUT;
 			break;
 		}
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index edb56e26ca..0fcb21e99c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -158,72 +158,45 @@ enum nfp_eth_fec {
 #define NFP_FEC_REED_SOLOMON	RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT)
 #define NFP_FEC_DISABLED	RTE_BIT32(NFP_FEC_DISABLED_BIT)
 
-/**
- * struct nfp_eth_table - ETH table information
- * @count:	number of table entries
- * @max_index:	max of @index fields of all @ports
- * @ports:	table of ports
- *
- * @eth_index:	port index according to legacy ethX numbering
- * @index:	chip-wide first channel index
- * @nbi:	NBI index
- * @base:	first channel index (within NBI)
- * @lanes:	number of channels
- * @speed:	interface speed (in Mbps)
- * @interface:	interface (module) plugged in
- * @media:	media type of the @interface
- * @fec:	forward error correction mode
- * @aneg:	auto negotiation mode
- * @mac_addr:	interface MAC address
- * @label_port:	port id
- * @label_subport:  id of interface within port (for split ports)
- * @enabled:	is enabled?
- * @tx_enabled:	is TX enabled?
- * @rx_enabled:	is RX enabled?
- * @override_changed: is media reconfig pending?
- *
- * @port_type:	one of %PORT_* defines for ethtool
- * @port_lanes:	total number of lanes on the port (sum of lanes of all subports)
- * @is_split:	is interface part of a split port
- * @fec_modes_supported:	bitmap of FEC modes supported
- */
+/* ETH table information */
 struct nfp_eth_table {
-	uint32_t count;
-	uint32_t max_index;
+	uint32_t count;     /**< Number of table entries */
+	uint32_t max_index; /**< Max of @index fields of all @ports */
 	struct nfp_eth_table_port {
+		/** Port index according to legacy ethX numbering */
 		uint32_t eth_index;
-		uint32_t index;
-		uint32_t nbi;
-		uint32_t base;
-		uint32_t lanes;
-		uint32_t speed;
+		uint32_t index;  /**< Chip-wide first channel index */
+		uint32_t nbi;    /**< NBI index */
+		uint32_t base;   /**< First channel index (within NBI) */
+		uint32_t lanes;  /**< Number of channels */
+		uint32_t speed;  /**< Interface speed (in Mbps) */
 
-		uint32_t interface;
-		enum nfp_eth_media media;
+		uint32_t interface;  /**< Interface (module) plugged in */
+		enum nfp_eth_media media; /**< Media type of the @interface */
 
-		enum nfp_eth_fec fec;
-		enum nfp_eth_aneg aneg;
+		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
-		struct rte_ether_addr mac_addr;
+		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
 
-		uint8_t label_port;
+		uint8_t label_port;    /**< Port id */
+		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;
-		int tx_enabled;
-		int rx_enabled;
-
-		int override_changed;
+		int enabled;     /**< Enable port */
+		int tx_enabled;  /**< Enable TX */
+		int rx_enabled;  /**< Enable RX */
 
-		/* Computed fields */
-		uint8_t port_type;
+		int override_changed;  /**< Media reconfig pending */
 
+		uint8_t port_type;    /**< One of %PORT_* */
+		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;
+		int is_split;   /**< Split port */
 
-		uint32_t fec_modes_supported;
-	} ports[];
+		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
+	} ports[]; /**< Table of ports */
 };
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
@@ -263,28 +236,17 @@ int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode);
 int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed);
 int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes);
 
-/**
- * struct nfp_nsp_identify - NSP static information
- * @version:      opaque version string
- * @flags:        version flags
- * @br_primary:   branch id of primary bootloader
- * @br_secondary: branch id of secondary bootloader
- * @br_nsp:       branch id of NSP
- * @primary:      version of primary bootloader
- * @secondary:    version id of secondary bootloader
- * @nsp:          version id of NSP
- * @sensor_mask:  mask of present sensors available on NIC
- */
+/* NSP static information */
 struct nfp_nsp_identify {
-	char version[40];
-	uint8_t flags;
-	uint8_t br_primary;
-	uint8_t br_secondary;
-	uint8_t br_nsp;
-	uint16_t primary;
-	uint16_t secondary;
-	uint16_t nsp;
-	uint64_t sensor_mask;
+	char version[40];      /**< Opaque version string */
+	uint8_t flags;         /**< Version flags */
+	uint8_t br_primary;    /**< Branch id of primary bootloader */
+	uint8_t br_secondary;  /**< Branch id of secondary bootloader */
+	uint8_t br_nsp;        /**< Branch id of NSP */
+	uint16_t primary;      /**< Version of primary bootloader */
+	uint16_t secondary;    /**< Version id of secondary bootloader */
+	uint16_t nsp;          /**< Version id of NSP */
+	uint64_t sensor_mask;  /**< Mask of present sensors available on NIC */
 };
 
 struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 74daa92aed..cb090d2a47 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -264,7 +264,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/* The NFP3800 NIC support 8 ports, but only 2 ports are valid,
+	/*
+	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
 	 * the rest 6 ports mac are all 0, ensure we don't use these port
 	 */
 	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
@@ -274,7 +275,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 			cnt++;
 	}
 
-	/* Some versions of flash will give us 0 instead of port count. For
+	/*
+	 * Some versions of flash will give us 0 instead of port count. For
 	 * those that give a port count, verify it against the value calculated
 	 * above.
 	 */
@@ -312,14 +314,16 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	return NULL;
 }
 
-/*
- * nfp_eth_read_ports() - retrieve port information
- * @cpp:	NFP CPP handle
+/**
+ * Read the port information from the device.
+ *
+ * Returned structure should be freed once no longer needed.
  *
- * Read the port information from the device.  Returned structure should
- * be freed with kfree() once no longer needed.
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: populated ETH table or NULL on error.
+ * @return
+ *   Populated ETH table or NULL on error.
  */
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
@@ -387,19 +391,19 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 	free(entries);
 }
 
-/*
- * nfp_eth_config_commit_end() - perform recorded configuration changes
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- *
+/**
  * Perform the configuration which was requested with __nfp_eth_set_*()
- * helpers and recorded in @nsp state.  If device was already configured
- * as requested or no __nfp_eth_set_*() operations were made no NSP command
+ * helpers and recorded in @nsp state. If device was already configured
+ * as requested or no __nfp_eth_set_*() operations were made, no NSP command
  * will be performed.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
@@ -417,19 +421,21 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 	return ret;
 }
 
-/*
- * nfp_eth_set_mod_enable() - set PHY module enable control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @enable:	Desired state
- *
+/**
  * Enable or disable PHY module (this usually means setting the TX lanes
  * disable bits).
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param enable
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
@@ -460,18 +466,20 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * nfp_eth_set_configured() - set PHY module configured control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @configed:	Desired state
- *
+/**
  * Set the ifup/ifdown state on the PHY.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param configured
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
@@ -525,7 +533,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
-	 *	 codes were initially not populated correctly.
+	 * codes were initially not populated correctly.
 	 */
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 17) {
 		PMD_DRV_LOG(ERR, "set operations not supported, please update flash");
@@ -555,15 +563,17 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 				val, ctrl_bit);			\
 	}))
 
-/*
- * __nfp_eth_set_aneg() - set PHY autonegotiation control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired autonegotiation mode
- *
+/**
  * Allow/disallow PHY module to advertise/perform autonegotiation.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired autonegotiation mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_aneg(struct nfp_nsp *nsp,
@@ -573,15 +583,17 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
-/*
- * __nfp_eth_set_fec() - set PHY forward error correction control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired fec mode
- *
+/**
  * Set the PHY module forward error correction mode.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired fec mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 static int
 __nfp_eth_set_fec(struct nfp_nsp *nsp,
@@ -591,16 +603,20 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
-/*
- * nfp_eth_set_fec() - set PHY forward error correction control mode
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @mode:	Desired fec mode
+/**
+ * Set PHY forward error correction control mode
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param mode
+ *   Desired fec mode
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_fec(struct nfp_cpp *cpp,
@@ -623,17 +639,19 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * __nfp_eth_set_speed() - set interface speed/rate
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @speed:	Desired speed (per lane)
- *
- * Set lane speed.  Provided @speed value should be subport speed divided
- * by number of lanes this subport is spanning (i.e. 10000 for 40G, 25000 for
- * 50G, etc.)
+/**
+ * Set lane speed.
+ * Provided @speed value should be subport speed divided by number of
+ * lanes this subport is spanning (i.e. 10000 for 40G, 25000 for 50G, etc.)
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param speed
+ *   Desired speed (per lane)
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_speed(struct nfp_nsp *nsp,
@@ -651,15 +669,17 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
-/*
- * __nfp_eth_set_split() - set interface lane split
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @lanes:	Desired lanes per port
- *
+/**
  * Set number of lanes in the port.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param lanes
+ *   Desired lanes per port
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_split(struct nfp_nsp *nsp,
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 363f7d6198..bdebf5c3aa 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -22,32 +22,23 @@
 
 #define NFP_RESOURCE_ENTRY_NAME_SZ	8
 
-/*
- * struct nfp_resource_entry - Resource table entry
- * @owner:		NFP CPP Lock, interface owner
- * @key:		NFP CPP Lock, posix_crc32(name, 8)
- * @region:		Memory region descriptor
- * @name:		ASCII, zero padded name
- * @reserved
- * @cpp_action:		CPP Action
- * @cpp_token:		CPP Token
- * @cpp_target:		CPP Target ID
- * @page_offset:	256-byte page offset into target's CPP address
- * @page_size:		size, in 256-byte pages
- */
+/* Resource table entry */
 struct nfp_resource_entry {
 	struct nfp_resource_entry_mutex {
-		uint32_t owner;
-		uint32_t key;
+		uint32_t owner;  /**< NFP CPP Lock, interface owner */
+		uint32_t key;    /**< NFP CPP Lock, posix_crc32(name, 8) */
 	} mutex;
+	/* Memory region descriptor */
 	struct nfp_resource_entry_region {
+		/** ASCII, zero padded name */
 		uint8_t  name[NFP_RESOURCE_ENTRY_NAME_SZ];
 		uint8_t  reserved[5];
-		uint8_t  cpp_action;
-		uint8_t  cpp_token;
-		uint8_t  cpp_target;
+		uint8_t  cpp_action;  /**< CPP Action */
+		uint8_t  cpp_token;   /**< CPP Token */
+		uint8_t  cpp_target;  /**< CPP Target ID */
+		/** 256-byte page offset into target's CPP address */
 		uint32_t page_offset;
-		uint32_t page_size;
+		uint32_t page_size;   /**< Size, in 256-byte pages */
 	} region;
 };
 
@@ -147,14 +138,18 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_resource_acquire() - Acquire a resource handle
- * @cpp:	NFP CPP handle
- * @name:	Name of the resource
+/**
+ * Acquire a resource handle
+ *
+ * Note: This function locks the acquired resource.
  *
- * NOTE: This function locks the acquired resource
+ * @param cpp
+ *   NFP CPP handle
+ * @param name
+ *   Name of the resource
  *
- * Return: NFP Resource handle, or NULL
+ * @return
+ *   NFP Resource handle, or NULL
  */
 struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
@@ -183,7 +178,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	}
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 1000000;
+	wait.tv_nsec = 1000000;    /* 1ms */
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
@@ -194,7 +189,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 			goto err_free;
 		}
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 1ms * 1000 = 1s */
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
 			err = -EBUSY;
 			goto err_free;
@@ -213,11 +208,13 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_resource_release() - Release a NFP Resource handle
- * @res:	NFP Resource handle
+/**
+ * Release a NFP Resource handle
  *
- * NOTE: This function implicitly unlocks the resource handle
+ * NOTE: This function implicitly unlocks the resource handle.
+ *
+ * @param res
+ *   NFP Resource handle
  */
 void
 nfp_resource_release(struct nfp_resource *res)
@@ -227,11 +224,14 @@ nfp_resource_release(struct nfp_resource *res)
 	free(res);
 }
 
-/*
- * nfp_resource_cpp_id() - Return the cpp_id of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the cpp_id of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 uint32_t
 nfp_resource_cpp_id(const struct nfp_resource *res)
@@ -239,11 +239,14 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
 	return res->cpp_id;
 }
 
-/*
- * nfp_resource_name() - Return the name of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the name of a resource handle
  *
- * Return: const char pointer to the name of the resource
+ * @param res
+ *   NFP Resource handle
+ *
+ * @return
+ *   Const char pointer to the name of the resource
  */
 const char *
 nfp_resource_name(const struct nfp_resource *res)
@@ -251,11 +254,14 @@ nfp_resource_name(const struct nfp_resource *res)
 	return res->name;
 }
 
-/*
- * nfp_resource_address() - Return the address of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the address of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Address of the resource
+ * @return
+ *   Address of the resource
  */
 uint64_t
 nfp_resource_address(const struct nfp_resource *res)
@@ -263,11 +269,14 @@ nfp_resource_address(const struct nfp_resource *res)
 	return res->addr;
 }
 
-/*
- * nfp_resource_size() - Return the size in bytes of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the size in bytes of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Size of the resource in bytes
+ * @return
+ *   Size of the resource in bytes
  */
 uint64_t
 nfp_resource_size(const struct nfp_resource *res)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 009b7359a4..4236950caf 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -8,43 +8,27 @@
 
 #include "nfp_cpp.h"
 
+/* Netronone Flow Firmware Table */
 #define NFP_RESOURCE_NFP_NFFW           "nfp.nffw"
+
+/* NFP Hardware Info Database */
 #define NFP_RESOURCE_NFP_HWINFO         "nfp.info"
+
+/* Service Processor */
 #define NFP_RESOURCE_NSP		"nfp.sp"
 
-/**
- * Opaque handle to a NFP Resource
- */
+/* Opaque handle to a NFP Resource */
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name);
 
-/**
- * Release a NFP Resource, and free the handle
- * @param[in]   res     NFP Resource handle
- */
 void nfp_resource_release(struct nfp_resource *res);
 
-/**
- * Return the CPP ID of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      CPP ID of the NFP Resource
- */
 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
 
-/**
- * Return the name of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Name of the NFP Resource
- */
 const char *nfp_resource_name(const struct nfp_resource *res);
 
-/**
- * Return the target address of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Address of the NFP Resource
- */
 uint64_t nfp_resource_address(const struct nfp_resource *res);
 
 uint64_t nfp_resource_size(const struct nfp_resource *res);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index d15a920752..0e6c0f9fe1 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -162,11 +162,14 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_rtsym_count() - Get the number of RTSYM descriptors
- * @rtbl:	NFP RTsym table
+/**
+ * Get the number of RTSYM descriptors
+ *
+ * @param rtbl
+ *   NFP RTSYM table
  *
- * Return: Number of RTSYM descriptors
+ * @return
+ *   Number of RTSYM descriptors
  */
 int
 nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
@@ -177,12 +180,16 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
 	return rtbl->num;
 }
 
-/*
- * nfp_rtsym_get() - Get the Nth RTSYM descriptor
- * @rtbl:	NFP RTsym table
- * @idx:	Index (0-based) of the RTSYM descriptor
+/**
+ * Get the Nth RTSYM descriptor
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param idx
+ *   Index (0-based) of the RTSYM descriptor
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
@@ -197,12 +204,16 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
 	return &rtbl->symtab[idx];
 }
 
-/*
- * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
+/**
+ * Return the RTSYM descriptor for a symbol name
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
@@ -227,7 +238,8 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_NONE:
 		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
-	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_OBJECT:
+		/* FALLTHROUGH */
 	case NFP_RTSYM_TYPE_FUNCTION:
 		return sym->size;
 	case NFP_RTSYM_TYPE_ABS:
@@ -327,17 +339,22 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
 	return nfp_cpp_readq(cpp, cpp_id, addr, value);
 }
 
-/*
- * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
- * @error:	Pointer to error code (optional)
+/**
+ * Read a simple unsigned scalar value from symbol
  *
  * Lookup a symbol, map, read it and return it's value. Value of the symbol
  * will be interpreted as a simple little-endian unsigned value. Symbol can
  * be 4 or 8 bytes in size.
  *
- * Return: value read, on error sets the error and returns ~0ULL.
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
+ * @param error
+ *   Pointer to error code (optional)
+ *
+ * @return
+ *   Value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index e7295258b3..ff1facbd17 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -31,12 +31,12 @@
  * of "sram" symbols for backward compatibility, which are viewed as global.
  */
 struct nfp_rtsym {
-	const char *name;
-	uint64_t addr;
-	uint64_t size;
-	int type;
-	int target;
-	int domain;
+	const char *name;  /**< Symbol name */
+	uint64_t addr;     /**< Address in the domain/target's address space */
+	uint64_t size;     /**< Size (in bytes) of the symbol */
+	int type;          /**< NFP_RTSYM_TYPE_* of the symbol */
+	int target;        /**< CPP target identifier, or NFP_RTSYM_TARGET_* */
+	int domain;        /**< CPP target domain */
 };
 
 struct nfp_rtsym_table;
diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c
index 611848e233..540b242a43 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/nfp/nfpcore/nfp_target.c
@@ -767,7 +767,7 @@ nfp_encode_basic(uint64_t *addr,
 		/*
 		 * Make sure we compare against isldN values by clearing the
 		 * LSB. This is what the silicon does.
-		 **/
+		 */
 		isld[0] &= ~1;
 		isld[1] &= ~1;
 
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v5 05/26] net/nfp: standard the local variable coding style
    2023-09-19  9:54  1%         ` [PATCH v5 02/26] net/nfp: unify the indent coding style Chaoyong He
@ 2023-09-19  9:54  3%         ` Chaoyong He
  2023-09-19  9:54  1%         ` [PATCH v5 07/26] net/nfp: standard the comment style Chaoyong He
  2023-09-19  9:54  5%         ` [PATCH v5 18/26] net/nfp: refact the nsp module Chaoyong He
  3 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-19  9:54 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He

There should only declare one local variable in each line, and the local
variable should be arranged from short to long in the function.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 58 ++++++++++++----------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 14 +++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 27 ++++++----
 drivers/net/nfp/nfpcore/nfp_mip.c          |  8 +--
 drivers/net/nfp/nfpcore/nfp_mutex.c        | 25 ++++++----
 drivers/net/nfp/nfpcore/nfp_nffw.c         | 15 +++---
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 40 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |  8 +--
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 39 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_resource.c     | 15 +++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 19 ++++---
 11 files changed, 151 insertions(+), 117 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index ec14ec45dc..78beee07ef 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -140,9 +140,9 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		size_t size,
 		int width)
 {
-	uint32_t bitsize;
-	uint32_t newcfg;
 	uint64_t mask;
+	uint32_t newcfg;
+	uint32_t bitsize;
 
 	if (tgt >= 16)
 		return -EINVAL;
@@ -239,7 +239,8 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 		struct nfp_bar *bar,
 		uint32_t newcfg)
 {
-	int base, slot;
+	int base;
+	int slot;
 
 	base = bar->index >> 3;
 	slot = bar->index & 7;
@@ -268,9 +269,9 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 		size_t size,
 		int width)
 {
-	uint64_t newbase;
-	uint32_t newcfg;
 	int err;
+	uint32_t newcfg;
+	uint64_t newbase;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
 			size, width);
@@ -303,8 +304,10 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 static int
 nfp_enable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -333,8 +336,10 @@ nfp_enable_bars(struct nfp_pcie_user *nfp)
 static struct nfp_bar *
 nfp_alloc_bar(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -356,8 +361,10 @@ nfp_alloc_bar(struct nfp_pcie_user *nfp)
 static void
 nfp_disable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -403,12 +410,13 @@ nfp6000_area_init(struct nfp_cpp_area *area,
 		uint64_t address,
 		size_t size)
 {
-	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
-	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	int pp;
+	int ret = 0;
+	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	uint32_t target = NFP_CPP_ID_TARGET_of(dest);
 	uint32_t action = NFP_CPP_ID_ACTION_of(dest);
-	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
-	int pp, ret = 0;
+	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 
 	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
@@ -493,14 +501,14 @@ nfp6000_area_read(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
+	size_t n;
+	int width;
+	bool is_64;
+	uint32_t *wrptr32 = kernel_vaddr;
 	uint64_t *wrptr64 = kernel_vaddr;
-	const volatile uint64_t *rdptr64;
 	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32 = kernel_vaddr;
 	const volatile uint32_t *rdptr32;
-	int width;
-	size_t n;
-	bool is_64;
+	const volatile uint64_t *rdptr64;
 
 	priv = nfp_cpp_area_priv(area);
 	rdptr64 = (uint64_t *)(priv->iomem + offset);
@@ -563,14 +571,14 @@ nfp6000_area_write(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
-	const uint64_t *rdptr64 = kernel_vaddr;
-	uint64_t *wrptr64;
-	const uint32_t *rdptr32 = kernel_vaddr;
-	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32;
-	int width;
 	size_t n;
+	int width;
 	bool is_64;
+	uint32_t *wrptr32;
+	uint64_t *wrptr64;
+	struct nfp6000_area_priv *priv;
+	const uint32_t *rdptr32 = kernel_vaddr;
+	const uint64_t *rdptr64 = kernel_vaddr;
 
 	priv = nfp_cpp_area_priv(area);
 	wrptr64 = (uint64_t *)(priv->iomem + offset);
@@ -693,10 +701,10 @@ static int
 nfp6000_set_serial(struct rte_pci_device *dev,
 		struct nfp_cpp *cpp)
 {
+	off_t pos;
 	uint16_t tmp;
 	uint8_t serial[6];
 	int serial_len = 6;
-	off_t pos;
 
 	pos = rte_pci_find_ext_capability(dev, RTE_PCI_EXT_CAP_ID_DSN);
 	if (pos <= 0) {
@@ -741,8 +749,8 @@ static int
 nfp6000_set_barsz(struct rte_pci_device *dev,
 		struct nfp_pcie_user *desc)
 {
-	uint64_t tmp;
 	int i = 0;
+	uint64_t tmp;
 
 	tmp = dev->mem_resource[0].len;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 7e7c36eda3..2e5a4e7349 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -172,9 +172,9 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t size)
 {
+	int err;
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
-	int err;
 
 	if (cpp == NULL)
 		return NULL;
@@ -396,8 +396,8 @@ static uint32_t
 nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 		uint32_t *xpb_addr)
 {
-	uint32_t xpb;
 	int island;
+	uint32_t xpb;
 
 	xpb = NFP_CPP_ID(14, NFP_CPP_ACTION_RW, 0);
 
@@ -569,9 +569,9 @@ static struct nfp_cpp *
 nfp_cpp_alloc(struct rte_pci_device *dev,
 		int driver_lock_needed)
 {
-	const struct nfp_cpp_operations *ops;
-	struct nfp_cpp *cpp;
 	int err;
+	struct nfp_cpp *cpp;
+	const struct nfp_cpp_operations *ops;
 
 	ops = nfp_cpp_transport_operations();
 
@@ -657,8 +657,8 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 		void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
@@ -687,8 +687,8 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 		const void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL)
@@ -708,8 +708,8 @@ uint32_t
 __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 		uint32_t *model)
 {
-	uint32_t reg;
 	int err;
+	uint32_t reg;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
 			&reg);
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index ea4c7d6a9e..819761eda0 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -36,7 +36,9 @@ static int
 nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
 		uint32_t size)
 {
-	const char *key, *val, *end = hwinfo->data + size;
+	const char *key;
+	const char *val;
+	const char *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
 			key = val + strlen(val) + 1) {
@@ -58,7 +60,9 @@ static int
 nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 		uint32_t len)
 {
-	uint32_t size, new_crc, *crc;
+	uint32_t *crc;
+	uint32_t size;
+	uint32_t new_crc;
 
 	size = db->size;
 	if (size > len) {
@@ -82,12 +86,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 		size_t *cpp_size)
 {
-	struct nfp_hwinfo *header;
-	void *res;
-	uint64_t cpp_addr;
-	uint32_t cpp_id;
 	int err;
+	void *res;
 	uint8_t *db;
+	uint32_t cpp_id;
+	uint64_t cpp_addr;
+	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
 	if (res) {
@@ -135,13 +139,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 		size_t *hwdb_size)
 {
+	int count = 0;
 	struct timespec wait;
 	struct nfp_hwinfo *db;
-	int count;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 10000000;
-	count = 0;
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -159,9 +162,9 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 struct nfp_hwinfo *
 nfp_hwinfo_read(struct nfp_cpp *cpp)
 {
-	struct nfp_hwinfo *db;
-	size_t hwdb_size = 0;
 	int err;
+	size_t hwdb_size = 0;
+	struct nfp_hwinfo *db;
 
 	db = nfp_hwinfo_fetch(cpp, &hwdb_size);
 	if (db == NULL)
@@ -186,7 +189,9 @@ const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
 		const char *lookup)
 {
-	const char *key, *val, *end;
+	const char *key;
+	const char *val;
+	const char *end;
 
 	if (hwinfo == NULL || lookup == NULL)
 		return NULL;
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 0071d3fc37..1e601313b4 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -68,10 +68,10 @@ static int
 nfp_mip_read_resource(struct nfp_cpp *cpp,
 		struct nfp_mip *mip)
 {
-	struct nfp_nffw_info *nffw_info;
-	uint32_t cpp_id;
-	uint64_t addr;
 	int err;
+	uint64_t addr;
+	uint32_t cpp_id;
+	struct nfp_nffw_info *nffw_info;
 
 	nffw_info = nfp_nffw_info_open(cpp);
 	if (nffw_info == NULL)
@@ -100,8 +100,8 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
 {
-	struct nfp_mip *mip;
 	int err;
+	struct nfp_mip *mip;
 
 	mip = malloc(sizeof(*mip));
 	if (mip == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index edc8137304..5be437b354 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -79,9 +79,9 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
+	int err;
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
-	int err;
 
 	err = _nfp_cpp_mutex_validate(model, &target, address);
 	if (err < 0)
@@ -122,11 +122,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
-	uint32_t model = nfp_cpp_model(cpp);
-	struct nfp_cpp_mutex *mutex;
-	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 	int err;
 	uint32_t tmp;
+	struct nfp_cpp_mutex *mutex;
+	uint32_t model = nfp_cpp_model(cpp);
+	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 
 	/* Look for cached mutex */
 	for (mutex = cpp->mutex_cache; mutex; mutex = mutex->next) {
@@ -242,12 +242,13 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 {
-	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
-	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
+	int err;
+	uint32_t key;
+	uint32_t value;
 	struct nfp_cpp *cpp = mutex->cpp;
-	uint32_t key, value;
 	uint16_t interface = nfp_cpp_interface(cpp);
-	int err;
+	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
+	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 
 	if (mutex->depth > 1) {
 		mutex->depth--;
@@ -296,12 +297,14 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 {
+	int err;
+	uint32_t key;
+	uint32_t tmp;
+	uint32_t value;
+	struct nfp_cpp *cpp = mutex->cpp;
 	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
 	uint32_t mus = NFP_CPP_ID(mutex->target, 5, 3);	/* test_set_imm */
-	uint32_t key, value, tmp;
-	struct nfp_cpp *cpp = mutex->cpp;
-	int err;
 
 	if (mutex->depth > 0) {
 		if (mutex->depth == MUTEX_DEPTH_MAX)
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 2412dc0e00..9123fc742a 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -68,9 +68,11 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 static int
 nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 {
-	uint32_t mode, addr40;
-	uint32_t xpbaddr, imbcppat;
 	int err;
+	uint32_t mode;
+	uint32_t addr40;
+	uint32_t xpbaddr;
+	uint32_t imbcppat;
 
 	/* Hardcoded XPB IMB Base, island 0 */
 	xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4;
@@ -118,10 +120,10 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
 {
-	struct nfp_nffw_info_data *fwinf;
-	struct nfp_nffw_info *state;
-	uint32_t info_ver;
 	int err;
+	uint32_t info_ver;
+	struct nfp_nffw_info *state;
+	struct nfp_nffw_info_data *fwinf;
 
 	state = malloc(sizeof(*state));
 	if (state == NULL)
@@ -183,8 +185,9 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 {
+	uint32_t i;
+	uint32_t cnt;
 	struct nffw_fwinfo *fwinfo;
-	uint32_t cnt, i;
 
 	cnt = nffw_res_fwinfos(&state->fwinf, &fwinfo);
 	if (cnt == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index dfe396c8ac..4861772a98 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -72,10 +72,11 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 static int
 nfp_nsp_check(struct nfp_nsp *state)
 {
-	struct nfp_cpp *cpp = state->cpp;
-	uint64_t nsp_status, reg;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t nsp_status;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
@@ -113,9 +114,9 @@ nfp_nsp_check(struct nfp_nsp *state)
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
 {
-	struct nfp_resource *res;
-	struct nfp_nsp *state;
 	int err;
+	struct nfp_nsp *state;
+	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
 	if (res == NULL)
@@ -170,13 +171,12 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 		uint64_t mask,
 		uint64_t val)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	uint32_t count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -217,10 +217,15 @@ nfp_nsp_command(struct nfp_nsp *state,
 		uint32_t buff_cpp,
 		uint64_t buff_addr)
 {
-	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
-	struct nfp_cpp *cpp = state->cpp;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t ret_val;
+	uint64_t nsp_base;
+	uint64_t nsp_buffer;
+	uint64_t nsp_status;
+	uint64_t nsp_command;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_base = nfp_resource_address(state->res);
@@ -296,11 +301,13 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 		void *out_buf,
 		unsigned int out_size)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	int err;
+	int ret;
+	uint64_t reg;
 	size_t max_size;
-	uint64_t reg, cpp_buf;
-	int ret, err;
 	uint32_t cpp_id;
+	uint64_t cpp_buf;
+	struct nfp_cpp *cpp = nsp->cpp;
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
@@ -360,13 +367,12 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	int count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 31677b66e6..3081e22dad 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -26,9 +26,9 @@ struct nsp_identify {
 struct nfp_nsp_identify *
 __nfp_nsp_identify(struct nfp_nsp *nsp)
 {
-	struct nfp_nsp_identify *nspi = NULL;
-	struct nsp_identify *ni;
 	int ret;
+	struct nsp_identify *ni;
+	struct nfp_nsp_identify *nspi = NULL;
 
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 15)
 		return NULL;
@@ -77,9 +77,9 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
 		enum nfp_nsp_sensor_id id,
 		uint32_t *val)
 {
-	struct nfp_sensors s;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	struct nfp_sensors s;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index bc155b44d8..9b7c8aa7f8 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -150,9 +150,10 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 		uint32_t index,
 		struct nfp_eth_table_port *dst)
 {
-	uint32_t rate;
 	uint32_t fec;
-	uint64_t port, state;
+	uint64_t port;
+	uint32_t rate;
+	uint64_t state;
 
 	port = rte_le_to_cpu_64(src->port);
 	state = rte_le_to_cpu_64(src->state);
@@ -200,7 +201,8 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 static void
 nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 {
-	uint32_t i, j;
+	uint32_t i;
+	uint32_t j;
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
@@ -242,12 +244,13 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 static struct nfp_eth_table *
 __nfp_eth_read_ports(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries;
-	struct nfp_eth_table *table;
-	uint32_t table_sz;
+	int ret;
 	uint32_t i;
 	uint32_t j;
-	int ret, cnt = 0;
+	int cnt = 0;
+	uint32_t table_sz;
+	struct nfp_eth_table *table;
+	union eth_table_entry *entries;
 	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
@@ -321,8 +324,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
 {
-	struct nfp_eth_table *ret;
 	struct nfp_nsp *nsp;
+	struct nfp_eth_table *ret;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
@@ -338,9 +341,9 @@ struct nfp_nsp *
 nfp_eth_config_start(struct nfp_cpp *cpp,
 		uint32_t idx)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -401,8 +404,8 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	int ret = 1;
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	if (nfp_nsp_config_modified(nsp)) {
 		ret = nfp_nsp_write_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
@@ -433,9 +436,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int enable)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -475,9 +478,9 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int configed)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -516,9 +519,9 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 		uint32_t val,
 		const uint64_t ctrl_bit)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
-	uint32_t idx = nfp_nsp_config_idx(nsp);
 	uint64_t reg;
+	uint32_t idx = nfp_nsp_config_idx(nsp);
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
@@ -604,8 +607,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 		uint32_t idx,
 		enum nfp_eth_fec mode)
 {
-	struct nfp_nsp *nsp;
 	int err;
+	struct nfp_nsp *nsp;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 9dd4832779..fa92f2762e 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -67,10 +67,12 @@ static int
 nfp_cpp_resource_find(struct nfp_cpp *cpp,
 		struct nfp_resource *res)
 {
-	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
+	int ret;
+	uint32_t i;
+	uint32_t key;
+	uint32_t cpp_id;
 	struct nfp_resource_entry entry;
-	uint32_t cpp_id, key;
-	int ret, i;
+	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 
 	cpp_id = NFP_CPP_ID(NFP_RESOURCE_TBL_TARGET, 3, 0);  /* Atomic read */
 
@@ -152,11 +154,11 @@ struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name)
 {
-	struct nfp_cpp_mutex *dev_mutex;
-	struct nfp_resource *res;
 	int err;
+	uint16_t count = 0;
 	struct timespec wait;
-	uint16_t count;
+	struct nfp_resource *res;
+	struct nfp_cpp_mutex *dev_mutex;
 
 	res = malloc(sizeof(*res));
 	if (res == NULL)
@@ -175,7 +177,6 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 1000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 243d3c9ce5..a34278beca 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -85,8 +85,8 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 struct nfp_rtsym_table *
 nfp_rtsym_table_read(struct nfp_cpp *cpp)
 {
-	struct nfp_rtsym_table *rtbl;
 	struct nfp_mip *mip;
+	struct nfp_rtsym_table *rtbl;
 
 	mip = nfp_mip_open(cpp);
 	rtbl = __nfp_rtsym_table_read(cpp, mip);
@@ -99,13 +99,18 @@ struct nfp_rtsym_table *
 __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 		const struct nfp_mip *mip)
 {
-	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
-	struct nfp_rtsym_entry *rtsymtab;
+	int n;
+	int err;
+	uint32_t size;
+	uint32_t strtab_addr;
+	uint32_t symtab_addr;
+	uint32_t strtab_size;
+	uint32_t symtab_size;
 	struct nfp_rtsym_table *cache;
+	struct nfp_rtsym_entry *rtsymtab;
 	const uint32_t dram =
 		NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) |
 		NFP_ISL_EMEM0;
-	int err, n, size;
 
 	if (mip == NULL)
 		return NULL;
@@ -341,10 +346,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		const char *name,
 		int *error)
 {
-	const struct nfp_rtsym *sym;
-	uint32_t val32;
-	uint64_t val;
 	int err;
+	uint64_t val;
+	uint32_t val32;
+	const struct nfp_rtsym *sym;
 
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-- 
2.39.1


^ permalink raw reply	[relevance 3%]

* [PATCH v5 02/26] net/nfp: unify the indent coding style
  @ 2023-09-19  9:54  1%         ` Chaoyong He
  2023-09-19  9:54  3%         ` [PATCH v5 05/26] net/nfp: standard the local variable " Chaoyong He
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-19  9:54 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He

Each parameter of function should occupy one line, and indent two TAB
character.
All the statement which span multi line should indent two TAB character.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
 drivers/net/nfp/nfpcore/nfp_crc.c          |  19 ++-
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
 drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
 drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  12 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  72 +++++----
 drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
 17 files changed, 463 insertions(+), 331 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 8f87c09327..54bef3cb6b 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -56,7 +56,8 @@ struct nfp_cpp_operations {
 	size_t area_priv_size;
 
 	/* Instance an NFP CPP */
-	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
+	int (*init)(struct nfp_cpp *cpp,
+			struct rte_pci_device *dev);
 
 	/*
 	 * Free the bus.
@@ -69,9 +70,9 @@ struct nfp_cpp_operations {
 	 * NOTE: This is _not_ serialized
 	 */
 	int (*area_init)(struct nfp_cpp_area *area,
-			 uint32_t dest,
-			 unsigned long long address,
-			 unsigned long size);
+			uint32_t dest,
+			unsigned long long address,
+			unsigned long size);
 	/*
 	 * Clean up a NFP CPP area before it is freed
 	 * NOTE: This is _not_ serialized
@@ -101,17 +102,17 @@ struct nfp_cpp_operations {
 	 * Serialized
 	 */
 	int (*area_read)(struct nfp_cpp_area *area,
-			 void *kernel_vaddr,
-			 unsigned long offset,
-			 unsigned int length);
+			void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 	/*
 	 * Perform a write to a NFP CPP area
 	 * Serialized
 	 */
 	int (*area_write)(struct nfp_cpp_area *area,
-			  const void *kernel_vaddr,
-			  unsigned long offset,
-			  unsigned int length);
+			const void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 };
 
 /*
@@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
  * @param   len     Length of the serial byte array
  */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		       size_t serial_len);
+		size_t serial_len);
 
 /*
  * Set the private data of the nfp_cpp instance
@@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
-					 int driver_lock_needed);
+		int driver_lock_needed);
 
 /*
  * Free a NFP CPP handle
@@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
-					unsigned long long address,
-					unsigned long size);
+		unsigned long long address, unsigned long size);
 
 /*
  * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
@@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
-						  uint32_t cpp_id,
-						  const char *name,
-						  unsigned long long address,
-						  unsigned long size);
+		uint32_t cpp_id, const char *name, unsigned long long address,
+		unsigned long size);
 
 /*
  * Free an allocated NFP CPP area handle
@@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
-						uint32_t cpp_id,
-						unsigned long long address,
-						unsigned long size);
+		uint32_t cpp_id, unsigned long long address, unsigned long size);
 
 /*
  * Release the resources, then free the NFP CPP area handle
@@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
-			   uint64_t addr, unsigned long size,
-			   struct nfp_cpp_area **area);
+		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
 /*
  * Return an IO pointer to the beginning of the NFP CPP area handle. The area
  * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
@@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
  *
  */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		      void *buffer, size_t length);
+		void *buffer, size_t length);
 
 /*
  * Write to a NFP CPP area handle from a buffer. The area must be acquired with
@@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		       const void *buffer, size_t length);
+		const void *buffer, size_t length);
 
 /*
  * nfp_cpp_area_iomem() - get IOMEM region for CPP area
@@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
-			     unsigned long long offset, unsigned long size);
+		unsigned long long offset, unsigned long size);
 
 /*
  * Get the NFP CPP handle that is the parent of a NFP CPP area handle
@@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
  * @return bytes read on success, -1 on failure.
  */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
-		 unsigned long long address, void *kernel_vaddr, size_t length);
+		unsigned long long address, void *kernel_vaddr, size_t length);
 
 /*
  * Write a block of data to a NFP CPP ID
@@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, -1 on failure.
  */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, const void *kernel_vaddr,
-		  size_t length);
+		unsigned long long address, const void *kernel_vaddr,
+		size_t length);
 
 
 
@@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		      uint32_t value, size_t length);
+		uint32_t value, size_t length);
 
 /*
  * Read a single 32-bit value from a NFP CPP area handle
@@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		       uint32_t *value);
+		uint32_t *value);
 
 /*
  * Write a single 32-bit value to a NFP CPP area handle
@@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-			uint32_t value);
+		uint32_t value);
 
 /*
  * Read a single 64-bit value from a NFP CPP area handle
@@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		       uint64_t *value);
+		uint64_t *value);
 
 /*
  * Write a single 64-bit value to a NFP CPP area handle
@@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-			uint64_t value);
+		uint64_t value);
 
 /*
  * Write a single 32-bit value on the XPB bus
@@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
  * @return 0 on success, or -1 on failure.
  */
 int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		    uint32_t value);
+		uint32_t value);
 
 /*
  * Modify bits of a 32-bit value from the XPB bus
@@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, negative value on failure.
  */
 int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		   uint32_t value, int timeout_us);
+		uint32_t value, int timeout_us);
 
 /*
  * Read a 32-bit word from a NFP CPP ID
@@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint32_t *value);
+		unsigned long long address, uint32_t *value);
 
 /*
  * Write a 32-bit value to a NFP CPP ID
@@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
  *
  */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint32_t value);
+		unsigned long long address, uint32_t value);
 
 /*
  * Read a 64-bit work from a NFP CPP ID
@@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint64_t *value);
+		unsigned long long address, uint64_t *value);
 
 /*
  * Write a 64-bit value to a NFP CPP ID
@@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint64_t value);
+		unsigned long long address, uint64_t value);
 
 /*
  * Initialize a mutex location
@@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
-		       unsigned long long address, uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Create a mutex handle from an address controlled by a MU Atomic engine
@@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
  *                      failure.
  */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-					  unsigned long long address,
-					  uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Get the NFP CPP handle the mutex was created with
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 2ee60eefc3..884cc84eaa 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
 #define TARGET_WIDTH_64    8
 
 static int
-nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
-		uint64_t *bar_base, int tgt, int act, int tok,
-		uint64_t offset, size_t size, int width)
+nfp_compute_bar(const struct nfp_bar *bar,
+		uint32_t *bar_config,
+		uint64_t *bar_base,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint32_t bitsize;
 	uint32_t newcfg;
@@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 
 	switch (width) {
 	case 8:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
 		break;
 	case 4:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
 		break;
 	case 0:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
 		break;
 	default:
 		return -EINVAL;
@@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 		/* Fixed CPP mapping with specific action */
 		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
 
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size), act,
-				    (unsigned long long)mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size), act,
+					(unsigned long long)mask);
 			return -EINVAL;
 		}
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-			    bar->index, tgt, act, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + mask));
+				bar->index, tgt, act, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + mask));
 
 		bitsize = 40 - 16;
 	} else {
 		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
 
 		/* Bulk mapping */
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
 
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size),
-				    tgt, tok, (unsigned long long)mask,
-				    (unsigned long long)(offset & mask),
-				    (unsigned long long)(offset + size - 1) & mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size),
+					tgt, tok, (unsigned long long)mask,
+					(unsigned long long)(offset & mask),
+					(unsigned long long)(offset + size - 1) & mask);
 			return -EINVAL;
 		}
 
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-			    bar->index, tgt, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + ~mask));
+				bar->index, tgt, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + ~mask));
 
 		bitsize = 40 - 21;
 	}
 
 	if (bar->bitsize < bitsize) {
 		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-			    tgt, tok, act);
+				tgt, tok, act);
 		return -EINVAL;
 	}
 
@@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 }
 
 static int
-nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
-		  uint32_t newcfg)
+nfp_bar_write(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		uint32_t newcfg)
 {
 	int base, slot;
 
@@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 		return (-ENOMEM);
 
 	bar->csr = nfp->cfg +
-		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
+			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
 
 	*(uint32_t *)(bar->csr) = newcfg;
 
@@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 }
 
 static int
-nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
-		int act, int tok, uint64_t offset, size_t size, int width)
+nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint64_t newbase;
 	uint32_t newcfg;
 	int err;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
-			      size, width);
+			size, width);
 	if (err != 0)
 		return err;
 
@@ -390,8 +398,10 @@ struct nfp6000_area_priv {
 };
 
 static int
-nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
-		  unsigned long long address, unsigned long size)
+nfp6000_area_init(struct nfp_cpp_area *area,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
@@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	int pp, ret = 0;
 
-	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
-				     address);
+	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
 		return pp;
 
@@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->width.write = PULL_WIDTH(pp);
 
 	if (priv->width.read > 0 &&
-	    priv->width.write > 0 && priv->width.read != priv->width.write)
+			priv->width.write > 0 &&
+			priv->width.read != priv->width.write)
 		return -EINVAL;
 
 	if (priv->width.read > 0)
@@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->size = size;
 
 	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
-				  priv->token, priv->offset, priv->size,
-				  priv->width.bar);
+			priv->token, priv->offset, priv->size,
+			priv->width.bar);
 
 	return ret;
 }
@@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
 
 	/* Calculate offset into BAR. */
 	if (nfp_bar_maptype(priv->bar) ==
-	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
+			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
 		priv->bar_offset = priv->offset &
-			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
-		priv->bar_offset +=
-			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
-							   priv->target);
-		priv->bar_offset +=
-		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
+				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
+				priv->target);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
+				priv->token);
 	} else {
 		priv->bar_offset = priv->offset & priv->bar->mask;
 	}
@@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
 }
 
 static int
-nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
-		  unsigned long offset, unsigned int length)
+nfp6000_area_read(struct nfp_cpp_area *area,
+		void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	uint64_t *wrptr64 = kernel_vaddr;
 	const volatile uint64_t *rdptr64;
@@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 
 	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW) {
+			priv->action == NFP_CPP_ACTION_RW) {
 		is_64 = false;
 	}
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 }
 
 static int
-nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
-		   unsigned long offset, unsigned int length)
+nfp6000_area_write(struct nfp_cpp_area *area,
+		const void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	const uint64_t *rdptr64 = kernel_vaddr;
 	uint64_t *wrptr64;
@@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
 
 	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW)
+			priv->action == NFP_CPP_ACTION_RW)
 		is_64 = false;
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_model(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint32_t model;
 
@@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_interface(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t interface;
 
@@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_serial(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t tmp;
 	uint8_t serial[6];
@@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
+nfp6000_set_barsz(struct rte_pci_device *dev,
+		struct nfp_pcie_user *desc)
 {
 	unsigned long tmp;
 	int i = 0;
@@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
+nfp6000_init(struct nfp_cpp *cpp,
+		struct rte_pci_device *dev)
 {
 	int ret = 0;
 	struct nfp_pcie_user *desc;
@@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
 	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
-	    cpp->driver_lock_needed) {
+			cpp->driver_lock_needed) {
 		ret = nfp_acquire_process_lock(desc);
 		if (ret != 0)
 			goto error;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 31338e0047..f764208a9a 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -27,7 +27,8 @@
 						NFP_PL_DEVICE_ID_MASK)
 
 void
-nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
+nfp_cpp_priv_set(struct nfp_cpp *cpp,
+		void *priv)
 {
 	cpp->priv = priv;
 }
@@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
+nfp_cpp_model_set(struct nfp_cpp *cpp,
+		uint32_t model)
 {
 	cpp->model = model;
 }
@@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
+nfp_cpp_interface_set(struct nfp_cpp *cpp,
+		uint32_t interface)
 {
 	cpp->interface = interface;
 }
 
 int
-nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
+nfp_cpp_serial(struct nfp_cpp *cpp,
+		const uint8_t **serial)
 {
 	*serial = cpp->serial;
 	return cpp->serial_len;
 }
 
 int
-nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		   size_t serial_len)
+nfp_cpp_serial_set(struct nfp_cpp *cpp,
+		const uint8_t *serial,
+		size_t serial_len)
 {
 	if (cpp->serial_len)
 		free(cpp->serial);
@@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
  * NOTE: @address and @size must be 32-bit aligned values.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
-			      const char *name, unsigned long long address,
-			      unsigned long size)
+nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
+		uint32_t dest,
+		const char *name,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
@@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 		name = "";
 
 	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
-		      strlen(name) + 1);
+			strlen(name) + 1);
 	if (area == NULL)
 		return NULL;
 
@@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 }
 
 struct nfp_cpp_area *
-nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
-		    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc(struct nfp_cpp *cpp,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
@@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
  * NOTE: The area must also be 'released' when the structure is freed.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
-			    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 
@@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		  void *kernel_vaddr, size_t length)
+nfp_cpp_area_read(struct nfp_cpp_area *area,
+		unsigned long offset,
+		void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		   const void *kernel_vaddr, size_t length)
+nfp_cpp_area_write(struct nfp_cpp_area *area,
+		unsigned long offset,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
  * or negative value on error.
  */
 int
-nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
-			 unsigned long length)
+nfp_cpp_area_check_range(struct nfp_cpp_area *area,
+		unsigned long long offset,
+		unsigned long length)
 {
 	if (((offset + length) > area->size))
 		return -EFAULT;
@@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
  * based upon NFP model.
  */
 static uint32_t
-nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
+nfp_xpb_to_cpp(struct nfp_cpp *cpp,
+		uint32_t *xpb_addr)
 {
 	uint32_t xpb;
 	int island;
@@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 		else
 			/* And only non-ARM interfaces use island id = 1 */
 			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
-			    NFP_CPP_INTERFACE_TYPE_ARM)
+					NFP_CPP_INTERFACE_TYPE_ARM)
 				*xpb_addr |= (1 << 24);
 	} else {
 		(*xpb_addr) |= (1 << 30);
@@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 }
 
 int
-nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		   uint32_t *value)
+nfp_cpp_area_readl(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp = 0;
@@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-		    uint32_t value)
+nfp_cpp_area_writel(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value)
 {
 	int sz;
 
@@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		   uint64_t *value)
+nfp_cpp_area_readq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp = 0;
@@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-		    uint64_t value)
+nfp_cpp_area_writeq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t value)
 {
 	int sz;
 
@@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint32_t *value)
+nfp_cpp_readl(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp;
@@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint32_t value)
+nfp_cpp_writel(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t value)
 {
 	int sz;
 
@@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint64_t *value)
+nfp_cpp_readq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp;
@@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint64_t value)
+nfp_cpp_writeq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t value)
 {
 	int sz;
 
@@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
+nfp_xpb_writel(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t value)
 {
 	uint32_t cpp_dest;
 
@@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
 }
 
 int
-nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
+nfp_xpb_readl(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t *value)
 {
 	uint32_t cpp_dest;
 
@@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
 }
 
 static struct nfp_cpp *
-nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_alloc(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	const struct nfp_cpp_operations *ops;
 	struct nfp_cpp *cpp;
@@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 			/* Hardcoded XPB IMB Base, island 0 */
 			xpbaddr = 0x000a0000 + (tgt * 4);
 			err = nfp_xpb_readl(cpp, xpbaddr,
-				(uint32_t *)&cpp->imb_cat_table[tgt]);
+					(uint32_t *)&cpp->imb_cat_table[tgt]);
 			if (err < 0) {
 				free(cpp);
 				return NULL;
@@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 }
 
 struct nfp_cpp *
-nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_from_device_name(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
@@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
  * @return 0 on success, or -1 on failure.
  */
 int
-nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
+nfp_xpb_writelm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
 		uint32_t value)
 {
 	int err;
@@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, or negative value on failure.
  */
 int
-nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-	       uint32_t value, int timeout_us)
+nfp_xpb_waitlm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
+		uint32_t value,
+		int timeout_us)
 {
 	uint32_t tmp;
 	int err;
@@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @length:     number of bytes to read
  */
 int
-nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
-	     unsigned long long address, void *kernel_vaddr, size_t length)
+nfp_cpp_read(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     number of bytes to write
  */
 int
-nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
-	      unsigned long long address, const void *kernel_vaddr,
-	      size_t length)
+nfp_cpp_write(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     length of area to fill
  */
 int
-nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		  uint32_t value, size_t length)
+nfp_cpp_area_fill(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value,
+		size_t length)
 {
 	int err;
 	size_t i;
@@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value64,
-				       sizeof(value64));
+		err = nfp_cpp_area_write(area, offset + i, &value64,
+				sizeof(value64));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value64))
@@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	if ((i + sizeof(value)) <= length) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
+		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value))
@@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * as those are model-specific
  */
 uint32_t
-__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
+__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
+		uint32_t *model)
 {
 	uint32_t reg;
 	int err;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
-			    &reg);
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 unsigned long size, struct nfp_cpp_area **area)
+nfp_cpp_map_area(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		unsigned long size,
+		struct nfp_cpp_area **area)
 {
 	uint8_t *res;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_crc.c b/drivers/net/nfp/nfpcore/nfp_crc.c
index 20431bf845..2cd8866253 100644
--- a/drivers/net/nfp/nfpcore/nfp_crc.c
+++ b/drivers/net/nfp/nfpcore/nfp_crc.c
@@ -9,27 +9,31 @@
 #include "nfp_crc.h"
 
 static inline uint32_t
-nfp_crc32_be_generic(uint32_t crc, unsigned char const *p, size_t len,
-		 uint32_t polynomial)
+nfp_crc32_be_generic(uint32_t crc,
+		unsigned char const *p,
+		size_t len,
+		uint32_t polynomial)
 {
 	int i;
 	while (len--) {
 		crc ^= *p++ << 24;
 		for (i = 0; i < 8; i++)
-			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
-					  0);
+			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial : 0);
 	}
 	return crc;
 }
 
 static inline uint32_t
-nfp_crc32_be(uint32_t crc, unsigned char const *p, size_t len)
+nfp_crc32_be(uint32_t crc,
+		unsigned char const *p,
+		size_t len)
 {
 	return nfp_crc32_be_generic(crc, p, len, CRCPOLY_BE);
 }
 
 static uint32_t
-nfp_crc32_posix_end(uint32_t crc, size_t total_len)
+nfp_crc32_posix_end(uint32_t crc,
+		size_t total_len)
 {
 	/* Extend with the length of the string. */
 	while (total_len != 0) {
@@ -43,7 +47,8 @@ nfp_crc32_posix_end(uint32_t crc, size_t total_len)
 }
 
 uint32_t
-nfp_crc32_posix(const void *buff, size_t len)
+nfp_crc32_posix(const void *buff,
+		size_t len)
 {
 	return nfp_crc32_posix_end(nfp_crc32_be(0, buff, len), len);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index a9d166c4dc..ea4c7d6a9e 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
 }
 
 static int
-nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
+nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
+		uint32_t size)
 {
 	const char *key, *val, *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 		if (val >= end) {
 			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
@@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
 }
 
 static int
-nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
+nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
+		uint32_t len)
 {
 	uint32_t size, new_crc, *crc;
 
@@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
 		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
-			    new_crc, *crc);
+				new_crc, *crc);
 		return -EINVAL;
 	}
 
@@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
+nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
+		size_t *cpp_size)
 {
 	struct nfp_hwinfo *header;
 	void *res;
@@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
 		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
-			header->version);
+				header->version);
 		goto exit_free;
 	}
 
@@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
+nfp_hwinfo_fetch(struct nfp_cpp *cpp,
+		size_t *hwdb_size)
 {
 	struct timespec wait;
 	struct nfp_hwinfo *db;
@@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
  * Return: Value of the HWInfo name, or NULL
  */
 const char *
-nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
+nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
+		const char *lookup)
 {
 	const char *key, *val, *end;
 
@@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
 	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 
 		if (strcmp(key, lookup) == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index f9723dd136..0071d3fc37 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -37,8 +37,10 @@ struct nfp_mip {
 
 /* Read memory and check if it could be a valid MIP */
 static int
-nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 struct nfp_mip *mip)
+nfp_mip_try_read(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		struct nfp_mip *mip)
 {
 	int ret;
 
@@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
 		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
-			    rte_le_to_cpu_32(mip->signature));
+				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
 		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
-			    rte_le_to_cpu_32(mip->mip_version));
+				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
 
@@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 
 /* Try to locate MIP using the resource table */
 static int
-nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
+nfp_mip_read_resource(struct nfp_cpp *cpp,
+		struct nfp_mip *mip)
 {
 	struct nfp_nffw_info *nffw_info;
 	uint32_t cpp_id;
@@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
  * @size:	Location for size of MIP symbol table
  */
 void
-nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_symtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->symtab_addr);
 	*size = rte_le_to_cpu_32(mip->symtab_size);
@@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
  * @size:	Location for size of MIP symbol name table
  */
 void
-nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_strtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->strtab_addr);
 	*size = rte_le_to_cpu_32(mip->strtab_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
index d0919b58fe..980abc2517 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.h
+++ b/drivers/net/nfp/nfpcore/nfp_mip.h
@@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
 void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			    uint64_t *off);
+		uint64_t *off);
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 0410a00856..047e755416 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
 };
 
 static int
-_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
+_nfp_cpp_mutex_validate(uint32_t model,
+		int *target,
+		unsigned long long address)
 {
 	/* Address must be 64-bit aligned */
 	if ((address & 7) != 0)
@@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
  * @return 0 on success, or negative value on failure.
  */
 int
-nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
-		   uint32_t key)
+nfp_cpp_mutex_init(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
@@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
 	if (err < 0)
 		return err;
 
-	err =
-	    nfp_cpp_writel(cpp, muw, address + 0,
-			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
+	err = nfp_cpp_writel(cpp, muw, address + 0,
+			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
 	if (err < 0)
 		return err;
 
@@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
  * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
-nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-		     unsigned long long address, uint32_t key)
+nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	struct nfp_cpp_mutex *mutex;
@@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 			return err;
 		if (time(NULL) >= warn_at) {
 			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
-				    mutex->usage, mutex->depth, mutex->target,
-				    mutex->address, mutex->key);
+					mutex->usage, mutex->depth, mutex->target,
+					mutex->address, mutex->key);
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 433780a5e7..fa65956baa 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -85,7 +85,8 @@ nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 }
 
 static unsigned int
-nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
+nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
+		struct nffw_fwinfo **arr)
 {
 	/*
 	 * For the this code, version 0 is most likely to be version 1 in this
@@ -138,8 +139,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 		goto err_release;
 
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
-			   nfp_resource_address(state->res),
-			   fwinf, sizeof(*fwinf));
+			nfp_resource_address(state->res),
+			fwinf, sizeof(*fwinf));
 	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
@@ -205,8 +206,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
  * Return: 0, or -ERRNO
  */
 int
-nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			uint64_t *off)
+nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
+		uint32_t *cpp_id,
+		uint64_t *off)
 {
 	struct nffw_fwinfo *fwinfo;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 6474abf0c2..4f476f6f2b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
+nfp_nsp_config_set_modified(struct nfp_nsp *state,
+		int modified)
 {
 	state->modified = modified;
 }
@@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
+nfp_nsp_config_set_state(struct nfp_nsp *state,
+		void *entries,
+		unsigned int idx)
 {
 	state->entries = entries;
 	state->idx = idx;
@@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 
 	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
-						    state->ver.minor);
+				state->ver.minor);
 		return -EINVAL;
 	}
 
@@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
 }
 
 static int
-nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
-		 uint64_t addr, uint64_t mask, uint64_t val)
+nfp_nsp_wait_reg(struct nfp_cpp *cpp,
+		uint64_t *reg,
+		uint32_t nsp_cpp,
+		uint64_t addr,
+		uint64_t mask,
+		uint64_t val)
 {
 	struct timespec wait;
 	int count;
@@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
  *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
-		uint32_t buff_cpp, uint64_t buff_addr)
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code,
+		uint32_t option,
+		uint32_t buff_cpp,
+		uint64_t buff_addr)
 {
 	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
 	struct nfp_cpp *cpp = state->cpp;
@@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 		return err;
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
 		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-			buff_cpp, buff_addr);
+				buff_cpp, buff_addr);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			     FIELD_PREP(NSP_COMMAND_CODE, code) |
-			     FIELD_PREP(NSP_COMMAND_START, 1));
+			FIELD_PREP(NSP_COMMAND_OPTION, option) |
+			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
 
 	/* Wait for NSP_COMMAND_START to go to 0 */
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
-			       NSP_COMMAND_START, 0);
+			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
 	/* Wait for NSP_STATUS_BUSY to go to 0 */
-	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
-			       0);
+	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
+			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
@@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-			 -err, (int)ret_val, code);
+				-err, (int)ret_val, code);
 		nfp_nsp_print_extended_error(ret_val);
 		return -err;
 	}
@@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 #define SZ_1M 0x00100000
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
-		    const void *in_buf, unsigned int in_size, void *out_buf,
-		    unsigned int out_size)
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		uint16_t code, uint32_t option,
+		const void *in_buf,
+		unsigned int in_size,
+		void *out_buf,
+		unsigned int out_size)
 {
 	struct nfp_cpp *cpp = nsp->cpp;
 	unsigned int max_size;
@@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-			    code, nsp->ver.major, nsp->ver.minor);
+				code, nsp->ver.major, nsp->ver.minor);
 		return -EOPNOTSUPP;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER_CONFIG,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
 	if (err < 0)
 		return err;
 
 	max_size = RTE_MAX(in_size, out_size);
 	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
 		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
-			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
+				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
 		memset(out_buf, 0, out_size - in_size);
 		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				    out_size - in_size);
+				out_size - in_size);
 		if (err < 0)
 			return err;
 	}
@@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
 }
 
 int
-nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_load_fw(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_eth_table(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			unsigned int size)
+nfp_nsp_write_eth_table(struct nfp_nsp *state,
+		const void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_identify(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
-		     unsigned int size)
+nfp_nsp_read_sensors(struct nfp_nsp *state,
+		unsigned int sensor_mask,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-				   0, buf, size);
+			0, buf, size);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 9905b2d3d3..1e2deaabb4 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_mac_reinit(struct nfp_nsp *state);
 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
-			 void *buf, unsigned int size);
+		void *buf, unsigned int size);
 
-static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
+static inline int
+nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
@@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
 int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
 int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
-			   int configed);
-int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
+		int configed);
+int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			    unsigned int size);
+		unsigned int size);
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
-			      unsigned int idx);
+		unsigned int idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
 void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
 int nfp_nsp_config_modified(struct nfp_nsp *state);
 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
+static inline int
+nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return !!eth_port->fec_modes_supported;
 }
@@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
 };
 
 int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
-			  long *val);
+		long *val);
 
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 21b338461e..28dba27124 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -73,7 +73,9 @@ struct nfp_sensors {
 };
 
 int
-nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
+nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
+		enum nfp_nsp_sensor_id id,
+		long *val)
 {
 	struct nfp_sensors s;
 	struct nfp_nsp *nsp;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 825a84a8cd..51bd57033e 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -159,7 +159,8 @@ nfp_eth_speed2rate(unsigned int speed)
 }
 
 static void
-nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
+nfp_eth_copy_mac_reverse(uint8_t *dst,
+		const uint8_t *src)
 {
 	int i;
 
@@ -168,8 +169,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
 }
 
 static void
-nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
-		       unsigned int index, struct nfp_eth_table_port *dst)
+nfp_eth_port_translate(struct nfp_nsp *nsp,
+		const union eth_table_entry *src,
+		unsigned int index,
+		struct nfp_eth_table_port *dst)
 {
 	unsigned int rate;
 	unsigned int fec;
@@ -225,21 +228,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
-					   table->ports[i].index);
+				table->ports[i].index);
 
 		for (j = 0; j < table->count; j++) {
 			if (table->ports[i].label_port !=
-			    table->ports[j].label_port)
+					table->ports[j].label_port)
 				continue;
 			table->ports[i].port_lanes += table->ports[j].lanes;
 
 			if (i == j)
 				continue;
 			if (table->ports[i].label_subport ==
-			    table->ports[j].label_subport)
+					table->ports[j].label_subport)
 				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
-					 table->ports[i].label_port,
-					 table->ports[i].label_subport);
+						table->ports[i].label_port,
+						table->ports[i].label_subport);
 
 			table->ports[i].is_split = 1;
 		}
@@ -296,7 +299,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 */
 	if (ret != 0 && ret != cnt) {
 		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
-		       ret, cnt);
+				ret, cnt);
 		goto err;
 	}
 
@@ -354,7 +357,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
 }
 
 struct nfp_nsp *
-nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
+nfp_eth_config_start(struct nfp_cpp *cpp,
+		unsigned int idx)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -447,7 +451,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
+nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int enable)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -487,7 +493,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
+nfp_eth_set_configured(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int configed)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -523,9 +531,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
 }
 
 static int
-nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
-		       const uint64_t mask, const unsigned int shift,
-		       unsigned int val, const uint64_t ctrl_bit)
+nfp_eth_set_bit_config(struct nfp_nsp *nsp,
+		unsigned int raw_idx,
+		const uint64_t mask,
+		const unsigned int shift,
+		unsigned int val,
+		const uint64_t ctrl_bit)
 {
 	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	unsigned int idx = nfp_nsp_config_idx(nsp);
@@ -560,7 +571,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
 	(__extension__ ({ \
 		typeof(mask) _x = (mask); \
 		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
-				       val, ctrl_bit);			\
+				val, ctrl_bit);			\
 	}))
 
 /*
@@ -574,11 +585,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
+__nfp_eth_set_aneg(struct nfp_nsp *nsp,
+		enum nfp_eth_aneg mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_ANEG, mode,
-				      NSP_ETH_CTRL_SET_ANEG);
+			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
 /*
@@ -592,11 +603,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
  * Return: 0 or -ERRNO.
  */
 static int
-__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
+__nfp_eth_set_fec(struct nfp_nsp *nsp,
+		enum nfp_eth_fec mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_FEC, mode,
-				      NSP_ETH_CTRL_SET_FEC);
+			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
 /*
@@ -611,7 +622,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
+nfp_eth_set_fec(struct nfp_cpp *cpp,
+		unsigned int idx,
+		enum nfp_eth_fec mode)
 {
 	struct nfp_nsp *nsp;
 	int err;
@@ -642,7 +655,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
+__nfp_eth_set_speed(struct nfp_nsp *nsp,
+		unsigned int speed)
 {
 	enum nfp_eth_rate rate;
 
@@ -653,8 +667,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
 	}
 
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_RATE, rate,
-				      NSP_ETH_CTRL_SET_RATE);
+			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
 /*
@@ -668,8 +681,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
+__nfp_eth_set_split(struct nfp_nsp *nsp,
+		unsigned int lanes)
 {
-	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
-				      lanes, NSP_ETH_CTRL_SET_LANES);
+	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
+			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 838cd6e0ef..57089c770f 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -64,7 +64,8 @@ struct nfp_resource {
 };
 
 static int
-nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
+nfp_cpp_resource_find(struct nfp_cpp *cpp,
+		struct nfp_resource *res)
 {
 	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 	struct nfp_resource_entry entry;
@@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 
 	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
 		uint64_t addr = NFP_RESOURCE_TBL_BASE +
-			sizeof(struct nfp_resource_entry) * i;
+				sizeof(struct nfp_resource_entry) * i;
 
 		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
 		if (ret != sizeof(entry))
@@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 			continue;
 
 		/* Found key! */
-		res->mutex =
-			nfp_cpp_mutex_alloc(cpp,
-					    NFP_RESOURCE_TBL_TARGET, addr, key);
+		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
+				addr, key);
 		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
-					 entry.region.cpp_action,
-					 entry.region.cpp_token);
+				entry.region.cpp_action,
+				entry.region.cpp_token);
 		res->addr = ((uint64_t)entry.region.page_offset) << 8;
 		res->size = (uint64_t)entry.region.page_size << 8;
 		return 0;
@@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 }
 
 static int
-nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
-			 struct nfp_cpp_mutex *dev_mutex)
+nfp_resource_try_acquire(struct nfp_cpp *cpp,
+		struct nfp_resource *res,
+		struct nfp_cpp_mutex *dev_mutex)
 {
 	int err;
 
@@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
  * Return: NFP Resource handle, or NULL
  */
 struct nfp_resource *
-nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
+nfp_resource_acquire(struct nfp_cpp *cpp,
+		const char *name)
 {
 	struct nfp_cpp_mutex *dev_mutex;
 	struct nfp_resource *res;
@@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
 	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
 
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
-					NFP_RESOURCE_TBL_BASE,
-					NFP_RESOURCE_TBL_KEY);
+			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
 		free(res);
 		return NULL;
@@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
  *
  * Return: const char pointer to the name of the resource
  */
-const char
-*nfp_resource_name(const struct nfp_resource *res)
+const char *
+nfp_resource_name(const struct nfp_resource *res)
 {
 	return res->name;
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 06cc6f74f4..009b7359a4 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -18,7 +18,7 @@
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
-					  const char *name);
+		const char *name);
 
 /**
  * Release a NFP Resource, and free the handle
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 4c45aec5c1..aa3b7a483e 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -40,22 +40,25 @@ struct nfp_rtsym_table {
 };
 
 static int
-nfp_meid(uint8_t island_id, uint8_t menum)
+nfp_meid(uint8_t island_id,
+		uint8_t menum)
 {
 	return (island_id & 0x3F) == island_id && menum < 12 ?
 		(island_id << 4) | (menum + 4) : -1;
 }
 
 static void
-nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
-			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
+nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
+		uint32_t strtab_size,
+		struct nfp_rtsym *sw,
+		struct nfp_rtsym_entry *fw)
 {
 	sw->type = fw->type;
 	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
 	sw->addr = ((uint64_t)fw->addr_hi << 32) |
-		   rte_le_to_cpu_32(fw->addr_lo);
+			rte_le_to_cpu_32(fw->addr_lo);
 	sw->size = ((uint64_t)fw->size_hi << 32) |
-		   rte_le_to_cpu_32(fw->size_lo);
+			rte_le_to_cpu_32(fw->size_lo);
 
 	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
 		     sw->name, sw->addr, sw->size, sw->target);
@@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
 }
 
 struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
+__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip)
 {
 	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
 	struct nfp_rtsym_entry *rtsymtab;
@@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
 
 	for (n = 0; n < cache->num; n++)
 		nfp_rtsym_sw_entry_init(cache, strtab_size,
-					&cache->symtab[n], &rtsymtab[n]);
+				&cache->symtab[n], &rtsymtab[n]);
 
 	free(rtsymtab);
 
@@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
+nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
+		int idx)
 {
 	if (rtbl == NULL)
 		return NULL;
@@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
+nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name)
 {
 	int n;
 
@@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
  * Return: value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
-nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
+nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		int *error)
 {
 	const struct nfp_rtsym *sym;
 	uint32_t val32;
@@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
-			name, sym->size);
+				name, sym->size);
 		err = -EINVAL;
 		break;
 	}
@@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 }
 
 uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area)
+nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		unsigned int min_size,
+		struct nfp_cpp_area **area)
 {
 	int ret;
 	uint8_t *mem;
@@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
-			sym->size, min_size);
+				sym->size, min_size);
 		return NULL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index 8b494211bc..30768f1ccf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -43,19 +43,18 @@ struct nfp_rtsym_table;
 
 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
 
-struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
+struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip);
 
 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
 
 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
 
-const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
+const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name);
 
 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
-			   int *error);
-uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area);
+		int *error);
+uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
+		unsigned int min_size, struct nfp_cpp_area **area);
 #endif
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* RE: [PATCH v2 2/5] bbdev: add new capabilities for FFT processing
  2023-09-18 15:42  0%     ` Maxime Coquelin
@ 2023-09-18 20:50  0%       ` Chautru, Nicolas
  0 siblings, 0 replies; 200+ results
From: Chautru, Nicolas @ 2023-09-18 20:50 UTC (permalink / raw)
  To: Maxime Coquelin, dev
  Cc: Rix, Tom, hemant.agrawal, david.marchand, Vargas, Hernan

Thanks Maxime. 

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, September 18, 2023 8:43 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org
> Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> david.marchand@redhat.com; Vargas, Hernan <hernan.vargas@intel.com>
> Subject: Re: [PATCH v2 2/5] bbdev: add new capabilities for FFT processing
> 
> 
> 
> On 9/18/23 17:08, Maxime Coquelin wrote:
> >
> >
> > On 6/15/23 18:48, Nicolas Chautru wrote:
> >> Extending existing FFT operation for new capabilities.
> >> Optional frequency domain dewindowing, frequency resampling, timing
> >> error correction and time offset per CS.
> >>
> >> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> >> ---
> >>   doc/guides/prog_guide/bbdev.rst | 24 ++++++++++++++++++++++++
> >>   lib/bbdev/rte_bbdev_op.h        | 23 ++++++++++++++++++++++-
> >>   2 files changed, 46 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/doc/guides/prog_guide/bbdev.rst
> >> b/doc/guides/prog_guide/bbdev.rst index 8e384015ee..95b33562fe
> 100644
> >> --- a/doc/guides/prog_guide/bbdev.rst
> >> +++ b/doc/guides/prog_guide/bbdev.rst
> >> @@ -1111,6 +1111,18 @@ with the operation flags forming a bitmask in
> >> the ``op_flags`` field.
> >>   |RTE_BBDEV_FFT_FP16_OUTPUT
> >> |
> >>   | Set if the output data shall use FP16 format instead of INT16
> >> |
> >>
> >> +--------------------------------------------------------------------
> >> +
> >> +|RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS
> >> +||  Set if device supports adjusting time offset per CS
> >> +||
> >> ++--------------------------------------------------------------------+
> >> +|RTE_BBDEV_FFT_TIMING_ERROR
> >> +||  Set if device supports correcting for timing error
> >> +||
> >> ++--------------------------------------------------------------------+
> >> +|RTE_BBDEV_FFT_DEWINDOWING
> >> +||  Set if enabling the option FFT Dewindowing in Frequency domain
> >> +||
> >> ++--------------------------------------------------------------------+
> >> +|RTE_BBDEV_FFT_FREQ_RESAMPLING
> >> +||  Set if device supports the optional frequency resampling
> >> +||
> >> ++--------------------------------------------------------------------+
> >>   The FFT parameters are set out in the table below.
> >> @@ -1121,6 +1133,8 @@ The FFT parameters are set out in the table
> below.
> >>
> >> +-------------------------+--------------------------------------------------------------+
> >>   |base_output              |output
> >> data                                                   |
> >>
> >> +-------------------------+--------------------------------------------------------------+
> >> +|dewindowing_input        |optional frequency domain dewindowing
> >> input data              |
> >> ++-------------------------+--------------------------------------------------------------+
> >>   |power_meas_output        |optional output data with power
> >> measurement on DFT output     |
> >>
> >> +-------------------------+--------------------------------------------------------------+
> >>   |op_flags                 |bitmask of all active operation
> >> capabilities                  | @@ -1155,6 +1169,16 @@ The FFT
> >> parameters are set out in the table below.
> >>
> >> +-------------------------+--------------------------------------------------------------+
> >>   |fp16_exp_adjust          |value added to FP16 exponent at
> >> conversion from INT16         |
> >>
> >> +-------------------------+--------------------------------------------------------------+
> >> +|freq_resample_mode       |frequency ressampling mode
> >> +|(0:transparent,
> >> 1-2: resample)     |
> >> ++-------------------------+--------------------------------------------------------------+
> >> +| output_depadded_size    |output depadded size prior to frequency
> >> resampling            |
> >> ++-------------------------+--------------------------------------------------------------+
> >> +|cs_theta_0               |timing error correction initial
> >> phase                         |
> >> ++-------------------------+--------------------------------------------------------------+
> >> +|cs_theta_d               |timing error correction phase
> >> increment                       |
> >> ++-------------------------+--------------------------------------------------------------+
> >> +|time_offset              |time offset per CS of time domain
> >> samples                     |
> >> ++-------------------------+--------------------------------------------------------------+
> >>   The mbuf input ``base_input`` is mandatory for all bbdev PMDs and
> >>   is the incoming data for the processing. Its size may not fit into
> >> an actual mbuf, diff --git a/lib/bbdev/rte_bbdev_op.h
> >> b/lib/bbdev/rte_bbdev_op.h index 990d110fa7..682e265327 100644
> >> --- a/lib/bbdev/rte_bbdev_op.h
> >> +++ b/lib/bbdev/rte_bbdev_op.h
> >> @@ -50,6 +50,7 @@ extern "C" {
> >>   #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
> >>   /* 12 CS maximum */
> >>   #define RTE_BBDEV_MAX_CS_2 (6)
> >> +#define RTE_BBDEV_MAX_CS   (12)
> >>   /* MLD-TS up to 4 layers */
> >>   #define RTE_BBDEV_MAX_MLD_LAYERS (4)
> >>   /* 12 SB per RB */
> >> @@ -242,7 +243,15 @@ enum rte_bbdev_op_fft_flag_bitmasks {
> >>       /** Set if the input data used FP16 format. */
> >>       RTE_BBDEV_FFT_FP16_INPUT = (1ULL << 6),
> >>       /** Set if the output data uses FP16 format. */
> >> -    RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
> >> +    RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7),
> >> +    /** Flexible adjustment of Timing offset adjustment per CS. */
> >> +    RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS = (1ULL << 8),
> >> +    /** Flexible adjustment of Timing error correction per CS. */
> >> +    RTE_BBDEV_FFT_TIMING_ERROR = (1ULL << 9),
> >> +    /** Set for optional frequency domain dewindowing. */
> >> +    RTE_BBDEV_FFT_DEWINDOWING = (1ULL << 10),
> >> +    /** Flexible adjustment of frequency resampling mode. */
> >> +    RTE_BBDEV_FFT_FREQ_RESAMPLING = (1ULL << 11)
> >>   };
> >>   /** Flags for MLDTS operation and capability structure */ @@ -756,6
> >> +765,8 @@ struct rte_bbdev_op_fft {
> >>       struct rte_bbdev_op_data base_input;
> >>       /** Output data starting from first antenna and first cyclic
> >> shift. */
> >>       struct rte_bbdev_op_data base_output;
> >> +    /** Optional frequency window input data. */
> >> +    struct rte_bbdev_op_data dewindowing_input;
> >>       /** Optional power measurement output data. */
> >>       struct rte_bbdev_op_data power_meas_output;
> >>       /** Flags from rte_bbdev_op_fft_flag_bitmasks. */ @@ -790,6
> >> +801,16 @@ struct rte_bbdev_op_fft {
> >>       uint16_t power_shift;
> >>       /** Adjust the FP6 exponent for INT<->FP16 conversion. */
> >>       uint16_t fp16_exp_adjust;
> >> +    /** Frequency resampling : 0: Transparent Mode1: 4/3 Resample2:
> >> 2/3 Resample. */
> >> +    int8_t freq_resample_mode;
> >> +    /** Output depadded size prior to frequency resampling. */
> >> +    uint16_t output_depadded_size;
> >> +    /** Time error correction initial phase. */
> >> +    uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
> >> +    /** Time error correction phase increment. */
> >> +    uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
> >> +    /* Time offset per CS of time domain samples. */
> >> +    int8_t time_offset[RTE_BBDEV_MAX_CS];
> >>   };
> >>   /* >8 End of structure rte_bbdev_op_fft. */
> >
> > I think you need to document ABI change in:
> > doc/guides/rel_notes/release_23_11.rst
> 
> Nevermind, I forgot the FFT API was still experimental.
> No need to submit a new revision, I will fix the typos in patch 5.
> 
> Maxime
> 
> > Once done, please add my:
> > Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> > Maxime
> >
> >


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/5] bbdev: add new capabilities for FFT processing
  2023-09-18 15:08  3%   ` Maxime Coquelin
@ 2023-09-18 15:42  0%     ` Maxime Coquelin
  2023-09-18 20:50  0%       ` Chautru, Nicolas
  0 siblings, 1 reply; 200+ results
From: Maxime Coquelin @ 2023-09-18 15:42 UTC (permalink / raw)
  To: Nicolas Chautru, dev; +Cc: trix, hemant.agrawal, david.marchand, hernan.vargas



On 9/18/23 17:08, Maxime Coquelin wrote:
> 
> 
> On 6/15/23 18:48, Nicolas Chautru wrote:
>> Extending existing FFT operation for new capabilities.
>> Optional frequency domain dewindowing, frequency resampling,
>> timing error correction and time offset per CS.
>>
>> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
>> ---
>>   doc/guides/prog_guide/bbdev.rst | 24 ++++++++++++++++++++++++
>>   lib/bbdev/rte_bbdev_op.h        | 23 ++++++++++++++++++++++-
>>   2 files changed, 46 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/guides/prog_guide/bbdev.rst 
>> b/doc/guides/prog_guide/bbdev.rst
>> index 8e384015ee..95b33562fe 100644
>> --- a/doc/guides/prog_guide/bbdev.rst
>> +++ b/doc/guides/prog_guide/bbdev.rst
>> @@ -1111,6 +1111,18 @@ with the operation flags forming a bitmask in 
>> the ``op_flags`` field.
>>   |RTE_BBDEV_FFT_FP16_OUTPUT                                           |
>>   | Set if the output data shall use FP16 format instead of INT16      |
>>   +--------------------------------------------------------------------+
>> +|RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS                                  |
>> +| Set if device supports adjusting time offset per CS                |
>> ++--------------------------------------------------------------------+
>> +|RTE_BBDEV_FFT_TIMING_ERROR                                          |
>> +| Set if device supports correcting for timing error                 |
>> ++--------------------------------------------------------------------+
>> +|RTE_BBDEV_FFT_DEWINDOWING                                           |
>> +| Set if enabling the option FFT Dewindowing in Frequency domain     |
>> ++--------------------------------------------------------------------+
>> +|RTE_BBDEV_FFT_FREQ_RESAMPLING                                       |
>> +| Set if device supports the optional frequency resampling           |
>> ++--------------------------------------------------------------------+
>>   The FFT parameters are set out in the table below.
>> @@ -1121,6 +1133,8 @@ The FFT parameters are set out in the table below.
>>   
>> +-------------------------+--------------------------------------------------------------+
>>   |base_output              |output 
>> data                                                   |
>>   
>> +-------------------------+--------------------------------------------------------------+
>> +|dewindowing_input        |optional frequency domain dewindowing 
>> input data              |
>> ++-------------------------+--------------------------------------------------------------+
>>   |power_meas_output        |optional output data with power 
>> measurement on DFT output     |
>>   
>> +-------------------------+--------------------------------------------------------------+
>>   |op_flags                 |bitmask of all active operation 
>> capabilities                  |
>> @@ -1155,6 +1169,16 @@ The FFT parameters are set out in the table below.
>>   
>> +-------------------------+--------------------------------------------------------------+
>>   |fp16_exp_adjust          |value added to FP16 exponent at 
>> conversion from INT16         |
>>   
>> +-------------------------+--------------------------------------------------------------+
>> +|freq_resample_mode       |frequency ressampling mode (0:transparent, 
>> 1-2: resample)     |
>> ++-------------------------+--------------------------------------------------------------+
>> +| output_depadded_size    |output depadded size prior to frequency 
>> resampling            |
>> ++-------------------------+--------------------------------------------------------------+
>> +|cs_theta_0               |timing error correction initial 
>> phase                         |
>> ++-------------------------+--------------------------------------------------------------+
>> +|cs_theta_d               |timing error correction phase 
>> increment                       |
>> ++-------------------------+--------------------------------------------------------------+
>> +|time_offset              |time offset per CS of time domain 
>> samples                     |
>> ++-------------------------+--------------------------------------------------------------+
>>   The mbuf input ``base_input`` is mandatory for all bbdev PMDs and
>>   is the incoming data for the processing. Its size may not fit into 
>> an actual mbuf,
>> diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
>> index 990d110fa7..682e265327 100644
>> --- a/lib/bbdev/rte_bbdev_op.h
>> +++ b/lib/bbdev/rte_bbdev_op.h
>> @@ -50,6 +50,7 @@ extern "C" {
>>   #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
>>   /* 12 CS maximum */
>>   #define RTE_BBDEV_MAX_CS_2 (6)
>> +#define RTE_BBDEV_MAX_CS   (12)
>>   /* MLD-TS up to 4 layers */
>>   #define RTE_BBDEV_MAX_MLD_LAYERS (4)
>>   /* 12 SB per RB */
>> @@ -242,7 +243,15 @@ enum rte_bbdev_op_fft_flag_bitmasks {
>>       /** Set if the input data used FP16 format. */
>>       RTE_BBDEV_FFT_FP16_INPUT = (1ULL << 6),
>>       /** Set if the output data uses FP16 format. */
>> -    RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
>> +    RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7),
>> +    /** Flexible adjustment of Timing offset adjustment per CS. */
>> +    RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS = (1ULL << 8),
>> +    /** Flexible adjustment of Timing error correction per CS. */
>> +    RTE_BBDEV_FFT_TIMING_ERROR = (1ULL << 9),
>> +    /** Set for optional frequency domain dewindowing. */
>> +    RTE_BBDEV_FFT_DEWINDOWING = (1ULL << 10),
>> +    /** Flexible adjustment of frequency resampling mode. */
>> +    RTE_BBDEV_FFT_FREQ_RESAMPLING = (1ULL << 11)
>>   };
>>   /** Flags for MLDTS operation and capability structure */
>> @@ -756,6 +765,8 @@ struct rte_bbdev_op_fft {
>>       struct rte_bbdev_op_data base_input;
>>       /** Output data starting from first antenna and first cyclic 
>> shift. */
>>       struct rte_bbdev_op_data base_output;
>> +    /** Optional frequency window input data. */
>> +    struct rte_bbdev_op_data dewindowing_input;
>>       /** Optional power measurement output data. */
>>       struct rte_bbdev_op_data power_meas_output;
>>       /** Flags from rte_bbdev_op_fft_flag_bitmasks. */
>> @@ -790,6 +801,16 @@ struct rte_bbdev_op_fft {
>>       uint16_t power_shift;
>>       /** Adjust the FP6 exponent for INT<->FP16 conversion. */
>>       uint16_t fp16_exp_adjust;
>> +    /** Frequency resampling : 0: Transparent Mode1: 4/3 Resample2: 
>> 2/3 Resample. */
>> +    int8_t freq_resample_mode;
>> +    /** Output depadded size prior to frequency resampling. */
>> +    uint16_t output_depadded_size;
>> +    /** Time error correction initial phase. */
>> +    uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
>> +    /** Time error correction phase increment. */
>> +    uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
>> +    /* Time offset per CS of time domain samples. */
>> +    int8_t time_offset[RTE_BBDEV_MAX_CS];
>>   };
>>   /* >8 End of structure rte_bbdev_op_fft. */
> 
> I think you need to document ABI change in:
> doc/guides/rel_notes/release_23_11.rst

Nevermind, I forgot the FFT API was still experimental.
No need to submit a new revision, I will fix the typos in patch 5.

Maxime

> Once done, please add my:
> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Maxime
> 
> 


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental API
    2023-09-06  6:17  0%   ` Hemant Agrawal
@ 2023-09-18 15:22  0%   ` Maxime Coquelin
  1 sibling, 0 replies; 200+ results
From: Maxime Coquelin @ 2023-09-18 15:22 UTC (permalink / raw)
  To: Nicolas Chautru, dev; +Cc: trix, hemant.agrawal, david.marchand, hernan.vargas



On 6/15/23 18:49, Nicolas Chautru wrote:
> Developpers are warned that the related fft experimental functions
> do not preserve ABI, hence these can be waived.
> 
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   devtools/libabigail.abignore | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 7a93de3ba1..09b8f156b5 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -30,7 +30,9 @@
>   [suppress_type]
>           type_kind = enum
>           changed_enumerators = RTE_CRYPTO_ASYM_XFORM_ECPM, RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> -
> +; Ignore changes to bbdev FFT API which is experimental
> +[suppress_type]
> +        name = rte_bbdev_fft_op
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>   ; Temporary exceptions till next major ABI version ;
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

With Hemmant's typo fix suggestion:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 2/5] bbdev: add new capabilities for FFT processing
  @ 2023-09-18 15:08  3%   ` Maxime Coquelin
  2023-09-18 15:42  0%     ` Maxime Coquelin
  0 siblings, 1 reply; 200+ results
From: Maxime Coquelin @ 2023-09-18 15:08 UTC (permalink / raw)
  To: Nicolas Chautru, dev; +Cc: trix, hemant.agrawal, david.marchand, hernan.vargas



On 6/15/23 18:48, Nicolas Chautru wrote:
> Extending existing FFT operation for new capabilities.
> Optional frequency domain dewindowing, frequency resampling,
> timing error correction and time offset per CS.
> 
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   doc/guides/prog_guide/bbdev.rst | 24 ++++++++++++++++++++++++
>   lib/bbdev/rte_bbdev_op.h        | 23 ++++++++++++++++++++++-
>   2 files changed, 46 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst
> index 8e384015ee..95b33562fe 100644
> --- a/doc/guides/prog_guide/bbdev.rst
> +++ b/doc/guides/prog_guide/bbdev.rst
> @@ -1111,6 +1111,18 @@ with the operation flags forming a bitmask in the ``op_flags`` field.
>   |RTE_BBDEV_FFT_FP16_OUTPUT                                           |
>   | Set if the output data shall use FP16 format instead of INT16      |
>   +--------------------------------------------------------------------+
> +|RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS                                  |
> +| Set if device supports adjusting time offset per CS                |
> ++--------------------------------------------------------------------+
> +|RTE_BBDEV_FFT_TIMING_ERROR                                          |
> +| Set if device supports correcting for timing error                 |
> ++--------------------------------------------------------------------+
> +|RTE_BBDEV_FFT_DEWINDOWING                                           |
> +| Set if enabling the option FFT Dewindowing in Frequency domain     |
> ++--------------------------------------------------------------------+
> +|RTE_BBDEV_FFT_FREQ_RESAMPLING                                       |
> +| Set if device supports the optional frequency resampling           |
> ++--------------------------------------------------------------------+
>   
>   The FFT parameters are set out in the table below.
>   
> @@ -1121,6 +1133,8 @@ The FFT parameters are set out in the table below.
>   +-------------------------+--------------------------------------------------------------+
>   |base_output              |output data                                                   |
>   +-------------------------+--------------------------------------------------------------+
> +|dewindowing_input        |optional frequency domain dewindowing input data              |
> ++-------------------------+--------------------------------------------------------------+
>   |power_meas_output        |optional output data with power measurement on DFT output     |
>   +-------------------------+--------------------------------------------------------------+
>   |op_flags                 |bitmask of all active operation capabilities                  |
> @@ -1155,6 +1169,16 @@ The FFT parameters are set out in the table below.
>   +-------------------------+--------------------------------------------------------------+
>   |fp16_exp_adjust          |value added to FP16 exponent at conversion from INT16         |
>   +-------------------------+--------------------------------------------------------------+
> +|freq_resample_mode       |frequency ressampling mode (0:transparent, 1-2: resample)     |
> ++-------------------------+--------------------------------------------------------------+
> +| output_depadded_size    |output depadded size prior to frequency resampling            |
> ++-------------------------+--------------------------------------------------------------+
> +|cs_theta_0               |timing error correction initial phase                         |
> ++-------------------------+--------------------------------------------------------------+
> +|cs_theta_d               |timing error correction phase increment                       |
> ++-------------------------+--------------------------------------------------------------+
> +|time_offset              |time offset per CS of time domain samples                     |
> ++-------------------------+--------------------------------------------------------------+
>   
>   The mbuf input ``base_input`` is mandatory for all bbdev PMDs and
>   is the incoming data for the processing. Its size may not fit into an actual mbuf,
> diff --git a/lib/bbdev/rte_bbdev_op.h b/lib/bbdev/rte_bbdev_op.h
> index 990d110fa7..682e265327 100644
> --- a/lib/bbdev/rte_bbdev_op.h
> +++ b/lib/bbdev/rte_bbdev_op.h
> @@ -50,6 +50,7 @@ extern "C" {
>   #define RTE_BBDEV_LDPC_MAX_CODE_BLOCKS (256)
>   /* 12 CS maximum */
>   #define RTE_BBDEV_MAX_CS_2 (6)
> +#define RTE_BBDEV_MAX_CS   (12)
>   /* MLD-TS up to 4 layers */
>   #define RTE_BBDEV_MAX_MLD_LAYERS (4)
>   /* 12 SB per RB */
> @@ -242,7 +243,15 @@ enum rte_bbdev_op_fft_flag_bitmasks {
>   	/** Set if the input data used FP16 format. */
>   	RTE_BBDEV_FFT_FP16_INPUT = (1ULL << 6),
>   	/** Set if the output data uses FP16 format. */
> -	RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7)
> +	RTE_BBDEV_FFT_FP16_OUTPUT = (1ULL << 7),
> +	/** Flexible adjustment of Timing offset adjustment per CS. */
> +	RTE_BBDEV_FFT_TIMING_OFFSET_PER_CS = (1ULL << 8),
> +	/** Flexible adjustment of Timing error correction per CS. */
> +	RTE_BBDEV_FFT_TIMING_ERROR = (1ULL << 9),
> +	/** Set for optional frequency domain dewindowing. */
> +	RTE_BBDEV_FFT_DEWINDOWING = (1ULL << 10),
> +	/** Flexible adjustment of frequency resampling mode. */
> +	RTE_BBDEV_FFT_FREQ_RESAMPLING = (1ULL << 11)
>   };
>   
>   /** Flags for MLDTS operation and capability structure */
> @@ -756,6 +765,8 @@ struct rte_bbdev_op_fft {
>   	struct rte_bbdev_op_data base_input;
>   	/** Output data starting from first antenna and first cyclic shift. */
>   	struct rte_bbdev_op_data base_output;
> +	/** Optional frequency window input data. */
> +	struct rte_bbdev_op_data dewindowing_input;
>   	/** Optional power measurement output data. */
>   	struct rte_bbdev_op_data power_meas_output;
>   	/** Flags from rte_bbdev_op_fft_flag_bitmasks. */
> @@ -790,6 +801,16 @@ struct rte_bbdev_op_fft {
>   	uint16_t power_shift;
>   	/** Adjust the FP6 exponent for INT<->FP16 conversion. */
>   	uint16_t fp16_exp_adjust;
> +	/** Frequency resampling : 0: Transparent Mode1: 4/3 Resample2: 2/3 Resample. */
> +	int8_t freq_resample_mode;
> +	/** Output depadded size prior to frequency resampling. */
> +	uint16_t output_depadded_size;
> +	/** Time error correction initial phase. */
> +	uint16_t cs_theta_0[RTE_BBDEV_MAX_CS];
> +	/** Time error correction phase increment. */
> +	uint32_t cs_theta_d[RTE_BBDEV_MAX_CS];
> +	/* Time offset per CS of time domain samples. */
> +	int8_t time_offset[RTE_BBDEV_MAX_CS];
>   };
>   /* >8 End of structure rte_bbdev_op_fft. */
>   

I think you need to document ABI change in:
doc/guides/rel_notes/release_23_11.rst

Once done, please add my:
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Maxime



^ permalink raw reply	[relevance 3%]

* Re: [PATCH v4 02/26] net/nfp: unify the indent coding style
  2023-09-18  2:45  1%       ` [PATCH v4 02/26] net/nfp: unify the indent coding style Chaoyong He
@ 2023-09-18 11:53  0%         ` Niklas Söderlund
  0 siblings, 0 replies; 200+ results
From: Niklas Söderlund @ 2023-09-18 11:53 UTC (permalink / raw)
  To: Chaoyong He; +Cc: dev, Niklas Söderlund

Hi Chaoyong,

On 2023-09-18 10:45:48 +0800, Chaoyong He wrote:
> Each parameter of function should occupy one line, and indent two TAB
> character.
> All the statement which span multi line should indent two TAB character.
> 
> Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>

Nacked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

I have not reviewed this rebase, I'm sure it's fine, but I have not 
reviewed it. Please drop my R-b from any future postings.

> ---
>  drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
>  drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
>  drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
>  drivers/net/nfp/nfpcore/nfp_crc.c          |  19 ++-
>  drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
>  drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
>  drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
>  drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
>  drivers/net/nfp/nfpcore/nfp_nffw.c         |  12 +-
>  drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
>  drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
>  drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
>  drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  72 +++++----
>  drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
>  drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
>  drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
>  drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
>  17 files changed, 463 insertions(+), 331 deletions(-)
> 
> diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
> index 8f87c09327..54bef3cb6b 100644
> --- a/drivers/net/nfp/nfpcore/nfp_cpp.h
> +++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
> @@ -56,7 +56,8 @@ struct nfp_cpp_operations {
>  	size_t area_priv_size;
>  
>  	/* Instance an NFP CPP */
> -	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
> +	int (*init)(struct nfp_cpp *cpp,
> +			struct rte_pci_device *dev);
>  
>  	/*
>  	 * Free the bus.
> @@ -69,9 +70,9 @@ struct nfp_cpp_operations {
>  	 * NOTE: This is _not_ serialized
>  	 */
>  	int (*area_init)(struct nfp_cpp_area *area,
> -			 uint32_t dest,
> -			 unsigned long long address,
> -			 unsigned long size);
> +			uint32_t dest,
> +			unsigned long long address,
> +			unsigned long size);
>  	/*
>  	 * Clean up a NFP CPP area before it is freed
>  	 * NOTE: This is _not_ serialized
> @@ -101,17 +102,17 @@ struct nfp_cpp_operations {
>  	 * Serialized
>  	 */
>  	int (*area_read)(struct nfp_cpp_area *area,
> -			 void *kernel_vaddr,
> -			 unsigned long offset,
> -			 unsigned int length);
> +			void *kernel_vaddr,
> +			unsigned long offset,
> +			unsigned int length);
>  	/*
>  	 * Perform a write to a NFP CPP area
>  	 * Serialized
>  	 */
>  	int (*area_write)(struct nfp_cpp_area *area,
> -			  const void *kernel_vaddr,
> -			  unsigned long offset,
> -			  unsigned int length);
> +			const void *kernel_vaddr,
> +			unsigned long offset,
> +			unsigned int length);
>  };
>  
>  /*
> @@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
>   * @param   len     Length of the serial byte array
>   */
>  int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
> -		       size_t serial_len);
> +		size_t serial_len);
>  
>  /*
>   * Set the private data of the nfp_cpp instance
> @@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
>   * @return NFP CPP handle, or NULL on failure.
>   */
>  struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
> -					 int driver_lock_needed);
> +		int driver_lock_needed);
>  
>  /*
>   * Free a NFP CPP handle
> @@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
>   * @return NFP CPP handle, or NULL on failure.
>   */
>  struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
> -					unsigned long long address,
> -					unsigned long size);
> +		unsigned long long address, unsigned long size);
>  
>  /*
>   * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
> @@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return NFP CPP handle, or NULL on failure.
>   */
>  struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
> -						  uint32_t cpp_id,
> -						  const char *name,
> -						  unsigned long long address,
> -						  unsigned long size);
> +		uint32_t cpp_id, const char *name, unsigned long long address,
> +		unsigned long size);
>  
>  /*
>   * Free an allocated NFP CPP area handle
> @@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
>   * @return NFP CPP handle, or NULL on failure.
>   */
>  struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
> -						uint32_t cpp_id,
> -						unsigned long long address,
> -						unsigned long size);
> +		uint32_t cpp_id, unsigned long long address, unsigned long size);
>  
>  /*
>   * Release the resources, then free the NFP CPP area handle
> @@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
>  void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
>  
>  uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
> -			   uint64_t addr, unsigned long size,
> -			   struct nfp_cpp_area **area);
> +		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
>  /*
>   * Return an IO pointer to the beginning of the NFP CPP area handle. The area
>   * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
> @@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
>   *
>   */
>  int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
> -		      void *buffer, size_t length);
> +		void *buffer, size_t length);
>  
>  /*
>   * Write to a NFP CPP area handle from a buffer. The area must be acquired with
> @@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
>   * @return bytes written on success, negative value on failure.
>   */
>  int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
> -		       const void *buffer, size_t length);
> +		const void *buffer, size_t length);
>  
>  /*
>   * nfp_cpp_area_iomem() - get IOMEM region for CPP area
> @@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
>   * @return 0 on success, negative value on failure.
>   */
>  int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
> -			     unsigned long long offset, unsigned long size);
> +		unsigned long long offset, unsigned long size);
>  
>  /*
>   * Get the NFP CPP handle that is the parent of a NFP CPP area handle
> @@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
>   * @return bytes read on success, -1 on failure.
>   */
>  int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		 unsigned long long address, void *kernel_vaddr, size_t length);
> +		unsigned long long address, void *kernel_vaddr, size_t length);
>  
>  /*
>   * Write a block of data to a NFP CPP ID
> @@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return bytes written on success, -1 on failure.
>   */
>  int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		  unsigned long long address, const void *kernel_vaddr,
> -		  size_t length);
> +		unsigned long long address, const void *kernel_vaddr,
> +		size_t length);
>  
>  
>  
> @@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return bytes written on success, negative value on failure.
>   */
>  int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
> -		      uint32_t value, size_t length);
> +		uint32_t value, size_t length);
>  
>  /*
>   * Read a single 32-bit value from a NFP CPP area handle
> @@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
>   * @return 0 on success, or -1 on error.
>   */
>  int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
> -		       uint32_t *value);
> +		uint32_t *value);
>  
>  /*
>   * Write a single 32-bit value to a NFP CPP area handle
> @@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
>   * @return 0 on success, or -1 on error.
>   */
>  int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
> -			uint32_t value);
> +		uint32_t value);
>  
>  /*
>   * Read a single 64-bit value from a NFP CPP area handle
> @@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
>   * @return 0 on success, or -1 on error.
>   */
>  int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
> -		       uint64_t *value);
> +		uint64_t *value);
>  
>  /*
>   * Write a single 64-bit value to a NFP CPP area handle
> @@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
>   * @return 0 on success, or -1 on error.
>   */
>  int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
> -			uint64_t value);
> +		uint64_t value);
>  
>  /*
>   * Write a single 32-bit value on the XPB bus
> @@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
>   * @return 0 on success, or -1 on failure.
>   */
>  int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
> -		    uint32_t value);
> +		uint32_t value);
>  
>  /*
>   * Modify bits of a 32-bit value from the XPB bus
> @@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
>   * @return >= 0 on success, negative value on failure.
>   */
>  int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
> -		   uint32_t value, int timeout_us);
> +		uint32_t value, int timeout_us);
>  
>  /*
>   * Read a 32-bit word from a NFP CPP ID
> @@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
>   * @return 0 on success, or -1 on failure.
>   */
>  int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		  unsigned long long address, uint32_t *value);
> +		unsigned long long address, uint32_t *value);
>  
>  /*
>   * Write a 32-bit value to a NFP CPP ID
> @@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
>   *
>   */
>  int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		   unsigned long long address, uint32_t value);
> +		unsigned long long address, uint32_t value);
>  
>  /*
>   * Read a 64-bit work from a NFP CPP ID
> @@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return 0 on success, or -1 on failure.
>   */
>  int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		  unsigned long long address, uint64_t *value);
> +		unsigned long long address, uint64_t *value);
>  
>  /*
>   * Write a 64-bit value to a NFP CPP ID
> @@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return 0 on success, or -1 on failure.
>   */
>  int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
> -		   unsigned long long address, uint64_t value);
> +		unsigned long long address, uint64_t value);
>  
>  /*
>   * Initialize a mutex location
> @@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
>   * @return 0 on success, negative value on failure.
>   */
>  int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
> -		       unsigned long long address, uint32_t key_id);
> +		unsigned long long address, uint32_t key_id);
>  
>  /*
>   * Create a mutex handle from an address controlled by a MU Atomic engine
> @@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
>   *                      failure.
>   */
>  struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
> -					  unsigned long long address,
> -					  uint32_t key_id);
> +		unsigned long long address, uint32_t key_id);
>  
>  /*
>   * Get the NFP CPP handle the mutex was created with
> diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
> index 2ee60eefc3..884cc84eaa 100644
> --- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
> +++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
> @@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
>  #define TARGET_WIDTH_64    8
>  
>  static int
> -nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
> -		uint64_t *bar_base, int tgt, int act, int tok,
> -		uint64_t offset, size_t size, int width)
> +nfp_compute_bar(const struct nfp_bar *bar,
> +		uint32_t *bar_config,
> +		uint64_t *bar_base,
> +		int tgt,
> +		int act,
> +		int tok,
> +		uint64_t offset,
> +		size_t size,
> +		int width)
>  {
>  	uint32_t bitsize;
>  	uint32_t newcfg;
> @@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
>  
>  	switch (width) {
>  	case 8:
> -		newcfg =
> -		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> -		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
> +		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> +				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
>  		break;
>  	case 4:
> -		newcfg =
> -		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> -		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
> +		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> +				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
>  		break;
>  	case 0:
> -		newcfg =
> -		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> -		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
> +		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
> +				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
>  		break;
>  	default:
>  		return -EINVAL;
> @@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
>  		/* Fixed CPP mapping with specific action */
>  		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
>  
> -		newcfg |=
> -		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
> -		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
> +		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
> +				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
>  		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
>  		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
>  		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
>  
>  		if ((offset & mask) != ((offset + size - 1) & mask)) {
>  			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
> -				    bar->index, (unsigned long long)offset,
> -				    (unsigned long long)(offset + size), act,
> -				    (unsigned long long)mask);
> +					bar->index, (unsigned long long)offset,
> +					(unsigned long long)(offset + size), act,
> +					(unsigned long long)mask);
>  			return -EINVAL;
>  		}
>  		offset &= mask;
>  
>  		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
> -			    bar->index, tgt, act, tok, (unsigned long long)offset,
> -			    (unsigned long long)(offset + mask));
> +				bar->index, tgt, act, tok, (unsigned long long)offset,
> +				(unsigned long long)(offset + mask));
>  
>  		bitsize = 40 - 16;
>  	} else {
>  		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
>  
>  		/* Bulk mapping */
> -		newcfg |=
> -		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
> -		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
> +		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
> +				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
>  
>  		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
>  		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
>  
>  		if ((offset & mask) != ((offset + size - 1) & mask)) {
>  			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
> -				    bar->index, (unsigned long long)offset,
> -				    (unsigned long long)(offset + size),
> -				    tgt, tok, (unsigned long long)mask,
> -				    (unsigned long long)(offset & mask),
> -				    (unsigned long long)(offset + size - 1) & mask);
> +					bar->index, (unsigned long long)offset,
> +					(unsigned long long)(offset + size),
> +					tgt, tok, (unsigned long long)mask,
> +					(unsigned long long)(offset & mask),
> +					(unsigned long long)(offset + size - 1) & mask);
>  			return -EINVAL;
>  		}
>  
>  		offset &= mask;
>  
>  		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
> -			    bar->index, tgt, tok, (unsigned long long)offset,
> -			    (unsigned long long)(offset + ~mask));
> +				bar->index, tgt, tok, (unsigned long long)offset,
> +				(unsigned long long)(offset + ~mask));
>  
>  		bitsize = 40 - 21;
>  	}
>  
>  	if (bar->bitsize < bitsize) {
>  		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
> -			    tgt, tok, act);
> +				tgt, tok, act);
>  		return -EINVAL;
>  	}
>  
> @@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
>  }
>  
>  static int
> -nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
> -		  uint32_t newcfg)
> +nfp_bar_write(struct nfp_pcie_user *nfp,
> +		struct nfp_bar *bar,
> +		uint32_t newcfg)
>  {
>  	int base, slot;
>  
> @@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
>  		return (-ENOMEM);
>  
>  	bar->csr = nfp->cfg +
> -		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
> +			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
>  
>  	*(uint32_t *)(bar->csr) = newcfg;
>  
> @@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
>  }
>  
>  static int
> -nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
> -		int act, int tok, uint64_t offset, size_t size, int width)
> +nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
> +		struct nfp_bar *bar,
> +		int tgt,
> +		int act,
> +		int tok,
> +		uint64_t offset,
> +		size_t size,
> +		int width)
>  {
>  	uint64_t newbase;
>  	uint32_t newcfg;
>  	int err;
>  
>  	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
> -			      size, width);
> +			size, width);
>  	if (err != 0)
>  		return err;
>  
> @@ -390,8 +398,10 @@ struct nfp6000_area_priv {
>  };
>  
>  static int
> -nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
> -		  unsigned long long address, unsigned long size)
> +nfp6000_area_init(struct nfp_cpp_area *area,
> +		uint32_t dest,
> +		unsigned long long address,
> +		unsigned long size)
>  {
>  	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
>  	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
> @@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
>  	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
>  	int pp, ret = 0;
>  
> -	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
> -				     address);
> +	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
>  	if (pp < 0)
>  		return pp;
>  
> @@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
>  	priv->width.write = PULL_WIDTH(pp);
>  
>  	if (priv->width.read > 0 &&
> -	    priv->width.write > 0 && priv->width.read != priv->width.write)
> +			priv->width.write > 0 &&
> +			priv->width.read != priv->width.write)
>  		return -EINVAL;
>  
>  	if (priv->width.read > 0)
> @@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
>  	priv->size = size;
>  
>  	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
> -				  priv->token, priv->offset, priv->size,
> -				  priv->width.bar);
> +			priv->token, priv->offset, priv->size,
> +			priv->width.bar);
>  
>  	return ret;
>  }
> @@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
>  
>  	/* Calculate offset into BAR. */
>  	if (nfp_bar_maptype(priv->bar) ==
> -	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
> +			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
>  		priv->bar_offset = priv->offset &
> -			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
> -		priv->bar_offset +=
> -			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
> -							   priv->target);
> -		priv->bar_offset +=
> -		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
> +				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
> +		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
> +				priv->target);
> +		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
> +				priv->token);
>  	} else {
>  		priv->bar_offset = priv->offset & priv->bar->mask;
>  	}
> @@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
>  }
>  
>  static int
> -nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
> -		  unsigned long offset, unsigned int length)
> +nfp6000_area_read(struct nfp_cpp_area *area,
> +		void *kernel_vaddr,
> +		unsigned long offset,
> +		unsigned int length)
>  {
>  	uint64_t *wrptr64 = kernel_vaddr;
>  	const volatile uint64_t *rdptr64;
> @@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
>  
>  	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
>  	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
> -	    priv->action == NFP_CPP_ACTION_RW) {
> +			priv->action == NFP_CPP_ACTION_RW) {
>  		is_64 = false;
>  	}
>  
>  	if (is_64) {
>  		if (offset % sizeof(uint64_t) != 0 ||
> -		    length % sizeof(uint64_t) != 0)
> +				length % sizeof(uint64_t) != 0)
>  			return -EINVAL;
>  	} else {
>  		if (offset % sizeof(uint32_t) != 0 ||
> -		    length % sizeof(uint32_t) != 0)
> +				length % sizeof(uint32_t) != 0)
>  			return -EINVAL;
>  	}
>  
> @@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
>  }
>  
>  static int
> -nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
> -		   unsigned long offset, unsigned int length)
> +nfp6000_area_write(struct nfp_cpp_area *area,
> +		const void *kernel_vaddr,
> +		unsigned long offset,
> +		unsigned int length)
>  {
>  	const uint64_t *rdptr64 = kernel_vaddr;
>  	uint64_t *wrptr64;
> @@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
>  
>  	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
>  	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
> -	    priv->action == NFP_CPP_ACTION_RW)
> +			priv->action == NFP_CPP_ACTION_RW)
>  		is_64 = false;
>  
>  	if (is_64) {
>  		if (offset % sizeof(uint64_t) != 0 ||
> -		    length % sizeof(uint64_t) != 0)
> +				length % sizeof(uint64_t) != 0)
>  			return -EINVAL;
>  	} else {
>  		if (offset % sizeof(uint32_t) != 0 ||
> -		    length % sizeof(uint32_t) != 0)
> +				length % sizeof(uint32_t) != 0)
>  			return -EINVAL;
>  	}
>  
> @@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
>  }
>  
>  static int
> -nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
> +nfp6000_set_model(struct rte_pci_device *dev,
> +		struct nfp_cpp *cpp)
>  {
>  	uint32_t model;
>  
> @@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
>  }
>  
>  static int
> -nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
> +nfp6000_set_interface(struct rte_pci_device *dev,
> +		struct nfp_cpp *cpp)
>  {
>  	uint16_t interface;
>  
> @@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
>  }
>  
>  static int
> -nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
> +nfp6000_set_serial(struct rte_pci_device *dev,
> +		struct nfp_cpp *cpp)
>  {
>  	uint16_t tmp;
>  	uint8_t serial[6];
> @@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
>  }
>  
>  static int
> -nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
> +nfp6000_set_barsz(struct rte_pci_device *dev,
> +		struct nfp_pcie_user *desc)
>  {
>  	unsigned long tmp;
>  	int i = 0;
> @@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
>  }
>  
>  static int
> -nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
> +nfp6000_init(struct nfp_cpp *cpp,
> +		struct rte_pci_device *dev)
>  {
>  	int ret = 0;
>  	struct nfp_pcie_user *desc;
> @@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
>  	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
>  
>  	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
> -	    cpp->driver_lock_needed) {
> +			cpp->driver_lock_needed) {
>  		ret = nfp_acquire_process_lock(desc);
>  		if (ret != 0)
>  			goto error;
> diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
> index 31338e0047..f764208a9a 100644
> --- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
> +++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
> @@ -27,7 +27,8 @@
>  						NFP_PL_DEVICE_ID_MASK)
>  
>  void
> -nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
> +nfp_cpp_priv_set(struct nfp_cpp *cpp,
> +		void *priv)
>  {
>  	cpp->priv = priv;
>  }
> @@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
>  }
>  
>  void
> -nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
> +nfp_cpp_model_set(struct nfp_cpp *cpp,
> +		uint32_t model)
>  {
>  	cpp->model = model;
>  }
> @@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
>  }
>  
>  void
> -nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
> +nfp_cpp_interface_set(struct nfp_cpp *cpp,
> +		uint32_t interface)
>  {
>  	cpp->interface = interface;
>  }
>  
>  int
> -nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
> +nfp_cpp_serial(struct nfp_cpp *cpp,
> +		const uint8_t **serial)
>  {
>  	*serial = cpp->serial;
>  	return cpp->serial_len;
>  }
>  
>  int
> -nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
> -		   size_t serial_len)
> +nfp_cpp_serial_set(struct nfp_cpp *cpp,
> +		const uint8_t *serial,
> +		size_t serial_len)
>  {
>  	if (cpp->serial_len)
>  		free(cpp->serial);
> @@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
>   * NOTE: @address and @size must be 32-bit aligned values.
>   */
>  struct nfp_cpp_area *
> -nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
> -			      const char *name, unsigned long long address,
> -			      unsigned long size)
> +nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
> +		uint32_t dest,
> +		const char *name,
> +		unsigned long long address,
> +		unsigned long size)
>  {
>  	struct nfp_cpp_area *area;
>  	uint64_t tmp64 = (uint64_t)address;
> @@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
>  		name = "";
>  
>  	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
> -		      strlen(name) + 1);
> +			strlen(name) + 1);
>  	if (area == NULL)
>  		return NULL;
>  
> @@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
>  }
>  
>  struct nfp_cpp_area *
> -nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
> -		    unsigned long long address, unsigned long size)
> +nfp_cpp_area_alloc(struct nfp_cpp *cpp,
> +		uint32_t dest,
> +		unsigned long long address,
> +		unsigned long size)
>  {
>  	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
>  }
> @@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
>   * NOTE: The area must also be 'released' when the structure is freed.
>   */
>  struct nfp_cpp_area *
> -nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
> -			    unsigned long long address, unsigned long size)
> +nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
> +		uint32_t destination,
> +		unsigned long long address,
> +		unsigned long size)
>  {
>  	struct nfp_cpp_area *area;
>  
> @@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
>   * NOTE: Area must have been locked down with an 'acquire'.
>   */
>  int
> -nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
> -		  void *kernel_vaddr, size_t length)
> +nfp_cpp_area_read(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		void *kernel_vaddr,
> +		size_t length)
>  {
>  	if ((offset + length) > area->size)
>  		return -EFAULT;
> @@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
>   * NOTE: Area must have been locked down with an 'acquire'.
>   */
>  int
> -nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
> -		   const void *kernel_vaddr, size_t length)
> +nfp_cpp_area_write(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		const void *kernel_vaddr,
> +		size_t length)
>  {
>  	if ((offset + length) > area->size)
>  		return -EFAULT;
> @@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
>   * or negative value on error.
>   */
>  int
> -nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
> -			 unsigned long length)
> +nfp_cpp_area_check_range(struct nfp_cpp_area *area,
> +		unsigned long long offset,
> +		unsigned long length)
>  {
>  	if (((offset + length) > area->size))
>  		return -EFAULT;
> @@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
>   * based upon NFP model.
>   */
>  static uint32_t
> -nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
> +nfp_xpb_to_cpp(struct nfp_cpp *cpp,
> +		uint32_t *xpb_addr)
>  {
>  	uint32_t xpb;
>  	int island;
> @@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
>  		else
>  			/* And only non-ARM interfaces use island id = 1 */
>  			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
> -			    NFP_CPP_INTERFACE_TYPE_ARM)
> +					NFP_CPP_INTERFACE_TYPE_ARM)
>  				*xpb_addr |= (1 << 24);
>  	} else {
>  		(*xpb_addr) |= (1 << 30);
> @@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
>  }
>  
>  int
> -nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
> -		   uint32_t *value)
> +nfp_cpp_area_readl(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		uint32_t *value)
>  {
>  	int sz;
>  	uint32_t tmp = 0;
> @@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
>  }
>  
>  int
> -nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
> -		    uint32_t value)
> +nfp_cpp_area_writel(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		uint32_t value)
>  {
>  	int sz;
>  
> @@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
>  }
>  
>  int
> -nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
> -		   uint64_t *value)
> +nfp_cpp_area_readq(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		uint64_t *value)
>  {
>  	int sz;
>  	uint64_t tmp = 0;
> @@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
>  }
>  
>  int
> -nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
> -		    uint64_t value)
> +nfp_cpp_area_writeq(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		uint64_t value)
>  {
>  	int sz;
>  
> @@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
>  }
>  
>  int
> -nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
> -	      uint32_t *value)
> +nfp_cpp_readl(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		unsigned long long address,
> +		uint32_t *value)
>  {
>  	int sz;
>  	uint32_t tmp;
> @@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
>  }
>  
>  int
> -nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
> -	       uint32_t value)
> +nfp_cpp_writel(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		unsigned long long address,
> +		uint32_t value)
>  {
>  	int sz;
>  
> @@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
>  }
>  
>  int
> -nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
> -	      uint64_t *value)
> +nfp_cpp_readq(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		unsigned long long address,
> +		uint64_t *value)
>  {
>  	int sz;
>  	uint64_t tmp;
> @@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
>  }
>  
>  int
> -nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
> -	       uint64_t value)
> +nfp_cpp_writeq(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		unsigned long long address,
> +		uint64_t value)
>  {
>  	int sz;
>  
> @@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
>  }
>  
>  int
> -nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
> +nfp_xpb_writel(struct nfp_cpp *cpp,
> +		uint32_t xpb_addr,
> +		uint32_t value)
>  {
>  	uint32_t cpp_dest;
>  
> @@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
>  }
>  
>  int
> -nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
> +nfp_xpb_readl(struct nfp_cpp *cpp,
> +		uint32_t xpb_addr,
> +		uint32_t *value)
>  {
>  	uint32_t cpp_dest;
>  
> @@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
>  }
>  
>  static struct nfp_cpp *
> -nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
> +nfp_cpp_alloc(struct rte_pci_device *dev,
> +		int driver_lock_needed)
>  {
>  	const struct nfp_cpp_operations *ops;
>  	struct nfp_cpp *cpp;
> @@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
>  			/* Hardcoded XPB IMB Base, island 0 */
>  			xpbaddr = 0x000a0000 + (tgt * 4);
>  			err = nfp_xpb_readl(cpp, xpbaddr,
> -				(uint32_t *)&cpp->imb_cat_table[tgt]);
> +					(uint32_t *)&cpp->imb_cat_table[tgt]);
>  			if (err < 0) {
>  				free(cpp);
>  				return NULL;
> @@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
>  }
>  
>  struct nfp_cpp *
> -nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
> +nfp_cpp_from_device_name(struct rte_pci_device *dev,
> +		int driver_lock_needed)
>  {
>  	return nfp_cpp_alloc(dev, driver_lock_needed);
>  }
> @@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
>   * @return 0 on success, or -1 on failure.
>   */
>  int
> -nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
> +nfp_xpb_writelm(struct nfp_cpp *cpp,
> +		uint32_t xpb_tgt,
> +		uint32_t mask,
>  		uint32_t value)
>  {
>  	int err;
> @@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
>   * @return >= 0 on success, or negative value on failure.
>   */
>  int
> -nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
> -	       uint32_t value, int timeout_us)
> +nfp_xpb_waitlm(struct nfp_cpp *cpp,
> +		uint32_t xpb_tgt,
> +		uint32_t mask,
> +		uint32_t value,
> +		int timeout_us)
>  {
>  	uint32_t tmp;
>  	int err;
> @@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
>   * @length:     number of bytes to read
>   */
>  int
> -nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
> -	     unsigned long long address, void *kernel_vaddr, size_t length)
> +nfp_cpp_read(struct nfp_cpp *cpp,
> +		uint32_t destination,
> +		unsigned long long address,
> +		void *kernel_vaddr,
> +		size_t length)
>  {
>  	struct nfp_cpp_area *area;
>  	int err;
> @@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
>   * @length:     number of bytes to write
>   */
>  int
> -nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
> -	      unsigned long long address, const void *kernel_vaddr,
> -	      size_t length)
> +nfp_cpp_write(struct nfp_cpp *cpp,
> +		uint32_t destination,
> +		unsigned long long address,
> +		const void *kernel_vaddr,
> +		size_t length)
>  {
>  	struct nfp_cpp_area *area;
>  	int err;
> @@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
>   * @length:     length of area to fill
>   */
>  int
> -nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
> -		  uint32_t value, size_t length)
> +nfp_cpp_area_fill(struct nfp_cpp_area *area,
> +		unsigned long offset,
> +		uint32_t value,
> +		size_t length)
>  {
>  	int err;
>  	size_t i;
> @@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
>  	}
>  
>  	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
> -		err =
> -		    nfp_cpp_area_write(area, offset + i, &value64,
> -				       sizeof(value64));
> +		err = nfp_cpp_area_write(area, offset + i, &value64,
> +				sizeof(value64));
>  		if (err < 0)
>  			return err;
>  		if (err != sizeof(value64))
> @@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
>  	}
>  
>  	if ((i + sizeof(value)) <= length) {
> -		err =
> -		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
> +		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
>  		if (err < 0)
>  			return err;
>  		if (err != sizeof(value))
> @@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
>   * as those are model-specific
>   */
>  uint32_t
> -__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
> +__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
> +		uint32_t *model)
>  {
>  	uint32_t reg;
>  	int err;
>  
>  	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
> -			    &reg);
> +			&reg);
>  	if (err < 0)
>  		return err;
>  
> @@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
>   * Return: Pointer to memory mapped area or NULL
>   */
>  uint8_t *
> -nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
> -		 unsigned long size, struct nfp_cpp_area **area)
> +nfp_cpp_map_area(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		uint64_t addr,
> +		unsigned long size,
> +		struct nfp_cpp_area **area)
>  {
>  	uint8_t *res;
>  
> diff --git a/drivers/net/nfp/nfpcore/nfp_crc.c b/drivers/net/nfp/nfpcore/nfp_crc.c
> index 20431bf845..2cd8866253 100644
> --- a/drivers/net/nfp/nfpcore/nfp_crc.c
> +++ b/drivers/net/nfp/nfpcore/nfp_crc.c
> @@ -9,27 +9,31 @@
>  #include "nfp_crc.h"
>  
>  static inline uint32_t
> -nfp_crc32_be_generic(uint32_t crc, unsigned char const *p, size_t len,
> -		 uint32_t polynomial)
> +nfp_crc32_be_generic(uint32_t crc,
> +		unsigned char const *p,
> +		size_t len,
> +		uint32_t polynomial)
>  {
>  	int i;
>  	while (len--) {
>  		crc ^= *p++ << 24;
>  		for (i = 0; i < 8; i++)
> -			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
> -					  0);
> +			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial : 0);
>  	}
>  	return crc;
>  }
>  
>  static inline uint32_t
> -nfp_crc32_be(uint32_t crc, unsigned char const *p, size_t len)
> +nfp_crc32_be(uint32_t crc,
> +		unsigned char const *p,
> +		size_t len)
>  {
>  	return nfp_crc32_be_generic(crc, p, len, CRCPOLY_BE);
>  }
>  
>  static uint32_t
> -nfp_crc32_posix_end(uint32_t crc, size_t total_len)
> +nfp_crc32_posix_end(uint32_t crc,
> +		size_t total_len)
>  {
>  	/* Extend with the length of the string. */
>  	while (total_len != 0) {
> @@ -43,7 +47,8 @@ nfp_crc32_posix_end(uint32_t crc, size_t total_len)
>  }
>  
>  uint32_t
> -nfp_crc32_posix(const void *buff, size_t len)
> +nfp_crc32_posix(const void *buff,
> +		size_t len)
>  {
>  	return nfp_crc32_posix_end(nfp_crc32_be(0, buff, len), len);
>  }
> diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
> index a9d166c4dc..ea4c7d6a9e 100644
> --- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
> +++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
> @@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
>  }
>  
>  static int
> -nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
> +nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
> +		uint32_t size)
>  {
>  	const char *key, *val, *end = hwinfo->data + size;
>  
>  	for (key = hwinfo->data; *key != 0 && key < end;
> -	     key = val + strlen(val) + 1) {
> +			key = val + strlen(val) + 1) {
>  		val = key + strlen(key) + 1;
>  		if (val >= end) {
>  			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
> @@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
>  }
>  
>  static int
> -nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
> +nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
> +		uint32_t len)
>  {
>  	uint32_t size, new_crc, *crc;
>  
> @@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
>  	crc = (uint32_t *)(db->start + size);
>  	if (new_crc != *crc) {
>  		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
> -			    new_crc, *crc);
> +				new_crc, *crc);
>  		return -EINVAL;
>  	}
>  
> @@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
>  }
>  
>  static struct nfp_hwinfo *
> -nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
> +nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
> +		size_t *cpp_size)
>  {
>  	struct nfp_hwinfo *header;
>  	void *res;
> @@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
>  
>  	if (header->version != NFP_HWINFO_VERSION_2) {
>  		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
> -			header->version);
> +				header->version);
>  		goto exit_free;
>  	}
>  
> @@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
>  }
>  
>  static struct nfp_hwinfo *
> -nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
> +nfp_hwinfo_fetch(struct nfp_cpp *cpp,
> +		size_t *hwdb_size)
>  {
>  	struct timespec wait;
>  	struct nfp_hwinfo *db;
> @@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
>   * Return: Value of the HWInfo name, or NULL
>   */
>  const char *
> -nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
> +nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
> +		const char *lookup)
>  {
>  	const char *key, *val, *end;
>  
> @@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
>  	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
>  
>  	for (key = hwinfo->data; *key != 0 && key < end;
> -	     key = val + strlen(val) + 1) {
> +			key = val + strlen(val) + 1) {
>  		val = key + strlen(key) + 1;
>  
>  		if (strcmp(key, lookup) == 0)
> diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
> index f9723dd136..0071d3fc37 100644
> --- a/drivers/net/nfp/nfpcore/nfp_mip.c
> +++ b/drivers/net/nfp/nfpcore/nfp_mip.c
> @@ -37,8 +37,10 @@ struct nfp_mip {
>  
>  /* Read memory and check if it could be a valid MIP */
>  static int
> -nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
> -		 struct nfp_mip *mip)
> +nfp_mip_try_read(struct nfp_cpp *cpp,
> +		uint32_t cpp_id,
> +		uint64_t addr,
> +		struct nfp_mip *mip)
>  {
>  	int ret;
>  
> @@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
>  	}
>  	if (mip->signature != NFP_MIP_SIGNATURE) {
>  		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
> -			    rte_le_to_cpu_32(mip->signature));
> +				rte_le_to_cpu_32(mip->signature));
>  		return -EINVAL;
>  	}
>  	if (mip->mip_version != NFP_MIP_VERSION) {
>  		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
> -			    rte_le_to_cpu_32(mip->mip_version));
> +				rte_le_to_cpu_32(mip->mip_version));
>  		return -EINVAL;
>  	}
>  
> @@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
>  
>  /* Try to locate MIP using the resource table */
>  static int
> -nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
> +nfp_mip_read_resource(struct nfp_cpp *cpp,
> +		struct nfp_mip *mip)
>  {
>  	struct nfp_nffw_info *nffw_info;
>  	uint32_t cpp_id;
> @@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
>   * @size:	Location for size of MIP symbol table
>   */
>  void
> -nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
> +nfp_mip_symtab(const struct nfp_mip *mip,
> +		uint32_t *addr,
> +		uint32_t *size)
>  {
>  	*addr = rte_le_to_cpu_32(mip->symtab_addr);
>  	*size = rte_le_to_cpu_32(mip->symtab_size);
> @@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
>   * @size:	Location for size of MIP symbol name table
>   */
>  void
> -nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
> +nfp_mip_strtab(const struct nfp_mip *mip,
> +		uint32_t *addr,
> +		uint32_t *size)
>  {
>  	*addr = rte_le_to_cpu_32(mip->strtab_addr);
>  	*size = rte_le_to_cpu_32(mip->strtab_size);
> diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
> index d0919b58fe..980abc2517 100644
> --- a/drivers/net/nfp/nfpcore/nfp_mip.h
> +++ b/drivers/net/nfp/nfpcore/nfp_mip.h
> @@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
>  void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
>  void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
>  int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
> -			    uint64_t *off);
> +		uint64_t *off);
>  #endif
> diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
> index 0410a00856..047e755416 100644
> --- a/drivers/net/nfp/nfpcore/nfp_mutex.c
> +++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
> @@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
>  };
>  
>  static int
> -_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
> +_nfp_cpp_mutex_validate(uint32_t model,
> +		int *target,
> +		unsigned long long address)
>  {
>  	/* Address must be 64-bit aligned */
>  	if ((address & 7) != 0)
> @@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
>   * @return 0 on success, or negative value on failure.
>   */
>  int
> -nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
> -		   uint32_t key)
> +nfp_cpp_mutex_init(struct nfp_cpp *cpp,
> +		int target,
> +		unsigned long long address,
> +		uint32_t key)
>  {
>  	uint32_t model = nfp_cpp_model(cpp);
>  	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
> @@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
>  	if (err < 0)
>  		return err;
>  
> -	err =
> -	    nfp_cpp_writel(cpp, muw, address + 0,
> -			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
> +	err = nfp_cpp_writel(cpp, muw, address + 0,
> +			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
>  	if (err < 0)
>  		return err;
>  
> @@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
>   * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
>   */
>  struct nfp_cpp_mutex *
> -nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
> -		     unsigned long long address, uint32_t key)
> +nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
> +		int target,
> +		unsigned long long address,
> +		uint32_t key)
>  {
>  	uint32_t model = nfp_cpp_model(cpp);
>  	struct nfp_cpp_mutex *mutex;
> @@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
>  			return err;
>  		if (time(NULL) >= warn_at) {
>  			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
> -				    mutex->usage, mutex->depth, mutex->target,
> -				    mutex->address, mutex->key);
> +					mutex->usage, mutex->depth, mutex->target,
> +					mutex->address, mutex->key);
>  			warn_at = time(NULL) + 60;
>  		}
>  		sched_yield();
> diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
> index 433780a5e7..fa65956baa 100644
> --- a/drivers/net/nfp/nfpcore/nfp_nffw.c
> +++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
> @@ -85,7 +85,8 @@ nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
>  }
>  
>  static unsigned int
> -nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
> +nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
> +		struct nffw_fwinfo **arr)
>  {
>  	/*
>  	 * For the this code, version 0 is most likely to be version 1 in this
> @@ -138,8 +139,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
>  		goto err_release;
>  
>  	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
> -			   nfp_resource_address(state->res),
> -			   fwinf, sizeof(*fwinf));
> +			nfp_resource_address(state->res),
> +			fwinf, sizeof(*fwinf));
>  	if (err < (int)sizeof(*fwinf))
>  		goto err_release;
>  
> @@ -205,8 +206,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
>   * Return: 0, or -ERRNO
>   */
>  int
> -nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
> -			uint64_t *off)
> +nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
> +		uint32_t *cpp_id,
> +		uint64_t *off)
>  {
>  	struct nffw_fwinfo *fwinfo;
>  
> diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
> index 6474abf0c2..4f476f6f2b 100644
> --- a/drivers/net/nfp/nfpcore/nfp_nsp.c
> +++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
> @@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
>  }
>  
>  void
> -nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
> +nfp_nsp_config_set_modified(struct nfp_nsp *state,
> +		int modified)
>  {
>  	state->modified = modified;
>  }
> @@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
>  }
>  
>  void
> -nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
> +nfp_nsp_config_set_state(struct nfp_nsp *state,
> +		void *entries,
> +		unsigned int idx)
>  {
>  	state->entries = entries;
>  	state->idx = idx;
> @@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
>  
>  	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
>  		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
> -						    state->ver.minor);
> +				state->ver.minor);
>  		return -EINVAL;
>  	}
>  
> @@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
>  }
>  
>  static int
> -nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
> -		 uint64_t addr, uint64_t mask, uint64_t val)
> +nfp_nsp_wait_reg(struct nfp_cpp *cpp,
> +		uint64_t *reg,
> +		uint32_t nsp_cpp,
> +		uint64_t addr,
> +		uint64_t mask,
> +		uint64_t val)
>  {
>  	struct timespec wait;
>  	int count;
> @@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
>   *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
>   */
>  static int
> -nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
> -		uint32_t buff_cpp, uint64_t buff_addr)
> +nfp_nsp_command(struct nfp_nsp *state,
> +		uint16_t code,
> +		uint32_t option,
> +		uint32_t buff_cpp,
> +		uint64_t buff_addr)
>  {
>  	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
>  	struct nfp_cpp *cpp = state->cpp;
> @@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
>  		return err;
>  
>  	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
> -	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
> +			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
>  		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
> -			buff_cpp, buff_addr);
> +				buff_cpp, buff_addr);
>  		return -EINVAL;
>  	}
>  
>  	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
> -			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
> -			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
> +			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
> +			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
>  	if (err < 0)
>  		return err;
>  
>  	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
> -			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
> -			     FIELD_PREP(NSP_COMMAND_CODE, code) |
> -			     FIELD_PREP(NSP_COMMAND_START, 1));
> +			FIELD_PREP(NSP_COMMAND_OPTION, option) |
> +			FIELD_PREP(NSP_COMMAND_CODE, code) |
> +			FIELD_PREP(NSP_COMMAND_START, 1));
>  	if (err < 0)
>  		return err;
>  
>  	/* Wait for NSP_COMMAND_START to go to 0 */
>  	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
> -			       NSP_COMMAND_START, 0);
> +			NSP_COMMAND_START, 0);
>  	if (err != 0) {
>  		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
> -			err, code);
> +				err, code);
>  		return err;
>  	}
>  
>  	/* Wait for NSP_STATUS_BUSY to go to 0 */
> -	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
> -			       0);
> +	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
> +			NSP_STATUS_BUSY, 0);
>  	if (err != 0) {
>  		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
> -			err, code);
> +				err, code);
>  		return err;
>  	}
>  
> @@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
>  	err = FIELD_GET(NSP_STATUS_RESULT, reg);
>  	if (err != 0) {
>  		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
> -			 -err, (int)ret_val, code);
> +				-err, (int)ret_val, code);
>  		nfp_nsp_print_extended_error(ret_val);
>  		return -err;
>  	}
> @@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
>  #define SZ_1M 0x00100000
>  
>  static int
> -nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
> -		    const void *in_buf, unsigned int in_size, void *out_buf,
> -		    unsigned int out_size)
> +nfp_nsp_command_buf(struct nfp_nsp *nsp,
> +		uint16_t code, uint32_t option,
> +		const void *in_buf,
> +		unsigned int in_size,
> +		void *out_buf,
> +		unsigned int out_size)
>  {
>  	struct nfp_cpp *cpp = nsp->cpp;
>  	unsigned int max_size;
> @@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
>  
>  	if (nsp->ver.minor < 13) {
>  		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
> -			    code, nsp->ver.major, nsp->ver.minor);
> +				code, nsp->ver.major, nsp->ver.minor);
>  		return -EOPNOTSUPP;
>  	}
>  
>  	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
> -			    nfp_resource_address(nsp->res) +
> -			    NSP_DFLT_BUFFER_CONFIG,
> -			    &reg);
> +			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
> +			&reg);
>  	if (err < 0)
>  		return err;
>  
>  	max_size = RTE_MAX(in_size, out_size);
>  	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
>  		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
> -			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
> +				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
>  		return -EINVAL;
>  	}
>  
>  	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
> -			    nfp_resource_address(nsp->res) +
> -			    NSP_DFLT_BUFFER,
> -			    &reg);
> +			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
> +			&reg);
>  	if (err < 0)
>  		return err;
>  
> @@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
>  	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
>  		memset(out_buf, 0, out_size - in_size);
>  		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
> -				    out_size - in_size);
> +				out_size - in_size);
>  		if (err < 0)
>  			return err;
>  	}
> @@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
>  }
>  
>  int
> -nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
> +nfp_nsp_load_fw(struct nfp_nsp *state,
> +		void *buf,
> +		unsigned int size)
>  {
>  	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
> -				   NULL, 0);
> +			NULL, 0);
>  }
>  
>  int
> -nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
> +nfp_nsp_read_eth_table(struct nfp_nsp *state,
> +		void *buf,
> +		unsigned int size)
>  {
>  	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
> -				   buf, size);
> +			buf, size);
>  }
>  
>  int
> -nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
> -			unsigned int size)
> +nfp_nsp_write_eth_table(struct nfp_nsp *state,
> +		const void *buf,
> +		unsigned int size)
>  {
>  	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
> -				   NULL, 0);
> +			NULL, 0);
>  }
>  
>  int
> -nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
> +nfp_nsp_read_identify(struct nfp_nsp *state,
> +		void *buf,
> +		unsigned int size)
>  {
>  	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
> -				   buf, size);
> +			buf, size);
>  }
>  
>  int
> -nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
> -		     unsigned int size)
> +nfp_nsp_read_sensors(struct nfp_nsp *state,
> +		unsigned int sensor_mask,
> +		void *buf,
> +		unsigned int size)
>  {
>  	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
> -				   0, buf, size);
> +			0, buf, size);
>  }
> diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
> index 9905b2d3d3..1e2deaabb4 100644
> --- a/drivers/net/nfp/nfpcore/nfp_nsp.h
> +++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
> @@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
>  int nfp_nsp_mac_reinit(struct nfp_nsp *state);
>  int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
>  int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
> -			 void *buf, unsigned int size);
> +		void *buf, unsigned int size);
>  
> -static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
> +static inline int
> +nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
>  {
>  	return nfp_nsp_get_abi_ver_minor(state) > 20;
>  }
> @@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
>  
>  int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
>  int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
> -			   int configed);
> -int
> -nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
> +		int configed);
> +int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
>  
>  int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
>  int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
> -			    unsigned int size);
> +		unsigned int size);
>  void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
> -			      unsigned int idx);
> +		unsigned int idx);
>  void nfp_nsp_config_clear_state(struct nfp_nsp *state);
>  void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
>  void *nfp_nsp_config_entries(struct nfp_nsp *state);
>  int nfp_nsp_config_modified(struct nfp_nsp *state);
>  unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
>  
> -static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
> +static inline int
> +nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
>  {
>  	return !!eth_port->fec_modes_supported;
>  }
> @@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
>  };
>  
>  int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
> -			  long *val);
> +		long *val);
>  
>  #endif
> diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
> index 21b338461e..28dba27124 100644
> --- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
> +++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
> @@ -73,7 +73,9 @@ struct nfp_sensors {
>  };
>  
>  int
> -nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
> +nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
> +		enum nfp_nsp_sensor_id id,
> +		long *val)
>  {
>  	struct nfp_sensors s;
>  	struct nfp_nsp *nsp;
> diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
> index 825a84a8cd..51bd57033e 100644
> --- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
> +++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
> @@ -159,7 +159,8 @@ nfp_eth_speed2rate(unsigned int speed)
>  }
>  
>  static void
> -nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
> +nfp_eth_copy_mac_reverse(uint8_t *dst,
> +		const uint8_t *src)
>  {
>  	int i;
>  
> @@ -168,8 +169,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
>  }
>  
>  static void
> -nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
> -		       unsigned int index, struct nfp_eth_table_port *dst)
> +nfp_eth_port_translate(struct nfp_nsp *nsp,
> +		const union eth_table_entry *src,
> +		unsigned int index,
> +		struct nfp_eth_table_port *dst)
>  {
>  	unsigned int rate;
>  	unsigned int fec;
> @@ -225,21 +228,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
>  
>  	for (i = 0; i < table->count; i++) {
>  		table->max_index = RTE_MAX(table->max_index,
> -					   table->ports[i].index);
> +				table->ports[i].index);
>  
>  		for (j = 0; j < table->count; j++) {
>  			if (table->ports[i].label_port !=
> -			    table->ports[j].label_port)
> +					table->ports[j].label_port)
>  				continue;
>  			table->ports[i].port_lanes += table->ports[j].lanes;
>  
>  			if (i == j)
>  				continue;
>  			if (table->ports[i].label_subport ==
> -			    table->ports[j].label_subport)
> +					table->ports[j].label_subport)
>  				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
> -					 table->ports[i].label_port,
> -					 table->ports[i].label_subport);
> +						table->ports[i].label_port,
> +						table->ports[i].label_subport);
>  
>  			table->ports[i].is_split = 1;
>  		}
> @@ -296,7 +299,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
>  	 */
>  	if (ret != 0 && ret != cnt) {
>  		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
> -		       ret, cnt);
> +				ret, cnt);
>  		goto err;
>  	}
>  
> @@ -354,7 +357,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
>  }
>  
>  struct nfp_nsp *
> -nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
> +nfp_eth_config_start(struct nfp_cpp *cpp,
> +		unsigned int idx)
>  {
>  	union eth_table_entry *entries;
>  	struct nfp_nsp *nsp;
> @@ -447,7 +451,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
>   * -ERRNO - configuration failed.
>   */
>  int
> -nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
> +nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
> +		unsigned int idx,
> +		int enable)
>  {
>  	union eth_table_entry *entries;
>  	struct nfp_nsp *nsp;
> @@ -487,7 +493,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
>   * -ERRNO - configuration failed.
>   */
>  int
> -nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
> +nfp_eth_set_configured(struct nfp_cpp *cpp,
> +		unsigned int idx,
> +		int configed)
>  {
>  	union eth_table_entry *entries;
>  	struct nfp_nsp *nsp;
> @@ -523,9 +531,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
>  }
>  
>  static int
> -nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
> -		       const uint64_t mask, const unsigned int shift,
> -		       unsigned int val, const uint64_t ctrl_bit)
> +nfp_eth_set_bit_config(struct nfp_nsp *nsp,
> +		unsigned int raw_idx,
> +		const uint64_t mask,
> +		const unsigned int shift,
> +		unsigned int val,
> +		const uint64_t ctrl_bit)
>  {
>  	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
>  	unsigned int idx = nfp_nsp_config_idx(nsp);
> @@ -560,7 +571,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
>  	(__extension__ ({ \
>  		typeof(mask) _x = (mask); \
>  		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
> -				       val, ctrl_bit);			\
> +				val, ctrl_bit);			\
>  	}))
>  
>  /*
> @@ -574,11 +585,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
>   * Return: 0 or -ERRNO.
>   */
>  int
> -__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
> +__nfp_eth_set_aneg(struct nfp_nsp *nsp,
> +		enum nfp_eth_aneg mode)
>  {
>  	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
> -				      NSP_ETH_STATE_ANEG, mode,
> -				      NSP_ETH_CTRL_SET_ANEG);
> +			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
>  }
>  
>  /*
> @@ -592,11 +603,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
>   * Return: 0 or -ERRNO.
>   */
>  static int
> -__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
> +__nfp_eth_set_fec(struct nfp_nsp *nsp,
> +		enum nfp_eth_fec mode)
>  {
>  	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
> -				      NSP_ETH_STATE_FEC, mode,
> -				      NSP_ETH_CTRL_SET_FEC);
> +			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
>  }
>  
>  /*
> @@ -611,7 +622,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
>   * -ERRNO - configuration failed.
>   */
>  int
> -nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
> +nfp_eth_set_fec(struct nfp_cpp *cpp,
> +		unsigned int idx,
> +		enum nfp_eth_fec mode)
>  {
>  	struct nfp_nsp *nsp;
>  	int err;
> @@ -642,7 +655,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
>   * Return: 0 or -ERRNO.
>   */
>  int
> -__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
> +__nfp_eth_set_speed(struct nfp_nsp *nsp,
> +		unsigned int speed)
>  {
>  	enum nfp_eth_rate rate;
>  
> @@ -653,8 +667,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
>  	}
>  
>  	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
> -				      NSP_ETH_STATE_RATE, rate,
> -				      NSP_ETH_CTRL_SET_RATE);
> +			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
>  }
>  
>  /*
> @@ -668,8 +681,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
>   * Return: 0 or -ERRNO.
>   */
>  int
> -__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
> +__nfp_eth_set_split(struct nfp_nsp *nsp,
> +		unsigned int lanes)
>  {
> -	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
> -				      lanes, NSP_ETH_CTRL_SET_LANES);
> +	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
> +			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
>  }
> diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
> index 838cd6e0ef..57089c770f 100644
> --- a/drivers/net/nfp/nfpcore/nfp_resource.c
> +++ b/drivers/net/nfp/nfpcore/nfp_resource.c
> @@ -64,7 +64,8 @@ struct nfp_resource {
>  };
>  
>  static int
> -nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
> +nfp_cpp_resource_find(struct nfp_cpp *cpp,
> +		struct nfp_resource *res)
>  {
>  	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
>  	struct nfp_resource_entry entry;
> @@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
>  
>  	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
>  		uint64_t addr = NFP_RESOURCE_TBL_BASE +
> -			sizeof(struct nfp_resource_entry) * i;
> +				sizeof(struct nfp_resource_entry) * i;
>  
>  		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
>  		if (ret != sizeof(entry))
> @@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
>  			continue;
>  
>  		/* Found key! */
> -		res->mutex =
> -			nfp_cpp_mutex_alloc(cpp,
> -					    NFP_RESOURCE_TBL_TARGET, addr, key);
> +		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
> +				addr, key);
>  		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
> -					 entry.region.cpp_action,
> -					 entry.region.cpp_token);
> +				entry.region.cpp_action,
> +				entry.region.cpp_token);
>  		res->addr = ((uint64_t)entry.region.page_offset) << 8;
>  		res->size = (uint64_t)entry.region.page_size << 8;
>  		return 0;
> @@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
>  }
>  
>  static int
> -nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
> -			 struct nfp_cpp_mutex *dev_mutex)
> +nfp_resource_try_acquire(struct nfp_cpp *cpp,
> +		struct nfp_resource *res,
> +		struct nfp_cpp_mutex *dev_mutex)
>  {
>  	int err;
>  
> @@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
>   * Return: NFP Resource handle, or NULL
>   */
>  struct nfp_resource *
> -nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
> +nfp_resource_acquire(struct nfp_cpp *cpp,
> +		const char *name)
>  {
>  	struct nfp_cpp_mutex *dev_mutex;
>  	struct nfp_resource *res;
> @@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
>  	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
>  
>  	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
> -					NFP_RESOURCE_TBL_BASE,
> -					NFP_RESOURCE_TBL_KEY);
> +			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
>  	if (dev_mutex == NULL) {
>  		free(res);
>  		return NULL;
> @@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
>   *
>   * Return: const char pointer to the name of the resource
>   */
> -const char
> -*nfp_resource_name(const struct nfp_resource *res)
> +const char *
> +nfp_resource_name(const struct nfp_resource *res)
>  {
>  	return res->name;
>  }
> diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
> index 06cc6f74f4..009b7359a4 100644
> --- a/drivers/net/nfp/nfpcore/nfp_resource.h
> +++ b/drivers/net/nfp/nfpcore/nfp_resource.h
> @@ -18,7 +18,7 @@
>  struct nfp_resource;
>  
>  struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
> -					  const char *name);
> +		const char *name);
>  
>  /**
>   * Release a NFP Resource, and free the handle
> diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
> index 4c45aec5c1..aa3b7a483e 100644
> --- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
> +++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
> @@ -40,22 +40,25 @@ struct nfp_rtsym_table {
>  };
>  
>  static int
> -nfp_meid(uint8_t island_id, uint8_t menum)
> +nfp_meid(uint8_t island_id,
> +		uint8_t menum)
>  {
>  	return (island_id & 0x3F) == island_id && menum < 12 ?
>  		(island_id << 4) | (menum + 4) : -1;
>  }
>  
>  static void
> -nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
> -			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
> +nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
> +		uint32_t strtab_size,
> +		struct nfp_rtsym *sw,
> +		struct nfp_rtsym_entry *fw)
>  {
>  	sw->type = fw->type;
>  	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
>  	sw->addr = ((uint64_t)fw->addr_hi << 32) |
> -		   rte_le_to_cpu_32(fw->addr_lo);
> +			rte_le_to_cpu_32(fw->addr_lo);
>  	sw->size = ((uint64_t)fw->size_hi << 32) |
> -		   rte_le_to_cpu_32(fw->size_lo);
> +			rte_le_to_cpu_32(fw->size_lo);
>  
>  	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
>  		     sw->name, sw->addr, sw->size, sw->target);
> @@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
>  }
>  
>  struct nfp_rtsym_table *
> -__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
> +__nfp_rtsym_table_read(struct nfp_cpp *cpp,
> +		const struct nfp_mip *mip)
>  {
>  	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
>  	struct nfp_rtsym_entry *rtsymtab;
> @@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
>  
>  	for (n = 0; n < cache->num; n++)
>  		nfp_rtsym_sw_entry_init(cache, strtab_size,
> -					&cache->symtab[n], &rtsymtab[n]);
> +				&cache->symtab[n], &rtsymtab[n]);
>  
>  	free(rtsymtab);
>  
> @@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
>   * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
>   */
>  const struct nfp_rtsym *
> -nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
> +nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
> +		int idx)
>  {
>  	if (rtbl == NULL)
>  		return NULL;
> @@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
>   * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
>   */
>  const struct nfp_rtsym *
> -nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
> +nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
> +		const char *name)
>  {
>  	int n;
>  
> @@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
>   * Return: value read, on error sets the error and returns ~0ULL.
>   */
>  uint64_t
> -nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
> +nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
> +		const char *name,
> +		int *error)
>  {
>  	const struct nfp_rtsym *sym;
>  	uint32_t val32;
> @@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
>  		break;
>  	default:
>  		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
> -			name, sym->size);
> +				name, sym->size);
>  		err = -EINVAL;
>  		break;
>  	}
> @@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
>  }
>  
>  uint8_t *
> -nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
> -	      unsigned int min_size, struct nfp_cpp_area **area)
> +nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
> +		const char *name,
> +		unsigned int min_size,
> +		struct nfp_cpp_area **area)
>  {
>  	int ret;
>  	uint8_t *mem;
> @@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
>  
>  	if (sym->size < min_size) {
>  		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
> -			sym->size, min_size);
> +				sym->size, min_size);
>  		return NULL;
>  	}
>  
> diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
> index 8b494211bc..30768f1ccf 100644
> --- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
> +++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
> @@ -43,19 +43,18 @@ struct nfp_rtsym_table;
>  
>  struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
>  
> -struct nfp_rtsym_table *
> -__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
> +struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
> +		const struct nfp_mip *mip);
>  
>  int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
>  
>  const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
>  
> -const struct nfp_rtsym *
> -nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
> +const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
> +		const char *name);
>  
>  uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
> -			   int *error);
> -uint8_t *
> -nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
> -	      unsigned int min_size, struct nfp_cpp_area **area);
> +		int *error);
> +uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
> +		unsigned int min_size, struct nfp_cpp_area **area);
>  #endif

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[relevance 0%]

* Minutes of Technical Board Meeting, 2023-Jun-28
       [not found]     <PAXPR04MB932824B064C14CEAE1093E93891CA@PAXPR04MB9328.eurprd04.prod.outlook.com>
@ 2023-09-18  5:18  3% ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2023-09-18  5:18 UTC (permalink / raw)
  To: techboard, dev

[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]

Minutes of Technical Board Meeting, 2023-Jun-28

Members Attending
-----------------
-Aaron
-Hemant (Chair)
-Jerin
-Keven
-Konstantin
-Maxime
-Stephen
-Nathan
-Ben

NOTE: The technical board meetings every second Wednesday at https://meet.jit.si/DPDK at 3 pm UTC.
Meetings are public, and DPDK community members are welcome to attend.
The agenda is available at: https://annuel.framapad.org/p/r.0c3cc4d1e011214183872a98f6b5c7db

NOTE: Next meeting will be on Wednesday 2023-July-12 @3pm UTC, and will be chaired by Honnappa



Newsletter
--------------
1. Ben reminded about the inputs for Newsletter. Expecting contributions.

Dublin DPDK submit
---------------------------

1) Decent amount of contribution received, the CFP date for 30th June may be extended.
2) 30 + Registrations

Other topics.
-------------------
1) Discussed about memarea library:
                - It is to provide a simple memory manager for non-huge page library
                - Stephen and Jerin will be providing feedback
2) Discussed the idea about pre-submitting code for 23.11 ABI compatibility.

[-- Attachment #2: Type: text/html, Size: 4337 bytes --]

^ permalink raw reply	[relevance 3%]

* [PATCH v4 18/26] net/nfp: refact the nsp module
                           ` (2 preceding siblings ...)
  2023-09-18  2:45  1%       ` [PATCH v4 07/26] net/nfp: standard the comment style Chaoyong He
@ 2023-09-18  2:46  5%       ` Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-18  2:46 UTC (permalink / raw)
  To: dev; +Cc: Chaoyong He, Niklas Söderlund

Move the definition of data structure into the implement file.
Also sync the logic from kernel driver and remove the unneeded header
file include statements.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c           |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c      | 390 +++++++++++++++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h      | 140 ++++-----
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c |   4 -
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c  |  79 ++---
 5 files changed, 398 insertions(+), 217 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index e3ff3d8087..efb47c5d56 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -661,7 +661,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 static int
 nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	struct nfp_cpp *cpp = nfp_nsp_cpp(nsp);
 	void *fw_buf;
 	char fw_name[125];
 	char serial[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 0f67148907..e9b3fc3945 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -3,20 +3,127 @@
  * All rights reserved.
  */
 
-#define NFP_SUBSYS "nfp_nsp"
-
-#include <stdio.h>
-#include <time.h>
+#include "nfp_nsp.h"
 
 #include <rte_common.h>
 
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
-#include "nfp_nsp.h"
 #include "nfp_platform.h"
 #include "nfp_resource.h"
 
-int
+/* Offsets relative to the CSR base */
+#define NSP_STATUS              0x00
+#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
+#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
+#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
+#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
+#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
+#define   NSP_STATUS_BUSY       RTE_BIT64(0)
+
+#define NSP_COMMAND             0x08
+#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
+#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
+#define   NSP_COMMAND_DMA_BUF   RTE_BIT64(1)
+#define   NSP_COMMAND_START     RTE_BIT64(0)
+
+/* CPP address to retrieve the data from */
+#define NSP_BUFFER              0x10
+#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
+#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER         0x18
+#define   NSP_DFLT_BUFFER_CPP          GENMASK_ULL(63, 40)
+#define   NSP_DFLT_BUFFER_ADDRESS      GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER_CONFIG  0x20
+#define   NSP_DFLT_BUFFER_SIZE_4KB     GENMASK_ULL(15, 8)
+#define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
+
+#define NSP_MAGIC               0xab10
+#define NSP_MAJOR               0
+#define NSP_MINOR               8
+
+#define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
+#define NSP_CODE_MINOR          GENMASK_ULL(11, 0)
+
+#define NFP_FW_LOAD_RET_MAJOR   GENMASK_ULL(15, 8)
+#define NFP_FW_LOAD_RET_MINOR   GENMASK_ULL(23, 16)
+
+enum nfp_nsp_cmd {
+	SPCODE_NOOP             = 0, /* No operation */
+	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
+	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
+	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
+	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
+	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
+	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
+	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
+	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
+	SPCODE_NSP_WRITE_FLASH  = 11, /* Load and flash image from buffer */
+	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
+	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
+	SPCODE_FW_STORED        = 16, /* If no FW loaded, load flash app FW */
+	SPCODE_HWINFO_LOOKUP    = 17, /* Lookup HWinfo with overwrites etc. */
+	SPCODE_HWINFO_SET       = 18, /* Set HWinfo entry */
+	SPCODE_FW_LOADED        = 19, /* Is application firmware loaded */
+	SPCODE_VERSIONS         = 21, /* Report FW versions */
+	SPCODE_READ_SFF_EEPROM  = 22, /* Read module EEPROM */
+	SPCODE_READ_MEDIA       = 23, /* Get the supported/advertised media for a port */
+};
+
+static const struct {
+	uint32_t code;
+	const char *msg;
+} nsp_errors[] = {
+	{ 6010, "could not map to phy for port" },
+	{ 6011, "not an allowed rate/lanes for port" },
+	{ 6012, "not an allowed rate/lanes for port" },
+	{ 6013, "high/low error, change other port first" },
+	{ 6014, "config not found in flash" },
+};
+
+struct nfp_nsp {
+	struct nfp_cpp *cpp;
+	struct nfp_resource *res;
+	struct {
+		uint16_t major;
+		uint16_t minor;
+	} ver;
+
+	/** Eth table config state */
+	bool modified;
+	uint32_t idx;
+	void *entries;
+};
+
+/* NFP command argument structure */
+struct nfp_nsp_command_arg {
+	uint16_t code;         /**< NFP SP Command Code */
+	bool dma;              /**< @buf points to a host buffer, not NSP buffer */
+	bool error_quiet;      /**< Don't print command error/warning */
+	uint32_t timeout_sec;  /**< Timeout value to wait for completion in seconds */
+	uint32_t option;       /**< NSP Command Argument */
+	uint64_t buf;          /**< NSP Buffer Address */
+	/** Callback for interpreting option if error occurred */
+	void (*error_cb)(struct nfp_nsp *state, uint32_t ret_val);
+};
+
+/* NFP command with buffer argument structure */
+struct nfp_nsp_command_buf_arg {
+	struct nfp_nsp_command_arg arg;  /**< NFP command argument structure */
+	const void *in_buf;              /**< Buffer with data for input */
+	void *out_buf;                   /**< Buffer for output data */
+	uint32_t in_size;                /**< Size of @in_buf */
+	uint32_t out_size;               /**< Size of @out_buf */
+};
+
+struct nfp_cpp *
+nfp_nsp_cpp(struct nfp_nsp *state)
+{
+	return state->cpp;
+}
+
+bool
 nfp_nsp_config_modified(struct nfp_nsp *state)
 {
 	return state->modified;
@@ -24,7 +131,7 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 
 void
 nfp_nsp_config_set_modified(struct nfp_nsp *state,
-		int modified)
+		bool modified)
 {
 	state->modified = modified;
 }
@@ -66,7 +173,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 		return;
 
 	for (i = 0; i < RTE_DIM(nsp_errors); i++)
-		if (ret_val == (uint32_t)nsp_errors[i].code)
+		if (ret_val == nsp_errors[i].code)
 			PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg);
 }
 
@@ -222,11 +329,8 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
  *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state,
-		uint16_t code,
-		uint32_t option,
-		uint32_t buff_cpp,
-		uint64_t buff_addr)
+nfp_nsp_command_real(struct nfp_nsp *state,
+		const struct nfp_nsp_command_arg *arg)
 {
 	int err;
 	uint64_t reg;
@@ -250,22 +354,14 @@ nfp_nsp_command(struct nfp_nsp *state,
 		return err;
 	}
 
-	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
-		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-				buff_cpp, buff_addr);
-		return -EINVAL;
-	}
-
-	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer, arg->buf);
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+			FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
+			FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
 			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
@@ -275,7 +371,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -284,7 +380,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -296,84 +392,85 @@ nfp_nsp_command(struct nfp_nsp *state,
 
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-				-err, (int)ret_val, code);
-		nfp_nsp_print_extended_error(ret_val);
+		if (!arg->error_quiet)
+			PMD_DRV_LOG(WARNING, "Result (error) code set: %d (%d) command: %d",
+					-err, (int)ret_val, arg->code);
+
+		if (arg->error_cb != 0)
+			arg->error_cb(state, ret_val);
+		else
+			nfp_nsp_print_extended_error(ret_val);
+
 		return -err;
 	}
 
 	return ret_val;
 }
 
-#define SZ_1M 0x00100000
+static int
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code)
+{
+	const struct nfp_nsp_command_arg arg = {
+		.code = code,
+	};
+
+	return nfp_nsp_command_real(state, &arg);
+}
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp,
-		uint16_t code, uint32_t option,
-		const void *in_buf,
-		unsigned int in_size,
-		void *out_buf,
-		unsigned int out_size)
+nfp_nsp_command_buf_def(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
 {
 	int err;
 	int ret;
 	uint64_t reg;
-	size_t max_size;
 	uint32_t cpp_id;
 	uint64_t cpp_buf;
 	struct nfp_cpp *cpp = nsp->cpp;
 
-	if (nsp->ver.minor < 13) {
-		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-				code, nsp->ver.major, nsp->ver.minor);
-		return -EOPNOTSUPP;
-	}
-
-	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
-			&reg);
-	if (err < 0)
-		return err;
-
-	max_size = RTE_MAX(in_size, out_size);
-	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
-		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %zu)",
-				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
-		return -EINVAL;
-	}
-
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
 			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
 			&reg);
 	if (err < 0)
 		return err;
 
-	cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8;
-	cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg);
+	cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
+	cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
 
-	if (in_buf != NULL && in_size > 0) {
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
+	if (arg->in_buf != NULL && arg->in_size > 0) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf,
+				arg->in_buf, arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
 	/* Zero out remaining part of the buffer */
-	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
-		memset(out_buf, 0, out_size - in_size);
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				out_size - in_size);
+	if (arg->out_buf != NULL && arg->out_size > arg->in_size) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + arg->in_size,
+				arg->out_buf, arg->out_size - arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
-	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
+	if (!FIELD_FIT(NSP_BUFFER_CPP, cpp_id >> 8) ||
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, cpp_buf)) {
+		PMD_DRV_LOG(ERR, "Buffer out of reach %#08x %#016lx",
+				cpp_id, cpp_buf);
+		return -EINVAL;
+	}
+
+	arg->arg.buf = FIELD_PREP(NSP_BUFFER_CPP, cpp_id >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, cpp_buf);
+	ret = nfp_nsp_command_real(nsp, &arg->arg);
 	if (ret < 0) {
 		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
 	}
 
-	if (out_buf != NULL && out_size > 0) {
-		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
+	if (arg->out_buf != NULL && arg->out_size > 0) {
+		err = nfp_cpp_read(cpp, cpp_id, cpp_buf,
+				arg->out_buf, arg->out_size);
 		if (err < 0)
 			return err;
 	}
@@ -381,6 +478,43 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	return ret;
 }
 
+#define SZ_1M 0x00100000
+#define SZ_4K 0x00001000
+
+static int
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
+{
+	int err;
+	uint64_t reg;
+	uint32_t size;
+	uint32_t max_size;
+	struct nfp_cpp *cpp = nsp->cpp;
+
+	if (nsp->ver.minor < 13) {
+		PMD_DRV_LOG(ERR, "NSP: Code %#04x with buffer not supported ABI %hu.%hu)",
+				arg->arg.code, nsp->ver.major, nsp->ver.minor);
+		return -EOPNOTSUPP;
+	}
+
+	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
+	if (err < 0)
+		return err;
+
+	max_size = RTE_MAX(arg->in_size, arg->out_size);
+	size = FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M +
+			FIELD_GET(NSP_DFLT_BUFFER_SIZE_4KB, reg) * SZ_4K;
+	if (size < max_size) {
+		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command %#04x (%u < %u)",
+				arg->arg.code, size, max_size);
+		return -EINVAL;
+	}
+
+	return nfp_nsp_command_buf_def(nsp, arg);
+}
+
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
@@ -392,7 +526,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
-		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
+		err = nfp_nsp_command(state, SPCODE_NOOP);
 		if (err != -EAGAIN)
 			break;
 
@@ -413,13 +547,57 @@ nfp_nsp_wait(struct nfp_nsp *state)
 int
 nfp_nsp_device_soft_reset(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_SOFT_RESET, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_SOFT_RESET);
 }
 
 int
 nfp_nsp_mac_reinit(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_MAC_INIT, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_MAC_INIT);
+}
+
+static void
+nfp_nsp_load_fw_extended_msg(struct nfp_nsp *state,
+		uint32_t ret_val)
+{
+	uint32_t minor;
+	uint32_t major;
+	static const char * const major_msg[] = {
+		/* 0 */ "Firmware from driver loaded",
+		/* 1 */ "Firmware from flash loaded",
+		/* 2 */ "Firmware loading failure",
+	};
+	static const char * const minor_msg[] = {
+		/*  0 */ "",
+		/*  1 */ "no named partition on flash",
+		/*  2 */ "error reading from flash",
+		/*  3 */ "can not deflate",
+		/*  4 */ "not a trusted file",
+		/*  5 */ "can not parse FW file",
+		/*  6 */ "MIP not found in FW file",
+		/*  7 */ "null firmware name in MIP",
+		/*  8 */ "FW version none",
+		/*  9 */ "FW build number none",
+		/* 10 */ "no FW selection policy HWInfo key found",
+		/* 11 */ "static FW selection policy",
+		/* 12 */ "FW version has precedence",
+		/* 13 */ "different FW application load requested",
+		/* 14 */ "development build",
+	};
+
+	major = FIELD_GET(NFP_FW_LOAD_RET_MAJOR, ret_val);
+	minor = FIELD_GET(NFP_FW_LOAD_RET_MINOR, ret_val);
+
+	if (!nfp_nsp_has_stored_fw_load(state))
+		return;
+
+	if (major >= RTE_DIM(major_msg))
+		PMD_DRV_LOG(INFO, "FW loading status: %x", ret_val);
+	else if (minor >= RTE_DIM(minor_msg))
+		PMD_DRV_LOG(INFO, "%s, reason code: %d", major_msg[major], minor);
+	else
+		PMD_DRV_LOG(INFO, "%s%c %s", major_msg[major],
+				minor != 0 ? ',' : '.', minor_msg[minor]);
 }
 
 int
@@ -427,8 +605,24 @@ nfp_nsp_load_fw(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-			NULL, 0);
+	int ret;
+	struct nfp_nsp_command_buf_arg load_fw = {
+		{
+			.code     = SPCODE_FW_LOAD,
+			.option   = size,
+			.error_cb = nfp_nsp_load_fw_extended_msg,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	ret = nfp_nsp_command_buf(state, &load_fw);
+	if (ret < 0)
+		return ret;
+
+	nfp_nsp_load_fw_extended_msg(state, ret);
+
+	return 0;
 }
 
 int
@@ -436,8 +630,16 @@ nfp_nsp_read_eth_table(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg eth_rescan = {
+		{
+			.code   = SPCODE_ETH_RESCAN,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_rescan);
 }
 
 int
@@ -445,8 +647,16 @@ nfp_nsp_write_eth_table(struct nfp_nsp *state,
 		const void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-			NULL, 0);
+	struct nfp_nsp_command_buf_arg eth_ctrl = {
+		{
+			.code   = SPCODE_ETH_CONTROL,
+			.option = size,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_ctrl);
 }
 
 int
@@ -454,8 +664,16 @@ nfp_nsp_read_identify(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg identify = {
+		{
+			.code   = SPCODE_NSP_IDENTIFY,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &identify);
 }
 
 int
@@ -464,6 +682,14 @@ nfp_nsp_read_sensors(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-			0, buf, size);
+	struct nfp_nsp_command_buf_arg sensors = {
+		{
+			.code   = SPCODE_NSP_SENSORS,
+			.option = sensor_mask,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &sensors);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 14986a9130..fe52dffeb7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -7,78 +7,8 @@
 #define __NSP_NSP_H__
 
 #include "nfp_cpp.h"
-#include "nfp_nsp.h"
-
-/* Offsets relative to the CSR base */
-#define NSP_STATUS              0x00
-#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
-#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
-#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
-#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
-#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
-#define   NSP_STATUS_BUSY       RTE_BIT64(0)
-
-#define NSP_COMMAND             0x08
-#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
-#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
-#define   NSP_COMMAND_START     RTE_BIT64(0)
-
-/* CPP address to retrieve the data from */
-#define NSP_BUFFER              0x10
-#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
-#define   NSP_BUFFER_PCIE       GENMASK_ULL(39, 38)
-#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(37, 0)
-
-#define NSP_DFLT_BUFFER         0x18
-
-#define NSP_DFLT_BUFFER_CONFIG 0x20
-#define   NSP_DFLT_BUFFER_SIZE_MB    GENMASK_ULL(7, 0)
-
-#define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
-#define NSP_MINOR               8
-
-#define NSP_CODE_MAJOR          GENMASK(15, 12)
-#define NSP_CODE_MINOR          GENMASK(11, 0)
-
-enum nfp_nsp_cmd {
-	SPCODE_NOOP             = 0, /* No operation */
-	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
-	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
-	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
-	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
-	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
-	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
-	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
-	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
-	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
-	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
-};
-
-static const struct {
-	int code;
-	const char *msg;
-} nsp_errors[] = {
-	{ 6010, "could not map to phy for port" },
-	{ 6011, "not an allowed rate/lanes for port" },
-	{ 6012, "not an allowed rate/lanes for port" },
-	{ 6013, "high/low error, change other port first" },
-	{ 6014, "config not found in flash" },
-};
 
-struct nfp_nsp {
-	struct nfp_cpp *cpp;
-	struct nfp_resource *res;
-	struct {
-		uint16_t major;
-		uint16_t minor;
-	} ver;
-
-	/* Eth table config state */
-	int modified;
-	unsigned int idx;
-	void *entries;
-};
+struct nfp_nsp;
 
 struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp);
 void nfp_nsp_close(struct nfp_nsp *state);
@@ -92,18 +22,61 @@ int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, size_t size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, uint32_t sensor_mask,
 		void *buf, size_t size);
 
-static inline int
+static inline bool
 nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
 
+static inline bool
+nfp_nsp_has_stored_fw_load(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 23;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_lookup(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 24;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_set(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_fw_loaded(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_versions(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 27;
+}
+
+static inline bool
+nfp_nsp_has_read_module_eeprom(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 28;
+}
+
+static inline bool
+nfp_nsp_has_read_media(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 33;
+}
+
 enum nfp_eth_interface {
 	NFP_INTERFACE_NONE      = 0,
 	NFP_INTERFACE_SFP       = 1,
 	NFP_INTERFACE_SFPP      = 10,
 	NFP_INTERFACE_SFP28     = 28,
 	NFP_INTERFACE_QSFP      = 40,
+	NFP_INTERFACE_RJ45      = 45,
 	NFP_INTERFACE_CXP       = 100,
 	NFP_INTERFACE_QSFP28    = 112,
 };
@@ -151,6 +124,7 @@ struct nfp_eth_table {
 		enum nfp_eth_media media; /**< Media type of the @interface */
 
 		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_fec act_fec; /**< Active Forward Error Correction mode */
 		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
 		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
@@ -159,17 +133,18 @@ struct nfp_eth_table {
 		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;     /**< Enable port */
-		int tx_enabled;  /**< Enable TX */
-		int rx_enabled;  /**< Enable RX */
+		bool enabled;     /**< Enable port */
+		bool tx_enabled;  /**< Enable TX */
+		bool rx_enabled;  /**< Enable RX */
+		bool supp_aneg;   /**< Support auto negotiation */
 
-		int override_changed;  /**< Media reconfig pending */
+		bool override_changed;  /**< Media reconfig pending */
 
 		uint8_t port_type;    /**< One of %PORT_* */
 		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;   /**< Split port */
+		bool is_split;   /**< Split port */
 
 		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
 	} ports[]; /**< Table of ports */
@@ -177,8 +152,8 @@ struct nfp_eth_table {
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
-int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, int enable);
-int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, int configed);
+int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, bool enable);
+int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, bool configured);
 int nfp_eth_set_fec(struct nfp_cpp *cpp, uint32_t idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, size_t size);
@@ -187,12 +162,13 @@ int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
 		uint32_t idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
-void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
+void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
-int nfp_nsp_config_modified(struct nfp_nsp *state);
+struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
+bool nfp_nsp_config_modified(struct nfp_nsp *state);
 uint32_t nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int
+static inline bool
 nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return eth_port->fec_modes_supported != 0;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index f656f200f4..46fa5467de 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -3,12 +3,8 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
-#include "nfp_nffw.h"
 
 struct nsp_identify {
 	uint8_t version[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index eb30d8e779..cc472907ca 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -3,10 +3,6 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
 #include "nfp_platform.h"
@@ -21,6 +17,7 @@
 #define NSP_ETH_PORT_PHYLABEL           GENMASK_ULL(59, 54)
 #define NSP_ETH_PORT_FEC_SUPP_BASER     RTE_BIT64(60)
 #define NSP_ETH_PORT_FEC_SUPP_RS        RTE_BIT64(61)
+#define NSP_ETH_PORT_SUPP_ANEG          RTE_BIT64(63)
 
 #define NSP_ETH_PORT_LANES_MASK         rte_cpu_to_le_64(NSP_ETH_PORT_LANES)
 
@@ -34,6 +31,7 @@
 #define NSP_ETH_STATE_OVRD_CHNG         RTE_BIT64(22)
 #define NSP_ETH_STATE_ANEG              GENMASK_ULL(25, 23)
 #define NSP_ETH_STATE_FEC               GENMASK_ULL(27, 26)
+#define NSP_ETH_STATE_ACT_FEC           GENMASK_ULL(29, 28)
 
 #define NSP_ETH_CTRL_CONFIGURED         RTE_BIT64(0)
 #define NSP_ETH_CTRL_ENABLED            RTE_BIT64(1)
@@ -54,26 +52,12 @@
 #define PORT_NONE               0xef
 #define PORT_OTHER              0xff
 
-#define SPEED_10                10
-#define SPEED_100               100
-#define SPEED_1000              1000
-#define SPEED_2500              2500
-#define SPEED_5000              5000
-#define SPEED_10000             10000
-#define SPEED_14000             14000
-#define SPEED_20000             20000
-#define SPEED_25000             25000
-#define SPEED_40000             40000
-#define SPEED_50000             50000
-#define SPEED_56000             56000
-#define SPEED_100000            100000
-
 enum nfp_eth_raw {
 	NSP_ETH_RAW_PORT = 0,
 	NSP_ETH_RAW_STATE,
 	NSP_ETH_RAW_MAC,
 	NSP_ETH_RAW_CONTROL,
-	NSP_ETH_NUM_RAW
+	NSP_ETH_NUM_RAW,
 };
 
 enum nfp_eth_rate {
@@ -100,12 +84,12 @@ static const struct {
 	enum nfp_eth_rate rate;
 	uint32_t speed;
 } nsp_eth_rate_tbl[] = {
-	{ RATE_INVALID, 0, },
-	{ RATE_10M,     SPEED_10, },
-	{ RATE_100M,    SPEED_100, },
-	{ RATE_1G,      SPEED_1000, },
-	{ RATE_10G,     SPEED_10000, },
-	{ RATE_25G,     SPEED_25000, },
+	{ RATE_INVALID, RTE_ETH_SPEED_NUM_NONE, },
+	{ RATE_10M,     RTE_ETH_SPEED_NUM_10M, },
+	{ RATE_100M,    RTE_ETH_SPEED_NUM_100M, },
+	{ RATE_1G,      RTE_ETH_SPEED_NUM_1G, },
+	{ RATE_10G,     RTE_ETH_SPEED_NUM_10G, },
+	{ RATE_25G,     RTE_ETH_SPEED_NUM_25G, },
 };
 
 static uint32_t
@@ -193,7 +177,14 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 	if (dst->fec_modes_supported != 0)
 		dst->fec_modes_supported |= NFP_FEC_AUTO | NFP_FEC_DISABLED;
 
-	dst->fec = 1 << FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->fec = FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->act_fec = dst->fec;
+
+	if (nfp_nsp_get_abi_ver_minor(nsp) < 33)
+		return;
+
+	dst->act_fec = FIELD_GET(NSP_ETH_STATE_ACT_FEC, state);
+	dst->supp_aneg = FIELD_GET(NSP_ETH_PORT_SUPP_ANEG, port);
 }
 
 static void
@@ -222,7 +213,7 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 						table->ports[i].label_port,
 						table->ports[i].label_subport);
 
-			table->ports[i].is_split = 1;
+			table->ports[i].is_split = true;
 		}
 	}
 }
@@ -233,6 +224,9 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 	if (entry->interface == NFP_INTERFACE_NONE) {
 		entry->port_type = PORT_NONE;
 		return;
+	} else if (entry->interface == NFP_INTERFACE_RJ45) {
+		entry->port_type = PORT_TP;
+		return;
 	}
 
 	if (entry->media == NFP_MEDIA_FIBRE)
@@ -251,7 +245,6 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	uint32_t table_sz;
 	struct nfp_eth_table *table;
 	union eth_table_entry *entries;
-	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -264,16 +257,9 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/*
-	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
-	 * the rest 6 ports mac are all 0, ensure we don't use these port
-	 */
-	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
+	for (i = 0; i < NSP_ETH_MAX_COUNT; i++)
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
 			cnt++;
-	}
 
 	/*
 	 * Some versions of flash will give us 0 instead of port count. For
@@ -294,11 +280,8 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	memset(table, 0, table_sz);
 	table->count = cnt;
 	for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
-			nfp_eth_port_translate(nsp, &entries[i], i,
-					&table->ports[j++]);
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
+			nfp_eth_port_translate(nsp, &entries[i], i, &table->ports[j++]);
 	}
 
 	nfp_eth_calc_port_geometry(table);
@@ -440,7 +423,7 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int enable)
+		bool enable)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -448,7 +431,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
-		return -1;
+		return -EIO;
 
 	entries = nfp_nsp_config_entries(nsp);
 
@@ -460,7 +443,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_ENABLED, enable);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -484,7 +467,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int configured)
+		bool configured)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -513,7 +496,7 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -551,7 +534,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	entries[idx].control |= rte_cpu_to_le_64(ctrl_bit);
 
-	nfp_nsp_config_set_modified(nsp, 1);
+	nfp_nsp_config_set_modified(nsp, true);
 
 	return 0;
 }
-- 
2.39.1


^ permalink raw reply	[relevance 5%]

* [PATCH v4 07/26] net/nfp: standard the comment style
    2023-09-18  2:45  1%       ` [PATCH v4 02/26] net/nfp: unify the indent coding style Chaoyong He
  2023-09-18  2:45  3%       ` [PATCH v4 05/26] net/nfp: standard the local variable " Chaoyong He
@ 2023-09-18  2:45  1%       ` Chaoyong He
  2023-09-18  2:46  5%       ` [PATCH v4 18/26] net/nfp: refact the nsp module Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-18  2:45 UTC (permalink / raw)
  To: dev; +Cc: Chaoyong He, Niklas Söderlund

Follow the DPDK coding style, use the kdoc comment style.
Also move the comment of the functions to the implement file and
add some comment to help understand logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          | 504 ++++-----------------
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  39 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 484 ++++++++++++++++----
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  21 +-
 drivers/net/nfp/nfpcore/nfp_hwinfo.h       |   2 +
 drivers/net/nfp/nfpcore/nfp_mip.c          |  43 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  69 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  49 +-
 drivers/net/nfp/nfpcore/nfp_nffw.h         |   6 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          |  53 ++-
 drivers/net/nfp/nfpcore/nfp_nsp.h          | 108 ++---
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 170 ++++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 103 +++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |  28 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  59 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  12 +-
 drivers/net/nfp/nfpcore/nfp_target.c       |   2 +-
 17 files changed, 888 insertions(+), 864 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 139752f85a..82189e9910 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -10,9 +10,7 @@
 
 struct nfp_cpp_mutex;
 
-/*
- * NFP CPP handle
- */
+/* NFP CPP handle */
 struct nfp_cpp {
 	uint32_t model;
 	uint32_t interface;
@@ -37,9 +35,7 @@ struct nfp_cpp {
 	int driver_lock_needed;
 };
 
-/*
- * NFP CPP device area handle
- */
+/* NFP CPP device area handle */
 struct nfp_cpp_area {
 	struct nfp_cpp *cpp;
 	char *name;
@@ -127,35 +123,45 @@ struct nfp_cpp_operations {
 
 #define NFP_CPP_TARGET_ID_MASK 0x1f
 
-/*
+/**
  * Pack target, token, and action into a CPP ID.
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
  *
- * @return      NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ID(target, action, token)                               \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
 		(((action) & 0xff) << 8))
 
-/*
+/**
  * Pack target, token, action, and island into a CPP ID.
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
- * @island      NFP CPP island id
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @return      NFP CPP ID
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
+ * @param island
+ *   NFP CPP island id
+ *
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ISLAND_ID(target, action, token, island)                \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
@@ -163,9 +169,12 @@ struct nfp_cpp_operations {
 
 /**
  * Return the NFP CPP target of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP target
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP target
  */
 static inline uint8_t
 NFP_CPP_ID_TARGET_of(uint32_t id)
@@ -173,11 +182,14 @@ NFP_CPP_ID_TARGET_of(uint32_t id)
 	return (id >> 24) & NFP_CPP_TARGET_ID_MASK;
 }
 
-/*
+/**
  * Return the NFP CPP token of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP token
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP token
  */
 static inline uint8_t
 NFP_CPP_ID_TOKEN_of(uint32_t id)
@@ -185,11 +197,14 @@ NFP_CPP_ID_TOKEN_of(uint32_t id)
 	return (id >> 16) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP action of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP action
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP action
  */
 static inline uint8_t
 NFP_CPP_ID_ACTION_of(uint32_t id)
@@ -197,11 +212,14 @@ NFP_CPP_ID_ACTION_of(uint32_t id)
 	return (id >> 8) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP island of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP island
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP island
  */
 static inline uint8_t
 NFP_CPP_ID_ISLAND_of(uint32_t id)
@@ -215,109 +233,57 @@ NFP_CPP_ID_ISLAND_of(uint32_t id)
  */
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
 
-/*
- * Set the model id
- *
- * @param   cpp     NFP CPP operations structure
- * @param   model   Model ID
- */
 void nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   interface Interface ID
- */
 void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   serial  NFP serial byte array
- * @param   len     Length of the serial byte array
- */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
 		size_t serial_len);
 
-/*
- * Set the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv);
 
-/*
- * Return the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void *nfp_cpp_priv(struct nfp_cpp *cpp);
 
-/*
- * Get the privately allocated portion of a NFP CPP area handle
- *
- * @param   cpp_area    NFP CPP area handle
- * @return          Pointer to the private area, or NULL on failure
- */
 void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
 
 uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
 
-/*
- * NFP CPP core interface for CPP clients.
- */
-
-/*
- * Open a NFP CPP handle to a CPP device
- *
- * @param[in]	id	0-based ID for the CPP interface to use
- *
- * @return NFP CPP handle, or NULL on failure.
- */
+/* NFP CPP core interface for CPP clients */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed);
 
-/*
- * Free a NFP CPP handle
- *
- * @param[in]	cpp	NFP CPP handle
- */
 void nfp_cpp_free(struct nfp_cpp *cpp);
 
 #define NFP_CPP_MODEL_INVALID   0xffffffff
 
-/*
- * NFP_CPP_MODEL_CHIP_of - retrieve the chip ID from the model ID
+/**
+ * Retrieve the chip ID from the model ID
  *
  * The chip ID is a 16-bit BCD+A-F encoding for the chip type.
  *
- * @param[in]   model   NFP CPP model id
- * @return      NFP CPP chip id
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   NFP CPP chip id
  */
 #define NFP_CPP_MODEL_CHIP_of(model)        (((model) >> 16) & 0xffff)
 
-/*
- * NFP_CPP_MODEL_IS_6000 - Check for the NFP6000 family of devices
+/**
+ * Check for the NFP6000 family of devices
  *
  * NOTE: The NFP4000 series is considered as a NFP6000 series variant.
  *
- * @param[in]	model	NFP CPP model id
- * @return		true if model is in the NFP6000 family, false otherwise.
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   true if model is in the NFP6000 family, false otherwise.
  */
 #define NFP_CPP_MODEL_IS_6000(model)		     \
 		((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \
 		(NFP_CPP_MODEL_CHIP_of(model) < 0x7000))
 
-/*
- * nfp_cpp_model - Retrieve the Model ID of the NFP
- *
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Model ID
- */
 uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 
 /*
@@ -330,7 +296,7 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 #define NFP_CPP_INTERFACE_TYPE_RPC		0x3
 #define NFP_CPP_INTERFACE_TYPE_ILA		0x4
 
-/*
+/**
  * Construct a 16-bit NFP Interface ID
  *
  * Interface IDs consists of 4 bits of interface type, 4 bits of unit
@@ -340,422 +306,138 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
  * which use the MU Atomic CompareAndWrite operation - hence the limit to 16
  * bits to be able to use the NFP Interface ID as a lock owner.
  *
- * @param[in]	type	NFP Interface Type
- * @param[in]	unit	Unit identifier for the interface type
- * @param[in]	channel	Channel identifier for the interface unit
- * @return		Interface ID
+ * @param type
+ *   NFP Interface Type
+ * @param unit
+ *   Unit identifier for the interface type
+ * @param channel
+ *   Channel identifier for the interface unit
+ *
+ * @return
+ *   Interface ID
  */
 #define NFP_CPP_INTERFACE(type, unit, channel)	\
 	((((type) & 0xf) << 12) | \
 	 (((unit) & 0xf) <<  8) | \
 	 (((channel) & 0xff) << 0))
 
-/*
+/**
  * Get the interface type of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's type
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's type
  */
 #define NFP_CPP_INTERFACE_TYPE_of(interface)	(((interface) >> 12) & 0xf)
 
-/*
+/**
  * Get the interface unit of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's unit
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's unit
  */
 #define NFP_CPP_INTERFACE_UNIT_of(interface)	(((interface) >>  8) & 0xf)
 
-/*
+/**
  * Get the interface channel of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's channel
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's channel
  */
 #define NFP_CPP_INTERFACE_CHANNEL_of(interface)	(((interface) >>  0) & 0xff)
 
-/*
- * Retrieve the Interface ID of the NFP
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Interface ID
- */
+
 uint16_t nfp_cpp_interface(struct nfp_cpp *cpp);
 
-/*
- * Retrieve the NFP Serial Number (unique per NFP)
- * @param[in]	cpp	NFP CPP handle
- * @param[out]	serial	Pointer to reference the serial number array
- *
- * @return	size of the NFP6000 serial number, in bytes
- */
 int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, size_t size);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	name	Name of owner of the area
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint32_t cpp_id, const char *name, uint64_t address,
 		uint32_t size);
 
-/*
- * Free an allocated NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_free(struct nfp_cpp_area *area);
 
-/*
- * Acquire the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- *
- * @return 0 on success, -1 on failure.
- */
 int nfp_cpp_area_acquire(struct nfp_cpp_area *area);
 
-/*
- * Release the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release(struct nfp_cpp_area *area);
 
-/*
- * Allocate, then acquire the resources needed to access the NFP CPP area handle
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 		uint32_t cpp_id, uint64_t address, size_t size);
 
-/*
- * Release the resources, then free the NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t addr, uint32_t size, struct nfp_cpp_area **area);
 
-/*
- * Read from a NFP CPP area handle into a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer to receive the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes read on success, negative value on failure.
- *
- */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset,
 		void *buffer, size_t length);
 
-/*
- * Write to a NFP CPP area handle from a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer that holds the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes written on success, negative value on failure.
- */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset,
 		const void *buffer, size_t length);
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
- * @area:       CPP area handle
- *
- * Returns an iomem pointer for use with readl()/writel() style operations.
- *
- * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
- */
 void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
 
-/*
- * Get the NFP CPP handle that is the parent of a NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			NFP CPP handle
- */
 struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
 
-/*
- * Get the name passed during allocation of the NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			Pointer to the area's name
- */
 const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
 
-/*
- * Read a block of data from a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy read data to
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes read on success, -1 on failure.
- */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, void *kernel_vaddr, size_t length);
 
-/*
- * Write a block of data to a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy write data from
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes written on success, -1 on failure.
- */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, const void *kernel_vaddr, size_t length);
 
-/*
- * Read a single 32-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t *value);
 
-/*
- * Write a single 32-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t value);
 
-/*
- * Read a single 64-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t *value);
 
-/*
- * Write a single 64-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t value);
 
-/*
- * Write a single 32-bit value on the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t value);
 
-/*
- * Read a single 32-bit value from the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
 
-/*
- * Read a 32-bit word from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t *value);
 
-/*
- * Write a 32-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- *
- */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t value);
 
-/*
- * Read a 64-bit work from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t *value);
 
-/*
- * Write a 64-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t value);
 
-/*
- * Initialize a mutex location
-
- * The CPP target:address must point to a 64-bit aligned location, and will
- * initialize 64 bits of data at the location.
- *
- * This creates the initial mutex state, as locked by this nfp_cpp_interface().
- *
- * This function should only be called when setting up the initial lock state
- * upon boot-up of the system.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	Unique 32-bit value for this mutex
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Create a mutex handle from an address controlled by a MU Atomic engine
- *
- * The CPP target:address must point to a 64-bit aligned location, and reserve
- * 64 bits of data at the location for use by the handle.
- *
- * Only target/address pairs that point to entities that support the MU Atomic
- * Engine's CmpAndSwap32 command are supported.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	32-bit unique key (must match the key at this location)
- *
- * @return		A non-NULL struct nfp_cpp_mutex * on success, NULL on
- *                      failure.
- */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Free a mutex handle - does not alter the lock state
- *
- * @param mutex		NFP CPP Mutex handle
- */
 void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
 
-/*
- * Lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Unlock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- * @return		0 if the lock succeeded, negative value on failure.
- */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
 uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index bdf4a658f5..7e94bfb611 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -58,7 +58,7 @@
  * Minimal size of the PCIe cfg memory we depend on being mapped,
  * queue controller and DMA controller don't have to be covered.
  */
-#define NFP_PCI_MIN_MAP_SIZE				0x080000
+#define NFP_PCI_MIN_MAP_SIZE				0x080000        /* 512K */
 
 #define NFP_PCIE_P2C_FIXED_SIZE(bar)               (1 << (bar)->bitsize)
 #define NFP_PCIE_P2C_BULK_SIZE(bar)                (1 << (bar)->bitsize)
@@ -72,40 +72,25 @@
 #define NFP_PCIE_CPP_BAR_PCIETOCPPEXPBAR(bar, slot) \
 	(((bar) * 8 + (slot)) * 4)
 
-/*
- * Define to enable a bit more verbose debug output.
- * Set to 1 to enable a bit more verbose debug output.
- */
 struct nfp_pcie_user;
 struct nfp6000_area_priv;
 
-/*
- * struct nfp_bar - describes BAR configuration and usage
- * @nfp:	backlink to owner
- * @barcfg:	cached contents of BAR config CSR
- * @base:	the BAR's base CPP offset
- * @mask:       mask for the BAR aperture (read only)
- * @bitsize:	bitsize of BAR aperture (read only)
- * @index:	index of the BAR
- * @lock:	lock to specify if bar is in use
- * @refcnt:	number of current users
- * @iomem:	mapped IO memory
- */
+/* Describes BAR configuration and usage */
 #define NFP_BAR_MIN 1
 #define NFP_BAR_MID 5
 #define NFP_BAR_MAX 7
 
 struct nfp_bar {
-	struct nfp_pcie_user *nfp;
-	uint32_t barcfg;
-	uint64_t base;		/* CPP address base */
-	uint64_t mask;		/* Bit mask of the bar */
-	uint32_t bitsize;	/* Bit size of the bar */
-	uint32_t index;
-	int lock;
+	struct nfp_pcie_user *nfp;    /**< Backlink to owner */
+	uint32_t barcfg;     /**< BAR config CSR */
+	uint64_t base;       /**< Base CPP offset */
+	uint64_t mask;       /**< Mask of the BAR aperture (read only) */
+	uint32_t bitsize;    /**< Bit size of the BAR aperture (read only) */
+	uint32_t index;      /**< Index of the BAR */
+	int lock;            /**< If the BAR has been locked */
 
 	char *csr;
-	char *iomem;
+	char *iomem;         /**< mapped IO memory */
 };
 
 #define BUSDEV_SZ	13
@@ -360,9 +345,7 @@ nfp_disable_bars(struct nfp_pcie_user *nfp)
 	}
 }
 
-/*
- * Generic CPP bus access interface.
- */
+/* Generic CPP bus access interface. */
 
 struct nfp6000_area_priv {
 	struct nfp_bar *bar;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index e2af888a28..0e8372576e 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -26,6 +26,15 @@
 #define NFP_PL_DEVICE_MODEL_MASK               (NFP_PL_DEVICE_PART_MASK | \
 						NFP_PL_DEVICE_ID_MASK)
 
+/**
+ * Set the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void
 nfp_cpp_priv_set(struct nfp_cpp *cpp,
 		void *priv)
@@ -33,12 +42,29 @@ nfp_cpp_priv_set(struct nfp_cpp *cpp,
 	cpp->priv = priv;
 }
 
+/**
+ * Return the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void *
 nfp_cpp_priv(struct nfp_cpp *cpp)
 {
 	return cpp->priv;
 }
 
+/**
+ * Set the model id
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param model
+ *   Model ID
+ */
 void
 nfp_cpp_model_set(struct nfp_cpp *cpp,
 		uint32_t model)
@@ -46,6 +72,15 @@ nfp_cpp_model_set(struct nfp_cpp *cpp,
 	cpp->model = model;
 }
 
+/**
+ * Retrieve the Model ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Model ID
+ */
 uint32_t
 nfp_cpp_model(struct nfp_cpp *cpp)
 {
@@ -63,6 +98,14 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 	return model;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param interface
+ *   Interface ID
+ */
 void
 nfp_cpp_interface_set(struct nfp_cpp *cpp,
 		uint32_t interface)
@@ -70,6 +113,17 @@ nfp_cpp_interface_set(struct nfp_cpp *cpp,
 	cpp->interface = interface;
 }
 
+/**
+ * Retrieve the Serial ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param serial
+ *   Pointer to NFP serial number
+ *
+ * @return
+ *   Length of NFP serial number
+ */
 int
 nfp_cpp_serial(struct nfp_cpp *cpp,
 		const uint8_t **serial)
@@ -78,6 +132,16 @@ nfp_cpp_serial(struct nfp_cpp *cpp,
 	return cpp->serial_len;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param serial
+ *   NFP serial byte array
+ * @param serial_len
+ *   Length of the serial byte array
+ */
 int
 nfp_cpp_serial_set(struct nfp_cpp *cpp,
 		const uint8_t *serial,
@@ -96,6 +160,15 @@ nfp_cpp_serial_set(struct nfp_cpp *cpp,
 	return 0;
 }
 
+/**
+ * Retrieve the Interface ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Interface ID
+ */
 uint16_t
 nfp_cpp_interface(struct nfp_cpp *cpp)
 {
@@ -105,18 +178,45 @@ nfp_cpp_interface(struct nfp_cpp *cpp)
 	return cpp->interface;
 }
 
+/**
+ * Get the privately allocated portion of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the private area, or NULL on failure
+ */
 void *
 nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area)
 {
 	return &cpp_area[1];
 }
 
+/**
+ * Get the NFP CPP handle that is the pci_dev of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   NFP CPP handle
+ */
 struct nfp_cpp *
 nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area)
 {
 	return cpp_area->cpp;
 }
 
+/**
+ * Get the name passed during allocation of the NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the area's name
+ */
 const char *
 nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 {
@@ -153,15 +253,24 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
 	return cpp->mu_locality_lsb;
 }
 
-/*
- * nfp_cpp_area_alloc - allocate a new CPP area
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area in bytes
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
  *
- * Allocate and initialize a CPP area structure.  The area must later
- * be locked down with an 'acquire' before it can be safely accessed.
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param name
+ *   Name of region
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
  *
  * NOTE: @address and @size must be 32-bit aligned values.
  */
@@ -211,6 +320,25 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 	return area;
 }
 
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
+ * NOTE: @address and @size must be 32-bit aligned values.
+ */
 struct nfp_cpp_area *
 nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 		uint32_t dest,
@@ -220,17 +348,22 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
 
-/*
- * nfp_cpp_area_alloc_acquire - allocate a new CPP area and lock it down
- *
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area
- *
+/**
  * Allocate and initialize a CPP area structure, and lock it down so
  * that it can be accessed directly.
  *
+ * @param cpp
+ *   CPP device handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
  * NOTE: @address and @size must be 32-bit aligned values.
  *
  * NOTE: The area must also be 'released' when the structure is freed.
@@ -258,11 +391,11 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	return area;
 }
 
-/*
- * nfp_cpp_area_free - free up the CPP area
- * area:    CPP area handle
- *
+/**
  * Frees up memory resources held by the CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_free(struct nfp_cpp_area *area)
@@ -272,11 +405,11 @@ nfp_cpp_area_free(struct nfp_cpp_area *area)
 	free(area);
 }
 
-/*
- * nfp_cpp_area_release_free - release CPP area and free it
- * area:    CPP area handle
+/**
+ * Releases CPP area and frees up memory resources held by it.
  *
- * Releases CPP area and frees up memory resources held by the it.
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release_free(struct nfp_cpp_area *area)
@@ -285,12 +418,15 @@ nfp_cpp_area_release_free(struct nfp_cpp_area *area)
 	nfp_cpp_area_free(area);
 }
 
-/*
- * nfp_cpp_area_acquire - lock down a CPP area for access
- * @area:   CPP area handle
+/**
+ * Locks down the CPP area for a potential long term activity.
+ * Area must always be locked down before being accessed.
  *
- * Locks down the CPP area for a potential long term activity.  Area
- * must always be locked down before being accessed.
+ * @param area
+ *   CPP area handle
+ *
+ * @return
+ *   0 on success, -1 on failure.
  */
 int
 nfp_cpp_area_acquire(struct nfp_cpp_area *area)
@@ -307,11 +443,11 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	return 0;
 }
 
-/*
- * nfp_cpp_area_release - release a locked down CPP area
- * @area:   CPP area handle
- *
+/**
  * Releases a previously locked down CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release(struct nfp_cpp_area *area)
@@ -320,16 +456,16 @@ nfp_cpp_area_release(struct nfp_cpp_area *area)
 		area->cpp->op->area_release(area);
 }
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
+/**
+ * Returns an iomem pointer for use with readl()/writel() style operations.
  *
- * @area:       CPP area handle
+ * @param area
+ *   CPP area handle
  *
- * Returns an iomem pointer for use with readl()/writel() style operations.
+ * @return
+ *   Pointer to the area, or NULL
  *
  * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
  */
 void *
 nfp_cpp_area_iomem(struct nfp_cpp_area *area)
@@ -342,18 +478,22 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
 	return iomem;
 }
 
-/*
- * nfp_cpp_area_read - read data from CPP area
+/**
+ * Read data from indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to put data into
- * @length:     number of bytes to read
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Read data from indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -368,18 +508,22 @@ nfp_cpp_area_read(struct nfp_cpp_area *area,
 	return area->cpp->op->area_read(area, kernel_vaddr, offset, length);
 }
 
-/*
- * nfp_cpp_area_write - write data to CPP area
+/**
+ * Write data to indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to read data from
- * @length:     number of bytes to write
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Write data to indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -436,6 +580,19 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 	return xpb;
 }
 
+/**
+ * Read a uint32_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readl(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -450,6 +607,19 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writel(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -462,6 +632,19 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -476,6 +659,19 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -489,6 +685,21 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint32_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readl(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -504,6 +715,21 @@ nfp_cpp_readl(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writel(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -518,6 +744,21 @@ nfp_cpp_writel(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -533,6 +774,21 @@ nfp_cpp_readq(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writeq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -547,6 +803,19 @@ nfp_cpp_writeq(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t word to a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_writel(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -559,6 +828,19 @@ nfp_xpb_writel(struct nfp_cpp *cpp,
 	return nfp_cpp_writel(cpp, cpp_dest, xpb_addr, value);
 }
 
+/**
+ * Read a uint32_t value from a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_readl(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -625,9 +907,11 @@ nfp_cpp_alloc(struct rte_pci_device *dev,
 	return cpp;
 }
 
-/*
- * nfp_cpp_free - free the CPP handle
- * @cpp:    CPP handle
+/**
+ * Free the CPP handle
+ *
+ * @param cpp
+ *   CPP handle
  */
 void
 nfp_cpp_free(struct nfp_cpp *cpp)
@@ -641,6 +925,19 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 	free(cpp);
 }
 
+/**
+ * Create a NFP CPP handle from device
+ *
+ * @param dev
+ *   PCI device
+ * @param driver_lock_needed
+ *   Driver lock flag
+ *
+ * @return
+ *   NFP CPP handle on success, NULL on failure
+ *
+ * NOTE: On failure, cpp_ops->free will be called!
+ */
 struct nfp_cpp *
 nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed)
@@ -648,13 +945,22 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev,
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
 
-/*
- * nfp_cpp_read - read from CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer for result
- * @length:     number of bytes to read
+/**
+ * Read from CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer for result
+ * @param length
+ *   Number of bytes to read
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_read(struct nfp_cpp *cpp,
@@ -678,13 +984,22 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_cpp_write - write to CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer to read from
- * @length:     number of bytes to write
+/**
+ * Write to CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer to read from
+ * @param length
+ *   Number of bytes to write
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_write(struct nfp_cpp *cpp,
@@ -731,18 +1046,23 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
- * nfp_cpp_map_area() - Helper function to map an area
- * @cpp:    NFP CPP handler
- * @cpp_id: CPP ID
- * @addr:   CPP address
- * @size:   Size of the area
- * @area:   Area handle (output)
+/**
+ * Map an area of IOMEM access.
+ * To undo the effect of this function call @nfp_cpp_area_release_free(*area).
  *
- * Map an area of IOMEM access.  To undo the effect of this function call
- * @nfp_cpp_area_release_free(*area).
+ * @param cpp
+ *   NFP CPP handler
+ * @param cpp_id
+ *   CPP id
+ * @param addr
+ *   CPP address
+ * @param size
+ *   Size of the area
+ * @param area
+ *   Area handle (output)
  *
- * Return: Pointer to memory mapped area or NULL
+ * @return
+ *   Pointer to memory mapped area or NULL
  */
 uint8_t *
 nfp_cpp_map_area(struct nfp_cpp *cpp,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index b658b5e900..f5579ab60f 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -3,7 +3,8 @@
  * All rights reserved.
  */
 
-/* Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
+/*
+ * Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
  * after chip reset.
  *
  * Examples of the fields:
@@ -146,7 +147,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *db;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 10000000;
+	wait.tv_nsec = 10000000;    /* 10ms */
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -154,7 +155,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 			return db;
 
 		nanosleep(&wait, NULL);
-		if (count++ > 200) {
+		if (count++ > 200) {    /* 10ms * 200 = 2s */
 			PMD_DRV_LOG(ERR, "NFP access error");
 			return NULL;
 		}
@@ -180,12 +181,16 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
 	return db;
 }
 
-/*
- * nfp_hwinfo_lookup() - Find a value in the HWInfo table by name
- * @hwinfo:	NFP HWinfo table
- * @lookup:	HWInfo name to search for
+/**
+ * Find a value in the HWInfo table by name
+ *
+ * @param hwinfo
+ *   NFP HWInfo table
+ * @param lookup
+ *   HWInfo name to search for
  *
- * Return: Value of the HWInfo name, or NULL
+ * @return
+ *   Value of the HWInfo name, or NULL
  */
 const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
index a3da7512db..424db8035d 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
@@ -59,6 +59,8 @@
  * Packed UTF8Z strings, ie 'key1\000value1\000key2\000value2\000'
  *
  * Unsorted.
+ *
+ * Note: Only the HwInfo v2 Table be supported now.
  */
 
 #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 086e82db70..0892c99e96 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -87,15 +87,16 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_mip_open() - Get device MIP structure
- * @cpp:	NFP CPP Handle
- *
- * Copy MIP structure from NFP device and return it.  The returned
+/**
+ * Copy MIP structure from NFP device and return it. The returned
  * structure is handled internally by the library and should be
- * freed by calling nfp_mip_close().
+ * freed by calling @nfp_mip_close().
+ *
+ * @param cpp
+ *   NFP CPP Handle
  *
- * Return: pointer to mip, NULL on failure.
+ * @return
+ *   Pointer to MIP, NULL on failure.
  */
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
@@ -131,11 +132,15 @@ nfp_mip_name(const struct nfp_mip *mip)
 	return mip->name;
 }
 
-/*
- * nfp_mip_symtab() - Get the address and size of the MIP symbol table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol table
- * @size:	Location for size of MIP symbol table
+/**
+ * Get the address and size of the MIP symbol table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol table
+ * @param size
+ *   Location for size of MIP symbol table
  */
 void
 nfp_mip_symtab(const struct nfp_mip *mip,
@@ -146,11 +151,15 @@ nfp_mip_symtab(const struct nfp_mip *mip,
 	*size = rte_le_to_cpu_32(mip->symtab_size);
 }
 
-/*
- * nfp_mip_strtab() - Get the address and size of the MIP symbol name table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol name table
- * @size:	Location for size of MIP symbol name table
+/**
+ * Get the address and size of the MIP symbol name table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol name table
+ * @param size
+ *   Location for size of MIP symbol name table
  */
 void
 nfp_mip_strtab(const struct nfp_mip *mip,
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 82919d8270..404d4fa938 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -53,7 +53,7 @@ _nfp_cpp_mutex_validate(uint32_t model,
 	return 0;
 }
 
-/*
+/**
  * Initialize a mutex location
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -65,13 +65,17 @@ _nfp_cpp_mutex_validate(uint32_t model,
  * This function should only be called when setting up
  * the initial lock state upon boot-up of the system.
  *
- * @param mutex     NFP CPP Mutex handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       Unique 32-bit value for this mutex
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   Unique 32-bit value for this mutex
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_init(struct nfp_cpp *cpp,
@@ -99,7 +103,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
+/**
  * Create a mutex handle from an address controlled by a MU Atomic engine
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -108,13 +112,17 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
  * Only target/address pairs that point to entities that support the
  * MU Atomic Engine are supported.
  *
- * @param cpp       NFP CPP handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       32-bit unique key (must match the key at this location)
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   32-bit unique key (must match the key at this location)
  *
- * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
+ * @return
+ *   A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
 nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
@@ -178,10 +186,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	return mutex;
 }
 
-/*
+/**
  * Free a mutex handle - does not alter the lock state
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  */
 void
 nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
@@ -203,12 +212,14 @@ nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
 	free(mutex);
 }
 
-/*
+/**
  * Lock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure.
  */
 int
 nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
@@ -229,12 +240,14 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 	return 0;
 }
 
-/*
+/**
  * Unlock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
@@ -280,16 +293,18 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 	return err;
 }
 
-/*
+/**
  * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
  *
  * Valid lock states:
- *
  *      0x....0000      - Unlocked
  *      0x....000f      - Locked
  *
- * @param mutex     NFP CPP Mutex handle
- * @return      0 if the lock succeeded, negative value on failure.
+ * @param mutex
+ *   NFP CPP Mutex handle
+ *
+ * @return
+ *   0 if the lock succeeded, negative value on failure.
  */
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
@@ -352,7 +367,7 @@ nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 		 * If there was another contending for this lock, then
 		 * the lock state would be 0x....000f
 		 *
-		 * Write our owner ID into the lock
+		 * Write our owner ID into the lock.
 		 * While not strictly necessary, this helps with
 		 * debug and bookkeeping.
 		 */
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index b5a354137d..5f004e3b21 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -52,7 +52,7 @@ nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi)
 	return (fi->loaded__mu_da__mip_off_hi >> 8) & 1;
 }
 
-/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 8) | mip_offset_lo */
+/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */
 static uint64_t
 nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 {
@@ -112,11 +112,14 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 	}
 }
 
-/*
- * nfp_nffw_info_open() - Acquire the lock on the NFFW table
- * @cpp:	NFP CPP handle
+/**
+ * Acquire the lock on the NFFW table
+ *
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: nffw info pointer, or NULL on failure
+ * @return
+ *   NFFW info pointer, or NULL on failure
  */
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
@@ -168,11 +171,11 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_close() - Release the lock on the NFFW table
- * @state:	NFP FW info state
+/**
+ * Release the lock on the NFFW table
  *
- * Return: void
+ * @param state
+ *   NFFW info pointer
  */
 void
 nfp_nffw_info_close(struct nfp_nffw_info *state)
@@ -181,11 +184,14 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 	free(state);
 }
 
-/*
- * nfp_nffw_info_fwid_first() - Return the first firmware ID in the NFFW
- * @state:	NFP FW info state
+/**
+ * Return the first firmware ID in the NFFW
  *
- * Return: First NFFW firmware info, NULL on failure
+ * @param state
+ *   NFFW info pointer
+ *
+ * @return:
+ *   First NFFW firmware info, NULL on failure
  */
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
@@ -205,13 +211,18 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_mip_first() - Retrieve the location of the first FW's MIP
- * @state:	NFP FW info state
- * @cpp_id:	Pointer to the CPP ID of the MIP
- * @off:	Pointer to the CPP Address of the MIP
+/**
+ * Retrieve the location of the first FW's MIP
+ *
+ * @param state
+ *   NFFW info pointer
+ * @param cpp_id
+ *   Pointer to the CPP ID of the MIP
+ * @param off
+ *   Pointer to the CPP Address of the MIP
  *
- * Return: 0, or -ERRNO
+ * @return
+ *   0, or -ERRNO
  */
 int
 nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h
index 46ac8a8d07..e032b6cce7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.h
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.h
@@ -8,7 +8,8 @@
 
 #include "nfp_cpp.h"
 
-/* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
+/*
+ * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
  * Lower IDs are reserved for target and loader IDs.
  */
 #define NFFW_FWID_EXT   3 /* For active MEs that we didn't load. */
@@ -16,7 +17,7 @@
 
 #define NFFW_FWID_ALL   255
 
-/**
+/*
  * NFFW_INFO_VERSION history:
  * 0: This was never actually used (before versioning), but it refers to
  *    the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
@@ -35,6 +36,7 @@
 #define NFFW_MEINFO_CNT_V2 200
 #define NFFW_FWINFO_CNT_V2 200
 
+/* nfp.nffw meinfo */
 struct nffw_meinfo {
 	uint32_t ctxmask__fwid__meid;
 };
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index ff19446173..a96ccea38b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -109,9 +109,11 @@ nfp_nsp_check(struct nfp_nsp *state)
 	return 0;
 }
 
-/*
- * nfp_nsp_open() - Prepare for communication and lock the NSP resource.
- * @cpp:	NFP CPP Handle
+/**
+ * Prepare for communication and lock the NSP resource.
+ *
+ * @param cpp
+ *   NFP CPP Handle
  */
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
@@ -145,9 +147,11 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	return state;
 }
 
-/*
- * nfp_nsp_close() - Clean up and unlock the NSP resource.
- * @state:	NFP SP state
+/**
+ * Clean up and unlock the NSP resource.
+ *
+ * @param state
+ *   NFP SP state
  */
 void
 nfp_nsp_close(struct nfp_nsp *state)
@@ -181,7 +185,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;     /* 25ms */
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -194,28 +198,27 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 			return 0;
 
 		nanosleep(&wait, 0);
-		if (count++ > 1000)
+		if (count++ > 1000)     /* 25ms * 1000 = 25s */
 			return -ETIMEDOUT;
 	}
 }
 
-/*
- * nfp_nsp_command() - Execute a command on the NFP Service Processor
- * @state:	NFP SP state
- * @code:	NFP SP Command Code
- * @option:	NFP SP Command Argument
- * @buff_cpp:	NFP SP Buffer CPP Address info
- * @buff_addr:	NFP SP Buffer Host address
- *
- * Return: 0 for success with no result
+/**
+ * Execute a command on the NFP Service Processor
  *
- *	 positive value for NSP completion with a result code
+ * @param state
+ *   NFP SP state
+ * @param arg
+ *   NFP command argument structure
  *
- *	-EAGAIN if the NSP is not yet present
- *	-ENODEV if the NSP is not a supported model
- *	-EBUSY if the NSP is stuck
- *	-EINTR if interrupted while waiting for completion
- *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
+ * @return
+ *   - 0 for success with no result
+ *   - Positive value for NSP completion with a result code
+ *   - -EAGAIN if the NSP is not yet present
+ *   - -ENODEV if the NSP is not a supported model
+ *   - -EBUSY if the NSP is stuck
+ *   - -EINTR if interrupted while waiting for completion
+ *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
 nfp_nsp_command(struct nfp_nsp *state,
@@ -383,7 +386,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
@@ -392,7 +395,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 
 		nanosleep(&wait, 0);
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 25ms * 1000 = 25s */
 			err = -ETIMEDOUT;
 			break;
 		}
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index edb56e26ca..0fcb21e99c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -158,72 +158,45 @@ enum nfp_eth_fec {
 #define NFP_FEC_REED_SOLOMON	RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT)
 #define NFP_FEC_DISABLED	RTE_BIT32(NFP_FEC_DISABLED_BIT)
 
-/**
- * struct nfp_eth_table - ETH table information
- * @count:	number of table entries
- * @max_index:	max of @index fields of all @ports
- * @ports:	table of ports
- *
- * @eth_index:	port index according to legacy ethX numbering
- * @index:	chip-wide first channel index
- * @nbi:	NBI index
- * @base:	first channel index (within NBI)
- * @lanes:	number of channels
- * @speed:	interface speed (in Mbps)
- * @interface:	interface (module) plugged in
- * @media:	media type of the @interface
- * @fec:	forward error correction mode
- * @aneg:	auto negotiation mode
- * @mac_addr:	interface MAC address
- * @label_port:	port id
- * @label_subport:  id of interface within port (for split ports)
- * @enabled:	is enabled?
- * @tx_enabled:	is TX enabled?
- * @rx_enabled:	is RX enabled?
- * @override_changed: is media reconfig pending?
- *
- * @port_type:	one of %PORT_* defines for ethtool
- * @port_lanes:	total number of lanes on the port (sum of lanes of all subports)
- * @is_split:	is interface part of a split port
- * @fec_modes_supported:	bitmap of FEC modes supported
- */
+/* ETH table information */
 struct nfp_eth_table {
-	uint32_t count;
-	uint32_t max_index;
+	uint32_t count;     /**< Number of table entries */
+	uint32_t max_index; /**< Max of @index fields of all @ports */
 	struct nfp_eth_table_port {
+		/** Port index according to legacy ethX numbering */
 		uint32_t eth_index;
-		uint32_t index;
-		uint32_t nbi;
-		uint32_t base;
-		uint32_t lanes;
-		uint32_t speed;
+		uint32_t index;  /**< Chip-wide first channel index */
+		uint32_t nbi;    /**< NBI index */
+		uint32_t base;   /**< First channel index (within NBI) */
+		uint32_t lanes;  /**< Number of channels */
+		uint32_t speed;  /**< Interface speed (in Mbps) */
 
-		uint32_t interface;
-		enum nfp_eth_media media;
+		uint32_t interface;  /**< Interface (module) plugged in */
+		enum nfp_eth_media media; /**< Media type of the @interface */
 
-		enum nfp_eth_fec fec;
-		enum nfp_eth_aneg aneg;
+		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
-		struct rte_ether_addr mac_addr;
+		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
 
-		uint8_t label_port;
+		uint8_t label_port;    /**< Port id */
+		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;
-		int tx_enabled;
-		int rx_enabled;
-
-		int override_changed;
+		int enabled;     /**< Enable port */
+		int tx_enabled;  /**< Enable TX */
+		int rx_enabled;  /**< Enable RX */
 
-		/* Computed fields */
-		uint8_t port_type;
+		int override_changed;  /**< Media reconfig pending */
 
+		uint8_t port_type;    /**< One of %PORT_* */
+		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;
+		int is_split;   /**< Split port */
 
-		uint32_t fec_modes_supported;
-	} ports[];
+		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
+	} ports[]; /**< Table of ports */
 };
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
@@ -263,28 +236,17 @@ int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode);
 int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed);
 int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes);
 
-/**
- * struct nfp_nsp_identify - NSP static information
- * @version:      opaque version string
- * @flags:        version flags
- * @br_primary:   branch id of primary bootloader
- * @br_secondary: branch id of secondary bootloader
- * @br_nsp:       branch id of NSP
- * @primary:      version of primary bootloader
- * @secondary:    version id of secondary bootloader
- * @nsp:          version id of NSP
- * @sensor_mask:  mask of present sensors available on NIC
- */
+/* NSP static information */
 struct nfp_nsp_identify {
-	char version[40];
-	uint8_t flags;
-	uint8_t br_primary;
-	uint8_t br_secondary;
-	uint8_t br_nsp;
-	uint16_t primary;
-	uint16_t secondary;
-	uint16_t nsp;
-	uint64_t sensor_mask;
+	char version[40];      /**< Opaque version string */
+	uint8_t flags;         /**< Version flags */
+	uint8_t br_primary;    /**< Branch id of primary bootloader */
+	uint8_t br_secondary;  /**< Branch id of secondary bootloader */
+	uint8_t br_nsp;        /**< Branch id of NSP */
+	uint16_t primary;      /**< Version of primary bootloader */
+	uint16_t secondary;    /**< Version id of secondary bootloader */
+	uint16_t nsp;          /**< Version id of NSP */
+	uint64_t sensor_mask;  /**< Mask of present sensors available on NIC */
 };
 
 struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 74daa92aed..cb090d2a47 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -264,7 +264,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/* The NFP3800 NIC support 8 ports, but only 2 ports are valid,
+	/*
+	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
 	 * the rest 6 ports mac are all 0, ensure we don't use these port
 	 */
 	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
@@ -274,7 +275,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 			cnt++;
 	}
 
-	/* Some versions of flash will give us 0 instead of port count. For
+	/*
+	 * Some versions of flash will give us 0 instead of port count. For
 	 * those that give a port count, verify it against the value calculated
 	 * above.
 	 */
@@ -312,14 +314,16 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	return NULL;
 }
 
-/*
- * nfp_eth_read_ports() - retrieve port information
- * @cpp:	NFP CPP handle
+/**
+ * Read the port information from the device.
+ *
+ * Returned structure should be freed once no longer needed.
  *
- * Read the port information from the device.  Returned structure should
- * be freed with kfree() once no longer needed.
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: populated ETH table or NULL on error.
+ * @return
+ *   Populated ETH table or NULL on error.
  */
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
@@ -387,19 +391,19 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 	free(entries);
 }
 
-/*
- * nfp_eth_config_commit_end() - perform recorded configuration changes
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- *
+/**
  * Perform the configuration which was requested with __nfp_eth_set_*()
- * helpers and recorded in @nsp state.  If device was already configured
- * as requested or no __nfp_eth_set_*() operations were made no NSP command
+ * helpers and recorded in @nsp state. If device was already configured
+ * as requested or no __nfp_eth_set_*() operations were made, no NSP command
  * will be performed.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
@@ -417,19 +421,21 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 	return ret;
 }
 
-/*
- * nfp_eth_set_mod_enable() - set PHY module enable control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @enable:	Desired state
- *
+/**
  * Enable or disable PHY module (this usually means setting the TX lanes
  * disable bits).
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param enable
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
@@ -460,18 +466,20 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * nfp_eth_set_configured() - set PHY module configured control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @configed:	Desired state
- *
+/**
  * Set the ifup/ifdown state on the PHY.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param configured
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
@@ -525,7 +533,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
-	 *	 codes were initially not populated correctly.
+	 * codes were initially not populated correctly.
 	 */
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 17) {
 		PMD_DRV_LOG(ERR, "set operations not supported, please update flash");
@@ -555,15 +563,17 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 				val, ctrl_bit);			\
 	}))
 
-/*
- * __nfp_eth_set_aneg() - set PHY autonegotiation control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired autonegotiation mode
- *
+/**
  * Allow/disallow PHY module to advertise/perform autonegotiation.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired autonegotiation mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_aneg(struct nfp_nsp *nsp,
@@ -573,15 +583,17 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
-/*
- * __nfp_eth_set_fec() - set PHY forward error correction control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired fec mode
- *
+/**
  * Set the PHY module forward error correction mode.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired fec mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 static int
 __nfp_eth_set_fec(struct nfp_nsp *nsp,
@@ -591,16 +603,20 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
-/*
- * nfp_eth_set_fec() - set PHY forward error correction control mode
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @mode:	Desired fec mode
+/**
+ * Set PHY forward error correction control mode
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param mode
+ *   Desired fec mode
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_fec(struct nfp_cpp *cpp,
@@ -623,17 +639,19 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * __nfp_eth_set_speed() - set interface speed/rate
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @speed:	Desired speed (per lane)
- *
- * Set lane speed.  Provided @speed value should be subport speed divided
- * by number of lanes this subport is spanning (i.e. 10000 for 40G, 25000 for
- * 50G, etc.)
+/**
+ * Set lane speed.
+ * Provided @speed value should be subport speed divided by number of
+ * lanes this subport is spanning (i.e. 10000 for 40G, 25000 for 50G, etc.)
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param speed
+ *   Desired speed (per lane)
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_speed(struct nfp_nsp *nsp,
@@ -651,15 +669,17 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
-/*
- * __nfp_eth_set_split() - set interface lane split
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @lanes:	Desired lanes per port
- *
+/**
  * Set number of lanes in the port.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param lanes
+ *   Desired lanes per port
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_split(struct nfp_nsp *nsp,
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 363f7d6198..bdebf5c3aa 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -22,32 +22,23 @@
 
 #define NFP_RESOURCE_ENTRY_NAME_SZ	8
 
-/*
- * struct nfp_resource_entry - Resource table entry
- * @owner:		NFP CPP Lock, interface owner
- * @key:		NFP CPP Lock, posix_crc32(name, 8)
- * @region:		Memory region descriptor
- * @name:		ASCII, zero padded name
- * @reserved
- * @cpp_action:		CPP Action
- * @cpp_token:		CPP Token
- * @cpp_target:		CPP Target ID
- * @page_offset:	256-byte page offset into target's CPP address
- * @page_size:		size, in 256-byte pages
- */
+/* Resource table entry */
 struct nfp_resource_entry {
 	struct nfp_resource_entry_mutex {
-		uint32_t owner;
-		uint32_t key;
+		uint32_t owner;  /**< NFP CPP Lock, interface owner */
+		uint32_t key;    /**< NFP CPP Lock, posix_crc32(name, 8) */
 	} mutex;
+	/* Memory region descriptor */
 	struct nfp_resource_entry_region {
+		/** ASCII, zero padded name */
 		uint8_t  name[NFP_RESOURCE_ENTRY_NAME_SZ];
 		uint8_t  reserved[5];
-		uint8_t  cpp_action;
-		uint8_t  cpp_token;
-		uint8_t  cpp_target;
+		uint8_t  cpp_action;  /**< CPP Action */
+		uint8_t  cpp_token;   /**< CPP Token */
+		uint8_t  cpp_target;  /**< CPP Target ID */
+		/** 256-byte page offset into target's CPP address */
 		uint32_t page_offset;
-		uint32_t page_size;
+		uint32_t page_size;   /**< Size, in 256-byte pages */
 	} region;
 };
 
@@ -147,14 +138,18 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_resource_acquire() - Acquire a resource handle
- * @cpp:	NFP CPP handle
- * @name:	Name of the resource
+/**
+ * Acquire a resource handle
+ *
+ * Note: This function locks the acquired resource.
  *
- * NOTE: This function locks the acquired resource
+ * @param cpp
+ *   NFP CPP handle
+ * @param name
+ *   Name of the resource
  *
- * Return: NFP Resource handle, or NULL
+ * @return
+ *   NFP Resource handle, or NULL
  */
 struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
@@ -183,7 +178,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	}
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 1000000;
+	wait.tv_nsec = 1000000;    /* 1ms */
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
@@ -194,7 +189,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 			goto err_free;
 		}
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 1ms * 1000 = 1s */
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
 			err = -EBUSY;
 			goto err_free;
@@ -213,11 +208,13 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_resource_release() - Release a NFP Resource handle
- * @res:	NFP Resource handle
+/**
+ * Release a NFP Resource handle
  *
- * NOTE: This function implicitly unlocks the resource handle
+ * NOTE: This function implicitly unlocks the resource handle.
+ *
+ * @param res
+ *   NFP Resource handle
  */
 void
 nfp_resource_release(struct nfp_resource *res)
@@ -227,11 +224,14 @@ nfp_resource_release(struct nfp_resource *res)
 	free(res);
 }
 
-/*
- * nfp_resource_cpp_id() - Return the cpp_id of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the cpp_id of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 uint32_t
 nfp_resource_cpp_id(const struct nfp_resource *res)
@@ -239,11 +239,14 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
 	return res->cpp_id;
 }
 
-/*
- * nfp_resource_name() - Return the name of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the name of a resource handle
  *
- * Return: const char pointer to the name of the resource
+ * @param res
+ *   NFP Resource handle
+ *
+ * @return
+ *   Const char pointer to the name of the resource
  */
 const char *
 nfp_resource_name(const struct nfp_resource *res)
@@ -251,11 +254,14 @@ nfp_resource_name(const struct nfp_resource *res)
 	return res->name;
 }
 
-/*
- * nfp_resource_address() - Return the address of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the address of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Address of the resource
+ * @return
+ *   Address of the resource
  */
 uint64_t
 nfp_resource_address(const struct nfp_resource *res)
@@ -263,11 +269,14 @@ nfp_resource_address(const struct nfp_resource *res)
 	return res->addr;
 }
 
-/*
- * nfp_resource_size() - Return the size in bytes of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the size in bytes of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Size of the resource in bytes
+ * @return
+ *   Size of the resource in bytes
  */
 uint64_t
 nfp_resource_size(const struct nfp_resource *res)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 009b7359a4..4236950caf 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -8,43 +8,27 @@
 
 #include "nfp_cpp.h"
 
+/* Netronone Flow Firmware Table */
 #define NFP_RESOURCE_NFP_NFFW           "nfp.nffw"
+
+/* NFP Hardware Info Database */
 #define NFP_RESOURCE_NFP_HWINFO         "nfp.info"
+
+/* Service Processor */
 #define NFP_RESOURCE_NSP		"nfp.sp"
 
-/**
- * Opaque handle to a NFP Resource
- */
+/* Opaque handle to a NFP Resource */
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name);
 
-/**
- * Release a NFP Resource, and free the handle
- * @param[in]   res     NFP Resource handle
- */
 void nfp_resource_release(struct nfp_resource *res);
 
-/**
- * Return the CPP ID of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      CPP ID of the NFP Resource
- */
 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
 
-/**
- * Return the name of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Name of the NFP Resource
- */
 const char *nfp_resource_name(const struct nfp_resource *res);
 
-/**
- * Return the target address of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Address of the NFP Resource
- */
 uint64_t nfp_resource_address(const struct nfp_resource *res);
 
 uint64_t nfp_resource_size(const struct nfp_resource *res);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index d15a920752..0e6c0f9fe1 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -162,11 +162,14 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_rtsym_count() - Get the number of RTSYM descriptors
- * @rtbl:	NFP RTsym table
+/**
+ * Get the number of RTSYM descriptors
+ *
+ * @param rtbl
+ *   NFP RTSYM table
  *
- * Return: Number of RTSYM descriptors
+ * @return
+ *   Number of RTSYM descriptors
  */
 int
 nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
@@ -177,12 +180,16 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
 	return rtbl->num;
 }
 
-/*
- * nfp_rtsym_get() - Get the Nth RTSYM descriptor
- * @rtbl:	NFP RTsym table
- * @idx:	Index (0-based) of the RTSYM descriptor
+/**
+ * Get the Nth RTSYM descriptor
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param idx
+ *   Index (0-based) of the RTSYM descriptor
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
@@ -197,12 +204,16 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
 	return &rtbl->symtab[idx];
 }
 
-/*
- * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
+/**
+ * Return the RTSYM descriptor for a symbol name
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
@@ -227,7 +238,8 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_NONE:
 		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
-	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_OBJECT:
+		/* FALLTHROUGH */
 	case NFP_RTSYM_TYPE_FUNCTION:
 		return sym->size;
 	case NFP_RTSYM_TYPE_ABS:
@@ -327,17 +339,22 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
 	return nfp_cpp_readq(cpp, cpp_id, addr, value);
 }
 
-/*
- * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
- * @error:	Pointer to error code (optional)
+/**
+ * Read a simple unsigned scalar value from symbol
  *
  * Lookup a symbol, map, read it and return it's value. Value of the symbol
  * will be interpreted as a simple little-endian unsigned value. Symbol can
  * be 4 or 8 bytes in size.
  *
- * Return: value read, on error sets the error and returns ~0ULL.
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
+ * @param error
+ *   Pointer to error code (optional)
+ *
+ * @return
+ *   Value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index e7295258b3..ff1facbd17 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -31,12 +31,12 @@
  * of "sram" symbols for backward compatibility, which are viewed as global.
  */
 struct nfp_rtsym {
-	const char *name;
-	uint64_t addr;
-	uint64_t size;
-	int type;
-	int target;
-	int domain;
+	const char *name;  /**< Symbol name */
+	uint64_t addr;     /**< Address in the domain/target's address space */
+	uint64_t size;     /**< Size (in bytes) of the symbol */
+	int type;          /**< NFP_RTSYM_TYPE_* of the symbol */
+	int target;        /**< CPP target identifier, or NFP_RTSYM_TARGET_* */
+	int domain;        /**< CPP target domain */
 };
 
 struct nfp_rtsym_table;
diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c
index 611848e233..540b242a43 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/nfp/nfpcore/nfp_target.c
@@ -767,7 +767,7 @@ nfp_encode_basic(uint64_t *addr,
 		/*
 		 * Make sure we compare against isldN values by clearing the
 		 * LSB. This is what the silicon does.
-		 **/
+		 */
 		isld[0] &= ~1;
 		isld[1] &= ~1;
 
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v4 05/26] net/nfp: standard the local variable coding style
    2023-09-18  2:45  1%       ` [PATCH v4 02/26] net/nfp: unify the indent coding style Chaoyong He
@ 2023-09-18  2:45  3%       ` Chaoyong He
  2023-09-18  2:45  1%       ` [PATCH v4 07/26] net/nfp: standard the comment style Chaoyong He
                         ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-18  2:45 UTC (permalink / raw)
  To: dev; +Cc: Chaoyong He, Niklas Söderlund

There should only declare one local variable in each line, and the local
variable should be arranged from short to long in the function.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 58 ++++++++++++----------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 14 +++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 27 ++++++----
 drivers/net/nfp/nfpcore/nfp_mip.c          |  8 +--
 drivers/net/nfp/nfpcore/nfp_mutex.c        | 25 ++++++----
 drivers/net/nfp/nfpcore/nfp_nffw.c         | 15 +++---
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 40 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |  8 +--
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 39 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_resource.c     | 15 +++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 19 ++++---
 11 files changed, 151 insertions(+), 117 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index ec14ec45dc..78beee07ef 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -140,9 +140,9 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		size_t size,
 		int width)
 {
-	uint32_t bitsize;
-	uint32_t newcfg;
 	uint64_t mask;
+	uint32_t newcfg;
+	uint32_t bitsize;
 
 	if (tgt >= 16)
 		return -EINVAL;
@@ -239,7 +239,8 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 		struct nfp_bar *bar,
 		uint32_t newcfg)
 {
-	int base, slot;
+	int base;
+	int slot;
 
 	base = bar->index >> 3;
 	slot = bar->index & 7;
@@ -268,9 +269,9 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 		size_t size,
 		int width)
 {
-	uint64_t newbase;
-	uint32_t newcfg;
 	int err;
+	uint32_t newcfg;
+	uint64_t newbase;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
 			size, width);
@@ -303,8 +304,10 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 static int
 nfp_enable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -333,8 +336,10 @@ nfp_enable_bars(struct nfp_pcie_user *nfp)
 static struct nfp_bar *
 nfp_alloc_bar(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -356,8 +361,10 @@ nfp_alloc_bar(struct nfp_pcie_user *nfp)
 static void
 nfp_disable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -403,12 +410,13 @@ nfp6000_area_init(struct nfp_cpp_area *area,
 		uint64_t address,
 		size_t size)
 {
-	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
-	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	int pp;
+	int ret = 0;
+	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	uint32_t target = NFP_CPP_ID_TARGET_of(dest);
 	uint32_t action = NFP_CPP_ID_ACTION_of(dest);
-	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
-	int pp, ret = 0;
+	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 
 	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
@@ -493,14 +501,14 @@ nfp6000_area_read(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
+	size_t n;
+	int width;
+	bool is_64;
+	uint32_t *wrptr32 = kernel_vaddr;
 	uint64_t *wrptr64 = kernel_vaddr;
-	const volatile uint64_t *rdptr64;
 	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32 = kernel_vaddr;
 	const volatile uint32_t *rdptr32;
-	int width;
-	size_t n;
-	bool is_64;
+	const volatile uint64_t *rdptr64;
 
 	priv = nfp_cpp_area_priv(area);
 	rdptr64 = (uint64_t *)(priv->iomem + offset);
@@ -563,14 +571,14 @@ nfp6000_area_write(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
-	const uint64_t *rdptr64 = kernel_vaddr;
-	uint64_t *wrptr64;
-	const uint32_t *rdptr32 = kernel_vaddr;
-	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32;
-	int width;
 	size_t n;
+	int width;
 	bool is_64;
+	uint32_t *wrptr32;
+	uint64_t *wrptr64;
+	struct nfp6000_area_priv *priv;
+	const uint32_t *rdptr32 = kernel_vaddr;
+	const uint64_t *rdptr64 = kernel_vaddr;
 
 	priv = nfp_cpp_area_priv(area);
 	wrptr64 = (uint64_t *)(priv->iomem + offset);
@@ -693,10 +701,10 @@ static int
 nfp6000_set_serial(struct rte_pci_device *dev,
 		struct nfp_cpp *cpp)
 {
+	off_t pos;
 	uint16_t tmp;
 	uint8_t serial[6];
 	int serial_len = 6;
-	off_t pos;
 
 	pos = rte_pci_find_ext_capability(dev, RTE_PCI_EXT_CAP_ID_DSN);
 	if (pos <= 0) {
@@ -741,8 +749,8 @@ static int
 nfp6000_set_barsz(struct rte_pci_device *dev,
 		struct nfp_pcie_user *desc)
 {
-	uint64_t tmp;
 	int i = 0;
+	uint64_t tmp;
 
 	tmp = dev->mem_resource[0].len;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 7e7c36eda3..2e5a4e7349 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -172,9 +172,9 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t size)
 {
+	int err;
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
-	int err;
 
 	if (cpp == NULL)
 		return NULL;
@@ -396,8 +396,8 @@ static uint32_t
 nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 		uint32_t *xpb_addr)
 {
-	uint32_t xpb;
 	int island;
+	uint32_t xpb;
 
 	xpb = NFP_CPP_ID(14, NFP_CPP_ACTION_RW, 0);
 
@@ -569,9 +569,9 @@ static struct nfp_cpp *
 nfp_cpp_alloc(struct rte_pci_device *dev,
 		int driver_lock_needed)
 {
-	const struct nfp_cpp_operations *ops;
-	struct nfp_cpp *cpp;
 	int err;
+	struct nfp_cpp *cpp;
+	const struct nfp_cpp_operations *ops;
 
 	ops = nfp_cpp_transport_operations();
 
@@ -657,8 +657,8 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 		void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
@@ -687,8 +687,8 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 		const void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL)
@@ -708,8 +708,8 @@ uint32_t
 __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 		uint32_t *model)
 {
-	uint32_t reg;
 	int err;
+	uint32_t reg;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
 			&reg);
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index ea4c7d6a9e..819761eda0 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -36,7 +36,9 @@ static int
 nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
 		uint32_t size)
 {
-	const char *key, *val, *end = hwinfo->data + size;
+	const char *key;
+	const char *val;
+	const char *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
 			key = val + strlen(val) + 1) {
@@ -58,7 +60,9 @@ static int
 nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 		uint32_t len)
 {
-	uint32_t size, new_crc, *crc;
+	uint32_t *crc;
+	uint32_t size;
+	uint32_t new_crc;
 
 	size = db->size;
 	if (size > len) {
@@ -82,12 +86,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 		size_t *cpp_size)
 {
-	struct nfp_hwinfo *header;
-	void *res;
-	uint64_t cpp_addr;
-	uint32_t cpp_id;
 	int err;
+	void *res;
 	uint8_t *db;
+	uint32_t cpp_id;
+	uint64_t cpp_addr;
+	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
 	if (res) {
@@ -135,13 +139,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 		size_t *hwdb_size)
 {
+	int count = 0;
 	struct timespec wait;
 	struct nfp_hwinfo *db;
-	int count;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 10000000;
-	count = 0;
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -159,9 +162,9 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 struct nfp_hwinfo *
 nfp_hwinfo_read(struct nfp_cpp *cpp)
 {
-	struct nfp_hwinfo *db;
-	size_t hwdb_size = 0;
 	int err;
+	size_t hwdb_size = 0;
+	struct nfp_hwinfo *db;
 
 	db = nfp_hwinfo_fetch(cpp, &hwdb_size);
 	if (db == NULL)
@@ -186,7 +189,9 @@ const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
 		const char *lookup)
 {
-	const char *key, *val, *end;
+	const char *key;
+	const char *val;
+	const char *end;
 
 	if (hwinfo == NULL || lookup == NULL)
 		return NULL;
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 0071d3fc37..1e601313b4 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -68,10 +68,10 @@ static int
 nfp_mip_read_resource(struct nfp_cpp *cpp,
 		struct nfp_mip *mip)
 {
-	struct nfp_nffw_info *nffw_info;
-	uint32_t cpp_id;
-	uint64_t addr;
 	int err;
+	uint64_t addr;
+	uint32_t cpp_id;
+	struct nfp_nffw_info *nffw_info;
 
 	nffw_info = nfp_nffw_info_open(cpp);
 	if (nffw_info == NULL)
@@ -100,8 +100,8 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
 {
-	struct nfp_mip *mip;
 	int err;
+	struct nfp_mip *mip;
 
 	mip = malloc(sizeof(*mip));
 	if (mip == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index edc8137304..5be437b354 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -79,9 +79,9 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
+	int err;
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
-	int err;
 
 	err = _nfp_cpp_mutex_validate(model, &target, address);
 	if (err < 0)
@@ -122,11 +122,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
-	uint32_t model = nfp_cpp_model(cpp);
-	struct nfp_cpp_mutex *mutex;
-	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 	int err;
 	uint32_t tmp;
+	struct nfp_cpp_mutex *mutex;
+	uint32_t model = nfp_cpp_model(cpp);
+	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 
 	/* Look for cached mutex */
 	for (mutex = cpp->mutex_cache; mutex; mutex = mutex->next) {
@@ -242,12 +242,13 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 {
-	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
-	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
+	int err;
+	uint32_t key;
+	uint32_t value;
 	struct nfp_cpp *cpp = mutex->cpp;
-	uint32_t key, value;
 	uint16_t interface = nfp_cpp_interface(cpp);
-	int err;
+	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
+	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 
 	if (mutex->depth > 1) {
 		mutex->depth--;
@@ -296,12 +297,14 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 {
+	int err;
+	uint32_t key;
+	uint32_t tmp;
+	uint32_t value;
+	struct nfp_cpp *cpp = mutex->cpp;
 	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
 	uint32_t mus = NFP_CPP_ID(mutex->target, 5, 3);	/* test_set_imm */
-	uint32_t key, value, tmp;
-	struct nfp_cpp *cpp = mutex->cpp;
-	int err;
 
 	if (mutex->depth > 0) {
 		if (mutex->depth == MUTEX_DEPTH_MAX)
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 2412dc0e00..9123fc742a 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -68,9 +68,11 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 static int
 nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 {
-	uint32_t mode, addr40;
-	uint32_t xpbaddr, imbcppat;
 	int err;
+	uint32_t mode;
+	uint32_t addr40;
+	uint32_t xpbaddr;
+	uint32_t imbcppat;
 
 	/* Hardcoded XPB IMB Base, island 0 */
 	xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4;
@@ -118,10 +120,10 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
 {
-	struct nfp_nffw_info_data *fwinf;
-	struct nfp_nffw_info *state;
-	uint32_t info_ver;
 	int err;
+	uint32_t info_ver;
+	struct nfp_nffw_info *state;
+	struct nfp_nffw_info_data *fwinf;
 
 	state = malloc(sizeof(*state));
 	if (state == NULL)
@@ -183,8 +185,9 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 {
+	uint32_t i;
+	uint32_t cnt;
 	struct nffw_fwinfo *fwinfo;
-	uint32_t cnt, i;
 
 	cnt = nffw_res_fwinfos(&state->fwinf, &fwinfo);
 	if (cnt == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index dfe396c8ac..4861772a98 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -72,10 +72,11 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 static int
 nfp_nsp_check(struct nfp_nsp *state)
 {
-	struct nfp_cpp *cpp = state->cpp;
-	uint64_t nsp_status, reg;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t nsp_status;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
@@ -113,9 +114,9 @@ nfp_nsp_check(struct nfp_nsp *state)
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
 {
-	struct nfp_resource *res;
-	struct nfp_nsp *state;
 	int err;
+	struct nfp_nsp *state;
+	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
 	if (res == NULL)
@@ -170,13 +171,12 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 		uint64_t mask,
 		uint64_t val)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	uint32_t count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -217,10 +217,15 @@ nfp_nsp_command(struct nfp_nsp *state,
 		uint32_t buff_cpp,
 		uint64_t buff_addr)
 {
-	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
-	struct nfp_cpp *cpp = state->cpp;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t ret_val;
+	uint64_t nsp_base;
+	uint64_t nsp_buffer;
+	uint64_t nsp_status;
+	uint64_t nsp_command;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_base = nfp_resource_address(state->res);
@@ -296,11 +301,13 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 		void *out_buf,
 		unsigned int out_size)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	int err;
+	int ret;
+	uint64_t reg;
 	size_t max_size;
-	uint64_t reg, cpp_buf;
-	int ret, err;
 	uint32_t cpp_id;
+	uint64_t cpp_buf;
+	struct nfp_cpp *cpp = nsp->cpp;
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
@@ -360,13 +367,12 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	int count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 31677b66e6..3081e22dad 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -26,9 +26,9 @@ struct nsp_identify {
 struct nfp_nsp_identify *
 __nfp_nsp_identify(struct nfp_nsp *nsp)
 {
-	struct nfp_nsp_identify *nspi = NULL;
-	struct nsp_identify *ni;
 	int ret;
+	struct nsp_identify *ni;
+	struct nfp_nsp_identify *nspi = NULL;
 
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 15)
 		return NULL;
@@ -77,9 +77,9 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
 		enum nfp_nsp_sensor_id id,
 		uint32_t *val)
 {
-	struct nfp_sensors s;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	struct nfp_sensors s;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index bc155b44d8..9b7c8aa7f8 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -150,9 +150,10 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 		uint32_t index,
 		struct nfp_eth_table_port *dst)
 {
-	uint32_t rate;
 	uint32_t fec;
-	uint64_t port, state;
+	uint64_t port;
+	uint32_t rate;
+	uint64_t state;
 
 	port = rte_le_to_cpu_64(src->port);
 	state = rte_le_to_cpu_64(src->state);
@@ -200,7 +201,8 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 static void
 nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 {
-	uint32_t i, j;
+	uint32_t i;
+	uint32_t j;
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
@@ -242,12 +244,13 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 static struct nfp_eth_table *
 __nfp_eth_read_ports(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries;
-	struct nfp_eth_table *table;
-	uint32_t table_sz;
+	int ret;
 	uint32_t i;
 	uint32_t j;
-	int ret, cnt = 0;
+	int cnt = 0;
+	uint32_t table_sz;
+	struct nfp_eth_table *table;
+	union eth_table_entry *entries;
 	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
@@ -321,8 +324,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
 {
-	struct nfp_eth_table *ret;
 	struct nfp_nsp *nsp;
+	struct nfp_eth_table *ret;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
@@ -338,9 +341,9 @@ struct nfp_nsp *
 nfp_eth_config_start(struct nfp_cpp *cpp,
 		uint32_t idx)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -401,8 +404,8 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	int ret = 1;
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	if (nfp_nsp_config_modified(nsp)) {
 		ret = nfp_nsp_write_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
@@ -433,9 +436,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int enable)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -475,9 +478,9 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int configed)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -516,9 +519,9 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 		uint32_t val,
 		const uint64_t ctrl_bit)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
-	uint32_t idx = nfp_nsp_config_idx(nsp);
 	uint64_t reg;
+	uint32_t idx = nfp_nsp_config_idx(nsp);
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
@@ -604,8 +607,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 		uint32_t idx,
 		enum nfp_eth_fec mode)
 {
-	struct nfp_nsp *nsp;
 	int err;
+	struct nfp_nsp *nsp;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 9dd4832779..fa92f2762e 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -67,10 +67,12 @@ static int
 nfp_cpp_resource_find(struct nfp_cpp *cpp,
 		struct nfp_resource *res)
 {
-	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
+	int ret;
+	uint32_t i;
+	uint32_t key;
+	uint32_t cpp_id;
 	struct nfp_resource_entry entry;
-	uint32_t cpp_id, key;
-	int ret, i;
+	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 
 	cpp_id = NFP_CPP_ID(NFP_RESOURCE_TBL_TARGET, 3, 0);  /* Atomic read */
 
@@ -152,11 +154,11 @@ struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name)
 {
-	struct nfp_cpp_mutex *dev_mutex;
-	struct nfp_resource *res;
 	int err;
+	uint16_t count = 0;
 	struct timespec wait;
-	uint16_t count;
+	struct nfp_resource *res;
+	struct nfp_cpp_mutex *dev_mutex;
 
 	res = malloc(sizeof(*res));
 	if (res == NULL)
@@ -175,7 +177,6 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 1000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 243d3c9ce5..a34278beca 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -85,8 +85,8 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 struct nfp_rtsym_table *
 nfp_rtsym_table_read(struct nfp_cpp *cpp)
 {
-	struct nfp_rtsym_table *rtbl;
 	struct nfp_mip *mip;
+	struct nfp_rtsym_table *rtbl;
 
 	mip = nfp_mip_open(cpp);
 	rtbl = __nfp_rtsym_table_read(cpp, mip);
@@ -99,13 +99,18 @@ struct nfp_rtsym_table *
 __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 		const struct nfp_mip *mip)
 {
-	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
-	struct nfp_rtsym_entry *rtsymtab;
+	int n;
+	int err;
+	uint32_t size;
+	uint32_t strtab_addr;
+	uint32_t symtab_addr;
+	uint32_t strtab_size;
+	uint32_t symtab_size;
 	struct nfp_rtsym_table *cache;
+	struct nfp_rtsym_entry *rtsymtab;
 	const uint32_t dram =
 		NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) |
 		NFP_ISL_EMEM0;
-	int err, n, size;
 
 	if (mip == NULL)
 		return NULL;
@@ -341,10 +346,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		const char *name,
 		int *error)
 {
-	const struct nfp_rtsym *sym;
-	uint32_t val32;
-	uint64_t val;
 	int err;
+	uint64_t val;
+	uint32_t val32;
+	const struct nfp_rtsym *sym;
 
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-- 
2.39.1


^ permalink raw reply	[relevance 3%]

* [PATCH v4 02/26] net/nfp: unify the indent coding style
  @ 2023-09-18  2:45  1%       ` Chaoyong He
  2023-09-18 11:53  0%         ` Niklas Söderlund
  2023-09-18  2:45  3%       ` [PATCH v4 05/26] net/nfp: standard the local variable " Chaoyong He
                         ` (3 subsequent siblings)
  4 siblings, 1 reply; 200+ results
From: Chaoyong He @ 2023-09-18  2:45 UTC (permalink / raw)
  To: dev; +Cc: Chaoyong He, Niklas Söderlund

Each parameter of function should occupy one line, and indent two TAB
character.
All the statement which span multi line should indent two TAB character.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
 drivers/net/nfp/nfpcore/nfp_crc.c          |  19 ++-
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
 drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
 drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  12 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  72 +++++----
 drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
 17 files changed, 463 insertions(+), 331 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 8f87c09327..54bef3cb6b 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -56,7 +56,8 @@ struct nfp_cpp_operations {
 	size_t area_priv_size;
 
 	/* Instance an NFP CPP */
-	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
+	int (*init)(struct nfp_cpp *cpp,
+			struct rte_pci_device *dev);
 
 	/*
 	 * Free the bus.
@@ -69,9 +70,9 @@ struct nfp_cpp_operations {
 	 * NOTE: This is _not_ serialized
 	 */
 	int (*area_init)(struct nfp_cpp_area *area,
-			 uint32_t dest,
-			 unsigned long long address,
-			 unsigned long size);
+			uint32_t dest,
+			unsigned long long address,
+			unsigned long size);
 	/*
 	 * Clean up a NFP CPP area before it is freed
 	 * NOTE: This is _not_ serialized
@@ -101,17 +102,17 @@ struct nfp_cpp_operations {
 	 * Serialized
 	 */
 	int (*area_read)(struct nfp_cpp_area *area,
-			 void *kernel_vaddr,
-			 unsigned long offset,
-			 unsigned int length);
+			void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 	/*
 	 * Perform a write to a NFP CPP area
 	 * Serialized
 	 */
 	int (*area_write)(struct nfp_cpp_area *area,
-			  const void *kernel_vaddr,
-			  unsigned long offset,
-			  unsigned int length);
+			const void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 };
 
 /*
@@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
  * @param   len     Length of the serial byte array
  */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		       size_t serial_len);
+		size_t serial_len);
 
 /*
  * Set the private data of the nfp_cpp instance
@@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
-					 int driver_lock_needed);
+		int driver_lock_needed);
 
 /*
  * Free a NFP CPP handle
@@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
-					unsigned long long address,
-					unsigned long size);
+		unsigned long long address, unsigned long size);
 
 /*
  * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
@@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
-						  uint32_t cpp_id,
-						  const char *name,
-						  unsigned long long address,
-						  unsigned long size);
+		uint32_t cpp_id, const char *name, unsigned long long address,
+		unsigned long size);
 
 /*
  * Free an allocated NFP CPP area handle
@@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
-						uint32_t cpp_id,
-						unsigned long long address,
-						unsigned long size);
+		uint32_t cpp_id, unsigned long long address, unsigned long size);
 
 /*
  * Release the resources, then free the NFP CPP area handle
@@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
-			   uint64_t addr, unsigned long size,
-			   struct nfp_cpp_area **area);
+		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
 /*
  * Return an IO pointer to the beginning of the NFP CPP area handle. The area
  * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
@@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
  *
  */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		      void *buffer, size_t length);
+		void *buffer, size_t length);
 
 /*
  * Write to a NFP CPP area handle from a buffer. The area must be acquired with
@@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		       const void *buffer, size_t length);
+		const void *buffer, size_t length);
 
 /*
  * nfp_cpp_area_iomem() - get IOMEM region for CPP area
@@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
-			     unsigned long long offset, unsigned long size);
+		unsigned long long offset, unsigned long size);
 
 /*
  * Get the NFP CPP handle that is the parent of a NFP CPP area handle
@@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
  * @return bytes read on success, -1 on failure.
  */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
-		 unsigned long long address, void *kernel_vaddr, size_t length);
+		unsigned long long address, void *kernel_vaddr, size_t length);
 
 /*
  * Write a block of data to a NFP CPP ID
@@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, -1 on failure.
  */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, const void *kernel_vaddr,
-		  size_t length);
+		unsigned long long address, const void *kernel_vaddr,
+		size_t length);
 
 
 
@@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		      uint32_t value, size_t length);
+		uint32_t value, size_t length);
 
 /*
  * Read a single 32-bit value from a NFP CPP area handle
@@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		       uint32_t *value);
+		uint32_t *value);
 
 /*
  * Write a single 32-bit value to a NFP CPP area handle
@@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-			uint32_t value);
+		uint32_t value);
 
 /*
  * Read a single 64-bit value from a NFP CPP area handle
@@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		       uint64_t *value);
+		uint64_t *value);
 
 /*
  * Write a single 64-bit value to a NFP CPP area handle
@@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-			uint64_t value);
+		uint64_t value);
 
 /*
  * Write a single 32-bit value on the XPB bus
@@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
  * @return 0 on success, or -1 on failure.
  */
 int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		    uint32_t value);
+		uint32_t value);
 
 /*
  * Modify bits of a 32-bit value from the XPB bus
@@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, negative value on failure.
  */
 int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		   uint32_t value, int timeout_us);
+		uint32_t value, int timeout_us);
 
 /*
  * Read a 32-bit word from a NFP CPP ID
@@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint32_t *value);
+		unsigned long long address, uint32_t *value);
 
 /*
  * Write a 32-bit value to a NFP CPP ID
@@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
  *
  */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint32_t value);
+		unsigned long long address, uint32_t value);
 
 /*
  * Read a 64-bit work from a NFP CPP ID
@@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint64_t *value);
+		unsigned long long address, uint64_t *value);
 
 /*
  * Write a 64-bit value to a NFP CPP ID
@@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint64_t value);
+		unsigned long long address, uint64_t value);
 
 /*
  * Initialize a mutex location
@@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
-		       unsigned long long address, uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Create a mutex handle from an address controlled by a MU Atomic engine
@@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
  *                      failure.
  */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-					  unsigned long long address,
-					  uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Get the NFP CPP handle the mutex was created with
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 2ee60eefc3..884cc84eaa 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
 #define TARGET_WIDTH_64    8
 
 static int
-nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
-		uint64_t *bar_base, int tgt, int act, int tok,
-		uint64_t offset, size_t size, int width)
+nfp_compute_bar(const struct nfp_bar *bar,
+		uint32_t *bar_config,
+		uint64_t *bar_base,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint32_t bitsize;
 	uint32_t newcfg;
@@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 
 	switch (width) {
 	case 8:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
 		break;
 	case 4:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
 		break;
 	case 0:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
 		break;
 	default:
 		return -EINVAL;
@@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 		/* Fixed CPP mapping with specific action */
 		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
 
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size), act,
-				    (unsigned long long)mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size), act,
+					(unsigned long long)mask);
 			return -EINVAL;
 		}
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-			    bar->index, tgt, act, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + mask));
+				bar->index, tgt, act, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + mask));
 
 		bitsize = 40 - 16;
 	} else {
 		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
 
 		/* Bulk mapping */
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
 
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size),
-				    tgt, tok, (unsigned long long)mask,
-				    (unsigned long long)(offset & mask),
-				    (unsigned long long)(offset + size - 1) & mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size),
+					tgt, tok, (unsigned long long)mask,
+					(unsigned long long)(offset & mask),
+					(unsigned long long)(offset + size - 1) & mask);
 			return -EINVAL;
 		}
 
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-			    bar->index, tgt, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + ~mask));
+				bar->index, tgt, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + ~mask));
 
 		bitsize = 40 - 21;
 	}
 
 	if (bar->bitsize < bitsize) {
 		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-			    tgt, tok, act);
+				tgt, tok, act);
 		return -EINVAL;
 	}
 
@@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 }
 
 static int
-nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
-		  uint32_t newcfg)
+nfp_bar_write(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		uint32_t newcfg)
 {
 	int base, slot;
 
@@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 		return (-ENOMEM);
 
 	bar->csr = nfp->cfg +
-		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
+			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
 
 	*(uint32_t *)(bar->csr) = newcfg;
 
@@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 }
 
 static int
-nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
-		int act, int tok, uint64_t offset, size_t size, int width)
+nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint64_t newbase;
 	uint32_t newcfg;
 	int err;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
-			      size, width);
+			size, width);
 	if (err != 0)
 		return err;
 
@@ -390,8 +398,10 @@ struct nfp6000_area_priv {
 };
 
 static int
-nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
-		  unsigned long long address, unsigned long size)
+nfp6000_area_init(struct nfp_cpp_area *area,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
@@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	int pp, ret = 0;
 
-	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
-				     address);
+	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
 		return pp;
 
@@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->width.write = PULL_WIDTH(pp);
 
 	if (priv->width.read > 0 &&
-	    priv->width.write > 0 && priv->width.read != priv->width.write)
+			priv->width.write > 0 &&
+			priv->width.read != priv->width.write)
 		return -EINVAL;
 
 	if (priv->width.read > 0)
@@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->size = size;
 
 	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
-				  priv->token, priv->offset, priv->size,
-				  priv->width.bar);
+			priv->token, priv->offset, priv->size,
+			priv->width.bar);
 
 	return ret;
 }
@@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
 
 	/* Calculate offset into BAR. */
 	if (nfp_bar_maptype(priv->bar) ==
-	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
+			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
 		priv->bar_offset = priv->offset &
-			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
-		priv->bar_offset +=
-			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
-							   priv->target);
-		priv->bar_offset +=
-		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
+				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
+				priv->target);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
+				priv->token);
 	} else {
 		priv->bar_offset = priv->offset & priv->bar->mask;
 	}
@@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
 }
 
 static int
-nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
-		  unsigned long offset, unsigned int length)
+nfp6000_area_read(struct nfp_cpp_area *area,
+		void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	uint64_t *wrptr64 = kernel_vaddr;
 	const volatile uint64_t *rdptr64;
@@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 
 	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW) {
+			priv->action == NFP_CPP_ACTION_RW) {
 		is_64 = false;
 	}
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 }
 
 static int
-nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
-		   unsigned long offset, unsigned int length)
+nfp6000_area_write(struct nfp_cpp_area *area,
+		const void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	const uint64_t *rdptr64 = kernel_vaddr;
 	uint64_t *wrptr64;
@@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
 
 	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW)
+			priv->action == NFP_CPP_ACTION_RW)
 		is_64 = false;
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_model(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint32_t model;
 
@@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_interface(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t interface;
 
@@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_serial(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t tmp;
 	uint8_t serial[6];
@@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
+nfp6000_set_barsz(struct rte_pci_device *dev,
+		struct nfp_pcie_user *desc)
 {
 	unsigned long tmp;
 	int i = 0;
@@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
+nfp6000_init(struct nfp_cpp *cpp,
+		struct rte_pci_device *dev)
 {
 	int ret = 0;
 	struct nfp_pcie_user *desc;
@@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
 	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
-	    cpp->driver_lock_needed) {
+			cpp->driver_lock_needed) {
 		ret = nfp_acquire_process_lock(desc);
 		if (ret != 0)
 			goto error;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 31338e0047..f764208a9a 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -27,7 +27,8 @@
 						NFP_PL_DEVICE_ID_MASK)
 
 void
-nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
+nfp_cpp_priv_set(struct nfp_cpp *cpp,
+		void *priv)
 {
 	cpp->priv = priv;
 }
@@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
+nfp_cpp_model_set(struct nfp_cpp *cpp,
+		uint32_t model)
 {
 	cpp->model = model;
 }
@@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
+nfp_cpp_interface_set(struct nfp_cpp *cpp,
+		uint32_t interface)
 {
 	cpp->interface = interface;
 }
 
 int
-nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
+nfp_cpp_serial(struct nfp_cpp *cpp,
+		const uint8_t **serial)
 {
 	*serial = cpp->serial;
 	return cpp->serial_len;
 }
 
 int
-nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		   size_t serial_len)
+nfp_cpp_serial_set(struct nfp_cpp *cpp,
+		const uint8_t *serial,
+		size_t serial_len)
 {
 	if (cpp->serial_len)
 		free(cpp->serial);
@@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
  * NOTE: @address and @size must be 32-bit aligned values.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
-			      const char *name, unsigned long long address,
-			      unsigned long size)
+nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
+		uint32_t dest,
+		const char *name,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
@@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 		name = "";
 
 	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
-		      strlen(name) + 1);
+			strlen(name) + 1);
 	if (area == NULL)
 		return NULL;
 
@@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 }
 
 struct nfp_cpp_area *
-nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
-		    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc(struct nfp_cpp *cpp,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
@@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
  * NOTE: The area must also be 'released' when the structure is freed.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
-			    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 
@@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		  void *kernel_vaddr, size_t length)
+nfp_cpp_area_read(struct nfp_cpp_area *area,
+		unsigned long offset,
+		void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		   const void *kernel_vaddr, size_t length)
+nfp_cpp_area_write(struct nfp_cpp_area *area,
+		unsigned long offset,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
  * or negative value on error.
  */
 int
-nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
-			 unsigned long length)
+nfp_cpp_area_check_range(struct nfp_cpp_area *area,
+		unsigned long long offset,
+		unsigned long length)
 {
 	if (((offset + length) > area->size))
 		return -EFAULT;
@@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
  * based upon NFP model.
  */
 static uint32_t
-nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
+nfp_xpb_to_cpp(struct nfp_cpp *cpp,
+		uint32_t *xpb_addr)
 {
 	uint32_t xpb;
 	int island;
@@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 		else
 			/* And only non-ARM interfaces use island id = 1 */
 			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
-			    NFP_CPP_INTERFACE_TYPE_ARM)
+					NFP_CPP_INTERFACE_TYPE_ARM)
 				*xpb_addr |= (1 << 24);
 	} else {
 		(*xpb_addr) |= (1 << 30);
@@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 }
 
 int
-nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		   uint32_t *value)
+nfp_cpp_area_readl(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp = 0;
@@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-		    uint32_t value)
+nfp_cpp_area_writel(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value)
 {
 	int sz;
 
@@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		   uint64_t *value)
+nfp_cpp_area_readq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp = 0;
@@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-		    uint64_t value)
+nfp_cpp_area_writeq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t value)
 {
 	int sz;
 
@@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint32_t *value)
+nfp_cpp_readl(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp;
@@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint32_t value)
+nfp_cpp_writel(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t value)
 {
 	int sz;
 
@@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint64_t *value)
+nfp_cpp_readq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp;
@@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint64_t value)
+nfp_cpp_writeq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t value)
 {
 	int sz;
 
@@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
+nfp_xpb_writel(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t value)
 {
 	uint32_t cpp_dest;
 
@@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
 }
 
 int
-nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
+nfp_xpb_readl(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t *value)
 {
 	uint32_t cpp_dest;
 
@@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
 }
 
 static struct nfp_cpp *
-nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_alloc(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	const struct nfp_cpp_operations *ops;
 	struct nfp_cpp *cpp;
@@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 			/* Hardcoded XPB IMB Base, island 0 */
 			xpbaddr = 0x000a0000 + (tgt * 4);
 			err = nfp_xpb_readl(cpp, xpbaddr,
-				(uint32_t *)&cpp->imb_cat_table[tgt]);
+					(uint32_t *)&cpp->imb_cat_table[tgt]);
 			if (err < 0) {
 				free(cpp);
 				return NULL;
@@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 }
 
 struct nfp_cpp *
-nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_from_device_name(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
@@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
  * @return 0 on success, or -1 on failure.
  */
 int
-nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
+nfp_xpb_writelm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
 		uint32_t value)
 {
 	int err;
@@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, or negative value on failure.
  */
 int
-nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-	       uint32_t value, int timeout_us)
+nfp_xpb_waitlm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
+		uint32_t value,
+		int timeout_us)
 {
 	uint32_t tmp;
 	int err;
@@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @length:     number of bytes to read
  */
 int
-nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
-	     unsigned long long address, void *kernel_vaddr, size_t length)
+nfp_cpp_read(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     number of bytes to write
  */
 int
-nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
-	      unsigned long long address, const void *kernel_vaddr,
-	      size_t length)
+nfp_cpp_write(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     length of area to fill
  */
 int
-nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		  uint32_t value, size_t length)
+nfp_cpp_area_fill(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value,
+		size_t length)
 {
 	int err;
 	size_t i;
@@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value64,
-				       sizeof(value64));
+		err = nfp_cpp_area_write(area, offset + i, &value64,
+				sizeof(value64));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value64))
@@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	if ((i + sizeof(value)) <= length) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
+		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value))
@@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * as those are model-specific
  */
 uint32_t
-__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
+__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
+		uint32_t *model)
 {
 	uint32_t reg;
 	int err;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
-			    &reg);
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 unsigned long size, struct nfp_cpp_area **area)
+nfp_cpp_map_area(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		unsigned long size,
+		struct nfp_cpp_area **area)
 {
 	uint8_t *res;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_crc.c b/drivers/net/nfp/nfpcore/nfp_crc.c
index 20431bf845..2cd8866253 100644
--- a/drivers/net/nfp/nfpcore/nfp_crc.c
+++ b/drivers/net/nfp/nfpcore/nfp_crc.c
@@ -9,27 +9,31 @@
 #include "nfp_crc.h"
 
 static inline uint32_t
-nfp_crc32_be_generic(uint32_t crc, unsigned char const *p, size_t len,
-		 uint32_t polynomial)
+nfp_crc32_be_generic(uint32_t crc,
+		unsigned char const *p,
+		size_t len,
+		uint32_t polynomial)
 {
 	int i;
 	while (len--) {
 		crc ^= *p++ << 24;
 		for (i = 0; i < 8; i++)
-			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
-					  0);
+			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial : 0);
 	}
 	return crc;
 }
 
 static inline uint32_t
-nfp_crc32_be(uint32_t crc, unsigned char const *p, size_t len)
+nfp_crc32_be(uint32_t crc,
+		unsigned char const *p,
+		size_t len)
 {
 	return nfp_crc32_be_generic(crc, p, len, CRCPOLY_BE);
 }
 
 static uint32_t
-nfp_crc32_posix_end(uint32_t crc, size_t total_len)
+nfp_crc32_posix_end(uint32_t crc,
+		size_t total_len)
 {
 	/* Extend with the length of the string. */
 	while (total_len != 0) {
@@ -43,7 +47,8 @@ nfp_crc32_posix_end(uint32_t crc, size_t total_len)
 }
 
 uint32_t
-nfp_crc32_posix(const void *buff, size_t len)
+nfp_crc32_posix(const void *buff,
+		size_t len)
 {
 	return nfp_crc32_posix_end(nfp_crc32_be(0, buff, len), len);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index a9d166c4dc..ea4c7d6a9e 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
 }
 
 static int
-nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
+nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
+		uint32_t size)
 {
 	const char *key, *val, *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 		if (val >= end) {
 			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
@@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
 }
 
 static int
-nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
+nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
+		uint32_t len)
 {
 	uint32_t size, new_crc, *crc;
 
@@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
 		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
-			    new_crc, *crc);
+				new_crc, *crc);
 		return -EINVAL;
 	}
 
@@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
+nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
+		size_t *cpp_size)
 {
 	struct nfp_hwinfo *header;
 	void *res;
@@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
 		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
-			header->version);
+				header->version);
 		goto exit_free;
 	}
 
@@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
+nfp_hwinfo_fetch(struct nfp_cpp *cpp,
+		size_t *hwdb_size)
 {
 	struct timespec wait;
 	struct nfp_hwinfo *db;
@@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
  * Return: Value of the HWInfo name, or NULL
  */
 const char *
-nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
+nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
+		const char *lookup)
 {
 	const char *key, *val, *end;
 
@@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
 	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 
 		if (strcmp(key, lookup) == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index f9723dd136..0071d3fc37 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -37,8 +37,10 @@ struct nfp_mip {
 
 /* Read memory and check if it could be a valid MIP */
 static int
-nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 struct nfp_mip *mip)
+nfp_mip_try_read(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		struct nfp_mip *mip)
 {
 	int ret;
 
@@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
 		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
-			    rte_le_to_cpu_32(mip->signature));
+				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
 		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
-			    rte_le_to_cpu_32(mip->mip_version));
+				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
 
@@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 
 /* Try to locate MIP using the resource table */
 static int
-nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
+nfp_mip_read_resource(struct nfp_cpp *cpp,
+		struct nfp_mip *mip)
 {
 	struct nfp_nffw_info *nffw_info;
 	uint32_t cpp_id;
@@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
  * @size:	Location for size of MIP symbol table
  */
 void
-nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_symtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->symtab_addr);
 	*size = rte_le_to_cpu_32(mip->symtab_size);
@@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
  * @size:	Location for size of MIP symbol name table
  */
 void
-nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_strtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->strtab_addr);
 	*size = rte_le_to_cpu_32(mip->strtab_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
index d0919b58fe..980abc2517 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.h
+++ b/drivers/net/nfp/nfpcore/nfp_mip.h
@@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
 void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			    uint64_t *off);
+		uint64_t *off);
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 0410a00856..047e755416 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
 };
 
 static int
-_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
+_nfp_cpp_mutex_validate(uint32_t model,
+		int *target,
+		unsigned long long address)
 {
 	/* Address must be 64-bit aligned */
 	if ((address & 7) != 0)
@@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
  * @return 0 on success, or negative value on failure.
  */
 int
-nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
-		   uint32_t key)
+nfp_cpp_mutex_init(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
@@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
 	if (err < 0)
 		return err;
 
-	err =
-	    nfp_cpp_writel(cpp, muw, address + 0,
-			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
+	err = nfp_cpp_writel(cpp, muw, address + 0,
+			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
 	if (err < 0)
 		return err;
 
@@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
  * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
-nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-		     unsigned long long address, uint32_t key)
+nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	struct nfp_cpp_mutex *mutex;
@@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 			return err;
 		if (time(NULL) >= warn_at) {
 			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
-				    mutex->usage, mutex->depth, mutex->target,
-				    mutex->address, mutex->key);
+					mutex->usage, mutex->depth, mutex->target,
+					mutex->address, mutex->key);
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 433780a5e7..fa65956baa 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -85,7 +85,8 @@ nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 }
 
 static unsigned int
-nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
+nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
+		struct nffw_fwinfo **arr)
 {
 	/*
 	 * For the this code, version 0 is most likely to be version 1 in this
@@ -138,8 +139,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 		goto err_release;
 
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
-			   nfp_resource_address(state->res),
-			   fwinf, sizeof(*fwinf));
+			nfp_resource_address(state->res),
+			fwinf, sizeof(*fwinf));
 	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
@@ -205,8 +206,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
  * Return: 0, or -ERRNO
  */
 int
-nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			uint64_t *off)
+nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
+		uint32_t *cpp_id,
+		uint64_t *off)
 {
 	struct nffw_fwinfo *fwinfo;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 6474abf0c2..4f476f6f2b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
+nfp_nsp_config_set_modified(struct nfp_nsp *state,
+		int modified)
 {
 	state->modified = modified;
 }
@@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
+nfp_nsp_config_set_state(struct nfp_nsp *state,
+		void *entries,
+		unsigned int idx)
 {
 	state->entries = entries;
 	state->idx = idx;
@@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 
 	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
-						    state->ver.minor);
+				state->ver.minor);
 		return -EINVAL;
 	}
 
@@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
 }
 
 static int
-nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
-		 uint64_t addr, uint64_t mask, uint64_t val)
+nfp_nsp_wait_reg(struct nfp_cpp *cpp,
+		uint64_t *reg,
+		uint32_t nsp_cpp,
+		uint64_t addr,
+		uint64_t mask,
+		uint64_t val)
 {
 	struct timespec wait;
 	int count;
@@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
  *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
-		uint32_t buff_cpp, uint64_t buff_addr)
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code,
+		uint32_t option,
+		uint32_t buff_cpp,
+		uint64_t buff_addr)
 {
 	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
 	struct nfp_cpp *cpp = state->cpp;
@@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 		return err;
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
 		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-			buff_cpp, buff_addr);
+				buff_cpp, buff_addr);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			     FIELD_PREP(NSP_COMMAND_CODE, code) |
-			     FIELD_PREP(NSP_COMMAND_START, 1));
+			FIELD_PREP(NSP_COMMAND_OPTION, option) |
+			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
 
 	/* Wait for NSP_COMMAND_START to go to 0 */
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
-			       NSP_COMMAND_START, 0);
+			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
 	/* Wait for NSP_STATUS_BUSY to go to 0 */
-	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
-			       0);
+	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
+			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
@@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-			 -err, (int)ret_val, code);
+				-err, (int)ret_val, code);
 		nfp_nsp_print_extended_error(ret_val);
 		return -err;
 	}
@@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 #define SZ_1M 0x00100000
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
-		    const void *in_buf, unsigned int in_size, void *out_buf,
-		    unsigned int out_size)
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		uint16_t code, uint32_t option,
+		const void *in_buf,
+		unsigned int in_size,
+		void *out_buf,
+		unsigned int out_size)
 {
 	struct nfp_cpp *cpp = nsp->cpp;
 	unsigned int max_size;
@@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-			    code, nsp->ver.major, nsp->ver.minor);
+				code, nsp->ver.major, nsp->ver.minor);
 		return -EOPNOTSUPP;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER_CONFIG,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
 	if (err < 0)
 		return err;
 
 	max_size = RTE_MAX(in_size, out_size);
 	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
 		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
-			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
+				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
 		memset(out_buf, 0, out_size - in_size);
 		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				    out_size - in_size);
+				out_size - in_size);
 		if (err < 0)
 			return err;
 	}
@@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
 }
 
 int
-nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_load_fw(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_eth_table(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			unsigned int size)
+nfp_nsp_write_eth_table(struct nfp_nsp *state,
+		const void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_identify(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
-		     unsigned int size)
+nfp_nsp_read_sensors(struct nfp_nsp *state,
+		unsigned int sensor_mask,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-				   0, buf, size);
+			0, buf, size);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 9905b2d3d3..1e2deaabb4 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_mac_reinit(struct nfp_nsp *state);
 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
-			 void *buf, unsigned int size);
+		void *buf, unsigned int size);
 
-static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
+static inline int
+nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
@@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
 int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
 int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
-			   int configed);
-int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
+		int configed);
+int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			    unsigned int size);
+		unsigned int size);
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
-			      unsigned int idx);
+		unsigned int idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
 void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
 int nfp_nsp_config_modified(struct nfp_nsp *state);
 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
+static inline int
+nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return !!eth_port->fec_modes_supported;
 }
@@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
 };
 
 int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
-			  long *val);
+		long *val);
 
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 21b338461e..28dba27124 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -73,7 +73,9 @@ struct nfp_sensors {
 };
 
 int
-nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
+nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
+		enum nfp_nsp_sensor_id id,
+		long *val)
 {
 	struct nfp_sensors s;
 	struct nfp_nsp *nsp;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 825a84a8cd..51bd57033e 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -159,7 +159,8 @@ nfp_eth_speed2rate(unsigned int speed)
 }
 
 static void
-nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
+nfp_eth_copy_mac_reverse(uint8_t *dst,
+		const uint8_t *src)
 {
 	int i;
 
@@ -168,8 +169,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
 }
 
 static void
-nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
-		       unsigned int index, struct nfp_eth_table_port *dst)
+nfp_eth_port_translate(struct nfp_nsp *nsp,
+		const union eth_table_entry *src,
+		unsigned int index,
+		struct nfp_eth_table_port *dst)
 {
 	unsigned int rate;
 	unsigned int fec;
@@ -225,21 +228,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
-					   table->ports[i].index);
+				table->ports[i].index);
 
 		for (j = 0; j < table->count; j++) {
 			if (table->ports[i].label_port !=
-			    table->ports[j].label_port)
+					table->ports[j].label_port)
 				continue;
 			table->ports[i].port_lanes += table->ports[j].lanes;
 
 			if (i == j)
 				continue;
 			if (table->ports[i].label_subport ==
-			    table->ports[j].label_subport)
+					table->ports[j].label_subport)
 				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
-					 table->ports[i].label_port,
-					 table->ports[i].label_subport);
+						table->ports[i].label_port,
+						table->ports[i].label_subport);
 
 			table->ports[i].is_split = 1;
 		}
@@ -296,7 +299,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 */
 	if (ret != 0 && ret != cnt) {
 		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
-		       ret, cnt);
+				ret, cnt);
 		goto err;
 	}
 
@@ -354,7 +357,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
 }
 
 struct nfp_nsp *
-nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
+nfp_eth_config_start(struct nfp_cpp *cpp,
+		unsigned int idx)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -447,7 +451,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
+nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int enable)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -487,7 +493,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
+nfp_eth_set_configured(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int configed)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -523,9 +531,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
 }
 
 static int
-nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
-		       const uint64_t mask, const unsigned int shift,
-		       unsigned int val, const uint64_t ctrl_bit)
+nfp_eth_set_bit_config(struct nfp_nsp *nsp,
+		unsigned int raw_idx,
+		const uint64_t mask,
+		const unsigned int shift,
+		unsigned int val,
+		const uint64_t ctrl_bit)
 {
 	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	unsigned int idx = nfp_nsp_config_idx(nsp);
@@ -560,7 +571,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
 	(__extension__ ({ \
 		typeof(mask) _x = (mask); \
 		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
-				       val, ctrl_bit);			\
+				val, ctrl_bit);			\
 	}))
 
 /*
@@ -574,11 +585,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
+__nfp_eth_set_aneg(struct nfp_nsp *nsp,
+		enum nfp_eth_aneg mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_ANEG, mode,
-				      NSP_ETH_CTRL_SET_ANEG);
+			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
 /*
@@ -592,11 +603,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
  * Return: 0 or -ERRNO.
  */
 static int
-__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
+__nfp_eth_set_fec(struct nfp_nsp *nsp,
+		enum nfp_eth_fec mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_FEC, mode,
-				      NSP_ETH_CTRL_SET_FEC);
+			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
 /*
@@ -611,7 +622,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
+nfp_eth_set_fec(struct nfp_cpp *cpp,
+		unsigned int idx,
+		enum nfp_eth_fec mode)
 {
 	struct nfp_nsp *nsp;
 	int err;
@@ -642,7 +655,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
+__nfp_eth_set_speed(struct nfp_nsp *nsp,
+		unsigned int speed)
 {
 	enum nfp_eth_rate rate;
 
@@ -653,8 +667,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
 	}
 
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_RATE, rate,
-				      NSP_ETH_CTRL_SET_RATE);
+			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
 /*
@@ -668,8 +681,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
+__nfp_eth_set_split(struct nfp_nsp *nsp,
+		unsigned int lanes)
 {
-	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
-				      lanes, NSP_ETH_CTRL_SET_LANES);
+	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
+			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 838cd6e0ef..57089c770f 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -64,7 +64,8 @@ struct nfp_resource {
 };
 
 static int
-nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
+nfp_cpp_resource_find(struct nfp_cpp *cpp,
+		struct nfp_resource *res)
 {
 	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 	struct nfp_resource_entry entry;
@@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 
 	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
 		uint64_t addr = NFP_RESOURCE_TBL_BASE +
-			sizeof(struct nfp_resource_entry) * i;
+				sizeof(struct nfp_resource_entry) * i;
 
 		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
 		if (ret != sizeof(entry))
@@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 			continue;
 
 		/* Found key! */
-		res->mutex =
-			nfp_cpp_mutex_alloc(cpp,
-					    NFP_RESOURCE_TBL_TARGET, addr, key);
+		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
+				addr, key);
 		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
-					 entry.region.cpp_action,
-					 entry.region.cpp_token);
+				entry.region.cpp_action,
+				entry.region.cpp_token);
 		res->addr = ((uint64_t)entry.region.page_offset) << 8;
 		res->size = (uint64_t)entry.region.page_size << 8;
 		return 0;
@@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 }
 
 static int
-nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
-			 struct nfp_cpp_mutex *dev_mutex)
+nfp_resource_try_acquire(struct nfp_cpp *cpp,
+		struct nfp_resource *res,
+		struct nfp_cpp_mutex *dev_mutex)
 {
 	int err;
 
@@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
  * Return: NFP Resource handle, or NULL
  */
 struct nfp_resource *
-nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
+nfp_resource_acquire(struct nfp_cpp *cpp,
+		const char *name)
 {
 	struct nfp_cpp_mutex *dev_mutex;
 	struct nfp_resource *res;
@@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
 	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
 
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
-					NFP_RESOURCE_TBL_BASE,
-					NFP_RESOURCE_TBL_KEY);
+			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
 		free(res);
 		return NULL;
@@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
  *
  * Return: const char pointer to the name of the resource
  */
-const char
-*nfp_resource_name(const struct nfp_resource *res)
+const char *
+nfp_resource_name(const struct nfp_resource *res)
 {
 	return res->name;
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 06cc6f74f4..009b7359a4 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -18,7 +18,7 @@
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
-					  const char *name);
+		const char *name);
 
 /**
  * Release a NFP Resource, and free the handle
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 4c45aec5c1..aa3b7a483e 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -40,22 +40,25 @@ struct nfp_rtsym_table {
 };
 
 static int
-nfp_meid(uint8_t island_id, uint8_t menum)
+nfp_meid(uint8_t island_id,
+		uint8_t menum)
 {
 	return (island_id & 0x3F) == island_id && menum < 12 ?
 		(island_id << 4) | (menum + 4) : -1;
 }
 
 static void
-nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
-			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
+nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
+		uint32_t strtab_size,
+		struct nfp_rtsym *sw,
+		struct nfp_rtsym_entry *fw)
 {
 	sw->type = fw->type;
 	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
 	sw->addr = ((uint64_t)fw->addr_hi << 32) |
-		   rte_le_to_cpu_32(fw->addr_lo);
+			rte_le_to_cpu_32(fw->addr_lo);
 	sw->size = ((uint64_t)fw->size_hi << 32) |
-		   rte_le_to_cpu_32(fw->size_lo);
+			rte_le_to_cpu_32(fw->size_lo);
 
 	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
 		     sw->name, sw->addr, sw->size, sw->target);
@@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
 }
 
 struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
+__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip)
 {
 	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
 	struct nfp_rtsym_entry *rtsymtab;
@@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
 
 	for (n = 0; n < cache->num; n++)
 		nfp_rtsym_sw_entry_init(cache, strtab_size,
-					&cache->symtab[n], &rtsymtab[n]);
+				&cache->symtab[n], &rtsymtab[n]);
 
 	free(rtsymtab);
 
@@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
+nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
+		int idx)
 {
 	if (rtbl == NULL)
 		return NULL;
@@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
+nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name)
 {
 	int n;
 
@@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
  * Return: value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
-nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
+nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		int *error)
 {
 	const struct nfp_rtsym *sym;
 	uint32_t val32;
@@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
-			name, sym->size);
+				name, sym->size);
 		err = -EINVAL;
 		break;
 	}
@@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 }
 
 uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area)
+nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		unsigned int min_size,
+		struct nfp_cpp_area **area)
 {
 	int ret;
 	uint8_t *mem;
@@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
-			sym->size, min_size);
+				sym->size, min_size);
 		return NULL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index 8b494211bc..30768f1ccf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -43,19 +43,18 @@ struct nfp_rtsym_table;
 
 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
 
-struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
+struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip);
 
 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
 
 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
 
-const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
+const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name);
 
 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
-			   int *error);
-uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area);
+		int *error);
+uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
+		unsigned int min_size, struct nfp_cpp_area **area);
 #endif
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v3 19/27] net/nfp: refact the nsp module
                         ` (2 preceding siblings ...)
  2023-09-15  9:15  1%     ` [PATCH v3 07/27] net/nfp: standard the comment style Chaoyong He
@ 2023-09-15  9:15  5%     ` Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-15  9:15 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, Niklas Söderlund

Move the definition of data structure into the implement file.
Also sync the logic from kernel driver and remove the unneeded header
file include statements.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c           |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c      | 390 +++++++++++++++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h      | 140 ++++-----
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c |   4 -
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c  |  79 ++---
 5 files changed, 398 insertions(+), 217 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 2e43055fd5..9243191de3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -661,7 +661,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 static int
 nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	struct nfp_cpp *cpp = nfp_nsp_cpp(nsp);
 	void *fw_buf;
 	char fw_name[125];
 	char serial[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 8e65064b10..75d13cb84f 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -3,20 +3,127 @@
  * All rights reserved.
  */
 
-#define NFP_SUBSYS "nfp_nsp"
-
-#include <stdio.h>
-#include <time.h>
+#include "nfp_nsp.h"
 
 #include <rte_common.h>
 
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
-#include "nfp_nsp.h"
 #include "nfp_platform.h"
 #include "nfp_resource.h"
 
-int
+/* Offsets relative to the CSR base */
+#define NSP_STATUS              0x00
+#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
+#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
+#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
+#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
+#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
+#define   NSP_STATUS_BUSY       RTE_BIT64(0)
+
+#define NSP_COMMAND             0x08
+#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
+#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
+#define   NSP_COMMAND_DMA_BUF   RTE_BIT64(1)
+#define   NSP_COMMAND_START     RTE_BIT64(0)
+
+/* CPP address to retrieve the data from */
+#define NSP_BUFFER              0x10
+#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
+#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER         0x18
+#define   NSP_DFLT_BUFFER_CPP          GENMASK_ULL(63, 40)
+#define   NSP_DFLT_BUFFER_ADDRESS      GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER_CONFIG  0x20
+#define   NSP_DFLT_BUFFER_SIZE_4KB     GENMASK_ULL(15, 8)
+#define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
+
+#define NSP_MAGIC               0xab10
+#define NSP_MAJOR               0
+#define NSP_MINOR               8
+
+#define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
+#define NSP_CODE_MINOR          GENMASK_ULL(11, 0)
+
+#define NFP_FW_LOAD_RET_MAJOR   GENMASK_ULL(15, 8)
+#define NFP_FW_LOAD_RET_MINOR   GENMASK_ULL(23, 16)
+
+enum nfp_nsp_cmd {
+	SPCODE_NOOP             = 0, /* No operation */
+	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
+	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
+	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
+	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
+	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
+	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
+	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
+	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
+	SPCODE_NSP_WRITE_FLASH  = 11, /* Load and flash image from buffer */
+	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
+	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
+	SPCODE_FW_STORED        = 16, /* If no FW loaded, load flash app FW */
+	SPCODE_HWINFO_LOOKUP    = 17, /* Lookup HWinfo with overwrites etc. */
+	SPCODE_HWINFO_SET       = 18, /* Set HWinfo entry */
+	SPCODE_FW_LOADED        = 19, /* Is application firmware loaded */
+	SPCODE_VERSIONS         = 21, /* Report FW versions */
+	SPCODE_READ_SFF_EEPROM  = 22, /* Read module EEPROM */
+	SPCODE_READ_MEDIA       = 23, /* Get the supported/advertised media for a port */
+};
+
+static const struct {
+	uint32_t code;
+	const char *msg;
+} nsp_errors[] = {
+	{ 6010, "could not map to phy for port" },
+	{ 6011, "not an allowed rate/lanes for port" },
+	{ 6012, "not an allowed rate/lanes for port" },
+	{ 6013, "high/low error, change other port first" },
+	{ 6014, "config not found in flash" },
+};
+
+struct nfp_nsp {
+	struct nfp_cpp *cpp;
+	struct nfp_resource *res;
+	struct {
+		uint16_t major;
+		uint16_t minor;
+	} ver;
+
+	/** Eth table config state */
+	bool modified;
+	uint32_t idx;
+	void *entries;
+};
+
+/* NFP command argument structure */
+struct nfp_nsp_command_arg {
+	uint16_t code;         /**< NFP SP Command Code */
+	bool dma;              /**< @buf points to a host buffer, not NSP buffer */
+	bool error_quiet;      /**< Don't print command error/warning */
+	uint32_t timeout_sec;  /**< Timeout value to wait for completion in seconds */
+	uint32_t option;       /**< NSP Command Argument */
+	uint64_t buf;          /**< NSP Buffer Address */
+	/** Callback for interpreting option if error occurred */
+	void (*error_cb)(struct nfp_nsp *state, uint32_t ret_val);
+};
+
+/* NFP command with buffer argument structure */
+struct nfp_nsp_command_buf_arg {
+	struct nfp_nsp_command_arg arg;  /**< NFP command argument structure */
+	const void *in_buf;              /**< Buffer with data for input */
+	void *out_buf;                   /**< Buffer for output data */
+	uint32_t in_size;                /**< Size of @in_buf */
+	uint32_t out_size;               /**< Size of @out_buf */
+};
+
+struct nfp_cpp *
+nfp_nsp_cpp(struct nfp_nsp *state)
+{
+	return state->cpp;
+}
+
+bool
 nfp_nsp_config_modified(struct nfp_nsp *state)
 {
 	return state->modified;
@@ -24,7 +131,7 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 
 void
 nfp_nsp_config_set_modified(struct nfp_nsp *state,
-		int modified)
+		bool modified)
 {
 	state->modified = modified;
 }
@@ -66,7 +173,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 		return;
 
 	for (i = 0; i < RTE_DIM(nsp_errors); i++)
-		if (ret_val == (uint32_t)nsp_errors[i].code)
+		if (ret_val == nsp_errors[i].code)
 			PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg);
 }
 
@@ -222,11 +329,8 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
  *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state,
-		uint16_t code,
-		uint32_t option,
-		uint32_t buff_cpp,
-		uint64_t buff_addr)
+nfp_nsp_command_real(struct nfp_nsp *state,
+		const struct nfp_nsp_command_arg *arg)
 {
 	int err;
 	uint64_t reg;
@@ -250,22 +354,14 @@ nfp_nsp_command(struct nfp_nsp *state,
 		return err;
 	}
 
-	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
-		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-				buff_cpp, buff_addr);
-		return -EINVAL;
-	}
-
-	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer, arg->buf);
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+			FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
+			FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
 			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
@@ -275,7 +371,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -284,7 +380,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -296,84 +392,85 @@ nfp_nsp_command(struct nfp_nsp *state,
 
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-				-err, (int)ret_val, code);
-		nfp_nsp_print_extended_error(ret_val);
+		if (!arg->error_quiet)
+			PMD_DRV_LOG(WARNING, "Result (error) code set: %d (%d) command: %d",
+					-err, (int)ret_val, arg->code);
+
+		if (arg->error_cb != 0)
+			arg->error_cb(state, ret_val);
+		else
+			nfp_nsp_print_extended_error(ret_val);
+
 		return -err;
 	}
 
 	return ret_val;
 }
 
-#define SZ_1M 0x00100000
+static int
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code)
+{
+	const struct nfp_nsp_command_arg arg = {
+		.code = code,
+	};
+
+	return nfp_nsp_command_real(state, &arg);
+}
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp,
-		uint16_t code, uint32_t option,
-		const void *in_buf,
-		unsigned int in_size,
-		void *out_buf,
-		unsigned int out_size)
+nfp_nsp_command_buf_def(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
 {
 	int err;
 	int ret;
 	uint64_t reg;
-	size_t max_size;
 	uint32_t cpp_id;
 	uint64_t cpp_buf;
 	struct nfp_cpp *cpp = nsp->cpp;
 
-	if (nsp->ver.minor < 13) {
-		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-				code, nsp->ver.major, nsp->ver.minor);
-		return -EOPNOTSUPP;
-	}
-
-	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
-			&reg);
-	if (err < 0)
-		return err;
-
-	max_size = RTE_MAX(in_size, out_size);
-	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
-		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %lu)",
-				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
-		return -EINVAL;
-	}
-
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
 			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
 			&reg);
 	if (err < 0)
 		return err;
 
-	cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8;
-	cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg);
+	cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
+	cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
 
-	if (in_buf != NULL && in_size > 0) {
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
+	if (arg->in_buf != NULL && arg->in_size > 0) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf,
+				arg->in_buf, arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
 	/* Zero out remaining part of the buffer */
-	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
-		memset(out_buf, 0, out_size - in_size);
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				out_size - in_size);
+	if (arg->out_buf != NULL && arg->out_size > arg->in_size) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + arg->in_size,
+				arg->out_buf, arg->out_size - arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
-	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
+	if (!FIELD_FIT(NSP_BUFFER_CPP, cpp_id >> 8) ||
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, cpp_buf)) {
+		PMD_DRV_LOG(ERR, "Buffer out of reach %#08x %#016lx",
+				cpp_id, cpp_buf);
+		return -EINVAL;
+	}
+
+	arg->arg.buf = FIELD_PREP(NSP_BUFFER_CPP, cpp_id >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, cpp_buf);
+	ret = nfp_nsp_command_real(nsp, &arg->arg);
 	if (ret < 0) {
 		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
 	}
 
-	if (out_buf != NULL && out_size > 0) {
-		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
+	if (arg->out_buf != NULL && arg->out_size > 0) {
+		err = nfp_cpp_read(cpp, cpp_id, cpp_buf,
+				arg->out_buf, arg->out_size);
 		if (err < 0)
 			return err;
 	}
@@ -381,6 +478,43 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	return ret;
 }
 
+#define SZ_1M 0x00100000
+#define SZ_4K 0x00001000
+
+static int
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
+{
+	int err;
+	uint64_t reg;
+	uint32_t size;
+	uint32_t max_size;
+	struct nfp_cpp *cpp = nsp->cpp;
+
+	if (nsp->ver.minor < 13) {
+		PMD_DRV_LOG(ERR, "NSP: Code %#04x with buffer not supported ABI %hu.%hu)",
+				arg->arg.code, nsp->ver.major, nsp->ver.minor);
+		return -EOPNOTSUPP;
+	}
+
+	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
+	if (err < 0)
+		return err;
+
+	max_size = RTE_MAX(arg->in_size, arg->out_size);
+	size = FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M +
+			FIELD_GET(NSP_DFLT_BUFFER_SIZE_4KB, reg) * SZ_4K;
+	if (size < max_size) {
+		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command %#04x (%u < %u)",
+				arg->arg.code, size, max_size);
+		return -EINVAL;
+	}
+
+	return nfp_nsp_command_buf_def(nsp, arg);
+}
+
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
@@ -392,7 +526,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
-		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
+		err = nfp_nsp_command(state, SPCODE_NOOP);
 		if (err != -EAGAIN)
 			break;
 
@@ -413,13 +547,57 @@ nfp_nsp_wait(struct nfp_nsp *state)
 int
 nfp_nsp_device_soft_reset(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_SOFT_RESET, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_SOFT_RESET);
 }
 
 int
 nfp_nsp_mac_reinit(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_MAC_INIT, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_MAC_INIT);
+}
+
+static void
+nfp_nsp_load_fw_extended_msg(struct nfp_nsp *state,
+		uint32_t ret_val)
+{
+	uint32_t minor;
+	uint32_t major;
+	static const char * const major_msg[] = {
+		/* 0 */ "Firmware from driver loaded",
+		/* 1 */ "Firmware from flash loaded",
+		/* 2 */ "Firmware loading failure",
+	};
+	static const char * const minor_msg[] = {
+		/*  0 */ "",
+		/*  1 */ "no named partition on flash",
+		/*  2 */ "error reading from flash",
+		/*  3 */ "can not deflate",
+		/*  4 */ "not a trusted file",
+		/*  5 */ "can not parse FW file",
+		/*  6 */ "MIP not found in FW file",
+		/*  7 */ "null firmware name in MIP",
+		/*  8 */ "FW version none",
+		/*  9 */ "FW build number none",
+		/* 10 */ "no FW selection policy HWInfo key found",
+		/* 11 */ "static FW selection policy",
+		/* 12 */ "FW version has precedence",
+		/* 13 */ "different FW application load requested",
+		/* 14 */ "development build",
+	};
+
+	major = FIELD_GET(NFP_FW_LOAD_RET_MAJOR, ret_val);
+	minor = FIELD_GET(NFP_FW_LOAD_RET_MINOR, ret_val);
+
+	if (!nfp_nsp_has_stored_fw_load(state))
+		return;
+
+	if (major >= RTE_DIM(major_msg))
+		PMD_DRV_LOG(INFO, "FW loading status: %x", ret_val);
+	else if (minor >= RTE_DIM(minor_msg))
+		PMD_DRV_LOG(INFO, "%s, reason code: %d", major_msg[major], minor);
+	else
+		PMD_DRV_LOG(INFO, "%s%c %s", major_msg[major],
+				minor != 0 ? ',' : '.', minor_msg[minor]);
 }
 
 int
@@ -427,8 +605,24 @@ nfp_nsp_load_fw(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-			NULL, 0);
+	int ret;
+	struct nfp_nsp_command_buf_arg load_fw = {
+		{
+			.code     = SPCODE_FW_LOAD,
+			.option   = size,
+			.error_cb = nfp_nsp_load_fw_extended_msg,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	ret = nfp_nsp_command_buf(state, &load_fw);
+	if (ret < 0)
+		return ret;
+
+	nfp_nsp_load_fw_extended_msg(state, ret);
+
+	return 0;
 }
 
 int
@@ -436,8 +630,16 @@ nfp_nsp_read_eth_table(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg eth_rescan = {
+		{
+			.code   = SPCODE_ETH_RESCAN,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_rescan);
 }
 
 int
@@ -445,8 +647,16 @@ nfp_nsp_write_eth_table(struct nfp_nsp *state,
 		const void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-			NULL, 0);
+	struct nfp_nsp_command_buf_arg eth_ctrl = {
+		{
+			.code   = SPCODE_ETH_CONTROL,
+			.option = size,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_ctrl);
 }
 
 int
@@ -454,8 +664,16 @@ nfp_nsp_read_identify(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg identify = {
+		{
+			.code   = SPCODE_NSP_IDENTIFY,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &identify);
 }
 
 int
@@ -464,6 +682,14 @@ nfp_nsp_read_sensors(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-			0, buf, size);
+	struct nfp_nsp_command_buf_arg sensors = {
+		{
+			.code   = SPCODE_NSP_SENSORS,
+			.option = sensor_mask,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &sensors);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 14986a9130..fe52dffeb7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -7,78 +7,8 @@
 #define __NSP_NSP_H__
 
 #include "nfp_cpp.h"
-#include "nfp_nsp.h"
-
-/* Offsets relative to the CSR base */
-#define NSP_STATUS              0x00
-#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
-#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
-#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
-#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
-#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
-#define   NSP_STATUS_BUSY       RTE_BIT64(0)
-
-#define NSP_COMMAND             0x08
-#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
-#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
-#define   NSP_COMMAND_START     RTE_BIT64(0)
-
-/* CPP address to retrieve the data from */
-#define NSP_BUFFER              0x10
-#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
-#define   NSP_BUFFER_PCIE       GENMASK_ULL(39, 38)
-#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(37, 0)
-
-#define NSP_DFLT_BUFFER         0x18
-
-#define NSP_DFLT_BUFFER_CONFIG 0x20
-#define   NSP_DFLT_BUFFER_SIZE_MB    GENMASK_ULL(7, 0)
-
-#define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
-#define NSP_MINOR               8
-
-#define NSP_CODE_MAJOR          GENMASK(15, 12)
-#define NSP_CODE_MINOR          GENMASK(11, 0)
-
-enum nfp_nsp_cmd {
-	SPCODE_NOOP             = 0, /* No operation */
-	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
-	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
-	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
-	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
-	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
-	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
-	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
-	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
-	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
-	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
-};
-
-static const struct {
-	int code;
-	const char *msg;
-} nsp_errors[] = {
-	{ 6010, "could not map to phy for port" },
-	{ 6011, "not an allowed rate/lanes for port" },
-	{ 6012, "not an allowed rate/lanes for port" },
-	{ 6013, "high/low error, change other port first" },
-	{ 6014, "config not found in flash" },
-};
 
-struct nfp_nsp {
-	struct nfp_cpp *cpp;
-	struct nfp_resource *res;
-	struct {
-		uint16_t major;
-		uint16_t minor;
-	} ver;
-
-	/* Eth table config state */
-	int modified;
-	unsigned int idx;
-	void *entries;
-};
+struct nfp_nsp;
 
 struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp);
 void nfp_nsp_close(struct nfp_nsp *state);
@@ -92,18 +22,61 @@ int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, size_t size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, uint32_t sensor_mask,
 		void *buf, size_t size);
 
-static inline int
+static inline bool
 nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
 
+static inline bool
+nfp_nsp_has_stored_fw_load(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 23;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_lookup(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 24;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_set(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_fw_loaded(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_versions(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 27;
+}
+
+static inline bool
+nfp_nsp_has_read_module_eeprom(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 28;
+}
+
+static inline bool
+nfp_nsp_has_read_media(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 33;
+}
+
 enum nfp_eth_interface {
 	NFP_INTERFACE_NONE      = 0,
 	NFP_INTERFACE_SFP       = 1,
 	NFP_INTERFACE_SFPP      = 10,
 	NFP_INTERFACE_SFP28     = 28,
 	NFP_INTERFACE_QSFP      = 40,
+	NFP_INTERFACE_RJ45      = 45,
 	NFP_INTERFACE_CXP       = 100,
 	NFP_INTERFACE_QSFP28    = 112,
 };
@@ -151,6 +124,7 @@ struct nfp_eth_table {
 		enum nfp_eth_media media; /**< Media type of the @interface */
 
 		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_fec act_fec; /**< Active Forward Error Correction mode */
 		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
 		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
@@ -159,17 +133,18 @@ struct nfp_eth_table {
 		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;     /**< Enable port */
-		int tx_enabled;  /**< Enable TX */
-		int rx_enabled;  /**< Enable RX */
+		bool enabled;     /**< Enable port */
+		bool tx_enabled;  /**< Enable TX */
+		bool rx_enabled;  /**< Enable RX */
+		bool supp_aneg;   /**< Support auto negotiation */
 
-		int override_changed;  /**< Media reconfig pending */
+		bool override_changed;  /**< Media reconfig pending */
 
 		uint8_t port_type;    /**< One of %PORT_* */
 		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;   /**< Split port */
+		bool is_split;   /**< Split port */
 
 		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
 	} ports[]; /**< Table of ports */
@@ -177,8 +152,8 @@ struct nfp_eth_table {
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
-int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, int enable);
-int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, int configed);
+int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, bool enable);
+int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, bool configured);
 int nfp_eth_set_fec(struct nfp_cpp *cpp, uint32_t idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, size_t size);
@@ -187,12 +162,13 @@ int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
 		uint32_t idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
-void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
+void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
-int nfp_nsp_config_modified(struct nfp_nsp *state);
+struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
+bool nfp_nsp_config_modified(struct nfp_nsp *state);
 uint32_t nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int
+static inline bool
 nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return eth_port->fec_modes_supported != 0;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 429f639fa2..86956f4330 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -3,12 +3,8 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
-#include "nfp_nffw.h"
 
 struct nsp_identify {
 	uint8_t version[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index dd17d0f5f6..90ecdaaa52 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -3,10 +3,6 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
 #include "nfp_platform.h"
@@ -21,6 +17,7 @@
 #define NSP_ETH_PORT_PHYLABEL           GENMASK_ULL(59, 54)
 #define NSP_ETH_PORT_FEC_SUPP_BASER     RTE_BIT64(60)
 #define NSP_ETH_PORT_FEC_SUPP_RS        RTE_BIT64(61)
+#define NSP_ETH_PORT_SUPP_ANEG          RTE_BIT64(63)
 
 #define NSP_ETH_PORT_LANES_MASK         rte_cpu_to_le_64(NSP_ETH_PORT_LANES)
 
@@ -34,6 +31,7 @@
 #define NSP_ETH_STATE_OVRD_CHNG         RTE_BIT64(22)
 #define NSP_ETH_STATE_ANEG              GENMASK_ULL(25, 23)
 #define NSP_ETH_STATE_FEC               GENMASK_ULL(27, 26)
+#define NSP_ETH_STATE_ACT_FEC           GENMASK_ULL(29, 28)
 
 #define NSP_ETH_CTRL_CONFIGURED         RTE_BIT64(0)
 #define NSP_ETH_CTRL_ENABLED            RTE_BIT64(1)
@@ -54,26 +52,12 @@
 #define PORT_NONE               0xef
 #define PORT_OTHER              0xff
 
-#define SPEED_10                10
-#define SPEED_100               100
-#define SPEED_1000              1000
-#define SPEED_2500              2500
-#define SPEED_5000              5000
-#define SPEED_10000             10000
-#define SPEED_14000             14000
-#define SPEED_20000             20000
-#define SPEED_25000             25000
-#define SPEED_40000             40000
-#define SPEED_50000             50000
-#define SPEED_56000             56000
-#define SPEED_100000            100000
-
 enum nfp_eth_raw {
 	NSP_ETH_RAW_PORT = 0,
 	NSP_ETH_RAW_STATE,
 	NSP_ETH_RAW_MAC,
 	NSP_ETH_RAW_CONTROL,
-	NSP_ETH_NUM_RAW
+	NSP_ETH_NUM_RAW,
 };
 
 enum nfp_eth_rate {
@@ -100,12 +84,12 @@ static const struct {
 	enum nfp_eth_rate rate;
 	uint32_t speed;
 } nsp_eth_rate_tbl[] = {
-	{ RATE_INVALID, 0, },
-	{ RATE_10M,     SPEED_10, },
-	{ RATE_100M,    SPEED_100, },
-	{ RATE_1G,      SPEED_1000, },
-	{ RATE_10G,     SPEED_10000, },
-	{ RATE_25G,     SPEED_25000, },
+	{ RATE_INVALID, RTE_ETH_SPEED_NUM_NONE, },
+	{ RATE_10M,     RTE_ETH_SPEED_NUM_10M, },
+	{ RATE_100M,    RTE_ETH_SPEED_NUM_100M, },
+	{ RATE_1G,      RTE_ETH_SPEED_NUM_1G, },
+	{ RATE_10G,     RTE_ETH_SPEED_NUM_10G, },
+	{ RATE_25G,     RTE_ETH_SPEED_NUM_25G, },
 };
 
 static uint32_t
@@ -193,7 +177,14 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 	if (dst->fec_modes_supported != 0)
 		dst->fec_modes_supported |= NFP_FEC_AUTO | NFP_FEC_DISABLED;
 
-	dst->fec = 1 << FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->fec = FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->act_fec = dst->fec;
+
+	if (nfp_nsp_get_abi_ver_minor(nsp) < 33)
+		return;
+
+	dst->act_fec = FIELD_GET(NSP_ETH_STATE_ACT_FEC, state);
+	dst->supp_aneg = FIELD_GET(NSP_ETH_PORT_SUPP_ANEG, port);
 }
 
 static void
@@ -222,7 +213,7 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 						table->ports[i].label_port,
 						table->ports[i].label_subport);
 
-			table->ports[i].is_split = 1;
+			table->ports[i].is_split = true;
 		}
 	}
 }
@@ -233,6 +224,9 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 	if (entry->interface == NFP_INTERFACE_NONE) {
 		entry->port_type = PORT_NONE;
 		return;
+	} else if (entry->interface == NFP_INTERFACE_RJ45) {
+		entry->port_type = PORT_TP;
+		return;
 	}
 
 	if (entry->media == NFP_MEDIA_FIBRE)
@@ -251,7 +245,6 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	uint32_t table_sz;
 	struct nfp_eth_table *table;
 	union eth_table_entry *entries;
-	const struct rte_ether_addr *mac;
 
 	entries = rte_zmalloc(NULL, NSP_ETH_TABLE_SIZE, 0);
 	if (entries == NULL)
@@ -263,16 +256,9 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/*
-	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
-	 * the rest 6 ports mac are all 0, ensure we don't use these port
-	 */
-	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
+	for (i = 0; i < NSP_ETH_MAX_COUNT; i++)
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
 			cnt++;
-	}
 
 	/*
 	 * Some versions of flash will give us 0 instead of port count. For
@@ -292,11 +278,8 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 
 	table->count = cnt;
 	for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
-			nfp_eth_port_translate(nsp, &entries[i], i,
-					&table->ports[j++]);
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
+			nfp_eth_port_translate(nsp, &entries[i], i, &table->ports[j++]);
 	}
 
 	nfp_eth_calc_port_geometry(table);
@@ -437,7 +420,7 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int enable)
+		bool enable)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -445,7 +428,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
-		return -1;
+		return -EIO;
 
 	entries = nfp_nsp_config_entries(nsp);
 
@@ -457,7 +440,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_ENABLED, enable);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -481,7 +464,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int configured)
+		bool configured)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -510,7 +493,7 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -548,7 +531,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	entries[idx].control |= rte_cpu_to_le_64(ctrl_bit);
 
-	nfp_nsp_config_set_modified(nsp, 1);
+	nfp_nsp_config_set_modified(nsp, true);
 
 	return 0;
 }
-- 
2.39.1


^ permalink raw reply	[relevance 5%]

* [PATCH v3 07/27] net/nfp: standard the comment style
    2023-09-15  9:15  1%     ` [PATCH v3 02/27] net/nfp: unify the indent coding style Chaoyong He
  2023-09-15  9:15  3%     ` [PATCH v3 05/27] net/nfp: standard the local variable " Chaoyong He
@ 2023-09-15  9:15  1%     ` Chaoyong He
  2023-09-15  9:15  5%     ` [PATCH v3 19/27] net/nfp: refact the nsp module Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-15  9:15 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, Niklas Söderlund

Follow the DPDK coding style, use the kdoc comment style.
Also add some comment to help understand logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          | 504 ++++-----------------
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  39 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 484 ++++++++++++++++----
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  21 +-
 drivers/net/nfp/nfpcore/nfp_hwinfo.h       |   2 +
 drivers/net/nfp/nfpcore/nfp_mip.c          |  43 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  69 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  49 +-
 drivers/net/nfp/nfpcore/nfp_nffw.h         |   6 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          |  53 ++-
 drivers/net/nfp/nfpcore/nfp_nsp.h          | 108 ++---
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 170 ++++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 103 +++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |  28 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  59 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  12 +-
 drivers/net/nfp/nfpcore/nfp_target.c       |   2 +-
 17 files changed, 888 insertions(+), 864 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 139752f85a..82189e9910 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -10,9 +10,7 @@
 
 struct nfp_cpp_mutex;
 
-/*
- * NFP CPP handle
- */
+/* NFP CPP handle */
 struct nfp_cpp {
 	uint32_t model;
 	uint32_t interface;
@@ -37,9 +35,7 @@ struct nfp_cpp {
 	int driver_lock_needed;
 };
 
-/*
- * NFP CPP device area handle
- */
+/* NFP CPP device area handle */
 struct nfp_cpp_area {
 	struct nfp_cpp *cpp;
 	char *name;
@@ -127,35 +123,45 @@ struct nfp_cpp_operations {
 
 #define NFP_CPP_TARGET_ID_MASK 0x1f
 
-/*
+/**
  * Pack target, token, and action into a CPP ID.
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
  *
- * @return      NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ID(target, action, token)                               \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
 		(((action) & 0xff) << 8))
 
-/*
+/**
  * Pack target, token, action, and island into a CPP ID.
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
- * @island      NFP CPP island id
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @return      NFP CPP ID
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
+ * @param island
+ *   NFP CPP island id
+ *
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ISLAND_ID(target, action, token, island)                \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
@@ -163,9 +169,12 @@ struct nfp_cpp_operations {
 
 /**
  * Return the NFP CPP target of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP target
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP target
  */
 static inline uint8_t
 NFP_CPP_ID_TARGET_of(uint32_t id)
@@ -173,11 +182,14 @@ NFP_CPP_ID_TARGET_of(uint32_t id)
 	return (id >> 24) & NFP_CPP_TARGET_ID_MASK;
 }
 
-/*
+/**
  * Return the NFP CPP token of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP token
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP token
  */
 static inline uint8_t
 NFP_CPP_ID_TOKEN_of(uint32_t id)
@@ -185,11 +197,14 @@ NFP_CPP_ID_TOKEN_of(uint32_t id)
 	return (id >> 16) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP action of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP action
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP action
  */
 static inline uint8_t
 NFP_CPP_ID_ACTION_of(uint32_t id)
@@ -197,11 +212,14 @@ NFP_CPP_ID_ACTION_of(uint32_t id)
 	return (id >> 8) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP island of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP island
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP island
  */
 static inline uint8_t
 NFP_CPP_ID_ISLAND_of(uint32_t id)
@@ -215,109 +233,57 @@ NFP_CPP_ID_ISLAND_of(uint32_t id)
  */
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
 
-/*
- * Set the model id
- *
- * @param   cpp     NFP CPP operations structure
- * @param   model   Model ID
- */
 void nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   interface Interface ID
- */
 void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   serial  NFP serial byte array
- * @param   len     Length of the serial byte array
- */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
 		size_t serial_len);
 
-/*
- * Set the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv);
 
-/*
- * Return the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void *nfp_cpp_priv(struct nfp_cpp *cpp);
 
-/*
- * Get the privately allocated portion of a NFP CPP area handle
- *
- * @param   cpp_area    NFP CPP area handle
- * @return          Pointer to the private area, or NULL on failure
- */
 void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
 
 uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
 
-/*
- * NFP CPP core interface for CPP clients.
- */
-
-/*
- * Open a NFP CPP handle to a CPP device
- *
- * @param[in]	id	0-based ID for the CPP interface to use
- *
- * @return NFP CPP handle, or NULL on failure.
- */
+/* NFP CPP core interface for CPP clients */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed);
 
-/*
- * Free a NFP CPP handle
- *
- * @param[in]	cpp	NFP CPP handle
- */
 void nfp_cpp_free(struct nfp_cpp *cpp);
 
 #define NFP_CPP_MODEL_INVALID   0xffffffff
 
-/*
- * NFP_CPP_MODEL_CHIP_of - retrieve the chip ID from the model ID
+/**
+ * Retrieve the chip ID from the model ID
  *
  * The chip ID is a 16-bit BCD+A-F encoding for the chip type.
  *
- * @param[in]   model   NFP CPP model id
- * @return      NFP CPP chip id
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   NFP CPP chip id
  */
 #define NFP_CPP_MODEL_CHIP_of(model)        (((model) >> 16) & 0xffff)
 
-/*
- * NFP_CPP_MODEL_IS_6000 - Check for the NFP6000 family of devices
+/**
+ * Check for the NFP6000 family of devices
  *
  * NOTE: The NFP4000 series is considered as a NFP6000 series variant.
  *
- * @param[in]	model	NFP CPP model id
- * @return		true if model is in the NFP6000 family, false otherwise.
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   true if model is in the NFP6000 family, false otherwise.
  */
 #define NFP_CPP_MODEL_IS_6000(model)		     \
 		((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \
 		(NFP_CPP_MODEL_CHIP_of(model) < 0x7000))
 
-/*
- * nfp_cpp_model - Retrieve the Model ID of the NFP
- *
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Model ID
- */
 uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 
 /*
@@ -330,7 +296,7 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 #define NFP_CPP_INTERFACE_TYPE_RPC		0x3
 #define NFP_CPP_INTERFACE_TYPE_ILA		0x4
 
-/*
+/**
  * Construct a 16-bit NFP Interface ID
  *
  * Interface IDs consists of 4 bits of interface type, 4 bits of unit
@@ -340,422 +306,138 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
  * which use the MU Atomic CompareAndWrite operation - hence the limit to 16
  * bits to be able to use the NFP Interface ID as a lock owner.
  *
- * @param[in]	type	NFP Interface Type
- * @param[in]	unit	Unit identifier for the interface type
- * @param[in]	channel	Channel identifier for the interface unit
- * @return		Interface ID
+ * @param type
+ *   NFP Interface Type
+ * @param unit
+ *   Unit identifier for the interface type
+ * @param channel
+ *   Channel identifier for the interface unit
+ *
+ * @return
+ *   Interface ID
  */
 #define NFP_CPP_INTERFACE(type, unit, channel)	\
 	((((type) & 0xf) << 12) | \
 	 (((unit) & 0xf) <<  8) | \
 	 (((channel) & 0xff) << 0))
 
-/*
+/**
  * Get the interface type of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's type
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's type
  */
 #define NFP_CPP_INTERFACE_TYPE_of(interface)	(((interface) >> 12) & 0xf)
 
-/*
+/**
  * Get the interface unit of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's unit
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's unit
  */
 #define NFP_CPP_INTERFACE_UNIT_of(interface)	(((interface) >>  8) & 0xf)
 
-/*
+/**
  * Get the interface channel of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's channel
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's channel
  */
 #define NFP_CPP_INTERFACE_CHANNEL_of(interface)	(((interface) >>  0) & 0xff)
 
-/*
- * Retrieve the Interface ID of the NFP
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Interface ID
- */
+
 uint16_t nfp_cpp_interface(struct nfp_cpp *cpp);
 
-/*
- * Retrieve the NFP Serial Number (unique per NFP)
- * @param[in]	cpp	NFP CPP handle
- * @param[out]	serial	Pointer to reference the serial number array
- *
- * @return	size of the NFP6000 serial number, in bytes
- */
 int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, size_t size);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	name	Name of owner of the area
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint32_t cpp_id, const char *name, uint64_t address,
 		uint32_t size);
 
-/*
- * Free an allocated NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_free(struct nfp_cpp_area *area);
 
-/*
- * Acquire the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- *
- * @return 0 on success, -1 on failure.
- */
 int nfp_cpp_area_acquire(struct nfp_cpp_area *area);
 
-/*
- * Release the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release(struct nfp_cpp_area *area);
 
-/*
- * Allocate, then acquire the resources needed to access the NFP CPP area handle
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 		uint32_t cpp_id, uint64_t address, size_t size);
 
-/*
- * Release the resources, then free the NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t addr, uint32_t size, struct nfp_cpp_area **area);
 
-/*
- * Read from a NFP CPP area handle into a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer to receive the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes read on success, negative value on failure.
- *
- */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset,
 		void *buffer, size_t length);
 
-/*
- * Write to a NFP CPP area handle from a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer that holds the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes written on success, negative value on failure.
- */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset,
 		const void *buffer, size_t length);
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
- * @area:       CPP area handle
- *
- * Returns an iomem pointer for use with readl()/writel() style operations.
- *
- * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
- */
 void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
 
-/*
- * Get the NFP CPP handle that is the parent of a NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			NFP CPP handle
- */
 struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
 
-/*
- * Get the name passed during allocation of the NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			Pointer to the area's name
- */
 const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
 
-/*
- * Read a block of data from a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy read data to
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes read on success, -1 on failure.
- */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, void *kernel_vaddr, size_t length);
 
-/*
- * Write a block of data to a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy write data from
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes written on success, -1 on failure.
- */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, const void *kernel_vaddr, size_t length);
 
-/*
- * Read a single 32-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t *value);
 
-/*
- * Write a single 32-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t value);
 
-/*
- * Read a single 64-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t *value);
 
-/*
- * Write a single 64-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t value);
 
-/*
- * Write a single 32-bit value on the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t value);
 
-/*
- * Read a single 32-bit value from the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
 
-/*
- * Read a 32-bit word from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t *value);
 
-/*
- * Write a 32-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- *
- */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t value);
 
-/*
- * Read a 64-bit work from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t *value);
 
-/*
- * Write a 64-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t value);
 
-/*
- * Initialize a mutex location
-
- * The CPP target:address must point to a 64-bit aligned location, and will
- * initialize 64 bits of data at the location.
- *
- * This creates the initial mutex state, as locked by this nfp_cpp_interface().
- *
- * This function should only be called when setting up the initial lock state
- * upon boot-up of the system.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	Unique 32-bit value for this mutex
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Create a mutex handle from an address controlled by a MU Atomic engine
- *
- * The CPP target:address must point to a 64-bit aligned location, and reserve
- * 64 bits of data at the location for use by the handle.
- *
- * Only target/address pairs that point to entities that support the MU Atomic
- * Engine's CmpAndSwap32 command are supported.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	32-bit unique key (must match the key at this location)
- *
- * @return		A non-NULL struct nfp_cpp_mutex * on success, NULL on
- *                      failure.
- */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Free a mutex handle - does not alter the lock state
- *
- * @param mutex		NFP CPP Mutex handle
- */
 void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
 
-/*
- * Lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Unlock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- * @return		0 if the lock succeeded, negative value on failure.
- */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
 uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index bdf4a658f5..7e94bfb611 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -58,7 +58,7 @@
  * Minimal size of the PCIe cfg memory we depend on being mapped,
  * queue controller and DMA controller don't have to be covered.
  */
-#define NFP_PCI_MIN_MAP_SIZE				0x080000
+#define NFP_PCI_MIN_MAP_SIZE				0x080000        /* 512K */
 
 #define NFP_PCIE_P2C_FIXED_SIZE(bar)               (1 << (bar)->bitsize)
 #define NFP_PCIE_P2C_BULK_SIZE(bar)                (1 << (bar)->bitsize)
@@ -72,40 +72,25 @@
 #define NFP_PCIE_CPP_BAR_PCIETOCPPEXPBAR(bar, slot) \
 	(((bar) * 8 + (slot)) * 4)
 
-/*
- * Define to enable a bit more verbose debug output.
- * Set to 1 to enable a bit more verbose debug output.
- */
 struct nfp_pcie_user;
 struct nfp6000_area_priv;
 
-/*
- * struct nfp_bar - describes BAR configuration and usage
- * @nfp:	backlink to owner
- * @barcfg:	cached contents of BAR config CSR
- * @base:	the BAR's base CPP offset
- * @mask:       mask for the BAR aperture (read only)
- * @bitsize:	bitsize of BAR aperture (read only)
- * @index:	index of the BAR
- * @lock:	lock to specify if bar is in use
- * @refcnt:	number of current users
- * @iomem:	mapped IO memory
- */
+/* Describes BAR configuration and usage */
 #define NFP_BAR_MIN 1
 #define NFP_BAR_MID 5
 #define NFP_BAR_MAX 7
 
 struct nfp_bar {
-	struct nfp_pcie_user *nfp;
-	uint32_t barcfg;
-	uint64_t base;		/* CPP address base */
-	uint64_t mask;		/* Bit mask of the bar */
-	uint32_t bitsize;	/* Bit size of the bar */
-	uint32_t index;
-	int lock;
+	struct nfp_pcie_user *nfp;    /**< Backlink to owner */
+	uint32_t barcfg;     /**< BAR config CSR */
+	uint64_t base;       /**< Base CPP offset */
+	uint64_t mask;       /**< Mask of the BAR aperture (read only) */
+	uint32_t bitsize;    /**< Bit size of the BAR aperture (read only) */
+	uint32_t index;      /**< Index of the BAR */
+	int lock;            /**< If the BAR has been locked */
 
 	char *csr;
-	char *iomem;
+	char *iomem;         /**< mapped IO memory */
 };
 
 #define BUSDEV_SZ	13
@@ -360,9 +345,7 @@ nfp_disable_bars(struct nfp_pcie_user *nfp)
 	}
 }
 
-/*
- * Generic CPP bus access interface.
- */
+/* Generic CPP bus access interface. */
 
 struct nfp6000_area_priv {
 	struct nfp_bar *bar;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index e2af888a28..0e8372576e 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -26,6 +26,15 @@
 #define NFP_PL_DEVICE_MODEL_MASK               (NFP_PL_DEVICE_PART_MASK | \
 						NFP_PL_DEVICE_ID_MASK)
 
+/**
+ * Set the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void
 nfp_cpp_priv_set(struct nfp_cpp *cpp,
 		void *priv)
@@ -33,12 +42,29 @@ nfp_cpp_priv_set(struct nfp_cpp *cpp,
 	cpp->priv = priv;
 }
 
+/**
+ * Return the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void *
 nfp_cpp_priv(struct nfp_cpp *cpp)
 {
 	return cpp->priv;
 }
 
+/**
+ * Set the model id
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param model
+ *   Model ID
+ */
 void
 nfp_cpp_model_set(struct nfp_cpp *cpp,
 		uint32_t model)
@@ -46,6 +72,15 @@ nfp_cpp_model_set(struct nfp_cpp *cpp,
 	cpp->model = model;
 }
 
+/**
+ * Retrieve the Model ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Model ID
+ */
 uint32_t
 nfp_cpp_model(struct nfp_cpp *cpp)
 {
@@ -63,6 +98,14 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 	return model;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param interface
+ *   Interface ID
+ */
 void
 nfp_cpp_interface_set(struct nfp_cpp *cpp,
 		uint32_t interface)
@@ -70,6 +113,17 @@ nfp_cpp_interface_set(struct nfp_cpp *cpp,
 	cpp->interface = interface;
 }
 
+/**
+ * Retrieve the Serial ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param serial
+ *   Pointer to NFP serial number
+ *
+ * @return
+ *   Length of NFP serial number
+ */
 int
 nfp_cpp_serial(struct nfp_cpp *cpp,
 		const uint8_t **serial)
@@ -78,6 +132,16 @@ nfp_cpp_serial(struct nfp_cpp *cpp,
 	return cpp->serial_len;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param serial
+ *   NFP serial byte array
+ * @param serial_len
+ *   Length of the serial byte array
+ */
 int
 nfp_cpp_serial_set(struct nfp_cpp *cpp,
 		const uint8_t *serial,
@@ -96,6 +160,15 @@ nfp_cpp_serial_set(struct nfp_cpp *cpp,
 	return 0;
 }
 
+/**
+ * Retrieve the Interface ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Interface ID
+ */
 uint16_t
 nfp_cpp_interface(struct nfp_cpp *cpp)
 {
@@ -105,18 +178,45 @@ nfp_cpp_interface(struct nfp_cpp *cpp)
 	return cpp->interface;
 }
 
+/**
+ * Get the privately allocated portion of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the private area, or NULL on failure
+ */
 void *
 nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area)
 {
 	return &cpp_area[1];
 }
 
+/**
+ * Get the NFP CPP handle that is the pci_dev of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   NFP CPP handle
+ */
 struct nfp_cpp *
 nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area)
 {
 	return cpp_area->cpp;
 }
 
+/**
+ * Get the name passed during allocation of the NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the area's name
+ */
 const char *
 nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 {
@@ -153,15 +253,24 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
 	return cpp->mu_locality_lsb;
 }
 
-/*
- * nfp_cpp_area_alloc - allocate a new CPP area
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area in bytes
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
  *
- * Allocate and initialize a CPP area structure.  The area must later
- * be locked down with an 'acquire' before it can be safely accessed.
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param name
+ *   Name of region
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
  *
  * NOTE: @address and @size must be 32-bit aligned values.
  */
@@ -211,6 +320,25 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 	return area;
 }
 
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
+ * NOTE: @address and @size must be 32-bit aligned values.
+ */
 struct nfp_cpp_area *
 nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 		uint32_t dest,
@@ -220,17 +348,22 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
 
-/*
- * nfp_cpp_area_alloc_acquire - allocate a new CPP area and lock it down
- *
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area
- *
+/**
  * Allocate and initialize a CPP area structure, and lock it down so
  * that it can be accessed directly.
  *
+ * @param cpp
+ *   CPP device handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
  * NOTE: @address and @size must be 32-bit aligned values.
  *
  * NOTE: The area must also be 'released' when the structure is freed.
@@ -258,11 +391,11 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	return area;
 }
 
-/*
- * nfp_cpp_area_free - free up the CPP area
- * area:    CPP area handle
- *
+/**
  * Frees up memory resources held by the CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_free(struct nfp_cpp_area *area)
@@ -272,11 +405,11 @@ nfp_cpp_area_free(struct nfp_cpp_area *area)
 	free(area);
 }
 
-/*
- * nfp_cpp_area_release_free - release CPP area and free it
- * area:    CPP area handle
+/**
+ * Releases CPP area and frees up memory resources held by it.
  *
- * Releases CPP area and frees up memory resources held by the it.
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release_free(struct nfp_cpp_area *area)
@@ -285,12 +418,15 @@ nfp_cpp_area_release_free(struct nfp_cpp_area *area)
 	nfp_cpp_area_free(area);
 }
 
-/*
- * nfp_cpp_area_acquire - lock down a CPP area for access
- * @area:   CPP area handle
+/**
+ * Locks down the CPP area for a potential long term activity.
+ * Area must always be locked down before being accessed.
  *
- * Locks down the CPP area for a potential long term activity.  Area
- * must always be locked down before being accessed.
+ * @param area
+ *   CPP area handle
+ *
+ * @return
+ *   0 on success, -1 on failure.
  */
 int
 nfp_cpp_area_acquire(struct nfp_cpp_area *area)
@@ -307,11 +443,11 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	return 0;
 }
 
-/*
- * nfp_cpp_area_release - release a locked down CPP area
- * @area:   CPP area handle
- *
+/**
  * Releases a previously locked down CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release(struct nfp_cpp_area *area)
@@ -320,16 +456,16 @@ nfp_cpp_area_release(struct nfp_cpp_area *area)
 		area->cpp->op->area_release(area);
 }
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
+/**
+ * Returns an iomem pointer for use with readl()/writel() style operations.
  *
- * @area:       CPP area handle
+ * @param area
+ *   CPP area handle
  *
- * Returns an iomem pointer for use with readl()/writel() style operations.
+ * @return
+ *   Pointer to the area, or NULL
  *
  * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
  */
 void *
 nfp_cpp_area_iomem(struct nfp_cpp_area *area)
@@ -342,18 +478,22 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
 	return iomem;
 }
 
-/*
- * nfp_cpp_area_read - read data from CPP area
+/**
+ * Read data from indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to put data into
- * @length:     number of bytes to read
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Read data from indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -368,18 +508,22 @@ nfp_cpp_area_read(struct nfp_cpp_area *area,
 	return area->cpp->op->area_read(area, kernel_vaddr, offset, length);
 }
 
-/*
- * nfp_cpp_area_write - write data to CPP area
+/**
+ * Write data to indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to read data from
- * @length:     number of bytes to write
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Write data to indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -436,6 +580,19 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 	return xpb;
 }
 
+/**
+ * Read a uint32_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readl(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -450,6 +607,19 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writel(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -462,6 +632,19 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -476,6 +659,19 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -489,6 +685,21 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint32_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readl(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -504,6 +715,21 @@ nfp_cpp_readl(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writel(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -518,6 +744,21 @@ nfp_cpp_writel(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -533,6 +774,21 @@ nfp_cpp_readq(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writeq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -547,6 +803,19 @@ nfp_cpp_writeq(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t word to a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_writel(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -559,6 +828,19 @@ nfp_xpb_writel(struct nfp_cpp *cpp,
 	return nfp_cpp_writel(cpp, cpp_dest, xpb_addr, value);
 }
 
+/**
+ * Read a uint32_t value from a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_readl(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -625,9 +907,11 @@ nfp_cpp_alloc(struct rte_pci_device *dev,
 	return cpp;
 }
 
-/*
- * nfp_cpp_free - free the CPP handle
- * @cpp:    CPP handle
+/**
+ * Free the CPP handle
+ *
+ * @param cpp
+ *   CPP handle
  */
 void
 nfp_cpp_free(struct nfp_cpp *cpp)
@@ -641,6 +925,19 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 	free(cpp);
 }
 
+/**
+ * Create a NFP CPP handle from device
+ *
+ * @param dev
+ *   PCI device
+ * @param driver_lock_needed
+ *   Driver lock flag
+ *
+ * @return
+ *   NFP CPP handle on success, NULL on failure
+ *
+ * NOTE: On failure, cpp_ops->free will be called!
+ */
 struct nfp_cpp *
 nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed)
@@ -648,13 +945,22 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev,
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
 
-/*
- * nfp_cpp_read - read from CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer for result
- * @length:     number of bytes to read
+/**
+ * Read from CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer for result
+ * @param length
+ *   Number of bytes to read
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_read(struct nfp_cpp *cpp,
@@ -678,13 +984,22 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_cpp_write - write to CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer to read from
- * @length:     number of bytes to write
+/**
+ * Write to CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer to read from
+ * @param length
+ *   Number of bytes to write
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_write(struct nfp_cpp *cpp,
@@ -731,18 +1046,23 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
- * nfp_cpp_map_area() - Helper function to map an area
- * @cpp:    NFP CPP handler
- * @cpp_id: CPP ID
- * @addr:   CPP address
- * @size:   Size of the area
- * @area:   Area handle (output)
+/**
+ * Map an area of IOMEM access.
+ * To undo the effect of this function call @nfp_cpp_area_release_free(*area).
  *
- * Map an area of IOMEM access.  To undo the effect of this function call
- * @nfp_cpp_area_release_free(*area).
+ * @param cpp
+ *   NFP CPP handler
+ * @param cpp_id
+ *   CPP id
+ * @param addr
+ *   CPP address
+ * @param size
+ *   Size of the area
+ * @param area
+ *   Area handle (output)
  *
- * Return: Pointer to memory mapped area or NULL
+ * @return
+ *   Pointer to memory mapped area or NULL
  */
 uint8_t *
 nfp_cpp_map_area(struct nfp_cpp *cpp,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index b658b5e900..f5579ab60f 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -3,7 +3,8 @@
  * All rights reserved.
  */
 
-/* Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
+/*
+ * Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
  * after chip reset.
  *
  * Examples of the fields:
@@ -146,7 +147,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *db;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 10000000;
+	wait.tv_nsec = 10000000;    /* 10ms */
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -154,7 +155,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 			return db;
 
 		nanosleep(&wait, NULL);
-		if (count++ > 200) {
+		if (count++ > 200) {    /* 10ms * 200 = 2s */
 			PMD_DRV_LOG(ERR, "NFP access error");
 			return NULL;
 		}
@@ -180,12 +181,16 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
 	return db;
 }
 
-/*
- * nfp_hwinfo_lookup() - Find a value in the HWInfo table by name
- * @hwinfo:	NFP HWinfo table
- * @lookup:	HWInfo name to search for
+/**
+ * Find a value in the HWInfo table by name
+ *
+ * @param hwinfo
+ *   NFP HWInfo table
+ * @param lookup
+ *   HWInfo name to search for
  *
- * Return: Value of the HWInfo name, or NULL
+ * @return
+ *   Value of the HWInfo name, or NULL
  */
 const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
index a3da7512db..424db8035d 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
@@ -59,6 +59,8 @@
  * Packed UTF8Z strings, ie 'key1\000value1\000key2\000value2\000'
  *
  * Unsorted.
+ *
+ * Note: Only the HwInfo v2 Table be supported now.
  */
 
 #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 086e82db70..0892c99e96 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -87,15 +87,16 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_mip_open() - Get device MIP structure
- * @cpp:	NFP CPP Handle
- *
- * Copy MIP structure from NFP device and return it.  The returned
+/**
+ * Copy MIP structure from NFP device and return it. The returned
  * structure is handled internally by the library and should be
- * freed by calling nfp_mip_close().
+ * freed by calling @nfp_mip_close().
+ *
+ * @param cpp
+ *   NFP CPP Handle
  *
- * Return: pointer to mip, NULL on failure.
+ * @return
+ *   Pointer to MIP, NULL on failure.
  */
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
@@ -131,11 +132,15 @@ nfp_mip_name(const struct nfp_mip *mip)
 	return mip->name;
 }
 
-/*
- * nfp_mip_symtab() - Get the address and size of the MIP symbol table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol table
- * @size:	Location for size of MIP symbol table
+/**
+ * Get the address and size of the MIP symbol table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol table
+ * @param size
+ *   Location for size of MIP symbol table
  */
 void
 nfp_mip_symtab(const struct nfp_mip *mip,
@@ -146,11 +151,15 @@ nfp_mip_symtab(const struct nfp_mip *mip,
 	*size = rte_le_to_cpu_32(mip->symtab_size);
 }
 
-/*
- * nfp_mip_strtab() - Get the address and size of the MIP symbol name table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol name table
- * @size:	Location for size of MIP symbol name table
+/**
+ * Get the address and size of the MIP symbol name table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol name table
+ * @param size
+ *   Location for size of MIP symbol name table
  */
 void
 nfp_mip_strtab(const struct nfp_mip *mip,
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 82919d8270..404d4fa938 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -53,7 +53,7 @@ _nfp_cpp_mutex_validate(uint32_t model,
 	return 0;
 }
 
-/*
+/**
  * Initialize a mutex location
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -65,13 +65,17 @@ _nfp_cpp_mutex_validate(uint32_t model,
  * This function should only be called when setting up
  * the initial lock state upon boot-up of the system.
  *
- * @param mutex     NFP CPP Mutex handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       Unique 32-bit value for this mutex
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   Unique 32-bit value for this mutex
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_init(struct nfp_cpp *cpp,
@@ -99,7 +103,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
+/**
  * Create a mutex handle from an address controlled by a MU Atomic engine
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -108,13 +112,17 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
  * Only target/address pairs that point to entities that support the
  * MU Atomic Engine are supported.
  *
- * @param cpp       NFP CPP handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       32-bit unique key (must match the key at this location)
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   32-bit unique key (must match the key at this location)
  *
- * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
+ * @return
+ *   A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
 nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
@@ -178,10 +186,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	return mutex;
 }
 
-/*
+/**
  * Free a mutex handle - does not alter the lock state
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  */
 void
 nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
@@ -203,12 +212,14 @@ nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
 	free(mutex);
 }
 
-/*
+/**
  * Lock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure.
  */
 int
 nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
@@ -229,12 +240,14 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 	return 0;
 }
 
-/*
+/**
  * Unlock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
@@ -280,16 +293,18 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 	return err;
 }
 
-/*
+/**
  * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
  *
  * Valid lock states:
- *
  *      0x....0000      - Unlocked
  *      0x....000f      - Locked
  *
- * @param mutex     NFP CPP Mutex handle
- * @return      0 if the lock succeeded, negative value on failure.
+ * @param mutex
+ *   NFP CPP Mutex handle
+ *
+ * @return
+ *   0 if the lock succeeded, negative value on failure.
  */
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
@@ -352,7 +367,7 @@ nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 		 * If there was another contending for this lock, then
 		 * the lock state would be 0x....000f
 		 *
-		 * Write our owner ID into the lock
+		 * Write our owner ID into the lock.
 		 * While not strictly necessary, this helps with
 		 * debug and bookkeeping.
 		 */
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index b5a354137d..5f004e3b21 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -52,7 +52,7 @@ nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi)
 	return (fi->loaded__mu_da__mip_off_hi >> 8) & 1;
 }
 
-/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 8) | mip_offset_lo */
+/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */
 static uint64_t
 nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 {
@@ -112,11 +112,14 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 	}
 }
 
-/*
- * nfp_nffw_info_open() - Acquire the lock on the NFFW table
- * @cpp:	NFP CPP handle
+/**
+ * Acquire the lock on the NFFW table
+ *
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: nffw info pointer, or NULL on failure
+ * @return
+ *   NFFW info pointer, or NULL on failure
  */
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
@@ -168,11 +171,11 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_close() - Release the lock on the NFFW table
- * @state:	NFP FW info state
+/**
+ * Release the lock on the NFFW table
  *
- * Return: void
+ * @param state
+ *   NFFW info pointer
  */
 void
 nfp_nffw_info_close(struct nfp_nffw_info *state)
@@ -181,11 +184,14 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 	free(state);
 }
 
-/*
- * nfp_nffw_info_fwid_first() - Return the first firmware ID in the NFFW
- * @state:	NFP FW info state
+/**
+ * Return the first firmware ID in the NFFW
  *
- * Return: First NFFW firmware info, NULL on failure
+ * @param state
+ *   NFFW info pointer
+ *
+ * @return:
+ *   First NFFW firmware info, NULL on failure
  */
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
@@ -205,13 +211,18 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_mip_first() - Retrieve the location of the first FW's MIP
- * @state:	NFP FW info state
- * @cpp_id:	Pointer to the CPP ID of the MIP
- * @off:	Pointer to the CPP Address of the MIP
+/**
+ * Retrieve the location of the first FW's MIP
+ *
+ * @param state
+ *   NFFW info pointer
+ * @param cpp_id
+ *   Pointer to the CPP ID of the MIP
+ * @param off
+ *   Pointer to the CPP Address of the MIP
  *
- * Return: 0, or -ERRNO
+ * @return
+ *   0, or -ERRNO
  */
 int
 nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h
index 46ac8a8d07..e032b6cce7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.h
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.h
@@ -8,7 +8,8 @@
 
 #include "nfp_cpp.h"
 
-/* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
+/*
+ * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
  * Lower IDs are reserved for target and loader IDs.
  */
 #define NFFW_FWID_EXT   3 /* For active MEs that we didn't load. */
@@ -16,7 +17,7 @@
 
 #define NFFW_FWID_ALL   255
 
-/**
+/*
  * NFFW_INFO_VERSION history:
  * 0: This was never actually used (before versioning), but it refers to
  *    the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
@@ -35,6 +36,7 @@
 #define NFFW_MEINFO_CNT_V2 200
 #define NFFW_FWINFO_CNT_V2 200
 
+/* nfp.nffw meinfo */
 struct nffw_meinfo {
 	uint32_t ctxmask__fwid__meid;
 };
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 76d418d478..039e4729bd 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -109,9 +109,11 @@ nfp_nsp_check(struct nfp_nsp *state)
 	return 0;
 }
 
-/*
- * nfp_nsp_open() - Prepare for communication and lock the NSP resource.
- * @cpp:	NFP CPP Handle
+/**
+ * Prepare for communication and lock the NSP resource.
+ *
+ * @param cpp
+ *   NFP CPP Handle
  */
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
@@ -145,9 +147,11 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	return state;
 }
 
-/*
- * nfp_nsp_close() - Clean up and unlock the NSP resource.
- * @state:	NFP SP state
+/**
+ * Clean up and unlock the NSP resource.
+ *
+ * @param state
+ *   NFP SP state
  */
 void
 nfp_nsp_close(struct nfp_nsp *state)
@@ -181,7 +185,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;     /* 25ms */
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -194,28 +198,27 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 			return 0;
 
 		nanosleep(&wait, 0);
-		if (count++ > 1000)
+		if (count++ > 1000)     /* 25ms * 1000 = 25s */
 			return -ETIMEDOUT;
 	}
 }
 
-/*
- * nfp_nsp_command() - Execute a command on the NFP Service Processor
- * @state:	NFP SP state
- * @code:	NFP SP Command Code
- * @option:	NFP SP Command Argument
- * @buff_cpp:	NFP SP Buffer CPP Address info
- * @buff_addr:	NFP SP Buffer Host address
- *
- * Return: 0 for success with no result
+/**
+ * Execute a command on the NFP Service Processor
  *
- *	 positive value for NSP completion with a result code
+ * @param state
+ *   NFP SP state
+ * @param arg
+ *   NFP command argument structure
  *
- *	-EAGAIN if the NSP is not yet present
- *	-ENODEV if the NSP is not a supported model
- *	-EBUSY if the NSP is stuck
- *	-EINTR if interrupted while waiting for completion
- *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
+ * @return
+ *   - 0 for success with no result
+ *   - Positive value for NSP completion with a result code
+ *   - -EAGAIN if the NSP is not yet present
+ *   - -ENODEV if the NSP is not a supported model
+ *   - -EBUSY if the NSP is stuck
+ *   - -EINTR if interrupted while waiting for completion
+ *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
 nfp_nsp_command(struct nfp_nsp *state,
@@ -383,7 +386,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
@@ -392,7 +395,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 
 		nanosleep(&wait, 0);
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 25ms * 1000 = 25s */
 			err = -ETIMEDOUT;
 			break;
 		}
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index edb56e26ca..0fcb21e99c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -158,72 +158,45 @@ enum nfp_eth_fec {
 #define NFP_FEC_REED_SOLOMON	RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT)
 #define NFP_FEC_DISABLED	RTE_BIT32(NFP_FEC_DISABLED_BIT)
 
-/**
- * struct nfp_eth_table - ETH table information
- * @count:	number of table entries
- * @max_index:	max of @index fields of all @ports
- * @ports:	table of ports
- *
- * @eth_index:	port index according to legacy ethX numbering
- * @index:	chip-wide first channel index
- * @nbi:	NBI index
- * @base:	first channel index (within NBI)
- * @lanes:	number of channels
- * @speed:	interface speed (in Mbps)
- * @interface:	interface (module) plugged in
- * @media:	media type of the @interface
- * @fec:	forward error correction mode
- * @aneg:	auto negotiation mode
- * @mac_addr:	interface MAC address
- * @label_port:	port id
- * @label_subport:  id of interface within port (for split ports)
- * @enabled:	is enabled?
- * @tx_enabled:	is TX enabled?
- * @rx_enabled:	is RX enabled?
- * @override_changed: is media reconfig pending?
- *
- * @port_type:	one of %PORT_* defines for ethtool
- * @port_lanes:	total number of lanes on the port (sum of lanes of all subports)
- * @is_split:	is interface part of a split port
- * @fec_modes_supported:	bitmap of FEC modes supported
- */
+/* ETH table information */
 struct nfp_eth_table {
-	uint32_t count;
-	uint32_t max_index;
+	uint32_t count;     /**< Number of table entries */
+	uint32_t max_index; /**< Max of @index fields of all @ports */
 	struct nfp_eth_table_port {
+		/** Port index according to legacy ethX numbering */
 		uint32_t eth_index;
-		uint32_t index;
-		uint32_t nbi;
-		uint32_t base;
-		uint32_t lanes;
-		uint32_t speed;
+		uint32_t index;  /**< Chip-wide first channel index */
+		uint32_t nbi;    /**< NBI index */
+		uint32_t base;   /**< First channel index (within NBI) */
+		uint32_t lanes;  /**< Number of channels */
+		uint32_t speed;  /**< Interface speed (in Mbps) */
 
-		uint32_t interface;
-		enum nfp_eth_media media;
+		uint32_t interface;  /**< Interface (module) plugged in */
+		enum nfp_eth_media media; /**< Media type of the @interface */
 
-		enum nfp_eth_fec fec;
-		enum nfp_eth_aneg aneg;
+		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
-		struct rte_ether_addr mac_addr;
+		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
 
-		uint8_t label_port;
+		uint8_t label_port;    /**< Port id */
+		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;
-		int tx_enabled;
-		int rx_enabled;
-
-		int override_changed;
+		int enabled;     /**< Enable port */
+		int tx_enabled;  /**< Enable TX */
+		int rx_enabled;  /**< Enable RX */
 
-		/* Computed fields */
-		uint8_t port_type;
+		int override_changed;  /**< Media reconfig pending */
 
+		uint8_t port_type;    /**< One of %PORT_* */
+		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;
+		int is_split;   /**< Split port */
 
-		uint32_t fec_modes_supported;
-	} ports[];
+		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
+	} ports[]; /**< Table of ports */
 };
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
@@ -263,28 +236,17 @@ int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode);
 int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed);
 int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes);
 
-/**
- * struct nfp_nsp_identify - NSP static information
- * @version:      opaque version string
- * @flags:        version flags
- * @br_primary:   branch id of primary bootloader
- * @br_secondary: branch id of secondary bootloader
- * @br_nsp:       branch id of NSP
- * @primary:      version of primary bootloader
- * @secondary:    version id of secondary bootloader
- * @nsp:          version id of NSP
- * @sensor_mask:  mask of present sensors available on NIC
- */
+/* NSP static information */
 struct nfp_nsp_identify {
-	char version[40];
-	uint8_t flags;
-	uint8_t br_primary;
-	uint8_t br_secondary;
-	uint8_t br_nsp;
-	uint16_t primary;
-	uint16_t secondary;
-	uint16_t nsp;
-	uint64_t sensor_mask;
+	char version[40];      /**< Opaque version string */
+	uint8_t flags;         /**< Version flags */
+	uint8_t br_primary;    /**< Branch id of primary bootloader */
+	uint8_t br_secondary;  /**< Branch id of secondary bootloader */
+	uint8_t br_nsp;        /**< Branch id of NSP */
+	uint16_t primary;      /**< Version of primary bootloader */
+	uint16_t secondary;    /**< Version id of secondary bootloader */
+	uint16_t nsp;          /**< Version id of NSP */
+	uint64_t sensor_mask;  /**< Mask of present sensors available on NIC */
 };
 
 struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 74daa92aed..cb090d2a47 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -264,7 +264,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/* The NFP3800 NIC support 8 ports, but only 2 ports are valid,
+	/*
+	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
 	 * the rest 6 ports mac are all 0, ensure we don't use these port
 	 */
 	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
@@ -274,7 +275,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 			cnt++;
 	}
 
-	/* Some versions of flash will give us 0 instead of port count. For
+	/*
+	 * Some versions of flash will give us 0 instead of port count. For
 	 * those that give a port count, verify it against the value calculated
 	 * above.
 	 */
@@ -312,14 +314,16 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	return NULL;
 }
 
-/*
- * nfp_eth_read_ports() - retrieve port information
- * @cpp:	NFP CPP handle
+/**
+ * Read the port information from the device.
+ *
+ * Returned structure should be freed once no longer needed.
  *
- * Read the port information from the device.  Returned structure should
- * be freed with kfree() once no longer needed.
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: populated ETH table or NULL on error.
+ * @return
+ *   Populated ETH table or NULL on error.
  */
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
@@ -387,19 +391,19 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 	free(entries);
 }
 
-/*
- * nfp_eth_config_commit_end() - perform recorded configuration changes
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- *
+/**
  * Perform the configuration which was requested with __nfp_eth_set_*()
- * helpers and recorded in @nsp state.  If device was already configured
- * as requested or no __nfp_eth_set_*() operations were made no NSP command
+ * helpers and recorded in @nsp state. If device was already configured
+ * as requested or no __nfp_eth_set_*() operations were made, no NSP command
  * will be performed.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
@@ -417,19 +421,21 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 	return ret;
 }
 
-/*
- * nfp_eth_set_mod_enable() - set PHY module enable control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @enable:	Desired state
- *
+/**
  * Enable or disable PHY module (this usually means setting the TX lanes
  * disable bits).
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param enable
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
@@ -460,18 +466,20 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * nfp_eth_set_configured() - set PHY module configured control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @configed:	Desired state
- *
+/**
  * Set the ifup/ifdown state on the PHY.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param configured
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
@@ -525,7 +533,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
-	 *	 codes were initially not populated correctly.
+	 * codes were initially not populated correctly.
 	 */
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 17) {
 		PMD_DRV_LOG(ERR, "set operations not supported, please update flash");
@@ -555,15 +563,17 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 				val, ctrl_bit);			\
 	}))
 
-/*
- * __nfp_eth_set_aneg() - set PHY autonegotiation control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired autonegotiation mode
- *
+/**
  * Allow/disallow PHY module to advertise/perform autonegotiation.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired autonegotiation mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_aneg(struct nfp_nsp *nsp,
@@ -573,15 +583,17 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
-/*
- * __nfp_eth_set_fec() - set PHY forward error correction control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired fec mode
- *
+/**
  * Set the PHY module forward error correction mode.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired fec mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 static int
 __nfp_eth_set_fec(struct nfp_nsp *nsp,
@@ -591,16 +603,20 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
-/*
- * nfp_eth_set_fec() - set PHY forward error correction control mode
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @mode:	Desired fec mode
+/**
+ * Set PHY forward error correction control mode
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param mode
+ *   Desired fec mode
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_fec(struct nfp_cpp *cpp,
@@ -623,17 +639,19 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * __nfp_eth_set_speed() - set interface speed/rate
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @speed:	Desired speed (per lane)
- *
- * Set lane speed.  Provided @speed value should be subport speed divided
- * by number of lanes this subport is spanning (i.e. 10000 for 40G, 25000 for
- * 50G, etc.)
+/**
+ * Set lane speed.
+ * Provided @speed value should be subport speed divided by number of
+ * lanes this subport is spanning (i.e. 10000 for 40G, 25000 for 50G, etc.)
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param speed
+ *   Desired speed (per lane)
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_speed(struct nfp_nsp *nsp,
@@ -651,15 +669,17 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
-/*
- * __nfp_eth_set_split() - set interface lane split
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @lanes:	Desired lanes per port
- *
+/**
  * Set number of lanes in the port.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param lanes
+ *   Desired lanes per port
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_split(struct nfp_nsp *nsp,
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 363f7d6198..bdebf5c3aa 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -22,32 +22,23 @@
 
 #define NFP_RESOURCE_ENTRY_NAME_SZ	8
 
-/*
- * struct nfp_resource_entry - Resource table entry
- * @owner:		NFP CPP Lock, interface owner
- * @key:		NFP CPP Lock, posix_crc32(name, 8)
- * @region:		Memory region descriptor
- * @name:		ASCII, zero padded name
- * @reserved
- * @cpp_action:		CPP Action
- * @cpp_token:		CPP Token
- * @cpp_target:		CPP Target ID
- * @page_offset:	256-byte page offset into target's CPP address
- * @page_size:		size, in 256-byte pages
- */
+/* Resource table entry */
 struct nfp_resource_entry {
 	struct nfp_resource_entry_mutex {
-		uint32_t owner;
-		uint32_t key;
+		uint32_t owner;  /**< NFP CPP Lock, interface owner */
+		uint32_t key;    /**< NFP CPP Lock, posix_crc32(name, 8) */
 	} mutex;
+	/* Memory region descriptor */
 	struct nfp_resource_entry_region {
+		/** ASCII, zero padded name */
 		uint8_t  name[NFP_RESOURCE_ENTRY_NAME_SZ];
 		uint8_t  reserved[5];
-		uint8_t  cpp_action;
-		uint8_t  cpp_token;
-		uint8_t  cpp_target;
+		uint8_t  cpp_action;  /**< CPP Action */
+		uint8_t  cpp_token;   /**< CPP Token */
+		uint8_t  cpp_target;  /**< CPP Target ID */
+		/** 256-byte page offset into target's CPP address */
 		uint32_t page_offset;
-		uint32_t page_size;
+		uint32_t page_size;   /**< Size, in 256-byte pages */
 	} region;
 };
 
@@ -147,14 +138,18 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_resource_acquire() - Acquire a resource handle
- * @cpp:	NFP CPP handle
- * @name:	Name of the resource
+/**
+ * Acquire a resource handle
+ *
+ * Note: This function locks the acquired resource.
  *
- * NOTE: This function locks the acquired resource
+ * @param cpp
+ *   NFP CPP handle
+ * @param name
+ *   Name of the resource
  *
- * Return: NFP Resource handle, or NULL
+ * @return
+ *   NFP Resource handle, or NULL
  */
 struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
@@ -183,7 +178,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	}
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 1000000;
+	wait.tv_nsec = 1000000;    /* 1ms */
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
@@ -194,7 +189,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 			goto err_free;
 		}
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 1ms * 1000 = 1s */
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
 			err = -EBUSY;
 			goto err_free;
@@ -213,11 +208,13 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_resource_release() - Release a NFP Resource handle
- * @res:	NFP Resource handle
+/**
+ * Release a NFP Resource handle
  *
- * NOTE: This function implicitly unlocks the resource handle
+ * NOTE: This function implicitly unlocks the resource handle.
+ *
+ * @param res
+ *   NFP Resource handle
  */
 void
 nfp_resource_release(struct nfp_resource *res)
@@ -227,11 +224,14 @@ nfp_resource_release(struct nfp_resource *res)
 	free(res);
 }
 
-/*
- * nfp_resource_cpp_id() - Return the cpp_id of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the cpp_id of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 uint32_t
 nfp_resource_cpp_id(const struct nfp_resource *res)
@@ -239,11 +239,14 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
 	return res->cpp_id;
 }
 
-/*
- * nfp_resource_name() - Return the name of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the name of a resource handle
  *
- * Return: const char pointer to the name of the resource
+ * @param res
+ *   NFP Resource handle
+ *
+ * @return
+ *   Const char pointer to the name of the resource
  */
 const char *
 nfp_resource_name(const struct nfp_resource *res)
@@ -251,11 +254,14 @@ nfp_resource_name(const struct nfp_resource *res)
 	return res->name;
 }
 
-/*
- * nfp_resource_address() - Return the address of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the address of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Address of the resource
+ * @return
+ *   Address of the resource
  */
 uint64_t
 nfp_resource_address(const struct nfp_resource *res)
@@ -263,11 +269,14 @@ nfp_resource_address(const struct nfp_resource *res)
 	return res->addr;
 }
 
-/*
- * nfp_resource_size() - Return the size in bytes of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the size in bytes of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Size of the resource in bytes
+ * @return
+ *   Size of the resource in bytes
  */
 uint64_t
 nfp_resource_size(const struct nfp_resource *res)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 009b7359a4..4236950caf 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -8,43 +8,27 @@
 
 #include "nfp_cpp.h"
 
+/* Netronone Flow Firmware Table */
 #define NFP_RESOURCE_NFP_NFFW           "nfp.nffw"
+
+/* NFP Hardware Info Database */
 #define NFP_RESOURCE_NFP_HWINFO         "nfp.info"
+
+/* Service Processor */
 #define NFP_RESOURCE_NSP		"nfp.sp"
 
-/**
- * Opaque handle to a NFP Resource
- */
+/* Opaque handle to a NFP Resource */
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name);
 
-/**
- * Release a NFP Resource, and free the handle
- * @param[in]   res     NFP Resource handle
- */
 void nfp_resource_release(struct nfp_resource *res);
 
-/**
- * Return the CPP ID of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      CPP ID of the NFP Resource
- */
 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
 
-/**
- * Return the name of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Name of the NFP Resource
- */
 const char *nfp_resource_name(const struct nfp_resource *res);
 
-/**
- * Return the target address of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Address of the NFP Resource
- */
 uint64_t nfp_resource_address(const struct nfp_resource *res);
 
 uint64_t nfp_resource_size(const struct nfp_resource *res);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index d15a920752..0e6c0f9fe1 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -162,11 +162,14 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_rtsym_count() - Get the number of RTSYM descriptors
- * @rtbl:	NFP RTsym table
+/**
+ * Get the number of RTSYM descriptors
+ *
+ * @param rtbl
+ *   NFP RTSYM table
  *
- * Return: Number of RTSYM descriptors
+ * @return
+ *   Number of RTSYM descriptors
  */
 int
 nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
@@ -177,12 +180,16 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
 	return rtbl->num;
 }
 
-/*
- * nfp_rtsym_get() - Get the Nth RTSYM descriptor
- * @rtbl:	NFP RTsym table
- * @idx:	Index (0-based) of the RTSYM descriptor
+/**
+ * Get the Nth RTSYM descriptor
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param idx
+ *   Index (0-based) of the RTSYM descriptor
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
@@ -197,12 +204,16 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
 	return &rtbl->symtab[idx];
 }
 
-/*
- * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
+/**
+ * Return the RTSYM descriptor for a symbol name
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
@@ -227,7 +238,8 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_NONE:
 		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
-	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_OBJECT:
+		/* FALLTHROUGH */
 	case NFP_RTSYM_TYPE_FUNCTION:
 		return sym->size;
 	case NFP_RTSYM_TYPE_ABS:
@@ -327,17 +339,22 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
 	return nfp_cpp_readq(cpp, cpp_id, addr, value);
 }
 
-/*
- * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
- * @error:	Pointer to error code (optional)
+/**
+ * Read a simple unsigned scalar value from symbol
  *
  * Lookup a symbol, map, read it and return it's value. Value of the symbol
  * will be interpreted as a simple little-endian unsigned value. Symbol can
  * be 4 or 8 bytes in size.
  *
- * Return: value read, on error sets the error and returns ~0ULL.
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
+ * @param error
+ *   Pointer to error code (optional)
+ *
+ * @return
+ *   Value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index e7295258b3..ff1facbd17 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -31,12 +31,12 @@
  * of "sram" symbols for backward compatibility, which are viewed as global.
  */
 struct nfp_rtsym {
-	const char *name;
-	uint64_t addr;
-	uint64_t size;
-	int type;
-	int target;
-	int domain;
+	const char *name;  /**< Symbol name */
+	uint64_t addr;     /**< Address in the domain/target's address space */
+	uint64_t size;     /**< Size (in bytes) of the symbol */
+	int type;          /**< NFP_RTSYM_TYPE_* of the symbol */
+	int target;        /**< CPP target identifier, or NFP_RTSYM_TARGET_* */
+	int domain;        /**< CPP target domain */
 };
 
 struct nfp_rtsym_table;
diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c
index 611848e233..540b242a43 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/nfp/nfpcore/nfp_target.c
@@ -767,7 +767,7 @@ nfp_encode_basic(uint64_t *addr,
 		/*
 		 * Make sure we compare against isldN values by clearing the
 		 * LSB. This is what the silicon does.
-		 **/
+		 */
 		isld[0] &= ~1;
 		isld[1] &= ~1;
 
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v3 05/27] net/nfp: standard the local variable coding style
    2023-09-15  9:15  1%     ` [PATCH v3 02/27] net/nfp: unify the indent coding style Chaoyong He
@ 2023-09-15  9:15  3%     ` Chaoyong He
  2023-09-15  9:15  1%     ` [PATCH v3 07/27] net/nfp: standard the comment style Chaoyong He
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-15  9:15 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, Niklas Söderlund

There should only declare one local variable in each line, and the local
variable should be arranged from short to long in the function.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 58 ++++++++++++----------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 14 +++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 27 ++++++----
 drivers/net/nfp/nfpcore/nfp_mip.c          |  8 +--
 drivers/net/nfp/nfpcore/nfp_mutex.c        | 25 ++++++----
 drivers/net/nfp/nfpcore/nfp_nffw.c         | 15 +++---
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 40 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |  8 +--
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 39 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_resource.c     | 15 +++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 19 ++++---
 11 files changed, 151 insertions(+), 117 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index ec14ec45dc..78beee07ef 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -140,9 +140,9 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		size_t size,
 		int width)
 {
-	uint32_t bitsize;
-	uint32_t newcfg;
 	uint64_t mask;
+	uint32_t newcfg;
+	uint32_t bitsize;
 
 	if (tgt >= 16)
 		return -EINVAL;
@@ -239,7 +239,8 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 		struct nfp_bar *bar,
 		uint32_t newcfg)
 {
-	int base, slot;
+	int base;
+	int slot;
 
 	base = bar->index >> 3;
 	slot = bar->index & 7;
@@ -268,9 +269,9 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 		size_t size,
 		int width)
 {
-	uint64_t newbase;
-	uint32_t newcfg;
 	int err;
+	uint32_t newcfg;
+	uint64_t newbase;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
 			size, width);
@@ -303,8 +304,10 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 static int
 nfp_enable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -333,8 +336,10 @@ nfp_enable_bars(struct nfp_pcie_user *nfp)
 static struct nfp_bar *
 nfp_alloc_bar(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -356,8 +361,10 @@ nfp_alloc_bar(struct nfp_pcie_user *nfp)
 static void
 nfp_disable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -403,12 +410,13 @@ nfp6000_area_init(struct nfp_cpp_area *area,
 		uint64_t address,
 		size_t size)
 {
-	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
-	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	int pp;
+	int ret = 0;
+	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	uint32_t target = NFP_CPP_ID_TARGET_of(dest);
 	uint32_t action = NFP_CPP_ID_ACTION_of(dest);
-	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
-	int pp, ret = 0;
+	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 
 	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
@@ -493,14 +501,14 @@ nfp6000_area_read(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
+	size_t n;
+	int width;
+	bool is_64;
+	uint32_t *wrptr32 = kernel_vaddr;
 	uint64_t *wrptr64 = kernel_vaddr;
-	const volatile uint64_t *rdptr64;
 	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32 = kernel_vaddr;
 	const volatile uint32_t *rdptr32;
-	int width;
-	size_t n;
-	bool is_64;
+	const volatile uint64_t *rdptr64;
 
 	priv = nfp_cpp_area_priv(area);
 	rdptr64 = (uint64_t *)(priv->iomem + offset);
@@ -563,14 +571,14 @@ nfp6000_area_write(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
-	const uint64_t *rdptr64 = kernel_vaddr;
-	uint64_t *wrptr64;
-	const uint32_t *rdptr32 = kernel_vaddr;
-	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32;
-	int width;
 	size_t n;
+	int width;
 	bool is_64;
+	uint32_t *wrptr32;
+	uint64_t *wrptr64;
+	struct nfp6000_area_priv *priv;
+	const uint32_t *rdptr32 = kernel_vaddr;
+	const uint64_t *rdptr64 = kernel_vaddr;
 
 	priv = nfp_cpp_area_priv(area);
 	wrptr64 = (uint64_t *)(priv->iomem + offset);
@@ -693,10 +701,10 @@ static int
 nfp6000_set_serial(struct rte_pci_device *dev,
 		struct nfp_cpp *cpp)
 {
+	off_t pos;
 	uint16_t tmp;
 	uint8_t serial[6];
 	int serial_len = 6;
-	off_t pos;
 
 	pos = rte_pci_find_ext_capability(dev, RTE_PCI_EXT_CAP_ID_DSN);
 	if (pos <= 0) {
@@ -741,8 +749,8 @@ static int
 nfp6000_set_barsz(struct rte_pci_device *dev,
 		struct nfp_pcie_user *desc)
 {
-	uint64_t tmp;
 	int i = 0;
+	uint64_t tmp;
 
 	tmp = dev->mem_resource[0].len;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 7e7c36eda3..2e5a4e7349 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -172,9 +172,9 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t size)
 {
+	int err;
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
-	int err;
 
 	if (cpp == NULL)
 		return NULL;
@@ -396,8 +396,8 @@ static uint32_t
 nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 		uint32_t *xpb_addr)
 {
-	uint32_t xpb;
 	int island;
+	uint32_t xpb;
 
 	xpb = NFP_CPP_ID(14, NFP_CPP_ACTION_RW, 0);
 
@@ -569,9 +569,9 @@ static struct nfp_cpp *
 nfp_cpp_alloc(struct rte_pci_device *dev,
 		int driver_lock_needed)
 {
-	const struct nfp_cpp_operations *ops;
-	struct nfp_cpp *cpp;
 	int err;
+	struct nfp_cpp *cpp;
+	const struct nfp_cpp_operations *ops;
 
 	ops = nfp_cpp_transport_operations();
 
@@ -657,8 +657,8 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 		void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
@@ -687,8 +687,8 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 		const void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL)
@@ -708,8 +708,8 @@ uint32_t
 __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 		uint32_t *model)
 {
-	uint32_t reg;
 	int err;
+	uint32_t reg;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
 			&reg);
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index ea4c7d6a9e..819761eda0 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -36,7 +36,9 @@ static int
 nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
 		uint32_t size)
 {
-	const char *key, *val, *end = hwinfo->data + size;
+	const char *key;
+	const char *val;
+	const char *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
 			key = val + strlen(val) + 1) {
@@ -58,7 +60,9 @@ static int
 nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 		uint32_t len)
 {
-	uint32_t size, new_crc, *crc;
+	uint32_t *crc;
+	uint32_t size;
+	uint32_t new_crc;
 
 	size = db->size;
 	if (size > len) {
@@ -82,12 +86,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 		size_t *cpp_size)
 {
-	struct nfp_hwinfo *header;
-	void *res;
-	uint64_t cpp_addr;
-	uint32_t cpp_id;
 	int err;
+	void *res;
 	uint8_t *db;
+	uint32_t cpp_id;
+	uint64_t cpp_addr;
+	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
 	if (res) {
@@ -135,13 +139,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 		size_t *hwdb_size)
 {
+	int count = 0;
 	struct timespec wait;
 	struct nfp_hwinfo *db;
-	int count;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 10000000;
-	count = 0;
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -159,9 +162,9 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 struct nfp_hwinfo *
 nfp_hwinfo_read(struct nfp_cpp *cpp)
 {
-	struct nfp_hwinfo *db;
-	size_t hwdb_size = 0;
 	int err;
+	size_t hwdb_size = 0;
+	struct nfp_hwinfo *db;
 
 	db = nfp_hwinfo_fetch(cpp, &hwdb_size);
 	if (db == NULL)
@@ -186,7 +189,9 @@ const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
 		const char *lookup)
 {
-	const char *key, *val, *end;
+	const char *key;
+	const char *val;
+	const char *end;
 
 	if (hwinfo == NULL || lookup == NULL)
 		return NULL;
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 0071d3fc37..1e601313b4 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -68,10 +68,10 @@ static int
 nfp_mip_read_resource(struct nfp_cpp *cpp,
 		struct nfp_mip *mip)
 {
-	struct nfp_nffw_info *nffw_info;
-	uint32_t cpp_id;
-	uint64_t addr;
 	int err;
+	uint64_t addr;
+	uint32_t cpp_id;
+	struct nfp_nffw_info *nffw_info;
 
 	nffw_info = nfp_nffw_info_open(cpp);
 	if (nffw_info == NULL)
@@ -100,8 +100,8 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
 {
-	struct nfp_mip *mip;
 	int err;
+	struct nfp_mip *mip;
 
 	mip = malloc(sizeof(*mip));
 	if (mip == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 4d26e6f052..05e0ff46e5 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -79,9 +79,9 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
+	int err;
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
-	int err;
 
 	err = _nfp_cpp_mutex_validate(model, &target, address);
 	if (err < 0)
@@ -122,11 +122,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
-	uint32_t model = nfp_cpp_model(cpp);
-	struct nfp_cpp_mutex *mutex;
-	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 	int err;
 	uint32_t tmp;
+	struct nfp_cpp_mutex *mutex;
+	uint32_t model = nfp_cpp_model(cpp);
+	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 
 	/* Look for cached mutex */
 	for (mutex = cpp->mutex_cache; mutex; mutex = mutex->next) {
@@ -241,12 +241,13 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 {
-	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
-	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
+	int err;
+	uint32_t key;
+	uint32_t value;
 	struct nfp_cpp *cpp = mutex->cpp;
-	uint32_t key, value;
 	uint16_t interface = nfp_cpp_interface(cpp);
-	int err;
+	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
+	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 
 	if (mutex->depth > 1) {
 		mutex->depth--;
@@ -295,12 +296,14 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 {
+	int err;
+	uint32_t key;
+	uint32_t tmp;
+	uint32_t value;
+	struct nfp_cpp *cpp = mutex->cpp;
 	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
 	uint32_t mus = NFP_CPP_ID(mutex->target, 5, 3);	/* test_set_imm */
-	uint32_t key, value, tmp;
-	struct nfp_cpp *cpp = mutex->cpp;
-	int err;
 
 	if (mutex->depth > 0) {
 		if (mutex->depth == MUTEX_DEPTH_MAX)
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 2412dc0e00..9123fc742a 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -68,9 +68,11 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 static int
 nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 {
-	uint32_t mode, addr40;
-	uint32_t xpbaddr, imbcppat;
 	int err;
+	uint32_t mode;
+	uint32_t addr40;
+	uint32_t xpbaddr;
+	uint32_t imbcppat;
 
 	/* Hardcoded XPB IMB Base, island 0 */
 	xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4;
@@ -118,10 +120,10 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
 {
-	struct nfp_nffw_info_data *fwinf;
-	struct nfp_nffw_info *state;
-	uint32_t info_ver;
 	int err;
+	uint32_t info_ver;
+	struct nfp_nffw_info *state;
+	struct nfp_nffw_info_data *fwinf;
 
 	state = malloc(sizeof(*state));
 	if (state == NULL)
@@ -183,8 +185,9 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 {
+	uint32_t i;
+	uint32_t cnt;
 	struct nffw_fwinfo *fwinfo;
-	uint32_t cnt, i;
 
 	cnt = nffw_res_fwinfos(&state->fwinf, &fwinfo);
 	if (cnt == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 87eed3d951..a00bd5870d 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -72,10 +72,11 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 static int
 nfp_nsp_check(struct nfp_nsp *state)
 {
-	struct nfp_cpp *cpp = state->cpp;
-	uint64_t nsp_status, reg;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t nsp_status;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
@@ -113,9 +114,9 @@ nfp_nsp_check(struct nfp_nsp *state)
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
 {
-	struct nfp_resource *res;
-	struct nfp_nsp *state;
 	int err;
+	struct nfp_nsp *state;
+	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
 	if (res == NULL)
@@ -170,13 +171,12 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 		uint64_t mask,
 		uint64_t val)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	uint32_t count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -217,10 +217,15 @@ nfp_nsp_command(struct nfp_nsp *state,
 		uint32_t buff_cpp,
 		uint64_t buff_addr)
 {
-	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
-	struct nfp_cpp *cpp = state->cpp;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t ret_val;
+	uint64_t nsp_base;
+	uint64_t nsp_buffer;
+	uint64_t nsp_status;
+	uint64_t nsp_command;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_base = nfp_resource_address(state->res);
@@ -296,11 +301,13 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 		void *out_buf,
 		unsigned int out_size)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	int err;
+	int ret;
+	uint64_t reg;
 	size_t max_size;
-	uint64_t reg, cpp_buf;
-	int ret, err;
 	uint32_t cpp_id;
+	uint64_t cpp_buf;
+	struct nfp_cpp *cpp = nsp->cpp;
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
@@ -360,13 +367,12 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	int count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 31677b66e6..3081e22dad 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -26,9 +26,9 @@ struct nsp_identify {
 struct nfp_nsp_identify *
 __nfp_nsp_identify(struct nfp_nsp *nsp)
 {
-	struct nfp_nsp_identify *nspi = NULL;
-	struct nsp_identify *ni;
 	int ret;
+	struct nsp_identify *ni;
+	struct nfp_nsp_identify *nspi = NULL;
 
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 15)
 		return NULL;
@@ -77,9 +77,9 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
 		enum nfp_nsp_sensor_id id,
 		uint32_t *val)
 {
-	struct nfp_sensors s;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	struct nfp_sensors s;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index bc155b44d8..9b7c8aa7f8 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -150,9 +150,10 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 		uint32_t index,
 		struct nfp_eth_table_port *dst)
 {
-	uint32_t rate;
 	uint32_t fec;
-	uint64_t port, state;
+	uint64_t port;
+	uint32_t rate;
+	uint64_t state;
 
 	port = rte_le_to_cpu_64(src->port);
 	state = rte_le_to_cpu_64(src->state);
@@ -200,7 +201,8 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 static void
 nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 {
-	uint32_t i, j;
+	uint32_t i;
+	uint32_t j;
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
@@ -242,12 +244,13 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 static struct nfp_eth_table *
 __nfp_eth_read_ports(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries;
-	struct nfp_eth_table *table;
-	uint32_t table_sz;
+	int ret;
 	uint32_t i;
 	uint32_t j;
-	int ret, cnt = 0;
+	int cnt = 0;
+	uint32_t table_sz;
+	struct nfp_eth_table *table;
+	union eth_table_entry *entries;
 	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
@@ -321,8 +324,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
 {
-	struct nfp_eth_table *ret;
 	struct nfp_nsp *nsp;
+	struct nfp_eth_table *ret;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
@@ -338,9 +341,9 @@ struct nfp_nsp *
 nfp_eth_config_start(struct nfp_cpp *cpp,
 		uint32_t idx)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -401,8 +404,8 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	int ret = 1;
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	if (nfp_nsp_config_modified(nsp)) {
 		ret = nfp_nsp_write_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
@@ -433,9 +436,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int enable)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -475,9 +478,9 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int configed)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -516,9 +519,9 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 		uint32_t val,
 		const uint64_t ctrl_bit)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
-	uint32_t idx = nfp_nsp_config_idx(nsp);
 	uint64_t reg;
+	uint32_t idx = nfp_nsp_config_idx(nsp);
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
@@ -604,8 +607,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 		uint32_t idx,
 		enum nfp_eth_fec mode)
 {
-	struct nfp_nsp *nsp;
 	int err;
+	struct nfp_nsp *nsp;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 9dd4832779..fa92f2762e 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -67,10 +67,12 @@ static int
 nfp_cpp_resource_find(struct nfp_cpp *cpp,
 		struct nfp_resource *res)
 {
-	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
+	int ret;
+	uint32_t i;
+	uint32_t key;
+	uint32_t cpp_id;
 	struct nfp_resource_entry entry;
-	uint32_t cpp_id, key;
-	int ret, i;
+	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 
 	cpp_id = NFP_CPP_ID(NFP_RESOURCE_TBL_TARGET, 3, 0);  /* Atomic read */
 
@@ -152,11 +154,11 @@ struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name)
 {
-	struct nfp_cpp_mutex *dev_mutex;
-	struct nfp_resource *res;
 	int err;
+	uint16_t count = 0;
 	struct timespec wait;
-	uint16_t count;
+	struct nfp_resource *res;
+	struct nfp_cpp_mutex *dev_mutex;
 
 	res = malloc(sizeof(*res));
 	if (res == NULL)
@@ -175,7 +177,6 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 1000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 243d3c9ce5..a34278beca 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -85,8 +85,8 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 struct nfp_rtsym_table *
 nfp_rtsym_table_read(struct nfp_cpp *cpp)
 {
-	struct nfp_rtsym_table *rtbl;
 	struct nfp_mip *mip;
+	struct nfp_rtsym_table *rtbl;
 
 	mip = nfp_mip_open(cpp);
 	rtbl = __nfp_rtsym_table_read(cpp, mip);
@@ -99,13 +99,18 @@ struct nfp_rtsym_table *
 __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 		const struct nfp_mip *mip)
 {
-	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
-	struct nfp_rtsym_entry *rtsymtab;
+	int n;
+	int err;
+	uint32_t size;
+	uint32_t strtab_addr;
+	uint32_t symtab_addr;
+	uint32_t strtab_size;
+	uint32_t symtab_size;
 	struct nfp_rtsym_table *cache;
+	struct nfp_rtsym_entry *rtsymtab;
 	const uint32_t dram =
 		NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) |
 		NFP_ISL_EMEM0;
-	int err, n, size;
 
 	if (mip == NULL)
 		return NULL;
@@ -341,10 +346,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		const char *name,
 		int *error)
 {
-	const struct nfp_rtsym *sym;
-	uint32_t val32;
-	uint64_t val;
 	int err;
+	uint64_t val;
+	uint32_t val32;
+	const struct nfp_rtsym *sym;
 
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-- 
2.39.1


^ permalink raw reply	[relevance 3%]

* [PATCH v3 02/27] net/nfp: unify the indent coding style
  @ 2023-09-15  9:15  1%     ` Chaoyong He
  2023-09-15  9:15  3%     ` [PATCH v3 05/27] net/nfp: standard the local variable " Chaoyong He
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-09-15  9:15 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, Chaoyong He, Niklas Söderlund

Each parameter of function should occupy one line, and indent two TAB
character.
All the statement which span multi line should indent two TAB character.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
 drivers/net/nfp/nfpcore/nfp_crc.c          |  19 ++-
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
 drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
 drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  12 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  72 +++++----
 drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
 17 files changed, 463 insertions(+), 331 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 8f87c09327..54bef3cb6b 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -56,7 +56,8 @@ struct nfp_cpp_operations {
 	size_t area_priv_size;
 
 	/* Instance an NFP CPP */
-	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
+	int (*init)(struct nfp_cpp *cpp,
+			struct rte_pci_device *dev);
 
 	/*
 	 * Free the bus.
@@ -69,9 +70,9 @@ struct nfp_cpp_operations {
 	 * NOTE: This is _not_ serialized
 	 */
 	int (*area_init)(struct nfp_cpp_area *area,
-			 uint32_t dest,
-			 unsigned long long address,
-			 unsigned long size);
+			uint32_t dest,
+			unsigned long long address,
+			unsigned long size);
 	/*
 	 * Clean up a NFP CPP area before it is freed
 	 * NOTE: This is _not_ serialized
@@ -101,17 +102,17 @@ struct nfp_cpp_operations {
 	 * Serialized
 	 */
 	int (*area_read)(struct nfp_cpp_area *area,
-			 void *kernel_vaddr,
-			 unsigned long offset,
-			 unsigned int length);
+			void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 	/*
 	 * Perform a write to a NFP CPP area
 	 * Serialized
 	 */
 	int (*area_write)(struct nfp_cpp_area *area,
-			  const void *kernel_vaddr,
-			  unsigned long offset,
-			  unsigned int length);
+			const void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 };
 
 /*
@@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
  * @param   len     Length of the serial byte array
  */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		       size_t serial_len);
+		size_t serial_len);
 
 /*
  * Set the private data of the nfp_cpp instance
@@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
-					 int driver_lock_needed);
+		int driver_lock_needed);
 
 /*
  * Free a NFP CPP handle
@@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
-					unsigned long long address,
-					unsigned long size);
+		unsigned long long address, unsigned long size);
 
 /*
  * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
@@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
-						  uint32_t cpp_id,
-						  const char *name,
-						  unsigned long long address,
-						  unsigned long size);
+		uint32_t cpp_id, const char *name, unsigned long long address,
+		unsigned long size);
 
 /*
  * Free an allocated NFP CPP area handle
@@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
-						uint32_t cpp_id,
-						unsigned long long address,
-						unsigned long size);
+		uint32_t cpp_id, unsigned long long address, unsigned long size);
 
 /*
  * Release the resources, then free the NFP CPP area handle
@@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
-			   uint64_t addr, unsigned long size,
-			   struct nfp_cpp_area **area);
+		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
 /*
  * Return an IO pointer to the beginning of the NFP CPP area handle. The area
  * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
@@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
  *
  */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		      void *buffer, size_t length);
+		void *buffer, size_t length);
 
 /*
  * Write to a NFP CPP area handle from a buffer. The area must be acquired with
@@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		       const void *buffer, size_t length);
+		const void *buffer, size_t length);
 
 /*
  * nfp_cpp_area_iomem() - get IOMEM region for CPP area
@@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
-			     unsigned long long offset, unsigned long size);
+		unsigned long long offset, unsigned long size);
 
 /*
  * Get the NFP CPP handle that is the parent of a NFP CPP area handle
@@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
  * @return bytes read on success, -1 on failure.
  */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
-		 unsigned long long address, void *kernel_vaddr, size_t length);
+		unsigned long long address, void *kernel_vaddr, size_t length);
 
 /*
  * Write a block of data to a NFP CPP ID
@@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, -1 on failure.
  */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, const void *kernel_vaddr,
-		  size_t length);
+		unsigned long long address, const void *kernel_vaddr,
+		size_t length);
 
 
 
@@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		      uint32_t value, size_t length);
+		uint32_t value, size_t length);
 
 /*
  * Read a single 32-bit value from a NFP CPP area handle
@@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		       uint32_t *value);
+		uint32_t *value);
 
 /*
  * Write a single 32-bit value to a NFP CPP area handle
@@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-			uint32_t value);
+		uint32_t value);
 
 /*
  * Read a single 64-bit value from a NFP CPP area handle
@@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		       uint64_t *value);
+		uint64_t *value);
 
 /*
  * Write a single 64-bit value to a NFP CPP area handle
@@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-			uint64_t value);
+		uint64_t value);
 
 /*
  * Write a single 32-bit value on the XPB bus
@@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
  * @return 0 on success, or -1 on failure.
  */
 int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		    uint32_t value);
+		uint32_t value);
 
 /*
  * Modify bits of a 32-bit value from the XPB bus
@@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, negative value on failure.
  */
 int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		   uint32_t value, int timeout_us);
+		uint32_t value, int timeout_us);
 
 /*
  * Read a 32-bit word from a NFP CPP ID
@@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint32_t *value);
+		unsigned long long address, uint32_t *value);
 
 /*
  * Write a 32-bit value to a NFP CPP ID
@@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
  *
  */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint32_t value);
+		unsigned long long address, uint32_t value);
 
 /*
  * Read a 64-bit work from a NFP CPP ID
@@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint64_t *value);
+		unsigned long long address, uint64_t *value);
 
 /*
  * Write a 64-bit value to a NFP CPP ID
@@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint64_t value);
+		unsigned long long address, uint64_t value);
 
 /*
  * Initialize a mutex location
@@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
-		       unsigned long long address, uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Create a mutex handle from an address controlled by a MU Atomic engine
@@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
  *                      failure.
  */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-					  unsigned long long address,
-					  uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Get the NFP CPP handle the mutex was created with
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 2ee60eefc3..884cc84eaa 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
 #define TARGET_WIDTH_64    8
 
 static int
-nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
-		uint64_t *bar_base, int tgt, int act, int tok,
-		uint64_t offset, size_t size, int width)
+nfp_compute_bar(const struct nfp_bar *bar,
+		uint32_t *bar_config,
+		uint64_t *bar_base,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint32_t bitsize;
 	uint32_t newcfg;
@@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 
 	switch (width) {
 	case 8:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
 		break;
 	case 4:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
 		break;
 	case 0:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
 		break;
 	default:
 		return -EINVAL;
@@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 		/* Fixed CPP mapping with specific action */
 		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
 
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size), act,
-				    (unsigned long long)mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size), act,
+					(unsigned long long)mask);
 			return -EINVAL;
 		}
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-			    bar->index, tgt, act, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + mask));
+				bar->index, tgt, act, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + mask));
 
 		bitsize = 40 - 16;
 	} else {
 		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
 
 		/* Bulk mapping */
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
 
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size),
-				    tgt, tok, (unsigned long long)mask,
-				    (unsigned long long)(offset & mask),
-				    (unsigned long long)(offset + size - 1) & mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size),
+					tgt, tok, (unsigned long long)mask,
+					(unsigned long long)(offset & mask),
+					(unsigned long long)(offset + size - 1) & mask);
 			return -EINVAL;
 		}
 
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-			    bar->index, tgt, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + ~mask));
+				bar->index, tgt, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + ~mask));
 
 		bitsize = 40 - 21;
 	}
 
 	if (bar->bitsize < bitsize) {
 		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-			    tgt, tok, act);
+				tgt, tok, act);
 		return -EINVAL;
 	}
 
@@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 }
 
 static int
-nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
-		  uint32_t newcfg)
+nfp_bar_write(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		uint32_t newcfg)
 {
 	int base, slot;
 
@@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 		return (-ENOMEM);
 
 	bar->csr = nfp->cfg +
-		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
+			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
 
 	*(uint32_t *)(bar->csr) = newcfg;
 
@@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 }
 
 static int
-nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
-		int act, int tok, uint64_t offset, size_t size, int width)
+nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint64_t newbase;
 	uint32_t newcfg;
 	int err;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
-			      size, width);
+			size, width);
 	if (err != 0)
 		return err;
 
@@ -390,8 +398,10 @@ struct nfp6000_area_priv {
 };
 
 static int
-nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
-		  unsigned long long address, unsigned long size)
+nfp6000_area_init(struct nfp_cpp_area *area,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
@@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	int pp, ret = 0;
 
-	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
-				     address);
+	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
 		return pp;
 
@@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->width.write = PULL_WIDTH(pp);
 
 	if (priv->width.read > 0 &&
-	    priv->width.write > 0 && priv->width.read != priv->width.write)
+			priv->width.write > 0 &&
+			priv->width.read != priv->width.write)
 		return -EINVAL;
 
 	if (priv->width.read > 0)
@@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->size = size;
 
 	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
-				  priv->token, priv->offset, priv->size,
-				  priv->width.bar);
+			priv->token, priv->offset, priv->size,
+			priv->width.bar);
 
 	return ret;
 }
@@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
 
 	/* Calculate offset into BAR. */
 	if (nfp_bar_maptype(priv->bar) ==
-	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
+			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
 		priv->bar_offset = priv->offset &
-			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
-		priv->bar_offset +=
-			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
-							   priv->target);
-		priv->bar_offset +=
-		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
+				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
+				priv->target);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
+				priv->token);
 	} else {
 		priv->bar_offset = priv->offset & priv->bar->mask;
 	}
@@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
 }
 
 static int
-nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
-		  unsigned long offset, unsigned int length)
+nfp6000_area_read(struct nfp_cpp_area *area,
+		void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	uint64_t *wrptr64 = kernel_vaddr;
 	const volatile uint64_t *rdptr64;
@@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 
 	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW) {
+			priv->action == NFP_CPP_ACTION_RW) {
 		is_64 = false;
 	}
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 }
 
 static int
-nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
-		   unsigned long offset, unsigned int length)
+nfp6000_area_write(struct nfp_cpp_area *area,
+		const void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	const uint64_t *rdptr64 = kernel_vaddr;
 	uint64_t *wrptr64;
@@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
 
 	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW)
+			priv->action == NFP_CPP_ACTION_RW)
 		is_64 = false;
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_model(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint32_t model;
 
@@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_interface(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t interface;
 
@@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_serial(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t tmp;
 	uint8_t serial[6];
@@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
+nfp6000_set_barsz(struct rte_pci_device *dev,
+		struct nfp_pcie_user *desc)
 {
 	unsigned long tmp;
 	int i = 0;
@@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
+nfp6000_init(struct nfp_cpp *cpp,
+		struct rte_pci_device *dev)
 {
 	int ret = 0;
 	struct nfp_pcie_user *desc;
@@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
 	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
-	    cpp->driver_lock_needed) {
+			cpp->driver_lock_needed) {
 		ret = nfp_acquire_process_lock(desc);
 		if (ret != 0)
 			goto error;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 31338e0047..f764208a9a 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -27,7 +27,8 @@
 						NFP_PL_DEVICE_ID_MASK)
 
 void
-nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
+nfp_cpp_priv_set(struct nfp_cpp *cpp,
+		void *priv)
 {
 	cpp->priv = priv;
 }
@@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
+nfp_cpp_model_set(struct nfp_cpp *cpp,
+		uint32_t model)
 {
 	cpp->model = model;
 }
@@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
+nfp_cpp_interface_set(struct nfp_cpp *cpp,
+		uint32_t interface)
 {
 	cpp->interface = interface;
 }
 
 int
-nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
+nfp_cpp_serial(struct nfp_cpp *cpp,
+		const uint8_t **serial)
 {
 	*serial = cpp->serial;
 	return cpp->serial_len;
 }
 
 int
-nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		   size_t serial_len)
+nfp_cpp_serial_set(struct nfp_cpp *cpp,
+		const uint8_t *serial,
+		size_t serial_len)
 {
 	if (cpp->serial_len)
 		free(cpp->serial);
@@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
  * NOTE: @address and @size must be 32-bit aligned values.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
-			      const char *name, unsigned long long address,
-			      unsigned long size)
+nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
+		uint32_t dest,
+		const char *name,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
@@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 		name = "";
 
 	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
-		      strlen(name) + 1);
+			strlen(name) + 1);
 	if (area == NULL)
 		return NULL;
 
@@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 }
 
 struct nfp_cpp_area *
-nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
-		    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc(struct nfp_cpp *cpp,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
@@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
  * NOTE: The area must also be 'released' when the structure is freed.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
-			    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 
@@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		  void *kernel_vaddr, size_t length)
+nfp_cpp_area_read(struct nfp_cpp_area *area,
+		unsigned long offset,
+		void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		   const void *kernel_vaddr, size_t length)
+nfp_cpp_area_write(struct nfp_cpp_area *area,
+		unsigned long offset,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
  * or negative value on error.
  */
 int
-nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
-			 unsigned long length)
+nfp_cpp_area_check_range(struct nfp_cpp_area *area,
+		unsigned long long offset,
+		unsigned long length)
 {
 	if (((offset + length) > area->size))
 		return -EFAULT;
@@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
  * based upon NFP model.
  */
 static uint32_t
-nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
+nfp_xpb_to_cpp(struct nfp_cpp *cpp,
+		uint32_t *xpb_addr)
 {
 	uint32_t xpb;
 	int island;
@@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 		else
 			/* And only non-ARM interfaces use island id = 1 */
 			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
-			    NFP_CPP_INTERFACE_TYPE_ARM)
+					NFP_CPP_INTERFACE_TYPE_ARM)
 				*xpb_addr |= (1 << 24);
 	} else {
 		(*xpb_addr) |= (1 << 30);
@@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 }
 
 int
-nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		   uint32_t *value)
+nfp_cpp_area_readl(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp = 0;
@@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-		    uint32_t value)
+nfp_cpp_area_writel(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value)
 {
 	int sz;
 
@@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		   uint64_t *value)
+nfp_cpp_area_readq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp = 0;
@@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-		    uint64_t value)
+nfp_cpp_area_writeq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t value)
 {
 	int sz;
 
@@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint32_t *value)
+nfp_cpp_readl(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp;
@@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint32_t value)
+nfp_cpp_writel(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t value)
 {
 	int sz;
 
@@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint64_t *value)
+nfp_cpp_readq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp;
@@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint64_t value)
+nfp_cpp_writeq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t value)
 {
 	int sz;
 
@@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
+nfp_xpb_writel(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t value)
 {
 	uint32_t cpp_dest;
 
@@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
 }
 
 int
-nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
+nfp_xpb_readl(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t *value)
 {
 	uint32_t cpp_dest;
 
@@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
 }
 
 static struct nfp_cpp *
-nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_alloc(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	const struct nfp_cpp_operations *ops;
 	struct nfp_cpp *cpp;
@@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 			/* Hardcoded XPB IMB Base, island 0 */
 			xpbaddr = 0x000a0000 + (tgt * 4);
 			err = nfp_xpb_readl(cpp, xpbaddr,
-				(uint32_t *)&cpp->imb_cat_table[tgt]);
+					(uint32_t *)&cpp->imb_cat_table[tgt]);
 			if (err < 0) {
 				free(cpp);
 				return NULL;
@@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 }
 
 struct nfp_cpp *
-nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_from_device_name(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
@@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
  * @return 0 on success, or -1 on failure.
  */
 int
-nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
+nfp_xpb_writelm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
 		uint32_t value)
 {
 	int err;
@@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, or negative value on failure.
  */
 int
-nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-	       uint32_t value, int timeout_us)
+nfp_xpb_waitlm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
+		uint32_t value,
+		int timeout_us)
 {
 	uint32_t tmp;
 	int err;
@@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @length:     number of bytes to read
  */
 int
-nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
-	     unsigned long long address, void *kernel_vaddr, size_t length)
+nfp_cpp_read(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     number of bytes to write
  */
 int
-nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
-	      unsigned long long address, const void *kernel_vaddr,
-	      size_t length)
+nfp_cpp_write(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     length of area to fill
  */
 int
-nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		  uint32_t value, size_t length)
+nfp_cpp_area_fill(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value,
+		size_t length)
 {
 	int err;
 	size_t i;
@@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value64,
-				       sizeof(value64));
+		err = nfp_cpp_area_write(area, offset + i, &value64,
+				sizeof(value64));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value64))
@@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	if ((i + sizeof(value)) <= length) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
+		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value))
@@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * as those are model-specific
  */
 uint32_t
-__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
+__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
+		uint32_t *model)
 {
 	uint32_t reg;
 	int err;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
-			    &reg);
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 unsigned long size, struct nfp_cpp_area **area)
+nfp_cpp_map_area(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		unsigned long size,
+		struct nfp_cpp_area **area)
 {
 	uint8_t *res;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_crc.c b/drivers/net/nfp/nfpcore/nfp_crc.c
index 20431bf845..2cd8866253 100644
--- a/drivers/net/nfp/nfpcore/nfp_crc.c
+++ b/drivers/net/nfp/nfpcore/nfp_crc.c
@@ -9,27 +9,31 @@
 #include "nfp_crc.h"
 
 static inline uint32_t
-nfp_crc32_be_generic(uint32_t crc, unsigned char const *p, size_t len,
-		 uint32_t polynomial)
+nfp_crc32_be_generic(uint32_t crc,
+		unsigned char const *p,
+		size_t len,
+		uint32_t polynomial)
 {
 	int i;
 	while (len--) {
 		crc ^= *p++ << 24;
 		for (i = 0; i < 8; i++)
-			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial :
-					  0);
+			crc = (crc << 1) ^ ((crc & 0x80000000) ? polynomial : 0);
 	}
 	return crc;
 }
 
 static inline uint32_t
-nfp_crc32_be(uint32_t crc, unsigned char const *p, size_t len)
+nfp_crc32_be(uint32_t crc,
+		unsigned char const *p,
+		size_t len)
 {
 	return nfp_crc32_be_generic(crc, p, len, CRCPOLY_BE);
 }
 
 static uint32_t
-nfp_crc32_posix_end(uint32_t crc, size_t total_len)
+nfp_crc32_posix_end(uint32_t crc,
+		size_t total_len)
 {
 	/* Extend with the length of the string. */
 	while (total_len != 0) {
@@ -43,7 +47,8 @@ nfp_crc32_posix_end(uint32_t crc, size_t total_len)
 }
 
 uint32_t
-nfp_crc32_posix(const void *buff, size_t len)
+nfp_crc32_posix(const void *buff,
+		size_t len)
 {
 	return nfp_crc32_posix_end(nfp_crc32_be(0, buff, len), len);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index a9d166c4dc..ea4c7d6a9e 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
 }
 
 static int
-nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
+nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
+		uint32_t size)
 {
 	const char *key, *val, *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 		if (val >= end) {
 			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
@@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
 }
 
 static int
-nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
+nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
+		uint32_t len)
 {
 	uint32_t size, new_crc, *crc;
 
@@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
 		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
-			    new_crc, *crc);
+				new_crc, *crc);
 		return -EINVAL;
 	}
 
@@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
+nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
+		size_t *cpp_size)
 {
 	struct nfp_hwinfo *header;
 	void *res;
@@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
 		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
-			header->version);
+				header->version);
 		goto exit_free;
 	}
 
@@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
+nfp_hwinfo_fetch(struct nfp_cpp *cpp,
+		size_t *hwdb_size)
 {
 	struct timespec wait;
 	struct nfp_hwinfo *db;
@@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
  * Return: Value of the HWInfo name, or NULL
  */
 const char *
-nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
+nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
+		const char *lookup)
 {
 	const char *key, *val, *end;
 
@@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
 	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 
 		if (strcmp(key, lookup) == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index f9723dd136..0071d3fc37 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -37,8 +37,10 @@ struct nfp_mip {
 
 /* Read memory and check if it could be a valid MIP */
 static int
-nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 struct nfp_mip *mip)
+nfp_mip_try_read(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		struct nfp_mip *mip)
 {
 	int ret;
 
@@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
 		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
-			    rte_le_to_cpu_32(mip->signature));
+				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
 		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
-			    rte_le_to_cpu_32(mip->mip_version));
+				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
 
@@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 
 /* Try to locate MIP using the resource table */
 static int
-nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
+nfp_mip_read_resource(struct nfp_cpp *cpp,
+		struct nfp_mip *mip)
 {
 	struct nfp_nffw_info *nffw_info;
 	uint32_t cpp_id;
@@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
  * @size:	Location for size of MIP symbol table
  */
 void
-nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_symtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->symtab_addr);
 	*size = rte_le_to_cpu_32(mip->symtab_size);
@@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
  * @size:	Location for size of MIP symbol name table
  */
 void
-nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_strtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->strtab_addr);
 	*size = rte_le_to_cpu_32(mip->strtab_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
index d0919b58fe..980abc2517 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.h
+++ b/drivers/net/nfp/nfpcore/nfp_mip.h
@@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
 void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			    uint64_t *off);
+		uint64_t *off);
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 0410a00856..047e755416 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
 };
 
 static int
-_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
+_nfp_cpp_mutex_validate(uint32_t model,
+		int *target,
+		unsigned long long address)
 {
 	/* Address must be 64-bit aligned */
 	if ((address & 7) != 0)
@@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
  * @return 0 on success, or negative value on failure.
  */
 int
-nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
-		   uint32_t key)
+nfp_cpp_mutex_init(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
@@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
 	if (err < 0)
 		return err;
 
-	err =
-	    nfp_cpp_writel(cpp, muw, address + 0,
-			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
+	err = nfp_cpp_writel(cpp, muw, address + 0,
+			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
 	if (err < 0)
 		return err;
 
@@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
  * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
-nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-		     unsigned long long address, uint32_t key)
+nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	struct nfp_cpp_mutex *mutex;
@@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 			return err;
 		if (time(NULL) >= warn_at) {
 			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
-				    mutex->usage, mutex->depth, mutex->target,
-				    mutex->address, mutex->key);
+					mutex->usage, mutex->depth, mutex->target,
+					mutex->address, mutex->key);
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 433780a5e7..fa65956baa 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -85,7 +85,8 @@ nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 }
 
 static unsigned int
-nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
+nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf,
+		struct nffw_fwinfo **arr)
 {
 	/*
 	 * For the this code, version 0 is most likely to be version 1 in this
@@ -138,8 +139,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 		goto err_release;
 
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
-			   nfp_resource_address(state->res),
-			   fwinf, sizeof(*fwinf));
+			nfp_resource_address(state->res),
+			fwinf, sizeof(*fwinf));
 	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
@@ -205,8 +206,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
  * Return: 0, or -ERRNO
  */
 int
-nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			uint64_t *off)
+nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
+		uint32_t *cpp_id,
+		uint64_t *off)
 {
 	struct nffw_fwinfo *fwinfo;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 6474abf0c2..4f476f6f2b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
+nfp_nsp_config_set_modified(struct nfp_nsp *state,
+		int modified)
 {
 	state->modified = modified;
 }
@@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
+nfp_nsp_config_set_state(struct nfp_nsp *state,
+		void *entries,
+		unsigned int idx)
 {
 	state->entries = entries;
 	state->idx = idx;
@@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 
 	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
-						    state->ver.minor);
+				state->ver.minor);
 		return -EINVAL;
 	}
 
@@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
 }
 
 static int
-nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
-		 uint64_t addr, uint64_t mask, uint64_t val)
+nfp_nsp_wait_reg(struct nfp_cpp *cpp,
+		uint64_t *reg,
+		uint32_t nsp_cpp,
+		uint64_t addr,
+		uint64_t mask,
+		uint64_t val)
 {
 	struct timespec wait;
 	int count;
@@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
  *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
-		uint32_t buff_cpp, uint64_t buff_addr)
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code,
+		uint32_t option,
+		uint32_t buff_cpp,
+		uint64_t buff_addr)
 {
 	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
 	struct nfp_cpp *cpp = state->cpp;
@@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 		return err;
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
 		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-			buff_cpp, buff_addr);
+				buff_cpp, buff_addr);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			     FIELD_PREP(NSP_COMMAND_CODE, code) |
-			     FIELD_PREP(NSP_COMMAND_START, 1));
+			FIELD_PREP(NSP_COMMAND_OPTION, option) |
+			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
 
 	/* Wait for NSP_COMMAND_START to go to 0 */
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
-			       NSP_COMMAND_START, 0);
+			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
 	/* Wait for NSP_STATUS_BUSY to go to 0 */
-	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
-			       0);
+	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
+			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
@@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-			 -err, (int)ret_val, code);
+				-err, (int)ret_val, code);
 		nfp_nsp_print_extended_error(ret_val);
 		return -err;
 	}
@@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 #define SZ_1M 0x00100000
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
-		    const void *in_buf, unsigned int in_size, void *out_buf,
-		    unsigned int out_size)
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		uint16_t code, uint32_t option,
+		const void *in_buf,
+		unsigned int in_size,
+		void *out_buf,
+		unsigned int out_size)
 {
 	struct nfp_cpp *cpp = nsp->cpp;
 	unsigned int max_size;
@@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-			    code, nsp->ver.major, nsp->ver.minor);
+				code, nsp->ver.major, nsp->ver.minor);
 		return -EOPNOTSUPP;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER_CONFIG,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
 	if (err < 0)
 		return err;
 
 	max_size = RTE_MAX(in_size, out_size);
 	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
 		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
-			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
+				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
 		memset(out_buf, 0, out_size - in_size);
 		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				    out_size - in_size);
+				out_size - in_size);
 		if (err < 0)
 			return err;
 	}
@@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
 }
 
 int
-nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_load_fw(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_eth_table(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			unsigned int size)
+nfp_nsp_write_eth_table(struct nfp_nsp *state,
+		const void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_identify(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
-		     unsigned int size)
+nfp_nsp_read_sensors(struct nfp_nsp *state,
+		unsigned int sensor_mask,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-				   0, buf, size);
+			0, buf, size);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 9905b2d3d3..1e2deaabb4 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_mac_reinit(struct nfp_nsp *state);
 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
-			 void *buf, unsigned int size);
+		void *buf, unsigned int size);
 
-static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
+static inline int
+nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
@@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
 int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
 int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
-			   int configed);
-int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
+		int configed);
+int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			    unsigned int size);
+		unsigned int size);
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
-			      unsigned int idx);
+		unsigned int idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
 void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
 int nfp_nsp_config_modified(struct nfp_nsp *state);
 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
+static inline int
+nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return !!eth_port->fec_modes_supported;
 }
@@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
 };
 
 int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
-			  long *val);
+		long *val);
 
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 21b338461e..28dba27124 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -73,7 +73,9 @@ struct nfp_sensors {
 };
 
 int
-nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
+nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
+		enum nfp_nsp_sensor_id id,
+		long *val)
 {
 	struct nfp_sensors s;
 	struct nfp_nsp *nsp;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 825a84a8cd..51bd57033e 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -159,7 +159,8 @@ nfp_eth_speed2rate(unsigned int speed)
 }
 
 static void
-nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
+nfp_eth_copy_mac_reverse(uint8_t *dst,
+		const uint8_t *src)
 {
 	int i;
 
@@ -168,8 +169,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
 }
 
 static void
-nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
-		       unsigned int index, struct nfp_eth_table_port *dst)
+nfp_eth_port_translate(struct nfp_nsp *nsp,
+		const union eth_table_entry *src,
+		unsigned int index,
+		struct nfp_eth_table_port *dst)
 {
 	unsigned int rate;
 	unsigned int fec;
@@ -225,21 +228,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
-					   table->ports[i].index);
+				table->ports[i].index);
 
 		for (j = 0; j < table->count; j++) {
 			if (table->ports[i].label_port !=
-			    table->ports[j].label_port)
+					table->ports[j].label_port)
 				continue;
 			table->ports[i].port_lanes += table->ports[j].lanes;
 
 			if (i == j)
 				continue;
 			if (table->ports[i].label_subport ==
-			    table->ports[j].label_subport)
+					table->ports[j].label_subport)
 				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
-					 table->ports[i].label_port,
-					 table->ports[i].label_subport);
+						table->ports[i].label_port,
+						table->ports[i].label_subport);
 
 			table->ports[i].is_split = 1;
 		}
@@ -296,7 +299,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 */
 	if (ret != 0 && ret != cnt) {
 		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
-		       ret, cnt);
+				ret, cnt);
 		goto err;
 	}
 
@@ -354,7 +357,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
 }
 
 struct nfp_nsp *
-nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
+nfp_eth_config_start(struct nfp_cpp *cpp,
+		unsigned int idx)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -447,7 +451,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
+nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int enable)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -487,7 +493,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
+nfp_eth_set_configured(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int configed)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -523,9 +531,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
 }
 
 static int
-nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
-		       const uint64_t mask, const unsigned int shift,
-		       unsigned int val, const uint64_t ctrl_bit)
+nfp_eth_set_bit_config(struct nfp_nsp *nsp,
+		unsigned int raw_idx,
+		const uint64_t mask,
+		const unsigned int shift,
+		unsigned int val,
+		const uint64_t ctrl_bit)
 {
 	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	unsigned int idx = nfp_nsp_config_idx(nsp);
@@ -560,7 +571,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
 	(__extension__ ({ \
 		typeof(mask) _x = (mask); \
 		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
-				       val, ctrl_bit);			\
+				val, ctrl_bit);			\
 	}))
 
 /*
@@ -574,11 +585,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
+__nfp_eth_set_aneg(struct nfp_nsp *nsp,
+		enum nfp_eth_aneg mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_ANEG, mode,
-				      NSP_ETH_CTRL_SET_ANEG);
+			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
 /*
@@ -592,11 +603,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
  * Return: 0 or -ERRNO.
  */
 static int
-__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
+__nfp_eth_set_fec(struct nfp_nsp *nsp,
+		enum nfp_eth_fec mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_FEC, mode,
-				      NSP_ETH_CTRL_SET_FEC);
+			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
 /*
@@ -611,7 +622,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
+nfp_eth_set_fec(struct nfp_cpp *cpp,
+		unsigned int idx,
+		enum nfp_eth_fec mode)
 {
 	struct nfp_nsp *nsp;
 	int err;
@@ -642,7 +655,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
+__nfp_eth_set_speed(struct nfp_nsp *nsp,
+		unsigned int speed)
 {
 	enum nfp_eth_rate rate;
 
@@ -653,8 +667,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
 	}
 
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_RATE, rate,
-				      NSP_ETH_CTRL_SET_RATE);
+			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
 /*
@@ -668,8 +681,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
+__nfp_eth_set_split(struct nfp_nsp *nsp,
+		unsigned int lanes)
 {
-	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
-				      lanes, NSP_ETH_CTRL_SET_LANES);
+	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
+			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 838cd6e0ef..57089c770f 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -64,7 +64,8 @@ struct nfp_resource {
 };
 
 static int
-nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
+nfp_cpp_resource_find(struct nfp_cpp *cpp,
+		struct nfp_resource *res)
 {
 	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 	struct nfp_resource_entry entry;
@@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 
 	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
 		uint64_t addr = NFP_RESOURCE_TBL_BASE +
-			sizeof(struct nfp_resource_entry) * i;
+				sizeof(struct nfp_resource_entry) * i;
 
 		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
 		if (ret != sizeof(entry))
@@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 			continue;
 
 		/* Found key! */
-		res->mutex =
-			nfp_cpp_mutex_alloc(cpp,
-					    NFP_RESOURCE_TBL_TARGET, addr, key);
+		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
+				addr, key);
 		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
-					 entry.region.cpp_action,
-					 entry.region.cpp_token);
+				entry.region.cpp_action,
+				entry.region.cpp_token);
 		res->addr = ((uint64_t)entry.region.page_offset) << 8;
 		res->size = (uint64_t)entry.region.page_size << 8;
 		return 0;
@@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 }
 
 static int
-nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
-			 struct nfp_cpp_mutex *dev_mutex)
+nfp_resource_try_acquire(struct nfp_cpp *cpp,
+		struct nfp_resource *res,
+		struct nfp_cpp_mutex *dev_mutex)
 {
 	int err;
 
@@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
  * Return: NFP Resource handle, or NULL
  */
 struct nfp_resource *
-nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
+nfp_resource_acquire(struct nfp_cpp *cpp,
+		const char *name)
 {
 	struct nfp_cpp_mutex *dev_mutex;
 	struct nfp_resource *res;
@@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
 	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
 
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
-					NFP_RESOURCE_TBL_BASE,
-					NFP_RESOURCE_TBL_KEY);
+			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
 		free(res);
 		return NULL;
@@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
  *
  * Return: const char pointer to the name of the resource
  */
-const char
-*nfp_resource_name(const struct nfp_resource *res)
+const char *
+nfp_resource_name(const struct nfp_resource *res)
 {
 	return res->name;
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 06cc6f74f4..009b7359a4 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -18,7 +18,7 @@
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
-					  const char *name);
+		const char *name);
 
 /**
  * Release a NFP Resource, and free the handle
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 4c45aec5c1..aa3b7a483e 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -40,22 +40,25 @@ struct nfp_rtsym_table {
 };
 
 static int
-nfp_meid(uint8_t island_id, uint8_t menum)
+nfp_meid(uint8_t island_id,
+		uint8_t menum)
 {
 	return (island_id & 0x3F) == island_id && menum < 12 ?
 		(island_id << 4) | (menum + 4) : -1;
 }
 
 static void
-nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
-			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
+nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
+		uint32_t strtab_size,
+		struct nfp_rtsym *sw,
+		struct nfp_rtsym_entry *fw)
 {
 	sw->type = fw->type;
 	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
 	sw->addr = ((uint64_t)fw->addr_hi << 32) |
-		   rte_le_to_cpu_32(fw->addr_lo);
+			rte_le_to_cpu_32(fw->addr_lo);
 	sw->size = ((uint64_t)fw->size_hi << 32) |
-		   rte_le_to_cpu_32(fw->size_lo);
+			rte_le_to_cpu_32(fw->size_lo);
 
 	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
 		     sw->name, sw->addr, sw->size, sw->target);
@@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
 }
 
 struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
+__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip)
 {
 	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
 	struct nfp_rtsym_entry *rtsymtab;
@@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
 
 	for (n = 0; n < cache->num; n++)
 		nfp_rtsym_sw_entry_init(cache, strtab_size,
-					&cache->symtab[n], &rtsymtab[n]);
+				&cache->symtab[n], &rtsymtab[n]);
 
 	free(rtsymtab);
 
@@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
+nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
+		int idx)
 {
 	if (rtbl == NULL)
 		return NULL;
@@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
+nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name)
 {
 	int n;
 
@@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
  * Return: value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
-nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
+nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		int *error)
 {
 	const struct nfp_rtsym *sym;
 	uint32_t val32;
@@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
-			name, sym->size);
+				name, sym->size);
 		err = -EINVAL;
 		break;
 	}
@@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 }
 
 uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area)
+nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		unsigned int min_size,
+		struct nfp_cpp_area **area)
 {
 	int ret;
 	uint8_t *mem;
@@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
-			sym->size, min_size);
+				sym->size, min_size);
 		return NULL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index 8b494211bc..30768f1ccf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -43,19 +43,18 @@ struct nfp_rtsym_table;
 
 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
 
-struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
+struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip);
 
 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
 
 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
 
-const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
+const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name);
 
 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
-			   int *error);
-uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area);
+		int *error);
+uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
+		unsigned int min_size, struct nfp_cpp_area **area);
 #endif
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v3 10/11] eal: remove deprecated thread functions
    2023-09-13 11:28  3%   ` [PATCH v3 03/11] eal: remove attributes from control thread creation Thomas Monjalon
  2023-09-13 11:28  3%   ` [PATCH v3 04/11] eal: promote thread API as stable Thomas Monjalon
@ 2023-09-13 11:28  4%   ` Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 11:28 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup,
	Anatoly Burakov, Bruce Richardson, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

The deprecated functions rte_thread_setname() and rte_ctrl_thread_create()
are replaced with the new rte_thread API:

	rte_thread_setname()
can be replaced with
	rte_thread_set_name()
or	rte_thread_set_prefixed_name()

	rte_ctrl_thread_create()
can be replaced with
	rte_thread_create_control()
or	rte_thread_create_internal_control()

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

---
v2: clean control thread params struct
---
 .../prog_guide/env_abstraction_layer.rst      |  2 +-
 doc/guides/rel_notes/deprecation.rst          |  5 -
 doc/guides/rel_notes/release_23_11.rst        |  4 +-
 lib/eal/common/eal_common_thread.c            | 93 +++----------------
 lib/eal/freebsd/eal_thread.c                  |  7 --
 lib/eal/include/rte_lcore.h                   | 42 ---------
 lib/eal/linux/eal_thread.c                    | 16 ----
 lib/eal/version.map                           |  2 -
 lib/eal/windows/eal_thread.c                  |  8 --
 9 files changed, 18 insertions(+), 161 deletions(-)

diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 89014789de..6debf54efb 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -756,7 +756,7 @@ Control Thread API
 ~~~~~~~~~~~~~~~~~~
 
 It is possible to create Control Threads using the public API
-``rte_ctrl_thread_create()``.
+``rte_thread_create_control()``.
 Those threads can be used for management/infrastructure tasks and are used
 internally by DPDK for multi process support and interrupt handling.
 
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 3e48908b51..8c8873006d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -29,11 +29,6 @@ Deprecation Notices
   are renamed to ``rte_tel_data_add_array_uint`` and ``rte_tel_data_add_dict_uint`` respectively.
   As such, the old function names are deprecated and will be removed in a future release.
 
-* eal: The functions ``rte_thread_setname`` and ``rte_ctrl_thread_create``
-  are planned to be deprecated starting with the 23.07 release, subject to
-  the replacement API rte_thread_set_name and rte_thread_create_control being
-  marked as stable, and planned to be removed by the 23.11 release.
-
 * eal: ``RTE_CPUFLAG_NUMFLAGS`` will be removed in DPDK 23.11 release.
   This is to allow new CPU features to be added without ABI breakage.
 
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d7562fd646..9746809a66 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,7 +115,9 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
-  The whole thread API was promoted to stable level.
+  The whole thread API was promoted to stable level,
+  except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
+  replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
 
 ABI Changes
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 830273813f..668b1ed96b 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -235,25 +235,22 @@ enum __rte_ctrl_thread_status {
 	CTRL_THREAD_ERROR /* Control thread encountered an error */
 };
 
-struct rte_thread_ctrl_params {
-	union {
-		void *(*ctrl_start_routine)(void *arg);
-		rte_thread_func control_start_routine;
-	} u;
+struct control_thread_params {
+	rte_thread_func start_routine;
 	void *arg;
 	int ret;
 	/* Control thread status.
 	 * If the status is CTRL_THREAD_ERROR, 'ret' has the error code.
 	 */
-	enum __rte_ctrl_thread_status ctrl_thread_status;
+	enum __rte_ctrl_thread_status status;
 };
 
-static int ctrl_thread_init(void *arg)
+static int control_thread_init(void *arg)
 {
 	struct internal_config *internal_conf =
 		eal_get_internal_configuration();
 	rte_cpuset_t *cpuset = &internal_conf->ctrl_cpuset;
-	struct rte_thread_ctrl_params *params = arg;
+	struct control_thread_params *params = arg;
 
 	__rte_thread_init(rte_lcore_id(), cpuset);
 	/* Set control thread socket ID to SOCKET_ID_ANY
@@ -262,96 +259,34 @@ static int ctrl_thread_init(void *arg)
 	RTE_PER_LCORE(_socket_id) = SOCKET_ID_ANY;
 	params->ret = rte_thread_set_affinity_by_id(rte_thread_self(), cpuset);
 	if (params->ret != 0) {
-		__atomic_store_n(&params->ctrl_thread_status,
+		__atomic_store_n(&params->status,
 			CTRL_THREAD_ERROR, __ATOMIC_RELEASE);
 		return 1;
 	}
 
-	__atomic_store_n(&params->ctrl_thread_status,
+	__atomic_store_n(&params->status,
 		CTRL_THREAD_RUNNING, __ATOMIC_RELEASE);
 
 	return 0;
 }
 
-static void *ctrl_thread_start(void *arg)
-{
-	struct rte_thread_ctrl_params *params = arg;
-	void *start_arg = params->arg;
-	void *(*start_routine)(void *) = params->u.ctrl_start_routine;
-
-	if (ctrl_thread_init(arg) != 0)
-		return NULL;
-
-	return start_routine(start_arg);
-}
-
 static uint32_t control_thread_start(void *arg)
 {
-	struct rte_thread_ctrl_params *params = arg;
+	struct control_thread_params *params = arg;
 	void *start_arg = params->arg;
-	rte_thread_func start_routine = params->u.control_start_routine;
+	rte_thread_func start_routine = params->start_routine;
 
-	if (ctrl_thread_init(arg) != 0)
+	if (control_thread_init(arg) != 0)
 		return 0;
 
 	return start_routine(start_arg);
 }
 
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg)
-{
-	struct rte_thread_ctrl_params *params;
-	enum __rte_ctrl_thread_status ctrl_thread_status;
-	int ret;
-
-	params = malloc(sizeof(*params));
-	if (!params)
-		return -ENOMEM;
-
-	params->u.ctrl_start_routine = start_routine;
-	params->arg = arg;
-	params->ret = 0;
-	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
-
-	ret = pthread_create(thread, attr, ctrl_thread_start, (void *)params);
-	if (ret != 0) {
-		free(params);
-		return -ret;
-	}
-
-	if (name != NULL)
-		rte_thread_set_name((rte_thread_t){(uintptr_t)*thread}, name);
-
-	/* Wait for the control thread to initialize successfully */
-	while ((ctrl_thread_status =
-			__atomic_load_n(&params->ctrl_thread_status,
-			__ATOMIC_ACQUIRE)) == CTRL_THREAD_LAUNCHING) {
-		/* Yield the CPU. Using sched_yield call requires maintaining
-		 * another implementation for Windows as sched_yield is not
-		 * supported on Windows.
-		 */
-		rte_delay_us_sleep(1);
-	}
-
-	/* Check if the control thread encountered an error */
-	if (ctrl_thread_status == CTRL_THREAD_ERROR) {
-		/* ctrl thread is exiting */
-		rte_thread_join((rte_thread_t){(uintptr_t)*thread}, NULL);
-	}
-
-	ret = params->ret;
-	free(params);
-
-	return -ret;
-}
-
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func start_routine, void *arg)
 {
-	struct rte_thread_ctrl_params *params;
+	struct control_thread_params *params;
 	enum __rte_ctrl_thread_status ctrl_thread_status;
 	int ret;
 
@@ -359,10 +294,10 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 	if (params == NULL)
 		return -ENOMEM;
 
-	params->u.control_start_routine = start_routine;
+	params->start_routine = start_routine;
 	params->arg = arg;
 	params->ret = 0;
-	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
+	params->status = CTRL_THREAD_LAUNCHING;
 
 	ret = rte_thread_create(thread, NULL, control_thread_start, params);
 	if (ret != 0) {
@@ -375,7 +310,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 
 	/* Wait for the control thread to initialize successfully */
 	while ((ctrl_thread_status =
-			__atomic_load_n(&params->ctrl_thread_status,
+			__atomic_load_n(&params->status,
 			__ATOMIC_ACQUIRE)) == CTRL_THREAD_LAUNCHING) {
 		rte_delay_us_sleep(1);
 	}
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index ba9b25c2c0..6f97a3c2c1 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -42,10 +42,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 
 	pthread_set_name_np((pthread_t)thread_id.opaque_id, truncated);
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	/* this BSD function returns no error */
-	pthread_set_name_np(id, name);
-	return 0;
-}
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 6ce810b876..7deae47af3 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -385,20 +385,6 @@ void rte_lcore_register_usage_cb(rte_lcore_usage_cb cb);
 void
 rte_lcore_dump(FILE *f);
 
-/**
- * Set thread names.
- *
- * @note It fails with glibc < 2.12.
- *
- * @param id
- *   Thread id.
- * @param name
- *   Thread name to set.
- * @return
- *   On success, return 0; otherwise return a negative value.
- */
-int rte_thread_setname(pthread_t id, const char *name);
-
 /**
  * Register current non-EAL thread as a lcore.
  *
@@ -421,34 +407,6 @@ rte_thread_register(void);
 void
 rte_thread_unregister(void);
 
-/**
- * Create a control thread.
- *
- * Creates a control thread with the given name and attributes. The
- * affinity of the new thread is based on the CPU affinity retrieved
- * at the time rte_eal_init() was called, the dataplane and service
- * lcores are then excluded. If setting the name of the thread fails,
- * the error is ignored and a debug message is logged.
- *
- * @param thread
- *   Filled with the thread id of the new created thread.
- * @param name
- *   The name of the control thread (max 16 characters including '\0').
- * @param attr
- *   Attributes for the new thread.
- * @param start_routine
- *   Function to be executed by the new thread.
- * @param arg
- *   Argument passed to start_routine.
- * @return
- *   On success, returns 0; on error, it returns a negative value
- *   corresponding to the error number.
- */
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index b9a126f3a8..880070c627 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -39,19 +39,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 	if (ret != 0)
 		RTE_LOG(DEBUG, EAL, "Failed to set thread name\n");
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	int ret = ENOSYS;
-#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-#if __GLIBC_PREREQ(2, 12)
-	char truncated[16];
-
-	strlcpy(truncated, name, sizeof(truncated));
-	ret = pthread_setname_np(id, truncated);
-#endif
-#endif
-	RTE_SET_USED(id);
-	RTE_SET_USED(name);
-	return -ret;
-}
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 6d32c19286..915057b325 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -20,7 +20,6 @@ DPDK_24 {
 	rte_cpu_get_flag_enabled;
 	rte_cpu_get_flag_name;
 	rte_cpu_is_supported; # WINDOWS_NO_EXPORT
-	rte_ctrl_thread_create;
 	rte_cycles_vmware_tsc_map; # WINDOWS_NO_EXPORT
 	rte_delay_us;
 	rte_delay_us_block;
@@ -278,7 +277,6 @@ DPDK_24 {
 	rte_thread_set_affinity_by_id;
 	rte_thread_set_name;
 	rte_thread_set_priority;
-	rte_thread_setname;
 	rte_thread_unregister;
 	rte_thread_value_get;
 	rte_thread_value_set;
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 464d510838..9e3df200b9 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -76,11 +76,3 @@ rte_sys_gettid(void)
 {
 	return GetCurrentThreadId();
 }
-
-int
-rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)
-{
-	/* TODO */
-	/* This is a stub, not the expected result */
-	return 0;
-}
-- 
2.42.0


^ permalink raw reply	[relevance 4%]

* [PATCH v3 04/11] eal: promote thread API as stable
    2023-09-13 11:28  3%   ` [PATCH v3 03/11] eal: remove attributes from control thread creation Thomas Monjalon
@ 2023-09-13 11:28  3%   ` Thomas Monjalon
  2023-09-13 11:28  4%   ` [PATCH v3 10/11] eal: remove deprecated thread functions Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 11:28 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup

The rte_thread API must be used to ease OS porting.
One step of this process is to mark the necessary API as stable.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 doc/guides/rel_notes/release_23_11.rst |  1 +
 lib/eal/include/rte_thread.h           | 64 --------------------------
 lib/eal/version.map                    | 40 ++++++++--------
 3 files changed, 20 insertions(+), 85 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d3d500f294..d7562fd646 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,6 +115,7 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
+  The whole thread API was promoted to stable level.
 
 
 ABI Changes
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 28cc5220a4..dd1f62523f 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -73,9 +73,6 @@ typedef struct {
 typedef struct eal_tls_key *rte_thread_key;
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a new thread that will invoke the 'thread_func' routine.
  *
  * @param thread_id
@@ -94,15 +91,11 @@ typedef struct eal_tls_key *rte_thread_key;
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_create(rte_thread_t *thread_id,
 		const rte_thread_attr_t *thread_attr,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a control thread.
  *
  * Creates a control thread with the given name and attributes. The
@@ -124,15 +117,11 @@ int rte_thread_create(rte_thread_t *thread_id,
  *   On success, returns 0; on error, it returns a negative value
  *   corresponding to the error number.
  */
-__rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Waits for the thread identified by 'thread_id' to terminate
  *
  * @param thread_id
@@ -145,13 +134,9 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Indicate that the return value of the thread is not needed and
  * all thread resources should be release when the thread terminates.
  *
@@ -162,25 +147,17 @@ int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_detach(rte_thread_t thread_id);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the id of the calling thread.
  *
  * @return
  *   Return the thread id of the calling thread.
  */
-__rte_experimental
 rte_thread_t rte_thread_self(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the name of the thread.
  * This API is a noop if the underlying platform does not
  * support setting the thread name or the platform-specific
@@ -193,14 +170,10 @@ rte_thread_t rte_thread_self(void);
  *    The name to set. Truncated to RTE_THREAD_NAME_SIZE,
  *    including terminating NUL if necessary.
  */
-__rte_experimental
 void
 rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Check if 2 thread ids are equal.
  *
  * @param t1
@@ -213,13 +186,9 @@ rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
  *   If the ids are equal, return nonzero.
  *   Otherwise, return 0.
  */
-__rte_experimental
 int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Initialize the attributes of a thread.
  * These attributes can be passed to the rte_thread_create() function
  * that will create a new thread and set its attributes according to attr.
@@ -231,13 +200,9 @@ int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_init(rte_thread_attr_t *attr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the thread priority value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -251,16 +216,12 @@ int rte_thread_attr_init(rte_thread_attr_t *attr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
 		enum rte_thread_priority priority);
 
 #ifdef RTE_HAS_CPUSET
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the CPU affinity value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -274,14 +235,10 @@ int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the value of CPU affinity that is set in the thread attributes pointed
  * to by 'thread_attr'.
  *
@@ -295,14 +252,10 @@ int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the affinity of thread 'thread_id' to the cpu set
  * specified by 'cpuset'.
  *
@@ -316,14 +269,10 @@ int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
 		const rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the affinity of thread 'thread_id' and store it
  * in 'cpuset'.
  *
@@ -337,7 +286,6 @@ int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_affinity_by_id(rte_thread_t thread_id,
 		rte_cpuset_t *cpuset);
 
@@ -364,9 +312,6 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
 #endif /* RTE_HAS_CPUSET */
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the priority of a thread.
  *
  * @param thread_id
@@ -379,14 +324,10 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_priority(rte_thread_t thread_id,
 		enum rte_thread_priority *priority);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the priority of a thread.
  *
  * @param thread_id
@@ -399,7 +340,6 @@ int rte_thread_get_priority(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_priority(rte_thread_t thread_id,
 		enum rte_thread_priority priority);
 
@@ -421,7 +361,6 @@ int rte_thread_set_priority(rte_thread_t thread_id,
  *                     ENOEXEC - Specific OS error.
  */
 
-__rte_experimental
 int rte_thread_key_create(rte_thread_key *key,
 			void (*destructor)(void *));
 
@@ -437,7 +376,6 @@ int rte_thread_key_create(rte_thread_key *key,
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_key_delete(rte_thread_key key);
 
 /**
@@ -454,7 +392,6 @@ int rte_thread_key_delete(rte_thread_key key);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_value_set(rte_thread_key key, const void *value);
 
 /**
@@ -469,7 +406,6 @@ int rte_thread_value_set(rte_thread_key key, const void *value);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 void *rte_thread_value_get(rte_thread_key key);
 
 #ifdef __cplusplus
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 7940431e5a..33b853d7be 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -257,12 +257,31 @@ DPDK_24 {
 	rte_strscpy;
 	rte_strsplit;
 	rte_sys_gettid;
+	rte_thread_attr_get_affinity;
+	rte_thread_attr_init;
+	rte_thread_attr_set_affinity;
+	rte_thread_attr_set_priority;
+	rte_thread_create;
+	rte_thread_create_control;
+	rte_thread_detach;
+	rte_thread_equal;
 	rte_thread_get_affinity;
+	rte_thread_get_affinity_by_id;
+	rte_thread_get_priority;
 	rte_thread_is_intr;
+	rte_thread_join;
+	rte_thread_key_create;
+	rte_thread_key_delete;
 	rte_thread_register;
+	rte_thread_self;
 	rte_thread_set_affinity;
+	rte_thread_set_affinity_by_id;
+	rte_thread_set_name;
+	rte_thread_set_priority;
 	rte_thread_setname;
 	rte_thread_unregister;
+	rte_thread_value_get;
+	rte_thread_value_set;
 	rte_uuid_compare;
 	rte_uuid_is_null;
 	rte_uuid_parse;
@@ -368,10 +387,6 @@ EXPERIMENTAL {
 	# added in 21.05
 	rte_devargs_reset;
 	rte_intr_callback_unregister_sync;
-	rte_thread_key_create;
-	rte_thread_key_delete;
-	rte_thread_value_get;
-	rte_thread_value_set;
 	rte_version_minor;
 	rte_version_month;
 	rte_version_prefix;
@@ -392,26 +407,9 @@ EXPERIMENTAL {
 
 	# added in 22.07
 	rte_drand;
-	rte_thread_get_affinity_by_id;
-	rte_thread_get_priority;
-	rte_thread_self;
-	rte_thread_set_affinity_by_id;
-	rte_thread_set_priority;
-
-	# added in 22.11
-	rte_thread_attr_get_affinity;
-	rte_thread_attr_init;
-	rte_thread_attr_set_affinity;
-	rte_thread_attr_set_priority;
-	rte_thread_create;
-	rte_thread_detach;
-	rte_thread_equal;
-	rte_thread_join;
 
 	# added in 23.03
 	rte_lcore_register_usage_cb;
-	rte_thread_create_control;
-	rte_thread_set_name;
 	__rte_eal_trace_generic_blob;
 
 	# added in 23.07
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* [PATCH v3 03/11] eal: remove attributes from control thread creation
  @ 2023-09-13 11:28  3%   ` Thomas Monjalon
  2023-09-13 11:28  3%   ` [PATCH v3 04/11] eal: promote thread API as stable Thomas Monjalon
  2023-09-13 11:28  4%   ` [PATCH v3 10/11] eal: remove deprecated thread functions Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 11:28 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup,
	Chengwen Feng, Kevin Laatz, Bruce Richardson, Jingjing Wu,
	Beilei Xing, Qiming Yang, Qi Zhang, Wenjun Wu, Jiawen Wu,
	Jian Wang, Harman Kalra, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

The experimental function rte_thread_create_control()
is supposed to wrap actions needed to create a control thread in DPDK.
This function should be easy to port on any OS.

As such, the thread attributes should not be customizable in this API.
The thread priority should be normal, and the affinity is on "free cores".
That's why the custom attributes parameter thread_attr is dropped.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 app/test/test_threads.c                | 2 +-
 doc/guides/rel_notes/release_23_11.rst | 3 +++
 drivers/dma/skeleton/skeleton_dmadev.c | 3 +--
 drivers/net/iavf/iavf_vchnl.c          | 2 +-
 drivers/net/ice/ice_dcf_parent.c       | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 1 -
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 lib/eal/common/eal_common_thread.c     | 5 ++---
 lib/eal/include/rte_thread.h           | 5 +----
 lib/eal/windows/eal_interrupts.c       | 2 +-
 10 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index 8c27e2bae1..4ac3f2671a 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -240,7 +240,7 @@ test_thread_control_create_join(void)
 
 	thread_id_ready = 0;
 	RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc",
-		NULL, thread_main, &thread_main_id) == 0,
+		thread_main, &thread_main_id) == 0,
 		"Failed to create thread.");
 
 	while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 333e1d95a2..d3d500f294 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -113,6 +113,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* eal: The thread API has changed.
+  The function ``rte_thread_create_control()`` does not take attributes anymore.
+
 
 ABI Changes
 -----------
diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 493224542f..4fc2319668 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -128,8 +128,7 @@ skeldma_start(struct rte_dma_dev *dev)
 	rte_mb();
 
 	snprintf(name, sizeof(name), "dpdk-dma-skel%d", dev->data->dev_id);
-	ret = rte_thread_create_control(&hw->thread, name, NULL,
-				     cpucopy_thread, dev);
+	ret = rte_thread_create_control(&hw->thread, name, cpucopy_thread, dev);
 	if (ret) {
 		SKELDMA_LOG(ERR, "Start cpucopy thread fail!");
 		return -EINVAL;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index c31a6d5c98..6baa6d5955 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -136,7 +136,7 @@ iavf_dev_event_handler_init(void)
 	pthread_mutex_init(&handler->lock, NULL);
 
 	if (rte_thread_create_control(&handler->tid, "dpdk-iavf-event",
-				NULL, iavf_dev_event_handle, NULL)) {
+				iavf_dev_event_handle, NULL)) {
 		__atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED);
 		return -1;
 	}
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index ad98a531de..d3bb65874f 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -182,7 +182,7 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 	param->vf_id = vf_id;
 
 	snprintf(name, sizeof(name), "dpdk-ice-rst%u", vf_id);
-	ret = rte_thread_create_control(&thread, name, NULL,
+	ret = rte_thread_create_control(&thread, name,
 				     ice_dcf_vsi_update_service_handler, param);
 	if (ret != 0) {
 		PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7eac05ee60..64e7e5d7d6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4330,7 +4330,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
 					"dpdk-ixgbe-link",
-					NULL,
 					ixgbe_dev_setup_link_thread_handler,
 					dev) < 0) {
 					PMD_DRV_LOG(ERR,
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 6f2f5a1841..198fac8318 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2897,7 +2897,7 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				 */
 				intr->flags |= TXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
-					"dpdk-txgbe-link", NULL,
+					"dpdk-txgbe-link",
 					txgbe_dev_setup_link_thread_handler, dev) < 0) {
 					PMD_DRV_LOG(ERR, "Create link thread failed!");
 					__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 6605bd017e..07ac721da1 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -349,8 +349,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name,
 
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *attr, rte_thread_func start_routine,
-	void *arg)
+		rte_thread_func start_routine, void *arg)
 {
 	struct rte_thread_ctrl_params *params;
 	enum __rte_ctrl_thread_status ctrl_thread_status;
@@ -365,7 +364,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 	params->ret = 0;
 	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
 
-	ret = rte_thread_create(thread, attr, control_thread_start, params);
+	ret = rte_thread_create(thread, NULL, control_thread_start, params);
 	if (ret != 0) {
 		free(params);
 		return -ret;
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 6233142322..28cc5220a4 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -116,8 +116,6 @@ int rte_thread_create(rte_thread_t *thread_id,
  * @param name
  *   The name of the control thread
  *   (max RTE_THREAD_NAME_SIZE characters including '\0').
- * @param thread_attr
- *   Attributes for the new thread.
  * @param thread_func
  *   Function to be executed by the new thread.
  * @param arg
@@ -129,8 +127,7 @@ int rte_thread_create(rte_thread_t *thread_id,
 __rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *thread_attr, rte_thread_func thread_func,
-	void *arg);
+		rte_thread_func thread_func, void *arg);
 
 /**
  * @warning
diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c
index b1b1228c2b..66a49c844a 100644
--- a/lib/eal/windows/eal_interrupts.c
+++ b/lib/eal/windows/eal_interrupts.c
@@ -98,7 +98,7 @@ rte_eal_intr_init(void)
 		return -1;
 	}
 
-	ret = rte_thread_create_control(&intr_thread, "dpdk-intr", NULL,
+	ret = rte_thread_create_control(&intr_thread, "dpdk-intr",
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* [PATCH v2 10/11] eal: remove deprecated thread functions
    2023-09-13 10:34  3%   ` [PATCH v2 03/11] eal: remove attributes from control thread creation Thomas Monjalon
  2023-09-13 10:34  3%   ` [PATCH v2 04/11] eal: promote thread API as stable Thomas Monjalon
@ 2023-09-13 10:34  4%   ` Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 10:34 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup,
	Anatoly Burakov, Bruce Richardson, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

The deprecated functions rte_thread_setname() and rte_ctrl_thread_create()
are replaced with the new rte_thread API:

	rte_thread_setname()
can be replaced with
	rte_thread_set_name()
or	rte_thread_set_prefixed_name()

	rte_ctrl_thread_create()
can be replaced with
	rte_thread_create_control()
or	rte_thread_create_internal_control()

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

---
v2: clean control thread params struct
---
 .../prog_guide/env_abstraction_layer.rst      |  2 +-
 doc/guides/rel_notes/deprecation.rst          |  5 -
 doc/guides/rel_notes/release_23_11.rst        |  4 +-
 lib/eal/common/eal_common_thread.c            | 93 +++----------------
 lib/eal/freebsd/eal_thread.c                  |  7 --
 lib/eal/include/rte_lcore.h                   | 42 ---------
 lib/eal/linux/eal_thread.c                    | 16 ----
 lib/eal/version.map                           |  2 -
 lib/eal/windows/eal_thread.c                  |  8 --
 9 files changed, 18 insertions(+), 161 deletions(-)

diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 89014789de..6debf54efb 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -756,7 +756,7 @@ Control Thread API
 ~~~~~~~~~~~~~~~~~~
 
 It is possible to create Control Threads using the public API
-``rte_ctrl_thread_create()``.
+``rte_thread_create_control()``.
 Those threads can be used for management/infrastructure tasks and are used
 internally by DPDK for multi process support and interrupt handling.
 
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 3e48908b51..8c8873006d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -29,11 +29,6 @@ Deprecation Notices
   are renamed to ``rte_tel_data_add_array_uint`` and ``rte_tel_data_add_dict_uint`` respectively.
   As such, the old function names are deprecated and will be removed in a future release.
 
-* eal: The functions ``rte_thread_setname`` and ``rte_ctrl_thread_create``
-  are planned to be deprecated starting with the 23.07 release, subject to
-  the replacement API rte_thread_set_name and rte_thread_create_control being
-  marked as stable, and planned to be removed by the 23.11 release.
-
 * eal: ``RTE_CPUFLAG_NUMFLAGS`` will be removed in DPDK 23.11 release.
   This is to allow new CPU features to be added without ABI breakage.
 
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d7562fd646..9746809a66 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,7 +115,9 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
-  The whole thread API was promoted to stable level.
+  The whole thread API was promoted to stable level,
+  except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
+  replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
 
 ABI Changes
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index cd6e00fe8a..a71142662a 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -235,25 +235,22 @@ enum __rte_ctrl_thread_status {
 	CTRL_THREAD_ERROR /* Control thread encountered an error */
 };
 
-struct rte_thread_ctrl_params {
-	union {
-		void *(*ctrl_start_routine)(void *arg);
-		rte_thread_func control_start_routine;
-	} u;
+struct control_thread_params {
+	rte_thread_func start_routine;
 	void *arg;
 	int ret;
 	/* Control thread status.
 	 * If the status is CTRL_THREAD_ERROR, 'ret' has the error code.
 	 */
-	enum __rte_ctrl_thread_status ctrl_thread_status;
+	enum __rte_ctrl_thread_status status;
 };
 
-static int ctrl_thread_init(void *arg)
+static int control_thread_init(void *arg)
 {
 	struct internal_config *internal_conf =
 		eal_get_internal_configuration();
 	rte_cpuset_t *cpuset = &internal_conf->ctrl_cpuset;
-	struct rte_thread_ctrl_params *params = arg;
+	struct control_thread_params *params = arg;
 
 	__rte_thread_init(rte_lcore_id(), cpuset);
 	/* Set control thread socket ID to SOCKET_ID_ANY
@@ -262,96 +259,34 @@ static int ctrl_thread_init(void *arg)
 	RTE_PER_LCORE(_socket_id) = SOCKET_ID_ANY;
 	params->ret = rte_thread_set_affinity_by_id(rte_thread_self(), cpuset);
 	if (params->ret != 0) {
-		__atomic_store_n(&params->ctrl_thread_status,
+		__atomic_store_n(&params->status,
 			CTRL_THREAD_ERROR, __ATOMIC_RELEASE);
 		return 1;
 	}
 
-	__atomic_store_n(&params->ctrl_thread_status,
+	__atomic_store_n(&params->status,
 		CTRL_THREAD_RUNNING, __ATOMIC_RELEASE);
 
 	return 0;
 }
 
-static void *ctrl_thread_start(void *arg)
-{
-	struct rte_thread_ctrl_params *params = arg;
-	void *start_arg = params->arg;
-	void *(*start_routine)(void *) = params->u.ctrl_start_routine;
-
-	if (ctrl_thread_init(arg) != 0)
-		return NULL;
-
-	return start_routine(start_arg);
-}
-
 static uint32_t control_thread_start(void *arg)
 {
-	struct rte_thread_ctrl_params *params = arg;
+	struct control_thread_params *params = arg;
 	void *start_arg = params->arg;
-	rte_thread_func start_routine = params->u.control_start_routine;
+	rte_thread_func start_routine = params->start_routine;
 
-	if (ctrl_thread_init(arg) != 0)
+	if (control_thread_init(arg) != 0)
 		return 0;
 
 	return start_routine(start_arg);
 }
 
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg)
-{
-	struct rte_thread_ctrl_params *params;
-	enum __rte_ctrl_thread_status ctrl_thread_status;
-	int ret;
-
-	params = malloc(sizeof(*params));
-	if (!params)
-		return -ENOMEM;
-
-	params->u.ctrl_start_routine = start_routine;
-	params->arg = arg;
-	params->ret = 0;
-	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
-
-	ret = pthread_create(thread, attr, ctrl_thread_start, (void *)params);
-	if (ret != 0) {
-		free(params);
-		return -ret;
-	}
-
-	if (name != NULL)
-		rte_thread_set_name((rte_thread_t){(uintptr_t)*thread}, name);
-
-	/* Wait for the control thread to initialize successfully */
-	while ((ctrl_thread_status =
-			__atomic_load_n(&params->ctrl_thread_status,
-			__ATOMIC_ACQUIRE)) == CTRL_THREAD_LAUNCHING) {
-		/* Yield the CPU. Using sched_yield call requires maintaining
-		 * another implementation for Windows as sched_yield is not
-		 * supported on Windows.
-		 */
-		rte_delay_us_sleep(1);
-	}
-
-	/* Check if the control thread encountered an error */
-	if (ctrl_thread_status == CTRL_THREAD_ERROR) {
-		/* ctrl thread is exiting */
-		rte_thread_join((rte_thread_t){(uintptr_t)*thread}, NULL);
-	}
-
-	ret = params->ret;
-	free(params);
-
-	return -ret;
-}
-
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func start_routine, void *arg)
 {
-	struct rte_thread_ctrl_params *params;
+	struct control_thread_params *params;
 	enum __rte_ctrl_thread_status ctrl_thread_status;
 	int ret;
 
@@ -359,10 +294,10 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 	if (params == NULL)
 		return -ENOMEM;
 
-	params->u.control_start_routine = start_routine;
+	params->start_routine = start_routine;
 	params->arg = arg;
 	params->ret = 0;
-	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
+	params->status = CTRL_THREAD_LAUNCHING;
 
 	ret = rte_thread_create(thread, NULL, control_thread_start, params);
 	if (ret != 0) {
@@ -375,7 +310,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 
 	/* Wait for the control thread to initialize successfully */
 	while ((ctrl_thread_status =
-			__atomic_load_n(&params->ctrl_thread_status,
+			__atomic_load_n(&params->status,
 			__ATOMIC_ACQUIRE)) == CTRL_THREAD_LAUNCHING) {
 		rte_delay_us_sleep(1);
 	}
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index ba9b25c2c0..6f97a3c2c1 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -42,10 +42,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 
 	pthread_set_name_np((pthread_t)thread_id.opaque_id, truncated);
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	/* this BSD function returns no error */
-	pthread_set_name_np(id, name);
-	return 0;
-}
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 6ce810b876..7deae47af3 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -385,20 +385,6 @@ void rte_lcore_register_usage_cb(rte_lcore_usage_cb cb);
 void
 rte_lcore_dump(FILE *f);
 
-/**
- * Set thread names.
- *
- * @note It fails with glibc < 2.12.
- *
- * @param id
- *   Thread id.
- * @param name
- *   Thread name to set.
- * @return
- *   On success, return 0; otherwise return a negative value.
- */
-int rte_thread_setname(pthread_t id, const char *name);
-
 /**
  * Register current non-EAL thread as a lcore.
  *
@@ -421,34 +407,6 @@ rte_thread_register(void);
 void
 rte_thread_unregister(void);
 
-/**
- * Create a control thread.
- *
- * Creates a control thread with the given name and attributes. The
- * affinity of the new thread is based on the CPU affinity retrieved
- * at the time rte_eal_init() was called, the dataplane and service
- * lcores are then excluded. If setting the name of the thread fails,
- * the error is ignored and a debug message is logged.
- *
- * @param thread
- *   Filled with the thread id of the new created thread.
- * @param name
- *   The name of the control thread (max 16 characters including '\0').
- * @param attr
- *   Attributes for the new thread.
- * @param start_routine
- *   Function to be executed by the new thread.
- * @param arg
- *   Argument passed to start_routine.
- * @return
- *   On success, returns 0; on error, it returns a negative value
- *   corresponding to the error number.
- */
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index b9a126f3a8..880070c627 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -39,19 +39,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 	if (ret != 0)
 		RTE_LOG(DEBUG, EAL, "Failed to set thread name\n");
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	int ret = ENOSYS;
-#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-#if __GLIBC_PREREQ(2, 12)
-	char truncated[16];
-
-	strlcpy(truncated, name, sizeof(truncated));
-	ret = pthread_setname_np(id, truncated);
-#endif
-#endif
-	RTE_SET_USED(id);
-	RTE_SET_USED(name);
-	return -ret;
-}
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 6d32c19286..915057b325 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -20,7 +20,6 @@ DPDK_24 {
 	rte_cpu_get_flag_enabled;
 	rte_cpu_get_flag_name;
 	rte_cpu_is_supported; # WINDOWS_NO_EXPORT
-	rte_ctrl_thread_create;
 	rte_cycles_vmware_tsc_map; # WINDOWS_NO_EXPORT
 	rte_delay_us;
 	rte_delay_us_block;
@@ -278,7 +277,6 @@ DPDK_24 {
 	rte_thread_set_affinity_by_id;
 	rte_thread_set_name;
 	rte_thread_set_priority;
-	rte_thread_setname;
 	rte_thread_unregister;
 	rte_thread_value_get;
 	rte_thread_value_set;
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 464d510838..9e3df200b9 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -76,11 +76,3 @@ rte_sys_gettid(void)
 {
 	return GetCurrentThreadId();
 }
-
-int
-rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)
-{
-	/* TODO */
-	/* This is a stub, not the expected result */
-	return 0;
-}
-- 
2.42.0


^ permalink raw reply	[relevance 4%]

* [PATCH v2 04/11] eal: promote thread API as stable
    2023-09-13 10:34  3%   ` [PATCH v2 03/11] eal: remove attributes from control thread creation Thomas Monjalon
@ 2023-09-13 10:34  3%   ` Thomas Monjalon
  2023-09-13 10:34  4%   ` [PATCH v2 10/11] eal: remove deprecated thread functions Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 10:34 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup

The rte_thread API must be used to ease OS porting.
One step of this process is to mark the necessary API as stable.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 doc/guides/rel_notes/release_23_11.rst |  1 +
 lib/eal/include/rte_thread.h           | 64 --------------------------
 lib/eal/version.map                    | 40 ++++++++--------
 3 files changed, 20 insertions(+), 85 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d3d500f294..d7562fd646 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,6 +115,7 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
+  The whole thread API was promoted to stable level.
 
 
 ABI Changes
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 28cc5220a4..dd1f62523f 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -73,9 +73,6 @@ typedef struct {
 typedef struct eal_tls_key *rte_thread_key;
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a new thread that will invoke the 'thread_func' routine.
  *
  * @param thread_id
@@ -94,15 +91,11 @@ typedef struct eal_tls_key *rte_thread_key;
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_create(rte_thread_t *thread_id,
 		const rte_thread_attr_t *thread_attr,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a control thread.
  *
  * Creates a control thread with the given name and attributes. The
@@ -124,15 +117,11 @@ int rte_thread_create(rte_thread_t *thread_id,
  *   On success, returns 0; on error, it returns a negative value
  *   corresponding to the error number.
  */
-__rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Waits for the thread identified by 'thread_id' to terminate
  *
  * @param thread_id
@@ -145,13 +134,9 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Indicate that the return value of the thread is not needed and
  * all thread resources should be release when the thread terminates.
  *
@@ -162,25 +147,17 @@ int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_detach(rte_thread_t thread_id);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the id of the calling thread.
  *
  * @return
  *   Return the thread id of the calling thread.
  */
-__rte_experimental
 rte_thread_t rte_thread_self(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the name of the thread.
  * This API is a noop if the underlying platform does not
  * support setting the thread name or the platform-specific
@@ -193,14 +170,10 @@ rte_thread_t rte_thread_self(void);
  *    The name to set. Truncated to RTE_THREAD_NAME_SIZE,
  *    including terminating NUL if necessary.
  */
-__rte_experimental
 void
 rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Check if 2 thread ids are equal.
  *
  * @param t1
@@ -213,13 +186,9 @@ rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
  *   If the ids are equal, return nonzero.
  *   Otherwise, return 0.
  */
-__rte_experimental
 int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Initialize the attributes of a thread.
  * These attributes can be passed to the rte_thread_create() function
  * that will create a new thread and set its attributes according to attr.
@@ -231,13 +200,9 @@ int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_init(rte_thread_attr_t *attr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the thread priority value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -251,16 +216,12 @@ int rte_thread_attr_init(rte_thread_attr_t *attr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
 		enum rte_thread_priority priority);
 
 #ifdef RTE_HAS_CPUSET
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the CPU affinity value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -274,14 +235,10 @@ int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the value of CPU affinity that is set in the thread attributes pointed
  * to by 'thread_attr'.
  *
@@ -295,14 +252,10 @@ int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the affinity of thread 'thread_id' to the cpu set
  * specified by 'cpuset'.
  *
@@ -316,14 +269,10 @@ int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
 		const rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the affinity of thread 'thread_id' and store it
  * in 'cpuset'.
  *
@@ -337,7 +286,6 @@ int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_affinity_by_id(rte_thread_t thread_id,
 		rte_cpuset_t *cpuset);
 
@@ -364,9 +312,6 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
 #endif /* RTE_HAS_CPUSET */
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the priority of a thread.
  *
  * @param thread_id
@@ -379,14 +324,10 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_priority(rte_thread_t thread_id,
 		enum rte_thread_priority *priority);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the priority of a thread.
  *
  * @param thread_id
@@ -399,7 +340,6 @@ int rte_thread_get_priority(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_priority(rte_thread_t thread_id,
 		enum rte_thread_priority priority);
 
@@ -421,7 +361,6 @@ int rte_thread_set_priority(rte_thread_t thread_id,
  *                     ENOEXEC - Specific OS error.
  */
 
-__rte_experimental
 int rte_thread_key_create(rte_thread_key *key,
 			void (*destructor)(void *));
 
@@ -437,7 +376,6 @@ int rte_thread_key_create(rte_thread_key *key,
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_key_delete(rte_thread_key key);
 
 /**
@@ -454,7 +392,6 @@ int rte_thread_key_delete(rte_thread_key key);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_value_set(rte_thread_key key, const void *value);
 
 /**
@@ -469,7 +406,6 @@ int rte_thread_value_set(rte_thread_key key, const void *value);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 void *rte_thread_value_get(rte_thread_key key);
 
 #ifdef __cplusplus
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 7940431e5a..33b853d7be 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -257,12 +257,31 @@ DPDK_24 {
 	rte_strscpy;
 	rte_strsplit;
 	rte_sys_gettid;
+	rte_thread_attr_get_affinity;
+	rte_thread_attr_init;
+	rte_thread_attr_set_affinity;
+	rte_thread_attr_set_priority;
+	rte_thread_create;
+	rte_thread_create_control;
+	rte_thread_detach;
+	rte_thread_equal;
 	rte_thread_get_affinity;
+	rte_thread_get_affinity_by_id;
+	rte_thread_get_priority;
 	rte_thread_is_intr;
+	rte_thread_join;
+	rte_thread_key_create;
+	rte_thread_key_delete;
 	rte_thread_register;
+	rte_thread_self;
 	rte_thread_set_affinity;
+	rte_thread_set_affinity_by_id;
+	rte_thread_set_name;
+	rte_thread_set_priority;
 	rte_thread_setname;
 	rte_thread_unregister;
+	rte_thread_value_get;
+	rte_thread_value_set;
 	rte_uuid_compare;
 	rte_uuid_is_null;
 	rte_uuid_parse;
@@ -368,10 +387,6 @@ EXPERIMENTAL {
 	# added in 21.05
 	rte_devargs_reset;
 	rte_intr_callback_unregister_sync;
-	rte_thread_key_create;
-	rte_thread_key_delete;
-	rte_thread_value_get;
-	rte_thread_value_set;
 	rte_version_minor;
 	rte_version_month;
 	rte_version_prefix;
@@ -392,26 +407,9 @@ EXPERIMENTAL {
 
 	# added in 22.07
 	rte_drand;
-	rte_thread_get_affinity_by_id;
-	rte_thread_get_priority;
-	rte_thread_self;
-	rte_thread_set_affinity_by_id;
-	rte_thread_set_priority;
-
-	# added in 22.11
-	rte_thread_attr_get_affinity;
-	rte_thread_attr_init;
-	rte_thread_attr_set_affinity;
-	rte_thread_attr_set_priority;
-	rte_thread_create;
-	rte_thread_detach;
-	rte_thread_equal;
-	rte_thread_join;
 
 	# added in 23.03
 	rte_lcore_register_usage_cb;
-	rte_thread_create_control;
-	rte_thread_set_name;
 	__rte_eal_trace_generic_blob;
 
 	# added in 23.07
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* [PATCH v2 03/11] eal: remove attributes from control thread creation
  @ 2023-09-13 10:34  3%   ` Thomas Monjalon
  2023-09-13 10:34  3%   ` [PATCH v2 04/11] eal: promote thread API as stable Thomas Monjalon
  2023-09-13 10:34  4%   ` [PATCH v2 10/11] eal: remove deprecated thread functions Thomas Monjalon
  2 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-13 10:34 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Morten Brørup,
	Chengwen Feng, Kevin Laatz, Bruce Richardson, Jingjing Wu,
	Beilei Xing, Qiming Yang, Qi Zhang, Wenjun Wu, Jiawen Wu,
	Jian Wang, Harman Kalra, Dmitry Kozlyuk,
	Narcisa Ana Maria Vasile, Dmitry Malloy, Pallavi Kadam

The experimental function rte_thread_create_control()
is supposed to wrap actions needed to create a control thread in DPDK.
This function should be easy to port on any OS.

As such, the thread attributes should not be customizable in this API.
The thread priority should be normal, and the affinity is on "free cores".
That's why the custom attributes parameter thread_attr is dropped.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 app/test/test_threads.c                | 2 +-
 doc/guides/rel_notes/release_23_11.rst | 3 +++
 drivers/dma/skeleton/skeleton_dmadev.c | 3 +--
 drivers/net/iavf/iavf_vchnl.c          | 2 +-
 drivers/net/ice/ice_dcf_parent.c       | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 1 -
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 lib/eal/common/eal_common_thread.c     | 5 ++---
 lib/eal/include/rte_thread.h           | 5 +----
 lib/eal/windows/eal_interrupts.c       | 2 +-
 10 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index 8c27e2bae1..4ac3f2671a 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -240,7 +240,7 @@ test_thread_control_create_join(void)
 
 	thread_id_ready = 0;
 	RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc",
-		NULL, thread_main, &thread_main_id) == 0,
+		thread_main, &thread_main_id) == 0,
 		"Failed to create thread.");
 
 	while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 333e1d95a2..d3d500f294 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -113,6 +113,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* eal: The thread API has changed.
+  The function ``rte_thread_create_control()`` does not take attributes anymore.
+
 
 ABI Changes
 -----------
diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 493224542f..4fc2319668 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -128,8 +128,7 @@ skeldma_start(struct rte_dma_dev *dev)
 	rte_mb();
 
 	snprintf(name, sizeof(name), "dpdk-dma-skel%d", dev->data->dev_id);
-	ret = rte_thread_create_control(&hw->thread, name, NULL,
-				     cpucopy_thread, dev);
+	ret = rte_thread_create_control(&hw->thread, name, cpucopy_thread, dev);
 	if (ret) {
 		SKELDMA_LOG(ERR, "Start cpucopy thread fail!");
 		return -EINVAL;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index c31a6d5c98..6baa6d5955 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -136,7 +136,7 @@ iavf_dev_event_handler_init(void)
 	pthread_mutex_init(&handler->lock, NULL);
 
 	if (rte_thread_create_control(&handler->tid, "dpdk-iavf-event",
-				NULL, iavf_dev_event_handle, NULL)) {
+				iavf_dev_event_handle, NULL)) {
 		__atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED);
 		return -1;
 	}
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index ad98a531de..d3bb65874f 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -182,7 +182,7 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 	param->vf_id = vf_id;
 
 	snprintf(name, sizeof(name), "dpdk-ice-rst%u", vf_id);
-	ret = rte_thread_create_control(&thread, name, NULL,
+	ret = rte_thread_create_control(&thread, name,
 				     ice_dcf_vsi_update_service_handler, param);
 	if (ret != 0) {
 		PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7eac05ee60..64e7e5d7d6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4330,7 +4330,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
 					"dpdk-ixgbe-link",
-					NULL,
 					ixgbe_dev_setup_link_thread_handler,
 					dev) < 0) {
 					PMD_DRV_LOG(ERR,
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 6f2f5a1841..198fac8318 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2897,7 +2897,7 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				 */
 				intr->flags |= TXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
-					"dpdk-txgbe-link", NULL,
+					"dpdk-txgbe-link",
 					txgbe_dev_setup_link_thread_handler, dev) < 0) {
 					PMD_DRV_LOG(ERR, "Create link thread failed!");
 					__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 6605bd017e..07ac721da1 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -349,8 +349,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name,
 
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *attr, rte_thread_func start_routine,
-	void *arg)
+		rte_thread_func start_routine, void *arg)
 {
 	struct rte_thread_ctrl_params *params;
 	enum __rte_ctrl_thread_status ctrl_thread_status;
@@ -365,7 +364,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 	params->ret = 0;
 	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
 
-	ret = rte_thread_create(thread, attr, control_thread_start, params);
+	ret = rte_thread_create(thread, NULL, control_thread_start, params);
 	if (ret != 0) {
 		free(params);
 		return -ret;
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 6233142322..28cc5220a4 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -116,8 +116,6 @@ int rte_thread_create(rte_thread_t *thread_id,
  * @param name
  *   The name of the control thread
  *   (max RTE_THREAD_NAME_SIZE characters including '\0').
- * @param thread_attr
- *   Attributes for the new thread.
  * @param thread_func
  *   Function to be executed by the new thread.
  * @param arg
@@ -129,8 +127,7 @@ int rte_thread_create(rte_thread_t *thread_id,
 __rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *thread_attr, rte_thread_func thread_func,
-	void *arg);
+		rte_thread_func thread_func, void *arg);
 
 /**
  * @warning
diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c
index b1b1228c2b..66a49c844a 100644
--- a/lib/eal/windows/eal_interrupts.c
+++ b/lib/eal/windows/eal_interrupts.c
@@ -98,7 +98,7 @@ rte_eal_intr_init(void)
 		return -1;
 	}
 
-	ret = rte_thread_create_control(&intr_thread, "dpdk-intr", NULL,
+	ret = rte_thread_create_control(&intr_thread, "dpdk-intr",
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* RE: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental API
  2023-09-12 20:32  0%     ` Vargas, Hernan
@ 2023-09-13  9:31  0%       ` Hemant Agrawal
  0 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2023-09-13  9:31 UTC (permalink / raw)
  To: Vargas, Hernan, Chautru, Nicolas, dev, maxime.coquelin
  Cc: Rix, Tom, david.marchand

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> -----Original Message-----
> From: Vargas, Hernan <hernan.vargas@intel.com>
> Sent: Wednesday, September 13, 2023 2:03 AM
> To: Hemant Agrawal <hemant.agrawal@nxp.com>; Chautru, Nicolas
> <nicolas.chautru@intel.com>; dev@dpdk.org; maxime.coquelin@redhat.com
> Cc: Rix, Tom <trix@redhat.com>; david.marchand@redhat.com
> Subject: RE: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental
> API
> Importance: High
> 
> Hi Hemant,
> 
> Your previous ack was under the [PATCH v2 0/5] email.
> Could you please place your ack for the patch under this email?
> 
> Thanks,
> Hernan
> 
> Acked-by: Hernan Vargas <hernan.vargas@intel.com>
> 
> > -----Original Message-----
> > From: Hemant Agrawal <hemant.agrawal@oss.nxp.com>
> > Sent: Wednesday, September 6, 2023 1:17 AM
> > To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> > maxime.coquelin@redhat.com
> > Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> > david.marchand@redhat.com; Vargas, Hernan <hernan.vargas@intel.com>
> > Subject: Re: [PATCH v2 5/5] devtools: ignore changes into bbdev
> > experimental API
> >
> >
> > On 15-Jun-23 10:19 PM, Nicolas Chautru wrote:
> > > Caution: This is an external email. Please take care when clicking
> > > links or opening attachments. When in doubt, report the message
> > > using the 'Report this email' button
> > >
> > >
> > > Developpers are warned that the related fft experimental functions
> > > do not preserve ABI, hence these can be waived.
> > %s/Developpers/Developers
> > >
> > > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> > > ---
> > >   devtools/libabigail.abignore | 4 +++-
> > >   1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/devtools/libabigail.abignore
> > > b/devtools/libabigail.abignore index 7a93de3ba1..09b8f156b5 100644
> > > --- a/devtools/libabigail.abignore
> > > +++ b/devtools/libabigail.abignore
> > > @@ -30,7 +30,9 @@
> > >   [suppress_type]
> > >           type_kind = enum
> > >           changed_enumerators = RTE_CRYPTO_ASYM_XFORM_ECPM,
> > > RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> > > -
> > > +; Ignore changes to bbdev FFT API which is experimental
> > > +[suppress_type]
> > > +        name = rte_bbdev_fft_op
> > >   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > >   ; Temporary exceptions till next major ABI version ;
> > >   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > > --
> > > 2.34.1
> > >

^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental API
  2023-09-06  6:17  0%   ` Hemant Agrawal
@ 2023-09-12 20:32  0%     ` Vargas, Hernan
  2023-09-13  9:31  0%       ` Hemant Agrawal
  0 siblings, 1 reply; 200+ results
From: Vargas, Hernan @ 2023-09-12 20:32 UTC (permalink / raw)
  To: hemant.agrawal, Chautru, Nicolas, dev, maxime.coquelin
  Cc: Rix, Tom, david.marchand

Hi Hemant,

Your previous ack was under the [PATCH v2 0/5] email.
Could you please place your ack for the patch under this email?

Thanks,
Hernan

Acked-by: Hernan Vargas <hernan.vargas@intel.com>

> -----Original Message-----
> From: Hemant Agrawal <hemant.agrawal@oss.nxp.com>
> Sent: Wednesday, September 6, 2023 1:17 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> maxime.coquelin@redhat.com
> Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> david.marchand@redhat.com; Vargas, Hernan <hernan.vargas@intel.com>
> Subject: Re: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental
> API
> 
> 
> On 15-Jun-23 10:19 PM, Nicolas Chautru wrote:
> > Caution: This is an external email. Please take care when clicking
> > links or opening attachments. When in doubt, report the message using
> > the 'Report this email' button
> >
> >
> > Developpers are warned that the related fft experimental functions do
> > not preserve ABI, hence these can be waived.
> %s/Developpers/Developers
> >
> > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> > ---
> >   devtools/libabigail.abignore | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/devtools/libabigail.abignore
> > b/devtools/libabigail.abignore index 7a93de3ba1..09b8f156b5 100644
> > --- a/devtools/libabigail.abignore
> > +++ b/devtools/libabigail.abignore
> > @@ -30,7 +30,9 @@
> >   [suppress_type]
> >           type_kind = enum
> >           changed_enumerators = RTE_CRYPTO_ASYM_XFORM_ECPM,
> > RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> > -
> > +; Ignore changes to bbdev FFT API which is experimental
> > +[suppress_type]
> > +        name = rte_bbdev_fft_op
> >   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >   ; Temporary exceptions till next major ABI version ;
> >   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> > --
> > 2.34.1
> >

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
    2023-08-18  6:53  0%   ` Jie Hai
@ 2023-09-12  1:52  0%   ` Jie Hai
  2023-10-10  2:25  0%   ` Jie Hai
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-09-12  1:52 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, liudongdong3

Hi, Thomas,

Kindly ping for review.

Thanks,
Jie Hai

On 2023/7/4 17:04, Jie Hai wrote:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
> 
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
> 
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
> 
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
> 
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
> 
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
> 
> v6->v7:
> 1. Remove prod/consumer head/tail info.
> 
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
> 
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
> 

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-09-08 20:58  3%         ` Stephen Hemminger
@ 2023-09-12  1:49  0%           ` Jie Hai
  0 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-09-12  1:49 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, liudongdong3

On 2023/9/9 4:58, Stephen Hemminger wrote:
> On Fri, 8 Sep 2023 17:28:08 +0800
> Jie Hai <haijie1@huawei.com> wrote:
> 
>> Hi, Stephen Hemminger
>>
>> On 2023/9/6 23:10, Stephen Hemminger wrote:
>>> On Sat, 26 Aug 2023 15:46:03 +0800
>>> Jie Hai <haijie1@huawei.com> wrote:
>>>    
>>>> Currently, rte_eth_rss_conf supports configuring and querying
>>>> rss hash functions, rss key and it's length, but not rss hash
>>>> algorithm.
>>>>
>>>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>>>> field "func". This represents the RSS algorithms to apply. The
>>>> following API is affected:
>>>> 	- rte_eth_dev_configure
>>>> 	- rte_eth_dev_rss_hash_update
>>>> 	- rte_eth_dev_rss_hash_conf_get
>>>>
>>>> If the value of "func" used for configuration is a gibberish
>>>> value, report the error and return. Do the same for
>>>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
>>>>
>>>> To check whether the drivers report the "func" field, it is set
>>>> to default value before querying.
>>>>
>>>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>>>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
>>>
>>> This is unannounced API/ABI change.
>> Thanks for pointing that. I'm sorry I didn't pay attention to this before.
>> What should I do with this set of patches?
>> Is it feasible to send annouce now?
> 
> Since this API/ABI breaking release, I am ok taking it. But will need a release
> note. Also you should treat 0 as "no change" case to allow for code that does hash_update
> without setting the value.
> 
The release note 'doc/guides/rel_notes/release_23_11.rst' has been 
updated in this patch. Please check it.

Whether or not to treat 0 as no change depends on the implemetation of 
the driver.

According to the drivers that support algorithm modification through the
flow API, the 0 is regarded as no change.
It is believed that these drivers have the same behavior when updating 
the hash_update with setting algorithm.

For the current drivers that do hash_update without setting the 'func'
value, the implemetation does not involve the modification of the 
algorithm.

In either case, 0 is regarded as "no change".
> 
> .

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-09-08  9:28  0%       ` Jie Hai
@ 2023-09-08 20:58  3%         ` Stephen Hemminger
  2023-09-12  1:49  0%           ` Jie Hai
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-09-08 20:58 UTC (permalink / raw)
  To: Jie Hai
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, liudongdong3

On Fri, 8 Sep 2023 17:28:08 +0800
Jie Hai <haijie1@huawei.com> wrote:

> Hi, Stephen Hemminger
> 
> On 2023/9/6 23:10, Stephen Hemminger wrote:
> > On Sat, 26 Aug 2023 15:46:03 +0800
> > Jie Hai <haijie1@huawei.com> wrote:
> >   
> >> Currently, rte_eth_rss_conf supports configuring and querying
> >> rss hash functions, rss key and it's length, but not rss hash
> >> algorithm.
> >>
> >> The structure ``rte_eth_rss_conf`` is extended by adding a new
> >> field "func". This represents the RSS algorithms to apply. The
> >> following API is affected:
> >> 	- rte_eth_dev_configure
> >> 	- rte_eth_dev_rss_hash_update
> >> 	- rte_eth_dev_rss_hash_conf_get
> >>
> >> If the value of "func" used for configuration is a gibberish
> >> value, report the error and return. Do the same for
> >> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
> >>
> >> To check whether the drivers report the "func" field, it is set
> >> to default value before querying.
> >>
> >> Signed-off-by: Jie Hai <haijie1@huawei.com>
> >> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>  
> > 
> > This is unannounced API/ABI change.  
> Thanks for pointing that. I'm sorry I didn't pay attention to this before.
> What should I do with this set of patches?
> Is it feasible to send annouce now?

Since this API/ABI breaking release, I am ok taking it. But will need a release
note. Also you should treat 0 as "no change" case to allow for code that does hash_update
without setting the value.


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-09-06 15:10  3%     ` Stephen Hemminger
@ 2023-09-08  9:28  0%       ` Jie Hai
  2023-09-08 20:58  3%         ` Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: Jie Hai @ 2023-09-08  9:28 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, liudongdong3

Hi, Stephen Hemminger

On 2023/9/6 23:10, Stephen Hemminger wrote:
> On Sat, 26 Aug 2023 15:46:03 +0800
> Jie Hai <haijie1@huawei.com> wrote:
> 
>> Currently, rte_eth_rss_conf supports configuring and querying
>> rss hash functions, rss key and it's length, but not rss hash
>> algorithm.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "func". This represents the RSS algorithms to apply. The
>> following API is affected:
>> 	- rte_eth_dev_configure
>> 	- rte_eth_dev_rss_hash_update
>> 	- rte_eth_dev_rss_hash_conf_get
>>
>> If the value of "func" used for configuration is a gibberish
>> value, report the error and return. Do the same for
>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
>>
>> To check whether the drivers report the "func" field, it is set
>> to default value before querying.
>>
>> Signed-off-by: Jie Hai <haijie1@huawei.com>
>> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> 
> This is unannounced API/ABI change.
Thanks for pointing that. I'm sorry I didn't pay attention to this before.
What should I do with this set of patches?
Is it feasible to send annouce now?
> 
> .

Thanks,
Jie Hai

^ permalink raw reply	[relevance 0%]

* [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm
  2023-09-08  8:00  3%     ` [PATCH v4 0/7] support setting and querying RSS algorithms Jie Hai
@ 2023-09-08  8:00  4%       ` Jie Hai
  2023-09-20 16:39  3%         ` Ferruh Yigit
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
  1 sibling, 1 reply; 200+ results
From: Jie Hai @ 2023-09-08  8:00 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: haijie1, lihuisong

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "func". This represents the RSS algorithms to apply. The
following API will be affected:
	- rte_eth_dev_configure
	- rte_eth_dev_rss_hash_update
	- rte_eth_dev_rss_hash_conf_get

If the value of "func" used for configuration is a gibberish
value, report the error and return. Do the same for
rte_eth_dev_rss_hash_update and rte_eth_dev_configure.

To check whether the drivers report the "func" field, it is set
to default value before querying.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 lib/ethdev/rte_ethdev.c                | 17 +++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 21 +++++++++++++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 22 ++--------------------
 5 files changed, 42 insertions(+), 21 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 333e1d95a283..deb019fbe4c1 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -129,6 +129,8 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
+  algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 0840d2b5942a..4cbcdb344cac 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1445,6 +1445,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev_conf->rx_adv_conf.rss_conf.func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, dev_conf->rx_adv_conf.rss_conf.func);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
 	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
 	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
@@ -4630,6 +4638,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, rss_conf->func);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4657,6 +4672,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->func = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 40cfbb7efddd..33cec3570f85 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,26 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	/**
+	 * DEFAULT means that conformance to a specific hash algorithm is
+	 * uncared to the caller. The driver can pick the one it deems optimal.
+	 */
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -464,6 +484,7 @@ struct rte_eth_rss_conf {
 	 * Supplying an *rss_hf* equal to zero disables the RSS feature.
 	 */
 	uint64_t rss_hf;
+	enum rte_eth_hash_function func;	/**< Hash algorithm. */
 };
 
 /*
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 271d854f7807..d3f2d466d841 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -12,7 +12,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 3bd0dc64fbe2..a7578b1d2eff 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3183,26 +3185,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	/**
-	 * DEFAULT means that conformance to a specific hash algorithm is
-	 * uncared to the caller. The driver can pick the one it deems optimal.
-	 */
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.30.0


^ permalink raw reply	[relevance 4%]

* [PATCH v4 0/7] support setting and querying RSS algorithms
  2023-09-04  7:28  3%   ` [PATCH " Jie Hai
  2023-09-04  7:28  4%     ` [PATCH 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-09-08  8:00  3%     ` Jie Hai
  2023-09-08  8:00  4%       ` [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
  1 sibling, 2 replies; 200+ results
From: Jie Hai @ 2023-09-08  8:00 UTC (permalink / raw)
  To: dev; +Cc: haijie1, lihuisong

This patchset is to support setting and querying RSS algorithms.

--
v4:
1. recomment some definitions related to RSS.
2. allocate static memory for rss_key instead of dynamic.
3. use array of strings to get the name of rss algorithm.
4. add display of rss algorithm with testpmd.

v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.


Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (6):
  ethdev: recomment some definitions related to RSS
  ethdev: support setting and querying RSS algorithm
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display

 app/proc-info/main.c                   | 31 +++++++++++-----
 app/test-pmd/cmdline.c                 | 29 ++++++++++++---
 app/test-pmd/config.c                  | 36 +++++++++----------
 app/test-pmd/testpmd.h                 |  2 +-
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 drivers/net/hns3/hns3_rss.c            | 47 +++++++++++++-----------
 lib/ethdev/rte_ethdev.c                | 17 +++++++++
 lib/ethdev/rte_ethdev.h                | 49 ++++++++++++++++++--------
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 18 ++--------
 10 files changed, 146 insertions(+), 86 deletions(-)

-- 
2.30.0


^ permalink raw reply	[relevance 3%]

* Re: [PATCH 10/11] eal: remove deprecated thread functions
  2023-09-06 16:12  4% ` [PATCH 10/11] eal: remove deprecated thread functions Thomas Monjalon
@ 2023-09-08  4:22  0%   ` Tyler Retzlaff
  0 siblings, 0 replies; 200+ results
From: Tyler Retzlaff @ 2023-09-08  4:22 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, David Marchand, Ferruh Yigit, Anatoly Burakov,
	Bruce Richardson, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam

On Wed, Sep 06, 2023 at 06:12:27PM +0200, Thomas Monjalon wrote:
> The deprecated functions rte_thread_setname() and rte_ctrl_thread_create()
> are replaced with the new rte_thread API:
> 
> 	rte_thread_setname()
> can be replaced with
> 	rte_thread_set_name()
> or	rte_thread_set_prefixed_name()
> 
> 	rte_ctrl_thread_create()
> can be replaced with
> 	rte_thread_create_control()
> or	rte_thread_create_internal_control()
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

with suggestions.

...

>  ABI Changes
> diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
> index 31c37e3102..78f643af73 100644
> --- a/lib/eal/common/eal_common_thread.c
> +++ b/lib/eal/common/eal_common_thread.c
> @@ -248,7 +248,7 @@ struct rte_thread_ctrl_params {
>  	enum __rte_ctrl_thread_status ctrl_thread_status;
>  };

the code above here

struct rte_thread_ctrl_params i think can now get renamed to
rte_thread_control_params and i think we can get rid of the union.
if i look through the code history i only added it to help maintain
compatibility while we had both ctrl and control thread APIs.

>  
> -static int ctrl_thread_init(void *arg)
> +static int control_thread_init(void *arg)
>  {
>  	struct internal_config *internal_conf =
>  		eal_get_internal_configuration();
> @@ -273,80 +273,18 @@ static int ctrl_thread_init(void *arg)
>  	return 0;
>  }

^ permalink raw reply	[relevance 0%]

* [PATCH 10/11] eal: remove deprecated thread functions
    2023-09-06 16:12  3% ` [PATCH 03/11] eal: remove attributes from control thread creation Thomas Monjalon
  2023-09-06 16:12  3% ` [PATCH 04/11] eal: promote thread API as stable Thomas Monjalon
@ 2023-09-06 16:12  4% ` Thomas Monjalon
  2023-09-08  4:22  0%   ` Tyler Retzlaff
      4 siblings, 1 reply; 200+ results
From: Thomas Monjalon @ 2023-09-06 16:12 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Anatoly Burakov,
	Bruce Richardson, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam

The deprecated functions rte_thread_setname() and rte_ctrl_thread_create()
are replaced with the new rte_thread API:

	rte_thread_setname()
can be replaced with
	rte_thread_set_name()
or	rte_thread_set_prefixed_name()

	rte_ctrl_thread_create()
can be replaced with
	rte_thread_create_control()
or	rte_thread_create_internal_control()

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 .../prog_guide/env_abstraction_layer.rst      |  2 +-
 doc/guides/rel_notes/deprecation.rst          |  5 --
 doc/guides/rel_notes/release_23_11.rst        |  4 +-
 lib/eal/common/eal_common_thread.c            | 66 +------------------
 lib/eal/freebsd/eal_thread.c                  |  7 --
 lib/eal/include/rte_lcore.h                   | 42 ------------
 lib/eal/linux/eal_thread.c                    | 16 -----
 lib/eal/version.map                           |  2 -
 lib/eal/windows/eal_thread.c                  |  8 ---
 9 files changed, 6 insertions(+), 146 deletions(-)

diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
index 89014789de..6debf54efb 100644
--- a/doc/guides/prog_guide/env_abstraction_layer.rst
+++ b/doc/guides/prog_guide/env_abstraction_layer.rst
@@ -756,7 +756,7 @@ Control Thread API
 ~~~~~~~~~~~~~~~~~~
 
 It is possible to create Control Threads using the public API
-``rte_ctrl_thread_create()``.
+``rte_thread_create_control()``.
 Those threads can be used for management/infrastructure tasks and are used
 internally by DPDK for multi process support and interrupt handling.
 
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 3e48908b51..8c8873006d 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -29,11 +29,6 @@ Deprecation Notices
   are renamed to ``rte_tel_data_add_array_uint`` and ``rte_tel_data_add_dict_uint`` respectively.
   As such, the old function names are deprecated and will be removed in a future release.
 
-* eal: The functions ``rte_thread_setname`` and ``rte_ctrl_thread_create``
-  are planned to be deprecated starting with the 23.07 release, subject to
-  the replacement API rte_thread_set_name and rte_thread_create_control being
-  marked as stable, and planned to be removed by the 23.11 release.
-
 * eal: ``RTE_CPUFLAG_NUMFLAGS`` will be removed in DPDK 23.11 release.
   This is to allow new CPU features to be added without ABI breakage.
 
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d7562fd646..9746809a66 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,7 +115,9 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
-  The whole thread API was promoted to stable level.
+  The whole thread API was promoted to stable level,
+  except ``rte_thread_setname()`` and ``rte_ctrl_thread_create()`` which are
+  replaced with ``rte_thread_set_name()`` and ``rte_thread_create_control()``.
 
 
 ABI Changes
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 31c37e3102..78f643af73 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -248,7 +248,7 @@ struct rte_thread_ctrl_params {
 	enum __rte_ctrl_thread_status ctrl_thread_status;
 };
 
-static int ctrl_thread_init(void *arg)
+static int control_thread_init(void *arg)
 {
 	struct internal_config *internal_conf =
 		eal_get_internal_configuration();
@@ -273,80 +273,18 @@ static int ctrl_thread_init(void *arg)
 	return 0;
 }
 
-static void *ctrl_thread_start(void *arg)
-{
-	struct rte_thread_ctrl_params *params = arg;
-	void *start_arg = params->arg;
-	void *(*start_routine)(void *) = params->u.ctrl_start_routine;
-
-	if (ctrl_thread_init(arg) != 0)
-		return NULL;
-
-	return start_routine(start_arg);
-}
-
 static uint32_t control_thread_start(void *arg)
 {
 	struct rte_thread_ctrl_params *params = arg;
 	void *start_arg = params->arg;
 	rte_thread_func start_routine = params->u.control_start_routine;
 
-	if (ctrl_thread_init(arg) != 0)
+	if (control_thread_init(arg) != 0)
 		return 0;
 
 	return start_routine(start_arg);
 }
 
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg)
-{
-	struct rte_thread_ctrl_params *params;
-	enum __rte_ctrl_thread_status ctrl_thread_status;
-	int ret;
-
-	params = malloc(sizeof(*params));
-	if (!params)
-		return -ENOMEM;
-
-	params->u.ctrl_start_routine = start_routine;
-	params->arg = arg;
-	params->ret = 0;
-	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
-
-	ret = pthread_create(thread, attr, ctrl_thread_start, (void *)params);
-	if (ret != 0) {
-		free(params);
-		return -ret;
-	}
-
-	if (name != NULL)
-		rte_thread_set_name((rte_thread_t){(uintptr_t)*thread}, name);
-
-	/* Wait for the control thread to initialize successfully */
-	while ((ctrl_thread_status =
-			__atomic_load_n(&params->ctrl_thread_status,
-			__ATOMIC_ACQUIRE)) == CTRL_THREAD_LAUNCHING) {
-		/* Yield the CPU. Using sched_yield call requires maintaining
-		 * another implementation for Windows as sched_yield is not
-		 * supported on Windows.
-		 */
-		rte_delay_us_sleep(1);
-	}
-
-	/* Check if the control thread encountered an error */
-	if (ctrl_thread_status == CTRL_THREAD_ERROR) {
-		/* ctrl thread is exiting */
-		rte_thread_join((rte_thread_t){(uintptr_t)*thread}, NULL);
-	}
-
-	ret = params->ret;
-	free(params);
-
-	return -ret;
-}
-
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func start_routine, void *arg)
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index ba9b25c2c0..6f97a3c2c1 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -42,10 +42,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 
 	pthread_set_name_np((pthread_t)thread_id.opaque_id, truncated);
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	/* this BSD function returns no error */
-	pthread_set_name_np(id, name);
-	return 0;
-}
diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h
index 6ce810b876..7deae47af3 100644
--- a/lib/eal/include/rte_lcore.h
+++ b/lib/eal/include/rte_lcore.h
@@ -385,20 +385,6 @@ void rte_lcore_register_usage_cb(rte_lcore_usage_cb cb);
 void
 rte_lcore_dump(FILE *f);
 
-/**
- * Set thread names.
- *
- * @note It fails with glibc < 2.12.
- *
- * @param id
- *   Thread id.
- * @param name
- *   Thread name to set.
- * @return
- *   On success, return 0; otherwise return a negative value.
- */
-int rte_thread_setname(pthread_t id, const char *name);
-
 /**
  * Register current non-EAL thread as a lcore.
  *
@@ -421,34 +407,6 @@ rte_thread_register(void);
 void
 rte_thread_unregister(void);
 
-/**
- * Create a control thread.
- *
- * Creates a control thread with the given name and attributes. The
- * affinity of the new thread is based on the CPU affinity retrieved
- * at the time rte_eal_init() was called, the dataplane and service
- * lcores are then excluded. If setting the name of the thread fails,
- * the error is ignored and a debug message is logged.
- *
- * @param thread
- *   Filled with the thread id of the new created thread.
- * @param name
- *   The name of the control thread (max 16 characters including '\0').
- * @param attr
- *   Attributes for the new thread.
- * @param start_routine
- *   Function to be executed by the new thread.
- * @param arg
- *   Argument passed to start_routine.
- * @return
- *   On success, returns 0; on error, it returns a negative value
- *   corresponding to the error number.
- */
-int
-rte_ctrl_thread_create(pthread_t *thread, const char *name,
-		const pthread_attr_t *attr,
-		void *(*start_routine)(void *), void *arg);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/eal/linux/eal_thread.c b/lib/eal/linux/eal_thread.c
index b9a126f3a8..880070c627 100644
--- a/lib/eal/linux/eal_thread.c
+++ b/lib/eal/linux/eal_thread.c
@@ -39,19 +39,3 @@ void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name)
 	if (ret != 0)
 		RTE_LOG(DEBUG, EAL, "Failed to set thread name\n");
 }
-
-int rte_thread_setname(pthread_t id, const char *name)
-{
-	int ret = ENOSYS;
-#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-#if __GLIBC_PREREQ(2, 12)
-	char truncated[16];
-
-	strlcpy(truncated, name, sizeof(truncated));
-	ret = pthread_setname_np(id, truncated);
-#endif
-#endif
-	RTE_SET_USED(id);
-	RTE_SET_USED(name);
-	return -ret;
-}
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 6d32c19286..915057b325 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -20,7 +20,6 @@ DPDK_24 {
 	rte_cpu_get_flag_enabled;
 	rte_cpu_get_flag_name;
 	rte_cpu_is_supported; # WINDOWS_NO_EXPORT
-	rte_ctrl_thread_create;
 	rte_cycles_vmware_tsc_map; # WINDOWS_NO_EXPORT
 	rte_delay_us;
 	rte_delay_us_block;
@@ -278,7 +277,6 @@ DPDK_24 {
 	rte_thread_set_affinity_by_id;
 	rte_thread_set_name;
 	rte_thread_set_priority;
-	rte_thread_setname;
 	rte_thread_unregister;
 	rte_thread_value_get;
 	rte_thread_value_set;
diff --git a/lib/eal/windows/eal_thread.c b/lib/eal/windows/eal_thread.c
index 464d510838..9e3df200b9 100644
--- a/lib/eal/windows/eal_thread.c
+++ b/lib/eal/windows/eal_thread.c
@@ -76,11 +76,3 @@ rte_sys_gettid(void)
 {
 	return GetCurrentThreadId();
 }
-
-int
-rte_thread_setname(__rte_unused pthread_t id, __rte_unused const char *name)
-{
-	/* TODO */
-	/* This is a stub, not the expected result */
-	return 0;
-}
-- 
2.42.0


^ permalink raw reply	[relevance 4%]

* [PATCH 04/11] eal: promote thread API as stable
    2023-09-06 16:12  3% ` [PATCH 03/11] eal: remove attributes from control thread creation Thomas Monjalon
@ 2023-09-06 16:12  3% ` Thomas Monjalon
  2023-09-06 16:12  4% ` [PATCH 10/11] eal: remove deprecated thread functions Thomas Monjalon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit

The rte_thread API must be used to ease OS porting.
One step of this process is to mark the necessary API as stable.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/rel_notes/release_23_11.rst |  1 +
 lib/eal/include/rte_thread.h           | 64 --------------------------
 lib/eal/version.map                    | 40 ++++++++--------
 3 files changed, 20 insertions(+), 85 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index d3d500f294..d7562fd646 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -115,6 +115,7 @@ API Changes
 
 * eal: The thread API has changed.
   The function ``rte_thread_create_control()`` does not take attributes anymore.
+  The whole thread API was promoted to stable level.
 
 
 ABI Changes
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 28cc5220a4..dd1f62523f 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -73,9 +73,6 @@ typedef struct {
 typedef struct eal_tls_key *rte_thread_key;
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a new thread that will invoke the 'thread_func' routine.
  *
  * @param thread_id
@@ -94,15 +91,11 @@ typedef struct eal_tls_key *rte_thread_key;
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_create(rte_thread_t *thread_id,
 		const rte_thread_attr_t *thread_attr,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Create a control thread.
  *
  * Creates a control thread with the given name and attributes. The
@@ -124,15 +117,11 @@ int rte_thread_create(rte_thread_t *thread_id,
  *   On success, returns 0; on error, it returns a negative value
  *   corresponding to the error number.
  */
-__rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
 		rte_thread_func thread_func, void *arg);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Waits for the thread identified by 'thread_id' to terminate
  *
  * @param thread_id
@@ -145,13 +134,9 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Indicate that the return value of the thread is not needed and
  * all thread resources should be release when the thread terminates.
  *
@@ -162,25 +147,17 @@ int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_detach(rte_thread_t thread_id);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the id of the calling thread.
  *
  * @return
  *   Return the thread id of the calling thread.
  */
-__rte_experimental
 rte_thread_t rte_thread_self(void);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the name of the thread.
  * This API is a noop if the underlying platform does not
  * support setting the thread name or the platform-specific
@@ -193,14 +170,10 @@ rte_thread_t rte_thread_self(void);
  *    The name to set. Truncated to RTE_THREAD_NAME_SIZE,
  *    including terminating NUL if necessary.
  */
-__rte_experimental
 void
 rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Check if 2 thread ids are equal.
  *
  * @param t1
@@ -213,13 +186,9 @@ rte_thread_set_name(rte_thread_t thread_id, const char *thread_name);
  *   If the ids are equal, return nonzero.
  *   Otherwise, return 0.
  */
-__rte_experimental
 int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Initialize the attributes of a thread.
  * These attributes can be passed to the rte_thread_create() function
  * that will create a new thread and set its attributes according to attr.
@@ -231,13 +200,9 @@ int rte_thread_equal(rte_thread_t t1, rte_thread_t t2);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_init(rte_thread_attr_t *attr);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the thread priority value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -251,16 +216,12 @@ int rte_thread_attr_init(rte_thread_attr_t *attr);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
 		enum rte_thread_priority priority);
 
 #ifdef RTE_HAS_CPUSET
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the CPU affinity value in the thread attributes pointed to
  * by 'thread_attr'.
  *
@@ -274,14 +235,10 @@ int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the value of CPU affinity that is set in the thread attributes pointed
  * to by 'thread_attr'.
  *
@@ -295,14 +252,10 @@ int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
 		rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the affinity of thread 'thread_id' to the cpu set
  * specified by 'cpuset'.
  *
@@ -316,14 +269,10 @@ int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
 		const rte_cpuset_t *cpuset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the affinity of thread 'thread_id' and store it
  * in 'cpuset'.
  *
@@ -337,7 +286,6 @@ int rte_thread_set_affinity_by_id(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_affinity_by_id(rte_thread_t thread_id,
 		rte_cpuset_t *cpuset);
 
@@ -364,9 +312,6 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
 #endif /* RTE_HAS_CPUSET */
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Get the priority of a thread.
  *
  * @param thread_id
@@ -379,14 +324,10 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_get_priority(rte_thread_t thread_id,
 		enum rte_thread_priority *priority);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
  * Set the priority of a thread.
  *
  * @param thread_id
@@ -399,7 +340,6 @@ int rte_thread_get_priority(rte_thread_t thread_id,
  *   On success, return 0.
  *   On failure, return a positive errno-style error number.
  */
-__rte_experimental
 int rte_thread_set_priority(rte_thread_t thread_id,
 		enum rte_thread_priority priority);
 
@@ -421,7 +361,6 @@ int rte_thread_set_priority(rte_thread_t thread_id,
  *                     ENOEXEC - Specific OS error.
  */
 
-__rte_experimental
 int rte_thread_key_create(rte_thread_key *key,
 			void (*destructor)(void *));
 
@@ -437,7 +376,6 @@ int rte_thread_key_create(rte_thread_key *key,
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_key_delete(rte_thread_key key);
 
 /**
@@ -454,7 +392,6 @@ int rte_thread_key_delete(rte_thread_key key);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 int rte_thread_value_set(rte_thread_key key, const void *value);
 
 /**
@@ -469,7 +406,6 @@ int rte_thread_value_set(rte_thread_key key, const void *value);
  *   rte_errno can be: EINVAL  - Invalid parameter passed.
  *                     ENOEXEC - Specific OS error.
  */
-__rte_experimental
 void *rte_thread_value_get(rte_thread_key key);
 
 #ifdef __cplusplus
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 7940431e5a..33b853d7be 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -257,12 +257,31 @@ DPDK_24 {
 	rte_strscpy;
 	rte_strsplit;
 	rte_sys_gettid;
+	rte_thread_attr_get_affinity;
+	rte_thread_attr_init;
+	rte_thread_attr_set_affinity;
+	rte_thread_attr_set_priority;
+	rte_thread_create;
+	rte_thread_create_control;
+	rte_thread_detach;
+	rte_thread_equal;
 	rte_thread_get_affinity;
+	rte_thread_get_affinity_by_id;
+	rte_thread_get_priority;
 	rte_thread_is_intr;
+	rte_thread_join;
+	rte_thread_key_create;
+	rte_thread_key_delete;
 	rte_thread_register;
+	rte_thread_self;
 	rte_thread_set_affinity;
+	rte_thread_set_affinity_by_id;
+	rte_thread_set_name;
+	rte_thread_set_priority;
 	rte_thread_setname;
 	rte_thread_unregister;
+	rte_thread_value_get;
+	rte_thread_value_set;
 	rte_uuid_compare;
 	rte_uuid_is_null;
 	rte_uuid_parse;
@@ -368,10 +387,6 @@ EXPERIMENTAL {
 	# added in 21.05
 	rte_devargs_reset;
 	rte_intr_callback_unregister_sync;
-	rte_thread_key_create;
-	rte_thread_key_delete;
-	rte_thread_value_get;
-	rte_thread_value_set;
 	rte_version_minor;
 	rte_version_month;
 	rte_version_prefix;
@@ -392,26 +407,9 @@ EXPERIMENTAL {
 
 	# added in 22.07
 	rte_drand;
-	rte_thread_get_affinity_by_id;
-	rte_thread_get_priority;
-	rte_thread_self;
-	rte_thread_set_affinity_by_id;
-	rte_thread_set_priority;
-
-	# added in 22.11
-	rte_thread_attr_get_affinity;
-	rte_thread_attr_init;
-	rte_thread_attr_set_affinity;
-	rte_thread_attr_set_priority;
-	rte_thread_create;
-	rte_thread_detach;
-	rte_thread_equal;
-	rte_thread_join;
 
 	# added in 23.03
 	rte_lcore_register_usage_cb;
-	rte_thread_create_control;
-	rte_thread_set_name;
 	__rte_eal_trace_generic_blob;
 
 	# added in 23.07
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* [PATCH 03/11] eal: remove attributes from control thread creation
  @ 2023-09-06 16:12  3% ` Thomas Monjalon
  2023-09-06 16:12  3% ` [PATCH 04/11] eal: promote thread API as stable Thomas Monjalon
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Thomas Monjalon @ 2023-09-06 16:12 UTC (permalink / raw)
  To: dev
  Cc: Tyler Retzlaff, David Marchand, Ferruh Yigit, Chengwen Feng,
	Kevin Laatz, Bruce Richardson, Jingjing Wu, Beilei Xing,
	Qiming Yang, Qi Zhang, Wenjun Wu, Jiawen Wu, Jian Wang,
	Harman Kalra, Dmitry Kozlyuk, Narcisa Ana Maria Vasile,
	Dmitry Malloy, Pallavi Kadam

The experimental function rte_thread_create_control()
is supposed to wrap actions needed to create a control thread in DPDK.
This function should be easy to port on any OS.

As such, the thread attributes should not be customizable in this API.
The thread priority should be normal, and the affinity is on "free cores".
That's why the custom attributes parameter thread_attr is dropped.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test/test_threads.c                | 2 +-
 doc/guides/rel_notes/release_23_11.rst | 3 +++
 drivers/dma/skeleton/skeleton_dmadev.c | 3 +--
 drivers/net/iavf/iavf_vchnl.c          | 2 +-
 drivers/net/ice/ice_dcf_parent.c       | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 1 -
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 lib/eal/common/eal_common_thread.c     | 5 ++---
 lib/eal/include/rte_thread.h           | 5 +----
 lib/eal/windows/eal_interrupts.c       | 2 +-
 10 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index 8c27e2bae1..4ac3f2671a 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -240,7 +240,7 @@ test_thread_control_create_join(void)
 
 	thread_id_ready = 0;
 	RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc",
-		NULL, thread_main, &thread_main_id) == 0,
+		thread_main, &thread_main_id) == 0,
 		"Failed to create thread.");
 
 	while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0)
diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 333e1d95a2..d3d500f294 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -113,6 +113,9 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* eal: The thread API has changed.
+  The function ``rte_thread_create_control()`` does not take attributes anymore.
+
 
 ABI Changes
 -----------
diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index 493224542f..4fc2319668 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -128,8 +128,7 @@ skeldma_start(struct rte_dma_dev *dev)
 	rte_mb();
 
 	snprintf(name, sizeof(name), "dpdk-dma-skel%d", dev->data->dev_id);
-	ret = rte_thread_create_control(&hw->thread, name, NULL,
-				     cpucopy_thread, dev);
+	ret = rte_thread_create_control(&hw->thread, name, cpucopy_thread, dev);
 	if (ret) {
 		SKELDMA_LOG(ERR, "Start cpucopy thread fail!");
 		return -EINVAL;
diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index c31a6d5c98..6baa6d5955 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -136,7 +136,7 @@ iavf_dev_event_handler_init(void)
 	pthread_mutex_init(&handler->lock, NULL);
 
 	if (rte_thread_create_control(&handler->tid, "dpdk-iavf-event",
-				NULL, iavf_dev_event_handle, NULL)) {
+				iavf_dev_event_handle, NULL)) {
 		__atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED);
 		return -1;
 	}
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index ad98a531de..d3bb65874f 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -182,7 +182,7 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id)
 	param->vf_id = vf_id;
 
 	snprintf(name, sizeof(name), "dpdk-ice-rst%u", vf_id);
-	ret = rte_thread_create_control(&thread, name, NULL,
+	ret = rte_thread_create_control(&thread, name,
 				     ice_dcf_vsi_update_service_handler, param);
 	if (ret != 0) {
 		PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 7eac05ee60..64e7e5d7d6 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4330,7 +4330,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
 					"dpdk-ixgbe-link",
-					NULL,
 					ixgbe_dev_setup_link_thread_handler,
 					dev) < 0) {
 					PMD_DRV_LOG(ERR,
diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index 6f2f5a1841..198fac8318 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2897,7 +2897,7 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev,
 				 */
 				intr->flags |= TXGBE_FLAG_NEED_LINK_CONFIG;
 				if (rte_thread_create_control(&ad->link_thread_tid,
-					"dpdk-txgbe-link", NULL,
+					"dpdk-txgbe-link",
 					txgbe_dev_setup_link_thread_handler, dev) < 0) {
 					PMD_DRV_LOG(ERR, "Create link thread failed!");
 					__atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST);
diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c
index 6605bd017e..07ac721da1 100644
--- a/lib/eal/common/eal_common_thread.c
+++ b/lib/eal/common/eal_common_thread.c
@@ -349,8 +349,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name,
 
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *attr, rte_thread_func start_routine,
-	void *arg)
+		rte_thread_func start_routine, void *arg)
 {
 	struct rte_thread_ctrl_params *params;
 	enum __rte_ctrl_thread_status ctrl_thread_status;
@@ -365,7 +364,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name,
 	params->ret = 0;
 	params->ctrl_thread_status = CTRL_THREAD_LAUNCHING;
 
-	ret = rte_thread_create(thread, attr, control_thread_start, params);
+	ret = rte_thread_create(thread, NULL, control_thread_start, params);
 	if (ret != 0) {
 		free(params);
 		return -ret;
diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h
index 6233142322..28cc5220a4 100644
--- a/lib/eal/include/rte_thread.h
+++ b/lib/eal/include/rte_thread.h
@@ -116,8 +116,6 @@ int rte_thread_create(rte_thread_t *thread_id,
  * @param name
  *   The name of the control thread
  *   (max RTE_THREAD_NAME_SIZE characters including '\0').
- * @param thread_attr
- *   Attributes for the new thread.
  * @param thread_func
  *   Function to be executed by the new thread.
  * @param arg
@@ -129,8 +127,7 @@ int rte_thread_create(rte_thread_t *thread_id,
 __rte_experimental
 int
 rte_thread_create_control(rte_thread_t *thread, const char *name,
-	const rte_thread_attr_t *thread_attr, rte_thread_func thread_func,
-	void *arg);
+		rte_thread_func thread_func, void *arg);
 
 /**
  * @warning
diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c
index b1b1228c2b..66a49c844a 100644
--- a/lib/eal/windows/eal_interrupts.c
+++ b/lib/eal/windows/eal_interrupts.c
@@ -98,7 +98,7 @@ rte_eal_intr_init(void)
 		return -1;
 	}
 
-	ret = rte_thread_create_control(&intr_thread, "dpdk-intr", NULL,
+	ret = rte_thread_create_control(&intr_thread, "dpdk-intr",
 			eal_intr_thread_main, NULL);
 	if (ret != 0) {
 		rte_errno = -ret;
-- 
2.42.0


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-26  7:46  5%   ` [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-08-30 11:46  0%     ` Thomas Monjalon
@ 2023-09-06 15:10  3%     ` Stephen Hemminger
  2023-09-08  9:28  0%       ` Jie Hai
  1 sibling, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-09-06 15:10 UTC (permalink / raw)
  To: Jie Hai
  Cc: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, liudongdong3

On Sat, 26 Aug 2023 15:46:03 +0800
Jie Hai <haijie1@huawei.com> wrote:

> Currently, rte_eth_rss_conf supports configuring and querying
> rss hash functions, rss key and it's length, but not rss hash
> algorithm.
> 
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "func". This represents the RSS algorithms to apply. The
> following API is affected:
> 	- rte_eth_dev_configure
> 	- rte_eth_dev_rss_hash_update
> 	- rte_eth_dev_rss_hash_conf_get
> 
> If the value of "func" used for configuration is a gibberish
> value, report the error and return. Do the same for
> rte_eth_dev_rss_hash_update and rte_eth_dev_configure.
> 
> To check whether the drivers report the "func" field, it is set
> to default value before querying.
> 
> Signed-off-by: Jie Hai <haijie1@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>

This is unannounced API/ABI change.

^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 0/5] bbdev: API extension for 23.11
                     ` (2 preceding siblings ...)
  @ 2023-09-06  6:20  0% ` Hemant Agrawal
  2023-09-21  7:35  0% ` Maxime Coquelin
  4 siblings, 0 replies; 200+ results
From: Hemant Agrawal @ 2023-09-06  6:20 UTC (permalink / raw)
  To: Nicolas Chautru, dev, maxime.coquelin
  Cc: trix, hemant.agrawal, david.marchand, hernan.vargas

Hi Nic,

     One small comment in the commit message.

Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>

Regards

Hemant

On 15-Jun-23 10:18 PM, Nicolas Chautru wrote:
> Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
>
>
> v2: moving the new mld functions at the end of struct rte_bbdev to avoid
> ABI offset changes based on feedback with Maxime.
> Adding a commit to waive the FFT ABI warning since that experimental function
> could break ABI (let me know if preferred to be merged with the FFT
> commit causing the FFT change).
>
>
> Including v1 for extending the bbdev api for 23.11.
> The new MLD-TS is expected to be non ABI compatible, the other ones
> should not break ABI.
> I will send a deprecation notice in parallel.
>
> This introduces a new operation (on top of FEC and FFT) to support
> equalization for MLD-TS. There also more modular API extension for
> existing FFT and FEC operation.
>
> Thanks
> Nic
>
>
> Nicolas Chautru (5):
>    bbdev: add operation type for MLDTS procession
>    bbdev: add new capabilities for FFT processing
>    bbdev: add new capability for FEC 5G UL processing
>    bbdev: improving error handling for queue configuration
>    devtools: ignore changes into bbdev experimental API
>
>   devtools/libabigail.abignore    |   4 +-
>   doc/guides/prog_guide/bbdev.rst |  83 ++++++++++++++++++
>   lib/bbdev/rte_bbdev.c           |  26 +++---
>   lib/bbdev/rte_bbdev.h           |  76 +++++++++++++++++
>   lib/bbdev/rte_bbdev_op.h        | 143 +++++++++++++++++++++++++++++++-
>   lib/bbdev/version.map           |   5 ++
>   6 files changed, 323 insertions(+), 14 deletions(-)
>
> --
> 2.34.1
>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 5/5] devtools: ignore changes into bbdev experimental API
  @ 2023-09-06  6:17  0%   ` Hemant Agrawal
  2023-09-12 20:32  0%     ` Vargas, Hernan
  2023-09-18 15:22  0%   ` Maxime Coquelin
  1 sibling, 1 reply; 200+ results
From: Hemant Agrawal @ 2023-09-06  6:17 UTC (permalink / raw)
  To: Nicolas Chautru, dev, maxime.coquelin
  Cc: trix, hemant.agrawal, david.marchand, hernan.vargas


On 15-Jun-23 10:19 PM, Nicolas Chautru wrote:
> Caution: This is an external email. Please take care when clicking links or opening attachments. When in doubt, report the message using the 'Report this email' button
>
>
> Developpers are warned that the related fft experimental functions
> do not preserve ABI, hence these can be waived.
%s/Developpers/Developers
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> ---
>   devtools/libabigail.abignore | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 7a93de3ba1..09b8f156b5 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -30,7 +30,9 @@
>   [suppress_type]
>           type_kind = enum
>           changed_enumerators = RTE_CRYPTO_ASYM_XFORM_ECPM, RTE_CRYPTO_ASYM_XFORM_TYPE_LIST_END
> -
> +; Ignore changes to bbdev FFT API which is experimental
> +[suppress_type]
> +        name = rte_bbdev_fft_op
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>   ; Temporary exceptions till next major ABI version ;
>   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> --
> 2.34.1
>

^ permalink raw reply	[relevance 0%]

* RE: [PATCH v2 0/5] bbdev: API extension for 23.11
  @ 2023-09-05 17:48  0%     ` Chautru, Nicolas
  0 siblings, 0 replies; 200+ results
From: Chautru, Nicolas @ 2023-09-05 17:48 UTC (permalink / raw)
  To: Vargas, Hernan, dev, maxime.coquelin, hemant.agrawal
  Cc: Rix, Tom, david.marchand

Hi Maxime, Hemant, 

Can we please get some extra review/ack for this bbdev serie. I would be good to apply on the baseband repo soon towards 23.11. 
Much appreciated!
Nic

> -----Original Message-----
> From: Vargas, Hernan <hernan.vargas@intel.com>
> Sent: Friday, August 4, 2023 9:14 AM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> maxime.coquelin@redhat.com
> Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> david.marchand@redhat.com
> Subject: RE: [PATCH v2 0/5] bbdev: API extension for 23.11
> 
> Hi Maxime,
> 
> Kind reminder to get a review on this series:
> https://patchwork.dpdk.org/project/dpdk/list/?series=28544
> 
> Thanks,
> Hernan
> 
> > -----Original Message-----
> > From: Chautru, Nicolas <nicolas.chautru@intel.com>
> > Sent: Monday, July 17, 2023 5:29 PM
> > To: dev@dpdk.org; maxime.coquelin@redhat.com
> > Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> > david.marchand@redhat.com; Vargas, Hernan
> <hernan.vargas@intel.com>
> > Subject: RE: [PATCH v2 0/5] bbdev: API extension for 23.11
> >
> > Hi Maxime, Hemant,
> > Can I get some review/ack for this serie please.
> > Thanks
> > Nic
> >
> > > -----Original Message-----
> > > From: Chautru, Nicolas <nicolas.chautru@intel.com>
> > > Sent: Thursday, June 15, 2023 9:49 AM
> > > To: dev@dpdk.org; maxime.coquelin@redhat.com
> > > Cc: Rix, Tom <trix@redhat.com>; hemant.agrawal@nxp.com;
> > > david.marchand@redhat.com; Vargas, Hernan
> <hernan.vargas@intel.com>;
> > > Chautru, Nicolas <nicolas.chautru@intel.com>
> > > Subject: [PATCH v2 0/5] bbdev: API extension for 23.11
> > >
> > > v2: moving the new mld functions at the end of struct rte_bbdev to
> > > avoid ABI offset changes based on feedback with Maxime.
> > > Adding a commit to waive the FFT ABI warning since that experimental
> > > function could break ABI (let me know if preferred to be merged with
> > > the FFT commit causing the FFT change).
> > >
> > >
> > > Including v1 for extending the bbdev api for 23.11.
> > > The new MLD-TS is expected to be non ABI compatible, the other ones
> > > should not break ABI.
> > > I will send a deprecation notice in parallel.
> > >
> > > This introduces a new operation (on top of FEC and FFT) to support
> > > equalization for MLD-TS. There also more modular API extension for
> > > existing FFT and FEC operation.
> > >
> > > Thanks
> > > Nic
> > >
> > >
> > > Nicolas Chautru (5):
> > >   bbdev: add operation type for MLDTS procession
> > >   bbdev: add new capabilities for FFT processing
> > >   bbdev: add new capability for FEC 5G UL processing
> > >   bbdev: improving error handling for queue configuration
> > >   devtools: ignore changes into bbdev experimental API
> > >
> > >  devtools/libabigail.abignore    |   4 +-
> > >  doc/guides/prog_guide/bbdev.rst |  83 ++++++++++++++++++
> > >  lib/bbdev/rte_bbdev.c           |  26 +++---
> > >  lib/bbdev/rte_bbdev.h           |  76 +++++++++++++++++
> > >  lib/bbdev/rte_bbdev_op.h        | 143
> > > +++++++++++++++++++++++++++++++-
> > >  lib/bbdev/version.map           |   5 ++
> > >  6 files changed, 323 insertions(+), 14 deletions(-)
> > >
> > > --
> > > 2.34.1


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v3 0/5] support setting and querying RSS algorithms
  2023-09-04  6:10  3%   ` [PATCH v3 0/5] support setting and querying RSS algorithms Jie Hai
@ 2023-09-04  7:37  0%     ` Jie Hai
  0 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-09-04  7:37 UTC (permalink / raw)
  To: dev; +Cc: lihuisong

Hi, ALL

Sorry, please drop this patchset.
Here is V3
https://inbox.dpdk.org/dev/20230904072851.7384-1-haijie1@huawei.com/

Thanks,
Jie Hai

On 2023/9/4 14:10, Jie Hai wrote:
> This patchset is to support setting and querying RSS algorithms.
> 
> --
> v3:
> 1. fix commit log for PATCH [1/5].
> 2. make RSS ABI changes description to start the actual text at the margin.
> 3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
> 4. fix some comment codes.
> 
> v2:
> 1. return error if "func" is invalid.
> 2. modify the comments of the "func" field.
> 3. modify commit log of patch [3/5].
> 4. use malloc instead of rte_malloc.
> 5. adjust display format of RSS info.
> 6. remove the string display of rss_hf.
> --
> 
> 
> Jie Hai (5):
>    app/proc-info: fix never show RSS info
>    app/proc-info: adjust the display format of RSS info
>    app/proc-info: support querying RSS hash algorithm
>    app/testpmd: add RSS hash algorithms display
>    app/testpmd: add RSS hash algorithms setting
> 
>   app/proc-info/main.c   |  45 ++++++++++++---
>   app/test-pmd/cmdline.c | 128 ++++++++++++++++++++++++++++++++++++++---
>   app/test-pmd/config.c  |  62 +++++++++++---------
>   app/test-pmd/testpmd.h |   5 +-
>   4 files changed, 194 insertions(+), 46 deletions(-)
> 

^ permalink raw reply	[relevance 0%]

* [PATCH 1/5] ethdev: support setting and querying RSS algorithm
  2023-09-04  7:28  3%   ` [PATCH " Jie Hai
@ 2023-09-04  7:28  4%     ` Jie Hai
  2023-09-08  8:00  3%     ` [PATCH v4 0/7] support setting and querying RSS algorithms Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-09-04  7:28 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko, Ori Kam
  Cc: haijie1, lihuisong

Currently, rte_eth_rss_conf supports configuring and querying
RSS hash functions, rss key and it's length, but not RSS hash
algorithm.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "func". This represents the RSS algorithms to apply. The
following API will be affected:
	- rte_eth_dev_configure
	- rte_eth_dev_rss_hash_update
	- rte_eth_dev_rss_hash_conf_get

If the value of "func" used for configuration is a gibberish
value, report the error and return. Do the same for
rte_eth_dev_rss_hash_update and rte_eth_dev_configure.

To check whether the drivers report the "func" field, it is set
to default value before querying.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 lib/ethdev/rte_ethdev.c                | 17 +++++++++++++++++
 lib/ethdev/rte_ethdev.h                | 20 ++++++++++++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 18 ++----------------
 5 files changed, 41 insertions(+), 17 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 4411bb32c195..94239170139d 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -123,6 +123,8 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
+  algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 0840d2b5942a..4cbcdb344cac 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1445,6 +1445,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev_conf->rx_adv_conf.rss_conf.func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, dev_conf->rx_adv_conf.rss_conf.func);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
 	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
 	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
@@ -4630,6 +4638,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, rss_conf->func);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4657,6 +4672,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->func = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 04a2564f222a..1fe3c0a502ac 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -445,6 +445,22 @@ struct rte_vlan_filter_conf {
 	uint64_t ids[64];
 };
 
+/**
+ * Hash function types.
+ */
+enum rte_eth_hash_function {
+	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
+	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
+	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
+	/**
+	 * Symmetric Toeplitz: src, dst will be replaced by
+	 * xor(src, dst). For the case with src/dst only,
+	 * src or dst address will xor with zero pair.
+	 */
+	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
+	RTE_ETH_HASH_FUNCTION_MAX,
+};
+
 /**
  * A structure used to configure the Receive Side Scaling (RSS) feature
  * of an Ethernet port.
@@ -461,11 +477,15 @@ struct rte_vlan_filter_conf {
  * The *rss_hf* field of the *rss_conf* structure indicates the different
  * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
  * Supplying an *rss_hf* equal to zero disables the RSS feature.
+ *
+ * The *func* field of the *rss_conf* structure indicates the hash algorithm
+ * applied by the RSS hashing.
  */
 struct rte_eth_rss_conf {
 	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
 	uint8_t rss_key_len; /**< hash key length in bytes. */
 	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
+	enum rte_eth_hash_function func;	/**< Hash algorithm. */
 };
 
 /*
diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 271d854f7807..d3f2d466d841 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -12,7 +12,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_string_fns.h>
 #include <rte_mbuf_dyn.h>
-#include "rte_ethdev.h"
 #include "rte_flow_driver.h"
 #include "rte_flow.h"
 
diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h
index 2ebb76dbc083..a7578b1d2eff 100644
--- a/lib/ethdev/rte_flow.h
+++ b/lib/ethdev/rte_flow.h
@@ -40,6 +40,8 @@
 #include <rte_macsec.h>
 #include <rte_ib.h>
 
+#include "rte_ethdev.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3183,22 +3185,6 @@ struct rte_flow_query_count {
 	uint64_t bytes; /**< Number of bytes through this rule [out]. */
 };
 
-/**
- * Hash function types.
- */
-enum rte_eth_hash_function {
-	RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
-	RTE_ETH_HASH_FUNCTION_TOEPLITZ, /**< Toeplitz */
-	RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, /**< Simple XOR */
-	/**
-	 * Symmetric Toeplitz: src, dst will be replaced by
-	 * xor(src, dst). For the case with src/dst only,
-	 * src or dst address will xor with zero pair.
-	 */
-	RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ,
-	RTE_ETH_HASH_FUNCTION_MAX,
-};
-
 /**
  * RTE_FLOW_ACTION_TYPE_RSS
  *
-- 
2.33.0


^ permalink raw reply	[relevance 4%]

* [PATCH 0/5] support setting and querying RSS algorithms
    2023-08-26  7:46  5%   ` [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-09-04  6:10  3%   ` [PATCH v3 0/5] support setting and querying RSS algorithms Jie Hai
@ 2023-09-04  7:28  3%   ` Jie Hai
  2023-09-04  7:28  4%     ` [PATCH 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
  2023-09-08  8:00  3%     ` [PATCH v4 0/7] support setting and querying RSS algorithms Jie Hai
  2 siblings, 2 replies; 200+ results
From: Jie Hai @ 2023-09-04  7:28 UTC (permalink / raw)
  To: dev; +Cc: haijie1, lihuisong

This patchset is to support setting and querying RSS algorithms.

--
v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.
--

Huisong Li (1):
  net/hns3: support setting and querying RSS hash function

Jie Hai (4):
  ethdev: support setting and querying RSS algorithm
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  app/proc-info: support querying RSS hash algorithm

 app/proc-info/main.c                   | 45 +++++++++++++++++++-----
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 drivers/net/hns3/hns3_rss.c            | 47 +++++++++++++++-----------
 lib/ethdev/rte_ethdev.c                | 17 ++++++++++
 lib/ethdev/rte_ethdev.h                | 20 +++++++++++
 lib/ethdev/rte_flow.c                  |  1 -
 lib/ethdev/rte_flow.h                  | 18 ++--------
 7 files changed, 104 insertions(+), 46 deletions(-)

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-30 11:46  0%     ` Thomas Monjalon
  2023-08-31  0:10  0%       ` Ajit Khaparde
@ 2023-09-04  7:10  0%       ` Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-09-04  7:10 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Ferruh Yigit, Andrew Rybchenko, liudongdong3, orika, jerinj,
	ajit.khaparde

Hi, Thomas

Thanks for your review.

On 2023/8/30 19:46, Thomas Monjalon wrote:
> Hello,
> 
> Thanks for bringing a new capability.
> 
> 26/08/2023 09:46, Jie Hai:
>> Currently, rte_eth_rss_conf supports configuring and querying
>> rss hash functions, rss key and it's length, but not rss hash
>> algorithm.
>>
>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>> field "func". This represents the RSS algorithms to apply. The
>> following API is affected:
>> 	- rte_eth_dev_configure
>> 	- rte_eth_dev_rss_hash_update
>> 	- rte_eth_dev_rss_hash_conf_get
> 
> So far, the RSS algorithm was used only in flow RSS API.
> 
Fixed in V3, these API will be affected.
>> --- a/doc/guides/rel_notes/release_23_11.rst
>> +++ b/doc/guides/rel_notes/release_23_11.rst
>> @@ -123,6 +123,8 @@ ABI Changes
>>      Also, make sure to start the actual text at the margin.
>>      =======================================================
>>   
>> +   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
>> +     algorithm.
> 
> As written above, it should start at the margin.
> 
Fixed in V3.
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> +#include "rte_flow.h"
> 
> It is strange to include rte_flow.h here.
> It would be better to move the enum.
> 
Fixed in V3, the definations are removed to rte_ethdev.h.
>> + * The *func* field of the *rss_conf* structure indicates the hash algorithm
>> + * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
>> + * the PMD to use its best-effort algorithm rather than a specific one.
>>    */
> 
> I don't like commenting a field on top of the structure.
> By the way, the first sentence does not look helpful.
> RTE_ETH_HASH_FUNCTION_DEFAULT may be explained in the enum.
> 
Other fields  above the structure 'rte_eth_rss_conf' have comments.
If the new fields 'func' do not have comments, it may be misleading.
Unless all the comments above are removed. I'm not sure whether to
delete them or not.
>>   struct rte_eth_rss_conf {
>>   	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
>>   	uint8_t rss_key_len; /**< hash key length in bytes. */
>>   	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
>> +	enum rte_eth_hash_function func;	/**< Hash algorithm to apply. */
> 
> You can drop "to apply" words.
Fixed in V3.
> 
> How the algorithms support combinations in rss_hf?
> 
The rss_hf defines the input of the RSS hash algorithms.
For example, rss_hf = RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_IPV4, 
these two kinds of packets can be dispatched to different queues 
according to their tuple field value.
For ipv4-tcp packets, src-ip, dst-ip, src-port, dst-port are used as 
parameters of RSS hash algorithms to compute hash value.
For ipv4 packets src-ip, dst-ip are used.

If rss_hf = RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L4_SRC_ONLY, for
ipv4-tcp packets, src-port is used as parameters of RSS hash algorithms 
to compute hash value.

> 
> .

Thanks,
Jie Hai

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-31  0:10  0%       ` Ajit Khaparde
  2023-08-31 10:59  0%         ` Jie Hai
@ 2023-09-04  6:26  0%         ` Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-09-04  6:26 UTC (permalink / raw)
  To: Ajit Khaparde, Thomas Monjalon
  Cc: dev, Ferruh Yigit, Andrew Rybchenko, liudongdong3, orika, jerinj

On 2023/8/31 8:10, Ajit Khaparde wrote:
> On Wed, Aug 30, 2023 at 4:46 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>> Hello,
>>
>> Thanks for bringing a new capability.
>>
>> 26/08/2023 09:46, Jie Hai:
>>> Currently, rte_eth_rss_conf supports configuring and querying
>>> rss hash functions, rss key and it's length, but not rss hash
>>> algorithm.
>>>
>>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>>> field "func". This represents the RSS algorithms to apply. The
>>> following API is affected:
>>>        - rte_eth_dev_configure
>>>        - rte_eth_dev_rss_hash_update
>>>        - rte_eth_dev_rss_hash_conf_get
>>
>> So far, the RSS algorithm was used only in flow RSS API.
>>
>>> --- a/doc/guides/rel_notes/release_23_11.rst
>>> +++ b/doc/guides/rel_notes/release_23_11.rst
>>> @@ -123,6 +123,8 @@ ABI Changes
>>>      Also, make sure to start the actual text at the margin.
>>>      =======================================================
>>>
>>> +   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
>>> +     algorithm.
>>
>> As written above, it should start at the margin.
>>
>>> --- a/lib/ethdev/rte_ethdev.h
>>> +++ b/lib/ethdev/rte_ethdev.h
>>> +#include "rte_flow.h"
>>
>> It is strange to include rte_flow.h here.
>> It would be better to move the enum.
>>
>>> + * The *func* field of the *rss_conf* structure indicates the hash algorithm
>>> + * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
>>> + * the PMD to use its best-effort algorithm rather than a specific one.
>>>    */
>>
>> I don't like commenting a field on top of the structure.
>> By the way, the first sentence does not look helpful.
>> RTE_ETH_HASH_FUNCTION_DEFAULT may be explained in the enum.
>>
>>>   struct rte_eth_rss_conf {
>>>        uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
>>>        uint8_t rss_key_len; /**< hash key length in bytes. */
>>>        uint64_t rss_hf;     /**< Hash functions to apply - see below. */
>>> +     enum rte_eth_hash_function func;        /**< Hash algorithm to apply. */
>>
>> You can drop "to apply" words.
>>
>> How the algorithms support combinations in rss_hf?
> I will spend a little more time on this tomorrow.
> Can you update testpmd also to display the info as a part of show rss.
> 
Hi, Ajit Khaparde,

Displaying RSS hash algorithms with testpmd is in progress.
However, there are some opinions on the implementation,
whether to add commands or display them in existing commands.

way 1: show port 0 rss-hash func
	RSS algorithms:
	  symmetric_toeplitz

way 2: show port 0 rss-hash
	RSS functions:
	  ipv4  ipv4-frag  ipv4-other  ipv6  ipv6-frag  ipv6-other
	RSS algorithms:
  	 symmetric_toeplitz

I hope you can give some comments or suggestions.

Thanks,
Jie Hai
>>
>>

^ permalink raw reply	[relevance 0%]

* [PATCH v3 0/5] support setting and querying RSS algorithms
    2023-08-26  7:46  5%   ` [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-09-04  6:10  3%   ` Jie Hai
  2023-09-04  7:37  0%     ` Jie Hai
  2023-09-04  7:28  3%   ` [PATCH " Jie Hai
  2 siblings, 1 reply; 200+ results
From: Jie Hai @ 2023-09-04  6:10 UTC (permalink / raw)
  To: dev; +Cc: haijie1, lihuisong

This patchset is to support setting and querying RSS algorithms.

--
v3:
1. fix commit log for PATCH [1/5].
2. make RSS ABI changes description to start the actual text at the margin.
3. move defnition of enum rte_eth_hash_function to rte_ethdev.h.
4. fix some comment codes.

v2:
1. return error if "func" is invalid.
2. modify the comments of the "func" field.
3. modify commit log of patch [3/5].
4. use malloc instead of rte_malloc.
5. adjust display format of RSS info.
6. remove the string display of rss_hf.
--


Jie Hai (5):
  app/proc-info: fix never show RSS info
  app/proc-info: adjust the display format of RSS info
  app/proc-info: support querying RSS hash algorithm
  app/testpmd: add RSS hash algorithms display
  app/testpmd: add RSS hash algorithms setting

 app/proc-info/main.c   |  45 ++++++++++++---
 app/test-pmd/cmdline.c | 128 ++++++++++++++++++++++++++++++++++++++---
 app/test-pmd/config.c  |  62 +++++++++++---------
 app/test-pmd/testpmd.h |   5 +-
 4 files changed, 194 insertions(+), 46 deletions(-)

-- 
2.33.0


^ permalink raw reply	[relevance 3%]

* [PATCH 3/3] devtools: enable testing ppc builds on ubuntu
  @ 2023-08-31 12:10 10% ` Bruce Richardson
  0 siblings, 0 replies; 200+ results
From: Bruce Richardson @ 2023-08-31 12:10 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When running PPC builds with the packaged Ubuntu compiler, a different
cross-file needs to be used. Adjust the test-meson-builds script to take
account of this, so that developers can easier pick up on errors.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index c41659d28b..605a855999 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -282,6 +282,9 @@ build build-loongarch64-generic-gcc $f ABI $use_shared

 # IBM POWER
 f=$srcdir/config/ppc/ppc64le-power8-linux-gcc
+if grep -q 'NAME="Ubuntu"' /etc/os-release ; then
+	f=$f-ubuntu
+fi
 build build-ppc64-power8-gcc $f ABI $use_shared

 # generic RISC-V
--
2.39.2


^ permalink raw reply	[relevance 10%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-31  0:10  0%       ` Ajit Khaparde
@ 2023-08-31 10:59  0%         ` Jie Hai
  2023-09-04  6:26  0%         ` Jie Hai
  1 sibling, 0 replies; 200+ results
From: Jie Hai @ 2023-08-31 10:59 UTC (permalink / raw)
  To: Ajit Khaparde, Thomas Monjalon
  Cc: dev, Ferruh Yigit, Andrew Rybchenko, liudongdong3, orika, jerinj

On 2023/8/31 8:10, Ajit Khaparde wrote:
> On Wed, Aug 30, 2023 at 4:46 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>> Hello,
>>
>> Thanks for bringing a new capability.
>>
>> 26/08/2023 09:46, Jie Hai:
>>> Currently, rte_eth_rss_conf supports configuring and querying
>>> rss hash functions, rss key and it's length, but not rss hash
>>> algorithm.
>>>
>>> The structure ``rte_eth_rss_conf`` is extended by adding a new
>>> field "func". This represents the RSS algorithms to apply. The
>>> following API is affected:
>>>        - rte_eth_dev_configure
>>>        - rte_eth_dev_rss_hash_update
>>>        - rte_eth_dev_rss_hash_conf_get
>>
>> So far, the RSS algorithm was used only in flow RSS API.
>>
>>> --- a/doc/guides/rel_notes/release_23_11.rst
>>> +++ b/doc/guides/rel_notes/release_23_11.rst
>>> @@ -123,6 +123,8 @@ ABI Changes
>>>      Also, make sure to start the actual text at the margin.
>>>      =======================================================
>>>
>>> +   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
>>> +     algorithm.
>>
>> As written above, it should start at the margin.
>>
>>> --- a/lib/ethdev/rte_ethdev.h
>>> +++ b/lib/ethdev/rte_ethdev.h
>>> +#include "rte_flow.h"
>>
>> It is strange to include rte_flow.h here.
>> It would be better to move the enum.
>>
>>> + * The *func* field of the *rss_conf* structure indicates the hash algorithm
>>> + * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
>>> + * the PMD to use its best-effort algorithm rather than a specific one.
>>>    */
>>
>> I don't like commenting a field on top of the structure.
>> By the way, the first sentence does not look helpful.
>> RTE_ETH_HASH_FUNCTION_DEFAULT may be explained in the enum.
>>
>>>   struct rte_eth_rss_conf {
>>>        uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
>>>        uint8_t rss_key_len; /**< hash key length in bytes. */
>>>        uint64_t rss_hf;     /**< Hash functions to apply - see below. */
>>> +     enum rte_eth_hash_function func;        /**< Hash algorithm to apply. */
>>
>> You can drop "to apply" words.
>>
>> How the algorithms support combinations in rss_hf?
> I will spend a little more time on this tomorrow.
> Can you update testpmd also to display the info as a part of show rss.
> 
Hi, Ajit Khaparde,

Thanks for your advice. I will update testpmd in next version.

Thanks, Jie Hai
>>
>>

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-30 11:46  0%     ` Thomas Monjalon
@ 2023-08-31  0:10  0%       ` Ajit Khaparde
  2023-08-31 10:59  0%         ` Jie Hai
  2023-09-04  6:26  0%         ` Jie Hai
  2023-09-04  7:10  0%       ` Jie Hai
  1 sibling, 2 replies; 200+ results
From: Ajit Khaparde @ 2023-08-31  0:10 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Jie Hai, dev, Ferruh Yigit, Andrew Rybchenko, liudongdong3,
	orika, jerinj

[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]

On Wed, Aug 30, 2023 at 4:46 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> Hello,
>
> Thanks for bringing a new capability.
>
> 26/08/2023 09:46, Jie Hai:
> > Currently, rte_eth_rss_conf supports configuring and querying
> > rss hash functions, rss key and it's length, but not rss hash
> > algorithm.
> >
> > The structure ``rte_eth_rss_conf`` is extended by adding a new
> > field "func". This represents the RSS algorithms to apply. The
> > following API is affected:
> >       - rte_eth_dev_configure
> >       - rte_eth_dev_rss_hash_update
> >       - rte_eth_dev_rss_hash_conf_get
>
> So far, the RSS algorithm was used only in flow RSS API.
>
> > --- a/doc/guides/rel_notes/release_23_11.rst
> > +++ b/doc/guides/rel_notes/release_23_11.rst
> > @@ -123,6 +123,8 @@ ABI Changes
> >     Also, make sure to start the actual text at the margin.
> >     =======================================================
> >
> > +   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
> > +     algorithm.
>
> As written above, it should start at the margin.
>
> > --- a/lib/ethdev/rte_ethdev.h
> > +++ b/lib/ethdev/rte_ethdev.h
> > +#include "rte_flow.h"
>
> It is strange to include rte_flow.h here.
> It would be better to move the enum.
>
> > + * The *func* field of the *rss_conf* structure indicates the hash algorithm
> > + * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
> > + * the PMD to use its best-effort algorithm rather than a specific one.
> >   */
>
> I don't like commenting a field on top of the structure.
> By the way, the first sentence does not look helpful.
> RTE_ETH_HASH_FUNCTION_DEFAULT may be explained in the enum.
>
> >  struct rte_eth_rss_conf {
> >       uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
> >       uint8_t rss_key_len; /**< hash key length in bytes. */
> >       uint64_t rss_hf;     /**< Hash functions to apply - see below. */
> > +     enum rte_eth_hash_function func;        /**< Hash algorithm to apply. */
>
> You can drop "to apply" words.
>
> How the algorithms support combinations in rss_hf?
I will spend a little more time on this tomorrow.
Can you update testpmd also to display the info as a part of show rss.

>
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

^ permalink raw reply	[relevance 0%]

* Re: [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  2023-08-26  7:46  5%   ` [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
@ 2023-08-30 11:46  0%     ` Thomas Monjalon
  2023-08-31  0:10  0%       ` Ajit Khaparde
  2023-09-04  7:10  0%       ` Jie Hai
  2023-09-06 15:10  3%     ` Stephen Hemminger
  1 sibling, 2 replies; 200+ results
From: Thomas Monjalon @ 2023-08-30 11:46 UTC (permalink / raw)
  To: Jie Hai
  Cc: dev, Ferruh Yigit, Andrew Rybchenko, liudongdong3, haijie1,
	orika, jerinj, ajit.khaparde

Hello,

Thanks for bringing a new capability.

26/08/2023 09:46, Jie Hai:
> Currently, rte_eth_rss_conf supports configuring and querying
> rss hash functions, rss key and it's length, but not rss hash
> algorithm.
> 
> The structure ``rte_eth_rss_conf`` is extended by adding a new
> field "func". This represents the RSS algorithms to apply. The
> following API is affected:
> 	- rte_eth_dev_configure
> 	- rte_eth_dev_rss_hash_update
> 	- rte_eth_dev_rss_hash_conf_get

So far, the RSS algorithm was used only in flow RSS API.

> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -123,6 +123,8 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
>  
> +   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
> +     algorithm.

As written above, it should start at the margin.

> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> +#include "rte_flow.h"

It is strange to include rte_flow.h here.
It would be better to move the enum.

> + * The *func* field of the *rss_conf* structure indicates the hash algorithm
> + * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
> + * the PMD to use its best-effort algorithm rather than a specific one.
>   */

I don't like commenting a field on top of the structure.
By the way, the first sentence does not look helpful.
RTE_ETH_HASH_FUNCTION_DEFAULT may be explained in the enum.

>  struct rte_eth_rss_conf {
>  	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
>  	uint8_t rss_key_len; /**< hash key length in bytes. */
>  	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
> +	enum rte_eth_hash_function func;	/**< Hash algorithm to apply. */

You can drop "to apply" words.

How the algorithms support combinations in rss_hf?



^ permalink raw reply	[relevance 0%]

* [PATCH v2 19/27] net/nfp: refact the nsp module
                       ` (2 preceding siblings ...)
  2023-08-30  2:14  1%   ` [PATCH v2 07/27] net/nfp: standard the comment style Chaoyong He
@ 2023-08-30  2:14  5%   ` Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-30  2:14 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Move the definition of data structure into the implement file.
Also sync the logic from kernel driver and remove the unneeded header
file include statements.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c           |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c      | 390 +++++++++++++++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h      | 140 ++++-----
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c |   4 -
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c  |  79 ++---
 5 files changed, 398 insertions(+), 217 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 2e43055fd5..9243191de3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -661,7 +661,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 static int
 nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	struct nfp_cpp *cpp = nfp_nsp_cpp(nsp);
 	void *fw_buf;
 	char fw_name[125];
 	char serial[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 8e65064b10..75d13cb84f 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -3,20 +3,127 @@
  * All rights reserved.
  */
 
-#define NFP_SUBSYS "nfp_nsp"
-
-#include <stdio.h>
-#include <time.h>
+#include "nfp_nsp.h"
 
 #include <rte_common.h>
 
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
-#include "nfp_nsp.h"
 #include "nfp_platform.h"
 #include "nfp_resource.h"
 
-int
+/* Offsets relative to the CSR base */
+#define NSP_STATUS              0x00
+#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
+#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
+#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
+#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
+#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
+#define   NSP_STATUS_BUSY       RTE_BIT64(0)
+
+#define NSP_COMMAND             0x08
+#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
+#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
+#define   NSP_COMMAND_DMA_BUF   RTE_BIT64(1)
+#define   NSP_COMMAND_START     RTE_BIT64(0)
+
+/* CPP address to retrieve the data from */
+#define NSP_BUFFER              0x10
+#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
+#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER         0x18
+#define   NSP_DFLT_BUFFER_CPP          GENMASK_ULL(63, 40)
+#define   NSP_DFLT_BUFFER_ADDRESS      GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER_CONFIG  0x20
+#define   NSP_DFLT_BUFFER_SIZE_4KB     GENMASK_ULL(15, 8)
+#define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
+
+#define NSP_MAGIC               0xab10
+#define NSP_MAJOR               0
+#define NSP_MINOR               8
+
+#define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
+#define NSP_CODE_MINOR          GENMASK_ULL(11, 0)
+
+#define NFP_FW_LOAD_RET_MAJOR   GENMASK_ULL(15, 8)
+#define NFP_FW_LOAD_RET_MINOR   GENMASK_ULL(23, 16)
+
+enum nfp_nsp_cmd {
+	SPCODE_NOOP             = 0, /* No operation */
+	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
+	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
+	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
+	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
+	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
+	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
+	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
+	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
+	SPCODE_NSP_WRITE_FLASH  = 11, /* Load and flash image from buffer */
+	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
+	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
+	SPCODE_FW_STORED        = 16, /* If no FW loaded, load flash app FW */
+	SPCODE_HWINFO_LOOKUP    = 17, /* Lookup HWinfo with overwrites etc. */
+	SPCODE_HWINFO_SET       = 18, /* Set HWinfo entry */
+	SPCODE_FW_LOADED        = 19, /* Is application firmware loaded */
+	SPCODE_VERSIONS         = 21, /* Report FW versions */
+	SPCODE_READ_SFF_EEPROM  = 22, /* Read module EEPROM */
+	SPCODE_READ_MEDIA       = 23, /* Get the supported/advertised media for a port */
+};
+
+static const struct {
+	uint32_t code;
+	const char *msg;
+} nsp_errors[] = {
+	{ 6010, "could not map to phy for port" },
+	{ 6011, "not an allowed rate/lanes for port" },
+	{ 6012, "not an allowed rate/lanes for port" },
+	{ 6013, "high/low error, change other port first" },
+	{ 6014, "config not found in flash" },
+};
+
+struct nfp_nsp {
+	struct nfp_cpp *cpp;
+	struct nfp_resource *res;
+	struct {
+		uint16_t major;
+		uint16_t minor;
+	} ver;
+
+	/** Eth table config state */
+	bool modified;
+	uint32_t idx;
+	void *entries;
+};
+
+/* NFP command argument structure */
+struct nfp_nsp_command_arg {
+	uint16_t code;         /**< NFP SP Command Code */
+	bool dma;              /**< @buf points to a host buffer, not NSP buffer */
+	bool error_quiet;      /**< Don't print command error/warning */
+	uint32_t timeout_sec;  /**< Timeout value to wait for completion in seconds */
+	uint32_t option;       /**< NSP Command Argument */
+	uint64_t buf;          /**< NSP Buffer Address */
+	/** Callback for interpreting option if error occurred */
+	void (*error_cb)(struct nfp_nsp *state, uint32_t ret_val);
+};
+
+/* NFP command with buffer argument structure */
+struct nfp_nsp_command_buf_arg {
+	struct nfp_nsp_command_arg arg;  /**< NFP command argument structure */
+	const void *in_buf;              /**< Buffer with data for input */
+	void *out_buf;                   /**< Buffer for output data */
+	uint32_t in_size;                /**< Size of @in_buf */
+	uint32_t out_size;               /**< Size of @out_buf */
+};
+
+struct nfp_cpp *
+nfp_nsp_cpp(struct nfp_nsp *state)
+{
+	return state->cpp;
+}
+
+bool
 nfp_nsp_config_modified(struct nfp_nsp *state)
 {
 	return state->modified;
@@ -24,7 +131,7 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 
 void
 nfp_nsp_config_set_modified(struct nfp_nsp *state,
-		int modified)
+		bool modified)
 {
 	state->modified = modified;
 }
@@ -66,7 +173,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 		return;
 
 	for (i = 0; i < RTE_DIM(nsp_errors); i++)
-		if (ret_val == (uint32_t)nsp_errors[i].code)
+		if (ret_val == nsp_errors[i].code)
 			PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg);
 }
 
@@ -222,11 +329,8 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
  *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state,
-		uint16_t code,
-		uint32_t option,
-		uint32_t buff_cpp,
-		uint64_t buff_addr)
+nfp_nsp_command_real(struct nfp_nsp *state,
+		const struct nfp_nsp_command_arg *arg)
 {
 	int err;
 	uint64_t reg;
@@ -250,22 +354,14 @@ nfp_nsp_command(struct nfp_nsp *state,
 		return err;
 	}
 
-	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
-		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-				buff_cpp, buff_addr);
-		return -EINVAL;
-	}
-
-	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer, arg->buf);
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+			FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
+			FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
 			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
@@ -275,7 +371,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -284,7 +380,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -296,84 +392,85 @@ nfp_nsp_command(struct nfp_nsp *state,
 
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-				-err, (int)ret_val, code);
-		nfp_nsp_print_extended_error(ret_val);
+		if (!arg->error_quiet)
+			PMD_DRV_LOG(WARNING, "Result (error) code set: %d (%d) command: %d",
+					-err, (int)ret_val, arg->code);
+
+		if (arg->error_cb != 0)
+			arg->error_cb(state, ret_val);
+		else
+			nfp_nsp_print_extended_error(ret_val);
+
 		return -err;
 	}
 
 	return ret_val;
 }
 
-#define SZ_1M 0x00100000
+static int
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code)
+{
+	const struct nfp_nsp_command_arg arg = {
+		.code = code,
+	};
+
+	return nfp_nsp_command_real(state, &arg);
+}
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp,
-		uint16_t code, uint32_t option,
-		const void *in_buf,
-		unsigned int in_size,
-		void *out_buf,
-		unsigned int out_size)
+nfp_nsp_command_buf_def(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
 {
 	int err;
 	int ret;
 	uint64_t reg;
-	size_t max_size;
 	uint32_t cpp_id;
 	uint64_t cpp_buf;
 	struct nfp_cpp *cpp = nsp->cpp;
 
-	if (nsp->ver.minor < 13) {
-		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-				code, nsp->ver.major, nsp->ver.minor);
-		return -EOPNOTSUPP;
-	}
-
-	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
-			&reg);
-	if (err < 0)
-		return err;
-
-	max_size = RTE_MAX(in_size, out_size);
-	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
-		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %lu)",
-				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
-		return -EINVAL;
-	}
-
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
 			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
 			&reg);
 	if (err < 0)
 		return err;
 
-	cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8;
-	cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg);
+	cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
+	cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
 
-	if (in_buf != NULL && in_size > 0) {
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
+	if (arg->in_buf != NULL && arg->in_size > 0) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf,
+				arg->in_buf, arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
 	/* Zero out remaining part of the buffer */
-	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
-		memset(out_buf, 0, out_size - in_size);
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				out_size - in_size);
+	if (arg->out_buf != NULL && arg->out_size > arg->in_size) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + arg->in_size,
+				arg->out_buf, arg->out_size - arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
-	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
+	if (!FIELD_FIT(NSP_BUFFER_CPP, cpp_id >> 8) ||
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, cpp_buf)) {
+		PMD_DRV_LOG(ERR, "Buffer out of reach %#08x %#016lx",
+				cpp_id, cpp_buf);
+		return -EINVAL;
+	}
+
+	arg->arg.buf = FIELD_PREP(NSP_BUFFER_CPP, cpp_id >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, cpp_buf);
+	ret = nfp_nsp_command_real(nsp, &arg->arg);
 	if (ret < 0) {
 		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
 	}
 
-	if (out_buf != NULL && out_size > 0) {
-		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
+	if (arg->out_buf != NULL && arg->out_size > 0) {
+		err = nfp_cpp_read(cpp, cpp_id, cpp_buf,
+				arg->out_buf, arg->out_size);
 		if (err < 0)
 			return err;
 	}
@@ -381,6 +478,43 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	return ret;
 }
 
+#define SZ_1M 0x00100000
+#define SZ_4K 0x00001000
+
+static int
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
+{
+	int err;
+	uint64_t reg;
+	uint32_t size;
+	uint32_t max_size;
+	struct nfp_cpp *cpp = nsp->cpp;
+
+	if (nsp->ver.minor < 13) {
+		PMD_DRV_LOG(ERR, "NSP: Code %#04x with buffer not supported ABI %hu.%hu)",
+				arg->arg.code, nsp->ver.major, nsp->ver.minor);
+		return -EOPNOTSUPP;
+	}
+
+	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
+	if (err < 0)
+		return err;
+
+	max_size = RTE_MAX(arg->in_size, arg->out_size);
+	size = FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M +
+			FIELD_GET(NSP_DFLT_BUFFER_SIZE_4KB, reg) * SZ_4K;
+	if (size < max_size) {
+		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command %#04x (%u < %u)",
+				arg->arg.code, size, max_size);
+		return -EINVAL;
+	}
+
+	return nfp_nsp_command_buf_def(nsp, arg);
+}
+
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
@@ -392,7 +526,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
-		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
+		err = nfp_nsp_command(state, SPCODE_NOOP);
 		if (err != -EAGAIN)
 			break;
 
@@ -413,13 +547,57 @@ nfp_nsp_wait(struct nfp_nsp *state)
 int
 nfp_nsp_device_soft_reset(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_SOFT_RESET, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_SOFT_RESET);
 }
 
 int
 nfp_nsp_mac_reinit(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_MAC_INIT, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_MAC_INIT);
+}
+
+static void
+nfp_nsp_load_fw_extended_msg(struct nfp_nsp *state,
+		uint32_t ret_val)
+{
+	uint32_t minor;
+	uint32_t major;
+	static const char * const major_msg[] = {
+		/* 0 */ "Firmware from driver loaded",
+		/* 1 */ "Firmware from flash loaded",
+		/* 2 */ "Firmware loading failure",
+	};
+	static const char * const minor_msg[] = {
+		/*  0 */ "",
+		/*  1 */ "no named partition on flash",
+		/*  2 */ "error reading from flash",
+		/*  3 */ "can not deflate",
+		/*  4 */ "not a trusted file",
+		/*  5 */ "can not parse FW file",
+		/*  6 */ "MIP not found in FW file",
+		/*  7 */ "null firmware name in MIP",
+		/*  8 */ "FW version none",
+		/*  9 */ "FW build number none",
+		/* 10 */ "no FW selection policy HWInfo key found",
+		/* 11 */ "static FW selection policy",
+		/* 12 */ "FW version has precedence",
+		/* 13 */ "different FW application load requested",
+		/* 14 */ "development build",
+	};
+
+	major = FIELD_GET(NFP_FW_LOAD_RET_MAJOR, ret_val);
+	minor = FIELD_GET(NFP_FW_LOAD_RET_MINOR, ret_val);
+
+	if (!nfp_nsp_has_stored_fw_load(state))
+		return;
+
+	if (major >= RTE_DIM(major_msg))
+		PMD_DRV_LOG(INFO, "FW loading status: %x", ret_val);
+	else if (minor >= RTE_DIM(minor_msg))
+		PMD_DRV_LOG(INFO, "%s, reason code: %d", major_msg[major], minor);
+	else
+		PMD_DRV_LOG(INFO, "%s%c %s", major_msg[major],
+				minor != 0 ? ',' : '.', minor_msg[minor]);
 }
 
 int
@@ -427,8 +605,24 @@ nfp_nsp_load_fw(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-			NULL, 0);
+	int ret;
+	struct nfp_nsp_command_buf_arg load_fw = {
+		{
+			.code     = SPCODE_FW_LOAD,
+			.option   = size,
+			.error_cb = nfp_nsp_load_fw_extended_msg,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	ret = nfp_nsp_command_buf(state, &load_fw);
+	if (ret < 0)
+		return ret;
+
+	nfp_nsp_load_fw_extended_msg(state, ret);
+
+	return 0;
 }
 
 int
@@ -436,8 +630,16 @@ nfp_nsp_read_eth_table(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg eth_rescan = {
+		{
+			.code   = SPCODE_ETH_RESCAN,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_rescan);
 }
 
 int
@@ -445,8 +647,16 @@ nfp_nsp_write_eth_table(struct nfp_nsp *state,
 		const void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-			NULL, 0);
+	struct nfp_nsp_command_buf_arg eth_ctrl = {
+		{
+			.code   = SPCODE_ETH_CONTROL,
+			.option = size,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_ctrl);
 }
 
 int
@@ -454,8 +664,16 @@ nfp_nsp_read_identify(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg identify = {
+		{
+			.code   = SPCODE_NSP_IDENTIFY,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &identify);
 }
 
 int
@@ -464,6 +682,14 @@ nfp_nsp_read_sensors(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-			0, buf, size);
+	struct nfp_nsp_command_buf_arg sensors = {
+		{
+			.code   = SPCODE_NSP_SENSORS,
+			.option = sensor_mask,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &sensors);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 14986a9130..fe52dffeb7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -7,78 +7,8 @@
 #define __NSP_NSP_H__
 
 #include "nfp_cpp.h"
-#include "nfp_nsp.h"
-
-/* Offsets relative to the CSR base */
-#define NSP_STATUS              0x00
-#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
-#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
-#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
-#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
-#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
-#define   NSP_STATUS_BUSY       RTE_BIT64(0)
-
-#define NSP_COMMAND             0x08
-#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
-#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
-#define   NSP_COMMAND_START     RTE_BIT64(0)
-
-/* CPP address to retrieve the data from */
-#define NSP_BUFFER              0x10
-#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
-#define   NSP_BUFFER_PCIE       GENMASK_ULL(39, 38)
-#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(37, 0)
-
-#define NSP_DFLT_BUFFER         0x18
-
-#define NSP_DFLT_BUFFER_CONFIG 0x20
-#define   NSP_DFLT_BUFFER_SIZE_MB    GENMASK_ULL(7, 0)
-
-#define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
-#define NSP_MINOR               8
-
-#define NSP_CODE_MAJOR          GENMASK(15, 12)
-#define NSP_CODE_MINOR          GENMASK(11, 0)
-
-enum nfp_nsp_cmd {
-	SPCODE_NOOP             = 0, /* No operation */
-	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
-	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
-	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
-	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
-	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
-	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
-	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
-	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
-	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
-	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
-};
-
-static const struct {
-	int code;
-	const char *msg;
-} nsp_errors[] = {
-	{ 6010, "could not map to phy for port" },
-	{ 6011, "not an allowed rate/lanes for port" },
-	{ 6012, "not an allowed rate/lanes for port" },
-	{ 6013, "high/low error, change other port first" },
-	{ 6014, "config not found in flash" },
-};
 
-struct nfp_nsp {
-	struct nfp_cpp *cpp;
-	struct nfp_resource *res;
-	struct {
-		uint16_t major;
-		uint16_t minor;
-	} ver;
-
-	/* Eth table config state */
-	int modified;
-	unsigned int idx;
-	void *entries;
-};
+struct nfp_nsp;
 
 struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp);
 void nfp_nsp_close(struct nfp_nsp *state);
@@ -92,18 +22,61 @@ int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, size_t size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, uint32_t sensor_mask,
 		void *buf, size_t size);
 
-static inline int
+static inline bool
 nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
 
+static inline bool
+nfp_nsp_has_stored_fw_load(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 23;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_lookup(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 24;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_set(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_fw_loaded(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_versions(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 27;
+}
+
+static inline bool
+nfp_nsp_has_read_module_eeprom(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 28;
+}
+
+static inline bool
+nfp_nsp_has_read_media(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 33;
+}
+
 enum nfp_eth_interface {
 	NFP_INTERFACE_NONE      = 0,
 	NFP_INTERFACE_SFP       = 1,
 	NFP_INTERFACE_SFPP      = 10,
 	NFP_INTERFACE_SFP28     = 28,
 	NFP_INTERFACE_QSFP      = 40,
+	NFP_INTERFACE_RJ45      = 45,
 	NFP_INTERFACE_CXP       = 100,
 	NFP_INTERFACE_QSFP28    = 112,
 };
@@ -151,6 +124,7 @@ struct nfp_eth_table {
 		enum nfp_eth_media media; /**< Media type of the @interface */
 
 		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_fec act_fec; /**< Active Forward Error Correction mode */
 		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
 		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
@@ -159,17 +133,18 @@ struct nfp_eth_table {
 		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;     /**< Enable port */
-		int tx_enabled;  /**< Enable TX */
-		int rx_enabled;  /**< Enable RX */
+		bool enabled;     /**< Enable port */
+		bool tx_enabled;  /**< Enable TX */
+		bool rx_enabled;  /**< Enable RX */
+		bool supp_aneg;   /**< Support auto negotiation */
 
-		int override_changed;  /**< Media reconfig pending */
+		bool override_changed;  /**< Media reconfig pending */
 
 		uint8_t port_type;    /**< One of %PORT_* */
 		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;   /**< Split port */
+		bool is_split;   /**< Split port */
 
 		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
 	} ports[]; /**< Table of ports */
@@ -177,8 +152,8 @@ struct nfp_eth_table {
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
-int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, int enable);
-int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, int configed);
+int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, bool enable);
+int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, bool configured);
 int nfp_eth_set_fec(struct nfp_cpp *cpp, uint32_t idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, size_t size);
@@ -187,12 +162,13 @@ int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
 		uint32_t idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
-void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
+void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
-int nfp_nsp_config_modified(struct nfp_nsp *state);
+struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
+bool nfp_nsp_config_modified(struct nfp_nsp *state);
 uint32_t nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int
+static inline bool
 nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return eth_port->fec_modes_supported != 0;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 429f639fa2..86956f4330 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -3,12 +3,8 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
-#include "nfp_nffw.h"
 
 struct nsp_identify {
 	uint8_t version[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 355d907f4d..996fd4b44a 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -3,10 +3,6 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
 #include "nfp_platform.h"
@@ -21,6 +17,7 @@
 #define NSP_ETH_PORT_PHYLABEL           GENMASK_ULL(59, 54)
 #define NSP_ETH_PORT_FEC_SUPP_BASER     RTE_BIT64(60)
 #define NSP_ETH_PORT_FEC_SUPP_RS        RTE_BIT64(61)
+#define NSP_ETH_PORT_SUPP_ANEG          RTE_BIT64(63)
 
 #define NSP_ETH_PORT_LANES_MASK         rte_cpu_to_le_64(NSP_ETH_PORT_LANES)
 
@@ -34,6 +31,7 @@
 #define NSP_ETH_STATE_OVRD_CHNG         RTE_BIT64(22)
 #define NSP_ETH_STATE_ANEG              GENMASK_ULL(25, 23)
 #define NSP_ETH_STATE_FEC               GENMASK_ULL(27, 26)
+#define NSP_ETH_STATE_ACT_FEC           GENMASK_ULL(29, 28)
 
 #define NSP_ETH_CTRL_CONFIGURED         RTE_BIT64(0)
 #define NSP_ETH_CTRL_ENABLED            RTE_BIT64(1)
@@ -54,26 +52,12 @@
 #define PORT_NONE               0xef
 #define PORT_OTHER              0xff
 
-#define SPEED_10                10
-#define SPEED_100               100
-#define SPEED_1000              1000
-#define SPEED_2500              2500
-#define SPEED_5000              5000
-#define SPEED_10000             10000
-#define SPEED_14000             14000
-#define SPEED_20000             20000
-#define SPEED_25000             25000
-#define SPEED_40000             40000
-#define SPEED_50000             50000
-#define SPEED_56000             56000
-#define SPEED_100000            100000
-
 enum nfp_eth_raw {
 	NSP_ETH_RAW_PORT = 0,
 	NSP_ETH_RAW_STATE,
 	NSP_ETH_RAW_MAC,
 	NSP_ETH_RAW_CONTROL,
-	NSP_ETH_NUM_RAW
+	NSP_ETH_NUM_RAW,
 };
 
 enum nfp_eth_rate {
@@ -100,12 +84,12 @@ static const struct {
 	enum nfp_eth_rate rate;
 	uint32_t speed;
 } nsp_eth_rate_tbl[] = {
-	{ RATE_INVALID, 0, },
-	{ RATE_10M,     SPEED_10, },
-	{ RATE_100M,    SPEED_100, },
-	{ RATE_1G,      SPEED_1000, },
-	{ RATE_10G,     SPEED_10000, },
-	{ RATE_25G,     SPEED_25000, },
+	{ RATE_INVALID, RTE_ETH_SPEED_NUM_NONE, },
+	{ RATE_10M,     RTE_ETH_SPEED_NUM_10M, },
+	{ RATE_100M,    RTE_ETH_SPEED_NUM_100M, },
+	{ RATE_1G,      RTE_ETH_SPEED_NUM_1G, },
+	{ RATE_10G,     RTE_ETH_SPEED_NUM_10G, },
+	{ RATE_25G,     RTE_ETH_SPEED_NUM_25G, },
 };
 
 static uint32_t
@@ -192,7 +176,14 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 	if (dst->fec_modes_supported != 0)
 		dst->fec_modes_supported |= NFP_FEC_AUTO | NFP_FEC_DISABLED;
 
-	dst->fec = 1 << FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->fec = FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->act_fec = dst->fec;
+
+	if (nfp_nsp_get_abi_ver_minor(nsp) < 33)
+		return;
+
+	dst->act_fec = FIELD_GET(NSP_ETH_STATE_ACT_FEC, state);
+	dst->supp_aneg = FIELD_GET(NSP_ETH_PORT_SUPP_ANEG, port);
 }
 
 static void
@@ -221,7 +212,7 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 						table->ports[i].label_port,
 						table->ports[i].label_subport);
 
-			table->ports[i].is_split = 1;
+			table->ports[i].is_split = true;
 		}
 	}
 }
@@ -232,6 +223,9 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 	if (entry->interface == NFP_INTERFACE_NONE) {
 		entry->port_type = PORT_NONE;
 		return;
+	} else if (entry->interface == NFP_INTERFACE_RJ45) {
+		entry->port_type = PORT_TP;
+		return;
 	}
 
 	if (entry->media == NFP_MEDIA_FIBRE)
@@ -250,7 +244,6 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	uint32_t table_sz;
 	struct nfp_eth_table *table;
 	union eth_table_entry *entries;
-	const struct rte_ether_addr *mac;
 
 	entries = rte_zmalloc(NULL, NSP_ETH_TABLE_SIZE, 0);
 	if (entries == NULL)
@@ -262,16 +255,9 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/*
-	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
-	 * the rest 6 ports mac are all 0, ensure we don't use these port
-	 */
-	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
+	for (i = 0; i < NSP_ETH_MAX_COUNT; i++)
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
 			cnt++;
-	}
 
 	/*
 	 * Some versions of flash will give us 0 instead of port count. For
@@ -291,11 +277,8 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 
 	table->count = cnt;
 	for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
-			nfp_eth_port_translate(nsp, &entries[i], i,
-					&table->ports[j++]);
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
+			nfp_eth_port_translate(nsp, &entries[i], i, &table->ports[j++]);
 	}
 
 	nfp_eth_calc_port_geometry(table);
@@ -436,7 +419,7 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int enable)
+		bool enable)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -444,7 +427,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
-		return -1;
+		return -EIO;
 
 	entries = nfp_nsp_config_entries(nsp);
 
@@ -456,7 +439,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_ENABLED, enable);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -480,7 +463,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int configured)
+		bool configured)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -509,7 +492,7 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -547,7 +530,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	entries[idx].control |= rte_cpu_to_le_64(ctrl_bit);
 
-	nfp_nsp_config_set_modified(nsp, 1);
+	nfp_nsp_config_set_modified(nsp, true);
 
 	return 0;
 }
-- 
2.39.1


^ permalink raw reply	[relevance 5%]

* [PATCH v2 07/27] net/nfp: standard the comment style
    2023-08-30  2:14  2%   ` [PATCH v2 02/27] net/nfp: unify the indent coding style Chaoyong He
  2023-08-30  2:14  3%   ` [PATCH v2 05/27] net/nfp: standard the local variable " Chaoyong He
@ 2023-08-30  2:14  1%   ` Chaoyong He
  2023-08-30  2:14  5%   ` [PATCH v2 19/27] net/nfp: refact the nsp module Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-30  2:14 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Follow the DPDK coding style, use the kdoc comment style.
Also add some comment to help understand logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          | 504 ++++-----------------
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  39 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 484 ++++++++++++++++----
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  21 +-
 drivers/net/nfp/nfpcore/nfp_hwinfo.h       |   2 +
 drivers/net/nfp/nfpcore/nfp_mip.c          |  43 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  69 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  49 +-
 drivers/net/nfp/nfpcore/nfp_nffw.h         |   6 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          |  53 ++-
 drivers/net/nfp/nfpcore/nfp_nsp.h          | 108 ++---
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 170 ++++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 103 +++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |  28 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  59 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  12 +-
 drivers/net/nfp/nfpcore/nfp_target.c       |   2 +-
 17 files changed, 888 insertions(+), 864 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 139752f85a..82189e9910 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -10,9 +10,7 @@
 
 struct nfp_cpp_mutex;
 
-/*
- * NFP CPP handle
- */
+/* NFP CPP handle */
 struct nfp_cpp {
 	uint32_t model;
 	uint32_t interface;
@@ -37,9 +35,7 @@ struct nfp_cpp {
 	int driver_lock_needed;
 };
 
-/*
- * NFP CPP device area handle
- */
+/* NFP CPP device area handle */
 struct nfp_cpp_area {
 	struct nfp_cpp *cpp;
 	char *name;
@@ -127,35 +123,45 @@ struct nfp_cpp_operations {
 
 #define NFP_CPP_TARGET_ID_MASK 0x1f
 
-/*
+/**
  * Pack target, token, and action into a CPP ID.
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
  *
- * @return      NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ID(target, action, token)                               \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
 		(((action) & 0xff) << 8))
 
-/*
+/**
  * Pack target, token, action, and island into a CPP ID.
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
- * @island      NFP CPP island id
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @return      NFP CPP ID
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
+ * @param island
+ *   NFP CPP island id
+ *
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ISLAND_ID(target, action, token, island)                \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
@@ -163,9 +169,12 @@ struct nfp_cpp_operations {
 
 /**
  * Return the NFP CPP target of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP target
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP target
  */
 static inline uint8_t
 NFP_CPP_ID_TARGET_of(uint32_t id)
@@ -173,11 +182,14 @@ NFP_CPP_ID_TARGET_of(uint32_t id)
 	return (id >> 24) & NFP_CPP_TARGET_ID_MASK;
 }
 
-/*
+/**
  * Return the NFP CPP token of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP token
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP token
  */
 static inline uint8_t
 NFP_CPP_ID_TOKEN_of(uint32_t id)
@@ -185,11 +197,14 @@ NFP_CPP_ID_TOKEN_of(uint32_t id)
 	return (id >> 16) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP action of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP action
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP action
  */
 static inline uint8_t
 NFP_CPP_ID_ACTION_of(uint32_t id)
@@ -197,11 +212,14 @@ NFP_CPP_ID_ACTION_of(uint32_t id)
 	return (id >> 8) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP island of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP island
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP island
  */
 static inline uint8_t
 NFP_CPP_ID_ISLAND_of(uint32_t id)
@@ -215,109 +233,57 @@ NFP_CPP_ID_ISLAND_of(uint32_t id)
  */
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
 
-/*
- * Set the model id
- *
- * @param   cpp     NFP CPP operations structure
- * @param   model   Model ID
- */
 void nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   interface Interface ID
- */
 void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   serial  NFP serial byte array
- * @param   len     Length of the serial byte array
- */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
 		size_t serial_len);
 
-/*
- * Set the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv);
 
-/*
- * Return the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void *nfp_cpp_priv(struct nfp_cpp *cpp);
 
-/*
- * Get the privately allocated portion of a NFP CPP area handle
- *
- * @param   cpp_area    NFP CPP area handle
- * @return          Pointer to the private area, or NULL on failure
- */
 void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
 
 uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
 
-/*
- * NFP CPP core interface for CPP clients.
- */
-
-/*
- * Open a NFP CPP handle to a CPP device
- *
- * @param[in]	id	0-based ID for the CPP interface to use
- *
- * @return NFP CPP handle, or NULL on failure.
- */
+/* NFP CPP core interface for CPP clients */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed);
 
-/*
- * Free a NFP CPP handle
- *
- * @param[in]	cpp	NFP CPP handle
- */
 void nfp_cpp_free(struct nfp_cpp *cpp);
 
 #define NFP_CPP_MODEL_INVALID   0xffffffff
 
-/*
- * NFP_CPP_MODEL_CHIP_of - retrieve the chip ID from the model ID
+/**
+ * Retrieve the chip ID from the model ID
  *
  * The chip ID is a 16-bit BCD+A-F encoding for the chip type.
  *
- * @param[in]   model   NFP CPP model id
- * @return      NFP CPP chip id
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   NFP CPP chip id
  */
 #define NFP_CPP_MODEL_CHIP_of(model)        (((model) >> 16) & 0xffff)
 
-/*
- * NFP_CPP_MODEL_IS_6000 - Check for the NFP6000 family of devices
+/**
+ * Check for the NFP6000 family of devices
  *
  * NOTE: The NFP4000 series is considered as a NFP6000 series variant.
  *
- * @param[in]	model	NFP CPP model id
- * @return		true if model is in the NFP6000 family, false otherwise.
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   true if model is in the NFP6000 family, false otherwise.
  */
 #define NFP_CPP_MODEL_IS_6000(model)		     \
 		((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \
 		(NFP_CPP_MODEL_CHIP_of(model) < 0x7000))
 
-/*
- * nfp_cpp_model - Retrieve the Model ID of the NFP
- *
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Model ID
- */
 uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 
 /*
@@ -330,7 +296,7 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 #define NFP_CPP_INTERFACE_TYPE_RPC		0x3
 #define NFP_CPP_INTERFACE_TYPE_ILA		0x4
 
-/*
+/**
  * Construct a 16-bit NFP Interface ID
  *
  * Interface IDs consists of 4 bits of interface type, 4 bits of unit
@@ -340,422 +306,138 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
  * which use the MU Atomic CompareAndWrite operation - hence the limit to 16
  * bits to be able to use the NFP Interface ID as a lock owner.
  *
- * @param[in]	type	NFP Interface Type
- * @param[in]	unit	Unit identifier for the interface type
- * @param[in]	channel	Channel identifier for the interface unit
- * @return		Interface ID
+ * @param type
+ *   NFP Interface Type
+ * @param unit
+ *   Unit identifier for the interface type
+ * @param channel
+ *   Channel identifier for the interface unit
+ *
+ * @return
+ *   Interface ID
  */
 #define NFP_CPP_INTERFACE(type, unit, channel)	\
 	((((type) & 0xf) << 12) | \
 	 (((unit) & 0xf) <<  8) | \
 	 (((channel) & 0xff) << 0))
 
-/*
+/**
  * Get the interface type of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's type
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's type
  */
 #define NFP_CPP_INTERFACE_TYPE_of(interface)	(((interface) >> 12) & 0xf)
 
-/*
+/**
  * Get the interface unit of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's unit
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's unit
  */
 #define NFP_CPP_INTERFACE_UNIT_of(interface)	(((interface) >>  8) & 0xf)
 
-/*
+/**
  * Get the interface channel of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's channel
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's channel
  */
 #define NFP_CPP_INTERFACE_CHANNEL_of(interface)	(((interface) >>  0) & 0xff)
 
-/*
- * Retrieve the Interface ID of the NFP
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Interface ID
- */
+
 uint16_t nfp_cpp_interface(struct nfp_cpp *cpp);
 
-/*
- * Retrieve the NFP Serial Number (unique per NFP)
- * @param[in]	cpp	NFP CPP handle
- * @param[out]	serial	Pointer to reference the serial number array
- *
- * @return	size of the NFP6000 serial number, in bytes
- */
 int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, size_t size);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	name	Name of owner of the area
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint32_t cpp_id, const char *name, uint64_t address,
 		uint32_t size);
 
-/*
- * Free an allocated NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_free(struct nfp_cpp_area *area);
 
-/*
- * Acquire the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- *
- * @return 0 on success, -1 on failure.
- */
 int nfp_cpp_area_acquire(struct nfp_cpp_area *area);
 
-/*
- * Release the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release(struct nfp_cpp_area *area);
 
-/*
- * Allocate, then acquire the resources needed to access the NFP CPP area handle
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 		uint32_t cpp_id, uint64_t address, size_t size);
 
-/*
- * Release the resources, then free the NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t addr, uint32_t size, struct nfp_cpp_area **area);
 
-/*
- * Read from a NFP CPP area handle into a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer to receive the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes read on success, negative value on failure.
- *
- */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset,
 		void *buffer, size_t length);
 
-/*
- * Write to a NFP CPP area handle from a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer that holds the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes written on success, negative value on failure.
- */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset,
 		const void *buffer, size_t length);
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
- * @area:       CPP area handle
- *
- * Returns an iomem pointer for use with readl()/writel() style operations.
- *
- * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
- */
 void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
 
-/*
- * Get the NFP CPP handle that is the parent of a NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			NFP CPP handle
- */
 struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
 
-/*
- * Get the name passed during allocation of the NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			Pointer to the area's name
- */
 const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
 
-/*
- * Read a block of data from a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy read data to
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes read on success, -1 on failure.
- */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, void *kernel_vaddr, size_t length);
 
-/*
- * Write a block of data to a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy write data from
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes written on success, -1 on failure.
- */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, const void *kernel_vaddr, size_t length);
 
-/*
- * Read a single 32-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t *value);
 
-/*
- * Write a single 32-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t value);
 
-/*
- * Read a single 64-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t *value);
 
-/*
- * Write a single 64-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t value);
 
-/*
- * Write a single 32-bit value on the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t value);
 
-/*
- * Read a single 32-bit value from the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
 
-/*
- * Read a 32-bit word from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t *value);
 
-/*
- * Write a 32-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- *
- */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t value);
 
-/*
- * Read a 64-bit work from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t *value);
 
-/*
- * Write a 64-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t value);
 
-/*
- * Initialize a mutex location
-
- * The CPP target:address must point to a 64-bit aligned location, and will
- * initialize 64 bits of data at the location.
- *
- * This creates the initial mutex state, as locked by this nfp_cpp_interface().
- *
- * This function should only be called when setting up the initial lock state
- * upon boot-up of the system.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	Unique 32-bit value for this mutex
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Create a mutex handle from an address controlled by a MU Atomic engine
- *
- * The CPP target:address must point to a 64-bit aligned location, and reserve
- * 64 bits of data at the location for use by the handle.
- *
- * Only target/address pairs that point to entities that support the MU Atomic
- * Engine's CmpAndSwap32 command are supported.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	32-bit unique key (must match the key at this location)
- *
- * @return		A non-NULL struct nfp_cpp_mutex * on success, NULL on
- *                      failure.
- */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Free a mutex handle - does not alter the lock state
- *
- * @param mutex		NFP CPP Mutex handle
- */
 void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
 
-/*
- * Lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Unlock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- * @return		0 if the lock succeeded, negative value on failure.
- */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
 uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index bdf4a658f5..7e94bfb611 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -58,7 +58,7 @@
  * Minimal size of the PCIe cfg memory we depend on being mapped,
  * queue controller and DMA controller don't have to be covered.
  */
-#define NFP_PCI_MIN_MAP_SIZE				0x080000
+#define NFP_PCI_MIN_MAP_SIZE				0x080000        /* 512K */
 
 #define NFP_PCIE_P2C_FIXED_SIZE(bar)               (1 << (bar)->bitsize)
 #define NFP_PCIE_P2C_BULK_SIZE(bar)                (1 << (bar)->bitsize)
@@ -72,40 +72,25 @@
 #define NFP_PCIE_CPP_BAR_PCIETOCPPEXPBAR(bar, slot) \
 	(((bar) * 8 + (slot)) * 4)
 
-/*
- * Define to enable a bit more verbose debug output.
- * Set to 1 to enable a bit more verbose debug output.
- */
 struct nfp_pcie_user;
 struct nfp6000_area_priv;
 
-/*
- * struct nfp_bar - describes BAR configuration and usage
- * @nfp:	backlink to owner
- * @barcfg:	cached contents of BAR config CSR
- * @base:	the BAR's base CPP offset
- * @mask:       mask for the BAR aperture (read only)
- * @bitsize:	bitsize of BAR aperture (read only)
- * @index:	index of the BAR
- * @lock:	lock to specify if bar is in use
- * @refcnt:	number of current users
- * @iomem:	mapped IO memory
- */
+/* Describes BAR configuration and usage */
 #define NFP_BAR_MIN 1
 #define NFP_BAR_MID 5
 #define NFP_BAR_MAX 7
 
 struct nfp_bar {
-	struct nfp_pcie_user *nfp;
-	uint32_t barcfg;
-	uint64_t base;		/* CPP address base */
-	uint64_t mask;		/* Bit mask of the bar */
-	uint32_t bitsize;	/* Bit size of the bar */
-	uint32_t index;
-	int lock;
+	struct nfp_pcie_user *nfp;    /**< Backlink to owner */
+	uint32_t barcfg;     /**< BAR config CSR */
+	uint64_t base;       /**< Base CPP offset */
+	uint64_t mask;       /**< Mask of the BAR aperture (read only) */
+	uint32_t bitsize;    /**< Bit size of the BAR aperture (read only) */
+	uint32_t index;      /**< Index of the BAR */
+	int lock;            /**< If the BAR has been locked */
 
 	char *csr;
-	char *iomem;
+	char *iomem;         /**< mapped IO memory */
 };
 
 #define BUSDEV_SZ	13
@@ -360,9 +345,7 @@ nfp_disable_bars(struct nfp_pcie_user *nfp)
 	}
 }
 
-/*
- * Generic CPP bus access interface.
- */
+/* Generic CPP bus access interface. */
 
 struct nfp6000_area_priv {
 	struct nfp_bar *bar;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 66f4ddaab7..f601907673 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -26,6 +26,15 @@
 #define NFP_PL_DEVICE_MODEL_MASK               (NFP_PL_DEVICE_PART_MASK | \
 						NFP_PL_DEVICE_ID_MASK)
 
+/**
+ * Set the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void
 nfp_cpp_priv_set(struct nfp_cpp *cpp,
 		void *priv)
@@ -33,12 +42,29 @@ nfp_cpp_priv_set(struct nfp_cpp *cpp,
 	cpp->priv = priv;
 }
 
+/**
+ * Return the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void *
 nfp_cpp_priv(struct nfp_cpp *cpp)
 {
 	return cpp->priv;
 }
 
+/**
+ * Set the model id
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param model
+ *   Model ID
+ */
 void
 nfp_cpp_model_set(struct nfp_cpp *cpp,
 		uint32_t model)
@@ -46,6 +72,15 @@ nfp_cpp_model_set(struct nfp_cpp *cpp,
 	cpp->model = model;
 }
 
+/**
+ * Retrieve the Model ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Model ID
+ */
 uint32_t
 nfp_cpp_model(struct nfp_cpp *cpp)
 {
@@ -63,6 +98,14 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 	return model;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param interface
+ *   Interface ID
+ */
 void
 nfp_cpp_interface_set(struct nfp_cpp *cpp,
 		uint32_t interface)
@@ -70,6 +113,17 @@ nfp_cpp_interface_set(struct nfp_cpp *cpp,
 	cpp->interface = interface;
 }
 
+/**
+ * Retrieve the Serial ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param serial
+ *   Pointer to NFP serial number
+ *
+ * @return
+ *   Length of NFP serial number
+ */
 int
 nfp_cpp_serial(struct nfp_cpp *cpp,
 		const uint8_t **serial)
@@ -78,6 +132,16 @@ nfp_cpp_serial(struct nfp_cpp *cpp,
 	return cpp->serial_len;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param serial
+ *   NFP serial byte array
+ * @param serial_len
+ *   Length of the serial byte array
+ */
 int
 nfp_cpp_serial_set(struct nfp_cpp *cpp,
 		const uint8_t *serial,
@@ -96,6 +160,15 @@ nfp_cpp_serial_set(struct nfp_cpp *cpp,
 	return 0;
 }
 
+/**
+ * Retrieve the Interface ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Interface ID
+ */
 uint16_t
 nfp_cpp_interface(struct nfp_cpp *cpp)
 {
@@ -105,18 +178,45 @@ nfp_cpp_interface(struct nfp_cpp *cpp)
 	return cpp->interface;
 }
 
+/**
+ * Get the privately allocated portion of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the private area, or NULL on failure
+ */
 void *
 nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area)
 {
 	return &cpp_area[1];
 }
 
+/**
+ * Get the NFP CPP handle that is the pci_dev of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   NFP CPP handle
+ */
 struct nfp_cpp *
 nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area)
 {
 	return cpp_area->cpp;
 }
 
+/**
+ * Get the name passed during allocation of the NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the area's name
+ */
 const char *
 nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 {
@@ -153,15 +253,24 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
 	return cpp->mu_locality_lsb;
 }
 
-/*
- * nfp_cpp_area_alloc - allocate a new CPP area
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area in bytes
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
  *
- * Allocate and initialize a CPP area structure.  The area must later
- * be locked down with an 'acquire' before it can be safely accessed.
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param name
+ *   Name of region
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
  *
  * NOTE: @address and @size must be 32-bit aligned values.
  */
@@ -211,6 +320,25 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 	return area;
 }
 
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
+ * NOTE: @address and @size must be 32-bit aligned values.
+ */
 struct nfp_cpp_area *
 nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 		uint32_t dest,
@@ -220,17 +348,22 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
 
-/*
- * nfp_cpp_area_alloc_acquire - allocate a new CPP area and lock it down
- *
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area
- *
+/**
  * Allocate and initialize a CPP area structure, and lock it down so
  * that it can be accessed directly.
  *
+ * @param cpp
+ *   CPP device handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
  * NOTE: @address and @size must be 32-bit aligned values.
  *
  * NOTE: The area must also be 'released' when the structure is freed.
@@ -258,11 +391,11 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	return area;
 }
 
-/*
- * nfp_cpp_area_free - free up the CPP area
- * area:    CPP area handle
- *
+/**
  * Frees up memory resources held by the CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_free(struct nfp_cpp_area *area)
@@ -272,11 +405,11 @@ nfp_cpp_area_free(struct nfp_cpp_area *area)
 	free(area);
 }
 
-/*
- * nfp_cpp_area_release_free - release CPP area and free it
- * area:    CPP area handle
+/**
+ * Releases CPP area and frees up memory resources held by it.
  *
- * Releases CPP area and frees up memory resources held by the it.
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release_free(struct nfp_cpp_area *area)
@@ -285,12 +418,15 @@ nfp_cpp_area_release_free(struct nfp_cpp_area *area)
 	nfp_cpp_area_free(area);
 }
 
-/*
- * nfp_cpp_area_acquire - lock down a CPP area for access
- * @area:   CPP area handle
+/**
+ * Locks down the CPP area for a potential long term activity.
+ * Area must always be locked down before being accessed.
  *
- * Locks down the CPP area for a potential long term activity.  Area
- * must always be locked down before being accessed.
+ * @param area
+ *   CPP area handle
+ *
+ * @return
+ *   0 on success, -1 on failure.
  */
 int
 nfp_cpp_area_acquire(struct nfp_cpp_area *area)
@@ -307,11 +443,11 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	return 0;
 }
 
-/*
- * nfp_cpp_area_release - release a locked down CPP area
- * @area:   CPP area handle
- *
+/**
  * Releases a previously locked down CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release(struct nfp_cpp_area *area)
@@ -320,16 +456,16 @@ nfp_cpp_area_release(struct nfp_cpp_area *area)
 		area->cpp->op->area_release(area);
 }
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
+/**
+ * Returns an iomem pointer for use with readl()/writel() style operations.
  *
- * @area:       CPP area handle
+ * @param area
+ *   CPP area handle
  *
- * Returns an iomem pointer for use with readl()/writel() style operations.
+ * @return
+ *   Pointer to the area, or NULL
  *
  * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
  */
 void *
 nfp_cpp_area_iomem(struct nfp_cpp_area *area)
@@ -342,18 +478,22 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
 	return iomem;
 }
 
-/*
- * nfp_cpp_area_read - read data from CPP area
+/**
+ * Read data from indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to put data into
- * @length:     number of bytes to read
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Read data from indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -368,18 +508,22 @@ nfp_cpp_area_read(struct nfp_cpp_area *area,
 	return area->cpp->op->area_read(area, kernel_vaddr, offset, length);
 }
 
-/*
- * nfp_cpp_area_write - write data to CPP area
+/**
+ * Write data to indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to read data from
- * @length:     number of bytes to write
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Write data to indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -436,6 +580,19 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 	return xpb;
 }
 
+/**
+ * Read a uint32_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readl(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -450,6 +607,19 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writel(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -462,6 +632,19 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -476,6 +659,19 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -489,6 +685,21 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint32_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readl(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -504,6 +715,21 @@ nfp_cpp_readl(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writel(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -518,6 +744,21 @@ nfp_cpp_writel(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -533,6 +774,21 @@ nfp_cpp_readq(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writeq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -547,6 +803,19 @@ nfp_cpp_writeq(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t word to a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_writel(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -559,6 +828,19 @@ nfp_xpb_writel(struct nfp_cpp *cpp,
 	return nfp_cpp_writel(cpp, cpp_dest, xpb_addr, value);
 }
 
+/**
+ * Read a uint32_t value from a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_readl(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -625,9 +907,11 @@ nfp_cpp_alloc(struct rte_pci_device *dev,
 	return cpp;
 }
 
-/*
- * nfp_cpp_free - free the CPP handle
- * @cpp:    CPP handle
+/**
+ * Free the CPP handle
+ *
+ * @param cpp
+ *   CPP handle
  */
 void
 nfp_cpp_free(struct nfp_cpp *cpp)
@@ -641,6 +925,19 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 	free(cpp);
 }
 
+/**
+ * Create a NFP CPP handle from device
+ *
+ * @param dev
+ *   PCI device
+ * @param driver_lock_needed
+ *   Driver lock flag
+ *
+ * @return
+ *   NFP CPP handle on success, NULL on failure
+ *
+ * NOTE: On failure, cpp_ops->free will be called!
+ */
 struct nfp_cpp *
 nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed)
@@ -648,13 +945,22 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev,
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
 
-/*
- * nfp_cpp_read - read from CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer for result
- * @length:     number of bytes to read
+/**
+ * Read from CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer for result
+ * @param length
+ *   Number of bytes to read
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_read(struct nfp_cpp *cpp,
@@ -678,13 +984,22 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_cpp_write - write to CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer to read from
- * @length:     number of bytes to write
+/**
+ * Write to CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer to read from
+ * @param length
+ *   Number of bytes to write
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_write(struct nfp_cpp *cpp,
@@ -731,18 +1046,23 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
- * nfp_cpp_map_area() - Helper function to map an area
- * @cpp:    NFP CPP handler
- * @cpp_id: CPP ID
- * @addr:   CPP address
- * @size:   Size of the area
- * @area:   Area handle (output)
+/**
+ * Map an area of IOMEM access.
+ * To undo the effect of this function call @nfp_cpp_area_release_free(*area).
  *
- * Map an area of IOMEM access.  To undo the effect of this function call
- * @nfp_cpp_area_release_free(*area).
+ * @param cpp
+ *   NFP CPP handler
+ * @param cpp_id
+ *   CPP id
+ * @param addr
+ *   CPP address
+ * @param size
+ *   Size of the area
+ * @param area
+ *   Area handle (output)
  *
- * Return: Pointer to memory mapped area or NULL
+ * @return
+ *   Pointer to memory mapped area or NULL
  */
 uint8_t *
 nfp_cpp_map_area(struct nfp_cpp *cpp,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index b658b5e900..f5579ab60f 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -3,7 +3,8 @@
  * All rights reserved.
  */
 
-/* Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
+/*
+ * Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
  * after chip reset.
  *
  * Examples of the fields:
@@ -146,7 +147,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *db;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 10000000;
+	wait.tv_nsec = 10000000;    /* 10ms */
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -154,7 +155,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 			return db;
 
 		nanosleep(&wait, NULL);
-		if (count++ > 200) {
+		if (count++ > 200) {    /* 10ms * 200 = 2s */
 			PMD_DRV_LOG(ERR, "NFP access error");
 			return NULL;
 		}
@@ -180,12 +181,16 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
 	return db;
 }
 
-/*
- * nfp_hwinfo_lookup() - Find a value in the HWInfo table by name
- * @hwinfo:	NFP HWinfo table
- * @lookup:	HWInfo name to search for
+/**
+ * Find a value in the HWInfo table by name
+ *
+ * @param hwinfo
+ *   NFP HWInfo table
+ * @param lookup
+ *   HWInfo name to search for
  *
- * Return: Value of the HWInfo name, or NULL
+ * @return
+ *   Value of the HWInfo name, or NULL
  */
 const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
index a3da7512db..424db8035d 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
@@ -59,6 +59,8 @@
  * Packed UTF8Z strings, ie 'key1\000value1\000key2\000value2\000'
  *
  * Unsorted.
+ *
+ * Note: Only the HwInfo v2 Table be supported now.
  */
 
 #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 086e82db70..0892c99e96 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -87,15 +87,16 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_mip_open() - Get device MIP structure
- * @cpp:	NFP CPP Handle
- *
- * Copy MIP structure from NFP device and return it.  The returned
+/**
+ * Copy MIP structure from NFP device and return it. The returned
  * structure is handled internally by the library and should be
- * freed by calling nfp_mip_close().
+ * freed by calling @nfp_mip_close().
+ *
+ * @param cpp
+ *   NFP CPP Handle
  *
- * Return: pointer to mip, NULL on failure.
+ * @return
+ *   Pointer to MIP, NULL on failure.
  */
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
@@ -131,11 +132,15 @@ nfp_mip_name(const struct nfp_mip *mip)
 	return mip->name;
 }
 
-/*
- * nfp_mip_symtab() - Get the address and size of the MIP symbol table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol table
- * @size:	Location for size of MIP symbol table
+/**
+ * Get the address and size of the MIP symbol table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol table
+ * @param size
+ *   Location for size of MIP symbol table
  */
 void
 nfp_mip_symtab(const struct nfp_mip *mip,
@@ -146,11 +151,15 @@ nfp_mip_symtab(const struct nfp_mip *mip,
 	*size = rte_le_to_cpu_32(mip->symtab_size);
 }
 
-/*
- * nfp_mip_strtab() - Get the address and size of the MIP symbol name table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol name table
- * @size:	Location for size of MIP symbol name table
+/**
+ * Get the address and size of the MIP symbol name table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol name table
+ * @param size
+ *   Location for size of MIP symbol name table
  */
 void
 nfp_mip_strtab(const struct nfp_mip *mip,
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 82919d8270..404d4fa938 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -53,7 +53,7 @@ _nfp_cpp_mutex_validate(uint32_t model,
 	return 0;
 }
 
-/*
+/**
  * Initialize a mutex location
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -65,13 +65,17 @@ _nfp_cpp_mutex_validate(uint32_t model,
  * This function should only be called when setting up
  * the initial lock state upon boot-up of the system.
  *
- * @param mutex     NFP CPP Mutex handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       Unique 32-bit value for this mutex
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   Unique 32-bit value for this mutex
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_init(struct nfp_cpp *cpp,
@@ -99,7 +103,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
+/**
  * Create a mutex handle from an address controlled by a MU Atomic engine
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -108,13 +112,17 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
  * Only target/address pairs that point to entities that support the
  * MU Atomic Engine are supported.
  *
- * @param cpp       NFP CPP handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       32-bit unique key (must match the key at this location)
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   32-bit unique key (must match the key at this location)
  *
- * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
+ * @return
+ *   A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
 nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
@@ -178,10 +186,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	return mutex;
 }
 
-/*
+/**
  * Free a mutex handle - does not alter the lock state
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  */
 void
 nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
@@ -203,12 +212,14 @@ nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
 	free(mutex);
 }
 
-/*
+/**
  * Lock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure.
  */
 int
 nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
@@ -229,12 +240,14 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 	return 0;
 }
 
-/*
+/**
  * Unlock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
@@ -280,16 +293,18 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 	return err;
 }
 
-/*
+/**
  * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
  *
  * Valid lock states:
- *
  *      0x....0000      - Unlocked
  *      0x....000f      - Locked
  *
- * @param mutex     NFP CPP Mutex handle
- * @return      0 if the lock succeeded, negative value on failure.
+ * @param mutex
+ *   NFP CPP Mutex handle
+ *
+ * @return
+ *   0 if the lock succeeded, negative value on failure.
  */
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
@@ -352,7 +367,7 @@ nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 		 * If there was another contending for this lock, then
 		 * the lock state would be 0x....000f
 		 *
-		 * Write our owner ID into the lock
+		 * Write our owner ID into the lock.
 		 * While not strictly necessary, this helps with
 		 * debug and bookkeeping.
 		 */
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 6ba40cd085..af55671a88 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -52,7 +52,7 @@ nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi)
 	return (fi->loaded__mu_da__mip_off_hi >> 8) & 1;
 }
 
-/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 8) | mip_offset_lo */
+/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */
 static uint64_t
 nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 {
@@ -111,11 +111,14 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
 	}
 }
 
-/*
- * nfp_nffw_info_open() - Acquire the lock on the NFFW table
- * @cpp:	NFP CPP handle
+/**
+ * Acquire the lock on the NFFW table
+ *
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: nffw info pointer, or NULL on failure
+ * @return
+ *   NFFW info pointer, or NULL on failure
  */
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
@@ -167,11 +170,11 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_close() - Release the lock on the NFFW table
- * @state:	NFP FW info state
+/**
+ * Release the lock on the NFFW table
  *
- * Return: void
+ * @param state
+ *   NFFW info pointer
  */
 void
 nfp_nffw_info_close(struct nfp_nffw_info *state)
@@ -180,11 +183,14 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 	free(state);
 }
 
-/*
- * nfp_nffw_info_fwid_first() - Return the first firmware ID in the NFFW
- * @state:	NFP FW info state
+/**
+ * Return the first firmware ID in the NFFW
  *
- * Return: First NFFW firmware info, NULL on failure
+ * @param state
+ *   NFFW info pointer
+ *
+ * @return:
+ *   First NFFW firmware info, NULL on failure
  */
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
@@ -204,13 +210,18 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_mip_first() - Retrieve the location of the first FW's MIP
- * @state:	NFP FW info state
- * @cpp_id:	Pointer to the CPP ID of the MIP
- * @off:	Pointer to the CPP Address of the MIP
+/**
+ * Retrieve the location of the first FW's MIP
+ *
+ * @param state
+ *   NFFW info pointer
+ * @param cpp_id
+ *   Pointer to the CPP ID of the MIP
+ * @param off
+ *   Pointer to the CPP Address of the MIP
  *
- * Return: 0, or -ERRNO
+ * @return
+ *   0, or -ERRNO
  */
 int
 nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h
index 46ac8a8d07..e032b6cce7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.h
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.h
@@ -8,7 +8,8 @@
 
 #include "nfp_cpp.h"
 
-/* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
+/*
+ * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
  * Lower IDs are reserved for target and loader IDs.
  */
 #define NFFW_FWID_EXT   3 /* For active MEs that we didn't load. */
@@ -16,7 +17,7 @@
 
 #define NFFW_FWID_ALL   255
 
-/**
+/*
  * NFFW_INFO_VERSION history:
  * 0: This was never actually used (before versioning), but it refers to
  *    the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
@@ -35,6 +36,7 @@
 #define NFFW_MEINFO_CNT_V2 200
 #define NFFW_FWINFO_CNT_V2 200
 
+/* nfp.nffw meinfo */
 struct nffw_meinfo {
 	uint32_t ctxmask__fwid__meid;
 };
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 76d418d478..039e4729bd 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -109,9 +109,11 @@ nfp_nsp_check(struct nfp_nsp *state)
 	return 0;
 }
 
-/*
- * nfp_nsp_open() - Prepare for communication and lock the NSP resource.
- * @cpp:	NFP CPP Handle
+/**
+ * Prepare for communication and lock the NSP resource.
+ *
+ * @param cpp
+ *   NFP CPP Handle
  */
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
@@ -145,9 +147,11 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	return state;
 }
 
-/*
- * nfp_nsp_close() - Clean up and unlock the NSP resource.
- * @state:	NFP SP state
+/**
+ * Clean up and unlock the NSP resource.
+ *
+ * @param state
+ *   NFP SP state
  */
 void
 nfp_nsp_close(struct nfp_nsp *state)
@@ -181,7 +185,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;     /* 25ms */
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -194,28 +198,27 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 			return 0;
 
 		nanosleep(&wait, 0);
-		if (count++ > 1000)
+		if (count++ > 1000)     /* 25ms * 1000 = 25s */
 			return -ETIMEDOUT;
 	}
 }
 
-/*
- * nfp_nsp_command() - Execute a command on the NFP Service Processor
- * @state:	NFP SP state
- * @code:	NFP SP Command Code
- * @option:	NFP SP Command Argument
- * @buff_cpp:	NFP SP Buffer CPP Address info
- * @buff_addr:	NFP SP Buffer Host address
- *
- * Return: 0 for success with no result
+/**
+ * Execute a command on the NFP Service Processor
  *
- *	 positive value for NSP completion with a result code
+ * @param state
+ *   NFP SP state
+ * @param arg
+ *   NFP command argument structure
  *
- *	-EAGAIN if the NSP is not yet present
- *	-ENODEV if the NSP is not a supported model
- *	-EBUSY if the NSP is stuck
- *	-EINTR if interrupted while waiting for completion
- *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
+ * @return
+ *   - 0 for success with no result
+ *   - Positive value for NSP completion with a result code
+ *   - -EAGAIN if the NSP is not yet present
+ *   - -ENODEV if the NSP is not a supported model
+ *   - -EBUSY if the NSP is stuck
+ *   - -EINTR if interrupted while waiting for completion
+ *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
 nfp_nsp_command(struct nfp_nsp *state,
@@ -383,7 +386,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
@@ -392,7 +395,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 
 		nanosleep(&wait, 0);
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 25ms * 1000 = 25s */
 			err = -ETIMEDOUT;
 			break;
 		}
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index edb56e26ca..0fcb21e99c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -158,72 +158,45 @@ enum nfp_eth_fec {
 #define NFP_FEC_REED_SOLOMON	RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT)
 #define NFP_FEC_DISABLED	RTE_BIT32(NFP_FEC_DISABLED_BIT)
 
-/**
- * struct nfp_eth_table - ETH table information
- * @count:	number of table entries
- * @max_index:	max of @index fields of all @ports
- * @ports:	table of ports
- *
- * @eth_index:	port index according to legacy ethX numbering
- * @index:	chip-wide first channel index
- * @nbi:	NBI index
- * @base:	first channel index (within NBI)
- * @lanes:	number of channels
- * @speed:	interface speed (in Mbps)
- * @interface:	interface (module) plugged in
- * @media:	media type of the @interface
- * @fec:	forward error correction mode
- * @aneg:	auto negotiation mode
- * @mac_addr:	interface MAC address
- * @label_port:	port id
- * @label_subport:  id of interface within port (for split ports)
- * @enabled:	is enabled?
- * @tx_enabled:	is TX enabled?
- * @rx_enabled:	is RX enabled?
- * @override_changed: is media reconfig pending?
- *
- * @port_type:	one of %PORT_* defines for ethtool
- * @port_lanes:	total number of lanes on the port (sum of lanes of all subports)
- * @is_split:	is interface part of a split port
- * @fec_modes_supported:	bitmap of FEC modes supported
- */
+/* ETH table information */
 struct nfp_eth_table {
-	uint32_t count;
-	uint32_t max_index;
+	uint32_t count;     /**< Number of table entries */
+	uint32_t max_index; /**< Max of @index fields of all @ports */
 	struct nfp_eth_table_port {
+		/** Port index according to legacy ethX numbering */
 		uint32_t eth_index;
-		uint32_t index;
-		uint32_t nbi;
-		uint32_t base;
-		uint32_t lanes;
-		uint32_t speed;
+		uint32_t index;  /**< Chip-wide first channel index */
+		uint32_t nbi;    /**< NBI index */
+		uint32_t base;   /**< First channel index (within NBI) */
+		uint32_t lanes;  /**< Number of channels */
+		uint32_t speed;  /**< Interface speed (in Mbps) */
 
-		uint32_t interface;
-		enum nfp_eth_media media;
+		uint32_t interface;  /**< Interface (module) plugged in */
+		enum nfp_eth_media media; /**< Media type of the @interface */
 
-		enum nfp_eth_fec fec;
-		enum nfp_eth_aneg aneg;
+		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
-		struct rte_ether_addr mac_addr;
+		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
 
-		uint8_t label_port;
+		uint8_t label_port;    /**< Port id */
+		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;
-		int tx_enabled;
-		int rx_enabled;
-
-		int override_changed;
+		int enabled;     /**< Enable port */
+		int tx_enabled;  /**< Enable TX */
+		int rx_enabled;  /**< Enable RX */
 
-		/* Computed fields */
-		uint8_t port_type;
+		int override_changed;  /**< Media reconfig pending */
 
+		uint8_t port_type;    /**< One of %PORT_* */
+		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;
+		int is_split;   /**< Split port */
 
-		uint32_t fec_modes_supported;
-	} ports[];
+		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
+	} ports[]; /**< Table of ports */
 };
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
@@ -263,28 +236,17 @@ int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode);
 int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed);
 int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes);
 
-/**
- * struct nfp_nsp_identify - NSP static information
- * @version:      opaque version string
- * @flags:        version flags
- * @br_primary:   branch id of primary bootloader
- * @br_secondary: branch id of secondary bootloader
- * @br_nsp:       branch id of NSP
- * @primary:      version of primary bootloader
- * @secondary:    version id of secondary bootloader
- * @nsp:          version id of NSP
- * @sensor_mask:  mask of present sensors available on NIC
- */
+/* NSP static information */
 struct nfp_nsp_identify {
-	char version[40];
-	uint8_t flags;
-	uint8_t br_primary;
-	uint8_t br_secondary;
-	uint8_t br_nsp;
-	uint16_t primary;
-	uint16_t secondary;
-	uint16_t nsp;
-	uint64_t sensor_mask;
+	char version[40];      /**< Opaque version string */
+	uint8_t flags;         /**< Version flags */
+	uint8_t br_primary;    /**< Branch id of primary bootloader */
+	uint8_t br_secondary;  /**< Branch id of secondary bootloader */
+	uint8_t br_nsp;        /**< Branch id of NSP */
+	uint16_t primary;      /**< Version of primary bootloader */
+	uint16_t secondary;    /**< Version id of secondary bootloader */
+	uint16_t nsp;          /**< Version id of NSP */
+	uint64_t sensor_mask;  /**< Mask of present sensors available on NIC */
 };
 
 struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 51dcf24f5f..e32884e7d3 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -263,7 +263,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/* The NFP3800 NIC support 8 ports, but only 2 ports are valid,
+	/*
+	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
 	 * the rest 6 ports mac are all 0, ensure we don't use these port
 	 */
 	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
@@ -273,7 +274,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 			cnt++;
 	}
 
-	/* Some versions of flash will give us 0 instead of port count. For
+	/*
+	 * Some versions of flash will give us 0 instead of port count. For
 	 * those that give a port count, verify it against the value calculated
 	 * above.
 	 */
@@ -311,14 +313,16 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	return NULL;
 }
 
-/*
- * nfp_eth_read_ports() - retrieve port information
- * @cpp:	NFP CPP handle
+/**
+ * Read the port information from the device.
+ *
+ * Returned structure should be freed once no longer needed.
  *
- * Read the port information from the device.  Returned structure should
- * be freed with kfree() once no longer needed.
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: populated ETH table or NULL on error.
+ * @return
+ *   Populated ETH table or NULL on error.
  */
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
@@ -386,19 +390,19 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 	free(entries);
 }
 
-/*
- * nfp_eth_config_commit_end() - perform recorded configuration changes
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- *
+/**
  * Perform the configuration which was requested with __nfp_eth_set_*()
- * helpers and recorded in @nsp state.  If device was already configured
- * as requested or no __nfp_eth_set_*() operations were made no NSP command
+ * helpers and recorded in @nsp state. If device was already configured
+ * as requested or no __nfp_eth_set_*() operations were made, no NSP command
  * will be performed.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
@@ -416,19 +420,21 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 	return ret;
 }
 
-/*
- * nfp_eth_set_mod_enable() - set PHY module enable control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @enable:	Desired state
- *
+/**
  * Enable or disable PHY module (this usually means setting the TX lanes
  * disable bits).
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param enable
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
@@ -459,18 +465,20 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * nfp_eth_set_configured() - set PHY module configured control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @configed:	Desired state
- *
+/**
  * Set the ifup/ifdown state on the PHY.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param configured
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
@@ -524,7 +532,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
-	 *	 codes were initially not populated correctly.
+	 * codes were initially not populated correctly.
 	 */
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 17) {
 		PMD_DRV_LOG(ERR, "set operations not supported, please update flash");
@@ -554,15 +562,17 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 				val, ctrl_bit);			\
 	}))
 
-/*
- * __nfp_eth_set_aneg() - set PHY autonegotiation control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired autonegotiation mode
- *
+/**
  * Allow/disallow PHY module to advertise/perform autonegotiation.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired autonegotiation mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_aneg(struct nfp_nsp *nsp,
@@ -572,15 +582,17 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
-/*
- * __nfp_eth_set_fec() - set PHY forward error correction control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired fec mode
- *
+/**
  * Set the PHY module forward error correction mode.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired fec mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 static int
 __nfp_eth_set_fec(struct nfp_nsp *nsp,
@@ -590,16 +602,20 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
-/*
- * nfp_eth_set_fec() - set PHY forward error correction control mode
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @mode:	Desired fec mode
+/**
+ * Set PHY forward error correction control mode
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param mode
+ *   Desired fec mode
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_fec(struct nfp_cpp *cpp,
@@ -622,17 +638,19 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * __nfp_eth_set_speed() - set interface speed/rate
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @speed:	Desired speed (per lane)
- *
- * Set lane speed.  Provided @speed value should be subport speed divided
- * by number of lanes this subport is spanning (i.e. 10000 for 40G, 25000 for
- * 50G, etc.)
+/**
+ * Set lane speed.
+ * Provided @speed value should be subport speed divided by number of
+ * lanes this subport is spanning (i.e. 10000 for 40G, 25000 for 50G, etc.)
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param speed
+ *   Desired speed (per lane)
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_speed(struct nfp_nsp *nsp,
@@ -650,15 +668,17 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
-/*
- * __nfp_eth_set_split() - set interface lane split
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @lanes:	Desired lanes per port
- *
+/**
  * Set number of lanes in the port.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param lanes
+ *   Desired lanes per port
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_split(struct nfp_nsp *nsp,
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 363f7d6198..bdebf5c3aa 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -22,32 +22,23 @@
 
 #define NFP_RESOURCE_ENTRY_NAME_SZ	8
 
-/*
- * struct nfp_resource_entry - Resource table entry
- * @owner:		NFP CPP Lock, interface owner
- * @key:		NFP CPP Lock, posix_crc32(name, 8)
- * @region:		Memory region descriptor
- * @name:		ASCII, zero padded name
- * @reserved
- * @cpp_action:		CPP Action
- * @cpp_token:		CPP Token
- * @cpp_target:		CPP Target ID
- * @page_offset:	256-byte page offset into target's CPP address
- * @page_size:		size, in 256-byte pages
- */
+/* Resource table entry */
 struct nfp_resource_entry {
 	struct nfp_resource_entry_mutex {
-		uint32_t owner;
-		uint32_t key;
+		uint32_t owner;  /**< NFP CPP Lock, interface owner */
+		uint32_t key;    /**< NFP CPP Lock, posix_crc32(name, 8) */
 	} mutex;
+	/* Memory region descriptor */
 	struct nfp_resource_entry_region {
+		/** ASCII, zero padded name */
 		uint8_t  name[NFP_RESOURCE_ENTRY_NAME_SZ];
 		uint8_t  reserved[5];
-		uint8_t  cpp_action;
-		uint8_t  cpp_token;
-		uint8_t  cpp_target;
+		uint8_t  cpp_action;  /**< CPP Action */
+		uint8_t  cpp_token;   /**< CPP Token */
+		uint8_t  cpp_target;  /**< CPP Target ID */
+		/** 256-byte page offset into target's CPP address */
 		uint32_t page_offset;
-		uint32_t page_size;
+		uint32_t page_size;   /**< Size, in 256-byte pages */
 	} region;
 };
 
@@ -147,14 +138,18 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_resource_acquire() - Acquire a resource handle
- * @cpp:	NFP CPP handle
- * @name:	Name of the resource
+/**
+ * Acquire a resource handle
+ *
+ * Note: This function locks the acquired resource.
  *
- * NOTE: This function locks the acquired resource
+ * @param cpp
+ *   NFP CPP handle
+ * @param name
+ *   Name of the resource
  *
- * Return: NFP Resource handle, or NULL
+ * @return
+ *   NFP Resource handle, or NULL
  */
 struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
@@ -183,7 +178,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	}
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 1000000;
+	wait.tv_nsec = 1000000;    /* 1ms */
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
@@ -194,7 +189,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 			goto err_free;
 		}
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 1ms * 1000 = 1s */
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
 			err = -EBUSY;
 			goto err_free;
@@ -213,11 +208,13 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_resource_release() - Release a NFP Resource handle
- * @res:	NFP Resource handle
+/**
+ * Release a NFP Resource handle
  *
- * NOTE: This function implicitly unlocks the resource handle
+ * NOTE: This function implicitly unlocks the resource handle.
+ *
+ * @param res
+ *   NFP Resource handle
  */
 void
 nfp_resource_release(struct nfp_resource *res)
@@ -227,11 +224,14 @@ nfp_resource_release(struct nfp_resource *res)
 	free(res);
 }
 
-/*
- * nfp_resource_cpp_id() - Return the cpp_id of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the cpp_id of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 uint32_t
 nfp_resource_cpp_id(const struct nfp_resource *res)
@@ -239,11 +239,14 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
 	return res->cpp_id;
 }
 
-/*
- * nfp_resource_name() - Return the name of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the name of a resource handle
  *
- * Return: const char pointer to the name of the resource
+ * @param res
+ *   NFP Resource handle
+ *
+ * @return
+ *   Const char pointer to the name of the resource
  */
 const char *
 nfp_resource_name(const struct nfp_resource *res)
@@ -251,11 +254,14 @@ nfp_resource_name(const struct nfp_resource *res)
 	return res->name;
 }
 
-/*
- * nfp_resource_address() - Return the address of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the address of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Address of the resource
+ * @return
+ *   Address of the resource
  */
 uint64_t
 nfp_resource_address(const struct nfp_resource *res)
@@ -263,11 +269,14 @@ nfp_resource_address(const struct nfp_resource *res)
 	return res->addr;
 }
 
-/*
- * nfp_resource_size() - Return the size in bytes of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the size in bytes of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Size of the resource in bytes
+ * @return
+ *   Size of the resource in bytes
  */
 uint64_t
 nfp_resource_size(const struct nfp_resource *res)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 009b7359a4..4236950caf 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -8,43 +8,27 @@
 
 #include "nfp_cpp.h"
 
+/* Netronone Flow Firmware Table */
 #define NFP_RESOURCE_NFP_NFFW           "nfp.nffw"
+
+/* NFP Hardware Info Database */
 #define NFP_RESOURCE_NFP_HWINFO         "nfp.info"
+
+/* Service Processor */
 #define NFP_RESOURCE_NSP		"nfp.sp"
 
-/**
- * Opaque handle to a NFP Resource
- */
+/* Opaque handle to a NFP Resource */
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name);
 
-/**
- * Release a NFP Resource, and free the handle
- * @param[in]   res     NFP Resource handle
- */
 void nfp_resource_release(struct nfp_resource *res);
 
-/**
- * Return the CPP ID of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      CPP ID of the NFP Resource
- */
 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
 
-/**
- * Return the name of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Name of the NFP Resource
- */
 const char *nfp_resource_name(const struct nfp_resource *res);
 
-/**
- * Return the target address of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Address of the NFP Resource
- */
 uint64_t nfp_resource_address(const struct nfp_resource *res);
 
 uint64_t nfp_resource_size(const struct nfp_resource *res);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index d15a920752..0e6c0f9fe1 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -162,11 +162,14 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_rtsym_count() - Get the number of RTSYM descriptors
- * @rtbl:	NFP RTsym table
+/**
+ * Get the number of RTSYM descriptors
+ *
+ * @param rtbl
+ *   NFP RTSYM table
  *
- * Return: Number of RTSYM descriptors
+ * @return
+ *   Number of RTSYM descriptors
  */
 int
 nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
@@ -177,12 +180,16 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
 	return rtbl->num;
 }
 
-/*
- * nfp_rtsym_get() - Get the Nth RTSYM descriptor
- * @rtbl:	NFP RTsym table
- * @idx:	Index (0-based) of the RTSYM descriptor
+/**
+ * Get the Nth RTSYM descriptor
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param idx
+ *   Index (0-based) of the RTSYM descriptor
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
@@ -197,12 +204,16 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
 	return &rtbl->symtab[idx];
 }
 
-/*
- * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
+/**
+ * Return the RTSYM descriptor for a symbol name
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
@@ -227,7 +238,8 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_NONE:
 		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
-	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_OBJECT:
+		/* FALLTHROUGH */
 	case NFP_RTSYM_TYPE_FUNCTION:
 		return sym->size;
 	case NFP_RTSYM_TYPE_ABS:
@@ -327,17 +339,22 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
 	return nfp_cpp_readq(cpp, cpp_id, addr, value);
 }
 
-/*
- * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
- * @error:	Pointer to error code (optional)
+/**
+ * Read a simple unsigned scalar value from symbol
  *
  * Lookup a symbol, map, read it and return it's value. Value of the symbol
  * will be interpreted as a simple little-endian unsigned value. Symbol can
  * be 4 or 8 bytes in size.
  *
- * Return: value read, on error sets the error and returns ~0ULL.
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
+ * @param error
+ *   Pointer to error code (optional)
+ *
+ * @return
+ *   Value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index e7295258b3..ff1facbd17 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -31,12 +31,12 @@
  * of "sram" symbols for backward compatibility, which are viewed as global.
  */
 struct nfp_rtsym {
-	const char *name;
-	uint64_t addr;
-	uint64_t size;
-	int type;
-	int target;
-	int domain;
+	const char *name;  /**< Symbol name */
+	uint64_t addr;     /**< Address in the domain/target's address space */
+	uint64_t size;     /**< Size (in bytes) of the symbol */
+	int type;          /**< NFP_RTSYM_TYPE_* of the symbol */
+	int target;        /**< CPP target identifier, or NFP_RTSYM_TARGET_* */
+	int domain;        /**< CPP target domain */
 };
 
 struct nfp_rtsym_table;
diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c
index 611848e233..540b242a43 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/nfp/nfpcore/nfp_target.c
@@ -767,7 +767,7 @@ nfp_encode_basic(uint64_t *addr,
 		/*
 		 * Make sure we compare against isldN values by clearing the
 		 * LSB. This is what the silicon does.
-		 **/
+		 */
 		isld[0] &= ~1;
 		isld[1] &= ~1;
 
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH v2 05/27] net/nfp: standard the local variable coding style
    2023-08-30  2:14  2%   ` [PATCH v2 02/27] net/nfp: unify the indent coding style Chaoyong He
@ 2023-08-30  2:14  3%   ` Chaoyong He
  2023-08-30  2:14  1%   ` [PATCH v2 07/27] net/nfp: standard the comment style Chaoyong He
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-30  2:14 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

There should only declare one local variable in each line, and the local
variable should be arranged from short to long in the function.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 58 ++++++++++++----------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 14 +++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 27 ++++++----
 drivers/net/nfp/nfpcore/nfp_mip.c          |  8 +--
 drivers/net/nfp/nfpcore/nfp_mutex.c        | 25 ++++++----
 drivers/net/nfp/nfpcore/nfp_nffw.c         | 15 +++---
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 40 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |  8 +--
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 39 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_resource.c     | 15 +++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 19 ++++---
 11 files changed, 151 insertions(+), 117 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index ec14ec45dc..78beee07ef 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -140,9 +140,9 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		size_t size,
 		int width)
 {
-	uint32_t bitsize;
-	uint32_t newcfg;
 	uint64_t mask;
+	uint32_t newcfg;
+	uint32_t bitsize;
 
 	if (tgt >= 16)
 		return -EINVAL;
@@ -239,7 +239,8 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 		struct nfp_bar *bar,
 		uint32_t newcfg)
 {
-	int base, slot;
+	int base;
+	int slot;
 
 	base = bar->index >> 3;
 	slot = bar->index & 7;
@@ -268,9 +269,9 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 		size_t size,
 		int width)
 {
-	uint64_t newbase;
-	uint32_t newcfg;
 	int err;
+	uint32_t newcfg;
+	uint64_t newbase;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
 			size, width);
@@ -303,8 +304,10 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 static int
 nfp_enable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -333,8 +336,10 @@ nfp_enable_bars(struct nfp_pcie_user *nfp)
 static struct nfp_bar *
 nfp_alloc_bar(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -356,8 +361,10 @@ nfp_alloc_bar(struct nfp_pcie_user *nfp)
 static void
 nfp_disable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -403,12 +410,13 @@ nfp6000_area_init(struct nfp_cpp_area *area,
 		uint64_t address,
 		size_t size)
 {
-	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
-	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	int pp;
+	int ret = 0;
+	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	uint32_t target = NFP_CPP_ID_TARGET_of(dest);
 	uint32_t action = NFP_CPP_ID_ACTION_of(dest);
-	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
-	int pp, ret = 0;
+	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 
 	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
@@ -493,14 +501,14 @@ nfp6000_area_read(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
+	size_t n;
+	int width;
+	bool is_64;
+	uint32_t *wrptr32 = kernel_vaddr;
 	uint64_t *wrptr64 = kernel_vaddr;
-	const volatile uint64_t *rdptr64;
 	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32 = kernel_vaddr;
 	const volatile uint32_t *rdptr32;
-	int width;
-	size_t n;
-	bool is_64;
+	const volatile uint64_t *rdptr64;
 
 	priv = nfp_cpp_area_priv(area);
 	rdptr64 = (uint64_t *)(priv->iomem + offset);
@@ -563,14 +571,14 @@ nfp6000_area_write(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
-	const uint64_t *rdptr64 = kernel_vaddr;
-	uint64_t *wrptr64;
-	const uint32_t *rdptr32 = kernel_vaddr;
-	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32;
-	int width;
 	size_t n;
+	int width;
 	bool is_64;
+	uint32_t *wrptr32;
+	uint64_t *wrptr64;
+	struct nfp6000_area_priv *priv;
+	const uint32_t *rdptr32 = kernel_vaddr;
+	const uint64_t *rdptr64 = kernel_vaddr;
 
 	priv = nfp_cpp_area_priv(area);
 	wrptr64 = (uint64_t *)(priv->iomem + offset);
@@ -693,10 +701,10 @@ static int
 nfp6000_set_serial(struct rte_pci_device *dev,
 		struct nfp_cpp *cpp)
 {
+	off_t pos;
 	uint16_t tmp;
 	uint8_t serial[6];
 	int serial_len = 6;
-	off_t pos;
 
 	pos = rte_pci_find_ext_capability(dev, RTE_PCI_EXT_CAP_ID_DSN);
 	if (pos <= 0) {
@@ -741,8 +749,8 @@ static int
 nfp6000_set_barsz(struct rte_pci_device *dev,
 		struct nfp_pcie_user *desc)
 {
-	uint64_t tmp;
 	int i = 0;
+	uint64_t tmp;
 
 	tmp = dev->mem_resource[0].len;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index f885e7d8ff..776842bdf6 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -172,9 +172,9 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t size)
 {
+	int err;
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
-	int err;
 
 	if (cpp == NULL)
 		return NULL;
@@ -396,8 +396,8 @@ static uint32_t
 nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 		uint32_t *xpb_addr)
 {
-	uint32_t xpb;
 	int island;
+	uint32_t xpb;
 
 	xpb = NFP_CPP_ID(14, NFP_CPP_ACTION_RW, 0);
 
@@ -569,9 +569,9 @@ static struct nfp_cpp *
 nfp_cpp_alloc(struct rte_pci_device *dev,
 		int driver_lock_needed)
 {
-	const struct nfp_cpp_operations *ops;
-	struct nfp_cpp *cpp;
 	int err;
+	struct nfp_cpp *cpp;
+	const struct nfp_cpp_operations *ops;
 
 	ops = nfp_cpp_transport_operations();
 
@@ -657,8 +657,8 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 		void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
@@ -687,8 +687,8 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 		const void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL)
@@ -708,8 +708,8 @@ uint32_t
 __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 		uint32_t *model)
 {
-	uint32_t reg;
 	int err;
+	uint32_t reg;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
 			&reg);
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index ea4c7d6a9e..819761eda0 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -36,7 +36,9 @@ static int
 nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
 		uint32_t size)
 {
-	const char *key, *val, *end = hwinfo->data + size;
+	const char *key;
+	const char *val;
+	const char *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
 			key = val + strlen(val) + 1) {
@@ -58,7 +60,9 @@ static int
 nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 		uint32_t len)
 {
-	uint32_t size, new_crc, *crc;
+	uint32_t *crc;
+	uint32_t size;
+	uint32_t new_crc;
 
 	size = db->size;
 	if (size > len) {
@@ -82,12 +86,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 		size_t *cpp_size)
 {
-	struct nfp_hwinfo *header;
-	void *res;
-	uint64_t cpp_addr;
-	uint32_t cpp_id;
 	int err;
+	void *res;
 	uint8_t *db;
+	uint32_t cpp_id;
+	uint64_t cpp_addr;
+	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
 	if (res) {
@@ -135,13 +139,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 		size_t *hwdb_size)
 {
+	int count = 0;
 	struct timespec wait;
 	struct nfp_hwinfo *db;
-	int count;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 10000000;
-	count = 0;
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -159,9 +162,9 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 struct nfp_hwinfo *
 nfp_hwinfo_read(struct nfp_cpp *cpp)
 {
-	struct nfp_hwinfo *db;
-	size_t hwdb_size = 0;
 	int err;
+	size_t hwdb_size = 0;
+	struct nfp_hwinfo *db;
 
 	db = nfp_hwinfo_fetch(cpp, &hwdb_size);
 	if (db == NULL)
@@ -186,7 +189,9 @@ const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
 		const char *lookup)
 {
-	const char *key, *val, *end;
+	const char *key;
+	const char *val;
+	const char *end;
 
 	if (hwinfo == NULL || lookup == NULL)
 		return NULL;
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 0071d3fc37..1e601313b4 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -68,10 +68,10 @@ static int
 nfp_mip_read_resource(struct nfp_cpp *cpp,
 		struct nfp_mip *mip)
 {
-	struct nfp_nffw_info *nffw_info;
-	uint32_t cpp_id;
-	uint64_t addr;
 	int err;
+	uint64_t addr;
+	uint32_t cpp_id;
+	struct nfp_nffw_info *nffw_info;
 
 	nffw_info = nfp_nffw_info_open(cpp);
 	if (nffw_info == NULL)
@@ -100,8 +100,8 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
 {
-	struct nfp_mip *mip;
 	int err;
+	struct nfp_mip *mip;
 
 	mip = malloc(sizeof(*mip));
 	if (mip == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 4d26e6f052..05e0ff46e5 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -79,9 +79,9 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
+	int err;
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
-	int err;
 
 	err = _nfp_cpp_mutex_validate(model, &target, address);
 	if (err < 0)
@@ -122,11 +122,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
-	uint32_t model = nfp_cpp_model(cpp);
-	struct nfp_cpp_mutex *mutex;
-	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 	int err;
 	uint32_t tmp;
+	struct nfp_cpp_mutex *mutex;
+	uint32_t model = nfp_cpp_model(cpp);
+	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 
 	/* Look for cached mutex */
 	for (mutex = cpp->mutex_cache; mutex; mutex = mutex->next) {
@@ -241,12 +241,13 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 {
-	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
-	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
+	int err;
+	uint32_t key;
+	uint32_t value;
 	struct nfp_cpp *cpp = mutex->cpp;
-	uint32_t key, value;
 	uint16_t interface = nfp_cpp_interface(cpp);
-	int err;
+	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
+	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 
 	if (mutex->depth > 1) {
 		mutex->depth--;
@@ -295,12 +296,14 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 {
+	int err;
+	uint32_t key;
+	uint32_t tmp;
+	uint32_t value;
+	struct nfp_cpp *cpp = mutex->cpp;
 	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
 	uint32_t mus = NFP_CPP_ID(mutex->target, 5, 3);	/* test_set_imm */
-	uint32_t key, value, tmp;
-	struct nfp_cpp *cpp = mutex->cpp;
-	int err;
 
 	if (mutex->depth > 0) {
 		if (mutex->depth == MUTEX_DEPTH_MAX)
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 7ff468373b..32e0fc94bb 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -68,9 +68,11 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 static int
 nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 {
-	uint32_t mode, addr40;
-	uint32_t xpbaddr, imbcppat;
 	int err;
+	uint32_t mode;
+	uint32_t addr40;
+	uint32_t xpbaddr;
+	uint32_t imbcppat;
 
 	/* Hardcoded XPB IMB Base, island 0 */
 	xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4;
@@ -117,10 +119,10 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
 {
-	struct nfp_nffw_info_data *fwinf;
-	struct nfp_nffw_info *state;
-	uint32_t info_ver;
 	int err;
+	uint32_t info_ver;
+	struct nfp_nffw_info *state;
+	struct nfp_nffw_info_data *fwinf;
 
 	state = malloc(sizeof(*state));
 	if (state == NULL)
@@ -182,8 +184,9 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 {
+	uint32_t i;
+	uint32_t cnt;
 	struct nffw_fwinfo *fwinfo;
-	uint32_t cnt, i;
 
 	cnt = nffw_res_fwinfos(&state->fwinf, &fwinfo);
 	if (cnt == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 87eed3d951..a00bd5870d 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -72,10 +72,11 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 static int
 nfp_nsp_check(struct nfp_nsp *state)
 {
-	struct nfp_cpp *cpp = state->cpp;
-	uint64_t nsp_status, reg;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t nsp_status;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
@@ -113,9 +114,9 @@ nfp_nsp_check(struct nfp_nsp *state)
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
 {
-	struct nfp_resource *res;
-	struct nfp_nsp *state;
 	int err;
+	struct nfp_nsp *state;
+	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
 	if (res == NULL)
@@ -170,13 +171,12 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 		uint64_t mask,
 		uint64_t val)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	uint32_t count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -217,10 +217,15 @@ nfp_nsp_command(struct nfp_nsp *state,
 		uint32_t buff_cpp,
 		uint64_t buff_addr)
 {
-	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
-	struct nfp_cpp *cpp = state->cpp;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t ret_val;
+	uint64_t nsp_base;
+	uint64_t nsp_buffer;
+	uint64_t nsp_status;
+	uint64_t nsp_command;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_base = nfp_resource_address(state->res);
@@ -296,11 +301,13 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 		void *out_buf,
 		unsigned int out_size)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	int err;
+	int ret;
+	uint64_t reg;
 	size_t max_size;
-	uint64_t reg, cpp_buf;
-	int ret, err;
 	uint32_t cpp_id;
+	uint64_t cpp_buf;
+	struct nfp_cpp *cpp = nsp->cpp;
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
@@ -360,13 +367,12 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	int count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 31677b66e6..3081e22dad 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -26,9 +26,9 @@ struct nsp_identify {
 struct nfp_nsp_identify *
 __nfp_nsp_identify(struct nfp_nsp *nsp)
 {
-	struct nfp_nsp_identify *nspi = NULL;
-	struct nsp_identify *ni;
 	int ret;
+	struct nsp_identify *ni;
+	struct nfp_nsp_identify *nspi = NULL;
 
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 15)
 		return NULL;
@@ -77,9 +77,9 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
 		enum nfp_nsp_sensor_id id,
 		uint32_t *val)
 {
-	struct nfp_sensors s;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	struct nfp_sensors s;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 899fcd7441..9e8a247e5c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -149,9 +149,10 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 		uint32_t index,
 		struct nfp_eth_table_port *dst)
 {
-	uint32_t rate;
 	uint32_t fec;
-	uint64_t port, state;
+	uint64_t port;
+	uint32_t rate;
+	uint64_t state;
 
 	port = rte_le_to_cpu_64(src->port);
 	state = rte_le_to_cpu_64(src->state);
@@ -199,7 +200,8 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 static void
 nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 {
-	uint32_t i, j;
+	uint32_t i;
+	uint32_t j;
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
@@ -241,12 +243,13 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 static struct nfp_eth_table *
 __nfp_eth_read_ports(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries;
-	struct nfp_eth_table *table;
-	uint32_t table_sz;
+	int ret;
 	uint32_t i;
 	uint32_t j;
-	int ret, cnt = 0;
+	int cnt = 0;
+	uint32_t table_sz;
+	struct nfp_eth_table *table;
+	union eth_table_entry *entries;
 	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
@@ -320,8 +323,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
 {
-	struct nfp_eth_table *ret;
 	struct nfp_nsp *nsp;
+	struct nfp_eth_table *ret;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
@@ -337,9 +340,9 @@ struct nfp_nsp *
 nfp_eth_config_start(struct nfp_cpp *cpp,
 		uint32_t idx)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -400,8 +403,8 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	int ret = 1;
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	if (nfp_nsp_config_modified(nsp)) {
 		ret = nfp_nsp_write_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
@@ -432,9 +435,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int enable)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -474,9 +477,9 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int configed)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -515,9 +518,9 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 		uint32_t val,
 		const uint64_t ctrl_bit)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
-	uint32_t idx = nfp_nsp_config_idx(nsp);
 	uint64_t reg;
+	uint32_t idx = nfp_nsp_config_idx(nsp);
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
@@ -603,8 +606,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 		uint32_t idx,
 		enum nfp_eth_fec mode)
 {
-	struct nfp_nsp *nsp;
 	int err;
+	struct nfp_nsp *nsp;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 9dd4832779..fa92f2762e 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -67,10 +67,12 @@ static int
 nfp_cpp_resource_find(struct nfp_cpp *cpp,
 		struct nfp_resource *res)
 {
-	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
+	int ret;
+	uint32_t i;
+	uint32_t key;
+	uint32_t cpp_id;
 	struct nfp_resource_entry entry;
-	uint32_t cpp_id, key;
-	int ret, i;
+	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 
 	cpp_id = NFP_CPP_ID(NFP_RESOURCE_TBL_TARGET, 3, 0);  /* Atomic read */
 
@@ -152,11 +154,11 @@ struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name)
 {
-	struct nfp_cpp_mutex *dev_mutex;
-	struct nfp_resource *res;
 	int err;
+	uint16_t count = 0;
 	struct timespec wait;
-	uint16_t count;
+	struct nfp_resource *res;
+	struct nfp_cpp_mutex *dev_mutex;
 
 	res = malloc(sizeof(*res));
 	if (res == NULL)
@@ -175,7 +177,6 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 1000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 243d3c9ce5..a34278beca 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -85,8 +85,8 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 struct nfp_rtsym_table *
 nfp_rtsym_table_read(struct nfp_cpp *cpp)
 {
-	struct nfp_rtsym_table *rtbl;
 	struct nfp_mip *mip;
+	struct nfp_rtsym_table *rtbl;
 
 	mip = nfp_mip_open(cpp);
 	rtbl = __nfp_rtsym_table_read(cpp, mip);
@@ -99,13 +99,18 @@ struct nfp_rtsym_table *
 __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 		const struct nfp_mip *mip)
 {
-	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
-	struct nfp_rtsym_entry *rtsymtab;
+	int n;
+	int err;
+	uint32_t size;
+	uint32_t strtab_addr;
+	uint32_t symtab_addr;
+	uint32_t strtab_size;
+	uint32_t symtab_size;
 	struct nfp_rtsym_table *cache;
+	struct nfp_rtsym_entry *rtsymtab;
 	const uint32_t dram =
 		NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) |
 		NFP_ISL_EMEM0;
-	int err, n, size;
 
 	if (mip == NULL)
 		return NULL;
@@ -341,10 +346,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		const char *name,
 		int *error)
 {
-	const struct nfp_rtsym *sym;
-	uint32_t val32;
-	uint64_t val;
 	int err;
+	uint64_t val;
+	uint32_t val32;
+	const struct nfp_rtsym *sym;
 
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-- 
2.39.1


^ permalink raw reply	[relevance 3%]

* [PATCH v2 02/27] net/nfp: unify the indent coding style
  @ 2023-08-30  2:14  2%   ` Chaoyong He
  2023-08-30  2:14  3%   ` [PATCH v2 05/27] net/nfp: standard the local variable " Chaoyong He
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-30  2:14 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Each parameter of function should occupy one line, and indent two TAB
character.
All the statement which span multi line should indent two TAB character.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
 drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
 drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |   9 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  69 ++++----
 drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
 16 files changed, 447 insertions(+), 322 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 8f87c09327..54bef3cb6b 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -56,7 +56,8 @@ struct nfp_cpp_operations {
 	size_t area_priv_size;
 
 	/* Instance an NFP CPP */
-	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
+	int (*init)(struct nfp_cpp *cpp,
+			struct rte_pci_device *dev);
 
 	/*
 	 * Free the bus.
@@ -69,9 +70,9 @@ struct nfp_cpp_operations {
 	 * NOTE: This is _not_ serialized
 	 */
 	int (*area_init)(struct nfp_cpp_area *area,
-			 uint32_t dest,
-			 unsigned long long address,
-			 unsigned long size);
+			uint32_t dest,
+			unsigned long long address,
+			unsigned long size);
 	/*
 	 * Clean up a NFP CPP area before it is freed
 	 * NOTE: This is _not_ serialized
@@ -101,17 +102,17 @@ struct nfp_cpp_operations {
 	 * Serialized
 	 */
 	int (*area_read)(struct nfp_cpp_area *area,
-			 void *kernel_vaddr,
-			 unsigned long offset,
-			 unsigned int length);
+			void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 	/*
 	 * Perform a write to a NFP CPP area
 	 * Serialized
 	 */
 	int (*area_write)(struct nfp_cpp_area *area,
-			  const void *kernel_vaddr,
-			  unsigned long offset,
-			  unsigned int length);
+			const void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 };
 
 /*
@@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
  * @param   len     Length of the serial byte array
  */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		       size_t serial_len);
+		size_t serial_len);
 
 /*
  * Set the private data of the nfp_cpp instance
@@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
-					 int driver_lock_needed);
+		int driver_lock_needed);
 
 /*
  * Free a NFP CPP handle
@@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
-					unsigned long long address,
-					unsigned long size);
+		unsigned long long address, unsigned long size);
 
 /*
  * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
@@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
-						  uint32_t cpp_id,
-						  const char *name,
-						  unsigned long long address,
-						  unsigned long size);
+		uint32_t cpp_id, const char *name, unsigned long long address,
+		unsigned long size);
 
 /*
  * Free an allocated NFP CPP area handle
@@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
-						uint32_t cpp_id,
-						unsigned long long address,
-						unsigned long size);
+		uint32_t cpp_id, unsigned long long address, unsigned long size);
 
 /*
  * Release the resources, then free the NFP CPP area handle
@@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
-			   uint64_t addr, unsigned long size,
-			   struct nfp_cpp_area **area);
+		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
 /*
  * Return an IO pointer to the beginning of the NFP CPP area handle. The area
  * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
@@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
  *
  */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		      void *buffer, size_t length);
+		void *buffer, size_t length);
 
 /*
  * Write to a NFP CPP area handle from a buffer. The area must be acquired with
@@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		       const void *buffer, size_t length);
+		const void *buffer, size_t length);
 
 /*
  * nfp_cpp_area_iomem() - get IOMEM region for CPP area
@@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
-			     unsigned long long offset, unsigned long size);
+		unsigned long long offset, unsigned long size);
 
 /*
  * Get the NFP CPP handle that is the parent of a NFP CPP area handle
@@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
  * @return bytes read on success, -1 on failure.
  */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
-		 unsigned long long address, void *kernel_vaddr, size_t length);
+		unsigned long long address, void *kernel_vaddr, size_t length);
 
 /*
  * Write a block of data to a NFP CPP ID
@@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, -1 on failure.
  */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, const void *kernel_vaddr,
-		  size_t length);
+		unsigned long long address, const void *kernel_vaddr,
+		size_t length);
 
 
 
@@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		      uint32_t value, size_t length);
+		uint32_t value, size_t length);
 
 /*
  * Read a single 32-bit value from a NFP CPP area handle
@@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		       uint32_t *value);
+		uint32_t *value);
 
 /*
  * Write a single 32-bit value to a NFP CPP area handle
@@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-			uint32_t value);
+		uint32_t value);
 
 /*
  * Read a single 64-bit value from a NFP CPP area handle
@@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		       uint64_t *value);
+		uint64_t *value);
 
 /*
  * Write a single 64-bit value to a NFP CPP area handle
@@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-			uint64_t value);
+		uint64_t value);
 
 /*
  * Write a single 32-bit value on the XPB bus
@@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
  * @return 0 on success, or -1 on failure.
  */
 int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		    uint32_t value);
+		uint32_t value);
 
 /*
  * Modify bits of a 32-bit value from the XPB bus
@@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, negative value on failure.
  */
 int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		   uint32_t value, int timeout_us);
+		uint32_t value, int timeout_us);
 
 /*
  * Read a 32-bit word from a NFP CPP ID
@@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint32_t *value);
+		unsigned long long address, uint32_t *value);
 
 /*
  * Write a 32-bit value to a NFP CPP ID
@@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
  *
  */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint32_t value);
+		unsigned long long address, uint32_t value);
 
 /*
  * Read a 64-bit work from a NFP CPP ID
@@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint64_t *value);
+		unsigned long long address, uint64_t *value);
 
 /*
  * Write a 64-bit value to a NFP CPP ID
@@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint64_t value);
+		unsigned long long address, uint64_t value);
 
 /*
  * Initialize a mutex location
@@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
-		       unsigned long long address, uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Create a mutex handle from an address controlled by a MU Atomic engine
@@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
  *                      failure.
  */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-					  unsigned long long address,
-					  uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Get the NFP CPP handle the mutex was created with
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 2ee60eefc3..884cc84eaa 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
 #define TARGET_WIDTH_64    8
 
 static int
-nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
-		uint64_t *bar_base, int tgt, int act, int tok,
-		uint64_t offset, size_t size, int width)
+nfp_compute_bar(const struct nfp_bar *bar,
+		uint32_t *bar_config,
+		uint64_t *bar_base,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint32_t bitsize;
 	uint32_t newcfg;
@@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 
 	switch (width) {
 	case 8:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
 		break;
 	case 4:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
 		break;
 	case 0:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
 		break;
 	default:
 		return -EINVAL;
@@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 		/* Fixed CPP mapping with specific action */
 		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
 
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size), act,
-				    (unsigned long long)mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size), act,
+					(unsigned long long)mask);
 			return -EINVAL;
 		}
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-			    bar->index, tgt, act, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + mask));
+				bar->index, tgt, act, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + mask));
 
 		bitsize = 40 - 16;
 	} else {
 		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
 
 		/* Bulk mapping */
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
 
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size),
-				    tgt, tok, (unsigned long long)mask,
-				    (unsigned long long)(offset & mask),
-				    (unsigned long long)(offset + size - 1) & mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size),
+					tgt, tok, (unsigned long long)mask,
+					(unsigned long long)(offset & mask),
+					(unsigned long long)(offset + size - 1) & mask);
 			return -EINVAL;
 		}
 
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-			    bar->index, tgt, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + ~mask));
+				bar->index, tgt, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + ~mask));
 
 		bitsize = 40 - 21;
 	}
 
 	if (bar->bitsize < bitsize) {
 		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-			    tgt, tok, act);
+				tgt, tok, act);
 		return -EINVAL;
 	}
 
@@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 }
 
 static int
-nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
-		  uint32_t newcfg)
+nfp_bar_write(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		uint32_t newcfg)
 {
 	int base, slot;
 
@@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 		return (-ENOMEM);
 
 	bar->csr = nfp->cfg +
-		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
+			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
 
 	*(uint32_t *)(bar->csr) = newcfg;
 
@@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 }
 
 static int
-nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
-		int act, int tok, uint64_t offset, size_t size, int width)
+nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint64_t newbase;
 	uint32_t newcfg;
 	int err;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
-			      size, width);
+			size, width);
 	if (err != 0)
 		return err;
 
@@ -390,8 +398,10 @@ struct nfp6000_area_priv {
 };
 
 static int
-nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
-		  unsigned long long address, unsigned long size)
+nfp6000_area_init(struct nfp_cpp_area *area,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
@@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	int pp, ret = 0;
 
-	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
-				     address);
+	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
 		return pp;
 
@@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->width.write = PULL_WIDTH(pp);
 
 	if (priv->width.read > 0 &&
-	    priv->width.write > 0 && priv->width.read != priv->width.write)
+			priv->width.write > 0 &&
+			priv->width.read != priv->width.write)
 		return -EINVAL;
 
 	if (priv->width.read > 0)
@@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->size = size;
 
 	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
-				  priv->token, priv->offset, priv->size,
-				  priv->width.bar);
+			priv->token, priv->offset, priv->size,
+			priv->width.bar);
 
 	return ret;
 }
@@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
 
 	/* Calculate offset into BAR. */
 	if (nfp_bar_maptype(priv->bar) ==
-	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
+			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
 		priv->bar_offset = priv->offset &
-			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
-		priv->bar_offset +=
-			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
-							   priv->target);
-		priv->bar_offset +=
-		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
+				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
+				priv->target);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
+				priv->token);
 	} else {
 		priv->bar_offset = priv->offset & priv->bar->mask;
 	}
@@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
 }
 
 static int
-nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
-		  unsigned long offset, unsigned int length)
+nfp6000_area_read(struct nfp_cpp_area *area,
+		void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	uint64_t *wrptr64 = kernel_vaddr;
 	const volatile uint64_t *rdptr64;
@@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 
 	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW) {
+			priv->action == NFP_CPP_ACTION_RW) {
 		is_64 = false;
 	}
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 }
 
 static int
-nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
-		   unsigned long offset, unsigned int length)
+nfp6000_area_write(struct nfp_cpp_area *area,
+		const void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	const uint64_t *rdptr64 = kernel_vaddr;
 	uint64_t *wrptr64;
@@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
 
 	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW)
+			priv->action == NFP_CPP_ACTION_RW)
 		is_64 = false;
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_model(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint32_t model;
 
@@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_interface(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t interface;
 
@@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_serial(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t tmp;
 	uint8_t serial[6];
@@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
+nfp6000_set_barsz(struct rte_pci_device *dev,
+		struct nfp_pcie_user *desc)
 {
 	unsigned long tmp;
 	int i = 0;
@@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
+nfp6000_init(struct nfp_cpp *cpp,
+		struct rte_pci_device *dev)
 {
 	int ret = 0;
 	struct nfp_pcie_user *desc;
@@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
 	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
-	    cpp->driver_lock_needed) {
+			cpp->driver_lock_needed) {
 		ret = nfp_acquire_process_lock(desc);
 		if (ret != 0)
 			goto error;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 2c6ec3e126..25f7700b08 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -27,7 +27,8 @@
 						NFP_PL_DEVICE_ID_MASK)
 
 void
-nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
+nfp_cpp_priv_set(struct nfp_cpp *cpp,
+		void *priv)
 {
 	cpp->priv = priv;
 }
@@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
+nfp_cpp_model_set(struct nfp_cpp *cpp,
+		uint32_t model)
 {
 	cpp->model = model;
 }
@@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
+nfp_cpp_interface_set(struct nfp_cpp *cpp,
+		uint32_t interface)
 {
 	cpp->interface = interface;
 }
 
 int
-nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
+nfp_cpp_serial(struct nfp_cpp *cpp,
+		const uint8_t **serial)
 {
 	*serial = cpp->serial;
 	return cpp->serial_len;
 }
 
 int
-nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		   size_t serial_len)
+nfp_cpp_serial_set(struct nfp_cpp *cpp,
+		const uint8_t *serial,
+		size_t serial_len)
 {
 	if (cpp->serial_len)
 		free(cpp->serial);
@@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
  * NOTE: @address and @size must be 32-bit aligned values.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
-			      const char *name, unsigned long long address,
-			      unsigned long size)
+nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
+		uint32_t dest,
+		const char *name,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
@@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 		name = "";
 
 	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
-		      strlen(name) + 1);
+			strlen(name) + 1);
 	if (area == NULL)
 		return NULL;
 
@@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 }
 
 struct nfp_cpp_area *
-nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
-		    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc(struct nfp_cpp *cpp,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
@@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
  * NOTE: The area must also be 'released' when the structure is freed.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
-			    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 
@@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		  void *kernel_vaddr, size_t length)
+nfp_cpp_area_read(struct nfp_cpp_area *area,
+		unsigned long offset,
+		void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		   const void *kernel_vaddr, size_t length)
+nfp_cpp_area_write(struct nfp_cpp_area *area,
+		unsigned long offset,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
  * or negative value on error.
  */
 int
-nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
-			 unsigned long length)
+nfp_cpp_area_check_range(struct nfp_cpp_area *area,
+		unsigned long long offset,
+		unsigned long length)
 {
 	if (((offset + length) > area->size))
 		return -EFAULT;
@@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
  * based upon NFP model.
  */
 static uint32_t
-nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
+nfp_xpb_to_cpp(struct nfp_cpp *cpp,
+		uint32_t *xpb_addr)
 {
 	uint32_t xpb;
 	int island;
@@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 		else
 			/* And only non-ARM interfaces use island id = 1 */
 			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
-			    NFP_CPP_INTERFACE_TYPE_ARM)
+					NFP_CPP_INTERFACE_TYPE_ARM)
 				*xpb_addr |= (1 << 24);
 	} else {
 		(*xpb_addr) |= (1 << 30);
@@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 }
 
 int
-nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		   uint32_t *value)
+nfp_cpp_area_readl(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp = 0;
@@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-		    uint32_t value)
+nfp_cpp_area_writel(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value)
 {
 	int sz;
 
@@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		   uint64_t *value)
+nfp_cpp_area_readq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp = 0;
@@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-		    uint64_t value)
+nfp_cpp_area_writeq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t value)
 {
 	int sz;
 
@@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint32_t *value)
+nfp_cpp_readl(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp;
@@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint32_t value)
+nfp_cpp_writel(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t value)
 {
 	int sz;
 
@@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint64_t *value)
+nfp_cpp_readq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp;
@@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint64_t value)
+nfp_cpp_writeq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t value)
 {
 	int sz;
 
@@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
+nfp_xpb_writel(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t value)
 {
 	uint32_t cpp_dest;
 
@@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
 }
 
 int
-nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
+nfp_xpb_readl(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t *value)
 {
 	uint32_t cpp_dest;
 
@@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
 }
 
 static struct nfp_cpp *
-nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_alloc(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	const struct nfp_cpp_operations *ops;
 	struct nfp_cpp *cpp;
@@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 			/* Hardcoded XPB IMB Base, island 0 */
 			xpbaddr = 0x000a0000 + (tgt * 4);
 			err = nfp_xpb_readl(cpp, xpbaddr,
-				(uint32_t *)&cpp->imb_cat_table[tgt]);
+					(uint32_t *)&cpp->imb_cat_table[tgt]);
 			if (err < 0) {
 				free(cpp);
 				return NULL;
@@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 }
 
 struct nfp_cpp *
-nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_from_device_name(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
@@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
  * @return 0 on success, or -1 on failure.
  */
 int
-nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
+nfp_xpb_writelm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
 		uint32_t value)
 {
 	int err;
@@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, or negative value on failure.
  */
 int
-nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-	       uint32_t value, int timeout_us)
+nfp_xpb_waitlm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
+		uint32_t value,
+		int timeout_us)
 {
 	uint32_t tmp;
 	int err;
@@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @length:     number of bytes to read
  */
 int
-nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
-	     unsigned long long address, void *kernel_vaddr, size_t length)
+nfp_cpp_read(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     number of bytes to write
  */
 int
-nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
-	      unsigned long long address, const void *kernel_vaddr,
-	      size_t length)
+nfp_cpp_write(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     length of area to fill
  */
 int
-nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		  uint32_t value, size_t length)
+nfp_cpp_area_fill(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value,
+		size_t length)
 {
 	int err;
 	size_t i;
@@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value64,
-				       sizeof(value64));
+		err = nfp_cpp_area_write(area, offset + i, &value64,
+				sizeof(value64));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value64))
@@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	if ((i + sizeof(value)) <= length) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
+		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value))
@@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * as those are model-specific
  */
 uint32_t
-__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
+__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
+		uint32_t *model)
 {
 	uint32_t reg;
 	int err;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
-			    &reg);
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 unsigned long size, struct nfp_cpp_area **area)
+nfp_cpp_map_area(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		unsigned long size,
+		struct nfp_cpp_area **area)
 {
 	uint8_t *res;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index a9d166c4dc..ea4c7d6a9e 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
 }
 
 static int
-nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
+nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
+		uint32_t size)
 {
 	const char *key, *val, *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 		if (val >= end) {
 			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
@@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
 }
 
 static int
-nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
+nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
+		uint32_t len)
 {
 	uint32_t size, new_crc, *crc;
 
@@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
 		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
-			    new_crc, *crc);
+				new_crc, *crc);
 		return -EINVAL;
 	}
 
@@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
+nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
+		size_t *cpp_size)
 {
 	struct nfp_hwinfo *header;
 	void *res;
@@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
 		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
-			header->version);
+				header->version);
 		goto exit_free;
 	}
 
@@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
+nfp_hwinfo_fetch(struct nfp_cpp *cpp,
+		size_t *hwdb_size)
 {
 	struct timespec wait;
 	struct nfp_hwinfo *db;
@@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
  * Return: Value of the HWInfo name, or NULL
  */
 const char *
-nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
+nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
+		const char *lookup)
 {
 	const char *key, *val, *end;
 
@@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
 	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 
 		if (strcmp(key, lookup) == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index f9723dd136..0071d3fc37 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -37,8 +37,10 @@ struct nfp_mip {
 
 /* Read memory and check if it could be a valid MIP */
 static int
-nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 struct nfp_mip *mip)
+nfp_mip_try_read(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		struct nfp_mip *mip)
 {
 	int ret;
 
@@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
 		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
-			    rte_le_to_cpu_32(mip->signature));
+				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
 		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
-			    rte_le_to_cpu_32(mip->mip_version));
+				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
 
@@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 
 /* Try to locate MIP using the resource table */
 static int
-nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
+nfp_mip_read_resource(struct nfp_cpp *cpp,
+		struct nfp_mip *mip)
 {
 	struct nfp_nffw_info *nffw_info;
 	uint32_t cpp_id;
@@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
  * @size:	Location for size of MIP symbol table
  */
 void
-nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_symtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->symtab_addr);
 	*size = rte_le_to_cpu_32(mip->symtab_size);
@@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
  * @size:	Location for size of MIP symbol name table
  */
 void
-nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_strtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->strtab_addr);
 	*size = rte_le_to_cpu_32(mip->strtab_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
index d0919b58fe..980abc2517 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.h
+++ b/drivers/net/nfp/nfpcore/nfp_mip.h
@@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
 void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			    uint64_t *off);
+		uint64_t *off);
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 0410a00856..047e755416 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
 };
 
 static int
-_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
+_nfp_cpp_mutex_validate(uint32_t model,
+		int *target,
+		unsigned long long address)
 {
 	/* Address must be 64-bit aligned */
 	if ((address & 7) != 0)
@@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
  * @return 0 on success, or negative value on failure.
  */
 int
-nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
-		   uint32_t key)
+nfp_cpp_mutex_init(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
@@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
 	if (err < 0)
 		return err;
 
-	err =
-	    nfp_cpp_writel(cpp, muw, address + 0,
-			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
+	err = nfp_cpp_writel(cpp, muw, address + 0,
+			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
 	if (err < 0)
 		return err;
 
@@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
  * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
-nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-		     unsigned long long address, uint32_t key)
+nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	struct nfp_cpp_mutex *mutex;
@@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 			return err;
 		if (time(NULL) >= warn_at) {
 			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
-				    mutex->usage, mutex->depth, mutex->target,
-				    mutex->address, mutex->key);
+					mutex->usage, mutex->depth, mutex->target,
+					mutex->address, mutex->key);
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 433780a5e7..8bdc69766e 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -138,8 +138,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 		goto err_release;
 
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
-			   nfp_resource_address(state->res),
-			   fwinf, sizeof(*fwinf));
+			nfp_resource_address(state->res),
+			fwinf, sizeof(*fwinf));
 	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
@@ -205,8 +205,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
  * Return: 0, or -ERRNO
  */
 int
-nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			uint64_t *off)
+nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
+		uint32_t *cpp_id,
+		uint64_t *off)
 {
 	struct nffw_fwinfo *fwinfo;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 6474abf0c2..4f476f6f2b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
+nfp_nsp_config_set_modified(struct nfp_nsp *state,
+		int modified)
 {
 	state->modified = modified;
 }
@@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
+nfp_nsp_config_set_state(struct nfp_nsp *state,
+		void *entries,
+		unsigned int idx)
 {
 	state->entries = entries;
 	state->idx = idx;
@@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 
 	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
-						    state->ver.minor);
+				state->ver.minor);
 		return -EINVAL;
 	}
 
@@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
 }
 
 static int
-nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
-		 uint64_t addr, uint64_t mask, uint64_t val)
+nfp_nsp_wait_reg(struct nfp_cpp *cpp,
+		uint64_t *reg,
+		uint32_t nsp_cpp,
+		uint64_t addr,
+		uint64_t mask,
+		uint64_t val)
 {
 	struct timespec wait;
 	int count;
@@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
  *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
-		uint32_t buff_cpp, uint64_t buff_addr)
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code,
+		uint32_t option,
+		uint32_t buff_cpp,
+		uint64_t buff_addr)
 {
 	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
 	struct nfp_cpp *cpp = state->cpp;
@@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 		return err;
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
 		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-			buff_cpp, buff_addr);
+				buff_cpp, buff_addr);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			     FIELD_PREP(NSP_COMMAND_CODE, code) |
-			     FIELD_PREP(NSP_COMMAND_START, 1));
+			FIELD_PREP(NSP_COMMAND_OPTION, option) |
+			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
 
 	/* Wait for NSP_COMMAND_START to go to 0 */
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
-			       NSP_COMMAND_START, 0);
+			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
 	/* Wait for NSP_STATUS_BUSY to go to 0 */
-	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
-			       0);
+	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
+			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
@@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-			 -err, (int)ret_val, code);
+				-err, (int)ret_val, code);
 		nfp_nsp_print_extended_error(ret_val);
 		return -err;
 	}
@@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 #define SZ_1M 0x00100000
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
-		    const void *in_buf, unsigned int in_size, void *out_buf,
-		    unsigned int out_size)
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		uint16_t code, uint32_t option,
+		const void *in_buf,
+		unsigned int in_size,
+		void *out_buf,
+		unsigned int out_size)
 {
 	struct nfp_cpp *cpp = nsp->cpp;
 	unsigned int max_size;
@@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-			    code, nsp->ver.major, nsp->ver.minor);
+				code, nsp->ver.major, nsp->ver.minor);
 		return -EOPNOTSUPP;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER_CONFIG,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
 	if (err < 0)
 		return err;
 
 	max_size = RTE_MAX(in_size, out_size);
 	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
 		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
-			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
+				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
 		memset(out_buf, 0, out_size - in_size);
 		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				    out_size - in_size);
+				out_size - in_size);
 		if (err < 0)
 			return err;
 	}
@@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
 }
 
 int
-nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_load_fw(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_eth_table(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			unsigned int size)
+nfp_nsp_write_eth_table(struct nfp_nsp *state,
+		const void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_identify(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
-		     unsigned int size)
+nfp_nsp_read_sensors(struct nfp_nsp *state,
+		unsigned int sensor_mask,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-				   0, buf, size);
+			0, buf, size);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 9905b2d3d3..1e2deaabb4 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_mac_reinit(struct nfp_nsp *state);
 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
-			 void *buf, unsigned int size);
+		void *buf, unsigned int size);
 
-static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
+static inline int
+nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
@@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
 int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
 int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
-			   int configed);
-int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
+		int configed);
+int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			    unsigned int size);
+		unsigned int size);
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
-			      unsigned int idx);
+		unsigned int idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
 void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
 int nfp_nsp_config_modified(struct nfp_nsp *state);
 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
+static inline int
+nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return !!eth_port->fec_modes_supported;
 }
@@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
 };
 
 int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
-			  long *val);
+		long *val);
 
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 21b338461e..28dba27124 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -73,7 +73,9 @@ struct nfp_sensors {
 };
 
 int
-nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
+nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
+		enum nfp_nsp_sensor_id id,
+		long *val)
 {
 	struct nfp_sensors s;
 	struct nfp_nsp *nsp;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 825a84a8cd..3eeefc74af 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -168,8 +168,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
 }
 
 static void
-nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
-		       unsigned int index, struct nfp_eth_table_port *dst)
+nfp_eth_port_translate(struct nfp_nsp *nsp,
+		const union eth_table_entry *src,
+		unsigned int index,
+		struct nfp_eth_table_port *dst)
 {
 	unsigned int rate;
 	unsigned int fec;
@@ -225,21 +227,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
-					   table->ports[i].index);
+				table->ports[i].index);
 
 		for (j = 0; j < table->count; j++) {
 			if (table->ports[i].label_port !=
-			    table->ports[j].label_port)
+					table->ports[j].label_port)
 				continue;
 			table->ports[i].port_lanes += table->ports[j].lanes;
 
 			if (i == j)
 				continue;
 			if (table->ports[i].label_subport ==
-			    table->ports[j].label_subport)
+					table->ports[j].label_subport)
 				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
-					 table->ports[i].label_port,
-					 table->ports[i].label_subport);
+						table->ports[i].label_port,
+						table->ports[i].label_subport);
 
 			table->ports[i].is_split = 1;
 		}
@@ -296,7 +298,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 */
 	if (ret != 0 && ret != cnt) {
 		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
-		       ret, cnt);
+				ret, cnt);
 		goto err;
 	}
 
@@ -354,7 +356,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
 }
 
 struct nfp_nsp *
-nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
+nfp_eth_config_start(struct nfp_cpp *cpp,
+		unsigned int idx)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -447,7 +450,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
+nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int enable)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -487,7 +492,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
+nfp_eth_set_configured(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int configed)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -523,9 +530,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
 }
 
 static int
-nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
-		       const uint64_t mask, const unsigned int shift,
-		       unsigned int val, const uint64_t ctrl_bit)
+nfp_eth_set_bit_config(struct nfp_nsp *nsp,
+		unsigned int raw_idx,
+		const uint64_t mask,
+		const unsigned int shift,
+		unsigned int val,
+		const uint64_t ctrl_bit)
 {
 	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	unsigned int idx = nfp_nsp_config_idx(nsp);
@@ -560,7 +570,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
 	(__extension__ ({ \
 		typeof(mask) _x = (mask); \
 		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
-				       val, ctrl_bit);			\
+				val, ctrl_bit);			\
 	}))
 
 /*
@@ -574,11 +584,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
+__nfp_eth_set_aneg(struct nfp_nsp *nsp,
+		enum nfp_eth_aneg mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_ANEG, mode,
-				      NSP_ETH_CTRL_SET_ANEG);
+			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
 /*
@@ -592,11 +602,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
  * Return: 0 or -ERRNO.
  */
 static int
-__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
+__nfp_eth_set_fec(struct nfp_nsp *nsp,
+		enum nfp_eth_fec mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_FEC, mode,
-				      NSP_ETH_CTRL_SET_FEC);
+			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
 /*
@@ -611,7 +621,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
+nfp_eth_set_fec(struct nfp_cpp *cpp,
+		unsigned int idx,
+		enum nfp_eth_fec mode)
 {
 	struct nfp_nsp *nsp;
 	int err;
@@ -642,7 +654,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
+__nfp_eth_set_speed(struct nfp_nsp *nsp,
+		unsigned int speed)
 {
 	enum nfp_eth_rate rate;
 
@@ -653,8 +666,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
 	}
 
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_RATE, rate,
-				      NSP_ETH_CTRL_SET_RATE);
+			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
 /*
@@ -668,8 +680,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
+__nfp_eth_set_split(struct nfp_nsp *nsp,
+		unsigned int lanes)
 {
-	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
-				      lanes, NSP_ETH_CTRL_SET_LANES);
+	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
+			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 838cd6e0ef..57089c770f 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -64,7 +64,8 @@ struct nfp_resource {
 };
 
 static int
-nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
+nfp_cpp_resource_find(struct nfp_cpp *cpp,
+		struct nfp_resource *res)
 {
 	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 	struct nfp_resource_entry entry;
@@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 
 	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
 		uint64_t addr = NFP_RESOURCE_TBL_BASE +
-			sizeof(struct nfp_resource_entry) * i;
+				sizeof(struct nfp_resource_entry) * i;
 
 		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
 		if (ret != sizeof(entry))
@@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 			continue;
 
 		/* Found key! */
-		res->mutex =
-			nfp_cpp_mutex_alloc(cpp,
-					    NFP_RESOURCE_TBL_TARGET, addr, key);
+		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
+				addr, key);
 		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
-					 entry.region.cpp_action,
-					 entry.region.cpp_token);
+				entry.region.cpp_action,
+				entry.region.cpp_token);
 		res->addr = ((uint64_t)entry.region.page_offset) << 8;
 		res->size = (uint64_t)entry.region.page_size << 8;
 		return 0;
@@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 }
 
 static int
-nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
-			 struct nfp_cpp_mutex *dev_mutex)
+nfp_resource_try_acquire(struct nfp_cpp *cpp,
+		struct nfp_resource *res,
+		struct nfp_cpp_mutex *dev_mutex)
 {
 	int err;
 
@@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
  * Return: NFP Resource handle, or NULL
  */
 struct nfp_resource *
-nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
+nfp_resource_acquire(struct nfp_cpp *cpp,
+		const char *name)
 {
 	struct nfp_cpp_mutex *dev_mutex;
 	struct nfp_resource *res;
@@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
 	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
 
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
-					NFP_RESOURCE_TBL_BASE,
-					NFP_RESOURCE_TBL_KEY);
+			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
 		free(res);
 		return NULL;
@@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
  *
  * Return: const char pointer to the name of the resource
  */
-const char
-*nfp_resource_name(const struct nfp_resource *res)
+const char *
+nfp_resource_name(const struct nfp_resource *res)
 {
 	return res->name;
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 06cc6f74f4..009b7359a4 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -18,7 +18,7 @@
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
-					  const char *name);
+		const char *name);
 
 /**
  * Release a NFP Resource, and free the handle
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 4c45aec5c1..aa3b7a483e 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -40,22 +40,25 @@ struct nfp_rtsym_table {
 };
 
 static int
-nfp_meid(uint8_t island_id, uint8_t menum)
+nfp_meid(uint8_t island_id,
+		uint8_t menum)
 {
 	return (island_id & 0x3F) == island_id && menum < 12 ?
 		(island_id << 4) | (menum + 4) : -1;
 }
 
 static void
-nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
-			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
+nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
+		uint32_t strtab_size,
+		struct nfp_rtsym *sw,
+		struct nfp_rtsym_entry *fw)
 {
 	sw->type = fw->type;
 	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
 	sw->addr = ((uint64_t)fw->addr_hi << 32) |
-		   rte_le_to_cpu_32(fw->addr_lo);
+			rte_le_to_cpu_32(fw->addr_lo);
 	sw->size = ((uint64_t)fw->size_hi << 32) |
-		   rte_le_to_cpu_32(fw->size_lo);
+			rte_le_to_cpu_32(fw->size_lo);
 
 	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
 		     sw->name, sw->addr, sw->size, sw->target);
@@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
 }
 
 struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
+__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip)
 {
 	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
 	struct nfp_rtsym_entry *rtsymtab;
@@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
 
 	for (n = 0; n < cache->num; n++)
 		nfp_rtsym_sw_entry_init(cache, strtab_size,
-					&cache->symtab[n], &rtsymtab[n]);
+				&cache->symtab[n], &rtsymtab[n]);
 
 	free(rtsymtab);
 
@@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
+nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
+		int idx)
 {
 	if (rtbl == NULL)
 		return NULL;
@@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
+nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name)
 {
 	int n;
 
@@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
  * Return: value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
-nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
+nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		int *error)
 {
 	const struct nfp_rtsym *sym;
 	uint32_t val32;
@@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
-			name, sym->size);
+				name, sym->size);
 		err = -EINVAL;
 		break;
 	}
@@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 }
 
 uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area)
+nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		unsigned int min_size,
+		struct nfp_cpp_area **area)
 {
 	int ret;
 	uint8_t *mem;
@@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
-			sym->size, min_size);
+				sym->size, min_size);
 		return NULL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index 8b494211bc..30768f1ccf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -43,19 +43,18 @@ struct nfp_rtsym_table;
 
 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
 
-struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
+struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip);
 
 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
 
 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
 
-const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
+const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name);
 
 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
-			   int *error);
-uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area);
+		int *error);
+uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
+		unsigned int min_size, struct nfp_cpp_area **area);
 #endif
-- 
2.39.1


^ permalink raw reply	[relevance 2%]

* Re: [PATCH v6 0/6] rte atomics API for optional stdatomic
  2023-08-22 21:00  3% ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
  2023-08-22 21:00  2%   ` [PATCH v6 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
@ 2023-08-29 15:57  0%   ` Tyler Retzlaff
  2023-09-29 14:09  0%   ` David Marchand
  2 siblings, 0 replies; 200+ results
From: Tyler Retzlaff @ 2023-08-29 15:57 UTC (permalink / raw)
  To: dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, Konstantin Ananyev, David Hunt,
	Thomas Monjalon, David Marchand


ping for additional reviewers.

thanks!

On Tue, Aug 22, 2023 at 02:00:39PM -0700, Tyler Retzlaff wrote:
> This series introduces API additions prefixed in the rte namespace that allow
> the optional use of stdatomics.h from C11 using enable_stdatomics=true for
> targets where enable_stdatomics=false no functional change is intended.
> 
> Be aware this does not contain all changes to use stdatomics across the DPDK
> tree it only introduces the minimum to allow the option to be used which is
> a pre-requisite for a clean CI (probably using clang) that can be run
> with enable_stdatomics=true enabled.
> 
> It is planned that subsequent series will be introduced per lib/driver as
> appropriate to further enable stdatomics use when enable_stdatomics=true.
> 
> Notes:
> 
> * Additional libraries beyond EAL make visible atomics use across the
>   API/ABI surface they will be converted in the subsequent series.
> 
> * The eal: add rte atomic qualifier with casts patch needs some discussion
>   as to whether or not the legacy rte_atomic APIs should be converted to
>   work with enable_stdatomic=true right now some implementation dependent
>   casts are used to prevent cascading / having to convert too much in
>   the intial series.
> 
> * Windows will obviously need complete conversion of libraries including
>   atomics that are not crossing API/ABI boundaries. those conversions will
>   introduced in separate series as new along side the existing msvc series.
> 
> Please keep in mind we would like to prioritize the review / acceptance of
> this patch since it needs to be completed in the 23.11 merge window.
> 
> Thank you all for the discussion that lead to the formation of this series.
> 
> v6:
>   * Adjust checkpatches to warn about use of __rte_atomic_thread_fence
>     and suggest use of rte_atomic_thread_fence. Use the existing check
>     more generic check for __atomic_xxx to catch use of __atomic_thread_fence
>     and recommend rte_atomic_xxx.
> 
> v5:
>   * Add RTE_ATOMIC to doxygen configuration PREDEFINED macros list to
>     fix documentation generation failure
>   * Fix two typos in expansion of C11 atomics macros strong -> weak and
>     add missing _explicit
>   * Adjust devtools/checkpatches messages based on feedback. i have chosen
>     not to try and catch use of C11 atomics or _Atomic since using those
>     directly will be picked up by existing CI passes where by compilation
>     error where enable_stdatomic=false (the default for most platforms)
> 
> v4:
>   * Move the definition of #define RTE_ATOMIC(type) to patch 1 where it
>     belongs (a mistake in v3)
>   * Provide comments for both RTE_ATOMIC and __rte_atomic macros indicating
>     their use as specified or qualified contexts.
> 
> v3:
>   * Remove comments from APIs mentioning the mapping to C++ memory model
>     memory orders
>   * Introduce and use new macro RTE_ATOMIC(type) to be used in contexts
>     where _Atomic is used as a type specifier to declare variables. The
>     macro allows more clarity about what the atomic type being specified
>     is. e.g. _Atomic(T *) vs _Atomic(T) it is easier to understand that
>     the former is an atomic pointer type and the latter is an atomic
>     type. it also has the benefit of (in the future) being interoperable
>     with c++23 syntactically
>     note: Morten i have retained your 'reviewed-by' tags if you disagree
>     given the changes in the above version please indicate as such but
>     i believe the changes are in the spirit of the feedback you provided
> 
> v2:
>   * Wrap meson_options.txt option description to newline and indent to
>     be consistent with other options.
>   * Provide separate typedef of rte_memory_order for enable_stdatomic=true
>     VS enable_stdatomic=false instead of a single typedef to int
>     note: slight tweak to reviewers feedback i've chosen to use a typedef
>           for both enable_stdatomic={true,false} (just seemed more consistent)
>   * Bring in assert.h and use static_assert macro instead of _Static_assert
>     keyword to better interoperate with c/c++
>   * Directly include rte_stdatomic.h where into other places it is consumed
>     instead of hacking it globally into rte_config.h
>   * Provide and use __rte_atomic_thread_fence to allow conditional expansion
>     within the body of existing rte_atomic_thread_fence inline function to
>     maintain per-arch optimizations when enable_stdatomic=false
> 
> Tyler Retzlaff (6):
>   eal: provide rte stdatomics optional atomics API
>   eal: adapt EAL to present rte optional atomics API
>   eal: add rte atomic qualifier with casts
>   distributor: adapt for EAL optional atomics API changes
>   bpf: adapt for EAL optional atomics API changes
>   devtools: forbid new direct use of GCC atomic builtins
> 
>  app/test/test_mcslock.c                  |   6 +-
>  config/meson.build                       |   1 +
>  devtools/checkpatches.sh                 |  12 +-
>  doc/api/doxy-api.conf.in                 |   1 +
>  lib/bpf/bpf_pkt.c                        |   6 +-
>  lib/distributor/distributor_private.h    |   2 +-
>  lib/distributor/rte_distributor_single.c |  44 +++----
>  lib/eal/arm/include/rte_atomic_32.h      |   4 +-
>  lib/eal/arm/include/rte_atomic_64.h      |  36 +++---
>  lib/eal/arm/include/rte_pause_64.h       |  26 ++--
>  lib/eal/arm/rte_power_intrinsics.c       |   8 +-
>  lib/eal/common/eal_common_trace.c        |  16 +--
>  lib/eal/include/generic/rte_atomic.h     |  67 +++++++----
>  lib/eal/include/generic/rte_pause.h      |  50 ++++----
>  lib/eal/include/generic/rte_rwlock.h     |  48 ++++----
>  lib/eal/include/generic/rte_spinlock.h   |  20 ++--
>  lib/eal/include/meson.build              |   1 +
>  lib/eal/include/rte_mcslock.h            |  51 ++++----
>  lib/eal/include/rte_pflock.h             |  25 ++--
>  lib/eal/include/rte_seqcount.h           |  19 +--
>  lib/eal/include/rte_stdatomic.h          | 198 +++++++++++++++++++++++++++++++
>  lib/eal/include/rte_ticketlock.h         |  43 +++----
>  lib/eal/include/rte_trace_point.h        |   5 +-
>  lib/eal/loongarch/include/rte_atomic.h   |   4 +-
>  lib/eal/ppc/include/rte_atomic.h         |  54 ++++-----
>  lib/eal/riscv/include/rte_atomic.h       |   4 +-
>  lib/eal/x86/include/rte_atomic.h         |   8 +-
>  lib/eal/x86/include/rte_spinlock.h       |   2 +-
>  lib/eal/x86/rte_power_intrinsics.c       |   7 +-
>  meson_options.txt                        |   2 +
>  30 files changed, 501 insertions(+), 269 deletions(-)
>  create mode 100644 lib/eal/include/rte_stdatomic.h
> 
> -- 
> 1.8.3.1

^ permalink raw reply	[relevance 0%]

* [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm
  @ 2023-08-26  7:46  5%   ` Jie Hai
  2023-08-30 11:46  0%     ` Thomas Monjalon
  2023-09-06 15:10  3%     ` Stephen Hemminger
  2023-09-04  6:10  3%   ` [PATCH v3 0/5] support setting and querying RSS algorithms Jie Hai
  2023-09-04  7:28  3%   ` [PATCH " Jie Hai
  2 siblings, 2 replies; 200+ results
From: Jie Hai @ 2023-08-26  7:46 UTC (permalink / raw)
  To: dev, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: liudongdong3, haijie1

Currently, rte_eth_rss_conf supports configuring and querying
rss hash functions, rss key and it's length, but not rss hash
algorithm.

The structure ``rte_eth_rss_conf`` is extended by adding a new
field "func". This represents the RSS algorithms to apply. The
following API is affected:
	- rte_eth_dev_configure
	- rte_eth_dev_rss_hash_update
	- rte_eth_dev_rss_hash_conf_get

If the value of "func" used for configuration is a gibberish
value, report the error and return. Do the same for
rte_eth_dev_rss_hash_update and rte_eth_dev_configure.

To check whether the drivers report the "func" field, it is set
to default value before querying.

Signed-off-by: Jie Hai <haijie1@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 doc/guides/rel_notes/release_23_11.rst |  2 ++
 lib/ethdev/rte_ethdev.c                | 17 +++++++++++++++++
 lib/ethdev/rte_ethdev.h                |  6 ++++++
 3 files changed, 25 insertions(+)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 4411bb32c195..3746436e8bc9 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -123,6 +123,8 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+   * ethdev: Added "func" field to ``rte_eth_rss_conf`` structure for RSS hash
+     algorithm.
 
 Known Issues
 ------------
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 0840d2b5942a..4cbcdb344cac 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -1445,6 +1445,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	if (dev_conf->rx_adv_conf.rss_conf.func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, dev_conf->rx_adv_conf.rss_conf.func);
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
 	if (((dev_conf->rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) == 0) &&
 	    (dev_conf->rxmode.offloads & RTE_ETH_RX_OFFLOAD_RSS_HASH)) {
@@ -4630,6 +4638,13 @@ rte_eth_dev_rss_hash_update(uint16_t port_id,
 		return -ENOTSUP;
 	}
 
+	if (rss_conf->func >= RTE_ETH_HASH_FUNCTION_MAX) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u invalid rss hash function (%u)\n",
+			port_id, rss_conf->func);
+		return -EINVAL;
+	}
+
 	if (*dev->dev_ops->rss_hash_update == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_update)(dev,
@@ -4657,6 +4672,8 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id,
 		return -EINVAL;
 	}
 
+	rss_conf->func = RTE_ETH_HASH_FUNCTION_DEFAULT;
+
 	if (*dev->dev_ops->rss_hash_conf_get == NULL)
 		return -ENOTSUP;
 	ret = eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev,
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 04a2564f222a..1bb5f23059ca 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -174,6 +174,7 @@ extern "C" {
 
 #include "rte_ethdev_trace_fp.h"
 #include "rte_dev_info.h"
+#include "rte_flow.h"
 
 extern int rte_eth_dev_logtype;
 
@@ -461,11 +462,16 @@ struct rte_vlan_filter_conf {
  * The *rss_hf* field of the *rss_conf* structure indicates the different
  * types of IPv4/IPv6 packets to which the RSS hashing must be applied.
  * Supplying an *rss_hf* equal to zero disables the RSS feature.
+ *
+ * The *func* field of the *rss_conf* structure indicates the hash algorithm
+ * applied by the RSS hashing. Passing RTE_ETH_HASH_FUNCTION_DEFAULT allows
+ * the PMD to use its best-effort algorithm rather than a specific one.
  */
 struct rte_eth_rss_conf {
 	uint8_t *rss_key;    /**< If not NULL, 40-byte hash key. */
 	uint8_t rss_key_len; /**< hash key length in bytes. */
 	uint64_t rss_hf;     /**< Hash functions to apply - see below. */
+	enum rte_eth_hash_function func;	/**< Hash algorithm to apply. */
 };
 
 /*
-- 
2.33.0


^ permalink raw reply	[relevance 5%]

* [PATCH 19/27] net/nfp: refact the nsp module
                     ` (2 preceding siblings ...)
  2023-08-24 11:09  1% ` [PATCH 07/27] net/nfp: standard the comment style Chaoyong He
@ 2023-08-24 11:09  5% ` Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-24 11:09 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Move the definition of data structure into the implement file.
Also sync the logic from kernel driver and remove the unneeded header
file include statements.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_ethdev.c           |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c      | 390 +++++++++++++++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h      | 140 ++++-----
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c |   4 -
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c  |  79 ++---
 5 files changed, 398 insertions(+), 217 deletions(-)

diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c
index 2e43055fd5..9243191de3 100644
--- a/drivers/net/nfp/nfp_ethdev.c
+++ b/drivers/net/nfp/nfp_ethdev.c
@@ -661,7 +661,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 static int
 nfp_fw_upload(struct rte_pci_device *dev, struct nfp_nsp *nsp, char *card)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	struct nfp_cpp *cpp = nfp_nsp_cpp(nsp);
 	void *fw_buf;
 	char fw_name[125];
 	char serial[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 8e65064b10..75d13cb84f 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -3,20 +3,127 @@
  * All rights reserved.
  */
 
-#define NFP_SUBSYS "nfp_nsp"
-
-#include <stdio.h>
-#include <time.h>
+#include "nfp_nsp.h"
 
 #include <rte_common.h>
 
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
-#include "nfp_nsp.h"
 #include "nfp_platform.h"
 #include "nfp_resource.h"
 
-int
+/* Offsets relative to the CSR base */
+#define NSP_STATUS              0x00
+#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
+#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
+#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
+#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
+#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
+#define   NSP_STATUS_BUSY       RTE_BIT64(0)
+
+#define NSP_COMMAND             0x08
+#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
+#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
+#define   NSP_COMMAND_DMA_BUF   RTE_BIT64(1)
+#define   NSP_COMMAND_START     RTE_BIT64(0)
+
+/* CPP address to retrieve the data from */
+#define NSP_BUFFER              0x10
+#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
+#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER         0x18
+#define   NSP_DFLT_BUFFER_CPP          GENMASK_ULL(63, 40)
+#define   NSP_DFLT_BUFFER_ADDRESS      GENMASK_ULL(39, 0)
+
+#define NSP_DFLT_BUFFER_CONFIG  0x20
+#define   NSP_DFLT_BUFFER_SIZE_4KB     GENMASK_ULL(15, 8)
+#define   NSP_DFLT_BUFFER_SIZE_MB      GENMASK_ULL(7, 0)
+
+#define NSP_MAGIC               0xab10
+#define NSP_MAJOR               0
+#define NSP_MINOR               8
+
+#define NSP_CODE_MAJOR          GENMASK_ULL(15, 12)
+#define NSP_CODE_MINOR          GENMASK_ULL(11, 0)
+
+#define NFP_FW_LOAD_RET_MAJOR   GENMASK_ULL(15, 8)
+#define NFP_FW_LOAD_RET_MINOR   GENMASK_ULL(23, 16)
+
+enum nfp_nsp_cmd {
+	SPCODE_NOOP             = 0, /* No operation */
+	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
+	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
+	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
+	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
+	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
+	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
+	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
+	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
+	SPCODE_NSP_WRITE_FLASH  = 11, /* Load and flash image from buffer */
+	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
+	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
+	SPCODE_FW_STORED        = 16, /* If no FW loaded, load flash app FW */
+	SPCODE_HWINFO_LOOKUP    = 17, /* Lookup HWinfo with overwrites etc. */
+	SPCODE_HWINFO_SET       = 18, /* Set HWinfo entry */
+	SPCODE_FW_LOADED        = 19, /* Is application firmware loaded */
+	SPCODE_VERSIONS         = 21, /* Report FW versions */
+	SPCODE_READ_SFF_EEPROM  = 22, /* Read module EEPROM */
+	SPCODE_READ_MEDIA       = 23, /* Get the supported/advertised media for a port */
+};
+
+static const struct {
+	uint32_t code;
+	const char *msg;
+} nsp_errors[] = {
+	{ 6010, "could not map to phy for port" },
+	{ 6011, "not an allowed rate/lanes for port" },
+	{ 6012, "not an allowed rate/lanes for port" },
+	{ 6013, "high/low error, change other port first" },
+	{ 6014, "config not found in flash" },
+};
+
+struct nfp_nsp {
+	struct nfp_cpp *cpp;
+	struct nfp_resource *res;
+	struct {
+		uint16_t major;
+		uint16_t minor;
+	} ver;
+
+	/** Eth table config state */
+	bool modified;
+	uint32_t idx;
+	void *entries;
+};
+
+/* NFP command argument structure */
+struct nfp_nsp_command_arg {
+	uint16_t code;         /**< NFP SP Command Code */
+	bool dma;              /**< @buf points to a host buffer, not NSP buffer */
+	bool error_quiet;      /**< Don't print command error/warning */
+	uint32_t timeout_sec;  /**< Timeout value to wait for completion in seconds */
+	uint32_t option;       /**< NSP Command Argument */
+	uint64_t buf;          /**< NSP Buffer Address */
+	/** Callback for interpreting option if error occurred */
+	void (*error_cb)(struct nfp_nsp *state, uint32_t ret_val);
+};
+
+/* NFP command with buffer argument structure */
+struct nfp_nsp_command_buf_arg {
+	struct nfp_nsp_command_arg arg;  /**< NFP command argument structure */
+	const void *in_buf;              /**< Buffer with data for input */
+	void *out_buf;                   /**< Buffer for output data */
+	uint32_t in_size;                /**< Size of @in_buf */
+	uint32_t out_size;               /**< Size of @out_buf */
+};
+
+struct nfp_cpp *
+nfp_nsp_cpp(struct nfp_nsp *state)
+{
+	return state->cpp;
+}
+
+bool
 nfp_nsp_config_modified(struct nfp_nsp *state)
 {
 	return state->modified;
@@ -24,7 +131,7 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 
 void
 nfp_nsp_config_set_modified(struct nfp_nsp *state,
-		int modified)
+		bool modified)
 {
 	state->modified = modified;
 }
@@ -66,7 +173,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 		return;
 
 	for (i = 0; i < RTE_DIM(nsp_errors); i++)
-		if (ret_val == (uint32_t)nsp_errors[i].code)
+		if (ret_val == nsp_errors[i].code)
 			PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg);
 }
 
@@ -222,11 +329,8 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
  *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state,
-		uint16_t code,
-		uint32_t option,
-		uint32_t buff_cpp,
-		uint64_t buff_addr)
+nfp_nsp_command_real(struct nfp_nsp *state,
+		const struct nfp_nsp_command_arg *arg)
 {
 	int err;
 	uint64_t reg;
@@ -250,22 +354,14 @@ nfp_nsp_command(struct nfp_nsp *state,
 		return err;
 	}
 
-	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
-		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-				buff_cpp, buff_addr);
-		return -EINVAL;
-	}
-
-	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer, arg->buf);
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_OPTION, arg->option) |
+			FIELD_PREP(NSP_COMMAND_CODE, arg->code) |
+			FIELD_PREP(NSP_COMMAND_DMA_BUF, arg->dma) |
 			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
@@ -275,7 +371,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to start",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -284,7 +380,7 @@ nfp_nsp_command(struct nfp_nsp *state,
 			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code %#04x to complete",
-				err, code);
+				err, arg->code);
 		return err;
 	}
 
@@ -296,84 +392,85 @@ nfp_nsp_command(struct nfp_nsp *state,
 
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
-		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-				-err, (int)ret_val, code);
-		nfp_nsp_print_extended_error(ret_val);
+		if (!arg->error_quiet)
+			PMD_DRV_LOG(WARNING, "Result (error) code set: %d (%d) command: %d",
+					-err, (int)ret_val, arg->code);
+
+		if (arg->error_cb != 0)
+			arg->error_cb(state, ret_val);
+		else
+			nfp_nsp_print_extended_error(ret_val);
+
 		return -err;
 	}
 
 	return ret_val;
 }
 
-#define SZ_1M 0x00100000
+static int
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code)
+{
+	const struct nfp_nsp_command_arg arg = {
+		.code = code,
+	};
+
+	return nfp_nsp_command_real(state, &arg);
+}
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp,
-		uint16_t code, uint32_t option,
-		const void *in_buf,
-		unsigned int in_size,
-		void *out_buf,
-		unsigned int out_size)
+nfp_nsp_command_buf_def(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
 {
 	int err;
 	int ret;
 	uint64_t reg;
-	size_t max_size;
 	uint32_t cpp_id;
 	uint64_t cpp_buf;
 	struct nfp_cpp *cpp = nsp->cpp;
 
-	if (nsp->ver.minor < 13) {
-		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-				code, nsp->ver.major, nsp->ver.minor);
-		return -EOPNOTSUPP;
-	}
-
-	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
-			&reg);
-	if (err < 0)
-		return err;
-
-	max_size = RTE_MAX(in_size, out_size);
-	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
-		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %lu)",
-				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
-		return -EINVAL;
-	}
-
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
 			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
 			&reg);
 	if (err < 0)
 		return err;
 
-	cpp_id = FIELD_GET(NSP_BUFFER_CPP, reg) << 8;
-	cpp_buf = FIELD_GET(NSP_BUFFER_ADDRESS, reg);
+	cpp_id = FIELD_GET(NSP_DFLT_BUFFER_CPP, reg) << 8;
+	cpp_buf = FIELD_GET(NSP_DFLT_BUFFER_ADDRESS, reg);
 
-	if (in_buf != NULL && in_size > 0) {
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf, in_buf, in_size);
+	if (arg->in_buf != NULL && arg->in_size > 0) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf,
+				arg->in_buf, arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
 	/* Zero out remaining part of the buffer */
-	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
-		memset(out_buf, 0, out_size - in_size);
-		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				out_size - in_size);
+	if (arg->out_buf != NULL && arg->out_size > arg->in_size) {
+		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + arg->in_size,
+				arg->out_buf, arg->out_size - arg->in_size);
 		if (err < 0)
 			return err;
 	}
 
-	ret = nfp_nsp_command(nsp, code, option, cpp_id, cpp_buf);
+	if (!FIELD_FIT(NSP_BUFFER_CPP, cpp_id >> 8) ||
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, cpp_buf)) {
+		PMD_DRV_LOG(ERR, "Buffer out of reach %#08x %#016lx",
+				cpp_id, cpp_buf);
+		return -EINVAL;
+	}
+
+	arg->arg.buf = FIELD_PREP(NSP_BUFFER_CPP, cpp_id >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, cpp_buf);
+	ret = nfp_nsp_command_real(nsp, &arg->arg);
 	if (ret < 0) {
 		PMD_DRV_LOG(ERR, "NSP command failed");
 		return ret;
 	}
 
-	if (out_buf != NULL && out_size > 0) {
-		err = nfp_cpp_read(cpp, cpp_id, cpp_buf, out_buf, out_size);
+	if (arg->out_buf != NULL && arg->out_size > 0) {
+		err = nfp_cpp_read(cpp, cpp_id, cpp_buf,
+				arg->out_buf, arg->out_size);
 		if (err < 0)
 			return err;
 	}
@@ -381,6 +478,43 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 	return ret;
 }
 
+#define SZ_1M 0x00100000
+#define SZ_4K 0x00001000
+
+static int
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		struct nfp_nsp_command_buf_arg *arg)
+{
+	int err;
+	uint64_t reg;
+	uint32_t size;
+	uint32_t max_size;
+	struct nfp_cpp *cpp = nsp->cpp;
+
+	if (nsp->ver.minor < 13) {
+		PMD_DRV_LOG(ERR, "NSP: Code %#04x with buffer not supported ABI %hu.%hu)",
+				arg->arg.code, nsp->ver.major, nsp->ver.minor);
+		return -EOPNOTSUPP;
+	}
+
+	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
+	if (err < 0)
+		return err;
+
+	max_size = RTE_MAX(arg->in_size, arg->out_size);
+	size = FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M +
+			FIELD_GET(NSP_DFLT_BUFFER_SIZE_4KB, reg) * SZ_4K;
+	if (size < max_size) {
+		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command %#04x (%u < %u)",
+				arg->arg.code, size, max_size);
+		return -EINVAL;
+	}
+
+	return nfp_nsp_command_buf_def(nsp, arg);
+}
+
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
@@ -392,7 +526,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
-		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
+		err = nfp_nsp_command(state, SPCODE_NOOP);
 		if (err != -EAGAIN)
 			break;
 
@@ -413,13 +547,57 @@ nfp_nsp_wait(struct nfp_nsp *state)
 int
 nfp_nsp_device_soft_reset(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_SOFT_RESET, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_SOFT_RESET);
 }
 
 int
 nfp_nsp_mac_reinit(struct nfp_nsp *state)
 {
-	return nfp_nsp_command(state, SPCODE_MAC_INIT, 0, 0, 0);
+	return nfp_nsp_command(state, SPCODE_MAC_INIT);
+}
+
+static void
+nfp_nsp_load_fw_extended_msg(struct nfp_nsp *state,
+		uint32_t ret_val)
+{
+	uint32_t minor;
+	uint32_t major;
+	static const char * const major_msg[] = {
+		/* 0 */ "Firmware from driver loaded",
+		/* 1 */ "Firmware from flash loaded",
+		/* 2 */ "Firmware loading failure",
+	};
+	static const char * const minor_msg[] = {
+		/*  0 */ "",
+		/*  1 */ "no named partition on flash",
+		/*  2 */ "error reading from flash",
+		/*  3 */ "can not deflate",
+		/*  4 */ "not a trusted file",
+		/*  5 */ "can not parse FW file",
+		/*  6 */ "MIP not found in FW file",
+		/*  7 */ "null firmware name in MIP",
+		/*  8 */ "FW version none",
+		/*  9 */ "FW build number none",
+		/* 10 */ "no FW selection policy HWInfo key found",
+		/* 11 */ "static FW selection policy",
+		/* 12 */ "FW version has precedence",
+		/* 13 */ "different FW application load requested",
+		/* 14 */ "development build",
+	};
+
+	major = FIELD_GET(NFP_FW_LOAD_RET_MAJOR, ret_val);
+	minor = FIELD_GET(NFP_FW_LOAD_RET_MINOR, ret_val);
+
+	if (!nfp_nsp_has_stored_fw_load(state))
+		return;
+
+	if (major >= RTE_DIM(major_msg))
+		PMD_DRV_LOG(INFO, "FW loading status: %x", ret_val);
+	else if (minor >= RTE_DIM(minor_msg))
+		PMD_DRV_LOG(INFO, "%s, reason code: %d", major_msg[major], minor);
+	else
+		PMD_DRV_LOG(INFO, "%s%c %s", major_msg[major],
+				minor != 0 ? ',' : '.', minor_msg[minor]);
 }
 
 int
@@ -427,8 +605,24 @@ nfp_nsp_load_fw(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-			NULL, 0);
+	int ret;
+	struct nfp_nsp_command_buf_arg load_fw = {
+		{
+			.code     = SPCODE_FW_LOAD,
+			.option   = size,
+			.error_cb = nfp_nsp_load_fw_extended_msg,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	ret = nfp_nsp_command_buf(state, &load_fw);
+	if (ret < 0)
+		return ret;
+
+	nfp_nsp_load_fw_extended_msg(state, ret);
+
+	return 0;
 }
 
 int
@@ -436,8 +630,16 @@ nfp_nsp_read_eth_table(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg eth_rescan = {
+		{
+			.code   = SPCODE_ETH_RESCAN,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_rescan);
 }
 
 int
@@ -445,8 +647,16 @@ nfp_nsp_write_eth_table(struct nfp_nsp *state,
 		const void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-			NULL, 0);
+	struct nfp_nsp_command_buf_arg eth_ctrl = {
+		{
+			.code   = SPCODE_ETH_CONTROL,
+			.option = size,
+		},
+		.in_buf  = buf,
+		.in_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &eth_ctrl);
 }
 
 int
@@ -454,8 +664,16 @@ nfp_nsp_read_identify(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-			buf, size);
+	struct nfp_nsp_command_buf_arg identify = {
+		{
+			.code   = SPCODE_NSP_IDENTIFY,
+			.option = size,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &identify);
 }
 
 int
@@ -464,6 +682,14 @@ nfp_nsp_read_sensors(struct nfp_nsp *state,
 		void *buf,
 		size_t size)
 {
-	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-			0, buf, size);
+	struct nfp_nsp_command_buf_arg sensors = {
+		{
+			.code   = SPCODE_NSP_SENSORS,
+			.option = sensor_mask,
+		},
+		.out_buf  = buf,
+		.out_size = size,
+	};
+
+	return nfp_nsp_command_buf(state, &sensors);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 14986a9130..fe52dffeb7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -7,78 +7,8 @@
 #define __NSP_NSP_H__
 
 #include "nfp_cpp.h"
-#include "nfp_nsp.h"
-
-/* Offsets relative to the CSR base */
-#define NSP_STATUS              0x00
-#define   NSP_STATUS_MAGIC      GENMASK_ULL(63, 48)
-#define   NSP_STATUS_MAJOR      GENMASK_ULL(47, 44)
-#define   NSP_STATUS_MINOR      GENMASK_ULL(43, 32)
-#define   NSP_STATUS_CODE       GENMASK_ULL(31, 16)
-#define   NSP_STATUS_RESULT     GENMASK_ULL(15, 8)
-#define   NSP_STATUS_BUSY       RTE_BIT64(0)
-
-#define NSP_COMMAND             0x08
-#define   NSP_COMMAND_OPTION    GENMASK_ULL(63, 32)
-#define   NSP_COMMAND_CODE      GENMASK_ULL(31, 16)
-#define   NSP_COMMAND_START     RTE_BIT64(0)
-
-/* CPP address to retrieve the data from */
-#define NSP_BUFFER              0x10
-#define   NSP_BUFFER_CPP        GENMASK_ULL(63, 40)
-#define   NSP_BUFFER_PCIE       GENMASK_ULL(39, 38)
-#define   NSP_BUFFER_ADDRESS    GENMASK_ULL(37, 0)
-
-#define NSP_DFLT_BUFFER         0x18
-
-#define NSP_DFLT_BUFFER_CONFIG 0x20
-#define   NSP_DFLT_BUFFER_SIZE_MB    GENMASK_ULL(7, 0)
-
-#define NSP_MAGIC               0xab10
-#define NSP_MAJOR               0
-#define NSP_MINOR               8
-
-#define NSP_CODE_MAJOR          GENMASK(15, 12)
-#define NSP_CODE_MINOR          GENMASK(11, 0)
-
-enum nfp_nsp_cmd {
-	SPCODE_NOOP             = 0, /* No operation */
-	SPCODE_SOFT_RESET       = 1, /* Soft reset the NFP */
-	SPCODE_FW_DEFAULT       = 2, /* Load default (UNDI) FW */
-	SPCODE_PHY_INIT         = 3, /* Initialize the PHY */
-	SPCODE_MAC_INIT         = 4, /* Initialize the MAC */
-	SPCODE_PHY_RXADAPT      = 5, /* Re-run PHY RX Adaptation */
-	SPCODE_FW_LOAD          = 6, /* Load fw from buffer, len in option */
-	SPCODE_ETH_RESCAN       = 7, /* Rescan ETHs, write ETH_TABLE to buf */
-	SPCODE_ETH_CONTROL      = 8, /* Update media config from buffer */
-	SPCODE_NSP_SENSORS      = 12, /* Read NSP sensor(s) */
-	SPCODE_NSP_IDENTIFY     = 13, /* Read NSP version */
-};
-
-static const struct {
-	int code;
-	const char *msg;
-} nsp_errors[] = {
-	{ 6010, "could not map to phy for port" },
-	{ 6011, "not an allowed rate/lanes for port" },
-	{ 6012, "not an allowed rate/lanes for port" },
-	{ 6013, "high/low error, change other port first" },
-	{ 6014, "config not found in flash" },
-};
 
-struct nfp_nsp {
-	struct nfp_cpp *cpp;
-	struct nfp_resource *res;
-	struct {
-		uint16_t major;
-		uint16_t minor;
-	} ver;
-
-	/* Eth table config state */
-	int modified;
-	unsigned int idx;
-	void *entries;
-};
+struct nfp_nsp;
 
 struct nfp_nsp *nfp_nsp_open(struct nfp_cpp *cpp);
 void nfp_nsp_close(struct nfp_nsp *state);
@@ -92,18 +22,61 @@ int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, size_t size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, uint32_t sensor_mask,
 		void *buf, size_t size);
 
-static inline int
+static inline bool
 nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
 
+static inline bool
+nfp_nsp_has_stored_fw_load(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 23;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_lookup(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 24;
+}
+
+static inline bool
+nfp_nsp_has_hwinfo_set(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_fw_loaded(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 25;
+}
+
+static inline bool
+nfp_nsp_has_versions(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 27;
+}
+
+static inline bool
+nfp_nsp_has_read_module_eeprom(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 28;
+}
+
+static inline bool
+nfp_nsp_has_read_media(struct nfp_nsp *state)
+{
+	return nfp_nsp_get_abi_ver_minor(state) > 33;
+}
+
 enum nfp_eth_interface {
 	NFP_INTERFACE_NONE      = 0,
 	NFP_INTERFACE_SFP       = 1,
 	NFP_INTERFACE_SFPP      = 10,
 	NFP_INTERFACE_SFP28     = 28,
 	NFP_INTERFACE_QSFP      = 40,
+	NFP_INTERFACE_RJ45      = 45,
 	NFP_INTERFACE_CXP       = 100,
 	NFP_INTERFACE_QSFP28    = 112,
 };
@@ -151,6 +124,7 @@ struct nfp_eth_table {
 		enum nfp_eth_media media; /**< Media type of the @interface */
 
 		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_fec act_fec; /**< Active Forward Error Correction mode */
 		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
 		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
@@ -159,17 +133,18 @@ struct nfp_eth_table {
 		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;     /**< Enable port */
-		int tx_enabled;  /**< Enable TX */
-		int rx_enabled;  /**< Enable RX */
+		bool enabled;     /**< Enable port */
+		bool tx_enabled;  /**< Enable TX */
+		bool rx_enabled;  /**< Enable RX */
+		bool supp_aneg;   /**< Support auto negotiation */
 
-		int override_changed;  /**< Media reconfig pending */
+		bool override_changed;  /**< Media reconfig pending */
 
 		uint8_t port_type;    /**< One of %PORT_* */
 		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;   /**< Split port */
+		bool is_split;   /**< Split port */
 
 		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
 	} ports[]; /**< Table of ports */
@@ -177,8 +152,8 @@ struct nfp_eth_table {
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
-int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, int enable);
-int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, int configed);
+int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, uint32_t idx, bool enable);
+int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, bool configured);
 int nfp_eth_set_fec(struct nfp_cpp *cpp, uint32_t idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, size_t size);
@@ -187,12 +162,13 @@ int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
 		uint32_t idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
-void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
+void nfp_nsp_config_set_modified(struct nfp_nsp *state, bool modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
-int nfp_nsp_config_modified(struct nfp_nsp *state);
+struct nfp_cpp *nfp_nsp_cpp(struct nfp_nsp *state);
+bool nfp_nsp_config_modified(struct nfp_nsp *state);
 uint32_t nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int
+static inline bool
 nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return eth_port->fec_modes_supported != 0;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 429f639fa2..86956f4330 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -3,12 +3,8 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
-#include "nfp_nffw.h"
 
 struct nsp_identify {
 	uint8_t version[40];
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 355d907f4d..996fd4b44a 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -3,10 +3,6 @@
  * All rights reserved.
  */
 
-#include <stdio.h>
-#include <rte_common.h>
-#include <rte_byteorder.h>
-#include "nfp_cpp.h"
 #include "nfp_logs.h"
 #include "nfp_nsp.h"
 #include "nfp_platform.h"
@@ -21,6 +17,7 @@
 #define NSP_ETH_PORT_PHYLABEL           GENMASK_ULL(59, 54)
 #define NSP_ETH_PORT_FEC_SUPP_BASER     RTE_BIT64(60)
 #define NSP_ETH_PORT_FEC_SUPP_RS        RTE_BIT64(61)
+#define NSP_ETH_PORT_SUPP_ANEG          RTE_BIT64(63)
 
 #define NSP_ETH_PORT_LANES_MASK         rte_cpu_to_le_64(NSP_ETH_PORT_LANES)
 
@@ -34,6 +31,7 @@
 #define NSP_ETH_STATE_OVRD_CHNG         RTE_BIT64(22)
 #define NSP_ETH_STATE_ANEG              GENMASK_ULL(25, 23)
 #define NSP_ETH_STATE_FEC               GENMASK_ULL(27, 26)
+#define NSP_ETH_STATE_ACT_FEC           GENMASK_ULL(29, 28)
 
 #define NSP_ETH_CTRL_CONFIGURED         RTE_BIT64(0)
 #define NSP_ETH_CTRL_ENABLED            RTE_BIT64(1)
@@ -54,26 +52,12 @@
 #define PORT_NONE               0xef
 #define PORT_OTHER              0xff
 
-#define SPEED_10                10
-#define SPEED_100               100
-#define SPEED_1000              1000
-#define SPEED_2500              2500
-#define SPEED_5000              5000
-#define SPEED_10000             10000
-#define SPEED_14000             14000
-#define SPEED_20000             20000
-#define SPEED_25000             25000
-#define SPEED_40000             40000
-#define SPEED_50000             50000
-#define SPEED_56000             56000
-#define SPEED_100000            100000
-
 enum nfp_eth_raw {
 	NSP_ETH_RAW_PORT = 0,
 	NSP_ETH_RAW_STATE,
 	NSP_ETH_RAW_MAC,
 	NSP_ETH_RAW_CONTROL,
-	NSP_ETH_NUM_RAW
+	NSP_ETH_NUM_RAW,
 };
 
 enum nfp_eth_rate {
@@ -100,12 +84,12 @@ static const struct {
 	enum nfp_eth_rate rate;
 	uint32_t speed;
 } nsp_eth_rate_tbl[] = {
-	{ RATE_INVALID, 0, },
-	{ RATE_10M,     SPEED_10, },
-	{ RATE_100M,    SPEED_100, },
-	{ RATE_1G,      SPEED_1000, },
-	{ RATE_10G,     SPEED_10000, },
-	{ RATE_25G,     SPEED_25000, },
+	{ RATE_INVALID, RTE_ETH_SPEED_NUM_NONE, },
+	{ RATE_10M,     RTE_ETH_SPEED_NUM_10M, },
+	{ RATE_100M,    RTE_ETH_SPEED_NUM_100M, },
+	{ RATE_1G,      RTE_ETH_SPEED_NUM_1G, },
+	{ RATE_10G,     RTE_ETH_SPEED_NUM_10G, },
+	{ RATE_25G,     RTE_ETH_SPEED_NUM_25G, },
 };
 
 static uint32_t
@@ -192,7 +176,14 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 	if (dst->fec_modes_supported != 0)
 		dst->fec_modes_supported |= NFP_FEC_AUTO | NFP_FEC_DISABLED;
 
-	dst->fec = 1 << FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->fec = FIELD_GET(NSP_ETH_STATE_FEC, state);
+	dst->act_fec = dst->fec;
+
+	if (nfp_nsp_get_abi_ver_minor(nsp) < 33)
+		return;
+
+	dst->act_fec = FIELD_GET(NSP_ETH_STATE_ACT_FEC, state);
+	dst->supp_aneg = FIELD_GET(NSP_ETH_PORT_SUPP_ANEG, port);
 }
 
 static void
@@ -221,7 +212,7 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 						table->ports[i].label_port,
 						table->ports[i].label_subport);
 
-			table->ports[i].is_split = 1;
+			table->ports[i].is_split = true;
 		}
 	}
 }
@@ -232,6 +223,9 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 	if (entry->interface == NFP_INTERFACE_NONE) {
 		entry->port_type = PORT_NONE;
 		return;
+	} else if (entry->interface == NFP_INTERFACE_RJ45) {
+		entry->port_type = PORT_TP;
+		return;
 	}
 
 	if (entry->media == NFP_MEDIA_FIBRE)
@@ -250,7 +244,6 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 	uint32_t table_sz;
 	struct nfp_eth_table *table;
 	union eth_table_entry *entries;
-	const struct rte_ether_addr *mac;
 
 	entries = rte_zmalloc(NULL, NSP_ETH_TABLE_SIZE, 0);
 	if (entries == NULL)
@@ -262,16 +255,9 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/*
-	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
-	 * the rest 6 ports mac are all 0, ensure we don't use these port
-	 */
-	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
+	for (i = 0; i < NSP_ETH_MAX_COUNT; i++)
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
 			cnt++;
-	}
 
 	/*
 	 * Some versions of flash will give us 0 instead of port count. For
@@ -291,11 +277,8 @@ nfp_eth_read_ports_real(struct nfp_nsp *nsp)
 
 	table->count = cnt;
 	for (i = 0, j = 0; i < NSP_ETH_MAX_COUNT; i++) {
-		mac = (const struct rte_ether_addr *)entries[i].mac_addr;
-		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0 &&
-				!rte_is_zero_ether_addr(mac))
-			nfp_eth_port_translate(nsp, &entries[i], i,
-					&table->ports[j++]);
+		if ((entries[i].port & NSP_ETH_PORT_LANES_MASK) != 0)
+			nfp_eth_port_translate(nsp, &entries[i], i, &table->ports[j++]);
 	}
 
 	nfp_eth_calc_port_geometry(table);
@@ -436,7 +419,7 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int enable)
+		bool enable)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -444,7 +427,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
-		return -1;
+		return -EIO;
 
 	entries = nfp_nsp_config_entries(nsp);
 
@@ -456,7 +439,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_ENABLED, enable);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -480,7 +463,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
-		int configured)
+		bool configured)
 {
 	uint64_t reg;
 	struct nfp_nsp *nsp;
@@ -509,7 +492,7 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured);
 		entries[idx].control = rte_cpu_to_le_64(reg);
 
-		nfp_nsp_config_set_modified(nsp, 1);
+		nfp_nsp_config_set_modified(nsp, true);
 	}
 
 	return nfp_eth_config_commit_end(nsp);
@@ -547,7 +530,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	entries[idx].control |= rte_cpu_to_le_64(ctrl_bit);
 
-	nfp_nsp_config_set_modified(nsp, 1);
+	nfp_nsp_config_set_modified(nsp, true);
 
 	return 0;
 }
-- 
2.39.1


^ permalink raw reply	[relevance 5%]

* [PATCH 07/27] net/nfp: standard the comment style
    2023-08-24 11:09  2% ` [PATCH 02/27] net/nfp: unify the indent coding style Chaoyong He
  2023-08-24 11:09  3% ` [PATCH 05/27] net/nfp: standard the local variable " Chaoyong He
@ 2023-08-24 11:09  1% ` Chaoyong He
  2023-08-24 11:09  5% ` [PATCH 19/27] net/nfp: refact the nsp module Chaoyong He
    4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-24 11:09 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Follow the DPDK coding style, use the kdoc comment style.
Also add some comment to help understand logic.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          | 504 ++++-----------------
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c |  39 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 484 ++++++++++++++++----
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  21 +-
 drivers/net/nfp/nfpcore/nfp_hwinfo.h       |   2 +
 drivers/net/nfp/nfpcore/nfp_mip.c          |  43 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  69 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |  49 +-
 drivers/net/nfp/nfpcore/nfp_nffw.h         |   6 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          |  53 ++-
 drivers/net/nfp/nfpcore/nfp_nsp.h          | 108 ++---
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 170 ++++---
 drivers/net/nfp/nfpcore/nfp_resource.c     | 103 +++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |  28 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  59 ++-
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  12 +-
 drivers/net/nfp/nfpcore/nfp_target.c       |   2 +-
 17 files changed, 888 insertions(+), 864 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 139752f85a..82189e9910 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -10,9 +10,7 @@
 
 struct nfp_cpp_mutex;
 
-/*
- * NFP CPP handle
- */
+/* NFP CPP handle */
 struct nfp_cpp {
 	uint32_t model;
 	uint32_t interface;
@@ -37,9 +35,7 @@ struct nfp_cpp {
 	int driver_lock_needed;
 };
 
-/*
- * NFP CPP device area handle
- */
+/* NFP CPP device area handle */
 struct nfp_cpp_area {
 	struct nfp_cpp *cpp;
 	char *name;
@@ -127,35 +123,45 @@ struct nfp_cpp_operations {
 
 #define NFP_CPP_TARGET_ID_MASK 0x1f
 
-/*
+/**
  * Pack target, token, and action into a CPP ID.
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
  *
- * @return      NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ID(target, action, token)                               \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
 		(((action) & 0xff) << 8))
 
-/*
+/**
  * Pack target, token, action, and island into a CPP ID.
- * @target      NFP CPP target id
- * @action      NFP CPP action id
- * @token       NFP CPP token id
- * @island      NFP CPP island id
  *
  * Create a 32-bit CPP identifier representing the access to be made.
  * These identifiers are used as parameters to other NFP CPP functions.
  * Some CPP devices may allow wildcard identifiers to be specified.
  *
- * @return      NFP CPP ID
+ * @param target
+ *   NFP CPP target id
+ * @param action
+ *   NFP CPP action id
+ * @param token
+ *   NFP CPP token id
+ * @param island
+ *   NFP CPP island id
+ *
+ * @return
+ *   NFP CPP ID
  */
 #define NFP_CPP_ISLAND_ID(target, action, token, island)                \
 		((((target) & 0x7f) << 24) | (((token) & 0xff) << 16) | \
@@ -163,9 +169,12 @@ struct nfp_cpp_operations {
 
 /**
  * Return the NFP CPP target of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP target
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP target
  */
 static inline uint8_t
 NFP_CPP_ID_TARGET_of(uint32_t id)
@@ -173,11 +182,14 @@ NFP_CPP_ID_TARGET_of(uint32_t id)
 	return (id >> 24) & NFP_CPP_TARGET_ID_MASK;
 }
 
-/*
+/**
  * Return the NFP CPP token of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP token
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP token
  */
 static inline uint8_t
 NFP_CPP_ID_TOKEN_of(uint32_t id)
@@ -185,11 +197,14 @@ NFP_CPP_ID_TOKEN_of(uint32_t id)
 	return (id >> 16) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP action of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP action
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP action
  */
 static inline uint8_t
 NFP_CPP_ID_ACTION_of(uint32_t id)
@@ -197,11 +212,14 @@ NFP_CPP_ID_ACTION_of(uint32_t id)
 	return (id >> 8) & 0xff;
 }
 
-/*
+/**
  * Return the NFP CPP island of a NFP CPP ID
- * @id          NFP CPP ID
  *
- * @return      NFP CPP island
+ * @param id
+ *   NFP CPP ID
+ *
+ * @return
+ *   NFP CPP island
  */
 static inline uint8_t
 NFP_CPP_ID_ISLAND_of(uint32_t id)
@@ -215,109 +233,57 @@ NFP_CPP_ID_ISLAND_of(uint32_t id)
  */
 const struct nfp_cpp_operations *nfp_cpp_transport_operations(void);
 
-/*
- * Set the model id
- *
- * @param   cpp     NFP CPP operations structure
- * @param   model   Model ID
- */
 void nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   interface Interface ID
- */
 void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
 
-/*
- * Set the private instance owned data of a nfp_cpp struct
- *
- * @param   cpp     NFP CPP operations structure
- * @param   serial  NFP serial byte array
- * @param   len     Length of the serial byte array
- */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
 		size_t serial_len);
 
-/*
- * Set the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv);
 
-/*
- * Return the private data of the nfp_cpp instance
- *
- * @param   cpp NFP CPP operations structure
- * @return      Opaque device pointer
- */
 void *nfp_cpp_priv(struct nfp_cpp *cpp);
 
-/*
- * Get the privately allocated portion of a NFP CPP area handle
- *
- * @param   cpp_area    NFP CPP area handle
- * @return          Pointer to the private area, or NULL on failure
- */
 void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area);
 
 uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
 
-/*
- * NFP CPP core interface for CPP clients.
- */
-
-/*
- * Open a NFP CPP handle to a CPP device
- *
- * @param[in]	id	0-based ID for the CPP interface to use
- *
- * @return NFP CPP handle, or NULL on failure.
- */
+/* NFP CPP core interface for CPP clients */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed);
 
-/*
- * Free a NFP CPP handle
- *
- * @param[in]	cpp	NFP CPP handle
- */
 void nfp_cpp_free(struct nfp_cpp *cpp);
 
 #define NFP_CPP_MODEL_INVALID   0xffffffff
 
-/*
- * NFP_CPP_MODEL_CHIP_of - retrieve the chip ID from the model ID
+/**
+ * Retrieve the chip ID from the model ID
  *
  * The chip ID is a 16-bit BCD+A-F encoding for the chip type.
  *
- * @param[in]   model   NFP CPP model id
- * @return      NFP CPP chip id
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   NFP CPP chip id
  */
 #define NFP_CPP_MODEL_CHIP_of(model)        (((model) >> 16) & 0xffff)
 
-/*
- * NFP_CPP_MODEL_IS_6000 - Check for the NFP6000 family of devices
+/**
+ * Check for the NFP6000 family of devices
  *
  * NOTE: The NFP4000 series is considered as a NFP6000 series variant.
  *
- * @param[in]	model	NFP CPP model id
- * @return		true if model is in the NFP6000 family, false otherwise.
+ * @param model
+ *   NFP CPP model id
+ *
+ * @return
+ *   true if model is in the NFP6000 family, false otherwise.
  */
 #define NFP_CPP_MODEL_IS_6000(model)		     \
 		((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \
 		(NFP_CPP_MODEL_CHIP_of(model) < 0x7000))
 
-/*
- * nfp_cpp_model - Retrieve the Model ID of the NFP
- *
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Model ID
- */
 uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 
 /*
@@ -330,7 +296,7 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
 #define NFP_CPP_INTERFACE_TYPE_RPC		0x3
 #define NFP_CPP_INTERFACE_TYPE_ILA		0x4
 
-/*
+/**
  * Construct a 16-bit NFP Interface ID
  *
  * Interface IDs consists of 4 bits of interface type, 4 bits of unit
@@ -340,422 +306,138 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp);
  * which use the MU Atomic CompareAndWrite operation - hence the limit to 16
  * bits to be able to use the NFP Interface ID as a lock owner.
  *
- * @param[in]	type	NFP Interface Type
- * @param[in]	unit	Unit identifier for the interface type
- * @param[in]	channel	Channel identifier for the interface unit
- * @return		Interface ID
+ * @param type
+ *   NFP Interface Type
+ * @param unit
+ *   Unit identifier for the interface type
+ * @param channel
+ *   Channel identifier for the interface unit
+ *
+ * @return
+ *   Interface ID
  */
 #define NFP_CPP_INTERFACE(type, unit, channel)	\
 	((((type) & 0xf) << 12) | \
 	 (((unit) & 0xf) <<  8) | \
 	 (((channel) & 0xff) << 0))
 
-/*
+/**
  * Get the interface type of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's type
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's type
  */
 #define NFP_CPP_INTERFACE_TYPE_of(interface)	(((interface) >> 12) & 0xf)
 
-/*
+/**
  * Get the interface unit of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's unit
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's unit
  */
 #define NFP_CPP_INTERFACE_UNIT_of(interface)	(((interface) >>  8) & 0xf)
 
-/*
+/**
  * Get the interface channel of a NFP Interface ID
- * @param[in]	interface	NFP Interface ID
- * @return			NFP Interface ID's channel
+ *
+ * @param interface
+ *   NFP Interface ID
+ *
+ * @return
+ *   NFP Interface ID's channel
  */
 #define NFP_CPP_INTERFACE_CHANNEL_of(interface)	(((interface) >>  0) & 0xff)
 
-/*
- * Retrieve the Interface ID of the NFP
- * @param[in]	cpp	NFP CPP handle
- * @return		NFP CPP Interface ID
- */
+
 uint16_t nfp_cpp_interface(struct nfp_cpp *cpp);
 
-/*
- * Retrieve the NFP Serial Number (unique per NFP)
- * @param[in]	cpp	NFP CPP handle
- * @param[out]	serial	Pointer to reference the serial number array
- *
- * @return	size of the NFP6000 serial number, in bytes
- */
 int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, size_t size);
 
-/*
- * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	name	Name of owner of the area
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint32_t cpp_id, const char *name, uint64_t address,
 		uint32_t size);
 
-/*
- * Free an allocated NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_free(struct nfp_cpp_area *area);
 
-/*
- * Acquire the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- *
- * @return 0 on success, -1 on failure.
- */
 int nfp_cpp_area_acquire(struct nfp_cpp_area *area);
 
-/*
- * Release the resources needed to access the NFP CPP area handle
- *
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release(struct nfp_cpp_area *area);
 
-/*
- * Allocate, then acquire the resources needed to access the NFP CPP area handle
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	size	Size of the area to reserve
- *
- * @return NFP CPP handle, or NULL on failure.
- */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 		uint32_t cpp_id, uint64_t address, size_t size);
 
-/*
- * Release the resources, then free the NFP CPP area handle
- * @param[in]	area	NFP CPP area handle
- */
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t addr, uint32_t size, struct nfp_cpp_area **area);
 
-/*
- * Read from a NFP CPP area handle into a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer to receive the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes read on success, negative value on failure.
- *
- */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset,
 		void *buffer, size_t length);
 
-/*
- * Write to a NFP CPP area handle from a buffer. The area must be acquired with
- * 'nfp_cpp_area_acquire()' before calling this operation.
- *
- * @param[in]	area	NFP CPP area handle
- * @param[in]	offset	Offset into the area
- * @param[in]	buffer	Location of buffer that holds the data
- * @param[in]	length	Length of the data to read
- *
- * @return bytes written on success, negative value on failure.
- */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset,
 		const void *buffer, size_t length);
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
- * @area:       CPP area handle
- *
- * Returns an iomem pointer for use with readl()/writel() style operations.
- *
- * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
- */
 void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
 
-/*
- * Get the NFP CPP handle that is the parent of a NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			NFP CPP handle
- */
 struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area);
 
-/*
- * Get the name passed during allocation of the NFP CPP area handle
- *
- * @param	cpp_area	NFP CPP area handle
- * @return			Pointer to the area's name
- */
 const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
 
-/*
- * Read a block of data from a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy read data to
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes read on success, -1 on failure.
- */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, void *kernel_vaddr, size_t length);
 
-/*
- * Write a block of data to a NFP CPP ID
- *
- * @param[in]	cpp	NFP CPP handle
- * @param[in]	cpp_id	NFP CPP ID
- * @param[in]	address	Offset into the NFP CPP ID address space
- * @param[in]	kernel_vaddr	Buffer to copy write data from
- * @param[in]	length	Size of the area to reserve
- *
- * @return bytes written on success, -1 on failure.
- */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, const void *kernel_vaddr, size_t length);
 
-/*
- * Read a single 32-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t *value);
 
-/*
- * Write a single 32-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 32-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, uint32_t offset,
 		uint32_t value);
 
-/*
- * Read a single 64-bit value from a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		output value
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t *value);
 
-/*
- * Write a single 64-bit value to a NFP CPP area handle
- *
- * @param area		NFP CPP area handle
- * @param offset	offset into NFP CPP area handle
- * @param value		value to write
- *
- * The area must be acquired with 'nfp_cpp_area_acquire()' before calling this
- * operation.
- *
- * NOTE: offset must be 64-bit aligned.
- *
- * @return 0 on success, or -1 on error.
- */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, uint32_t offset,
 		uint64_t value);
 
-/*
- * Write a single 32-bit value on the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t value);
 
-/*
- * Read a single 32-bit value from the XPB bus
- *
- * @param cpp           NFP CPP device handle
- * @param xpb_tgt	XPB target and address
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
 
-/*
- * Read a 32-bit word from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t *value);
 
-/*
- * Write a 32-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- *
- */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint32_t value);
 
-/*
- * Read a 64-bit work from a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         output value
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t *value);
 
-/*
- * Write a 64-bit value to a NFP CPP ID
- *
- * @param cpp           NFP CPP handle
- * @param cpp_id        NFP CPP ID
- * @param address       offset into the NFP CPP ID address space
- * @param value         value to write
- *
- * @return 0 on success, or -1 on failure.
- */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
 		uint64_t address, uint64_t value);
 
-/*
- * Initialize a mutex location
-
- * The CPP target:address must point to a 64-bit aligned location, and will
- * initialize 64 bits of data at the location.
- *
- * This creates the initial mutex state, as locked by this nfp_cpp_interface().
- *
- * This function should only be called when setting up the initial lock state
- * upon boot-up of the system.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	Unique 32-bit value for this mutex
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Create a mutex handle from an address controlled by a MU Atomic engine
- *
- * The CPP target:address must point to a 64-bit aligned location, and reserve
- * 64 bits of data at the location for use by the handle.
- *
- * Only target/address pairs that point to entities that support the MU Atomic
- * Engine's CmpAndSwap32 command are supported.
- *
- * @param cpp		NFP CPP handle
- * @param target	NFP CPP target ID
- * @param address	Offset into the address space of the NFP CPP target ID
- * @param key_id	32-bit unique key (must match the key at this location)
- *
- * @return		A non-NULL struct nfp_cpp_mutex * on success, NULL on
- *                      failure.
- */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
 		uint64_t address, uint32_t key_id);
 
-/*
- * Free a mutex handle - does not alter the lock state
- *
- * @param mutex		NFP CPP Mutex handle
- */
 void nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex);
 
-/*
- * Lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Unlock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- *
- * @return 0 on success, negative value on failure.
- */
 int nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex);
 
-/*
- * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
- *
- * @param mutex		NFP CPP Mutex handle
- * @return		0 if the lock succeeded, negative value on failure.
- */
 int nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex);
 
 uint32_t nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp);
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index bdf4a658f5..7e94bfb611 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -58,7 +58,7 @@
  * Minimal size of the PCIe cfg memory we depend on being mapped,
  * queue controller and DMA controller don't have to be covered.
  */
-#define NFP_PCI_MIN_MAP_SIZE				0x080000
+#define NFP_PCI_MIN_MAP_SIZE				0x080000        /* 512K */
 
 #define NFP_PCIE_P2C_FIXED_SIZE(bar)               (1 << (bar)->bitsize)
 #define NFP_PCIE_P2C_BULK_SIZE(bar)                (1 << (bar)->bitsize)
@@ -72,40 +72,25 @@
 #define NFP_PCIE_CPP_BAR_PCIETOCPPEXPBAR(bar, slot) \
 	(((bar) * 8 + (slot)) * 4)
 
-/*
- * Define to enable a bit more verbose debug output.
- * Set to 1 to enable a bit more verbose debug output.
- */
 struct nfp_pcie_user;
 struct nfp6000_area_priv;
 
-/*
- * struct nfp_bar - describes BAR configuration and usage
- * @nfp:	backlink to owner
- * @barcfg:	cached contents of BAR config CSR
- * @base:	the BAR's base CPP offset
- * @mask:       mask for the BAR aperture (read only)
- * @bitsize:	bitsize of BAR aperture (read only)
- * @index:	index of the BAR
- * @lock:	lock to specify if bar is in use
- * @refcnt:	number of current users
- * @iomem:	mapped IO memory
- */
+/* Describes BAR configuration and usage */
 #define NFP_BAR_MIN 1
 #define NFP_BAR_MID 5
 #define NFP_BAR_MAX 7
 
 struct nfp_bar {
-	struct nfp_pcie_user *nfp;
-	uint32_t barcfg;
-	uint64_t base;		/* CPP address base */
-	uint64_t mask;		/* Bit mask of the bar */
-	uint32_t bitsize;	/* Bit size of the bar */
-	uint32_t index;
-	int lock;
+	struct nfp_pcie_user *nfp;    /**< Backlink to owner */
+	uint32_t barcfg;     /**< BAR config CSR */
+	uint64_t base;       /**< Base CPP offset */
+	uint64_t mask;       /**< Mask of the BAR aperture (read only) */
+	uint32_t bitsize;    /**< Bit size of the BAR aperture (read only) */
+	uint32_t index;      /**< Index of the BAR */
+	int lock;            /**< If the BAR has been locked */
 
 	char *csr;
-	char *iomem;
+	char *iomem;         /**< mapped IO memory */
 };
 
 #define BUSDEV_SZ	13
@@ -360,9 +345,7 @@ nfp_disable_bars(struct nfp_pcie_user *nfp)
 	}
 }
 
-/*
- * Generic CPP bus access interface.
- */
+/* Generic CPP bus access interface. */
 
 struct nfp6000_area_priv {
 	struct nfp_bar *bar;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 66f4ddaab7..f601907673 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -26,6 +26,15 @@
 #define NFP_PL_DEVICE_MODEL_MASK               (NFP_PL_DEVICE_PART_MASK | \
 						NFP_PL_DEVICE_ID_MASK)
 
+/**
+ * Set the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void
 nfp_cpp_priv_set(struct nfp_cpp *cpp,
 		void *priv)
@@ -33,12 +42,29 @@ nfp_cpp_priv_set(struct nfp_cpp *cpp,
 	cpp->priv = priv;
 }
 
+/**
+ * Return the private data of the nfp_cpp instance
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ *
+ * @return
+ *   Opaque device pointer
+ */
 void *
 nfp_cpp_priv(struct nfp_cpp *cpp)
 {
 	return cpp->priv;
 }
 
+/**
+ * Set the model id
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param model
+ *   Model ID
+ */
 void
 nfp_cpp_model_set(struct nfp_cpp *cpp,
 		uint32_t model)
@@ -46,6 +72,15 @@ nfp_cpp_model_set(struct nfp_cpp *cpp,
 	cpp->model = model;
 }
 
+/**
+ * Retrieve the Model ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Model ID
+ */
 uint32_t
 nfp_cpp_model(struct nfp_cpp *cpp)
 {
@@ -63,6 +98,14 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 	return model;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param interface
+ *   Interface ID
+ */
 void
 nfp_cpp_interface_set(struct nfp_cpp *cpp,
 		uint32_t interface)
@@ -70,6 +113,17 @@ nfp_cpp_interface_set(struct nfp_cpp *cpp,
 	cpp->interface = interface;
 }
 
+/**
+ * Retrieve the Serial ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param serial
+ *   Pointer to NFP serial number
+ *
+ * @return
+ *   Length of NFP serial number
+ */
 int
 nfp_cpp_serial(struct nfp_cpp *cpp,
 		const uint8_t **serial)
@@ -78,6 +132,16 @@ nfp_cpp_serial(struct nfp_cpp *cpp,
 	return cpp->serial_len;
 }
 
+/**
+ * Set the private instance owned data of a nfp_cpp struct
+ *
+ * @param cpp
+ *   NFP CPP operations structure
+ * @param serial
+ *   NFP serial byte array
+ * @param serial_len
+ *   Length of the serial byte array
+ */
 int
 nfp_cpp_serial_set(struct nfp_cpp *cpp,
 		const uint8_t *serial,
@@ -96,6 +160,15 @@ nfp_cpp_serial_set(struct nfp_cpp *cpp,
 	return 0;
 }
 
+/**
+ * Retrieve the Interface ID of the NFP
+ *
+ * @param cpp
+ *   NFP CPP handle
+ *
+ * @return
+ *   NFP CPP Interface ID
+ */
 uint16_t
 nfp_cpp_interface(struct nfp_cpp *cpp)
 {
@@ -105,18 +178,45 @@ nfp_cpp_interface(struct nfp_cpp *cpp)
 	return cpp->interface;
 }
 
+/**
+ * Get the privately allocated portion of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the private area, or NULL on failure
+ */
 void *
 nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area)
 {
 	return &cpp_area[1];
 }
 
+/**
+ * Get the NFP CPP handle that is the pci_dev of a NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   NFP CPP handle
+ */
 struct nfp_cpp *
 nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area)
 {
 	return cpp_area->cpp;
 }
 
+/**
+ * Get the name passed during allocation of the NFP CPP area handle
+ *
+ * @param cpp_area
+ *   NFP CPP area handle
+ *
+ * @return
+ *   Pointer to the area's name
+ */
 const char *
 nfp_cpp_area_name(struct nfp_cpp_area *cpp_area)
 {
@@ -153,15 +253,24 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
 	return cpp->mu_locality_lsb;
 }
 
-/*
- * nfp_cpp_area_alloc - allocate a new CPP area
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area in bytes
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
  *
- * Allocate and initialize a CPP area structure.  The area must later
- * be locked down with an 'acquire' before it can be safely accessed.
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param name
+ *   Name of region
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
  *
  * NOTE: @address and @size must be 32-bit aligned values.
  */
@@ -211,6 +320,25 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 	return area;
 }
 
+/**
+ * Allocate and initialize a CPP area structure.
+ * The area must later be locked down with an 'acquire' before
+ * it can be safely accessed.
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param dest
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
+ * NOTE: @address and @size must be 32-bit aligned values.
+ */
 struct nfp_cpp_area *
 nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 		uint32_t dest,
@@ -220,17 +348,22 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp,
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
 
-/*
- * nfp_cpp_area_alloc_acquire - allocate a new CPP area and lock it down
- *
- * @cpp:    CPP handle
- * @dest:   CPP id
- * @address:    start address on CPP target
- * @size:   size of area
- *
+/**
  * Allocate and initialize a CPP area structure, and lock it down so
  * that it can be accessed directly.
  *
+ * @param cpp
+ *   CPP device handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Address of region
+ * @param size
+ *   Size of region
+ *
+ * @return
+ *   NFP CPP area handle, or NULL
+ *
  * NOTE: @address and @size must be 32-bit aligned values.
  *
  * NOTE: The area must also be 'released' when the structure is freed.
@@ -258,11 +391,11 @@ nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 	return area;
 }
 
-/*
- * nfp_cpp_area_free - free up the CPP area
- * area:    CPP area handle
- *
+/**
  * Frees up memory resources held by the CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_free(struct nfp_cpp_area *area)
@@ -272,11 +405,11 @@ nfp_cpp_area_free(struct nfp_cpp_area *area)
 	free(area);
 }
 
-/*
- * nfp_cpp_area_release_free - release CPP area and free it
- * area:    CPP area handle
+/**
+ * Releases CPP area and frees up memory resources held by it.
  *
- * Releases CPP area and frees up memory resources held by the it.
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release_free(struct nfp_cpp_area *area)
@@ -285,12 +418,15 @@ nfp_cpp_area_release_free(struct nfp_cpp_area *area)
 	nfp_cpp_area_free(area);
 }
 
-/*
- * nfp_cpp_area_acquire - lock down a CPP area for access
- * @area:   CPP area handle
+/**
+ * Locks down the CPP area for a potential long term activity.
+ * Area must always be locked down before being accessed.
  *
- * Locks down the CPP area for a potential long term activity.  Area
- * must always be locked down before being accessed.
+ * @param area
+ *   CPP area handle
+ *
+ * @return
+ *   0 on success, -1 on failure.
  */
 int
 nfp_cpp_area_acquire(struct nfp_cpp_area *area)
@@ -307,11 +443,11 @@ nfp_cpp_area_acquire(struct nfp_cpp_area *area)
 	return 0;
 }
 
-/*
- * nfp_cpp_area_release - release a locked down CPP area
- * @area:   CPP area handle
- *
+/**
  * Releases a previously locked down CPP area.
+ *
+ * @param area
+ *   CPP area handle
  */
 void
 nfp_cpp_area_release(struct nfp_cpp_area *area)
@@ -320,16 +456,16 @@ nfp_cpp_area_release(struct nfp_cpp_area *area)
 		area->cpp->op->area_release(area);
 }
 
-/*
- * nfp_cpp_area_iomem() - get IOMEM region for CPP area
+/**
+ * Returns an iomem pointer for use with readl()/writel() style operations.
  *
- * @area:       CPP area handle
+ * @param area
+ *   CPP area handle
  *
- * Returns an iomem pointer for use with readl()/writel() style operations.
+ * @return
+ *   Pointer to the area, or NULL
  *
  * NOTE: Area must have been locked down with an 'acquire'.
- *
- * Return: pointer to the area, or NULL
  */
 void *
 nfp_cpp_area_iomem(struct nfp_cpp_area *area)
@@ -342,18 +478,22 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
 	return iomem;
 }
 
-/*
- * nfp_cpp_area_read - read data from CPP area
+/**
+ * Read data from indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to put data into
- * @length:     number of bytes to read
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Read data from indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -368,18 +508,22 @@ nfp_cpp_area_read(struct nfp_cpp_area *area,
 	return area->cpp->op->area_read(area, kernel_vaddr, offset, length);
 }
 
-/*
- * nfp_cpp_area_write - write data to CPP area
+/**
+ * Write data to indicated CPP region.
  *
- * @area:       CPP area handle
- * @offset:     offset into CPP area
- * @kernel_vaddr:   kernel address to read data from
- * @length:     number of bytes to write
+ * @param area
+ *   CPP area handle
+ * @param offset
+ *   Offset into CPP area
+ * @param kernel_vaddr
+ *   Address to put data into
+ * @param length
+ *   Number of bytes to read
  *
- * Write data to indicated CPP region.
+ * @return
+ *   Length of io, or -ERRNO
  *
  * NOTE: @offset and @length must be 32-bit aligned values.
- *
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
@@ -436,6 +580,19 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 	return xpb;
 }
 
+/**
+ * Read a uint32_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readl(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -450,6 +607,19 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writel(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -462,6 +632,19 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_readq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -476,6 +659,19 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t vale to an area
+ *
+ * @param area
+ *   CPP Area handle
+ * @param offset
+ *   Offset into area
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 		uint32_t offset,
@@ -489,6 +685,21 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint32_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readl(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -504,6 +715,21 @@ nfp_cpp_readl(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writel(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -518,6 +744,21 @@ nfp_cpp_writel(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Read a uint64_t value from a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_readq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -533,6 +774,21 @@ nfp_cpp_readq(struct nfp_cpp *cpp,
 	return (sz == sizeof(*value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint64_t value to a CPP location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param cpp_id
+ *   CPP ID for operation
+ * @param address
+ *   Address for operation
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_cpp_writeq(struct nfp_cpp *cpp,
 		uint32_t cpp_id,
@@ -547,6 +803,19 @@ nfp_cpp_writeq(struct nfp_cpp *cpp,
 	return (sz == sizeof(value)) ? 0 : -1;
 }
 
+/**
+ * Write a uint32_t word to a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Value to write
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_writel(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -559,6 +828,19 @@ nfp_xpb_writel(struct nfp_cpp *cpp,
 	return nfp_cpp_writel(cpp, cpp_dest, xpb_addr, value);
 }
 
+/**
+ * Read a uint32_t value from a XPB location
+ *
+ * @param cpp
+ *   CPP device handle
+ * @param xpb_addr
+ *   XPB target and address
+ * @param value
+ *   Pointer to read buffer
+ *
+ * @return
+ *   0 on success, or -ERRNO
+ */
 int
 nfp_xpb_readl(struct nfp_cpp *cpp,
 		uint32_t xpb_addr,
@@ -625,9 +907,11 @@ nfp_cpp_alloc(struct rte_pci_device *dev,
 	return cpp;
 }
 
-/*
- * nfp_cpp_free - free the CPP handle
- * @cpp:    CPP handle
+/**
+ * Free the CPP handle
+ *
+ * @param cpp
+ *   CPP handle
  */
 void
 nfp_cpp_free(struct nfp_cpp *cpp)
@@ -641,6 +925,19 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 	free(cpp);
 }
 
+/**
+ * Create a NFP CPP handle from device
+ *
+ * @param dev
+ *   PCI device
+ * @param driver_lock_needed
+ *   Driver lock flag
+ *
+ * @return
+ *   NFP CPP handle on success, NULL on failure
+ *
+ * NOTE: On failure, cpp_ops->free will be called!
+ */
 struct nfp_cpp *
 nfp_cpp_from_device_name(struct rte_pci_device *dev,
 		int driver_lock_needed)
@@ -648,13 +945,22 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev,
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
 
-/*
- * nfp_cpp_read - read from CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer for result
- * @length:     number of bytes to read
+/**
+ * Read from CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer for result
+ * @param length
+ *   Number of bytes to read
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_read(struct nfp_cpp *cpp,
@@ -678,13 +984,22 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_cpp_write - write to CPP target
- * @cpp:        CPP handle
- * @destination:    CPP id
- * @address:        offset into CPP target
- * @kernel_vaddr:   kernel buffer to read from
- * @length:     number of bytes to write
+/**
+ * Write to CPP target
+ *
+ * @param cpp
+ *   CPP handle
+ * @param destination
+ *   CPP id
+ * @param address
+ *   Offset into CPP target
+ * @param kernel_vaddr
+ *   Buffer to read from
+ * @param length
+ *   Number of bytes to write
+ *
+ * @return
+ *   Length of io, or -ERRNO
  */
 int
 nfp_cpp_write(struct nfp_cpp *cpp,
@@ -731,18 +1046,23 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
- * nfp_cpp_map_area() - Helper function to map an area
- * @cpp:    NFP CPP handler
- * @cpp_id: CPP ID
- * @addr:   CPP address
- * @size:   Size of the area
- * @area:   Area handle (output)
+/**
+ * Map an area of IOMEM access.
+ * To undo the effect of this function call @nfp_cpp_area_release_free(*area).
  *
- * Map an area of IOMEM access.  To undo the effect of this function call
- * @nfp_cpp_area_release_free(*area).
+ * @param cpp
+ *   NFP CPP handler
+ * @param cpp_id
+ *   CPP id
+ * @param addr
+ *   CPP address
+ * @param size
+ *   Size of the area
+ * @param area
+ *   Area handle (output)
  *
- * Return: Pointer to memory mapped area or NULL
+ * @return
+ *   Pointer to memory mapped area or NULL
  */
 uint8_t *
 nfp_cpp_map_area(struct nfp_cpp *cpp,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index b658b5e900..f5579ab60f 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -3,7 +3,8 @@
  * All rights reserved.
  */
 
-/* Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
+/*
+ * Parse the hwinfo table that the ARM firmware builds in the ARM scratch SRAM
  * after chip reset.
  *
  * Examples of the fields:
@@ -146,7 +147,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 	struct nfp_hwinfo *db;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 10000000;
+	wait.tv_nsec = 10000000;    /* 10ms */
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -154,7 +155,7 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 			return db;
 
 		nanosleep(&wait, NULL);
-		if (count++ > 200) {
+		if (count++ > 200) {    /* 10ms * 200 = 2s */
 			PMD_DRV_LOG(ERR, "NFP access error");
 			return NULL;
 		}
@@ -180,12 +181,16 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
 	return db;
 }
 
-/*
- * nfp_hwinfo_lookup() - Find a value in the HWInfo table by name
- * @hwinfo:	NFP HWinfo table
- * @lookup:	HWInfo name to search for
+/**
+ * Find a value in the HWInfo table by name
+ *
+ * @param hwinfo
+ *   NFP HWInfo table
+ * @param lookup
+ *   HWInfo name to search for
  *
- * Return: Value of the HWInfo name, or NULL
+ * @return
+ *   Value of the HWInfo name, or NULL
  */
 const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
index a3da7512db..424db8035d 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h
@@ -59,6 +59,8 @@
  * Packed UTF8Z strings, ie 'key1\000value1\000key2\000value2\000'
  *
  * Unsorted.
+ *
+ * Note: Only the HwInfo v2 Table be supported now.
  */
 
 #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 086e82db70..0892c99e96 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -87,15 +87,16 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_mip_open() - Get device MIP structure
- * @cpp:	NFP CPP Handle
- *
- * Copy MIP structure from NFP device and return it.  The returned
+/**
+ * Copy MIP structure from NFP device and return it. The returned
  * structure is handled internally by the library and should be
- * freed by calling nfp_mip_close().
+ * freed by calling @nfp_mip_close().
+ *
+ * @param cpp
+ *   NFP CPP Handle
  *
- * Return: pointer to mip, NULL on failure.
+ * @return
+ *   Pointer to MIP, NULL on failure.
  */
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
@@ -131,11 +132,15 @@ nfp_mip_name(const struct nfp_mip *mip)
 	return mip->name;
 }
 
-/*
- * nfp_mip_symtab() - Get the address and size of the MIP symbol table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol table
- * @size:	Location for size of MIP symbol table
+/**
+ * Get the address and size of the MIP symbol table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol table
+ * @param size
+ *   Location for size of MIP symbol table
  */
 void
 nfp_mip_symtab(const struct nfp_mip *mip,
@@ -146,11 +151,15 @@ nfp_mip_symtab(const struct nfp_mip *mip,
 	*size = rte_le_to_cpu_32(mip->symtab_size);
 }
 
-/*
- * nfp_mip_strtab() - Get the address and size of the MIP symbol name table
- * @mip:	MIP handle
- * @addr:	Location for NFP DDR address of MIP symbol name table
- * @size:	Location for size of MIP symbol name table
+/**
+ * Get the address and size of the MIP symbol name table.
+ *
+ * @param mip
+ *   MIP handle
+ * @param addr
+ *   Location for NFP DDR address of MIP symbol name table
+ * @param size
+ *   Location for size of MIP symbol name table
  */
 void
 nfp_mip_strtab(const struct nfp_mip *mip,
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 82919d8270..404d4fa938 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -53,7 +53,7 @@ _nfp_cpp_mutex_validate(uint32_t model,
 	return 0;
 }
 
-/*
+/**
  * Initialize a mutex location
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -65,13 +65,17 @@ _nfp_cpp_mutex_validate(uint32_t model,
  * This function should only be called when setting up
  * the initial lock state upon boot-up of the system.
  *
- * @param mutex     NFP CPP Mutex handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       Unique 32-bit value for this mutex
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   Unique 32-bit value for this mutex
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_init(struct nfp_cpp *cpp,
@@ -99,7 +103,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 	return 0;
 }
 
-/*
+/**
  * Create a mutex handle from an address controlled by a MU Atomic engine
  *
  * The CPP target:address must point to a 64-bit aligned location, and
@@ -108,13 +112,17 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
  * Only target/address pairs that point to entities that support the
  * MU Atomic Engine are supported.
  *
- * @param cpp       NFP CPP handle
- * @param target    NFP CPP target ID (ie NFP_CPP_TARGET_CLS or
- *		    NFP_CPP_TARGET_MU)
- * @param address   Offset into the address space of the NFP CPP target ID
- * @param key       32-bit unique key (must match the key at this location)
+ * @param cpp
+ *   NFP CPP handle
+ * @param target
+ *   NFP CPP target ID (ie NFP_CPP_TARGET_CLS or NFP_CPP_TARGET_MU)
+ * @param address
+ *   Offset into the address space of the NFP CPP target ID
+ * @param key
+ *   32-bit unique key (must match the key at this location)
  *
- * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
+ * @return
+ *   A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
 nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
@@ -178,10 +186,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 	return mutex;
 }
 
-/*
+/**
  * Free a mutex handle - does not alter the lock state
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  */
 void
 nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
@@ -203,12 +212,14 @@ nfp_cpp_mutex_free(struct nfp_cpp_mutex *mutex)
 	free(mutex);
 }
 
-/*
+/**
  * Lock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure.
  */
 int
 nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
@@ -229,12 +240,14 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 	return 0;
 }
 
-/*
+/**
  * Unlock a mutex handle, using the NFP MU Atomic Engine
  *
- * @param mutex     NFP CPP Mutex handle
+ * @param mutex
+ *   NFP CPP Mutex handle
  *
- * @return 0 on success, or negative value on failure.
+ * @return
+ *   0 on success, or negative value on failure
  */
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
@@ -280,16 +293,18 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 	return err;
 }
 
-/*
+/**
  * Attempt to lock a mutex handle, using the NFP MU Atomic Engine
  *
  * Valid lock states:
- *
  *      0x....0000      - Unlocked
  *      0x....000f      - Locked
  *
- * @param mutex     NFP CPP Mutex handle
- * @return      0 if the lock succeeded, negative value on failure.
+ * @param mutex
+ *   NFP CPP Mutex handle
+ *
+ * @return
+ *   0 if the lock succeeded, negative value on failure.
  */
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
@@ -352,7 +367,7 @@ nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 		 * If there was another contending for this lock, then
 		 * the lock state would be 0x....000f
 		 *
-		 * Write our owner ID into the lock
+		 * Write our owner ID into the lock.
 		 * While not strictly necessary, this helps with
 		 * debug and bookkeeping.
 		 */
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 6ba40cd085..af55671a88 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -52,7 +52,7 @@ nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi)
 	return (fi->loaded__mu_da__mip_off_hi >> 8) & 1;
 }
 
-/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 8) | mip_offset_lo */
+/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */
 static uint64_t
 nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 {
@@ -111,11 +111,14 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
 	}
 }
 
-/*
- * nfp_nffw_info_open() - Acquire the lock on the NFFW table
- * @cpp:	NFP CPP handle
+/**
+ * Acquire the lock on the NFFW table
+ *
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: nffw info pointer, or NULL on failure
+ * @return
+ *   NFFW info pointer, or NULL on failure
  */
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
@@ -167,11 +170,11 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_close() - Release the lock on the NFFW table
- * @state:	NFP FW info state
+/**
+ * Release the lock on the NFFW table
  *
- * Return: void
+ * @param state
+ *   NFFW info pointer
  */
 void
 nfp_nffw_info_close(struct nfp_nffw_info *state)
@@ -180,11 +183,14 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 	free(state);
 }
 
-/*
- * nfp_nffw_info_fwid_first() - Return the first firmware ID in the NFFW
- * @state:	NFP FW info state
+/**
+ * Return the first firmware ID in the NFFW
  *
- * Return: First NFFW firmware info, NULL on failure
+ * @param state
+ *   NFFW info pointer
+ *
+ * @return:
+ *   First NFFW firmware info, NULL on failure
  */
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
@@ -204,13 +210,18 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 	return NULL;
 }
 
-/*
- * nfp_nffw_info_mip_first() - Retrieve the location of the first FW's MIP
- * @state:	NFP FW info state
- * @cpp_id:	Pointer to the CPP ID of the MIP
- * @off:	Pointer to the CPP Address of the MIP
+/**
+ * Retrieve the location of the first FW's MIP
+ *
+ * @param state
+ *   NFFW info pointer
+ * @param cpp_id
+ *   Pointer to the CPP ID of the MIP
+ * @param off
+ *   Pointer to the CPP Address of the MIP
  *
- * Return: 0, or -ERRNO
+ * @return
+ *   0, or -ERRNO
  */
 int
 nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h
index 46ac8a8d07..e032b6cce7 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.h
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.h
@@ -8,7 +8,8 @@
 
 #include "nfp_cpp.h"
 
-/* Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
+/*
+ * Init-CSR owner IDs for firmware map to firmware IDs which start at 4.
  * Lower IDs are reserved for target and loader IDs.
  */
 #define NFFW_FWID_EXT   3 /* For active MEs that we didn't load. */
@@ -16,7 +17,7 @@
 
 #define NFFW_FWID_ALL   255
 
-/**
+/*
  * NFFW_INFO_VERSION history:
  * 0: This was never actually used (before versioning), but it refers to
  *    the previous struct which had FWINFO_CNT = MEINFO_CNT = 120 that later
@@ -35,6 +36,7 @@
 #define NFFW_MEINFO_CNT_V2 200
 #define NFFW_FWINFO_CNT_V2 200
 
+/* nfp.nffw meinfo */
 struct nffw_meinfo {
 	uint32_t ctxmask__fwid__meid;
 };
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 76d418d478..039e4729bd 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -109,9 +109,11 @@ nfp_nsp_check(struct nfp_nsp *state)
 	return 0;
 }
 
-/*
- * nfp_nsp_open() - Prepare for communication and lock the NSP resource.
- * @cpp:	NFP CPP Handle
+/**
+ * Prepare for communication and lock the NSP resource.
+ *
+ * @param cpp
+ *   NFP CPP Handle
  */
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
@@ -145,9 +147,11 @@ nfp_nsp_open(struct nfp_cpp *cpp)
 	return state;
 }
 
-/*
- * nfp_nsp_close() - Clean up and unlock the NSP resource.
- * @state:	NFP SP state
+/**
+ * Clean up and unlock the NSP resource.
+ *
+ * @param state
+ *   NFP SP state
  */
 void
 nfp_nsp_close(struct nfp_nsp *state)
@@ -181,7 +185,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;     /* 25ms */
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -194,28 +198,27 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 			return 0;
 
 		nanosleep(&wait, 0);
-		if (count++ > 1000)
+		if (count++ > 1000)     /* 25ms * 1000 = 25s */
 			return -ETIMEDOUT;
 	}
 }
 
-/*
- * nfp_nsp_command() - Execute a command on the NFP Service Processor
- * @state:	NFP SP state
- * @code:	NFP SP Command Code
- * @option:	NFP SP Command Argument
- * @buff_cpp:	NFP SP Buffer CPP Address info
- * @buff_addr:	NFP SP Buffer Host address
- *
- * Return: 0 for success with no result
+/**
+ * Execute a command on the NFP Service Processor
  *
- *	 positive value for NSP completion with a result code
+ * @param state
+ *   NFP SP state
+ * @param arg
+ *   NFP command argument structure
  *
- *	-EAGAIN if the NSP is not yet present
- *	-ENODEV if the NSP is not a supported model
- *	-EBUSY if the NSP is stuck
- *	-EINTR if interrupted while waiting for completion
- *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
+ * @return
+ *   - 0 for success with no result
+ *   - Positive value for NSP completion with a result code
+ *   - -EAGAIN if the NSP is not yet present
+ *   - -ENODEV if the NSP is not a supported model
+ *   - -EBUSY if the NSP is stuck
+ *   - -EINTR if interrupted while waiting for completion
+ *   - -ETIMEDOUT if the NSP took longer than @timeout_sec seconds to complete
  */
 static int
 nfp_nsp_command(struct nfp_nsp *state,
@@ -383,7 +386,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 	struct timespec wait;
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 25000000;
+	wait.tv_nsec = 25000000;    /* 25ms */
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
@@ -392,7 +395,7 @@ nfp_nsp_wait(struct nfp_nsp *state)
 
 		nanosleep(&wait, 0);
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 25ms * 1000 = 25s */
 			err = -ETIMEDOUT;
 			break;
 		}
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index edb56e26ca..0fcb21e99c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -158,72 +158,45 @@ enum nfp_eth_fec {
 #define NFP_FEC_REED_SOLOMON	RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT)
 #define NFP_FEC_DISABLED	RTE_BIT32(NFP_FEC_DISABLED_BIT)
 
-/**
- * struct nfp_eth_table - ETH table information
- * @count:	number of table entries
- * @max_index:	max of @index fields of all @ports
- * @ports:	table of ports
- *
- * @eth_index:	port index according to legacy ethX numbering
- * @index:	chip-wide first channel index
- * @nbi:	NBI index
- * @base:	first channel index (within NBI)
- * @lanes:	number of channels
- * @speed:	interface speed (in Mbps)
- * @interface:	interface (module) plugged in
- * @media:	media type of the @interface
- * @fec:	forward error correction mode
- * @aneg:	auto negotiation mode
- * @mac_addr:	interface MAC address
- * @label_port:	port id
- * @label_subport:  id of interface within port (for split ports)
- * @enabled:	is enabled?
- * @tx_enabled:	is TX enabled?
- * @rx_enabled:	is RX enabled?
- * @override_changed: is media reconfig pending?
- *
- * @port_type:	one of %PORT_* defines for ethtool
- * @port_lanes:	total number of lanes on the port (sum of lanes of all subports)
- * @is_split:	is interface part of a split port
- * @fec_modes_supported:	bitmap of FEC modes supported
- */
+/* ETH table information */
 struct nfp_eth_table {
-	uint32_t count;
-	uint32_t max_index;
+	uint32_t count;     /**< Number of table entries */
+	uint32_t max_index; /**< Max of @index fields of all @ports */
 	struct nfp_eth_table_port {
+		/** Port index according to legacy ethX numbering */
 		uint32_t eth_index;
-		uint32_t index;
-		uint32_t nbi;
-		uint32_t base;
-		uint32_t lanes;
-		uint32_t speed;
+		uint32_t index;  /**< Chip-wide first channel index */
+		uint32_t nbi;    /**< NBI index */
+		uint32_t base;   /**< First channel index (within NBI) */
+		uint32_t lanes;  /**< Number of channels */
+		uint32_t speed;  /**< Interface speed (in Mbps) */
 
-		uint32_t interface;
-		enum nfp_eth_media media;
+		uint32_t interface;  /**< Interface (module) plugged in */
+		enum nfp_eth_media media; /**< Media type of the @interface */
 
-		enum nfp_eth_fec fec;
-		enum nfp_eth_aneg aneg;
+		enum nfp_eth_fec fec;     /**< Forward Error Correction mode */
+		enum nfp_eth_aneg aneg;   /**< Auto negotiation mode */
 
-		struct rte_ether_addr mac_addr;
+		struct rte_ether_addr mac_addr;  /**< Interface MAC address */
 
-		uint8_t label_port;
+		uint8_t label_port;    /**< Port id */
+		/** Id of interface within port (for split ports) */
 		uint8_t label_subport;
 
-		int enabled;
-		int tx_enabled;
-		int rx_enabled;
-
-		int override_changed;
+		int enabled;     /**< Enable port */
+		int tx_enabled;  /**< Enable TX */
+		int rx_enabled;  /**< Enable RX */
 
-		/* Computed fields */
-		uint8_t port_type;
+		int override_changed;  /**< Media reconfig pending */
 
+		uint8_t port_type;    /**< One of %PORT_* */
+		/** Sum of lanes of all subports of this port */
 		uint32_t port_lanes;
 
-		int is_split;
+		int is_split;   /**< Split port */
 
-		uint32_t fec_modes_supported;
-	} ports[];
+		uint32_t fec_modes_supported;  /**< Bitmap of FEC modes supported */
+	} ports[]; /**< Table of ports */
 };
 
 struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
@@ -263,28 +236,17 @@ int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode);
 int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed);
 int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes);
 
-/**
- * struct nfp_nsp_identify - NSP static information
- * @version:      opaque version string
- * @flags:        version flags
- * @br_primary:   branch id of primary bootloader
- * @br_secondary: branch id of secondary bootloader
- * @br_nsp:       branch id of NSP
- * @primary:      version of primary bootloader
- * @secondary:    version id of secondary bootloader
- * @nsp:          version id of NSP
- * @sensor_mask:  mask of present sensors available on NIC
- */
+/* NSP static information */
 struct nfp_nsp_identify {
-	char version[40];
-	uint8_t flags;
-	uint8_t br_primary;
-	uint8_t br_secondary;
-	uint8_t br_nsp;
-	uint16_t primary;
-	uint16_t secondary;
-	uint16_t nsp;
-	uint64_t sensor_mask;
+	char version[40];      /**< Opaque version string */
+	uint8_t flags;         /**< Version flags */
+	uint8_t br_primary;    /**< Branch id of primary bootloader */
+	uint8_t br_secondary;  /**< Branch id of secondary bootloader */
+	uint8_t br_nsp;        /**< Branch id of NSP */
+	uint16_t primary;      /**< Version of primary bootloader */
+	uint16_t secondary;    /**< Version id of secondary bootloader */
+	uint16_t nsp;          /**< Version id of NSP */
+	uint64_t sensor_mask;  /**< Mask of present sensors available on NIC */
 };
 
 struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 51dcf24f5f..e32884e7d3 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -263,7 +263,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 		goto err;
 	}
 
-	/* The NFP3800 NIC support 8 ports, but only 2 ports are valid,
+	/*
+	 * The NFP3800 NIC support 8 ports, but only 2 ports are valid,
 	 * the rest 6 ports mac are all 0, ensure we don't use these port
 	 */
 	for (i = 0; i < NSP_ETH_MAX_COUNT; i++) {
@@ -273,7 +274,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 			cnt++;
 	}
 
-	/* Some versions of flash will give us 0 instead of port count. For
+	/*
+	 * Some versions of flash will give us 0 instead of port count. For
 	 * those that give a port count, verify it against the value calculated
 	 * above.
 	 */
@@ -311,14 +313,16 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	return NULL;
 }
 
-/*
- * nfp_eth_read_ports() - retrieve port information
- * @cpp:	NFP CPP handle
+/**
+ * Read the port information from the device.
+ *
+ * Returned structure should be freed once no longer needed.
  *
- * Read the port information from the device.  Returned structure should
- * be freed with kfree() once no longer needed.
+ * @param cpp
+ *   NFP CPP handle
  *
- * Return: populated ETH table or NULL on error.
+ * @return
+ *   Populated ETH table or NULL on error.
  */
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
@@ -386,19 +390,19 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 	free(entries);
 }
 
-/*
- * nfp_eth_config_commit_end() - perform recorded configuration changes
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- *
+/**
  * Perform the configuration which was requested with __nfp_eth_set_*()
- * helpers and recorded in @nsp state.  If device was already configured
- * as requested or no __nfp_eth_set_*() operations were made no NSP command
+ * helpers and recorded in @nsp state. If device was already configured
+ * as requested or no __nfp_eth_set_*() operations were made, no NSP command
  * will be performed.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
@@ -416,19 +420,21 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 	return ret;
 }
 
-/*
- * nfp_eth_set_mod_enable() - set PHY module enable control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @enable:	Desired state
- *
+/**
  * Enable or disable PHY module (this usually means setting the TX lanes
  * disable bits).
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param enable
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
@@ -459,18 +465,20 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * nfp_eth_set_configured() - set PHY module configured control bit
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @configed:	Desired state
- *
+/**
  * Set the ifup/ifdown state on the PHY.
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param configured
+ *   Desired state
+ *
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_configured(struct nfp_cpp *cpp,
@@ -524,7 +532,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
-	 *	 codes were initially not populated correctly.
+	 * codes were initially not populated correctly.
 	 */
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 17) {
 		PMD_DRV_LOG(ERR, "set operations not supported, please update flash");
@@ -554,15 +562,17 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 				val, ctrl_bit);			\
 	}))
 
-/*
- * __nfp_eth_set_aneg() - set PHY autonegotiation control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired autonegotiation mode
- *
+/**
  * Allow/disallow PHY module to advertise/perform autonegotiation.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired autonegotiation mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_aneg(struct nfp_nsp *nsp,
@@ -572,15 +582,17 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
-/*
- * __nfp_eth_set_fec() - set PHY forward error correction control bit
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @mode:	Desired fec mode
- *
+/**
  * Set the PHY module forward error correction mode.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param mode
+ *   Desired fec mode
+ *
+ * @return
+ *   0 or -ERRNO
  */
 static int
 __nfp_eth_set_fec(struct nfp_nsp *nsp,
@@ -590,16 +602,20 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
-/*
- * nfp_eth_set_fec() - set PHY forward error correction control mode
- * @cpp:	NFP CPP handle
- * @idx:	NFP chip-wide port index
- * @mode:	Desired fec mode
+/**
+ * Set PHY forward error correction control mode
+ *
+ * @param cpp
+ *   NFP CPP handle
+ * @param idx
+ *   NFP chip-wide port index
+ * @param mode
+ *   Desired fec mode
  *
- * Return:
- * 0 - configuration successful;
- * 1 - no changes were needed;
- * -ERRNO - configuration failed.
+ * @return
+ *   - (0) Configuration successful
+ *   - (1) No changes were needed
+ *   - (-ERRNO) Configuration failed
  */
 int
 nfp_eth_set_fec(struct nfp_cpp *cpp,
@@ -622,17 +638,19 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 	return nfp_eth_config_commit_end(nsp);
 }
 
-/*
- * __nfp_eth_set_speed() - set interface speed/rate
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @speed:	Desired speed (per lane)
- *
- * Set lane speed.  Provided @speed value should be subport speed divided
- * by number of lanes this subport is spanning (i.e. 10000 for 40G, 25000 for
- * 50G, etc.)
+/**
+ * Set lane speed.
+ * Provided @speed value should be subport speed divided by number of
+ * lanes this subport is spanning (i.e. 10000 for 40G, 25000 for 50G, etc.)
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param speed
+ *   Desired speed (per lane)
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_speed(struct nfp_nsp *nsp,
@@ -650,15 +668,17 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp,
 			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
-/*
- * __nfp_eth_set_split() - set interface lane split
- * @nsp:	NFP NSP handle returned from nfp_eth_config_start()
- * @lanes:	Desired lanes per port
- *
+/**
  * Set number of lanes in the port.
  * Will write to hwinfo overrides in the flash (persistent config).
  *
- * Return: 0 or -ERRNO.
+ * @param nsp
+ *   NFP NSP handle returned from nfp_eth_config_start()
+ * @param lanes
+ *   Desired lanes per port
+ *
+ * @return
+ *   0 or -ERRNO
  */
 int
 __nfp_eth_set_split(struct nfp_nsp *nsp,
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 363f7d6198..bdebf5c3aa 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -22,32 +22,23 @@
 
 #define NFP_RESOURCE_ENTRY_NAME_SZ	8
 
-/*
- * struct nfp_resource_entry - Resource table entry
- * @owner:		NFP CPP Lock, interface owner
- * @key:		NFP CPP Lock, posix_crc32(name, 8)
- * @region:		Memory region descriptor
- * @name:		ASCII, zero padded name
- * @reserved
- * @cpp_action:		CPP Action
- * @cpp_token:		CPP Token
- * @cpp_target:		CPP Target ID
- * @page_offset:	256-byte page offset into target's CPP address
- * @page_size:		size, in 256-byte pages
- */
+/* Resource table entry */
 struct nfp_resource_entry {
 	struct nfp_resource_entry_mutex {
-		uint32_t owner;
-		uint32_t key;
+		uint32_t owner;  /**< NFP CPP Lock, interface owner */
+		uint32_t key;    /**< NFP CPP Lock, posix_crc32(name, 8) */
 	} mutex;
+	/* Memory region descriptor */
 	struct nfp_resource_entry_region {
+		/** ASCII, zero padded name */
 		uint8_t  name[NFP_RESOURCE_ENTRY_NAME_SZ];
 		uint8_t  reserved[5];
-		uint8_t  cpp_action;
-		uint8_t  cpp_token;
-		uint8_t  cpp_target;
+		uint8_t  cpp_action;  /**< CPP Action */
+		uint8_t  cpp_token;   /**< CPP Token */
+		uint8_t  cpp_target;  /**< CPP Target ID */
+		/** 256-byte page offset into target's CPP address */
 		uint32_t page_offset;
-		uint32_t page_size;
+		uint32_t page_size;   /**< Size, in 256-byte pages */
 	} region;
 };
 
@@ -147,14 +138,18 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp,
 	return err;
 }
 
-/*
- * nfp_resource_acquire() - Acquire a resource handle
- * @cpp:	NFP CPP handle
- * @name:	Name of the resource
+/**
+ * Acquire a resource handle
+ *
+ * Note: This function locks the acquired resource.
  *
- * NOTE: This function locks the acquired resource
+ * @param cpp
+ *   NFP CPP handle
+ * @param name
+ *   Name of the resource
  *
- * Return: NFP Resource handle, or NULL
+ * @return
+ *   NFP Resource handle, or NULL
  */
 struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
@@ -183,7 +178,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	}
 
 	wait.tv_sec = 0;
-	wait.tv_nsec = 1000000;
+	wait.tv_nsec = 1000000;    /* 1ms */
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
@@ -194,7 +189,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 			goto err_free;
 		}
 
-		if (count++ > 1000) {
+		if (count++ > 1000) {    /* 1ms * 1000 = 1s */
 			PMD_DRV_LOG(ERR, "Error: resource %s timed out", name);
 			err = -EBUSY;
 			goto err_free;
@@ -213,11 +208,13 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_resource_release() - Release a NFP Resource handle
- * @res:	NFP Resource handle
+/**
+ * Release a NFP Resource handle
  *
- * NOTE: This function implicitly unlocks the resource handle
+ * NOTE: This function implicitly unlocks the resource handle.
+ *
+ * @param res
+ *   NFP Resource handle
  */
 void
 nfp_resource_release(struct nfp_resource *res)
@@ -227,11 +224,14 @@ nfp_resource_release(struct nfp_resource *res)
 	free(res);
 }
 
-/*
- * nfp_resource_cpp_id() - Return the cpp_id of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the cpp_id of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: NFP CPP ID
+ * @return
+ *   NFP CPP ID
  */
 uint32_t
 nfp_resource_cpp_id(const struct nfp_resource *res)
@@ -239,11 +239,14 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
 	return res->cpp_id;
 }
 
-/*
- * nfp_resource_name() - Return the name of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the name of a resource handle
  *
- * Return: const char pointer to the name of the resource
+ * @param res
+ *   NFP Resource handle
+ *
+ * @return
+ *   Const char pointer to the name of the resource
  */
 const char *
 nfp_resource_name(const struct nfp_resource *res)
@@ -251,11 +254,14 @@ nfp_resource_name(const struct nfp_resource *res)
 	return res->name;
 }
 
-/*
- * nfp_resource_address() - Return the address of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the address of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Address of the resource
+ * @return
+ *   Address of the resource
  */
 uint64_t
 nfp_resource_address(const struct nfp_resource *res)
@@ -263,11 +269,14 @@ nfp_resource_address(const struct nfp_resource *res)
 	return res->addr;
 }
 
-/*
- * nfp_resource_size() - Return the size in bytes of a resource handle
- * @res:        NFP Resource handle
+/**
+ * Return the size in bytes of a resource handle
+ *
+ * @param res
+ *   NFP Resource handle
  *
- * Return: Size of the resource in bytes
+ * @return
+ *   Size of the resource in bytes
  */
 uint64_t
 nfp_resource_size(const struct nfp_resource *res)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 009b7359a4..4236950caf 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -8,43 +8,27 @@
 
 #include "nfp_cpp.h"
 
+/* Netronone Flow Firmware Table */
 #define NFP_RESOURCE_NFP_NFFW           "nfp.nffw"
+
+/* NFP Hardware Info Database */
 #define NFP_RESOURCE_NFP_HWINFO         "nfp.info"
+
+/* Service Processor */
 #define NFP_RESOURCE_NSP		"nfp.sp"
 
-/**
- * Opaque handle to a NFP Resource
- */
+/* Opaque handle to a NFP Resource */
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name);
 
-/**
- * Release a NFP Resource, and free the handle
- * @param[in]   res     NFP Resource handle
- */
 void nfp_resource_release(struct nfp_resource *res);
 
-/**
- * Return the CPP ID of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      CPP ID of the NFP Resource
- */
 uint32_t nfp_resource_cpp_id(const struct nfp_resource *res);
 
-/**
- * Return the name of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Name of the NFP Resource
- */
 const char *nfp_resource_name(const struct nfp_resource *res);
 
-/**
- * Return the target address of a NFP Resource
- * @param[in]   res     NFP Resource handle
- * @return      Address of the NFP Resource
- */
 uint64_t nfp_resource_address(const struct nfp_resource *res);
 
 uint64_t nfp_resource_size(const struct nfp_resource *res);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index d15a920752..0e6c0f9fe1 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -162,11 +162,14 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 	return NULL;
 }
 
-/*
- * nfp_rtsym_count() - Get the number of RTSYM descriptors
- * @rtbl:	NFP RTsym table
+/**
+ * Get the number of RTSYM descriptors
+ *
+ * @param rtbl
+ *   NFP RTSYM table
  *
- * Return: Number of RTSYM descriptors
+ * @return
+ *   Number of RTSYM descriptors
  */
 int
 nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
@@ -177,12 +180,16 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
 	return rtbl->num;
 }
 
-/*
- * nfp_rtsym_get() - Get the Nth RTSYM descriptor
- * @rtbl:	NFP RTsym table
- * @idx:	Index (0-based) of the RTSYM descriptor
+/**
+ * Get the Nth RTSYM descriptor
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param idx
+ *   Index (0-based) of the RTSYM descriptor
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
@@ -197,12 +204,16 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
 	return &rtbl->symtab[idx];
 }
 
-/*
- * nfp_rtsym_lookup() - Return the RTSYM descriptor for a symbol name
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
+/**
+ * Return the RTSYM descriptor for a symbol name
+ *
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
  *
- * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
+ * @return
+ *   Const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
 nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
@@ -227,7 +238,8 @@ nfp_rtsym_size(const struct nfp_rtsym *sym)
 	case NFP_RTSYM_TYPE_NONE:
 		PMD_DRV_LOG(ERR, "The type of rtsym '%s' is NONE", sym->name);
 		return 0;
-	case NFP_RTSYM_TYPE_OBJECT:    /* Fall through */
+	case NFP_RTSYM_TYPE_OBJECT:
+		/* FALLTHROUGH */
 	case NFP_RTSYM_TYPE_FUNCTION:
 		return sym->size;
 	case NFP_RTSYM_TYPE_ABS:
@@ -327,17 +339,22 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
 	return nfp_cpp_readq(cpp, cpp_id, addr, value);
 }
 
-/*
- * nfp_rtsym_read_le() - Read a simple unsigned scalar value from symbol
- * @rtbl:	NFP RTsym table
- * @name:	Symbol name
- * @error:	Pointer to error code (optional)
+/**
+ * Read a simple unsigned scalar value from symbol
  *
  * Lookup a symbol, map, read it and return it's value. Value of the symbol
  * will be interpreted as a simple little-endian unsigned value. Symbol can
  * be 4 or 8 bytes in size.
  *
- * Return: value read, on error sets the error and returns ~0ULL.
+ * @param rtbl
+ *   NFP RTSYM table
+ * @param name
+ *   Symbol name
+ * @param error
+ *   Pointer to error code (optional)
+ *
+ * @return
+ *   Value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
 nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index e7295258b3..ff1facbd17 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -31,12 +31,12 @@
  * of "sram" symbols for backward compatibility, which are viewed as global.
  */
 struct nfp_rtsym {
-	const char *name;
-	uint64_t addr;
-	uint64_t size;
-	int type;
-	int target;
-	int domain;
+	const char *name;  /**< Symbol name */
+	uint64_t addr;     /**< Address in the domain/target's address space */
+	uint64_t size;     /**< Size (in bytes) of the symbol */
+	int type;          /**< NFP_RTSYM_TYPE_* of the symbol */
+	int target;        /**< CPP target identifier, or NFP_RTSYM_TARGET_* */
+	int domain;        /**< CPP target domain */
 };
 
 struct nfp_rtsym_table;
diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c
index 611848e233..540b242a43 100644
--- a/drivers/net/nfp/nfpcore/nfp_target.c
+++ b/drivers/net/nfp/nfpcore/nfp_target.c
@@ -767,7 +767,7 @@ nfp_encode_basic(uint64_t *addr,
 		/*
 		 * Make sure we compare against isldN values by clearing the
 		 * LSB. This is what the silicon does.
-		 **/
+		 */
 		isld[0] &= ~1;
 		isld[1] &= ~1;
 
-- 
2.39.1


^ permalink raw reply	[relevance 1%]

* [PATCH 05/27] net/nfp: standard the local variable coding style
    2023-08-24 11:09  2% ` [PATCH 02/27] net/nfp: unify the indent coding style Chaoyong He
@ 2023-08-24 11:09  3% ` Chaoyong He
  2023-08-24 11:09  1% ` [PATCH 07/27] net/nfp: standard the comment style Chaoyong He
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-24 11:09 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

There should only declare one local variable in each line, and the local
variable should be arranged from short to long in the function.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 58 ++++++++++++----------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 14 +++---
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       | 27 ++++++----
 drivers/net/nfp/nfpcore/nfp_mip.c          |  8 +--
 drivers/net/nfp/nfpcore/nfp_mutex.c        | 25 ++++++----
 drivers/net/nfp/nfpcore/nfp_nffw.c         | 15 +++---
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 40 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |  8 +--
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      | 39 ++++++++-------
 drivers/net/nfp/nfpcore/nfp_resource.c     | 15 +++---
 drivers/net/nfp/nfpcore/nfp_rtsym.c        | 19 ++++---
 11 files changed, 151 insertions(+), 117 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index ec14ec45dc..78beee07ef 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -140,9 +140,9 @@ nfp_compute_bar(const struct nfp_bar *bar,
 		size_t size,
 		int width)
 {
-	uint32_t bitsize;
-	uint32_t newcfg;
 	uint64_t mask;
+	uint32_t newcfg;
+	uint32_t bitsize;
 
 	if (tgt >= 16)
 		return -EINVAL;
@@ -239,7 +239,8 @@ nfp_bar_write(struct nfp_pcie_user *nfp,
 		struct nfp_bar *bar,
 		uint32_t newcfg)
 {
-	int base, slot;
+	int base;
+	int slot;
 
 	base = bar->index >> 3;
 	slot = bar->index & 7;
@@ -268,9 +269,9 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 		size_t size,
 		int width)
 {
-	uint64_t newbase;
-	uint32_t newcfg;
 	int err;
+	uint32_t newcfg;
+	uint64_t newbase;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
 			size, width);
@@ -303,8 +304,10 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
 static int
 nfp_enable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -333,8 +336,10 @@ nfp_enable_bars(struct nfp_pcie_user *nfp)
 static struct nfp_bar *
 nfp_alloc_bar(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -356,8 +361,10 @@ nfp_alloc_bar(struct nfp_pcie_user *nfp)
 static void
 nfp_disable_bars(struct nfp_pcie_user *nfp)
 {
+	int x;
+	int end;
+	int start;
 	struct nfp_bar *bar;
-	int x, start, end;
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
 		start = NFP_BAR_MID;
@@ -403,12 +410,13 @@ nfp6000_area_init(struct nfp_cpp_area *area,
 		uint64_t address,
 		size_t size)
 {
-	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
-	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	int pp;
+	int ret = 0;
+	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	uint32_t target = NFP_CPP_ID_TARGET_of(dest);
 	uint32_t action = NFP_CPP_ID_ACTION_of(dest);
-	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
-	int pp, ret = 0;
+	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
+	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 
 	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
@@ -493,14 +501,14 @@ nfp6000_area_read(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
+	size_t n;
+	int width;
+	bool is_64;
+	uint32_t *wrptr32 = kernel_vaddr;
 	uint64_t *wrptr64 = kernel_vaddr;
-	const volatile uint64_t *rdptr64;
 	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32 = kernel_vaddr;
 	const volatile uint32_t *rdptr32;
-	int width;
-	size_t n;
-	bool is_64;
+	const volatile uint64_t *rdptr64;
 
 	priv = nfp_cpp_area_priv(area);
 	rdptr64 = (uint64_t *)(priv->iomem + offset);
@@ -563,14 +571,14 @@ nfp6000_area_write(struct nfp_cpp_area *area,
 		uint32_t offset,
 		size_t length)
 {
-	const uint64_t *rdptr64 = kernel_vaddr;
-	uint64_t *wrptr64;
-	const uint32_t *rdptr32 = kernel_vaddr;
-	struct nfp6000_area_priv *priv;
-	uint32_t *wrptr32;
-	int width;
 	size_t n;
+	int width;
 	bool is_64;
+	uint32_t *wrptr32;
+	uint64_t *wrptr64;
+	struct nfp6000_area_priv *priv;
+	const uint32_t *rdptr32 = kernel_vaddr;
+	const uint64_t *rdptr64 = kernel_vaddr;
 
 	priv = nfp_cpp_area_priv(area);
 	wrptr64 = (uint64_t *)(priv->iomem + offset);
@@ -693,10 +701,10 @@ static int
 nfp6000_set_serial(struct rte_pci_device *dev,
 		struct nfp_cpp *cpp)
 {
+	off_t pos;
 	uint16_t tmp;
 	uint8_t serial[6];
 	int serial_len = 6;
-	off_t pos;
 
 	pos = rte_pci_find_ext_capability(dev, RTE_PCI_EXT_CAP_ID_DSN);
 	if (pos <= 0) {
@@ -741,8 +749,8 @@ static int
 nfp6000_set_barsz(struct rte_pci_device *dev,
 		struct nfp_pcie_user *desc)
 {
-	uint64_t tmp;
 	int i = 0;
+	uint64_t tmp;
 
 	tmp = dev->mem_resource[0].len;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index f885e7d8ff..776842bdf6 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -172,9 +172,9 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t size)
 {
+	int err;
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
-	int err;
 
 	if (cpp == NULL)
 		return NULL;
@@ -396,8 +396,8 @@ static uint32_t
 nfp_xpb_to_cpp(struct nfp_cpp *cpp,
 		uint32_t *xpb_addr)
 {
-	uint32_t xpb;
 	int island;
+	uint32_t xpb;
 
 	xpb = NFP_CPP_ID(14, NFP_CPP_ACTION_RW, 0);
 
@@ -569,9 +569,9 @@ static struct nfp_cpp *
 nfp_cpp_alloc(struct rte_pci_device *dev,
 		int driver_lock_needed)
 {
-	const struct nfp_cpp_operations *ops;
-	struct nfp_cpp *cpp;
 	int err;
+	struct nfp_cpp *cpp;
+	const struct nfp_cpp_operations *ops;
 
 	ops = nfp_cpp_transport_operations();
 
@@ -657,8 +657,8 @@ nfp_cpp_read(struct nfp_cpp *cpp,
 		void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL) {
@@ -687,8 +687,8 @@ nfp_cpp_write(struct nfp_cpp *cpp,
 		const void *kernel_vaddr,
 		size_t length)
 {
-	struct nfp_cpp_area *area;
 	int err;
+	struct nfp_cpp_area *area;
 
 	area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length);
 	if (area == NULL)
@@ -708,8 +708,8 @@ uint32_t
 __nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
 		uint32_t *model)
 {
-	uint32_t reg;
 	int err;
+	uint32_t reg;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
 			&reg);
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index ea4c7d6a9e..819761eda0 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -36,7 +36,9 @@ static int
 nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
 		uint32_t size)
 {
-	const char *key, *val, *end = hwinfo->data + size;
+	const char *key;
+	const char *val;
+	const char *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
 			key = val + strlen(val) + 1) {
@@ -58,7 +60,9 @@ static int
 nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
 		uint32_t len)
 {
-	uint32_t size, new_crc, *crc;
+	uint32_t *crc;
+	uint32_t size;
+	uint32_t new_crc;
 
 	size = db->size;
 	if (size > len) {
@@ -82,12 +86,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
 		size_t *cpp_size)
 {
-	struct nfp_hwinfo *header;
-	void *res;
-	uint64_t cpp_addr;
-	uint32_t cpp_id;
 	int err;
+	void *res;
 	uint8_t *db;
+	uint32_t cpp_id;
+	uint64_t cpp_addr;
+	struct nfp_hwinfo *header;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NFP_HWINFO);
 	if (res) {
@@ -135,13 +139,12 @@ static struct nfp_hwinfo *
 nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 		size_t *hwdb_size)
 {
+	int count = 0;
 	struct timespec wait;
 	struct nfp_hwinfo *db;
-	int count;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 10000000;
-	count = 0;
 
 	for (;;) {
 		db = nfp_hwinfo_try_fetch(cpp, hwdb_size);
@@ -159,9 +162,9 @@ nfp_hwinfo_fetch(struct nfp_cpp *cpp,
 struct nfp_hwinfo *
 nfp_hwinfo_read(struct nfp_cpp *cpp)
 {
-	struct nfp_hwinfo *db;
-	size_t hwdb_size = 0;
 	int err;
+	size_t hwdb_size = 0;
+	struct nfp_hwinfo *db;
 
 	db = nfp_hwinfo_fetch(cpp, &hwdb_size);
 	if (db == NULL)
@@ -186,7 +189,9 @@ const char *
 nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
 		const char *lookup)
 {
-	const char *key, *val, *end;
+	const char *key;
+	const char *val;
+	const char *end;
 
 	if (hwinfo == NULL || lookup == NULL)
 		return NULL;
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index 0071d3fc37..1e601313b4 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -68,10 +68,10 @@ static int
 nfp_mip_read_resource(struct nfp_cpp *cpp,
 		struct nfp_mip *mip)
 {
-	struct nfp_nffw_info *nffw_info;
-	uint32_t cpp_id;
-	uint64_t addr;
 	int err;
+	uint64_t addr;
+	uint32_t cpp_id;
+	struct nfp_nffw_info *nffw_info;
 
 	nffw_info = nfp_nffw_info_open(cpp);
 	if (nffw_info == NULL)
@@ -100,8 +100,8 @@ nfp_mip_read_resource(struct nfp_cpp *cpp,
 struct nfp_mip *
 nfp_mip_open(struct nfp_cpp *cpp)
 {
-	struct nfp_mip *mip;
 	int err;
+	struct nfp_mip *mip;
 
 	mip = malloc(sizeof(*mip));
 	if (mip == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 4d26e6f052..05e0ff46e5 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -79,9 +79,9 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
+	int err;
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
-	int err;
 
 	err = _nfp_cpp_mutex_validate(model, &target, address);
 	if (err < 0)
@@ -122,11 +122,11 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
 		uint64_t address,
 		uint32_t key)
 {
-	uint32_t model = nfp_cpp_model(cpp);
-	struct nfp_cpp_mutex *mutex;
-	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 	int err;
 	uint32_t tmp;
+	struct nfp_cpp_mutex *mutex;
+	uint32_t model = nfp_cpp_model(cpp);
+	uint32_t mur = NFP_CPP_ID(target, 3, 0);	/* atomic_read */
 
 	/* Look for cached mutex */
 	for (mutex = cpp->mutex_cache; mutex; mutex = mutex->next) {
@@ -241,12 +241,13 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 {
-	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
-	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
+	int err;
+	uint32_t key;
+	uint32_t value;
 	struct nfp_cpp *cpp = mutex->cpp;
-	uint32_t key, value;
 	uint16_t interface = nfp_cpp_interface(cpp);
-	int err;
+	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
+	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 
 	if (mutex->depth > 1) {
 		mutex->depth--;
@@ -295,12 +296,14 @@ nfp_cpp_mutex_unlock(struct nfp_cpp_mutex *mutex)
 int
 nfp_cpp_mutex_trylock(struct nfp_cpp_mutex *mutex)
 {
+	int err;
+	uint32_t key;
+	uint32_t tmp;
+	uint32_t value;
+	struct nfp_cpp *cpp = mutex->cpp;
 	uint32_t mur = NFP_CPP_ID(mutex->target, 3, 0);	/* atomic_read */
 	uint32_t muw = NFP_CPP_ID(mutex->target, 4, 0);	/* atomic_write */
 	uint32_t mus = NFP_CPP_ID(mutex->target, 5, 3);	/* test_set_imm */
-	uint32_t key, value, tmp;
-	struct nfp_cpp *cpp = mutex->cpp;
-	int err;
 
 	if (mutex->depth > 0) {
 		if (mutex->depth == MUTEX_DEPTH_MAX)
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 7ff468373b..32e0fc94bb 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -68,9 +68,11 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi)
 static int
 nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp)
 {
-	uint32_t mode, addr40;
-	uint32_t xpbaddr, imbcppat;
 	int err;
+	uint32_t mode;
+	uint32_t addr40;
+	uint32_t xpbaddr;
+	uint32_t imbcppat;
 
 	/* Hardcoded XPB IMB Base, island 0 */
 	xpbaddr = 0x000a0000 + NFP_CPP_TARGET_MU * 4;
@@ -117,10 +119,10 @@ nffw_res_fwinfos(struct nfp_nffw_info_data *fwinf, struct nffw_fwinfo **arr)
 struct nfp_nffw_info *
 nfp_nffw_info_open(struct nfp_cpp *cpp)
 {
-	struct nfp_nffw_info_data *fwinf;
-	struct nfp_nffw_info *state;
-	uint32_t info_ver;
 	int err;
+	uint32_t info_ver;
+	struct nfp_nffw_info *state;
+	struct nfp_nffw_info_data *fwinf;
 
 	state = malloc(sizeof(*state));
 	if (state == NULL)
@@ -182,8 +184,9 @@ nfp_nffw_info_close(struct nfp_nffw_info *state)
 static struct nffw_fwinfo *
 nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
 {
+	uint32_t i;
+	uint32_t cnt;
 	struct nffw_fwinfo *fwinfo;
-	uint32_t cnt, i;
 
 	cnt = nffw_res_fwinfos(&state->fwinf, &fwinfo);
 	if (cnt == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 87eed3d951..a00bd5870d 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -72,10 +72,11 @@ nfp_nsp_print_extended_error(uint32_t ret_val)
 static int
 nfp_nsp_check(struct nfp_nsp *state)
 {
-	struct nfp_cpp *cpp = state->cpp;
-	uint64_t nsp_status, reg;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t nsp_status;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_status = nfp_resource_address(state->res) + NSP_STATUS;
@@ -113,9 +114,9 @@ nfp_nsp_check(struct nfp_nsp *state)
 struct nfp_nsp *
 nfp_nsp_open(struct nfp_cpp *cpp)
 {
-	struct nfp_resource *res;
-	struct nfp_nsp *state;
 	int err;
+	struct nfp_nsp *state;
+	struct nfp_resource *res;
 
 	res = nfp_resource_acquire(cpp, NFP_RESOURCE_NSP);
 	if (res == NULL)
@@ -170,13 +171,12 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp,
 		uint64_t mask,
 		uint64_t val)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	uint32_t count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_cpp_readq(cpp, nsp_cpp, addr, reg);
@@ -217,10 +217,15 @@ nfp_nsp_command(struct nfp_nsp *state,
 		uint32_t buff_cpp,
 		uint64_t buff_addr)
 {
-	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
-	struct nfp_cpp *cpp = state->cpp;
-	uint32_t nsp_cpp;
 	int err;
+	uint64_t reg;
+	uint32_t nsp_cpp;
+	uint64_t ret_val;
+	uint64_t nsp_base;
+	uint64_t nsp_buffer;
+	uint64_t nsp_status;
+	uint64_t nsp_command;
+	struct nfp_cpp *cpp = state->cpp;
 
 	nsp_cpp = nfp_resource_cpp_id(state->res);
 	nsp_base = nfp_resource_address(state->res);
@@ -296,11 +301,13 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 		void *out_buf,
 		unsigned int out_size)
 {
-	struct nfp_cpp *cpp = nsp->cpp;
+	int err;
+	int ret;
+	uint64_t reg;
 	size_t max_size;
-	uint64_t reg, cpp_buf;
-	int ret, err;
 	uint32_t cpp_id;
+	uint64_t cpp_buf;
+	struct nfp_cpp *cpp = nsp->cpp;
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
@@ -360,13 +367,12 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp,
 int
 nfp_nsp_wait(struct nfp_nsp *state)
 {
-	struct timespec wait;
-	uint32_t count;
 	int err;
+	int count = 0;
+	struct timespec wait;
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 25000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_nsp_command(state, SPCODE_NOOP, 0, 0, 0);
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 31677b66e6..3081e22dad 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -26,9 +26,9 @@ struct nsp_identify {
 struct nfp_nsp_identify *
 __nfp_nsp_identify(struct nfp_nsp *nsp)
 {
-	struct nfp_nsp_identify *nspi = NULL;
-	struct nsp_identify *ni;
 	int ret;
+	struct nsp_identify *ni;
+	struct nfp_nsp_identify *nspi = NULL;
 
 	if (nfp_nsp_get_abi_ver_minor(nsp) < 15)
 		return NULL;
@@ -77,9 +77,9 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
 		enum nfp_nsp_sensor_id id,
 		uint32_t *val)
 {
-	struct nfp_sensors s;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	struct nfp_sensors s;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 899fcd7441..9e8a247e5c 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -149,9 +149,10 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 		uint32_t index,
 		struct nfp_eth_table_port *dst)
 {
-	uint32_t rate;
 	uint32_t fec;
-	uint64_t port, state;
+	uint64_t port;
+	uint32_t rate;
+	uint64_t state;
 
 	port = rte_le_to_cpu_64(src->port);
 	state = rte_le_to_cpu_64(src->state);
@@ -199,7 +200,8 @@ nfp_eth_port_translate(struct nfp_nsp *nsp,
 static void
 nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 {
-	uint32_t i, j;
+	uint32_t i;
+	uint32_t j;
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
@@ -241,12 +243,13 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry)
 static struct nfp_eth_table *
 __nfp_eth_read_ports(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries;
-	struct nfp_eth_table *table;
-	uint32_t table_sz;
+	int ret;
 	uint32_t i;
 	uint32_t j;
-	int ret, cnt = 0;
+	int cnt = 0;
+	uint32_t table_sz;
+	struct nfp_eth_table *table;
+	union eth_table_entry *entries;
 	const struct rte_ether_addr *mac;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
@@ -320,8 +323,8 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 struct nfp_eth_table *
 nfp_eth_read_ports(struct nfp_cpp *cpp)
 {
-	struct nfp_eth_table *ret;
 	struct nfp_nsp *nsp;
+	struct nfp_eth_table *ret;
 
 	nsp = nfp_nsp_open(cpp);
 	if (nsp == NULL)
@@ -337,9 +340,9 @@ struct nfp_nsp *
 nfp_eth_config_start(struct nfp_cpp *cpp,
 		uint32_t idx)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	int ret;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	entries = malloc(NSP_ETH_TABLE_SIZE);
 	if (entries == NULL)
@@ -400,8 +403,8 @@ nfp_eth_config_cleanup_end(struct nfp_nsp *nsp)
 int
 nfp_eth_config_commit_end(struct nfp_nsp *nsp)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	int ret = 1;
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	if (nfp_nsp_config_modified(nsp)) {
 		ret = nfp_nsp_write_eth_table(nsp, entries, NSP_ETH_TABLE_SIZE);
@@ -432,9 +435,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int enable)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -474,9 +477,9 @@ nfp_eth_set_configured(struct nfp_cpp *cpp,
 		uint32_t idx,
 		int configed)
 {
-	union eth_table_entry *entries;
-	struct nfp_nsp *nsp;
 	uint64_t reg;
+	struct nfp_nsp *nsp;
+	union eth_table_entry *entries;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
@@ -515,9 +518,9 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp,
 		uint32_t val,
 		const uint64_t ctrl_bit)
 {
-	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
-	uint32_t idx = nfp_nsp_config_idx(nsp);
 	uint64_t reg;
+	uint32_t idx = nfp_nsp_config_idx(nsp);
+	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 
 	/*
 	 * Note: set features were added in ABI 0.14 but the error
@@ -603,8 +606,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp,
 		uint32_t idx,
 		enum nfp_eth_fec mode)
 {
-	struct nfp_nsp *nsp;
 	int err;
+	struct nfp_nsp *nsp;
 
 	nsp = nfp_eth_config_start(cpp, idx);
 	if (nsp == NULL)
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 9dd4832779..fa92f2762e 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -67,10 +67,12 @@ static int
 nfp_cpp_resource_find(struct nfp_cpp *cpp,
 		struct nfp_resource *res)
 {
-	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
+	int ret;
+	uint32_t i;
+	uint32_t key;
+	uint32_t cpp_id;
 	struct nfp_resource_entry entry;
-	uint32_t cpp_id, key;
-	int ret, i;
+	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 
 	cpp_id = NFP_CPP_ID(NFP_RESOURCE_TBL_TARGET, 3, 0);  /* Atomic read */
 
@@ -152,11 +154,11 @@ struct nfp_resource *
 nfp_resource_acquire(struct nfp_cpp *cpp,
 		const char *name)
 {
-	struct nfp_cpp_mutex *dev_mutex;
-	struct nfp_resource *res;
 	int err;
+	uint16_t count = 0;
 	struct timespec wait;
-	uint16_t count;
+	struct nfp_resource *res;
+	struct nfp_cpp_mutex *dev_mutex;
 
 	res = malloc(sizeof(*res));
 	if (res == NULL)
@@ -175,7 +177,6 @@ nfp_resource_acquire(struct nfp_cpp *cpp,
 
 	wait.tv_sec = 0;
 	wait.tv_nsec = 1000000;
-	count = 0;
 
 	for (;;) {
 		err = nfp_resource_try_acquire(cpp, res, dev_mutex);
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 243d3c9ce5..a34278beca 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -85,8 +85,8 @@ nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
 struct nfp_rtsym_table *
 nfp_rtsym_table_read(struct nfp_cpp *cpp)
 {
-	struct nfp_rtsym_table *rtbl;
 	struct nfp_mip *mip;
+	struct nfp_rtsym_table *rtbl;
 
 	mip = nfp_mip_open(cpp);
 	rtbl = __nfp_rtsym_table_read(cpp, mip);
@@ -99,13 +99,18 @@ struct nfp_rtsym_table *
 __nfp_rtsym_table_read(struct nfp_cpp *cpp,
 		const struct nfp_mip *mip)
 {
-	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
-	struct nfp_rtsym_entry *rtsymtab;
+	int n;
+	int err;
+	uint32_t size;
+	uint32_t strtab_addr;
+	uint32_t symtab_addr;
+	uint32_t strtab_size;
+	uint32_t symtab_size;
 	struct nfp_rtsym_table *cache;
+	struct nfp_rtsym_entry *rtsymtab;
 	const uint32_t dram =
 		NFP_CPP_ID(NFP_CPP_TARGET_MU, NFP_CPP_ACTION_RW, 0) |
 		NFP_ISL_EMEM0;
-	int err, n, size;
 
 	if (mip == NULL)
 		return NULL;
@@ -341,10 +346,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
 		const char *name,
 		int *error)
 {
-	const struct nfp_rtsym *sym;
-	uint32_t val32;
-	uint64_t val;
 	int err;
+	uint64_t val;
+	uint32_t val32;
+	const struct nfp_rtsym *sym;
 
 	sym = nfp_rtsym_lookup(rtbl, name);
 	if (sym == NULL) {
-- 
2.39.1


^ permalink raw reply	[relevance 3%]

* [PATCH 02/27] net/nfp: unify the indent coding style
  @ 2023-08-24 11:09  2% ` Chaoyong He
  2023-08-24 11:09  3% ` [PATCH 05/27] net/nfp: standard the local variable " Chaoyong He
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 200+ results
From: Chaoyong He @ 2023-08-24 11:09 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

Each parameter of function should occupy one line, and indent two TAB
character.
All the statement which span multi line should indent two TAB character.

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfpcore/nfp_cpp.h          |  80 +++++-----
 drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 152 ++++++++++--------
 drivers/net/nfp/nfpcore/nfp_cppcore.c      | 173 +++++++++++++--------
 drivers/net/nfp/nfpcore/nfp_hwinfo.c       |  23 +--
 drivers/net/nfp/nfpcore/nfp_mip.c          |  21 ++-
 drivers/net/nfp/nfpcore/nfp_mip.h          |   2 +-
 drivers/net/nfp/nfpcore/nfp_mutex.c        |  25 +--
 drivers/net/nfp/nfpcore/nfp_nffw.c         |   9 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c          | 108 +++++++------
 drivers/net/nfp/nfpcore/nfp_nsp.h          |  19 +--
 drivers/net/nfp/nfpcore/nfp_nsp_cmds.c     |   4 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c      |  69 ++++----
 drivers/net/nfp/nfpcore/nfp_resource.c     |  29 ++--
 drivers/net/nfp/nfpcore/nfp_resource.h     |   2 +-
 drivers/net/nfp/nfpcore/nfp_rtsym.c        |  38 +++--
 drivers/net/nfp/nfpcore/nfp_rtsym.h        |  15 +-
 16 files changed, 447 insertions(+), 322 deletions(-)

diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h
index 8f87c09327..54bef3cb6b 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp.h
+++ b/drivers/net/nfp/nfpcore/nfp_cpp.h
@@ -56,7 +56,8 @@ struct nfp_cpp_operations {
 	size_t area_priv_size;
 
 	/* Instance an NFP CPP */
-	int (*init)(struct nfp_cpp *cpp, struct rte_pci_device *dev);
+	int (*init)(struct nfp_cpp *cpp,
+			struct rte_pci_device *dev);
 
 	/*
 	 * Free the bus.
@@ -69,9 +70,9 @@ struct nfp_cpp_operations {
 	 * NOTE: This is _not_ serialized
 	 */
 	int (*area_init)(struct nfp_cpp_area *area,
-			 uint32_t dest,
-			 unsigned long long address,
-			 unsigned long size);
+			uint32_t dest,
+			unsigned long long address,
+			unsigned long size);
 	/*
 	 * Clean up a NFP CPP area before it is freed
 	 * NOTE: This is _not_ serialized
@@ -101,17 +102,17 @@ struct nfp_cpp_operations {
 	 * Serialized
 	 */
 	int (*area_read)(struct nfp_cpp_area *area,
-			 void *kernel_vaddr,
-			 unsigned long offset,
-			 unsigned int length);
+			void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 	/*
 	 * Perform a write to a NFP CPP area
 	 * Serialized
 	 */
 	int (*area_write)(struct nfp_cpp_area *area,
-			  const void *kernel_vaddr,
-			  unsigned long offset,
-			  unsigned int length);
+			const void *kernel_vaddr,
+			unsigned long offset,
+			unsigned int length);
 };
 
 /*
@@ -239,7 +240,7 @@ void nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface);
  * @param   len     Length of the serial byte array
  */
 int nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		       size_t serial_len);
+		size_t serial_len);
 
 /*
  * Set the private data of the nfp_cpp instance
@@ -279,7 +280,7 @@ uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev,
-					 int driver_lock_needed);
+		int driver_lock_needed);
 
 /*
  * Free a NFP CPP handle
@@ -397,8 +398,7 @@ int nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
-					unsigned long long address,
-					unsigned long size);
+		unsigned long long address, unsigned long size);
 
 /*
  * Allocate a NFP CPP area handle, as an offset into a CPP ID, by a named owner
@@ -411,10 +411,8 @@ struct nfp_cpp_area *nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
-						  uint32_t cpp_id,
-						  const char *name,
-						  unsigned long long address,
-						  unsigned long size);
+		uint32_t cpp_id, const char *name, unsigned long long address,
+		unsigned long size);
 
 /*
  * Free an allocated NFP CPP area handle
@@ -448,9 +446,7 @@ void nfp_cpp_area_release(struct nfp_cpp_area *area);
  * @return NFP CPP handle, or NULL on failure.
  */
 struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
-						uint32_t cpp_id,
-						unsigned long long address,
-						unsigned long size);
+		uint32_t cpp_id, unsigned long long address, unsigned long size);
 
 /*
  * Release the resources, then free the NFP CPP area handle
@@ -459,8 +455,7 @@ struct nfp_cpp_area *nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
 void nfp_cpp_area_release_free(struct nfp_cpp_area *area);
 
 uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id,
-			   uint64_t addr, unsigned long size,
-			   struct nfp_cpp_area **area);
+		uint64_t addr, unsigned long size, struct nfp_cpp_area **area);
 /*
  * Return an IO pointer to the beginning of the NFP CPP area handle. The area
  * must be acquired with 'nfp_cpp_area_acquire()' before calling this operation.
@@ -484,7 +479,7 @@ void *nfp_cpp_area_mapped(struct nfp_cpp_area *area);
  *
  */
 int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		      void *buffer, size_t length);
+		void *buffer, size_t length);
 
 /*
  * Write to a NFP CPP area handle from a buffer. The area must be acquired with
@@ -498,7 +493,7 @@ int nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		       const void *buffer, size_t length);
+		const void *buffer, size_t length);
 
 /*
  * nfp_cpp_area_iomem() - get IOMEM region for CPP area
@@ -522,7 +517,7 @@ void *nfp_cpp_area_iomem(struct nfp_cpp_area *area);
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_area_check_range(struct nfp_cpp_area *area,
-			     unsigned long long offset, unsigned long size);
+		unsigned long long offset, unsigned long size);
 
 /*
  * Get the NFP CPP handle that is the parent of a NFP CPP area handle
@@ -552,7 +547,7 @@ const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area);
  * @return bytes read on success, -1 on failure.
  */
 int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
-		 unsigned long long address, void *kernel_vaddr, size_t length);
+		unsigned long long address, void *kernel_vaddr, size_t length);
 
 /*
  * Write a block of data to a NFP CPP ID
@@ -566,8 +561,8 @@ int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, -1 on failure.
  */
 int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, const void *kernel_vaddr,
-		  size_t length);
+		unsigned long long address, const void *kernel_vaddr,
+		size_t length);
 
 
 
@@ -582,7 +577,7 @@ int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return bytes written on success, negative value on failure.
  */
 int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		      uint32_t value, size_t length);
+		uint32_t value, size_t length);
 
 /*
  * Read a single 32-bit value from a NFP CPP area handle
@@ -599,7 +594,7 @@ int nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		       uint32_t *value);
+		uint32_t *value);
 
 /*
  * Write a single 32-bit value to a NFP CPP area handle
@@ -616,7 +611,7 @@ int nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-			uint32_t value);
+		uint32_t value);
 
 /*
  * Read a single 64-bit value from a NFP CPP area handle
@@ -633,7 +628,7 @@ int nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		       uint64_t *value);
+		uint64_t *value);
 
 /*
  * Write a single 64-bit value to a NFP CPP area handle
@@ -650,7 +645,7 @@ int nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
  * @return 0 on success, or -1 on error.
  */
 int nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-			uint64_t value);
+		uint64_t value);
 
 /*
  * Write a single 32-bit value on the XPB bus
@@ -685,7 +680,7 @@ int nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t *value);
  * @return 0 on success, or -1 on failure.
  */
 int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		    uint32_t value);
+		uint32_t value);
 
 /*
  * Modify bits of a 32-bit value from the XPB bus
@@ -699,7 +694,7 @@ int nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, negative value on failure.
  */
 int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-		   uint32_t value, int timeout_us);
+		uint32_t value, int timeout_us);
 
 /*
  * Read a 32-bit word from a NFP CPP ID
@@ -712,7 +707,7 @@ int nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint32_t *value);
+		unsigned long long address, uint32_t *value);
 
 /*
  * Write a 32-bit value to a NFP CPP ID
@@ -726,7 +721,7 @@ int nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id,
  *
  */
 int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint32_t value);
+		unsigned long long address, uint32_t value);
 
 /*
  * Read a 64-bit work from a NFP CPP ID
@@ -739,7 +734,7 @@ int nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		  unsigned long long address, uint64_t *value);
+		unsigned long long address, uint64_t *value);
 
 /*
  * Write a 64-bit value to a NFP CPP ID
@@ -752,7 +747,7 @@ int nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, or -1 on failure.
  */
 int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
-		   unsigned long long address, uint64_t value);
+		unsigned long long address, uint64_t value);
 
 /*
  * Initialize a mutex location
@@ -773,7 +768,7 @@ int nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id,
  * @return 0 on success, negative value on failure.
  */
 int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
-		       unsigned long long address, uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Create a mutex handle from an address controlled by a MU Atomic engine
@@ -793,8 +788,7 @@ int nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target,
  *                      failure.
  */
 struct nfp_cpp_mutex *nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-					  unsigned long long address,
-					  uint32_t key_id);
+		unsigned long long address, uint32_t key_id);
 
 /*
  * Get the NFP CPP handle the mutex was created with
diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
index 2ee60eefc3..884cc84eaa 100644
--- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
+++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c
@@ -130,9 +130,15 @@ nfp_bar_maptype(struct nfp_bar *bar)
 #define TARGET_WIDTH_64    8
 
 static int
-nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
-		uint64_t *bar_base, int tgt, int act, int tok,
-		uint64_t offset, size_t size, int width)
+nfp_compute_bar(const struct nfp_bar *bar,
+		uint32_t *bar_config,
+		uint64_t *bar_base,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint32_t bitsize;
 	uint32_t newcfg;
@@ -143,19 +149,16 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 
 	switch (width) {
 	case 8:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_64BIT);
 		break;
 	case 4:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_32BIT);
 		break;
 	case 0:
-		newcfg =
-		    NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
-		    (NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
+		newcfg = NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT
+				(NFP_PCIE_BAR_PCIE2CPP_LENGTHSELECT_0BYTE);
 		break;
 	default:
 		return -EINVAL;
@@ -165,60 +168,58 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 		/* Fixed CPP mapping with specific action */
 		mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1);
 
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for Fixed mapping <%#llx,%#llx>, action=%d BAR too small (0x%llx)",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size), act,
-				    (unsigned long long)mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size), act,
+					(unsigned long long)mask);
 			return -EINVAL;
 		}
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created Fixed mapping %d:%d:%d:0x%#llx-0x%#llx>",
-			    bar->index, tgt, act, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + mask));
+				bar->index, tgt, act, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + mask));
 
 		bitsize = 40 - 16;
 	} else {
 		mask = ~(NFP_PCIE_P2C_BULK_SIZE(bar) - 1);
 
 		/* Bulk mapping */
-		newcfg |=
-		    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
-		    (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
+		newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE
+				(NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK);
 
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt);
 		newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok);
 
 		if ((offset & mask) != ((offset + size - 1) & mask)) {
 			PMD_DRV_LOG(ERR, "BAR%d: Won't use for bulk mapping <%#llx,%#llx> target=%d, token=%d BAR too small (%#llx) - (%#llx != %#llx).",
-				    bar->index, (unsigned long long)offset,
-				    (unsigned long long)(offset + size),
-				    tgt, tok, (unsigned long long)mask,
-				    (unsigned long long)(offset & mask),
-				    (unsigned long long)(offset + size - 1) & mask);
+					bar->index, (unsigned long long)offset,
+					(unsigned long long)(offset + size),
+					tgt, tok, (unsigned long long)mask,
+					(unsigned long long)(offset & mask),
+					(unsigned long long)(offset + size - 1) & mask);
 			return -EINVAL;
 		}
 
 		offset &= mask;
 
 		PMD_DRV_LOG(DEBUG, "BAR%d: Created bulk mapping %d:x:%d:%#llx-%#llx",
-			    bar->index, tgt, tok, (unsigned long long)offset,
-			    (unsigned long long)(offset + ~mask));
+				bar->index, tgt, tok, (unsigned long long)offset,
+				(unsigned long long)(offset + ~mask));
 
 		bitsize = 40 - 21;
 	}
 
 	if (bar->bitsize < bitsize) {
 		PMD_DRV_LOG(ERR, "BAR%d: Too small for %d:%d:%d", bar->index,
-			    tgt, tok, act);
+				tgt, tok, act);
 		return -EINVAL;
 	}
 
@@ -234,8 +235,9 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config,
 }
 
 static int
-nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
-		  uint32_t newcfg)
+nfp_bar_write(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		uint32_t newcfg)
 {
 	int base, slot;
 
@@ -246,7 +248,7 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 		return (-ENOMEM);
 
 	bar->csr = nfp->cfg +
-		   NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
+			NFP_PCIE_CFG_BAR_PCIETOCPPEXPBAR(nfp->dev_id, base, slot);
 
 	*(uint32_t *)(bar->csr) = newcfg;
 
@@ -257,15 +259,21 @@ nfp_bar_write(struct nfp_pcie_user *nfp, struct nfp_bar *bar,
 }
 
 static int
-nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, int tgt,
-		int act, int tok, uint64_t offset, size_t size, int width)
+nfp_reconfigure_bar(struct nfp_pcie_user *nfp,
+		struct nfp_bar *bar,
+		int tgt,
+		int act,
+		int tok,
+		uint64_t offset,
+		size_t size,
+		int width)
 {
 	uint64_t newbase;
 	uint32_t newcfg;
 	int err;
 
 	err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset,
-			      size, width);
+			size, width);
 	if (err != 0)
 		return err;
 
@@ -390,8 +398,10 @@ struct nfp6000_area_priv {
 };
 
 static int
-nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
-		  unsigned long long address, unsigned long size)
+nfp6000_area_init(struct nfp_cpp_area *area,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_pcie_user *nfp = nfp_cpp_priv(nfp_cpp_area_cpp(area));
 	struct nfp6000_area_priv *priv = nfp_cpp_area_priv(area);
@@ -400,8 +410,7 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	uint32_t token = NFP_CPP_ID_TOKEN_of(dest);
 	int pp, ret = 0;
 
-	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token),
-				     address);
+	pp = nfp_target_pushpull(NFP_CPP_ID(target, action, token), address);
 	if (pp < 0)
 		return pp;
 
@@ -409,7 +418,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->width.write = PULL_WIDTH(pp);
 
 	if (priv->width.read > 0 &&
-	    priv->width.write > 0 && priv->width.read != priv->width.write)
+			priv->width.write > 0 &&
+			priv->width.read != priv->width.write)
 		return -EINVAL;
 
 	if (priv->width.read > 0)
@@ -428,8 +438,8 @@ nfp6000_area_init(struct nfp_cpp_area *area, uint32_t dest,
 	priv->size = size;
 
 	ret = nfp_reconfigure_bar(nfp, priv->bar, priv->target, priv->action,
-				  priv->token, priv->offset, priv->size,
-				  priv->width.bar);
+			priv->token, priv->offset, priv->size,
+			priv->width.bar);
 
 	return ret;
 }
@@ -441,14 +451,13 @@ nfp6000_area_acquire(struct nfp_cpp_area *area)
 
 	/* Calculate offset into BAR. */
 	if (nfp_bar_maptype(priv->bar) ==
-	    NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
+			NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_GENERAL) {
 		priv->bar_offset = priv->offset &
-			(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
-		priv->bar_offset +=
-			NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
-							   priv->target);
-		priv->bar_offset +=
-		    NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar, priv->token);
+				(NFP_PCIE_P2C_GENERAL_SIZE(priv->bar) - 1);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TARGET_OFFSET(priv->bar,
+				priv->target);
+		priv->bar_offset += NFP_PCIE_P2C_GENERAL_TOKEN_OFFSET(priv->bar,
+				priv->token);
 	} else {
 		priv->bar_offset = priv->offset & priv->bar->mask;
 	}
@@ -490,8 +499,10 @@ nfp6000_area_iomem(struct nfp_cpp_area *area)
 }
 
 static int
-nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
-		  unsigned long offset, unsigned int length)
+nfp6000_area_read(struct nfp_cpp_area *area,
+		void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	uint64_t *wrptr64 = kernel_vaddr;
 	const volatile uint64_t *rdptr64;
@@ -524,17 +535,17 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 
 	/* MU reads via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW) {
+			priv->action == NFP_CPP_ACTION_RW) {
 		is_64 = false;
 	}
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -558,8 +569,10 @@ nfp6000_area_read(struct nfp_cpp_area *area, void *kernel_vaddr,
 }
 
 static int
-nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
-		   unsigned long offset, unsigned int length)
+nfp6000_area_write(struct nfp_cpp_area *area,
+		const void *kernel_vaddr,
+		unsigned long offset,
+		unsigned int length)
 {
 	const uint64_t *rdptr64 = kernel_vaddr;
 	uint64_t *wrptr64;
@@ -590,16 +603,16 @@ nfp6000_area_write(struct nfp_cpp_area *area, const void *kernel_vaddr,
 
 	/* MU writes via a PCIe2CPP BAR supports 32bit (and other) lengths */
 	if (priv->target == (NFP_CPP_TARGET_ID_MASK & NFP_CPP_TARGET_MU) &&
-	    priv->action == NFP_CPP_ACTION_RW)
+			priv->action == NFP_CPP_ACTION_RW)
 		is_64 = false;
 
 	if (is_64) {
 		if (offset % sizeof(uint64_t) != 0 ||
-		    length % sizeof(uint64_t) != 0)
+				length % sizeof(uint64_t) != 0)
 			return -EINVAL;
 	} else {
 		if (offset % sizeof(uint32_t) != 0 ||
-		    length % sizeof(uint32_t) != 0)
+				length % sizeof(uint32_t) != 0)
 			return -EINVAL;
 	}
 
@@ -655,7 +668,8 @@ nfp_acquire_process_lock(struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_model(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint32_t model;
 
@@ -671,7 +685,8 @@ nfp6000_set_model(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_interface(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t interface;
 
@@ -686,7 +701,8 @@ nfp6000_set_interface(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
+nfp6000_set_serial(struct rte_pci_device *dev,
+		struct nfp_cpp *cpp)
 {
 	uint16_t tmp;
 	uint8_t serial[6];
@@ -733,7 +749,8 @@ nfp6000_set_serial(struct rte_pci_device *dev, struct nfp_cpp *cpp)
 }
 
 static int
-nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
+nfp6000_set_barsz(struct rte_pci_device *dev,
+		struct nfp_pcie_user *desc)
 {
 	unsigned long tmp;
 	int i = 0;
@@ -748,7 +765,8 @@ nfp6000_set_barsz(struct rte_pci_device *dev, struct nfp_pcie_user *desc)
 }
 
 static int
-nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
+nfp6000_init(struct nfp_cpp *cpp,
+		struct rte_pci_device *dev)
 {
 	int ret = 0;
 	struct nfp_pcie_user *desc;
@@ -762,7 +780,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev)
 	strlcpy(desc->busdev, dev->device.name, sizeof(desc->busdev));
 
 	if (rte_eal_process_type() == RTE_PROC_PRIMARY &&
-	    cpp->driver_lock_needed) {
+			cpp->driver_lock_needed) {
 		ret = nfp_acquire_process_lock(desc);
 		if (ret != 0)
 			goto error;
diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c
index 2c6ec3e126..25f7700b08 100644
--- a/drivers/net/nfp/nfpcore/nfp_cppcore.c
+++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c
@@ -27,7 +27,8 @@
 						NFP_PL_DEVICE_ID_MASK)
 
 void
-nfp_cpp_priv_set(struct nfp_cpp *cpp, void *priv)
+nfp_cpp_priv_set(struct nfp_cpp *cpp,
+		void *priv)
 {
 	cpp->priv = priv;
 }
@@ -39,7 +40,8 @@ nfp_cpp_priv(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_model_set(struct nfp_cpp *cpp, uint32_t model)
+nfp_cpp_model_set(struct nfp_cpp *cpp,
+		uint32_t model)
 {
 	cpp->model = model;
 }
@@ -62,21 +64,24 @@ nfp_cpp_model(struct nfp_cpp *cpp)
 }
 
 void
-nfp_cpp_interface_set(struct nfp_cpp *cpp, uint32_t interface)
+nfp_cpp_interface_set(struct nfp_cpp *cpp,
+		uint32_t interface)
 {
 	cpp->interface = interface;
 }
 
 int
-nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial)
+nfp_cpp_serial(struct nfp_cpp *cpp,
+		const uint8_t **serial)
 {
 	*serial = cpp->serial;
 	return cpp->serial_len;
 }
 
 int
-nfp_cpp_serial_set(struct nfp_cpp *cpp, const uint8_t *serial,
-		   size_t serial_len)
+nfp_cpp_serial_set(struct nfp_cpp *cpp,
+		const uint8_t *serial,
+		size_t serial_len)
 {
 	if (cpp->serial_len)
 		free(cpp->serial);
@@ -161,9 +166,11 @@ nfp_cpp_mu_locality_lsb(struct nfp_cpp *cpp)
  * NOTE: @address and @size must be 32-bit aligned values.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
-			      const char *name, unsigned long long address,
-			      unsigned long size)
+nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp,
+		uint32_t dest,
+		const char *name,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 	uint64_t tmp64 = (uint64_t)address;
@@ -183,7 +190,7 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 		name = "";
 
 	area = calloc(1, sizeof(*area) + cpp->op->area_priv_size +
-		      strlen(name) + 1);
+			strlen(name) + 1);
 	if (area == NULL)
 		return NULL;
 
@@ -204,8 +211,10 @@ nfp_cpp_area_alloc_with_name(struct nfp_cpp *cpp, uint32_t dest,
 }
 
 struct nfp_cpp_area *
-nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
-		    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc(struct nfp_cpp *cpp,
+		uint32_t dest,
+		unsigned long long address,
+		unsigned long size)
 {
 	return nfp_cpp_area_alloc_with_name(cpp, dest, NULL, address, size);
 }
@@ -226,8 +235,10 @@ nfp_cpp_area_alloc(struct nfp_cpp *cpp, uint32_t dest,
  * NOTE: The area must also be 'released' when the structure is freed.
  */
 struct nfp_cpp_area *
-nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp, uint32_t destination,
-			    unsigned long long address, unsigned long size)
+nfp_cpp_area_alloc_acquire(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		unsigned long size)
 {
 	struct nfp_cpp_area *area;
 
@@ -340,8 +351,10 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area)
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
-		  void *kernel_vaddr, size_t length)
+nfp_cpp_area_read(struct nfp_cpp_area *area,
+		unsigned long offset,
+		void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -364,8 +377,10 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, unsigned long offset,
  * NOTE: Area must have been locked down with an 'acquire'.
  */
 int
-nfp_cpp_area_write(struct nfp_cpp_area *area, unsigned long offset,
-		   const void *kernel_vaddr, size_t length)
+nfp_cpp_area_write(struct nfp_cpp_area *area,
+		unsigned long offset,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	if ((offset + length) > area->size)
 		return -EFAULT;
@@ -392,8 +407,9 @@ nfp_cpp_area_mapped(struct nfp_cpp_area *area)
  * or negative value on error.
  */
 int
-nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
-			 unsigned long length)
+nfp_cpp_area_check_range(struct nfp_cpp_area *area,
+		unsigned long long offset,
+		unsigned long length)
 {
 	if (((offset + length) > area->size))
 		return -EFAULT;
@@ -406,7 +422,8 @@ nfp_cpp_area_check_range(struct nfp_cpp_area *area, unsigned long long offset,
  * based upon NFP model.
  */
 static uint32_t
-nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
+nfp_xpb_to_cpp(struct nfp_cpp *cpp,
+		uint32_t *xpb_addr)
 {
 	uint32_t xpb;
 	int island;
@@ -433,7 +450,7 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 		else
 			/* And only non-ARM interfaces use island id = 1 */
 			if (NFP_CPP_INTERFACE_TYPE_of(nfp_cpp_interface(cpp)) !=
-			    NFP_CPP_INTERFACE_TYPE_ARM)
+					NFP_CPP_INTERFACE_TYPE_ARM)
 				*xpb_addr |= (1 << 24);
 	} else {
 		(*xpb_addr) |= (1 << 30);
@@ -443,8 +460,9 @@ nfp_xpb_to_cpp(struct nfp_cpp *cpp, uint32_t *xpb_addr)
 }
 
 int
-nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
-		   uint32_t *value)
+nfp_cpp_area_readl(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp = 0;
@@ -456,8 +474,9 @@ nfp_cpp_area_readl(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
-		    uint32_t value)
+nfp_cpp_area_writel(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value)
 {
 	int sz;
 
@@ -467,8 +486,9 @@ nfp_cpp_area_writel(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
-		   uint64_t *value)
+nfp_cpp_area_readq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp = 0;
@@ -480,8 +500,9 @@ nfp_cpp_area_readq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
-		    uint64_t value)
+nfp_cpp_area_writeq(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint64_t value)
 {
 	int sz;
 
@@ -492,8 +513,10 @@ nfp_cpp_area_writeq(struct nfp_cpp_area *area, unsigned long offset,
 }
 
 int
-nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint32_t *value)
+nfp_cpp_readl(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t *value)
 {
 	int sz;
 	uint32_t tmp;
@@ -505,8 +528,10 @@ nfp_cpp_readl(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint32_t value)
+nfp_cpp_writel(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint32_t value)
 {
 	int sz;
 
@@ -517,8 +542,10 @@ nfp_cpp_writel(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	      uint64_t *value)
+nfp_cpp_readq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t *value)
 {
 	int sz;
 	uint64_t tmp;
@@ -530,8 +557,10 @@ nfp_cpp_readq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
-	       uint64_t value)
+nfp_cpp_writeq(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		unsigned long long address,
+		uint64_t value)
 {
 	int sz;
 
@@ -542,7 +571,9 @@ nfp_cpp_writeq(struct nfp_cpp *cpp, uint32_t cpp_id, unsigned long long address,
 }
 
 int
-nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
+nfp_xpb_writel(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t value)
 {
 	uint32_t cpp_dest;
 
@@ -552,7 +583,9 @@ nfp_xpb_writel(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t value)
 }
 
 int
-nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
+nfp_xpb_readl(struct nfp_cpp *cpp,
+		uint32_t xpb_addr,
+		uint32_t *value)
 {
 	uint32_t cpp_dest;
 
@@ -562,7 +595,8 @@ nfp_xpb_readl(struct nfp_cpp *cpp, uint32_t xpb_addr, uint32_t *value)
 }
 
 static struct nfp_cpp *
-nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_alloc(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	const struct nfp_cpp_operations *ops;
 	struct nfp_cpp *cpp;
@@ -596,7 +630,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed)
 			/* Hardcoded XPB IMB Base, island 0 */
 			xpbaddr = 0x000a0000 + (tgt * 4);
 			err = nfp_xpb_readl(cpp, xpbaddr,
-				(uint32_t *)&cpp->imb_cat_table[tgt]);
+					(uint32_t *)&cpp->imb_cat_table[tgt]);
 			if (err < 0) {
 				free(cpp);
 				return NULL;
@@ -631,7 +665,8 @@ nfp_cpp_free(struct nfp_cpp *cpp)
 }
 
 struct nfp_cpp *
-nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
+nfp_cpp_from_device_name(struct rte_pci_device *dev,
+		int driver_lock_needed)
 {
 	return nfp_cpp_alloc(dev, driver_lock_needed);
 }
@@ -647,7 +682,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed)
  * @return 0 on success, or -1 on failure.
  */
 int
-nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
+nfp_xpb_writelm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
 		uint32_t value)
 {
 	int err;
@@ -674,8 +711,11 @@ nfp_xpb_writelm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @return >= 0 on success, or negative value on failure.
  */
 int
-nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
-	       uint32_t value, int timeout_us)
+nfp_xpb_waitlm(struct nfp_cpp *cpp,
+		uint32_t xpb_tgt,
+		uint32_t mask,
+		uint32_t value,
+		int timeout_us)
 {
 	uint32_t tmp;
 	int err;
@@ -716,8 +756,11 @@ nfp_xpb_waitlm(struct nfp_cpp *cpp, uint32_t xpb_tgt, uint32_t mask,
  * @length:     number of bytes to read
  */
 int
-nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
-	     unsigned long long address, void *kernel_vaddr, size_t length)
+nfp_cpp_read(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -743,9 +786,11 @@ nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     number of bytes to write
  */
 int
-nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
-	      unsigned long long address, const void *kernel_vaddr,
-	      size_t length)
+nfp_cpp_write(struct nfp_cpp *cpp,
+		uint32_t destination,
+		unsigned long long address,
+		const void *kernel_vaddr,
+		size_t length)
 {
 	struct nfp_cpp_area *area;
 	int err;
@@ -768,8 +813,10 @@ nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination,
  * @length:     length of area to fill
  */
 int
-nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
-		  uint32_t value, size_t length)
+nfp_cpp_area_fill(struct nfp_cpp_area *area,
+		unsigned long offset,
+		uint32_t value,
+		size_t length)
 {
 	int err;
 	size_t i;
@@ -795,9 +842,8 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	for (i = 0; (i + sizeof(value)) < length; i += sizeof(value64)) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value64,
-				       sizeof(value64));
+		err = nfp_cpp_area_write(area, offset + i, &value64,
+				sizeof(value64));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value64))
@@ -805,8 +851,7 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
 	}
 
 	if ((i + sizeof(value)) <= length) {
-		err =
-		    nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
+		err = nfp_cpp_area_write(area, offset + i, &value, sizeof(value));
 		if (err < 0)
 			return err;
 		if (err != sizeof(value))
@@ -822,13 +867,14 @@ nfp_cpp_area_fill(struct nfp_cpp_area *area, unsigned long offset,
  * as those are model-specific
  */
 uint32_t
-__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
+__nfp_cpp_model_autodetect(struct nfp_cpp *cpp,
+		uint32_t *model)
 {
 	uint32_t reg;
 	int err;
 
 	err = nfp_xpb_readl(cpp, NFP_XPB_DEVICE(1, 1, 16) + NFP_PL_DEVICE_ID,
-			    &reg);
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -853,8 +899,11 @@ __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model)
  * Return: Pointer to memory mapped area or NULL
  */
 uint8_t *
-nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 unsigned long size, struct nfp_cpp_area **area)
+nfp_cpp_map_area(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		unsigned long size,
+		struct nfp_cpp_area **area)
 {
 	uint8_t *res;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.c b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
index a9d166c4dc..ea4c7d6a9e 100644
--- a/drivers/net/nfp/nfpcore/nfp_hwinfo.c
+++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.c
@@ -33,12 +33,13 @@ nfp_hwinfo_is_updating(struct nfp_hwinfo *hwinfo)
 }
 
 static int
-nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
+nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo,
+		uint32_t size)
 {
 	const char *key, *val, *end = hwinfo->data + size;
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 		if (val >= end) {
 			PMD_DRV_LOG(ERR, "Bad HWINFO - overflowing value");
@@ -54,7 +55,8 @@ nfp_hwinfo_db_walk(struct nfp_hwinfo *hwinfo, uint32_t size)
 }
 
 static int
-nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
+nfp_hwinfo_db_validate(struct nfp_hwinfo *db,
+		uint32_t len)
 {
 	uint32_t size, new_crc, *crc;
 
@@ -69,7 +71,7 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 	crc = (uint32_t *)(db->start + size);
 	if (new_crc != *crc) {
 		PMD_DRV_LOG(ERR, "Corrupt hwinfo table (CRC mismatch) calculated 0x%x, expected 0x%x",
-			    new_crc, *crc);
+				new_crc, *crc);
 		return -EINVAL;
 	}
 
@@ -77,7 +79,8 @@ nfp_hwinfo_db_validate(struct nfp_hwinfo *db, uint32_t len)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
+nfp_hwinfo_try_fetch(struct nfp_cpp *cpp,
+		size_t *cpp_size)
 {
 	struct nfp_hwinfo *header;
 	void *res;
@@ -115,7 +118,7 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 
 	if (header->version != NFP_HWINFO_VERSION_2) {
 		PMD_DRV_LOG(DEBUG, "Unknown HWInfo version: 0x%08x",
-			header->version);
+				header->version);
 		goto exit_free;
 	}
 
@@ -129,7 +132,8 @@ nfp_hwinfo_try_fetch(struct nfp_cpp *cpp, size_t *cpp_size)
 }
 
 static struct nfp_hwinfo *
-nfp_hwinfo_fetch(struct nfp_cpp *cpp, size_t *hwdb_size)
+nfp_hwinfo_fetch(struct nfp_cpp *cpp,
+		size_t *hwdb_size)
 {
 	struct timespec wait;
 	struct nfp_hwinfo *db;
@@ -179,7 +183,8 @@ nfp_hwinfo_read(struct nfp_cpp *cpp)
  * Return: Value of the HWInfo name, or NULL
  */
 const char *
-nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
+nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo,
+		const char *lookup)
 {
 	const char *key, *val, *end;
 
@@ -189,7 +194,7 @@ nfp_hwinfo_lookup(struct nfp_hwinfo *hwinfo, const char *lookup)
 	end = hwinfo->data + hwinfo->size - sizeof(uint32_t);
 
 	for (key = hwinfo->data; *key != 0 && key < end;
-	     key = val + strlen(val) + 1) {
+			key = val + strlen(val) + 1) {
 		val = key + strlen(key) + 1;
 
 		if (strcmp(key, lookup) == 0)
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.c b/drivers/net/nfp/nfpcore/nfp_mip.c
index f9723dd136..0071d3fc37 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.c
+++ b/drivers/net/nfp/nfpcore/nfp_mip.c
@@ -37,8 +37,10 @@ struct nfp_mip {
 
 /* Read memory and check if it could be a valid MIP */
 static int
-nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
-		 struct nfp_mip *mip)
+nfp_mip_try_read(struct nfp_cpp *cpp,
+		uint32_t cpp_id,
+		uint64_t addr,
+		struct nfp_mip *mip)
 {
 	int ret;
 
@@ -49,12 +51,12 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 	}
 	if (mip->signature != NFP_MIP_SIGNATURE) {
 		PMD_DRV_LOG(ERR, "Incorrect MIP signature (0x%08x)",
-			    rte_le_to_cpu_32(mip->signature));
+				rte_le_to_cpu_32(mip->signature));
 		return -EINVAL;
 	}
 	if (mip->mip_version != NFP_MIP_VERSION) {
 		PMD_DRV_LOG(ERR, "Unsupported MIP version (%d)",
-			    rte_le_to_cpu_32(mip->mip_version));
+				rte_le_to_cpu_32(mip->mip_version));
 		return -EINVAL;
 	}
 
@@ -63,7 +65,8 @@ nfp_mip_try_read(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr,
 
 /* Try to locate MIP using the resource table */
 static int
-nfp_mip_read_resource(struct nfp_cpp *cpp, struct nfp_mip *mip)
+nfp_mip_read_resource(struct nfp_cpp *cpp,
+		struct nfp_mip *mip)
 {
 	struct nfp_nffw_info *nffw_info;
 	uint32_t cpp_id;
@@ -134,7 +137,9 @@ nfp_mip_name(const struct nfp_mip *mip)
  * @size:	Location for size of MIP symbol table
  */
 void
-nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_symtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->symtab_addr);
 	*size = rte_le_to_cpu_32(mip->symtab_size);
@@ -147,7 +152,9 @@ nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
  * @size:	Location for size of MIP symbol name table
  */
 void
-nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size)
+nfp_mip_strtab(const struct nfp_mip *mip,
+		uint32_t *addr,
+		uint32_t *size)
 {
 	*addr = rte_le_to_cpu_32(mip->strtab_addr);
 	*size = rte_le_to_cpu_32(mip->strtab_size);
diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h
index d0919b58fe..980abc2517 100644
--- a/drivers/net/nfp/nfpcore/nfp_mip.h
+++ b/drivers/net/nfp/nfpcore/nfp_mip.h
@@ -17,5 +17,5 @@ const char *nfp_mip_name(const struct nfp_mip *mip);
 void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size);
 int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			    uint64_t *off);
+		uint64_t *off);
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c
index 0410a00856..047e755416 100644
--- a/drivers/net/nfp/nfpcore/nfp_mutex.c
+++ b/drivers/net/nfp/nfpcore/nfp_mutex.c
@@ -35,7 +35,9 @@ struct nfp_cpp_mutex {
 };
 
 static int
-_nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
+_nfp_cpp_mutex_validate(uint32_t model,
+		int *target,
+		unsigned long long address)
 {
 	/* Address must be 64-bit aligned */
 	if ((address & 7) != 0)
@@ -72,8 +74,10 @@ _nfp_cpp_mutex_validate(uint32_t model, int *target, unsigned long long address)
  * @return 0 on success, or negative value on failure.
  */
 int
-nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
-		   uint32_t key)
+nfp_cpp_mutex_init(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	uint32_t muw = NFP_CPP_ID(target, 4, 0);	/* atomic_write */
@@ -87,9 +91,8 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
 	if (err < 0)
 		return err;
 
-	err =
-	    nfp_cpp_writel(cpp, muw, address + 0,
-			   MUTEX_LOCKED(nfp_cpp_interface(cpp)));
+	err = nfp_cpp_writel(cpp, muw, address + 0,
+			MUTEX_LOCKED(nfp_cpp_interface(cpp)));
 	if (err < 0)
 		return err;
 
@@ -114,8 +117,10 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, int target, unsigned long long address,
  * @return      A non-NULL struct nfp_cpp_mutex * on success, NULL on failure.
  */
 struct nfp_cpp_mutex *
-nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, int target,
-		     unsigned long long address, uint32_t key)
+nfp_cpp_mutex_alloc(struct nfp_cpp *cpp,
+		int target,
+		unsigned long long address,
+		uint32_t key)
 {
 	uint32_t model = nfp_cpp_model(cpp);
 	struct nfp_cpp_mutex *mutex;
@@ -265,8 +270,8 @@ nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex)
 			return err;
 		if (time(NULL) >= warn_at) {
 			PMD_DRV_LOG(ERR, "Warning: waiting for NFP mutex usage:%u depth:%hd] target:%d addr:%llx key:%08x]",
-				    mutex->usage, mutex->depth, mutex->target,
-				    mutex->address, mutex->key);
+					mutex->usage, mutex->depth, mutex->target,
+					mutex->address, mutex->key);
 			warn_at = time(NULL) + 60;
 		}
 		sched_yield();
diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c
index 433780a5e7..8bdc69766e 100644
--- a/drivers/net/nfp/nfpcore/nfp_nffw.c
+++ b/drivers/net/nfp/nfpcore/nfp_nffw.c
@@ -138,8 +138,8 @@ nfp_nffw_info_open(struct nfp_cpp *cpp)
 		goto err_release;
 
 	err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
-			   nfp_resource_address(state->res),
-			   fwinf, sizeof(*fwinf));
+			nfp_resource_address(state->res),
+			fwinf, sizeof(*fwinf));
 	if (err < (int)sizeof(*fwinf))
 		goto err_release;
 
@@ -205,8 +205,9 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state)
  * Return: 0, or -ERRNO
  */
 int
-nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id,
-			uint64_t *off)
+nfp_nffw_info_mip_first(struct nfp_nffw_info *state,
+		uint32_t *cpp_id,
+		uint64_t *off)
 {
 	struct nffw_fwinfo *fwinfo;
 
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c
index 6474abf0c2..4f476f6f2b 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.c
@@ -22,7 +22,8 @@ nfp_nsp_config_modified(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified)
+nfp_nsp_config_set_modified(struct nfp_nsp *state,
+		int modified)
 {
 	state->modified = modified;
 }
@@ -40,7 +41,9 @@ nfp_nsp_config_idx(struct nfp_nsp *state)
 }
 
 void
-nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries, unsigned int idx)
+nfp_nsp_config_set_state(struct nfp_nsp *state,
+		void *entries,
+		unsigned int idx)
 {
 	state->entries = entries;
 	state->idx = idx;
@@ -91,7 +94,7 @@ nfp_nsp_check(struct nfp_nsp *state)
 
 	if (state->ver.major != NSP_MAJOR || state->ver.minor < NSP_MINOR) {
 		PMD_DRV_LOG(ERR, "Unsupported ABI %hu.%hu", state->ver.major,
-						    state->ver.minor);
+				state->ver.minor);
 		return -EINVAL;
 	}
 
@@ -160,8 +163,12 @@ nfp_nsp_get_abi_ver_minor(struct nfp_nsp *state)
 }
 
 static int
-nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
-		 uint64_t addr, uint64_t mask, uint64_t val)
+nfp_nsp_wait_reg(struct nfp_cpp *cpp,
+		uint64_t *reg,
+		uint32_t nsp_cpp,
+		uint64_t addr,
+		uint64_t mask,
+		uint64_t val)
 {
 	struct timespec wait;
 	int count;
@@ -204,8 +211,11 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, uint64_t *reg, uint32_t nsp_cpp,
  *	-ETIMEDOUT if the NSP took longer than 30 seconds to complete
  */
 static int
-nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
-		uint32_t buff_cpp, uint64_t buff_addr)
+nfp_nsp_command(struct nfp_nsp *state,
+		uint16_t code,
+		uint32_t option,
+		uint32_t buff_cpp,
+		uint64_t buff_addr)
 {
 	uint64_t reg, ret_val, nsp_base, nsp_buffer, nsp_status, nsp_command;
 	struct nfp_cpp *cpp = state->cpp;
@@ -223,40 +233,40 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 		return err;
 
 	if (!FIELD_FIT(NSP_BUFFER_CPP, buff_cpp >> 8) ||
-	    !FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
+			!FIELD_FIT(NSP_BUFFER_ADDRESS, buff_addr)) {
 		PMD_DRV_LOG(ERR, "Host buffer out of reach %08x %" PRIx64,
-			buff_cpp, buff_addr);
+				buff_cpp, buff_addr);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_buffer,
-			     FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
-			     FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
+			FIELD_PREP(NSP_BUFFER_CPP, buff_cpp >> 8) |
+			FIELD_PREP(NSP_BUFFER_ADDRESS, buff_addr));
 	if (err < 0)
 		return err;
 
 	err = nfp_cpp_writeq(cpp, nsp_cpp, nsp_command,
-			     FIELD_PREP(NSP_COMMAND_OPTION, option) |
-			     FIELD_PREP(NSP_COMMAND_CODE, code) |
-			     FIELD_PREP(NSP_COMMAND_START, 1));
+			FIELD_PREP(NSP_COMMAND_OPTION, option) |
+			FIELD_PREP(NSP_COMMAND_CODE, code) |
+			FIELD_PREP(NSP_COMMAND_START, 1));
 	if (err < 0)
 		return err;
 
 	/* Wait for NSP_COMMAND_START to go to 0 */
 	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_command,
-			       NSP_COMMAND_START, 0);
+			NSP_COMMAND_START, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
 	/* Wait for NSP_STATUS_BUSY to go to 0 */
-	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status, NSP_STATUS_BUSY,
-			       0);
+	err = nfp_nsp_wait_reg(cpp, &reg, nsp_cpp, nsp_status,
+			NSP_STATUS_BUSY, 0);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Error %d waiting for code 0x%04x to start",
-			err, code);
+				err, code);
 		return err;
 	}
 
@@ -268,7 +278,7 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 	err = FIELD_GET(NSP_STATUS_RESULT, reg);
 	if (err != 0) {
 		PMD_DRV_LOG(ERR, "Result (error) code set: %d (%d) command: %d",
-			 -err, (int)ret_val, code);
+				-err, (int)ret_val, code);
 		nfp_nsp_print_extended_error(ret_val);
 		return -err;
 	}
@@ -279,9 +289,12 @@ nfp_nsp_command(struct nfp_nsp *state, uint16_t code, uint32_t option,
 #define SZ_1M 0x00100000
 
 static int
-nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
-		    const void *in_buf, unsigned int in_size, void *out_buf,
-		    unsigned int out_size)
+nfp_nsp_command_buf(struct nfp_nsp *nsp,
+		uint16_t code, uint32_t option,
+		const void *in_buf,
+		unsigned int in_size,
+		void *out_buf,
+		unsigned int out_size)
 {
 	struct nfp_cpp *cpp = nsp->cpp;
 	unsigned int max_size;
@@ -291,28 +304,26 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 
 	if (nsp->ver.minor < 13) {
 		PMD_DRV_LOG(ERR, "NSP: Code 0x%04x with buffer not supported ABI %hu.%hu)",
-			    code, nsp->ver.major, nsp->ver.minor);
+				code, nsp->ver.major, nsp->ver.minor);
 		return -EOPNOTSUPP;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER_CONFIG,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER_CONFIG,
+			&reg);
 	if (err < 0)
 		return err;
 
 	max_size = RTE_MAX(in_size, out_size);
 	if (FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M < max_size) {
 		PMD_DRV_LOG(ERR, "NSP: default buffer too small for command 0x%04x (%llu < %u)",
-			    code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
+				code, FIELD_GET(NSP_DFLT_BUFFER_SIZE_MB, reg) * SZ_1M, max_size);
 		return -EINVAL;
 	}
 
 	err = nfp_cpp_readq(cpp, nfp_resource_cpp_id(nsp->res),
-			    nfp_resource_address(nsp->res) +
-			    NSP_DFLT_BUFFER,
-			    &reg);
+			nfp_resource_address(nsp->res) + NSP_DFLT_BUFFER,
+			&reg);
 	if (err < 0)
 		return err;
 
@@ -328,7 +339,7 @@ nfp_nsp_command_buf(struct nfp_nsp *nsp, uint16_t code, uint32_t option,
 	if (out_buf != NULL && out_size > 0 && out_size > in_size) {
 		memset(out_buf, 0, out_size - in_size);
 		err = nfp_cpp_write(cpp, cpp_id, cpp_buf + in_size, out_buf,
-				    out_size - in_size);
+				out_size - in_size);
 		if (err < 0)
 			return err;
 	}
@@ -388,38 +399,47 @@ nfp_nsp_mac_reinit(struct nfp_nsp *state)
 }
 
 int
-nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_load_fw(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_FW_LOAD, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_eth_table(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_RESCAN, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			unsigned int size)
+nfp_nsp_write_eth_table(struct nfp_nsp *state,
+		const void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_ETH_CONTROL, size, buf, size,
-				   NULL, 0);
+			NULL, 0);
 }
 
 int
-nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size)
+nfp_nsp_read_identify(struct nfp_nsp *state,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_IDENTIFY, size, NULL, 0,
-				   buf, size);
+			buf, size);
 }
 
 int
-nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask, void *buf,
-		     unsigned int size)
+nfp_nsp_read_sensors(struct nfp_nsp *state,
+		unsigned int sensor_mask,
+		void *buf,
+		unsigned int size)
 {
 	return nfp_nsp_command_buf(state, SPCODE_NSP_SENSORS, sensor_mask, NULL,
-				   0, buf, size);
+			0, buf, size);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h
index 9905b2d3d3..1e2deaabb4 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/nfp/nfpcore/nfp_nsp.h
@@ -114,9 +114,10 @@ int nfp_nsp_load_fw(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_mac_reinit(struct nfp_nsp *state);
 int nfp_nsp_read_identify(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_read_sensors(struct nfp_nsp *state, unsigned int sensor_mask,
-			 void *buf, unsigned int size);
+		void *buf, unsigned int size);
 
-static inline int nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
+static inline int
+nfp_nsp_has_mac_reinit(struct nfp_nsp *state)
 {
 	return nfp_nsp_get_abi_ver_minor(state) > 20;
 }
@@ -229,22 +230,22 @@ struct nfp_eth_table *nfp_eth_read_ports(struct nfp_cpp *cpp);
 
 int nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable);
 int nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx,
-			   int configed);
-int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
+		int configed);
+int nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode);
 
 int nfp_nsp_read_eth_table(struct nfp_nsp *state, void *buf, unsigned int size);
 int nfp_nsp_write_eth_table(struct nfp_nsp *state, const void *buf,
-			    unsigned int size);
+		unsigned int size);
 void nfp_nsp_config_set_state(struct nfp_nsp *state, void *entries,
-			      unsigned int idx);
+		unsigned int idx);
 void nfp_nsp_config_clear_state(struct nfp_nsp *state);
 void nfp_nsp_config_set_modified(struct nfp_nsp *state, int modified);
 void *nfp_nsp_config_entries(struct nfp_nsp *state);
 int nfp_nsp_config_modified(struct nfp_nsp *state);
 unsigned int nfp_nsp_config_idx(struct nfp_nsp *state);
 
-static inline int nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
+static inline int
+nfp_eth_can_support_fec(struct nfp_eth_table_port *eth_port)
 {
 	return !!eth_port->fec_modes_supported;
 }
@@ -297,6 +298,6 @@ enum nfp_nsp_sensor_id {
 };
 
 int nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id,
-			  long *val);
+		long *val);
 
 #endif
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
index 21b338461e..28dba27124 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c
@@ -73,7 +73,9 @@ struct nfp_sensors {
 };
 
 int
-nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val)
+nfp_hwmon_read_sensor(struct nfp_cpp *cpp,
+		enum nfp_nsp_sensor_id id,
+		long *val)
 {
 	struct nfp_sensors s;
 	struct nfp_nsp *nsp;
diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
index 825a84a8cd..3eeefc74af 100644
--- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
+++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c
@@ -168,8 +168,10 @@ nfp_eth_copy_mac_reverse(uint8_t *dst, const uint8_t *src)
 }
 
 static void
-nfp_eth_port_translate(struct nfp_nsp *nsp, const union eth_table_entry *src,
-		       unsigned int index, struct nfp_eth_table_port *dst)
+nfp_eth_port_translate(struct nfp_nsp *nsp,
+		const union eth_table_entry *src,
+		unsigned int index,
+		struct nfp_eth_table_port *dst)
 {
 	unsigned int rate;
 	unsigned int fec;
@@ -225,21 +227,21 @@ nfp_eth_calc_port_geometry(struct nfp_eth_table *table)
 
 	for (i = 0; i < table->count; i++) {
 		table->max_index = RTE_MAX(table->max_index,
-					   table->ports[i].index);
+				table->ports[i].index);
 
 		for (j = 0; j < table->count; j++) {
 			if (table->ports[i].label_port !=
-			    table->ports[j].label_port)
+					table->ports[j].label_port)
 				continue;
 			table->ports[i].port_lanes += table->ports[j].lanes;
 
 			if (i == j)
 				continue;
 			if (table->ports[i].label_subport ==
-			    table->ports[j].label_subport)
+					table->ports[j].label_subport)
 				PMD_DRV_LOG(DEBUG, "Port %d subport %d is a duplicate",
-					 table->ports[i].label_port,
-					 table->ports[i].label_subport);
+						table->ports[i].label_port,
+						table->ports[i].label_subport);
 
 			table->ports[i].is_split = 1;
 		}
@@ -296,7 +298,7 @@ __nfp_eth_read_ports(struct nfp_nsp *nsp)
 	 */
 	if (ret != 0 && ret != cnt) {
 		PMD_DRV_LOG(ERR, "table entry count (%d) unmatch entries present (%d)",
-		       ret, cnt);
+				ret, cnt);
 		goto err;
 	}
 
@@ -354,7 +356,8 @@ nfp_eth_read_ports(struct nfp_cpp *cpp)
 }
 
 struct nfp_nsp *
-nfp_eth_config_start(struct nfp_cpp *cpp, unsigned int idx)
+nfp_eth_config_start(struct nfp_cpp *cpp,
+		unsigned int idx)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -447,7 +450,9 @@ nfp_eth_config_commit_end(struct nfp_nsp *nsp)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
+nfp_eth_set_mod_enable(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int enable)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -487,7 +492,9 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, unsigned int idx, int enable)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
+nfp_eth_set_configured(struct nfp_cpp *cpp,
+		unsigned int idx,
+		int configed)
 {
 	union eth_table_entry *entries;
 	struct nfp_nsp *nsp;
@@ -523,9 +530,12 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, unsigned int idx, int configed)
 }
 
 static int
-nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
-		       const uint64_t mask, const unsigned int shift,
-		       unsigned int val, const uint64_t ctrl_bit)
+nfp_eth_set_bit_config(struct nfp_nsp *nsp,
+		unsigned int raw_idx,
+		const uint64_t mask,
+		const unsigned int shift,
+		unsigned int val,
+		const uint64_t ctrl_bit)
 {
 	union eth_table_entry *entries = nfp_nsp_config_entries(nsp);
 	unsigned int idx = nfp_nsp_config_idx(nsp);
@@ -560,7 +570,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
 	(__extension__ ({ \
 		typeof(mask) _x = (mask); \
 		nfp_eth_set_bit_config(nsp, raw_idx, _x, __bf_shf(_x), \
-				       val, ctrl_bit);			\
+				val, ctrl_bit);			\
 	}))
 
 /*
@@ -574,11 +584,11 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, unsigned int raw_idx,
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
+__nfp_eth_set_aneg(struct nfp_nsp *nsp,
+		enum nfp_eth_aneg mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_ANEG, mode,
-				      NSP_ETH_CTRL_SET_ANEG);
+			NSP_ETH_STATE_ANEG, mode, NSP_ETH_CTRL_SET_ANEG);
 }
 
 /*
@@ -592,11 +602,11 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode)
  * Return: 0 or -ERRNO.
  */
 static int
-__nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
+__nfp_eth_set_fec(struct nfp_nsp *nsp,
+		enum nfp_eth_fec mode)
 {
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_FEC, mode,
-				      NSP_ETH_CTRL_SET_FEC);
+			NSP_ETH_STATE_FEC, mode, NSP_ETH_CTRL_SET_FEC);
 }
 
 /*
@@ -611,7 +621,9 @@ __nfp_eth_set_fec(struct nfp_nsp *nsp, enum nfp_eth_fec mode)
  * -ERRNO - configuration failed.
  */
 int
-nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
+nfp_eth_set_fec(struct nfp_cpp *cpp,
+		unsigned int idx,
+		enum nfp_eth_fec mode)
 {
 	struct nfp_nsp *nsp;
 	int err;
@@ -642,7 +654,8 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, unsigned int idx, enum nfp_eth_fec mode)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
+__nfp_eth_set_speed(struct nfp_nsp *nsp,
+		unsigned int speed)
 {
 	enum nfp_eth_rate rate;
 
@@ -653,8 +666,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
 	}
 
 	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE,
-				      NSP_ETH_STATE_RATE, rate,
-				      NSP_ETH_CTRL_SET_RATE);
+			NSP_ETH_STATE_RATE, rate, NSP_ETH_CTRL_SET_RATE);
 }
 
 /*
@@ -668,8 +680,9 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, unsigned int speed)
  * Return: 0 or -ERRNO.
  */
 int
-__nfp_eth_set_split(struct nfp_nsp *nsp, unsigned int lanes)
+__nfp_eth_set_split(struct nfp_nsp *nsp,
+		unsigned int lanes)
 {
-	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, NSP_ETH_PORT_LANES,
-				      lanes, NSP_ETH_CTRL_SET_LANES);
+	return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT,
+			NSP_ETH_PORT_LANES, lanes, NSP_ETH_CTRL_SET_LANES);
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.c b/drivers/net/nfp/nfpcore/nfp_resource.c
index 838cd6e0ef..57089c770f 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.c
+++ b/drivers/net/nfp/nfpcore/nfp_resource.c
@@ -64,7 +64,8 @@ struct nfp_resource {
 };
 
 static int
-nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
+nfp_cpp_resource_find(struct nfp_cpp *cpp,
+		struct nfp_resource *res)
 {
 	char name_pad[NFP_RESOURCE_ENTRY_NAME_SZ + 2];
 	struct nfp_resource_entry entry;
@@ -85,7 +86,7 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 
 	for (i = 0; i < NFP_RESOURCE_TBL_ENTRIES; i++) {
 		uint64_t addr = NFP_RESOURCE_TBL_BASE +
-			sizeof(struct nfp_resource_entry) * i;
+				sizeof(struct nfp_resource_entry) * i;
 
 		ret = nfp_cpp_read(cpp, cpp_id, addr, &entry, sizeof(entry));
 		if (ret != sizeof(entry))
@@ -95,12 +96,11 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 			continue;
 
 		/* Found key! */
-		res->mutex =
-			nfp_cpp_mutex_alloc(cpp,
-					    NFP_RESOURCE_TBL_TARGET, addr, key);
+		res->mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
+				addr, key);
 		res->cpp_id = NFP_CPP_ID(entry.region.cpp_target,
-					 entry.region.cpp_action,
-					 entry.region.cpp_token);
+				entry.region.cpp_action,
+				entry.region.cpp_token);
 		res->addr = ((uint64_t)entry.region.page_offset) << 8;
 		res->size = (uint64_t)entry.region.page_size << 8;
 		return 0;
@@ -110,8 +110,9 @@ nfp_cpp_resource_find(struct nfp_cpp *cpp, struct nfp_resource *res)
 }
 
 static int
-nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
-			 struct nfp_cpp_mutex *dev_mutex)
+nfp_resource_try_acquire(struct nfp_cpp *cpp,
+		struct nfp_resource *res,
+		struct nfp_cpp_mutex *dev_mutex)
 {
 	int err;
 
@@ -148,7 +149,8 @@ nfp_resource_try_acquire(struct nfp_cpp *cpp, struct nfp_resource *res,
  * Return: NFP Resource handle, or NULL
  */
 struct nfp_resource *
-nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
+nfp_resource_acquire(struct nfp_cpp *cpp,
+		const char *name)
 {
 	struct nfp_cpp_mutex *dev_mutex;
 	struct nfp_resource *res;
@@ -165,8 +167,7 @@ nfp_resource_acquire(struct nfp_cpp *cpp, const char *name)
 	strncpy(res->name, name, NFP_RESOURCE_ENTRY_NAME_SZ);
 
 	dev_mutex = nfp_cpp_mutex_alloc(cpp, NFP_RESOURCE_TBL_TARGET,
-					NFP_RESOURCE_TBL_BASE,
-					NFP_RESOURCE_TBL_KEY);
+			NFP_RESOURCE_TBL_BASE, NFP_RESOURCE_TBL_KEY);
 	if (dev_mutex == NULL) {
 		free(res);
 		return NULL;
@@ -234,8 +235,8 @@ nfp_resource_cpp_id(const struct nfp_resource *res)
  *
  * Return: const char pointer to the name of the resource
  */
-const char
-*nfp_resource_name(const struct nfp_resource *res)
+const char *
+nfp_resource_name(const struct nfp_resource *res)
 {
 	return res->name;
 }
diff --git a/drivers/net/nfp/nfpcore/nfp_resource.h b/drivers/net/nfp/nfpcore/nfp_resource.h
index 06cc6f74f4..009b7359a4 100644
--- a/drivers/net/nfp/nfpcore/nfp_resource.h
+++ b/drivers/net/nfp/nfpcore/nfp_resource.h
@@ -18,7 +18,7 @@
 struct nfp_resource;
 
 struct nfp_resource *nfp_resource_acquire(struct nfp_cpp *cpp,
-					  const char *name);
+		const char *name);
 
 /**
  * Release a NFP Resource, and free the handle
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.c b/drivers/net/nfp/nfpcore/nfp_rtsym.c
index 4c45aec5c1..aa3b7a483e 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.c
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.c
@@ -40,22 +40,25 @@ struct nfp_rtsym_table {
 };
 
 static int
-nfp_meid(uint8_t island_id, uint8_t menum)
+nfp_meid(uint8_t island_id,
+		uint8_t menum)
 {
 	return (island_id & 0x3F) == island_id && menum < 12 ?
 		(island_id << 4) | (menum + 4) : -1;
 }
 
 static void
-nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache, uint32_t strtab_size,
-			struct nfp_rtsym *sw, struct nfp_rtsym_entry *fw)
+nfp_rtsym_sw_entry_init(struct nfp_rtsym_table *cache,
+		uint32_t strtab_size,
+		struct nfp_rtsym *sw,
+		struct nfp_rtsym_entry *fw)
 {
 	sw->type = fw->type;
 	sw->name = cache->strtab + rte_le_to_cpu_16(fw->name) % strtab_size;
 	sw->addr = ((uint64_t)fw->addr_hi << 32) |
-		   rte_le_to_cpu_32(fw->addr_lo);
+			rte_le_to_cpu_32(fw->addr_lo);
 	sw->size = ((uint64_t)fw->size_hi << 32) |
-		   rte_le_to_cpu_32(fw->size_lo);
+			rte_le_to_cpu_32(fw->size_lo);
 
 	PMD_INIT_LOG(DEBUG, "rtsym_entry_init name=%s, addr=%" PRIx64 ", size=%" PRIu64 ", target=%d",
 		     sw->name, sw->addr, sw->size, sw->target);
@@ -93,7 +96,8 @@ nfp_rtsym_table_read(struct nfp_cpp *cpp)
 }
 
 struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
+__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip)
 {
 	uint32_t strtab_addr, symtab_addr, strtab_size, symtab_size;
 	struct nfp_rtsym_entry *rtsymtab;
@@ -142,7 +146,7 @@ __nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip)
 
 	for (n = 0; n < cache->num; n++)
 		nfp_rtsym_sw_entry_init(cache, strtab_size,
-					&cache->symtab[n], &rtsymtab[n]);
+				&cache->symtab[n], &rtsymtab[n]);
 
 	free(rtsymtab);
 
@@ -178,7 +182,8 @@ nfp_rtsym_count(struct nfp_rtsym_table *rtbl)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
+nfp_rtsym_get(struct nfp_rtsym_table *rtbl,
+		int idx)
 {
 	if (rtbl == NULL)
 		return NULL;
@@ -197,7 +202,8 @@ nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx)
  * Return: const pointer to a struct nfp_rtsym descriptor, or NULL
  */
 const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name)
+nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name)
 {
 	int n;
 
@@ -331,7 +337,9 @@ nfp_rtsym_readq(struct nfp_cpp *cpp,
  * Return: value read, on error sets the error and returns ~0ULL.
  */
 uint64_t
-nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
+nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		int *error)
 {
 	const struct nfp_rtsym *sym;
 	uint32_t val32;
@@ -354,7 +362,7 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "rtsym '%s' unsupported size: %" PRId64,
-			name, sym->size);
+				name, sym->size);
 		err = -EINVAL;
 		break;
 	}
@@ -372,8 +380,10 @@ nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name, int *error)
 }
 
 uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area)
+nfp_rtsym_map(struct nfp_rtsym_table *rtbl,
+		const char *name,
+		unsigned int min_size,
+		struct nfp_cpp_area **area)
 {
 	int ret;
 	uint8_t *mem;
@@ -397,7 +407,7 @@ nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
 
 	if (sym->size < min_size) {
 		PMD_DRV_LOG(ERR, "Symbol %s too small (%" PRIu64 " < %u)", name,
-			sym->size, min_size);
+				sym->size, min_size);
 		return NULL;
 	}
 
diff --git a/drivers/net/nfp/nfpcore/nfp_rtsym.h b/drivers/net/nfp/nfpcore/nfp_rtsym.h
index 8b494211bc..30768f1ccf 100644
--- a/drivers/net/nfp/nfpcore/nfp_rtsym.h
+++ b/drivers/net/nfp/nfpcore/nfp_rtsym.h
@@ -43,19 +43,18 @@ struct nfp_rtsym_table;
 
 struct nfp_rtsym_table *nfp_rtsym_table_read(struct nfp_cpp *cpp);
 
-struct nfp_rtsym_table *
-__nfp_rtsym_table_read(struct nfp_cpp *cpp, const struct nfp_mip *mip);
+struct nfp_rtsym_table *__nfp_rtsym_table_read(struct nfp_cpp *cpp,
+		const struct nfp_mip *mip);
 
 int nfp_rtsym_count(struct nfp_rtsym_table *rtbl);
 
 const struct nfp_rtsym *nfp_rtsym_get(struct nfp_rtsym_table *rtbl, int idx);
 
-const struct nfp_rtsym *
-nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl, const char *name);
+const struct nfp_rtsym *nfp_rtsym_lookup(struct nfp_rtsym_table *rtbl,
+		const char *name);
 
 uint64_t nfp_rtsym_read_le(struct nfp_rtsym_table *rtbl, const char *name,
-			   int *error);
-uint8_t *
-nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
-	      unsigned int min_size, struct nfp_cpp_area **area);
+		int *error);
+uint8_t *nfp_rtsym_map(struct nfp_rtsym_table *rtbl, const char *name,
+		unsigned int min_size, struct nfp_cpp_area **area);
 #endif
-- 
2.39.1


^ permalink raw reply	[relevance 2%]

* [PATCH v12 1/4] ethdev: add API for mbufs recycle mode
  @ 2023-08-24  7:36  3%   ` Feifei Wang
  0 siblings, 0 replies; 200+ results
From: Feifei Wang @ 2023-08-24  7:36 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, nd, Feifei Wang, Honnappa Nagarahalli, Ruifeng Wang,
	Morten Brørup, Konstantin Ananyev

Add 'rte_eth_recycle_rx_queue_info_get' and 'rte_eth_recycle_mbufs'
APIs to recycle used mbufs from a transmit queue of an Ethernet device,
and move these mbufs into a mbuf ring for a receive queue of an Ethernet
device. This can bypass mempool 'put/get' operations hence saving CPU
cycles.

For each recycling mbufs, the rte_eth_recycle_mbufs() function performs
the following operations:
- Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf
ring.
- Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
from the Tx mbuf ring.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
---
 doc/guides/rel_notes/release_23_11.rst |  15 +++
 lib/ethdev/ethdev_driver.h             |  10 ++
 lib/ethdev/ethdev_private.c            |   2 +
 lib/ethdev/rte_ethdev.c                |  22 +++
 lib/ethdev/rte_ethdev.h                | 180 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_core.h           |  23 +++-
 lib/ethdev/version.map                 |   3 +
 7 files changed, 249 insertions(+), 6 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 333e1d95a2..9d6ce65f22 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -78,6 +78,13 @@ New Features
 * build: Optional libraries can now be selected with the new ``enable_libs``
   build option similarly to the existing ``enable_drivers`` build option.
 
+* **Add mbufs recycling support.**
+
+  Added ``rte_eth_recycle_rx_queue_info_get`` and ``rte_eth_recycle_mbufs``
+  APIs which allow the user to copy used mbufs from the Tx mbuf ring
+  into the Rx mbuf ring. This feature supports the case that the Rx Ethernet
+  device is different from the Tx Ethernet device with respective driver
+  callback functions in ``rte_eth_recycle_mbufs``.
 
 Removed Items
 -------------
@@ -129,6 +136,14 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields to ``rte_eth_dev`` structure.
+
+* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
+  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields, to move ``rxq`` and ``txq`` fields, to change the size of
+  ``reserved1`` and ``reserved2`` fields.
+
 
 Known Issues
 ------------
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 980f837ab6..b0c55a8523 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -58,6 +58,10 @@ struct rte_eth_dev {
 	eth_rx_descriptor_status_t rx_descriptor_status;
 	/** Check the status of a Tx descriptor */
 	eth_tx_descriptor_status_t tx_descriptor_status;
+	/** Pointer to PMD transmit mbufs reuse function */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	/** Pointer to PMD receive descriptors refill function */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
 
 	/**
 	 * Device data that is shared between primary and secondary processes
@@ -507,6 +511,10 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
+typedef void (*eth_recycle_rxq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t rx_queue_id,
+	struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
 	uint16_t queue_id, struct rte_eth_burst_mode *mode);
 
@@ -1250,6 +1258,8 @@ struct eth_dev_ops {
 	eth_rxq_info_get_t         rxq_info_get;
 	/** Retrieve Tx queue information */
 	eth_txq_info_get_t         txq_info_get;
+	/** Retrieve mbufs recycle Rx queue information */
+	eth_recycle_rxq_info_get_t recycle_rxq_info_get;
 	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst mode */
 	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst mode */
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version */
diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c
index 14ec8c6ccf..f8ab64f195 100644
--- a/lib/ethdev/ethdev_private.c
+++ b/lib/ethdev/ethdev_private.c
@@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
 	fpo->rx_queue_count = dev->rx_queue_count;
 	fpo->rx_descriptor_status = dev->rx_descriptor_status;
 	fpo->tx_descriptor_status = dev->tx_descriptor_status;
+	fpo->recycle_tx_mbufs_reuse = dev->recycle_tx_mbufs_reuse;
+	fpo->recycle_rx_descriptors_refill = dev->recycle_rx_descriptors_refill;
 
 	fpo->rxq.data = dev->data->rx_queues;
 	fpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 0840d2b594..2bf7a84f16 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5876,6 +5876,28 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	return 0;
 }
 
+int
+rte_eth_recycle_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_dev *dev;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	ret = eth_dev_validate_rx_queue(dev, queue_id);
+	if (unlikely(ret != 0))
+		return ret;
+
+	if (*dev->dev_ops->recycle_rxq_info_get == NULL)
+		return -ENOTSUP;
+
+	dev->dev_ops->recycle_rxq_info_get(dev, queue_id, recycle_rxq_info);
+
+	return 0;
+}
+
 int
 rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 			  struct rte_eth_burst_mode *mode)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 04a2564f22..9ea639852d 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -1820,6 +1820,30 @@ struct rte_eth_txq_info {
 	uint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */
 } __rte_cache_min_aligned;
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice.
+ *
+ * Ethernet device Rx queue information structure for recycling mbufs.
+ * Used to retrieve Rx queue information when Tx queue reusing mbufs and moving
+ * them into Rx mbuf ring.
+ */
+struct rte_eth_recycle_rxq_info {
+	struct rte_mbuf **mbuf_ring; /**< mbuf ring of Rx queue. */
+	struct rte_mempool *mp;     /**< mempool of Rx queue. */
+	uint16_t *refill_head;      /**< head of Rx queue refilling mbufs. */
+	uint16_t *receive_tail;     /**< tail of Rx queue receiving pkts. */
+	uint16_t mbuf_ring_size;     /**< configured number of mbuf ring size. */
+	/**
+	 * Requirement on mbuf refilling batch size of Rx mbuf ring.
+	 * For some PMD drivers, the number of Rx mbuf ring refilling mbufs
+	 * should be aligned with mbuf ring size, in order to simplify
+	 * ring wrapping around.
+	 * Value 0 means that PMD drivers have no requirement for this.
+	 */
+	uint16_t refill_requirement;
+} __rte_cache_min_aligned;
+
 /* Generic Burst mode flag definition, values can be ORed. */
 
 /**
@@ -4853,6 +4877,31 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Retrieve information about given ports's Rx queue for recycling mbufs.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The Rx queue on the Ethernet devicefor which information
+ *   will be retrieved.
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* to be filled.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENODEV:  If *port_id* is invalid.
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The queue_id is out of range.
+ */
+__rte_experimental
+int rte_eth_recycle_rx_queue_info_get(uint16_t port_id,
+		uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 /**
  * Retrieve information about the Rx packet burst mode.
  *
@@ -6527,6 +6576,137 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
 	return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Recycle used mbufs from a transmit queue of an Ethernet device, and move
+ * these mbufs into a mbuf ring for a receive queue of an Ethernet device.
+ * This can bypass mempool path to save CPU cycles.
+ *
+ * The rte_eth_recycle_mbufs() function loops, with rte_eth_rx_burst() and
+ * rte_eth_tx_burst() functions, freeing Tx used mbufs and replenishing Rx
+ * descriptors. The number of recycling mbufs depends on the request of Rx mbuf
+ * ring, with the constraint of enough used mbufs from Tx mbuf ring.
+ *
+ * For each recycling mbufs, the rte_eth_recycle_mbufs() function performs the
+ * following operations:
+ *
+ * - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf ring.
+ *
+ * - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
+ *   from the Tx mbuf ring.
+ *
+ * This function spilts Rx and Tx path with different callback functions. The
+ * callback function recycle_tx_mbufs_reuse is for Tx driver. The callback
+ * function recycle_rx_descriptors_refill is for Rx driver. rte_eth_recycle_mbufs()
+ * can support the case that Rx Ethernet device is different from Tx Ethernet device.
+ *
+ * It is the responsibility of users to select the Rx/Tx queue pair to recycle
+ * mbufs. Before call this function, users must call rte_eth_recycle_rxq_info_get
+ * function to retrieve selected Rx queue information.
+ * @see rte_eth_recycle_rxq_info_get, struct rte_eth_recycle_rxq_info
+ *
+ * Currently, the rte_eth_recycle_mbufs() function can support to feed 1 Rx queue from
+ * 2 Tx queues in the same thread. Do not pair the Rx queue and Tx queue in different
+ * threads, in order to avoid memory error rewriting.
+ *
+ * @param rx_port_id
+ *   Port identifying the receive side.
+ * @param rx_queue_id
+ *   The index of the receive queue identifying the receive side.
+ *   The value must be in the range [0, nb_rx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param tx_port_id
+ *   Port identifying the transmit side.
+ * @param tx_queue_id
+ *   The index of the transmit queue identifying the transmit side.
+ *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* which contains
+ *   the information of the Rx queue mbuf ring.
+ * @return
+ *   The number of recycling mbufs.
+ */
+__rte_experimental
+static inline uint16_t
+rte_eth_recycle_mbufs(uint16_t rx_port_id, uint16_t rx_queue_id,
+		uint16_t tx_port_id, uint16_t tx_queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_fp_ops *p1, *p2;
+	void *qd1, *qd2;
+	uint16_t nb_mbufs;
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	if (tx_port_id >= RTE_MAX_ETHPORTS ||
+			tx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR,
+				"Invalid tx_port_id=%u or tx_queue_id=%u\n",
+				tx_port_id, tx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to Tx queue data */
+	p1 = &rte_eth_fp_ops[tx_port_id];
+	qd1 = p1->txq.data[tx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port_id, 0);
+
+	if (qd1 == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u for port_id=%u\n",
+				tx_queue_id, tx_port_id);
+		return 0;
+	}
+#endif
+	if (p1->recycle_tx_mbufs_reuse == NULL)
+		return 0;
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	if (rx_port_id >= RTE_MAX_ETHPORTS ||
+			rx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR, "Invalid rx_port_id=%u or rx_queue_id=%u\n",
+				rx_port_id, rx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to Rx queue data */
+	p2 = &rte_eth_fp_ops[rx_port_id];
+	qd2 = p2->rxq.data[rx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port_id, 0);
+
+	if (qd2 == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u for port_id=%u\n",
+				rx_queue_id, rx_port_id);
+		return 0;
+	}
+#endif
+	if (p2->recycle_rx_descriptors_refill == NULL)
+		return 0;
+
+	/* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
+	 * into Rx mbuf ring.
+	 */
+	nb_mbufs = p1->recycle_tx_mbufs_reuse(qd1, recycle_rxq_info);
+
+	/* If no recycling mbufs, return 0. */
+	if (nb_mbufs == 0)
+		return 0;
+
+	/* Replenish the Rx descriptors with the recycling
+	 * into Rx mbuf ring.
+	 */
+	p2->recycle_rx_descriptors_refill(qd2, nb_mbufs);
+
+	return nb_mbufs;
+}
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index 46e9721e07..a24ad7a6b2 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -55,6 +55,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
 /** @internal Check the status of a Tx descriptor */
 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
 
+/** @internal Copy used mbufs from Tx mbuf ring into Rx mbuf ring */
+typedef uint16_t (*eth_recycle_tx_mbufs_reuse_t)(void *txq,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
+/** @internal Refill Rx descriptors with the recycling mbufs */
+typedef void (*eth_recycle_rx_descriptors_refill_t)(void *rxq, uint16_t nb);
+
 /**
  * @internal
  * Structure used to hold opaque pointers to internal ethdev Rx/Tx
@@ -83,15 +90,17 @@ struct rte_eth_fp_ops {
 	 * Rx fast-path functions and related data.
 	 * 64-bit systems: occupies first 64B line
 	 */
+	/** Rx queues data. */
+	struct rte_ethdev_qdata rxq;
 	/** PMD receive function. */
 	eth_rx_burst_t rx_pkt_burst;
 	/** Get the number of used Rx descriptors. */
 	eth_rx_queue_count_t rx_queue_count;
 	/** Check the status of a Rx descriptor. */
 	eth_rx_descriptor_status_t rx_descriptor_status;
-	/** Rx queues data. */
-	struct rte_ethdev_qdata rxq;
-	uintptr_t reserved1[3];
+	/** Refill Rx descriptors with the recycling mbufs. */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
+	uintptr_t reserved1[2];
 	/**@}*/
 
 	/**@{*/
@@ -99,15 +108,17 @@ struct rte_eth_fp_ops {
 	 * Tx fast-path functions and related data.
 	 * 64-bit systems: occupies second 64B line
 	 */
+	/** Tx queues data. */
+	struct rte_ethdev_qdata txq;
 	/** PMD transmit function. */
 	eth_tx_burst_t tx_pkt_burst;
 	/** PMD transmit prepare function. */
 	eth_tx_prep_t tx_pkt_prepare;
 	/** Check the status of a Tx descriptor. */
 	eth_tx_descriptor_status_t tx_descriptor_status;
-	/** Tx queues data. */
-	struct rte_ethdev_qdata txq;
-	uintptr_t reserved2[3];
+	/** Copy used mbufs from Tx mbuf ring into Rx. */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	uintptr_t reserved2[2];
 	/**@}*/
 
 } __rte_cache_aligned;
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index b965d6aa52..eec159dfdd 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -312,6 +312,9 @@ EXPERIMENTAL {
 	rte_flow_async_action_list_handle_query_update;
 	rte_flow_async_actions_update;
 	rte_flow_restore_info_dynflag;
+
+	# added in 23.11
+	rte_eth_recycle_rx_queue_info_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* RE: [PATCH v11 1/4] ethdev: add API for mbufs recycle mode
  2023-08-22  7:27  3%   ` [PATCH v11 1/4] ethdev: add API for mbufs recycle mode Feifei Wang
  2023-08-22 23:33  0%     ` Konstantin Ananyev
@ 2023-08-24  3:38  0%     ` Feifei Wang
  1 sibling, 0 replies; 200+ results
From: Feifei Wang @ 2023-08-24  3:38 UTC (permalink / raw)
  To: Feifei Wang, Konstantin Ananyev
  Cc: dev, nd, Honnappa Nagarahalli, Ruifeng Wang, Morten Brørup,
	thomas, Ferruh Yigit, Andrew Rybchenko, nd

For Konstantin

> -----Original Message-----
> From: Feifei Wang <feifei.wang2@arm.com>
> Sent: Tuesday, August 22, 2023 3:27 PM
> To: thomas@monjalon.net; Ferruh Yigit <ferruh.yigit@amd.com>; Andrew
> Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Cc: dev@dpdk.org; nd <nd@arm.com>; Feifei Wang
> <Feifei.Wang2@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>; Ruifeng Wang
> <Ruifeng.Wang@arm.com>; Morten Brørup <mb@smartsharesystems.com>
> Subject: [PATCH v11 1/4] ethdev: add API for mbufs recycle mode
> 
> Add 'rte_eth_recycle_rx_queue_info_get' and 'rte_eth_recycle_mbufs'
> APIs to recycle used mbufs from a transmit queue of an Ethernet device, and
> move these mbufs into a mbuf ring for a receive queue of an Ethernet device.
> This can bypass mempool 'put/get' operations hence saving CPU cycles.
> 
> For each recycling mbufs, the rte_eth_recycle_mbufs() function performs the
> following operations:
> - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf ring.
> - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed from
> the Tx mbuf ring.
> 
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  doc/guides/rel_notes/release_23_11.rst |  15 ++
>  lib/ethdev/ethdev_driver.h             |  10 ++
>  lib/ethdev/ethdev_private.c            |   2 +
>  lib/ethdev/rte_ethdev.c                |  31 +++++
>  lib/ethdev/rte_ethdev.h                | 181 +++++++++++++++++++++++++
>  lib/ethdev/rte_ethdev_core.h           |  23 +++-
>  lib/ethdev/version.map                 |   3 +
>  7 files changed, 259 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_23_11.rst
> b/doc/guides/rel_notes/release_23_11.rst
> index 4411bb32c1..02ee3867a0 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -72,6 +72,13 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =======================================================
> 
> +* **Add mbufs recycling support.**
> +
> +  Added ``rte_eth_recycle_rx_queue_info_get`` and
> + ``rte_eth_recycle_mbufs``  APIs which allow the user to copy used
> + mbufs from the Tx mbuf ring  into the Rx mbuf ring. This feature
> + supports the case that the Rx Ethernet  device is different from the
> + Tx Ethernet device with respective driver  callback functions in
> ``rte_eth_recycle_mbufs``.
> 
>  Removed Items
>  -------------
> @@ -123,6 +130,14 @@ ABI Changes
>     Also, make sure to start the actual text at the margin.
>     =======================================================
> 
> +* ethdev: Added ``recycle_tx_mbufs_reuse`` and
> +``recycle_rx_descriptors_refill``
> +  fields to ``rte_eth_dev`` structure.
> +
> +* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
> +  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
> +  fields, to move ``rxq`` and ``txq`` fields, to change the size of
> +  ``reserved1`` and ``reserved2`` fields.
> +
> 
>  Known Issues
>  ------------
> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index
> 980f837ab6..b0c55a8523 100644
> --- a/lib/ethdev/ethdev_driver.h
> +++ b/lib/ethdev/ethdev_driver.h
> @@ -58,6 +58,10 @@ struct rte_eth_dev {
>  	eth_rx_descriptor_status_t rx_descriptor_status;
>  	/** Check the status of a Tx descriptor */
>  	eth_tx_descriptor_status_t tx_descriptor_status;
> +	/** Pointer to PMD transmit mbufs reuse function */
> +	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
> +	/** Pointer to PMD receive descriptors refill function */
> +	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
> 
>  	/**
>  	 * Device data that is shared between primary and secondary
> processes @@ -507,6 +511,10 @@ typedef void (*eth_rxq_info_get_t)(struct
> rte_eth_dev *dev,  typedef void (*eth_txq_info_get_t)(struct rte_eth_dev
> *dev,
>  	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
> 
> +typedef void (*eth_recycle_rxq_info_get_t)(struct rte_eth_dev *dev,
> +	uint16_t rx_queue_id,
> +	struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
>  typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
>  	uint16_t queue_id, struct rte_eth_burst_mode *mode);
> 
> @@ -1250,6 +1258,8 @@ struct eth_dev_ops {
>  	eth_rxq_info_get_t         rxq_info_get;
>  	/** Retrieve Tx queue information */
>  	eth_txq_info_get_t         txq_info_get;
> +	/** Retrieve mbufs recycle Rx queue information */
> +	eth_recycle_rxq_info_get_t recycle_rxq_info_get;
>  	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst
> mode */
>  	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst
> mode */
>  	eth_fw_version_get_t       fw_version_get; /**< Get firmware version
> */
> diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c index
> 14ec8c6ccf..f8ab64f195 100644
> --- a/lib/ethdev/ethdev_private.c
> +++ b/lib/ethdev/ethdev_private.c
> @@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
>  	fpo->rx_queue_count = dev->rx_queue_count;
>  	fpo->rx_descriptor_status = dev->rx_descriptor_status;
>  	fpo->tx_descriptor_status = dev->tx_descriptor_status;
> +	fpo->recycle_tx_mbufs_reuse = dev->recycle_tx_mbufs_reuse;
> +	fpo->recycle_rx_descriptors_refill =
> +dev->recycle_rx_descriptors_refill;
> 
>  	fpo->rxq.data = dev->data->rx_queues;
>  	fpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index
> 0840d2b594..ea89a101a1 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -5876,6 +5876,37 @@ rte_eth_tx_queue_info_get(uint16_t port_id,
> uint16_t queue_id,
>  	return 0;
>  }
> 
> +int
> +rte_eth_recycle_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info) {
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (queue_id >= dev->data->nb_rx_queues) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u\n",
> queue_id);
> +		return -EINVAL;
> +	}
> +
> +	if (dev->data->rx_queues == NULL ||
> +			dev->data->rx_queues[queue_id] == NULL) {
> +		RTE_ETHDEV_LOG(ERR,
> +			   "Rx queue %"PRIu16" of device with port_id=%"
> +			   PRIu16" has not been setup\n",
> +			   queue_id, port_id);
> +		return -EINVAL;
> +	}
> +
> +	if (*dev->dev_ops->recycle_rxq_info_get == NULL)
> +		return -ENOTSUP;
> +
> +	dev->dev_ops->recycle_rxq_info_get(dev, queue_id, recycle_rxq_info);
> +
> +	return 0;
> +}
> +
>  int
>  rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
>  			  struct rte_eth_burst_mode *mode)
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index
> 04a2564f22..9dc5749d83 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -1820,6 +1820,30 @@ struct rte_eth_txq_info {
>  	uint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */
>  } __rte_cache_min_aligned;
> 
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this structure may change without prior notice.
> + *
> + * Ethernet device Rx queue information structure for recycling mbufs.
> + * Used to retrieve Rx queue information when Tx queue reusing mbufs
> +and moving
> + * them into Rx mbuf ring.
> + */
> +struct rte_eth_recycle_rxq_info {
> +	struct rte_mbuf **mbuf_ring; /**< mbuf ring of Rx queue. */
> +	struct rte_mempool *mp;     /**< mempool of Rx queue. */
> +	uint16_t *refill_head;      /**< head of Rx queue refilling mbufs. */
> +	uint16_t *receive_tail;     /**< tail of Rx queue receiving pkts. */
> +	uint16_t mbuf_ring_size;     /**< configured number of mbuf ring size.
> */
> +	/**
> +	 * Requirement on mbuf refilling batch size of Rx mbuf ring.
> +	 * For some PMD drivers, the number of Rx mbuf ring refilling mbufs
> +	 * should be aligned with mbuf ring size, in order to simplify
> +	 * ring wrapping around.
> +	 * Value 0 means that PMD drivers have no requirement for this.
> +	 */
> +	uint16_t refill_requirement;
> +} __rte_cache_min_aligned;
> +
>  /* Generic Burst mode flag definition, values can be ORed. */
> 
>  /**
> @@ -4853,6 +4877,31 @@ int rte_eth_rx_queue_info_get(uint16_t port_id,
> uint16_t queue_id,  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t
> queue_id,
>  	struct rte_eth_txq_info *qinfo);
> 
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior
> +notice
> + *
> + * Retrieve information about given ports's Rx queue for recycling mbufs.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param queue_id
> + *   The Rx queue on the Ethernet devicefor which information
> + *   will be retrieved.
> + * @param recycle_rxq_info
> + *   A pointer to a structure of type *rte_eth_recycle_rxq_info* to be filled.
> + *
> + * @return
> + *   - 0: Success
> + *   - -ENODEV:  If *port_id* is invalid.
> + *   - -ENOTSUP: routine is not supported by the device PMD.
> + *   - -EINVAL:  The queue_id is out of range.
> + */
> +__rte_experimental
> +int rte_eth_recycle_rx_queue_info_get(uint16_t port_id,
> +		uint16_t queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
>  /**
>   * Retrieve information about the Rx packet burst mode.
>   *
> @@ -6527,6 +6576,138 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t
> queue_id,
>  	return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);  }
> 
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior
> +notice
> + *
> + * Recycle used mbufs from a transmit queue of an Ethernet device, and
> +move
> + * these mbufs into a mbuf ring for a receive queue of an Ethernet device.
> + * This can bypass mempool path to save CPU cycles.
> + *
> + * The rte_eth_recycle_mbufs() function loops, with rte_eth_rx_burst()
> +and
> + * rte_eth_tx_burst() functions, freeing Tx used mbufs and replenishing
> +Rx
> + * descriptors. The number of recycling mbufs depends on the request of
> +Rx mbuf
> + * ring, with the constraint of enough used mbufs from Tx mbuf ring.
> + *
> + * For each recycling mbufs, the rte_eth_recycle_mbufs() function
> +performs the
> + * following operations:
> + *
> + * - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf
> ring.
> + *
> + * - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
> + *   from the Tx mbuf ring.
> + *
> + * This function spilts Rx and Tx path with different callback
> +functions. The
> + * callback function recycle_tx_mbufs_reuse is for Tx driver. The
> +callback
> + * function recycle_rx_descriptors_refill is for Rx driver.
> +rte_eth_recycle_mbufs()
> + * can support the case that Rx Ethernet device is different from Tx Ethernet
> device.
> + *
> + * It is the responsibility of users to select the Rx/Tx queue pair to
> +recycle
> + * mbufs. Before call this function, users must call
> +rte_eth_recycle_rxq_info_get
> + * function to retrieve selected Rx queue information.
> + * @see rte_eth_recycle_rxq_info_get, struct rte_eth_recycle_rxq_info
> + *
> + * Currently, the rte_eth_recycle_mbufs() function can support to feed
> +1 Rx queue from
> + * 2 Tx queues in the same thread. Do not pair the Rx queue and Tx
> +queue in different
> + * threads, in order to avoid memory error rewriting.
> + *
> + * @param rx_port_id
> + *   Port identifying the receive side.
> + * @param rx_queue_id
> + *   The index of the receive queue identifying the receive side.
> + *   The value must be in the range [0, nb_rx_queue - 1] previously supplied
> + *   to rte_eth_dev_configure().
> + * @param tx_port_id
> + *   Port identifying the transmit side.
> + * @param tx_queue_id
> + *   The index of the transmit queue identifying the transmit side.
> + *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
> + *   to rte_eth_dev_configure().
> + * @param recycle_rxq_info
> + *   A pointer to a structure of type *rte_eth_recycle_rxq_info* which contains
> + *   the information of the Rx queue mbuf ring.
> + * @return
> + *   The number of recycling mbufs.
> + */
> +__rte_experimental
> +static inline uint16_t
> +rte_eth_recycle_mbufs(uint16_t rx_port_id, uint16_t rx_queue_id,
> +		uint16_t tx_port_id, uint16_t tx_queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info) {
> +	struct rte_eth_fp_ops *p;
> +	void *qd;
> +	uint16_t nb_mbufs;
> +
> +#ifdef RTE_ETHDEV_DEBUG_TX
> +	if (tx_port_id >= RTE_MAX_ETHPORTS ||
> +			tx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
> +		RTE_ETHDEV_LOG(ERR,
> +				"Invalid tx_port_id=%u or
> tx_queue_id=%u\n",
> +				tx_port_id, tx_queue_id);
> +		return 0;
> +	}
> +#endif
> +
> +	/* fetch pointer to queue data */
> +	p = &rte_eth_fp_ops[tx_port_id];
> +	qd = p->txq.data[tx_queue_id];
> +
> +#ifdef RTE_ETHDEV_DEBUG_TX
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port_id, 0);
> +
> +	if (qd == NULL) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u for
> port_id=%u\n",
> +				tx_queue_id, tx_port_id);
> +		return 0;
> +	}
> +#endif
> +	if (p->recycle_tx_mbufs_reuse == NULL)
> +		return 0;
> +
> +	/* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
> +	 * into Rx mbuf ring.
> +	 */
> +	nb_mbufs = p->recycle_tx_mbufs_reuse(qd, recycle_rxq_info);
> +
[Konstantin]
It is probably better to do that call after rx_port_id, rx_queue_id, 
etc. checks.
Otherwise with some errorneous params we can get mbufs, from TXQ,
'rx_refill' would not happen and we will return zero.
With that in place:
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>


Thanks for the comments, I will put all check before function call.

> +	/* If no recycling mbufs, return 0. */
> +	if (nb_mbufs == 0)
> +		return 0;
> +
> +#ifdef RTE_ETHDEV_DEBUG_RX
> +	if (rx_port_id >= RTE_MAX_ETHPORTS ||
> +			rx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid rx_port_id=%u or
> rx_queue_id=%u\n",
> +				rx_port_id, rx_queue_id);
> +		return 0;
> +	}
> +#endif
> +
> +	/* fetch pointer to queue data */
> +	p = &rte_eth_fp_ops[rx_port_id];
> +	qd = p->rxq.data[rx_queue_id];
> +
> +#ifdef RTE_ETHDEV_DEBUG_RX
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port_id, 0);
> +
> +	if (qd == NULL) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u for
> port_id=%u\n",
> +				rx_queue_id, rx_port_id);
> +		return 0;
> +	}
> +#endif
> +
> +	if (p->recycle_rx_descriptors_refill == NULL)
> +		return 0;
> +
> +	/* Replenish the Rx descriptors with the recycling
> +	 * into Rx mbuf ring.
> +	 */
> +	p->recycle_rx_descriptors_refill(qd, nb_mbufs);
> +
> +	return nb_mbufs;
> +}
> +
>  /**
>   * @warning
>   * @b EXPERIMENTAL: this API may change without prior notice diff --git
> a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h index
> 46e9721e07..a24ad7a6b2 100644
> --- a/lib/ethdev/rte_ethdev_core.h
> +++ b/lib/ethdev/rte_ethdev_core.h
> @@ -55,6 +55,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq,
> uint16_t offset);
>  /** @internal Check the status of a Tx descriptor */  typedef int
> (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
> 
> +/** @internal Copy used mbufs from Tx mbuf ring into Rx mbuf ring */
> +typedef uint16_t (*eth_recycle_tx_mbufs_reuse_t)(void *txq,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
> +/** @internal Refill Rx descriptors with the recycling mbufs */ typedef
> +void (*eth_recycle_rx_descriptors_refill_t)(void *rxq, uint16_t nb);
> +
>  /**
>   * @internal
>   * Structure used to hold opaque pointers to internal ethdev Rx/Tx @@ -
> 83,15 +90,17 @@ struct rte_eth_fp_ops {
>  	 * Rx fast-path functions and related data.
>  	 * 64-bit systems: occupies first 64B line
>  	 */
> +	/** Rx queues data. */
> +	struct rte_ethdev_qdata rxq;
>  	/** PMD receive function. */
>  	eth_rx_burst_t rx_pkt_burst;
>  	/** Get the number of used Rx descriptors. */
>  	eth_rx_queue_count_t rx_queue_count;
>  	/** Check the status of a Rx descriptor. */
>  	eth_rx_descriptor_status_t rx_descriptor_status;
> -	/** Rx queues data. */
> -	struct rte_ethdev_qdata rxq;
> -	uintptr_t reserved1[3];
> +	/** Refill Rx descriptors with the recycling mbufs. */
> +	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
> +	uintptr_t reserved1[2];
>  	/**@}*/
> 
>  	/**@{*/
> @@ -99,15 +108,17 @@ struct rte_eth_fp_ops {
>  	 * Tx fast-path functions and related data.
>  	 * 64-bit systems: occupies second 64B line
>  	 */
> +	/** Tx queues data. */
> +	struct rte_ethdev_qdata txq;
>  	/** PMD transmit function. */
>  	eth_tx_burst_t tx_pkt_burst;
>  	/** PMD transmit prepare function. */
>  	eth_tx_prep_t tx_pkt_prepare;
>  	/** Check the status of a Tx descriptor. */
>  	eth_tx_descriptor_status_t tx_descriptor_status;
> -	/** Tx queues data. */
> -	struct rte_ethdev_qdata txq;
> -	uintptr_t reserved2[3];
> +	/** Copy used mbufs from Tx mbuf ring into Rx. */
> +	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
> +	uintptr_t reserved2[2];
>  	/**@}*/
> 
>  } __rte_cache_aligned;
> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index
> b965d6aa52..eec159dfdd 100644
> --- a/lib/ethdev/version.map
> +++ b/lib/ethdev/version.map
> @@ -312,6 +312,9 @@ EXPERIMENTAL {
>  	rte_flow_async_action_list_handle_query_update;
>  	rte_flow_async_actions_update;
>  	rte_flow_restore_info_dynflag;
> +
> +	# added in 23.11
> +	rte_eth_recycle_rx_queue_info_get;
>  };
> 
>  INTERNAL {
> --
> 2.25.1


^ permalink raw reply	[relevance 0%]

* Re: [PATCH v11 1/4] ethdev: add API for mbufs recycle mode
  2023-08-22  7:27  3%   ` [PATCH v11 1/4] ethdev: add API for mbufs recycle mode Feifei Wang
@ 2023-08-22 23:33  0%     ` Konstantin Ananyev
  2023-08-24  3:38  0%     ` Feifei Wang
  1 sibling, 0 replies; 200+ results
From: Konstantin Ananyev @ 2023-08-22 23:33 UTC (permalink / raw)
  To: Feifei Wang, Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, nd, Honnappa Nagarahalli, Ruifeng Wang, Morten Brørup

Hi Feifei,

> Add 'rte_eth_recycle_rx_queue_info_get' and 'rte_eth_recycle_mbufs'
> APIs to recycle used mbufs from a transmit queue of an Ethernet device,
> and move these mbufs into a mbuf ring for a receive queue of an Ethernet
> device. This can bypass mempool 'put/get' operations hence saving CPU
> cycles.
> 
> For each recycling mbufs, the rte_eth_recycle_mbufs() function performs
> the following operations:
> - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf
> ring.
> - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
> from the Tx mbuf ring.
> 
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>   doc/guides/rel_notes/release_23_11.rst |  15 ++
>   lib/ethdev/ethdev_driver.h             |  10 ++
>   lib/ethdev/ethdev_private.c            |   2 +
>   lib/ethdev/rte_ethdev.c                |  31 +++++
>   lib/ethdev/rte_ethdev.h                | 181 +++++++++++++++++++++++++
>   lib/ethdev/rte_ethdev_core.h           |  23 +++-
>   lib/ethdev/version.map                 |   3 +
>   7 files changed, 259 insertions(+), 6 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index 4411bb32c1..02ee3867a0 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -72,6 +72,13 @@ New Features
>        Also, make sure to start the actual text at the margin.
>        =======================================================
>   
> +* **Add mbufs recycling support.**
> +
> +  Added ``rte_eth_recycle_rx_queue_info_get`` and ``rte_eth_recycle_mbufs``
> +  APIs which allow the user to copy used mbufs from the Tx mbuf ring
> +  into the Rx mbuf ring. This feature supports the case that the Rx Ethernet
> +  device is different from the Tx Ethernet device with respective driver
> +  callback functions in ``rte_eth_recycle_mbufs``.
>   
>   Removed Items
>   -------------
> @@ -123,6 +130,14 @@ ABI Changes
>      Also, make sure to start the actual text at the margin.
>      =======================================================
>   
> +* ethdev: Added ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
> +  fields to ``rte_eth_dev`` structure.
> +
> +* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
> +  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
> +  fields, to move ``rxq`` and ``txq`` fields, to change the size of
> +  ``reserved1`` and ``reserved2`` fields.
> +
>   
>   Known Issues
>   ------------
> diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
> index 980f837ab6..b0c55a8523 100644
> --- a/lib/ethdev/ethdev_driver.h
> +++ b/lib/ethdev/ethdev_driver.h
> @@ -58,6 +58,10 @@ struct rte_eth_dev {
>   	eth_rx_descriptor_status_t rx_descriptor_status;
>   	/** Check the status of a Tx descriptor */
>   	eth_tx_descriptor_status_t tx_descriptor_status;
> +	/** Pointer to PMD transmit mbufs reuse function */
> +	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
> +	/** Pointer to PMD receive descriptors refill function */
> +	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
>   
>   	/**
>   	 * Device data that is shared between primary and secondary processes
> @@ -507,6 +511,10 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
>   typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
>   	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
>   
> +typedef void (*eth_recycle_rxq_info_get_t)(struct rte_eth_dev *dev,
> +	uint16_t rx_queue_id,
> +	struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
>   typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
>   	uint16_t queue_id, struct rte_eth_burst_mode *mode);
>   
> @@ -1250,6 +1258,8 @@ struct eth_dev_ops {
>   	eth_rxq_info_get_t         rxq_info_get;
>   	/** Retrieve Tx queue information */
>   	eth_txq_info_get_t         txq_info_get;
> +	/** Retrieve mbufs recycle Rx queue information */
> +	eth_recycle_rxq_info_get_t recycle_rxq_info_get;
>   	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst mode */
>   	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst mode */
>   	eth_fw_version_get_t       fw_version_get; /**< Get firmware version */
> diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c
> index 14ec8c6ccf..f8ab64f195 100644
> --- a/lib/ethdev/ethdev_private.c
> +++ b/lib/ethdev/ethdev_private.c
> @@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
>   	fpo->rx_queue_count = dev->rx_queue_count;
>   	fpo->rx_descriptor_status = dev->rx_descriptor_status;
>   	fpo->tx_descriptor_status = dev->tx_descriptor_status;
> +	fpo->recycle_tx_mbufs_reuse = dev->recycle_tx_mbufs_reuse;
> +	fpo->recycle_rx_descriptors_refill = dev->recycle_rx_descriptors_refill;
>   
>   	fpo->rxq.data = dev->data->rx_queues;
>   	fpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index 0840d2b594..ea89a101a1 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -5876,6 +5876,37 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>   	return 0;
>   }
>   
> +int
> +rte_eth_recycle_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +	dev = &rte_eth_devices[port_id];
> +
> +	if (queue_id >= dev->data->nb_rx_queues) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u\n", queue_id);
> +		return -EINVAL;
> +	}
> +
> +	if (dev->data->rx_queues == NULL ||
> +			dev->data->rx_queues[queue_id] == NULL) {
> +		RTE_ETHDEV_LOG(ERR,
> +			   "Rx queue %"PRIu16" of device with port_id=%"
> +			   PRIu16" has not been setup\n",
> +			   queue_id, port_id);
> +		return -EINVAL;
> +	}
> +
> +	if (*dev->dev_ops->recycle_rxq_info_get == NULL)
> +		return -ENOTSUP;
> +
> +	dev->dev_ops->recycle_rxq_info_get(dev, queue_id, recycle_rxq_info);
> +
> +	return 0;
> +}
> +
>   int
>   rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
>   			  struct rte_eth_burst_mode *mode)
> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
> index 04a2564f22..9dc5749d83 100644
> --- a/lib/ethdev/rte_ethdev.h
> +++ b/lib/ethdev/rte_ethdev.h
> @@ -1820,6 +1820,30 @@ struct rte_eth_txq_info {
>   	uint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */
>   } __rte_cache_min_aligned;
>   
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this structure may change without prior notice.
> + *
> + * Ethernet device Rx queue information structure for recycling mbufs.
> + * Used to retrieve Rx queue information when Tx queue reusing mbufs and moving
> + * them into Rx mbuf ring.
> + */
> +struct rte_eth_recycle_rxq_info {
> +	struct rte_mbuf **mbuf_ring; /**< mbuf ring of Rx queue. */
> +	struct rte_mempool *mp;     /**< mempool of Rx queue. */
> +	uint16_t *refill_head;      /**< head of Rx queue refilling mbufs. */
> +	uint16_t *receive_tail;     /**< tail of Rx queue receiving pkts. */
> +	uint16_t mbuf_ring_size;     /**< configured number of mbuf ring size. */
> +	/**
> +	 * Requirement on mbuf refilling batch size of Rx mbuf ring.
> +	 * For some PMD drivers, the number of Rx mbuf ring refilling mbufs
> +	 * should be aligned with mbuf ring size, in order to simplify
> +	 * ring wrapping around.
> +	 * Value 0 means that PMD drivers have no requirement for this.
> +	 */
> +	uint16_t refill_requirement;
> +} __rte_cache_min_aligned;
> +
>   /* Generic Burst mode flag definition, values can be ORed. */
>   
>   /**
> @@ -4853,6 +4877,31 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>   int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>   	struct rte_eth_txq_info *qinfo);
>   
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
> + *
> + * Retrieve information about given ports's Rx queue for recycling mbufs.
> + *
> + * @param port_id
> + *   The port identifier of the Ethernet device.
> + * @param queue_id
> + *   The Rx queue on the Ethernet devicefor which information
> + *   will be retrieved.
> + * @param recycle_rxq_info
> + *   A pointer to a structure of type *rte_eth_recycle_rxq_info* to be filled.
> + *
> + * @return
> + *   - 0: Success
> + *   - -ENODEV:  If *port_id* is invalid.
> + *   - -ENOTSUP: routine is not supported by the device PMD.
> + *   - -EINVAL:  The queue_id is out of range.
> + */
> +__rte_experimental
> +int rte_eth_recycle_rx_queue_info_get(uint16_t port_id,
> +		uint16_t queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
>   /**
>    * Retrieve information about the Rx packet burst mode.
>    *
> @@ -6527,6 +6576,138 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
>   	return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
>   }
>   
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
> + *
> + * Recycle used mbufs from a transmit queue of an Ethernet device, and move
> + * these mbufs into a mbuf ring for a receive queue of an Ethernet device.
> + * This can bypass mempool path to save CPU cycles.
> + *
> + * The rte_eth_recycle_mbufs() function loops, with rte_eth_rx_burst() and
> + * rte_eth_tx_burst() functions, freeing Tx used mbufs and replenishing Rx
> + * descriptors. The number of recycling mbufs depends on the request of Rx mbuf
> + * ring, with the constraint of enough used mbufs from Tx mbuf ring.
> + *
> + * For each recycling mbufs, the rte_eth_recycle_mbufs() function performs the
> + * following operations:
> + *
> + * - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf ring.
> + *
> + * - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
> + *   from the Tx mbuf ring.
> + *
> + * This function spilts Rx and Tx path with different callback functions. The
> + * callback function recycle_tx_mbufs_reuse is for Tx driver. The callback
> + * function recycle_rx_descriptors_refill is for Rx driver. rte_eth_recycle_mbufs()
> + * can support the case that Rx Ethernet device is different from Tx Ethernet device.
> + *
> + * It is the responsibility of users to select the Rx/Tx queue pair to recycle
> + * mbufs. Before call this function, users must call rte_eth_recycle_rxq_info_get
> + * function to retrieve selected Rx queue information.
> + * @see rte_eth_recycle_rxq_info_get, struct rte_eth_recycle_rxq_info
> + *
> + * Currently, the rte_eth_recycle_mbufs() function can support to feed 1 Rx queue from
> + * 2 Tx queues in the same thread. Do not pair the Rx queue and Tx queue in different
> + * threads, in order to avoid memory error rewriting.
> + *
> + * @param rx_port_id
> + *   Port identifying the receive side.
> + * @param rx_queue_id
> + *   The index of the receive queue identifying the receive side.
> + *   The value must be in the range [0, nb_rx_queue - 1] previously supplied
> + *   to rte_eth_dev_configure().
> + * @param tx_port_id
> + *   Port identifying the transmit side.
> + * @param tx_queue_id
> + *   The index of the transmit queue identifying the transmit side.
> + *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
> + *   to rte_eth_dev_configure().
> + * @param recycle_rxq_info
> + *   A pointer to a structure of type *rte_eth_recycle_rxq_info* which contains
> + *   the information of the Rx queue mbuf ring.
> + * @return
> + *   The number of recycling mbufs.
> + */
> +__rte_experimental
> +static inline uint16_t
> +rte_eth_recycle_mbufs(uint16_t rx_port_id, uint16_t rx_queue_id,
> +		uint16_t tx_port_id, uint16_t tx_queue_id,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
> +{
> +	struct rte_eth_fp_ops *p;
> +	void *qd;
> +	uint16_t nb_mbufs;
> +
> +#ifdef RTE_ETHDEV_DEBUG_TX
> +	if (tx_port_id >= RTE_MAX_ETHPORTS ||
> +			tx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
> +		RTE_ETHDEV_LOG(ERR,
> +				"Invalid tx_port_id=%u or tx_queue_id=%u\n",
> +				tx_port_id, tx_queue_id);
> +		return 0;
> +	}
> +#endif
> +
> +	/* fetch pointer to queue data */
> +	p = &rte_eth_fp_ops[tx_port_id];
> +	qd = p->txq.data[tx_queue_id];
> +
> +#ifdef RTE_ETHDEV_DEBUG_TX
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port_id, 0);
> +
> +	if (qd == NULL) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u for port_id=%u\n",
> +				tx_queue_id, tx_port_id);
> +		return 0;
> +	}
> +#endif
> +	if (p->recycle_tx_mbufs_reuse == NULL)
> +		return 0;
> +
> +	/* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
> +	 * into Rx mbuf ring.
> +	 */
> +	nb_mbufs = p->recycle_tx_mbufs_reuse(qd, recycle_rxq_info);

It is probably better to do that call after rx_port_id, rx_queue_id, 
etc. checks.
Otherwise with some errorneous params we can get mbufs, from TXQ,
'rx_refill' would not happen and we will return zero.
With that in place:
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>

> +
> +	/* If no recycling mbufs, return 0. */
> +	if (nb_mbufs == 0)
> +		return 0;
> +
> +#ifdef RTE_ETHDEV_DEBUG_RX
> +	if (rx_port_id >= RTE_MAX_ETHPORTS ||
> +			rx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid rx_port_id=%u or rx_queue_id=%u\n",
> +				rx_port_id, rx_queue_id);
> +		return 0;
> +	}
> +#endif
> +
> +	/* fetch pointer to queue data */
> +	p = &rte_eth_fp_ops[rx_port_id];
> +	qd = p->rxq.data[rx_queue_id];
> +
> +#ifdef RTE_ETHDEV_DEBUG_RX
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port_id, 0);
> +
> +	if (qd == NULL) {
> +		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u for port_id=%u\n",
> +				rx_queue_id, rx_port_id);
> +		return 0;
> +	}
> +#endif
> +
> +	if (p->recycle_rx_descriptors_refill == NULL)
> +		return 0;
> +
> +	/* Replenish the Rx descriptors with the recycling
> +	 * into Rx mbuf ring.
> +	 */
> +	p->recycle_rx_descriptors_refill(qd, nb_mbufs);
> +
> +	return nb_mbufs;
> +}
> +
>   /**
>    * @warning
>    * @b EXPERIMENTAL: this API may change without prior notice
> diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
> index 46e9721e07..a24ad7a6b2 100644
> --- a/lib/ethdev/rte_ethdev_core.h
> +++ b/lib/ethdev/rte_ethdev_core.h
> @@ -55,6 +55,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
>   /** @internal Check the status of a Tx descriptor */
>   typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
>   
> +/** @internal Copy used mbufs from Tx mbuf ring into Rx mbuf ring */
> +typedef uint16_t (*eth_recycle_tx_mbufs_reuse_t)(void *txq,
> +		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
> +
> +/** @internal Refill Rx descriptors with the recycling mbufs */
> +typedef void (*eth_recycle_rx_descriptors_refill_t)(void *rxq, uint16_t nb);
> +
>   /**
>    * @internal
>    * Structure used to hold opaque pointers to internal ethdev Rx/Tx
> @@ -83,15 +90,17 @@ struct rte_eth_fp_ops {
>   	 * Rx fast-path functions and related data.
>   	 * 64-bit systems: occupies first 64B line
>   	 */
> +	/** Rx queues data. */
> +	struct rte_ethdev_qdata rxq;
>   	/** PMD receive function. */
>   	eth_rx_burst_t rx_pkt_burst;
>   	/** Get the number of used Rx descriptors. */
>   	eth_rx_queue_count_t rx_queue_count;
>   	/** Check the status of a Rx descriptor. */
>   	eth_rx_descriptor_status_t rx_descriptor_status;
> -	/** Rx queues data. */
> -	struct rte_ethdev_qdata rxq;
> -	uintptr_t reserved1[3];
> +	/** Refill Rx descriptors with the recycling mbufs. */
> +	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
> +	uintptr_t reserved1[2];
>   	/**@}*/
>   
>   	/**@{*/
> @@ -99,15 +108,17 @@ struct rte_eth_fp_ops {
>   	 * Tx fast-path functions and related data.
>   	 * 64-bit systems: occupies second 64B line
>   	 */
> +	/** Tx queues data. */
> +	struct rte_ethdev_qdata txq;
>   	/** PMD transmit function. */
>   	eth_tx_burst_t tx_pkt_burst;
>   	/** PMD transmit prepare function. */
>   	eth_tx_prep_t tx_pkt_prepare;
>   	/** Check the status of a Tx descriptor. */
>   	eth_tx_descriptor_status_t tx_descriptor_status;
> -	/** Tx queues data. */
> -	struct rte_ethdev_qdata txq;
> -	uintptr_t reserved2[3];
> +	/** Copy used mbufs from Tx mbuf ring into Rx. */
> +	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
> +	uintptr_t reserved2[2];
>   	/**@}*/
>   
>   } __rte_cache_aligned;
> diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
> index b965d6aa52..eec159dfdd 100644
> --- a/lib/ethdev/version.map
> +++ b/lib/ethdev/version.map
> @@ -312,6 +312,9 @@ EXPERIMENTAL {
>   	rte_flow_async_action_list_handle_query_update;
>   	rte_flow_async_actions_update;
>   	rte_flow_restore_info_dynflag;
> +
> +	# added in 23.11
> +	rte_eth_recycle_rx_queue_info_get;
>   };
>   
>   INTERNAL {


^ permalink raw reply	[relevance 0%]

* [PATCH v6 3/6] eal: add rte atomic qualifier with casts
  2023-08-22 21:00  3% ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
@ 2023-08-22 21:00  2%   ` Tyler Retzlaff
  2023-08-29 15:57  0%   ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
  2023-09-29 14:09  0%   ` David Marchand
  2 siblings, 0 replies; 200+ results
From: Tyler Retzlaff @ 2023-08-22 21:00 UTC (permalink / raw)
  To: dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, Konstantin Ananyev, David Hunt,
	Thomas Monjalon, David Marchand, Tyler Retzlaff

Introduce __rte_atomic qualifying casts in rte_optional atomics inline
functions to prevent cascading the need to pass __rte_atomic qualified
arguments.

Warning, this is really implementation dependent and being done
temporarily to avoid having to convert more of the libraries and tests in
DPDK in the initial series that introduces the API. The consequence of the
assumption of the ABI of the types in question not being ``the same'' is
only a risk that may be realized when enable_stdatomic=true.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
---
 lib/eal/include/generic/rte_atomic.h | 48 ++++++++++++++++++++++++------------
 lib/eal/include/generic/rte_pause.h  |  9 ++++---
 lib/eal/x86/rte_power_intrinsics.c   |  7 +++---
 3 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index 5940e7e..709bf15 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -274,7 +274,8 @@
 static inline void
 rte_atomic16_add(rte_atomic16_t *v, int16_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -288,7 +289,8 @@
 static inline void
 rte_atomic16_sub(rte_atomic16_t *v, int16_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -341,7 +343,8 @@
 static inline int16_t
 rte_atomic16_add_return(rte_atomic16_t *v, int16_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 
 /**
@@ -361,7 +364,8 @@
 static inline int16_t
 rte_atomic16_sub_return(rte_atomic16_t *v, int16_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 
 /**
@@ -380,7 +384,8 @@
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, 1, rte_memory_order_seq_cst) + 1 == 0;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) + 1 == 0;
 }
 #endif
 
@@ -400,7 +405,8 @@ static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic16_dec_and_test(rte_atomic16_t *v)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, 1, rte_memory_order_seq_cst) - 1 == 0;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) - 1 == 0;
 }
 #endif
 
@@ -553,7 +559,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline void
 rte_atomic32_add(rte_atomic32_t *v, int32_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -567,7 +574,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline void
 rte_atomic32_sub(rte_atomic32_t *v, int32_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -620,7 +628,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline int32_t
 rte_atomic32_add_return(rte_atomic32_t *v, int32_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 
 /**
@@ -640,7 +649,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline int32_t
 rte_atomic32_sub_return(rte_atomic32_t *v, int32_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 
 /**
@@ -659,7 +669,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, 1, rte_memory_order_seq_cst) + 1 == 0;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) + 1 == 0;
 }
 #endif
 
@@ -679,7 +690,8 @@ static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, 1, rte_memory_order_seq_cst) - 1 == 0;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) - 1 == 0;
 }
 #endif
 
@@ -885,7 +897,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline void
 rte_atomic64_add(rte_atomic64_t *v, int64_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int64_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 #endif
 
@@ -904,7 +917,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline void
 rte_atomic64_sub(rte_atomic64_t *v, int64_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int64_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 #endif
 
@@ -962,7 +976,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline int64_t
 rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int64_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 #endif
 
@@ -986,7 +1001,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline int64_t
 rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int64_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 #endif
 
diff --git a/lib/eal/include/generic/rte_pause.h b/lib/eal/include/generic/rte_pause.h
index 256309e..b7b059f 100644
--- a/lib/eal/include/generic/rte_pause.h
+++ b/lib/eal/include/generic/rte_pause.h
@@ -81,7 +81,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint16_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
@@ -91,7 +92,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint32_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
@@ -101,7 +103,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint64_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c
index cf70e33..fb8539f 100644
--- a/lib/eal/x86/rte_power_intrinsics.c
+++ b/lib/eal/x86/rte_power_intrinsics.c
@@ -23,9 +23,10 @@
 	uint64_t val;
 
 	/* trigger a write but don't change the value */
-	val = rte_atomic_load_explicit((volatile uint64_t *)addr, rte_memory_order_relaxed);
-	rte_atomic_compare_exchange_strong_explicit((volatile uint64_t *)addr, &val, val,
-			rte_memory_order_relaxed, rte_memory_order_relaxed);
+	val = rte_atomic_load_explicit((volatile __rte_atomic uint64_t *)addr,
+	    rte_memory_order_relaxed);
+	rte_atomic_compare_exchange_strong_explicit((volatile __rte_atomic uint64_t *)addr,
+	    &val, val, rte_memory_order_relaxed, rte_memory_order_relaxed);
 }
 
 static bool wait_supported;
-- 
1.8.3.1


^ permalink raw reply	[relevance 2%]

* [PATCH v6 0/6] rte atomics API for optional stdatomic
    2023-08-17 21:42  3% ` [PATCH v5 0/6] " Tyler Retzlaff
@ 2023-08-22 21:00  3% ` Tyler Retzlaff
  2023-08-22 21:00  2%   ` [PATCH v6 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
                     ` (2 more replies)
  1 sibling, 3 replies; 200+ results
From: Tyler Retzlaff @ 2023-08-22 21:00 UTC (permalink / raw)
  To: dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, Konstantin Ananyev, David Hunt,
	Thomas Monjalon, David Marchand, Tyler Retzlaff

This series introduces API additions prefixed in the rte namespace that allow
the optional use of stdatomics.h from C11 using enable_stdatomics=true for
targets where enable_stdatomics=false no functional change is intended.

Be aware this does not contain all changes to use stdatomics across the DPDK
tree it only introduces the minimum to allow the option to be used which is
a pre-requisite for a clean CI (probably using clang) that can be run
with enable_stdatomics=true enabled.

It is planned that subsequent series will be introduced per lib/driver as
appropriate to further enable stdatomics use when enable_stdatomics=true.

Notes:

* Additional libraries beyond EAL make visible atomics use across the
  API/ABI surface they will be converted in the subsequent series.

* The eal: add rte atomic qualifier with casts patch needs some discussion
  as to whether or not the legacy rte_atomic APIs should be converted to
  work with enable_stdatomic=true right now some implementation dependent
  casts are used to prevent cascading / having to convert too much in
  the intial series.

* Windows will obviously need complete conversion of libraries including
  atomics that are not crossing API/ABI boundaries. those conversions will
  introduced in separate series as new along side the existing msvc series.

Please keep in mind we would like to prioritize the review / acceptance of
this patch since it needs to be completed in the 23.11 merge window.

Thank you all for the discussion that lead to the formation of this series.

v6:
  * Adjust checkpatches to warn about use of __rte_atomic_thread_fence
    and suggest use of rte_atomic_thread_fence. Use the existing check
    more generic check for __atomic_xxx to catch use of __atomic_thread_fence
    and recommend rte_atomic_xxx.

v5:
  * Add RTE_ATOMIC to doxygen configuration PREDEFINED macros list to
    fix documentation generation failure
  * Fix two typos in expansion of C11 atomics macros strong -> weak and
    add missing _explicit
  * Adjust devtools/checkpatches messages based on feedback. i have chosen
    not to try and catch use of C11 atomics or _Atomic since using those
    directly will be picked up by existing CI passes where by compilation
    error where enable_stdatomic=false (the default for most platforms)

v4:
  * Move the definition of #define RTE_ATOMIC(type) to patch 1 where it
    belongs (a mistake in v3)
  * Provide comments for both RTE_ATOMIC and __rte_atomic macros indicating
    their use as specified or qualified contexts.

v3:
  * Remove comments from APIs mentioning the mapping to C++ memory model
    memory orders
  * Introduce and use new macro RTE_ATOMIC(type) to be used in contexts
    where _Atomic is used as a type specifier to declare variables. The
    macro allows more clarity about what the atomic type being specified
    is. e.g. _Atomic(T *) vs _Atomic(T) it is easier to understand that
    the former is an atomic pointer type and the latter is an atomic
    type. it also has the benefit of (in the future) being interoperable
    with c++23 syntactically
    note: Morten i have retained your 'reviewed-by' tags if you disagree
    given the changes in the above version please indicate as such but
    i believe the changes are in the spirit of the feedback you provided

v2:
  * Wrap meson_options.txt option description to newline and indent to
    be consistent with other options.
  * Provide separate typedef of rte_memory_order for enable_stdatomic=true
    VS enable_stdatomic=false instead of a single typedef to int
    note: slight tweak to reviewers feedback i've chosen to use a typedef
          for both enable_stdatomic={true,false} (just seemed more consistent)
  * Bring in assert.h and use static_assert macro instead of _Static_assert
    keyword to better interoperate with c/c++
  * Directly include rte_stdatomic.h where into other places it is consumed
    instead of hacking it globally into rte_config.h
  * Provide and use __rte_atomic_thread_fence to allow conditional expansion
    within the body of existing rte_atomic_thread_fence inline function to
    maintain per-arch optimizations when enable_stdatomic=false

Tyler Retzlaff (6):
  eal: provide rte stdatomics optional atomics API
  eal: adapt EAL to present rte optional atomics API
  eal: add rte atomic qualifier with casts
  distributor: adapt for EAL optional atomics API changes
  bpf: adapt for EAL optional atomics API changes
  devtools: forbid new direct use of GCC atomic builtins

 app/test/test_mcslock.c                  |   6 +-
 config/meson.build                       |   1 +
 devtools/checkpatches.sh                 |  12 +-
 doc/api/doxy-api.conf.in                 |   1 +
 lib/bpf/bpf_pkt.c                        |   6 +-
 lib/distributor/distributor_private.h    |   2 +-
 lib/distributor/rte_distributor_single.c |  44 +++----
 lib/eal/arm/include/rte_atomic_32.h      |   4 +-
 lib/eal/arm/include/rte_atomic_64.h      |  36 +++---
 lib/eal/arm/include/rte_pause_64.h       |  26 ++--
 lib/eal/arm/rte_power_intrinsics.c       |   8 +-
 lib/eal/common/eal_common_trace.c        |  16 +--
 lib/eal/include/generic/rte_atomic.h     |  67 +++++++----
 lib/eal/include/generic/rte_pause.h      |  50 ++++----
 lib/eal/include/generic/rte_rwlock.h     |  48 ++++----
 lib/eal/include/generic/rte_spinlock.h   |  20 ++--
 lib/eal/include/meson.build              |   1 +
 lib/eal/include/rte_mcslock.h            |  51 ++++----
 lib/eal/include/rte_pflock.h             |  25 ++--
 lib/eal/include/rte_seqcount.h           |  19 +--
 lib/eal/include/rte_stdatomic.h          | 198 +++++++++++++++++++++++++++++++
 lib/eal/include/rte_ticketlock.h         |  43 +++----
 lib/eal/include/rte_trace_point.h        |   5 +-
 lib/eal/loongarch/include/rte_atomic.h   |   4 +-
 lib/eal/ppc/include/rte_atomic.h         |  54 ++++-----
 lib/eal/riscv/include/rte_atomic.h       |   4 +-
 lib/eal/x86/include/rte_atomic.h         |   8 +-
 lib/eal/x86/include/rte_spinlock.h       |   2 +-
 lib/eal/x86/rte_power_intrinsics.c       |   7 +-
 meson_options.txt                        |   2 +
 30 files changed, 501 insertions(+), 269 deletions(-)
 create mode 100644 lib/eal/include/rte_stdatomic.h

-- 
1.8.3.1


^ permalink raw reply	[relevance 3%]

* Minutes of Technical Board Meeting, 2023-August -9
@ 2023-08-22 10:23  3% Jerin Jacob Kollanukkaran
  0 siblings, 0 replies; 200+ results
From: Jerin Jacob Kollanukkaran @ 2023-08-22 10:23 UTC (permalink / raw)
  To: dev, techboard

Minutes of Technical Board Meeting, 2023-August -9

Members Attending
-----------------
-Aaron
-Bruce
-Hemant
-Honnappa
-Jerin (Chair)
-Konstantin
-Stephen
-Thomas
-Tyler
-Morten
 

NOTE: The technical board meetings every second Wednesday at https://meet.jit.si/DPDK at 3 pm UTC.
Meetings are public, and DPDK community members are welcome to attend.
 
NOTE: Next meeting will be on Wednesday 2023- August -23 @3pm UTC, and will be chaired by Honnappa


Dublin DPDK submit
------------------

Collected various topics to be discussed in tech-board meeting on 11th September 2023 evening.

1) General tech-board discussion on the
- Process of adding/removing tech-board members
- Expected size of tech-board  Do we want more people? Less? Grow the TB or expand it?
- Specific individuals who wish to join or leave the TB within the next year?
- Efficient ways to split the work up etc.
2) Discussion led by Aaron on the possible automation of patches in the future - pros? Cons ? Worth implementing? Best process if this route is pursued.
3) Internal review process: how to accelerate and/or improve this - more comments, addressing/responding to these comments, etc.
4) Improvements in use of lab resources by maintainers and committers - additional branches, etc. 


DPDK C11 atomics integration challenges
----------------------------------------
1) Discussed various issues with C11 atomics integration like
- rte_ring performance issue C11 atomics
- ABI compatibility issues in public header due to atomics size differences 
- c++23 clang distribution  issues

- In general agreed to have DPDK specific prefix for better integration of atomics primitives by providing room to
accommodate compiler specific differences, Tyler Retzlaff will send a RFC for the same.
RFC is at https://patches.dpdk.org/project/dpdk/list/?series=29255

^ permalink raw reply	[relevance 3%]

* [PATCH v11 1/4] ethdev: add API for mbufs recycle mode
  @ 2023-08-22  7:27  3%   ` Feifei Wang
  2023-08-22 23:33  0%     ` Konstantin Ananyev
  2023-08-24  3:38  0%     ` Feifei Wang
  0 siblings, 2 replies; 200+ results
From: Feifei Wang @ 2023-08-22  7:27 UTC (permalink / raw)
  To: Thomas Monjalon, Ferruh Yigit, Andrew Rybchenko
  Cc: dev, nd, Feifei Wang, Honnappa Nagarahalli, Ruifeng Wang,
	Morten Brørup

Add 'rte_eth_recycle_rx_queue_info_get' and 'rte_eth_recycle_mbufs'
APIs to recycle used mbufs from a transmit queue of an Ethernet device,
and move these mbufs into a mbuf ring for a receive queue of an Ethernet
device. This can bypass mempool 'put/get' operations hence saving CPU
cycles.

For each recycling mbufs, the rte_eth_recycle_mbufs() function performs
the following operations:
- Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf
ring.
- Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
from the Tx mbuf ring.

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Suggested-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 doc/guides/rel_notes/release_23_11.rst |  15 ++
 lib/ethdev/ethdev_driver.h             |  10 ++
 lib/ethdev/ethdev_private.c            |   2 +
 lib/ethdev/rte_ethdev.c                |  31 +++++
 lib/ethdev/rte_ethdev.h                | 181 +++++++++++++++++++++++++
 lib/ethdev/rte_ethdev_core.h           |  23 +++-
 lib/ethdev/version.map                 |   3 +
 7 files changed, 259 insertions(+), 6 deletions(-)

diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
index 4411bb32c1..02ee3867a0 100644
--- a/doc/guides/rel_notes/release_23_11.rst
+++ b/doc/guides/rel_notes/release_23_11.rst
@@ -72,6 +72,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Add mbufs recycling support.**
+
+  Added ``rte_eth_recycle_rx_queue_info_get`` and ``rte_eth_recycle_mbufs``
+  APIs which allow the user to copy used mbufs from the Tx mbuf ring
+  into the Rx mbuf ring. This feature supports the case that the Rx Ethernet
+  device is different from the Tx Ethernet device with respective driver
+  callback functions in ``rte_eth_recycle_mbufs``.
 
 Removed Items
 -------------
@@ -123,6 +130,14 @@ ABI Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* ethdev: Added ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields to ``rte_eth_dev`` structure.
+
+* ethdev: Structure ``rte_eth_fp_ops`` was affected to add
+  ``recycle_tx_mbufs_reuse`` and ``recycle_rx_descriptors_refill``
+  fields, to move ``rxq`` and ``txq`` fields, to change the size of
+  ``reserved1`` and ``reserved2`` fields.
+
 
 Known Issues
 ------------
diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h
index 980f837ab6..b0c55a8523 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -58,6 +58,10 @@ struct rte_eth_dev {
 	eth_rx_descriptor_status_t rx_descriptor_status;
 	/** Check the status of a Tx descriptor */
 	eth_tx_descriptor_status_t tx_descriptor_status;
+	/** Pointer to PMD transmit mbufs reuse function */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	/** Pointer to PMD receive descriptors refill function */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
 
 	/**
 	 * Device data that is shared between primary and secondary processes
@@ -507,6 +511,10 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
+typedef void (*eth_recycle_rxq_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t rx_queue_id,
+	struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
 	uint16_t queue_id, struct rte_eth_burst_mode *mode);
 
@@ -1250,6 +1258,8 @@ struct eth_dev_ops {
 	eth_rxq_info_get_t         rxq_info_get;
 	/** Retrieve Tx queue information */
 	eth_txq_info_get_t         txq_info_get;
+	/** Retrieve mbufs recycle Rx queue information */
+	eth_recycle_rxq_info_get_t recycle_rxq_info_get;
 	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst mode */
 	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst mode */
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version */
diff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c
index 14ec8c6ccf..f8ab64f195 100644
--- a/lib/ethdev/ethdev_private.c
+++ b/lib/ethdev/ethdev_private.c
@@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,
 	fpo->rx_queue_count = dev->rx_queue_count;
 	fpo->rx_descriptor_status = dev->rx_descriptor_status;
 	fpo->tx_descriptor_status = dev->tx_descriptor_status;
+	fpo->recycle_tx_mbufs_reuse = dev->recycle_tx_mbufs_reuse;
+	fpo->recycle_rx_descriptors_refill = dev->recycle_rx_descriptors_refill;
 
 	fpo->rxq.data = dev->data->rx_queues;
 	fpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 0840d2b594..ea89a101a1 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -5876,6 +5876,37 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	return 0;
 }
 
+int
+rte_eth_recycle_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+	dev = &rte_eth_devices[port_id];
+
+	if (queue_id >= dev->data->nb_rx_queues) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u\n", queue_id);
+		return -EINVAL;
+	}
+
+	if (dev->data->rx_queues == NULL ||
+			dev->data->rx_queues[queue_id] == NULL) {
+		RTE_ETHDEV_LOG(ERR,
+			   "Rx queue %"PRIu16" of device with port_id=%"
+			   PRIu16" has not been setup\n",
+			   queue_id, port_id);
+		return -EINVAL;
+	}
+
+	if (*dev->dev_ops->recycle_rxq_info_get == NULL)
+		return -ENOTSUP;
+
+	dev->dev_ops->recycle_rxq_info_get(dev, queue_id, recycle_rxq_info);
+
+	return 0;
+}
+
 int
 rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
 			  struct rte_eth_burst_mode *mode)
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index 04a2564f22..9dc5749d83 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -1820,6 +1820,30 @@ struct rte_eth_txq_info {
 	uint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */
 } __rte_cache_min_aligned;
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice.
+ *
+ * Ethernet device Rx queue information structure for recycling mbufs.
+ * Used to retrieve Rx queue information when Tx queue reusing mbufs and moving
+ * them into Rx mbuf ring.
+ */
+struct rte_eth_recycle_rxq_info {
+	struct rte_mbuf **mbuf_ring; /**< mbuf ring of Rx queue. */
+	struct rte_mempool *mp;     /**< mempool of Rx queue. */
+	uint16_t *refill_head;      /**< head of Rx queue refilling mbufs. */
+	uint16_t *receive_tail;     /**< tail of Rx queue receiving pkts. */
+	uint16_t mbuf_ring_size;     /**< configured number of mbuf ring size. */
+	/**
+	 * Requirement on mbuf refilling batch size of Rx mbuf ring.
+	 * For some PMD drivers, the number of Rx mbuf ring refilling mbufs
+	 * should be aligned with mbuf ring size, in order to simplify
+	 * ring wrapping around.
+	 * Value 0 means that PMD drivers have no requirement for this.
+	 */
+	uint16_t refill_requirement;
+} __rte_cache_min_aligned;
+
 /* Generic Burst mode flag definition, values can be ORed. */
 
 /**
@@ -4853,6 +4877,31 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo);
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Retrieve information about given ports's Rx queue for recycling mbufs.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The Rx queue on the Ethernet devicefor which information
+ *   will be retrieved.
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* to be filled.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENODEV:  If *port_id* is invalid.
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The queue_id is out of range.
+ */
+__rte_experimental
+int rte_eth_recycle_rx_queue_info_get(uint16_t port_id,
+		uint16_t queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
 /**
  * Retrieve information about the Rx packet burst mode.
  *
@@ -6527,6 +6576,138 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,
 	return rte_eth_tx_buffer_flush(port_id, queue_id, buffer);
 }
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
+ *
+ * Recycle used mbufs from a transmit queue of an Ethernet device, and move
+ * these mbufs into a mbuf ring for a receive queue of an Ethernet device.
+ * This can bypass mempool path to save CPU cycles.
+ *
+ * The rte_eth_recycle_mbufs() function loops, with rte_eth_rx_burst() and
+ * rte_eth_tx_burst() functions, freeing Tx used mbufs and replenishing Rx
+ * descriptors. The number of recycling mbufs depends on the request of Rx mbuf
+ * ring, with the constraint of enough used mbufs from Tx mbuf ring.
+ *
+ * For each recycling mbufs, the rte_eth_recycle_mbufs() function performs the
+ * following operations:
+ *
+ * - Copy used *rte_mbuf* buffer pointers from Tx mbuf ring into Rx mbuf ring.
+ *
+ * - Replenish the Rx descriptors with the recycling *rte_mbuf* mbufs freed
+ *   from the Tx mbuf ring.
+ *
+ * This function spilts Rx and Tx path with different callback functions. The
+ * callback function recycle_tx_mbufs_reuse is for Tx driver. The callback
+ * function recycle_rx_descriptors_refill is for Rx driver. rte_eth_recycle_mbufs()
+ * can support the case that Rx Ethernet device is different from Tx Ethernet device.
+ *
+ * It is the responsibility of users to select the Rx/Tx queue pair to recycle
+ * mbufs. Before call this function, users must call rte_eth_recycle_rxq_info_get
+ * function to retrieve selected Rx queue information.
+ * @see rte_eth_recycle_rxq_info_get, struct rte_eth_recycle_rxq_info
+ *
+ * Currently, the rte_eth_recycle_mbufs() function can support to feed 1 Rx queue from
+ * 2 Tx queues in the same thread. Do not pair the Rx queue and Tx queue in different
+ * threads, in order to avoid memory error rewriting.
+ *
+ * @param rx_port_id
+ *   Port identifying the receive side.
+ * @param rx_queue_id
+ *   The index of the receive queue identifying the receive side.
+ *   The value must be in the range [0, nb_rx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param tx_port_id
+ *   Port identifying the transmit side.
+ * @param tx_queue_id
+ *   The index of the transmit queue identifying the transmit side.
+ *   The value must be in the range [0, nb_tx_queue - 1] previously supplied
+ *   to rte_eth_dev_configure().
+ * @param recycle_rxq_info
+ *   A pointer to a structure of type *rte_eth_recycle_rxq_info* which contains
+ *   the information of the Rx queue mbuf ring.
+ * @return
+ *   The number of recycling mbufs.
+ */
+__rte_experimental
+static inline uint16_t
+rte_eth_recycle_mbufs(uint16_t rx_port_id, uint16_t rx_queue_id,
+		uint16_t tx_port_id, uint16_t tx_queue_id,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info)
+{
+	struct rte_eth_fp_ops *p;
+	void *qd;
+	uint16_t nb_mbufs;
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	if (tx_port_id >= RTE_MAX_ETHPORTS ||
+			tx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR,
+				"Invalid tx_port_id=%u or tx_queue_id=%u\n",
+				tx_port_id, tx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to queue data */
+	p = &rte_eth_fp_ops[tx_port_id];
+	qd = p->txq.data[tx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_TX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(tx_port_id, 0);
+
+	if (qd == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Tx queue_id=%u for port_id=%u\n",
+				tx_queue_id, tx_port_id);
+		return 0;
+	}
+#endif
+	if (p->recycle_tx_mbufs_reuse == NULL)
+		return 0;
+
+	/* Copy used *rte_mbuf* buffer pointers from Tx mbuf ring
+	 * into Rx mbuf ring.
+	 */
+	nb_mbufs = p->recycle_tx_mbufs_reuse(qd, recycle_rxq_info);
+
+	/* If no recycling mbufs, return 0. */
+	if (nb_mbufs == 0)
+		return 0;
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	if (rx_port_id >= RTE_MAX_ETHPORTS ||
+			rx_queue_id >= RTE_MAX_QUEUES_PER_PORT) {
+		RTE_ETHDEV_LOG(ERR, "Invalid rx_port_id=%u or rx_queue_id=%u\n",
+				rx_port_id, rx_queue_id);
+		return 0;
+	}
+#endif
+
+	/* fetch pointer to queue data */
+	p = &rte_eth_fp_ops[rx_port_id];
+	qd = p->rxq.data[rx_queue_id];
+
+#ifdef RTE_ETHDEV_DEBUG_RX
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(rx_port_id, 0);
+
+	if (qd == NULL) {
+		RTE_ETHDEV_LOG(ERR, "Invalid Rx queue_id=%u for port_id=%u\n",
+				rx_queue_id, rx_port_id);
+		return 0;
+	}
+#endif
+
+	if (p->recycle_rx_descriptors_refill == NULL)
+		return 0;
+
+	/* Replenish the Rx descriptors with the recycling
+	 * into Rx mbuf ring.
+	 */
+	p->recycle_rx_descriptors_refill(qd, nb_mbufs);
+
+	return nb_mbufs;
+}
+
 /**
  * @warning
  * @b EXPERIMENTAL: this API may change without prior notice
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index 46e9721e07..a24ad7a6b2 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -55,6 +55,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);
 /** @internal Check the status of a Tx descriptor */
 typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);
 
+/** @internal Copy used mbufs from Tx mbuf ring into Rx mbuf ring */
+typedef uint16_t (*eth_recycle_tx_mbufs_reuse_t)(void *txq,
+		struct rte_eth_recycle_rxq_info *recycle_rxq_info);
+
+/** @internal Refill Rx descriptors with the recycling mbufs */
+typedef void (*eth_recycle_rx_descriptors_refill_t)(void *rxq, uint16_t nb);
+
 /**
  * @internal
  * Structure used to hold opaque pointers to internal ethdev Rx/Tx
@@ -83,15 +90,17 @@ struct rte_eth_fp_ops {
 	 * Rx fast-path functions and related data.
 	 * 64-bit systems: occupies first 64B line
 	 */
+	/** Rx queues data. */
+	struct rte_ethdev_qdata rxq;
 	/** PMD receive function. */
 	eth_rx_burst_t rx_pkt_burst;
 	/** Get the number of used Rx descriptors. */
 	eth_rx_queue_count_t rx_queue_count;
 	/** Check the status of a Rx descriptor. */
 	eth_rx_descriptor_status_t rx_descriptor_status;
-	/** Rx queues data. */
-	struct rte_ethdev_qdata rxq;
-	uintptr_t reserved1[3];
+	/** Refill Rx descriptors with the recycling mbufs. */
+	eth_recycle_rx_descriptors_refill_t recycle_rx_descriptors_refill;
+	uintptr_t reserved1[2];
 	/**@}*/
 
 	/**@{*/
@@ -99,15 +108,17 @@ struct rte_eth_fp_ops {
 	 * Tx fast-path functions and related data.
 	 * 64-bit systems: occupies second 64B line
 	 */
+	/** Tx queues data. */
+	struct rte_ethdev_qdata txq;
 	/** PMD transmit function. */
 	eth_tx_burst_t tx_pkt_burst;
 	/** PMD transmit prepare function. */
 	eth_tx_prep_t tx_pkt_prepare;
 	/** Check the status of a Tx descriptor. */
 	eth_tx_descriptor_status_t tx_descriptor_status;
-	/** Tx queues data. */
-	struct rte_ethdev_qdata txq;
-	uintptr_t reserved2[3];
+	/** Copy used mbufs from Tx mbuf ring into Rx. */
+	eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse;
+	uintptr_t reserved2[2];
 	/**@}*/
 
 } __rte_cache_aligned;
diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
index b965d6aa52..eec159dfdd 100644
--- a/lib/ethdev/version.map
+++ b/lib/ethdev/version.map
@@ -312,6 +312,9 @@ EXPERIMENTAL {
 	rte_flow_async_action_list_handle_query_update;
 	rte_flow_async_actions_update;
 	rte_flow_restore_info_dynflag;
+
+	# added in 23.11
+	rte_eth_recycle_rx_queue_info_get;
 };
 
 INTERNAL {
-- 
2.25.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 0/6] optional rte optional stdatomics API
  2023-08-17 21:42  3% ` [PATCH v5 0/6] " Tyler Retzlaff
  2023-08-17 21:42  2%   ` [PATCH v5 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
@ 2023-08-21 22:27  0%   ` Konstantin Ananyev
  1 sibling, 0 replies; 200+ results
From: Konstantin Ananyev @ 2023-08-21 22:27 UTC (permalink / raw)
  To: Tyler Retzlaff, dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, David Hunt, Thomas Monjalon, David Marchand


> This series introduces API additions prefixed in the rte namespace that allow
> the optional use of stdatomics.h from C11 using enable_stdatomics=true for
> targets where enable_stdatomics=false no functional change is intended.
> 
> Be aware this does not contain all changes to use stdatomics across the DPDK
> tree it only introduces the minimum to allow the option to be used which is
> a pre-requisite for a clean CI (probably using clang) that can be run
> with enable_stdatomics=true enabled.
> 
> It is planned that subsequent series will be introduced per lib/driver as
> appropriate to further enable stdatomics use when enable_stdatomics=true.
> 
> Notes:
> 
> * Additional libraries beyond EAL make visible atomics use across the
>    API/ABI surface they will be converted in the subsequent series.
> 
> * The eal: add rte atomic qualifier with casts patch needs some discussion
>    as to whether or not the legacy rte_atomic APIs should be converted to
>    work with enable_stdatomic=true right now some implementation dependent
>    casts are used to prevent cascading / having to convert too much in
>    the intial series.
> 
> * Windows will obviously need complete conversion of libraries including
>    atomics that are not crossing API/ABI boundaries. those conversions will
>    introduced in separate series as new along side the existing msvc series.
> 
> Please keep in mind we would like to prioritize the review / acceptance of
> this patch since it needs to be completed in the 23.11 merge window.
> 
> Thank you all for the discussion that lead to the formation of this series.
> 
> v5:
>    * Add RTE_ATOMIC to doxygen configuration PREDEFINED macros list to
>      fix documentation generation failure
>    * Fix two typos in expansion of C11 atomics macros strong -> weak and
>      add missing _explicit
>    * Adjust devtools/checkpatches messages based on feedback. i have chosen
>      not to try and catch use of C11 atomics or _Atomic since using those
>      directly will be picked up by existing CI passes where by compilation
>      error where enable_stdatomic=false (the default for most platforms)
> 
> v4:
>    * Move the definition of #define RTE_ATOMIC(type) to patch 1 where it
>      belongs (a mistake in v3)
>    * Provide comments for both RTE_ATOMIC and __rte_atomic macros indicating
>      their use as specified or qualified contexts.
> 
> v3:
>    * Remove comments from APIs mentioning the mapping to C++ memory model
>      memory orders
>    * Introduce and use new macro RTE_ATOMIC(type) to be used in contexts
>      where _Atomic is used as a type specifier to declare variables. The
>      macro allows more clarity about what the atomic type being specified
>      is. e.g. _Atomic(T *) vs _Atomic(T) it is easier to understand that
>      the former is an atomic pointer type and the latter is an atomic
>      type. it also has the benefit of (in the future) being interoperable
>      with c++23 syntactically
>      note: Morten i have retained your 'reviewed-by' tags if you disagree
>      given the changes in the above version please indicate as such but
>      i believe the changes are in the spirit of the feedback you provided
> 
> v2:
>    * Wrap meson_options.txt option description to newline and indent to
>      be consistent with other options.
>    * Provide separate typedef of rte_memory_order for enable_stdatomic=true
>      VS enable_stdatomic=false instead of a single typedef to int
>      note: slight tweak to reviewers feedback i've chosen to use a typedef
>            for both enable_stdatomic={true,false} (just seemed more consistent)
>    * Bring in assert.h and use static_assert macro instead of _Static_assert
>      keyword to better interoperate with c/c++
>    * Directly include rte_stdatomic.h where into other places it is consumed
>      instead of hacking it globally into rte_config.h
>    * Provide and use __rte_atomic_thread_fence to allow conditional expansion
>      within the body of existing rte_atomic_thread_fence inline function to
>      maintain per-arch optimizations when enable_stdatomic=false
> 
> Tyler Retzlaff (6):
>    eal: provide rte stdatomics optional atomics API
>    eal: adapt EAL to present rte optional atomics API
>    eal: add rte atomic qualifier with casts
>    distributor: adapt for EAL optional atomics API changes
>    bpf: adapt for EAL optional atomics API changes
>    devtools: forbid new direct use of GCC atomic builtins
> 
>   app/test/test_mcslock.c                  |   6 +-
>   config/meson.build                       |   1 +
>   devtools/checkpatches.sh                 |   8 +-
>   doc/api/doxy-api.conf.in                 |   1 +
>   lib/bpf/bpf_pkt.c                        |   6 +-
>   lib/distributor/distributor_private.h    |   2 +-
>   lib/distributor/rte_distributor_single.c |  44 +++----
>   lib/eal/arm/include/rte_atomic_32.h      |   4 +-
>   lib/eal/arm/include/rte_atomic_64.h      |  36 +++---
>   lib/eal/arm/include/rte_pause_64.h       |  26 ++--
>   lib/eal/arm/rte_power_intrinsics.c       |   8 +-
>   lib/eal/common/eal_common_trace.c        |  16 +--
>   lib/eal/include/generic/rte_atomic.h     |  67 +++++++----
>   lib/eal/include/generic/rte_pause.h      |  50 ++++----
>   lib/eal/include/generic/rte_rwlock.h     |  48 ++++----
>   lib/eal/include/generic/rte_spinlock.h   |  20 ++--
>   lib/eal/include/meson.build              |   1 +
>   lib/eal/include/rte_mcslock.h            |  51 ++++----
>   lib/eal/include/rte_pflock.h             |  25 ++--
>   lib/eal/include/rte_seqcount.h           |  19 +--
>   lib/eal/include/rte_stdatomic.h          | 198 +++++++++++++++++++++++++++++++
>   lib/eal/include/rte_ticketlock.h         |  43 +++----
>   lib/eal/include/rte_trace_point.h        |   5 +-
>   lib/eal/loongarch/include/rte_atomic.h   |   4 +-
>   lib/eal/ppc/include/rte_atomic.h         |  54 ++++-----
>   lib/eal/riscv/include/rte_atomic.h       |   4 +-
>   lib/eal/x86/include/rte_atomic.h         |   8 +-
>   lib/eal/x86/include/rte_spinlock.h       |   2 +-
>   lib/eal/x86/rte_power_intrinsics.c       |   7 +-
>   meson_options.txt                        |   2 +
>   30 files changed, 499 insertions(+), 267 deletions(-)
>   create mode 100644 lib/eal/include/rte_stdatomic.h
> 

Series-acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>


^ permalink raw reply	[relevance 0%]

* [PATCH v13 17/21] hash: move rte_hash_set_alg out header
  2023-08-21 16:09  2% ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types Stephen Hemminger
@ 2023-08-21 16:09  2%   ` Stephen Hemminger
  0 siblings, 0 replies; 200+ results
From: Stephen Hemminger @ 2023-08-21 16:09 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Ruifeng Wang, Yipeng Wang, Sameh Gobriel,
	Bruce Richardson, Vladimir Medvedkin

The code for setting algorithm for hash is not at all perf sensitive,
and doing it inline has a couple of problems. First, it means that if
multiple files include the header, then the initialization gets done
multiple times. But also, it makes it harder to fix usage of RTE_LOG().

Despite what the checking script say. This is not an ABI change, the
previous version inlined the same code; therefore both old and new code
will work the same.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/hash/meson.build     |  1 +
 lib/hash/rte_crc_arm64.h |  8 ++---
 lib/hash/rte_crc_x86.h   | 10 +++---
 lib/hash/rte_hash_crc.c  | 68 ++++++++++++++++++++++++++++++++++++++++
 lib/hash/rte_hash_crc.h  | 48 ++--------------------------
 lib/hash/version.map     |  7 +++++
 6 files changed, 88 insertions(+), 54 deletions(-)
 create mode 100644 lib/hash/rte_hash_crc.c

diff --git a/lib/hash/meson.build b/lib/hash/meson.build
index e56ee8572564..c345c6f561fc 100644
--- a/lib/hash/meson.build
+++ b/lib/hash/meson.build
@@ -19,6 +19,7 @@ indirect_headers += files(
 
 sources = files(
     'rte_cuckoo_hash.c',
+    'rte_hash_crc.c',
     'rte_fbk_hash.c',
     'rte_thash.c',
     'rte_thash_gfni.c'
diff --git a/lib/hash/rte_crc_arm64.h b/lib/hash/rte_crc_arm64.h
index c9f52510871b..414fe065caa8 100644
--- a/lib/hash/rte_crc_arm64.h
+++ b/lib/hash/rte_crc_arm64.h
@@ -53,7 +53,7 @@ crc32c_arm64_u64(uint64_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_ARM64))
+	if (likely(rte_hash_crc32_alg & CRC32_ARM64))
 		return crc32c_arm64_u8(data, init_val);
 
 	return crc32c_1byte(data, init_val);
@@ -67,7 +67,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_ARM64))
+	if (likely(rte_hash_crc32_alg & CRC32_ARM64))
 		return crc32c_arm64_u16(data, init_val);
 
 	return crc32c_2bytes(data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_4byte(uint32_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_ARM64))
+	if (likely(rte_hash_crc32_alg & CRC32_ARM64))
 		return crc32c_arm64_u32(data, init_val);
 
 	return crc32c_1word(data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_8byte(uint64_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_ARM64))
+	if (likely(rte_hash_crc32_alg & CRC32_ARM64))
 		return crc32c_arm64_u64(data, init_val);
 
 	return crc32c_2words(data, init_val);
diff --git a/lib/hash/rte_crc_x86.h b/lib/hash/rte_crc_x86.h
index 205bc182be77..3b865e251db2 100644
--- a/lib/hash/rte_crc_x86.h
+++ b/lib/hash/rte_crc_x86.h
@@ -67,7 +67,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val)
 static inline uint32_t
 rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_SSE42))
+	if (likely(rte_hash_crc32_alg & CRC32_SSE42))
 		return crc32c_sse42_u8(data, init_val);
 
 	return crc32c_1byte(data, init_val);
@@ -81,7 +81,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_SSE42))
+	if (likely(rte_hash_crc32_alg & CRC32_SSE42))
 		return crc32c_sse42_u16(data, init_val);
 
 	return crc32c_2bytes(data, init_val);
@@ -95,7 +95,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val)
 static inline uint32_t
 rte_hash_crc_4byte(uint32_t data, uint32_t init_val)
 {
-	if (likely(crc32_alg & CRC32_SSE42))
+	if (likely(rte_hash_crc32_alg & CRC32_SSE42))
 		return crc32c_sse42_u32(data, init_val);
 
 	return crc32c_1word(data, init_val);
@@ -110,11 +110,11 @@ static inline uint32_t
 rte_hash_crc_8byte(uint64_t data, uint32_t init_val)
 {
 #ifdef RTE_ARCH_X86_64
-	if (likely(crc32_alg == CRC32_SSE42_x64))
+	if (likely(rte_hash_crc32_alg == CRC32_SSE42_x64))
 		return crc32c_sse42_u64(data, init_val);
 #endif
 
-	if (likely(crc32_alg & CRC32_SSE42))
+	if (likely(rte_hash_crc32_alg & CRC32_SSE42))
 		return crc32c_sse42_u64_mimic(data, init_val);
 
 	return crc32c_2words(data, init_val);
diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c
new file mode 100644
index 000000000000..1439d8a71f6a
--- /dev/null
+++ b/lib/hash/rte_hash_crc.c
@@ -0,0 +1,68 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2014 Intel Corporation
+ */
+
+#include <rte_cpuflags.h>
+#include <rte_log.h>
+
+#include "rte_hash_crc.h"
+
+RTE_LOG_REGISTER_SUFFIX(hash_crc_logtype, crc, INFO);
+#define RTE_LOGTYPE_HASH_CRC hash_crc_logtype
+
+uint8_t rte_hash_crc32_alg = CRC32_SW;
+
+/**
+ * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash
+ * calculation.
+ *
+ * @param alg
+ *   An OR of following flags:
+ *   - (CRC32_SW) Don't use SSE4.2/ARMv8 intrinsics (default non-[x86/ARMv8])
+ *   - (CRC32_SSE42) Use SSE4.2 intrinsics if available
+ *   - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default x86)
+ *   - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8)
+ *
+ */
+void
+rte_hash_crc_set_alg(uint8_t alg)
+{
+	rte_hash_crc32_alg = CRC32_SW;
+
+	if (alg == CRC32_SW)
+		return;
+
+#if defined RTE_ARCH_X86
+	if (!(alg & CRC32_SSE42_x64))
+		RTE_LOG(WARNING, HASH_CRC,
+			"Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n");
+	if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42)
+		rte_hash_crc32_alg = CRC32_SSE42;
+	else
+		rte_hash_crc32_alg = CRC32_SSE42_x64;
+#endif
+
+#if defined RTE_ARCH_ARM64
+	if (!(alg & CRC32_ARM64))
+		RTE_LOG(WARNING, HASH_CRC,
+			"Unsupported CRC32 algorithm requested using CRC32_ARM64\n");
+	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32))
+		rte_hash_crc32_alg = CRC32_ARM64;
+#endif
+
+	if (rte_hash_crc32_alg == CRC32_SW)
+		RTE_LOG(WARNING, HASH_CRC,
+			"Unsupported CRC32 algorithm requested using CRC32_SW\n");
+}
+
+/* Setting the best available algorithm */
+RTE_INIT(rte_hash_crc_init_alg)
+{
+#if defined(RTE_ARCH_X86)
+	rte_hash_crc_set_alg(CRC32_SSE42_x64);
+#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
+	rte_hash_crc_set_alg(CRC32_ARM64);
+#else
+	rte_hash_crc_set_alg(CRC32_SW);
+#endif
+}
diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h
index 60bf42ce1d97..8ad2422ec333 100644
--- a/lib/hash/rte_hash_crc.h
+++ b/lib/hash/rte_hash_crc.h
@@ -20,8 +20,6 @@ extern "C" {
 #include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_config.h>
-#include <rte_cpuflags.h>
-#include <rte_log.h>
 
 #include "rte_crc_sw.h"
 
@@ -31,7 +29,7 @@ extern "C" {
 #define CRC32_SSE42_x64     (CRC32_x64|CRC32_SSE42)
 #define CRC32_ARM64         (1U << 3)
 
-static uint8_t crc32_alg = CRC32_SW;
+extern uint8_t rte_hash_crc32_alg;
 
 #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
 #include "rte_crc_arm64.h"
@@ -52,48 +50,8 @@ static uint8_t crc32_alg = CRC32_SW;
  *   - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default x86)
  *   - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8)
  */
-static inline void
-rte_hash_crc_set_alg(uint8_t alg)
-{
-	crc32_alg = CRC32_SW;
-
-	if (alg == CRC32_SW)
-		return;
-
-#if defined RTE_ARCH_X86
-	if (!(alg & CRC32_SSE42_x64))
-		RTE_LOG(WARNING, HASH,
-			"Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n");
-	if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42)
-		crc32_alg = CRC32_SSE42;
-	else
-		crc32_alg = CRC32_SSE42_x64;
-#endif
-
-#if defined RTE_ARCH_ARM64
-	if (!(alg & CRC32_ARM64))
-		RTE_LOG(WARNING, HASH,
-			"Unsupported CRC32 algorithm requested using CRC32_ARM64\n");
-	if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32))
-		crc32_alg = CRC32_ARM64;
-#endif
-
-	if (crc32_alg == CRC32_SW)
-		RTE_LOG(WARNING, HASH,
-			"Unsupported CRC32 algorithm requested using CRC32_SW\n");
-}
-
-/* Setting the best available algorithm */
-RTE_INIT(rte_hash_crc_init_alg)
-{
-#if defined(RTE_ARCH_X86)
-	rte_hash_crc_set_alg(CRC32_SSE42_x64);
-#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32)
-	rte_hash_crc_set_alg(CRC32_ARM64);
-#else
-	rte_hash_crc_set_alg(CRC32_SW);
-#endif
-}
+void
+rte_hash_crc_set_alg(uint8_t alg);
 
 #ifdef __DOXYGEN__
 
diff --git a/lib/hash/version.map b/lib/hash/version.map
index 8288c6e7967e..a1e68036c5b8 100644
--- a/lib/hash/version.map
+++ b/lib/hash/version.map
@@ -9,6 +9,7 @@ DPDK_24 {
 	rte_hash_add_key_with_hash;
 	rte_hash_add_key_with_hash_data;
 	rte_hash_count;
+	rte_hash_crc_set_alg;
 	rte_hash_create;
 	rte_hash_del_key;
 	rte_hash_del_key_with_hash;
@@ -56,3 +57,9 @@ EXPERIMENTAL {
 	rte_thash_gfni;
 	rte_thash_gfni_bulk;
 };
+
+INTERNAL {
+	global:
+
+	rte_hash_crc32_alg;
+};
-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* [PATCH v13 00/21] Convert static log types in libraries to dynamic types
  @ 2023-08-21 16:09  2% ` Stephen Hemminger
  2023-08-21 16:09  2%   ` [PATCH v13 17/21] hash: move rte_hash_set_alg out header Stephen Hemminger
  0 siblings, 1 reply; 200+ results
From: Stephen Hemminger @ 2023-08-21 16:09 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This patchset removes most of the uses of static LOGTYPE's in DPDK
libraries. It starts with the easy one and goes on to the more complex ones.

There are several options on how to treat the old static types:
leave them there, mark as deprecated, or remove them.
This version removes them since there is no guarantee in current
DPDK policies that says they can't be removed.

Note: there is one patch in this series that will get
flagged incorrectly as an ABI change.

v13 - rebase because log now moved.

v12 - rebase and add table and pipeline libraries

v11 - fix include check on arm cross build

v10 - add necessary rte_compat.h in thash_gfni stub for arm

v9 - fix handling of crc32 alg in lib/hash.
     make it an internal global variable.
     fix gfni stubs for case where they are not used.

Stephen Hemminger (21):
  gso: don't log message on non TCP/UDP
  eal: drop no longer used GSO logtype
  log: drop unused RTE_LOGTYPE_TIMER
  efd: convert RTE_LOGTYPE_EFD to dynamic type
  mbuf: convert RTE_LOGTYPE_MBUF to dynamic type
  acl: convert RTE_LOGTYPE_ACL to dynamic type
  examples/power: replace use of RTE_LOGTYPE_POWER
  examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER
  power: convert RTE_LOGTYPE_POWER to dynamic type
  ring: convert RTE_LOGTYPE_RING to dynamic type
  mempool: convert RTE_LOGTYPE_MEMPOOL to dynamic type
  lpm: convert RTE_LOGTYPE_LPM to dynamic types
  sched: convert RTE_LOGTYPE_SCHED to dynamic type
  examples/ipsec-secgw: replace RTE_LOGTYPE_PORT
  port: convert RTE_LOGTYPE_PORT to dynamic type
  hash: move rte_thash_gfni stubs out of header file
  hash: move rte_hash_set_alg out header
  hash: convert RTE_LOGTYPE_HASH to dynamic type
  table: convert RTE_LOGTYPE_TABLE to dynamic type
  app/test: remove use of RTE_LOGTYPE_PIPELINE
  pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type

 app/test/test_acl.c             |  2 +-
 app/test/test_table_acl.c       | 50 +++++++++++-------------
 app/test/test_table_pipeline.c  | 40 +++++++++----------
 examples/distributor/main.c     |  2 +-
 examples/ipsec-secgw/sa.c       |  6 +--
 examples/l3fwd-power/main.c     | 17 +++++----
 lib/acl/acl.h                   |  1 +
 lib/acl/acl_bld.c               |  3 ++
 lib/acl/acl_gen.c               |  1 +
 lib/acl/acl_log.h               |  6 +++
 lib/acl/rte_acl.c               |  3 ++
 lib/acl/tb_mem.c                |  3 +-
 lib/efd/rte_efd.c               |  4 ++
 lib/fib/fib_log.h               |  4 ++
 lib/fib/rte_fib.c               |  3 ++
 lib/fib/rte_fib6.c              |  2 +
 lib/gso/rte_gso.c               |  4 +-
 lib/gso/rte_gso.h               |  1 +
 lib/hash/meson.build            |  9 ++++-
 lib/hash/rte_crc_arm64.h        |  8 ++--
 lib/hash/rte_crc_x86.h          | 10 ++---
 lib/hash/rte_cuckoo_hash.c      |  5 +++
 lib/hash/rte_fbk_hash.c         |  5 +++
 lib/hash/rte_hash_crc.c         | 68 +++++++++++++++++++++++++++++++++
 lib/hash/rte_hash_crc.h         | 48 ++---------------------
 lib/hash/rte_thash.c            |  3 ++
 lib/hash/rte_thash_gfni.c       | 50 ++++++++++++++++++++++++
 lib/hash/rte_thash_gfni.h       | 30 +++++----------
 lib/hash/version.map            | 11 ++++++
 lib/log/log.c                   | 16 --------
 lib/log/rte_log.h               | 32 ++++++++--------
 lib/lpm/lpm_log.h               |  4 ++
 lib/lpm/rte_lpm.c               |  3 ++
 lib/lpm/rte_lpm6.c              |  1 +
 lib/mbuf/mbuf_log.h             |  4 ++
 lib/mbuf/rte_mbuf.c             |  4 ++
 lib/mbuf/rte_mbuf_dyn.c         |  2 +
 lib/mbuf/rte_mbuf_pool_ops.c    |  2 +
 lib/mempool/rte_mempool.c       |  2 +
 lib/mempool/rte_mempool.h       |  8 ++++
 lib/mempool/version.map         |  3 ++
 lib/pipeline/rte_pipeline.c     |  2 +
 lib/pipeline/rte_pipeline.h     |  5 +++
 lib/port/rte_port_ethdev.c      |  3 ++
 lib/port/rte_port_eventdev.c    |  4 ++
 lib/port/rte_port_fd.c          |  3 ++
 lib/port/rte_port_frag.c        |  3 ++
 lib/port/rte_port_ras.c         |  3 ++
 lib/port/rte_port_ring.c        |  3 ++
 lib/port/rte_port_sched.c       |  3 ++
 lib/port/rte_port_source_sink.c |  3 ++
 lib/port/rte_port_sym_crypto.c  |  3 ++
 lib/power/guest_channel.c       |  3 +-
 lib/power/power_common.c        |  2 +
 lib/power/power_common.h        |  2 +
 lib/power/power_kvm_vm.c        |  1 +
 lib/power/rte_power.c           |  1 +
 lib/rib/rib_log.h               |  4 ++
 lib/rib/rte_rib.c               |  3 ++
 lib/rib/rte_rib6.c              |  3 ++
 lib/ring/rte_ring.c             |  3 ++
 lib/sched/rte_pie.c             |  1 +
 lib/sched/rte_sched.c           |  5 +++
 lib/sched/rte_sched_log.h       |  4 ++
 lib/table/meson.build           |  1 +
 lib/table/rte_table.c           |  8 ++++
 lib/table/rte_table.h           |  4 ++
 67 files changed, 387 insertions(+), 173 deletions(-)
 create mode 100644 lib/acl/acl_log.h
 create mode 100644 lib/fib/fib_log.h
 create mode 100644 lib/hash/rte_hash_crc.c
 create mode 100644 lib/hash/rte_thash_gfni.c
 create mode 100644 lib/lpm/lpm_log.h
 create mode 100644 lib/mbuf/mbuf_log.h
 create mode 100644 lib/rib/rib_log.h
 create mode 100644 lib/sched/rte_sched_log.h
 create mode 100644 lib/table/rte_table.c

-- 
2.39.2


^ permalink raw reply	[relevance 2%]

* Re: [PATCH v7 0/3] add telemetry cmds for ring
  @ 2023-08-18  6:53  0%   ` Jie Hai
  2023-09-12  1:52  0%   ` Jie Hai
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 200+ results
From: Jie Hai @ 2023-08-18  6:53 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, liudongdong3

Hi, Thomas,

Kindly ping for review.

Thanks, Jie Hai

On 2023/7/4 17:04, Jie Hai wrote:
> This patch set supports telemetry cmd to list rings and dump information
> of a ring by its name.
> 
> v1->v2:
> 1. Add space after "switch".
> 2. Fix wrong strlen parameter.
> 
> v2->v3:
> 1. Remove prefix "rte_" for static function.
> 2. Add Acked-by Konstantin Ananyev for PATCH 1.
> 3. Introduce functions to return strings instead copy strings.
> 4. Check pointer to memzone of ring.
> 5. Remove redundant variable.
> 6. Hold lock when access ring data.
> 
> v3->v4:
> 1. Update changelog according to reviews of Honnappa Nagarahalli.
> 2. Add Reviewed-by Honnappa Nagarahalli.
> 3. Correct grammar in help information.
> 4. Correct spell warning on "te" reported by checkpatch.pl.
> 5. Use ring_walk() to query ring info instead of rte_ring_lookup().
> 6. Fix that type definition the flag field of rte_ring does not match the usage.
> 7. Use rte_tel_data_add_dict_uint_hex instead of rte_tel_data_add_dict_u64
>     for mask and flags.
> 
> v4->v5:
> 1. Add Acked-by Konstantin Ananyev and Chengwen Feng.
> 2. Add ABI change explanation for commit message of patch 1/3.
> 
> v5->v6:
> 1. Add Acked-by Morten Brørup.
> 2. Fix incorrect reference of commit.
> 
> v6->v7:
> 1. Remove prod/consumer head/tail info.
> 
> Jie Hai (3):
>    ring: fix unmatched type definition and usage
>    ring: add telemetry cmd to list rings
>    ring: add telemetry cmd for ring info
> 
>   lib/ring/meson.build     |   1 +
>   lib/ring/rte_ring.c      | 135 +++++++++++++++++++++++++++++++++++++++
>   lib/ring/rte_ring_core.h |   2 +-
>   3 files changed, 137 insertions(+), 1 deletion(-)
> 

^ permalink raw reply	[relevance 0%]

* [PATCH v5 3/6] eal: add rte atomic qualifier with casts
  2023-08-17 21:42  3% ` [PATCH v5 0/6] " Tyler Retzlaff
@ 2023-08-17 21:42  2%   ` Tyler Retzlaff
  2023-08-21 22:27  0%   ` [PATCH v5 0/6] optional rte optional stdatomics API Konstantin Ananyev
  1 sibling, 0 replies; 200+ results
From: Tyler Retzlaff @ 2023-08-17 21:42 UTC (permalink / raw)
  To: dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, Konstantin Ananyev, David Hunt,
	Thomas Monjalon, David Marchand, Tyler Retzlaff

Introduce __rte_atomic qualifying casts in rte_optional atomics inline
functions to prevent cascading the need to pass __rte_atomic qualified
arguments.

Warning, this is really implementation dependent and being done
temporarily to avoid having to convert more of the libraries and tests in
DPDK in the initial series that introduces the API. The consequence of the
assumption of the ABI of the types in question not being ``the same'' is
only a risk that may be realized when enable_stdatomic=true.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
 lib/eal/include/generic/rte_atomic.h | 48 ++++++++++++++++++++++++------------
 lib/eal/include/generic/rte_pause.h  |  9 ++++---
 lib/eal/x86/rte_power_intrinsics.c   |  7 +++---
 3 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
index 5940e7e..709bf15 100644
--- a/lib/eal/include/generic/rte_atomic.h
+++ b/lib/eal/include/generic/rte_atomic.h
@@ -274,7 +274,8 @@
 static inline void
 rte_atomic16_add(rte_atomic16_t *v, int16_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -288,7 +289,8 @@
 static inline void
 rte_atomic16_sub(rte_atomic16_t *v, int16_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -341,7 +343,8 @@
 static inline int16_t
 rte_atomic16_add_return(rte_atomic16_t *v, int16_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 
 /**
@@ -361,7 +364,8 @@
 static inline int16_t
 rte_atomic16_sub_return(rte_atomic16_t *v, int16_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 
 /**
@@ -380,7 +384,8 @@
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, 1, rte_memory_order_seq_cst) + 1 == 0;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int16_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) + 1 == 0;
 }
 #endif
 
@@ -400,7 +405,8 @@ static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic16_dec_and_test(rte_atomic16_t *v)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, 1, rte_memory_order_seq_cst) - 1 == 0;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int16_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) - 1 == 0;
 }
 #endif
 
@@ -553,7 +559,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline void
 rte_atomic32_add(rte_atomic32_t *v, int32_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -567,7 +574,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline void
 rte_atomic32_sub(rte_atomic32_t *v, int32_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 
 /**
@@ -620,7 +628,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline int32_t
 rte_atomic32_add_return(rte_atomic32_t *v, int32_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 
 /**
@@ -640,7 +649,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 static inline int32_t
 rte_atomic32_sub_return(rte_atomic32_t *v, int32_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 
 /**
@@ -659,7 +669,8 @@ static inline void rte_atomic16_clear(rte_atomic16_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, 1, rte_memory_order_seq_cst) + 1 == 0;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int32_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) + 1 == 0;
 }
 #endif
 
@@ -679,7 +690,8 @@ static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)
 #ifdef RTE_FORCE_INTRINSICS
 static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, 1, rte_memory_order_seq_cst) - 1 == 0;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int32_t *)&v->cnt, 1,
+	    rte_memory_order_seq_cst) - 1 == 0;
 }
 #endif
 
@@ -885,7 +897,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline void
 rte_atomic64_add(rte_atomic64_t *v, int64_t inc)
 {
-	rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst);
+	rte_atomic_fetch_add_explicit((volatile __rte_atomic int64_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst);
 }
 #endif
 
@@ -904,7 +917,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline void
 rte_atomic64_sub(rte_atomic64_t *v, int64_t dec)
 {
-	rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst);
+	rte_atomic_fetch_sub_explicit((volatile __rte_atomic int64_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst);
 }
 #endif
 
@@ -962,7 +976,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline int64_t
 rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)
 {
-	return rte_atomic_fetch_add_explicit(&v->cnt, inc, rte_memory_order_seq_cst) + inc;
+	return rte_atomic_fetch_add_explicit((volatile __rte_atomic int64_t *)&v->cnt, inc,
+	    rte_memory_order_seq_cst) + inc;
 }
 #endif
 
@@ -986,7 +1001,8 @@ static inline void rte_atomic32_clear(rte_atomic32_t *v)
 static inline int64_t
 rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)
 {
-	return rte_atomic_fetch_sub_explicit(&v->cnt, dec, rte_memory_order_seq_cst) - dec;
+	return rte_atomic_fetch_sub_explicit((volatile __rte_atomic int64_t *)&v->cnt, dec,
+	    rte_memory_order_seq_cst) - dec;
 }
 #endif
 
diff --git a/lib/eal/include/generic/rte_pause.h b/lib/eal/include/generic/rte_pause.h
index 256309e..b7b059f 100644
--- a/lib/eal/include/generic/rte_pause.h
+++ b/lib/eal/include/generic/rte_pause.h
@@ -81,7 +81,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint16_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
@@ -91,7 +92,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint32_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
@@ -101,7 +103,8 @@
 {
 	assert(memorder == rte_memory_order_acquire || memorder == rte_memory_order_relaxed);
 
-	while (rte_atomic_load_explicit(addr, memorder) != expected)
+	while (rte_atomic_load_explicit((volatile __rte_atomic uint64_t *)addr, memorder)
+	    != expected)
 		rte_pause();
 }
 
diff --git a/lib/eal/x86/rte_power_intrinsics.c b/lib/eal/x86/rte_power_intrinsics.c
index cf70e33..fb8539f 100644
--- a/lib/eal/x86/rte_power_intrinsics.c
+++ b/lib/eal/x86/rte_power_intrinsics.c
@@ -23,9 +23,10 @@
 	uint64_t val;
 
 	/* trigger a write but don't change the value */
-	val = rte_atomic_load_explicit((volatile uint64_t *)addr, rte_memory_order_relaxed);
-	rte_atomic_compare_exchange_strong_explicit((volatile uint64_t *)addr, &val, val,
-			rte_memory_order_relaxed, rte_memory_order_relaxed);
+	val = rte_atomic_load_explicit((volatile __rte_atomic uint64_t *)addr,
+	    rte_memory_order_relaxed);
+	rte_atomic_compare_exchange_strong_explicit((volatile __rte_atomic uint64_t *)addr,
+	    &val, val, rte_memory_order_relaxed, rte_memory_order_relaxed);
 }
 
 static bool wait_supported;
-- 
1.8.3.1


^ permalink raw reply	[relevance 2%]

* [PATCH v5 0/6] optional rte optional stdatomics API
  @ 2023-08-17 21:42  3% ` Tyler Retzlaff
  2023-08-17 21:42  2%   ` [PATCH v5 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
  2023-08-21 22:27  0%   ` [PATCH v5 0/6] optional rte optional stdatomics API Konstantin Ananyev
  2023-08-22 21:00  3% ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
  1 sibling, 2 replies; 200+ results
From: Tyler Retzlaff @ 2023-08-17 21:42 UTC (permalink / raw)
  To: dev
  Cc: techboard, Bruce Richardson, Honnappa Nagarahalli, Ruifeng Wang,
	Jerin Jacob, Sunil Kumar Kori, Mattias Rönnblom, Joyce Kong,
	David Christensen, Konstantin Ananyev, David Hunt,
	Thomas Monjalon, David Marchand, Tyler Retzlaff

This series introduces API additions prefixed in the rte namespace that allow
the optional use of stdatomics.h from C11 using enable_stdatomics=true for
targets where enable_stdatomics=false no functional change is intended.

Be aware this does not contain all changes to use stdatomics across the DPDK
tree it only introduces the minimum to allow the option to be used which is
a pre-requisite for a clean CI (probably using clang) that can be run
with enable_stdatomics=true enabled.

It is planned that subsequent series will be introduced per lib/driver as
appropriate to further enable stdatomics use when enable_stdatomics=true.

Notes:

* Additional libraries beyond EAL make visible atomics use across the
  API/ABI surface they will be converted in the subsequent series.

* The eal: add rte atomic qualifier with casts patch needs some discussion
  as to whether or not the legacy rte_atomic APIs should be converted to
  work with enable_stdatomic=true right now some implementation dependent
  casts are used to prevent cascading / having to convert too much in
  the intial series.

* Windows will obviously need complete conversion of libraries including
  atomics that are not crossing API/ABI boundaries. those conversions will
  introduced in separate series as new along side the existing msvc series.

Please keep in mind we would like to prioritize the review / acceptance of
this patch since it needs to be completed in the 23.11 merge window.

Thank you all for the discussion that lead to the formation of this series.

v5:
  * Add RTE_ATOMIC to doxygen configuration PREDEFINED macros list to
    fix documentation generation failure
  * Fix two typos in expansion of C11 atomics macros strong -> weak and
    add missing _explicit
  * Adjust devtools/checkpatches messages based on feedback. i have chosen
    not to try and catch use of C11 atomics or _Atomic since using those
    directly will be picked up by existing CI passes where by compilation
    error where enable_stdatomic=false (the default for most platforms)

v4:
  * Move the definition of #define RTE_ATOMIC(type) to patch 1 where it
    belongs (a mistake in v3)
  * Provide comments for both RTE_ATOMIC and __rte_atomic macros indicating
    their use as specified or qualified contexts.

v3:
  * Remove comments from APIs mentioning the mapping to C++ memory model
    memory orders
  * Introduce and use new macro RTE_ATOMIC(type) to be used in contexts
    where _Atomic is used as a type specifier to declare variables. The
    macro allows more clarity about what the atomic type being specified
    is. e.g. _Atomic(T *) vs _Atomic(T) it is easier to understand that
    the former is an atomic pointer type and the latter is an atomic
    type. it also has the benefit of (in the future) being interoperable
    with c++23 syntactically
    note: Morten i have retained your 'reviewed-by' tags if you disagree
    given the changes in the above version please indicate as such but
    i believe the changes are in the spirit of the feedback you provided

v2:
  * Wrap meson_options.txt option description to newline and indent to
    be consistent with other options.
  * Provide separate typedef of rte_memory_order for enable_stdatomic=true
    VS enable_stdatomic=false instead of a single typedef to int
    note: slight tweak to reviewers feedback i've chosen to use a typedef
          for both enable_stdatomic={true,false} (just seemed more consistent)
  * Bring in assert.h and use static_assert macro instead of _Static_assert
    keyword to better interoperate with c/c++
  * Directly include rte_stdatomic.h where into other places it is consumed
    instead of hacking it globally into rte_config.h
  * Provide and use __rte_atomic_thread_fence to allow conditional expansion
    within the body of existing rte_atomic_thread_fence inline function to
    maintain per-arch optimizations when enable_stdatomic=false

Tyler Retzlaff (6):
  eal: provide rte stdatomics optional atomics API
  eal: adapt EAL to present rte optional atomics API
  eal: add rte atomic qualifier with casts
  distributor: adapt for EAL optional atomics API changes
  bpf: adapt for EAL optional atomics API changes
  devtools: forbid new direct use of GCC atomic builtins

 app/test/test_mcslock.c                  |   6 +-
 config/meson.build                       |   1 +
 devtools/checkpatches.sh                 |   8 +-
 doc/api/doxy-api.conf.in                 |   1 +
 lib/bpf/bpf_pkt.c                        |   6 +-
 lib/distributor/distributor_private.h    |   2 +-
 lib/distributor/rte_distributor_single.c |  44 +++----
 lib/eal/arm/include/rte_atomic_32.h      |   4 +-
 lib/eal/arm/include/rte_atomic_64.h      |  36 +++---
 lib/eal/arm/include/rte_pause_64.h       |  26 ++--
 lib/eal/arm/rte_power_intrinsics.c       |   8 +-
 lib/eal/common/eal_common_trace.c        |  16 +--
 lib/eal/include/generic/rte_atomic.h     |  67 +++++++----
 lib/eal/include/generic/rte_pause.h      |  50 ++++----
 lib/eal/include/generic/rte_rwlock.h     |  48 ++++----
 lib/eal/include/generic/rte_spinlock.h   |  20 ++--
 lib/eal/include/meson.build              |   1 +
 lib/eal/include/rte_mcslock.h            |  51 ++++----
 lib/eal/include/rte_pflock.h             |  25 ++--
 lib/eal/include/rte_seqcount.h           |  19 +--
 lib/eal/include/rte_stdatomic.h          | 198 +++++++++++++++++++++++++++++++
 lib/eal/include/rte_ticketlock.h         |  43 +++----
 lib/eal/include/rte_trace_point.h        |   5 +-
 lib/eal/loongarch/include/rte_atomic.h   |   4 +-
 lib/eal/ppc/include/rte_atomic.h         |  54 ++++-----
 lib/eal/riscv/include/rte_atomic.h       |   4 +-
 lib/eal/x86/include/rte_atomic.h         |   8 +-
 lib/eal/x86/include/rte_spinlock.h       |   2 +-
 lib/eal/x86/rte_power_intrinsics.c       |   7 +-
 meson_options.txt                        |   2 +
 30 files changed, 499 insertions(+), 267 deletions(-)
 create mode 100644 lib/eal/include/rte_stdatomic.h

-- 
1.8.3.1


^ permalink raw reply	[relevance 3%]

* Re: [PATCH v5 2/2] net/bonding: replace master/slave to main/member
  @ 2023-08-17  2:36  0%     ` lihuisong (C)
  0 siblings, 0 replies; 200+ results
From: lihuisong (C) @ 2023-08-17  2:36 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund, Long Wu, James Hershaw

good job. I doesn't find any where doesn't been replaced. thanks.
How do you make such a perfect and accurate replacement?
Acked-by: Huisong Li <lihuisong@huawei.com>


在 2023/8/16 14:27, Chaoyong He 写道:
> From: Long Wu <long.wu@corigine.com>
>
> This patch replaces the usage of the word 'master/slave' with more
> appropriate word 'main/member' in bonding PMD as well as in its docs
> and examples. Also the test app and testpmd were modified to use the
> new wording.
>
> The bonding PMD's public APIs were modified according to the changes
> in word:
> rte_eth_bond_8023ad_slave_info is now called
> rte_eth_bond_8023ad_member_info,
> rte_eth_bond_active_slaves_get is now called
> rte_eth_bond_active_members_get,
> rte_eth_bond_slave_add is now called
> rte_eth_bond_member_add,
> rte_eth_bond_slave_remove is now called
> rte_eth_bond_member_remove,
> rte_eth_bond_slaves_get is now called
> rte_eth_bond_members_get.
>
> The data structure ``struct rte_eth_bond_8023ad_slave_info`` was
> renamed to ``struct rte_eth_bond_8023ad_member_info``
>
> Signed-off-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: James Hershaw <james.hershaw@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Acked-by: Niklas Söderlund <niklas.soderlund@corigine.com>
> ---
>   app/test-pmd/testpmd.c                        |  113 +-
>   app/test-pmd/testpmd.h                        |    8 +-
>   app/test/test_link_bonding.c                  | 2792 +++++++++--------
>   app/test/test_link_bonding_mode4.c            |  588 ++--
>   app/test/test_link_bonding_rssconf.c          |  166 +-
>   doc/guides/howto/lm_bond_virtio_sriov.rst     |   24 +-
>   doc/guides/nics/bnxt.rst                      |    4 +-
>   doc/guides/prog_guide/img/bond-mode-1.svg     |    2 +-
>   .../link_bonding_poll_mode_drv_lib.rst        |  230 +-
>   doc/guides/rel_notes/deprecation.rst          |   16 -
>   doc/guides/rel_notes/release_23_11.rst        |   17 +
>   drivers/net/bonding/bonding_testpmd.c         |  178 +-
>   drivers/net/bonding/eth_bond_8023ad_private.h |   40 +-
>   drivers/net/bonding/eth_bond_private.h        |  108 +-
>   drivers/net/bonding/rte_eth_bond.h            |   96 +-
>   drivers/net/bonding/rte_eth_bond_8023ad.c     |  372 +--
>   drivers/net/bonding/rte_eth_bond_8023ad.h     |   67 +-
>   drivers/net/bonding/rte_eth_bond_alb.c        |   44 +-
>   drivers/net/bonding/rte_eth_bond_alb.h        |   20 +-
>   drivers/net/bonding/rte_eth_bond_api.c        |  482 +--
>   drivers/net/bonding/rte_eth_bond_args.c       |   32 +-
>   drivers/net/bonding/rte_eth_bond_flow.c       |   54 +-
>   drivers/net/bonding/rte_eth_bond_pmd.c        | 1384 ++++----
>   drivers/net/bonding/version.map               |   15 +-
>   examples/bond/main.c                          |   40 +-
>   25 files changed, 3486 insertions(+), 3406 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 938ca035d4..d41eb2b6f1 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -602,27 +602,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   }
>   
>   static int
> -change_bonding_slave_port_status(portid_t bond_pid, bool is_stop)
> +change_bonding_member_port_status(portid_t bond_pid, bool is_stop)
>   {
>   #ifdef RTE_NET_BOND
>   
> -	portid_t slave_pids[RTE_MAX_ETHPORTS];
> +	portid_t member_pids[RTE_MAX_ETHPORTS];
>   	struct rte_port *port;
> -	int num_slaves;
> -	portid_t slave_pid;
> +	int num_members;
> +	portid_t member_pid;
>   	int i;
>   
> -	num_slaves = rte_eth_bond_slaves_get(bond_pid, slave_pids,
> +	num_members = rte_eth_bond_members_get(bond_pid, member_pids,
>   						RTE_MAX_ETHPORTS);
> -	if (num_slaves < 0) {
> -		fprintf(stderr, "Failed to get slave list for port = %u\n",
> +	if (num_members < 0) {
> +		fprintf(stderr, "Failed to get member list for port = %u\n",
>   			bond_pid);
> -		return num_slaves;
> +		return num_members;
>   	}
>   
> -	for (i = 0; i < num_slaves; i++) {
> -		slave_pid = slave_pids[i];
> -		port = &ports[slave_pid];
> +	for (i = 0; i < num_members; i++) {
> +		member_pid = member_pids[i];
> +		port = &ports[member_pid];
>   		port->port_status =
>   			is_stop ? RTE_PORT_STOPPED : RTE_PORT_STARTED;
>   	}
> @@ -646,12 +646,12 @@ eth_dev_start_mp(uint16_t port_id)
>   		struct rte_port *port = &ports[port_id];
>   
>   		/*
> -		 * Starting a bonded port also starts all slaves under the bonded
> +		 * Starting a bonded port also starts all members under the bonded
>   		 * device. So if this port is bond device, we need to modify the
> -		 * port status of these slaves.
> +		 * port status of these members.
>   		 */
>   		if (port->bond_flag == 1)
> -			return change_bonding_slave_port_status(port_id, false);
> +			return change_bonding_member_port_status(port_id, false);
>   	}
>   
>   	return 0;
> @@ -670,12 +670,12 @@ eth_dev_stop_mp(uint16_t port_id)
>   		struct rte_port *port = &ports[port_id];
>   
>   		/*
> -		 * Stopping a bonded port also stops all slaves under the bonded
> +		 * Stopping a bonded port also stops all members under the bonded
>   		 * device. So if this port is bond device, we need to modify the
> -		 * port status of these slaves.
> +		 * port status of these members.
>   		 */
>   		if (port->bond_flag == 1)
> -			return change_bonding_slave_port_status(port_id, true);
> +			return change_bonding_member_port_status(port_id, true);
>   	}
>   
>   	return 0;
> @@ -2624,7 +2624,7 @@ all_ports_started(void)
>   		port = &ports[pi];
>   		/* Check if there is a port which is not started */
>   		if ((port->port_status != RTE_PORT_STARTED) &&
> -			(port->slave_flag == 0))
> +			(port->member_flag == 0))
>   			return 0;
>   	}
>   
> @@ -2638,7 +2638,7 @@ port_is_stopped(portid_t port_id)
>   	struct rte_port *port = &ports[port_id];
>   
>   	if ((port->port_status != RTE_PORT_STOPPED) &&
> -	    (port->slave_flag == 0))
> +	    (port->member_flag == 0))
>   		return 0;
>   	return 1;
>   }
> @@ -2984,8 +2984,8 @@ fill_xstats_display_info(void)
>   
>   /*
>    * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding
> - * device in dev_info is zero when no slave is added. And its capability
> - * will be updated when add a new slave device. So adding a slave device need
> + * device in dev_info is zero when no member is added. And its capability
> + * will be updated when add a new member device. So adding a member device need
>    * to update the port configurations of bonding device.
>    */
>   static void
> @@ -3042,7 +3042,7 @@ start_port(portid_t pid)
>   		if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
>   			continue;
>   
> -		if (port_is_bonding_slave(pi)) {
> +		if (port_is_bonding_member(pi)) {
>   			fprintf(stderr,
>   				"Please remove port %d from bonded device.\n",
>   				pi);
> @@ -3364,7 +3364,7 @@ stop_port(portid_t pid)
>   			continue;
>   		}
>   
> -		if (port_is_bonding_slave(pi)) {
> +		if (port_is_bonding_member(pi)) {
>   			fprintf(stderr,
>   				"Please remove port %d from bonded device.\n",
>   				pi);
> @@ -3453,28 +3453,28 @@ flush_port_owned_resources(portid_t pi)
>   }
>   
>   static void
> -clear_bonding_slave_device(portid_t *slave_pids, uint16_t num_slaves)
> +clear_bonding_member_device(portid_t *member_pids, uint16_t num_members)
>   {
>   	struct rte_port *port;
> -	portid_t slave_pid;
> +	portid_t member_pid;
>   	uint16_t i;
>   
> -	for (i = 0; i < num_slaves; i++) {
> -		slave_pid = slave_pids[i];
> -		if (port_is_started(slave_pid) == 1) {
> -			if (rte_eth_dev_stop(slave_pid) != 0)
> +	for (i = 0; i < num_members; i++) {
> +		member_pid = member_pids[i];
> +		if (port_is_started(member_pid) == 1) {
> +			if (rte_eth_dev_stop(member_pid) != 0)
>   				fprintf(stderr, "rte_eth_dev_stop failed for port %u\n",
> -					slave_pid);
> +					member_pid);
>   
> -			port = &ports[slave_pid];
> +			port = &ports[member_pid];
>   			port->port_status = RTE_PORT_STOPPED;
>   		}
>   
> -		clear_port_slave_flag(slave_pid);
> +		clear_port_member_flag(member_pid);
>   
> -		/* Close slave device when testpmd quit or is killed. */
> +		/* Close member device when testpmd quit or is killed. */
>   		if (cl_quit == 1 || f_quit == 1)
> -			rte_eth_dev_close(slave_pid);
> +			rte_eth_dev_close(member_pid);
>   	}
>   }
>   
> @@ -3483,8 +3483,8 @@ close_port(portid_t pid)
>   {
>   	portid_t pi;
>   	struct rte_port *port;
> -	portid_t slave_pids[RTE_MAX_ETHPORTS];
> -	int num_slaves = 0;
> +	portid_t member_pids[RTE_MAX_ETHPORTS];
> +	int num_members = 0;
>   
>   	if (port_id_is_invalid(pid, ENABLED_WARN))
>   		return;
> @@ -3502,7 +3502,7 @@ close_port(portid_t pid)
>   			continue;
>   		}
>   
> -		if (port_is_bonding_slave(pi)) {
> +		if (port_is_bonding_member(pi)) {
>   			fprintf(stderr,
>   				"Please remove port %d from bonded device.\n",
>   				pi);
> @@ -3519,17 +3519,17 @@ close_port(portid_t pid)
>   			flush_port_owned_resources(pi);
>   #ifdef RTE_NET_BOND
>   			if (port->bond_flag == 1)
> -				num_slaves = rte_eth_bond_slaves_get(pi,
> -						slave_pids, RTE_MAX_ETHPORTS);
> +				num_members = rte_eth_bond_members_get(pi,
> +						member_pids, RTE_MAX_ETHPORTS);
>   #endif
>   			rte_eth_dev_close(pi);
>   			/*
> -			 * If this port is bonded device, all slaves under the
> +			 * If this port is bonded device, all members under the
>   			 * device need to be removed or closed.
>   			 */
> -			if (port->bond_flag == 1 && num_slaves > 0)
> -				clear_bonding_slave_device(slave_pids,
> -							num_slaves);
> +			if (port->bond_flag == 1 && num_members > 0)
> +				clear_bonding_member_device(member_pids,
> +							num_members);
>   		}
>   
>   		free_xstats_display_info(pi);
> @@ -3569,7 +3569,7 @@ reset_port(portid_t pid)
>   			continue;
>   		}
>   
> -		if (port_is_bonding_slave(pi)) {
> +		if (port_is_bonding_member(pi)) {
>   			fprintf(stderr,
>   				"Please remove port %d from bonded device.\n",
>   				pi);
> @@ -4217,38 +4217,39 @@ init_port_config(void)
>   	}
>   }
>   
> -void set_port_slave_flag(portid_t slave_pid)
> +void set_port_member_flag(portid_t member_pid)
>   {
>   	struct rte_port *port;
>   
> -	port = &ports[slave_pid];
> -	port->slave_flag = 1;
> +	port = &ports[member_pid];
> +	port->member_flag = 1;
>   }
>   
> -void clear_port_slave_flag(portid_t slave_pid)
> +void clear_port_member_flag(portid_t member_pid)
>   {
>   	struct rte_port *port;
>   
> -	port = &ports[slave_pid];
> -	port->slave_flag = 0;
> +	port = &ports[member_pid];
> +	port->member_flag = 0;
>   }
>   
> -uint8_t port_is_bonding_slave(portid_t slave_pid)
> +uint8_t port_is_bonding_member(portid_t member_pid)
>   {
>   	struct rte_port *port;
>   	struct rte_eth_dev_info dev_info;
>   	int ret;
>   
> -	port = &ports[slave_pid];
> -	ret = eth_dev_info_get_print_err(slave_pid, &dev_info);
> +	port = &ports[member_pid];
> +	ret = eth_dev_info_get_print_err(member_pid, &dev_info);
>   	if (ret != 0) {
>   		TESTPMD_LOG(ERR,
>   			"Failed to get device info for port id %d,"
> -			"cannot determine if the port is a bonded slave",
> -			slave_pid);
> +			"cannot determine if the port is a bonded member",
> +			member_pid);
>   		return 0;
>   	}
> -	if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDING_MEMBER) || (port->slave_flag == 1))
> +
> +	if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDING_MEMBER) || (port->member_flag == 1))
>   		return 1;
>   	return 0;
>   }
> diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> index f1df6a8faf..888e30367f 100644
> --- a/app/test-pmd/testpmd.h
> +++ b/app/test-pmd/testpmd.h
> @@ -337,7 +337,7 @@ struct rte_port {
>   	uint32_t                mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
>   	queueid_t               queue_nb; /**< nb. of queues for flow rules */
>   	uint32_t                queue_sz; /**< size of a queue for flow rules */
> -	uint8_t                 slave_flag : 1, /**< bonding slave port */
> +	uint8_t                 member_flag : 1, /**< bonding member port */
>   				bond_flag : 1, /**< port is bond device */
>   				fwd_mac_swap : 1, /**< swap packet MAC before forward */
>   				update_conf : 1; /**< need to update bonding device configuration */
> @@ -1107,9 +1107,9 @@ void stop_packet_forwarding(void);
>   void dev_set_link_up(portid_t pid);
>   void dev_set_link_down(portid_t pid);
>   void init_port_config(void);
> -void set_port_slave_flag(portid_t slave_pid);
> -void clear_port_slave_flag(portid_t slave_pid);
> -uint8_t port_is_bonding_slave(portid_t slave_pid);
> +void set_port_member_flag(portid_t member_pid);
> +void clear_port_member_flag(portid_t member_pid);
> +uint8_t port_is_bonding_member(portid_t member_pid);
>   
>   int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode,
>   		     enum rte_eth_nb_tcs num_tcs,
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index 2f46e4c6ee..8dceb14ed0 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -59,13 +59,13 @@
>   #define INVALID_BONDING_MODE	(-1)
>   
>   
> -uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 };
> +uint8_t member_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 };
>   uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF };
>   
>   struct link_bonding_unittest_params {
>   	int16_t bonded_port_id;
> -	int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS];
> -	uint16_t bonded_slave_count;
> +	int16_t member_port_ids[TEST_MAX_NUMBER_OF_PORTS];
> +	uint16_t bonded_member_count;
>   	uint8_t bonding_mode;
>   
>   	uint16_t nb_rx_q;
> @@ -73,7 +73,7 @@ struct link_bonding_unittest_params {
>   
>   	struct rte_mempool *mbuf_pool;
>   
> -	struct rte_ether_addr *default_slave_mac;
> +	struct rte_ether_addr *default_member_mac;
>   	struct rte_ether_addr *default_bonded_mac;
>   
>   	/* Packet Headers */
> @@ -90,8 +90,8 @@ static struct rte_udp_hdr pkt_udp_hdr;
>   
>   static struct link_bonding_unittest_params default_params  = {
>   	.bonded_port_id = -1,
> -	.slave_port_ids = { -1 },
> -	.bonded_slave_count = 0,
> +	.member_port_ids = { -1 },
> +	.bonded_member_count = 0,
>   	.bonding_mode = BONDING_MODE_ROUND_ROBIN,
>   
>   	.nb_rx_q = 1,
> @@ -99,7 +99,7 @@ static struct link_bonding_unittest_params default_params  = {
>   
>   	.mbuf_pool = NULL,
>   
> -	.default_slave_mac = (struct rte_ether_addr *)slave_mac,
> +	.default_member_mac = (struct rte_ether_addr *)member_mac,
>   	.default_bonded_mac = (struct rte_ether_addr *)bonded_mac,
>   
>   	.pkt_eth_hdr = NULL,
> @@ -202,8 +202,8 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr)
>   	return 0;
>   }
>   
> -static int slaves_initialized;
> -static int mac_slaves_initialized;
> +static int members_initialized;
> +static int mac_members_initialized;
>   
>   static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
>   static pthread_cond_t cvar = PTHREAD_COND_INITIALIZER;
> @@ -213,7 +213,7 @@ static int
>   test_setup(void)
>   {
>   	int i, nb_mbuf_per_pool;
> -	struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)slave_mac;
> +	struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)member_mac;
>   
>   	/* Allocate ethernet packet header with space for VLAN header */
>   	if (test_params->pkt_eth_hdr == NULL) {
> @@ -235,7 +235,7 @@ test_setup(void)
>   	}
>   
>   	/* Create / Initialize virtual eth devs */
> -	if (!slaves_initialized) {
> +	if (!members_initialized) {
>   		for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) {
>   			char pmd_name[RTE_ETH_NAME_MAX_LEN];
>   
> @@ -243,16 +243,16 @@ test_setup(void)
>   
>   			snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_%d", i);
>   
> -			test_params->slave_port_ids[i] = virtual_ethdev_create(pmd_name,
> +			test_params->member_port_ids[i] = virtual_ethdev_create(pmd_name,
>   					mac_addr, rte_socket_id(), 1);
> -			TEST_ASSERT(test_params->slave_port_ids[i] >= 0,
> +			TEST_ASSERT(test_params->member_port_ids[i] >= 0,
>   					"Failed to create virtual virtual ethdev %s", pmd_name);
>   
>   			TEST_ASSERT_SUCCESS(configure_ethdev(
> -					test_params->slave_port_ids[i], 1, 0),
> +					test_params->member_port_ids[i], 1, 0),
>   					"Failed to configure virtual ethdev %s", pmd_name);
>   		}
> -		slaves_initialized = 1;
> +		members_initialized = 1;
>   	}
>   
>   	return 0;
> @@ -261,9 +261,9 @@ test_setup(void)
>   static int
>   test_create_bonded_device(void)
>   {
> -	int current_slave_count;
> +	int current_member_count;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
>   	/* Don't try to recreate bonded device if re-running test suite*/
>   	if (test_params->bonded_port_id == -1) {
> @@ -281,19 +281,19 @@ test_create_bonded_device(void)
>   			test_params->bonding_mode), "Failed to set ethdev %d to mode %d",
>   			test_params->bonded_port_id, test_params->bonding_mode);
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(current_slave_count, 0,
> -			"Number of slaves %d is great than expected %d.",
> -			current_slave_count, 0);
> +	TEST_ASSERT_EQUAL(current_member_count, 0,
> +			"Number of members %d is great than expected %d.",
> +			current_member_count, 0);
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);
> +	current_member_count = rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(current_slave_count, 0,
> -			"Number of active slaves %d is great than expected %d.",
> -			current_slave_count, 0);
> +	TEST_ASSERT_EQUAL(current_member_count, 0,
> +			"Number of active members %d is great than expected %d.",
> +			current_member_count, 0);
>   
>   	return 0;
>   }
> @@ -329,46 +329,46 @@ test_create_bonded_device_with_invalid_params(void)
>   }
>   
>   static int
> -test_add_slave_to_bonded_device(void)
> +test_add_member_to_bonded_device(void)
>   {
> -	int current_slave_count;
> +	int current_member_count;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id,
> -			test_params->slave_port_ids[test_params->bonded_slave_count]),
> -			"Failed to add slave (%d) to bonded port (%d).",
> -			test_params->slave_port_ids[test_params->bonded_slave_count],
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id,
> +			test_params->member_port_ids[test_params->bonded_member_count]),
> +			"Failed to add member (%d) to bonded port (%d).",
> +			test_params->member_port_ids[test_params->bonded_member_count],
>   			test_params->bonded_port_id);
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count + 1,
> -			"Number of slaves (%d) is greater than expected (%d).",
> -			current_slave_count, test_params->bonded_slave_count + 1);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count + 1,
> +			"Number of members (%d) is greater than expected (%d).",
> +			current_member_count, test_params->bonded_member_count + 1);
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, 0,
> -					"Number of active slaves (%d) is not as expected (%d).\n",
> -					current_slave_count, 0);
> +	current_member_count = rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, 0,
> +					"Number of active members (%d) is not as expected (%d).\n",
> +					current_member_count, 0);
>   
> -	test_params->bonded_slave_count++;
> +	test_params->bonded_member_count++;
>   
>   	return 0;
>   }
>   
>   static int
> -test_add_slave_to_invalid_bonded_device(void)
> +test_add_member_to_invalid_bonded_device(void)
>   {
>   	/* Invalid port ID */
> -	TEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->bonded_port_id + 5,
> -			test_params->slave_port_ids[test_params->bonded_slave_count]),
> +	TEST_ASSERT_FAIL(rte_eth_bond_member_add(test_params->bonded_port_id + 5,
> +			test_params->member_port_ids[test_params->bonded_member_count]),
>   			"Expected call to failed as invalid port specified.");
>   
>   	/* Non bonded device */
> -	TEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->slave_port_ids[0],
> -			test_params->slave_port_ids[test_params->bonded_slave_count]),
> +	TEST_ASSERT_FAIL(rte_eth_bond_member_add(test_params->member_port_ids[0],
> +			test_params->member_port_ids[test_params->bonded_member_count]),
>   			"Expected call to failed as invalid port specified.");
>   
>   	return 0;
> @@ -376,63 +376,63 @@ test_add_slave_to_invalid_bonded_device(void)
>   
>   
>   static int
> -test_remove_slave_from_bonded_device(void)
> +test_remove_member_from_bonded_device(void)
>   {
> -	int current_slave_count;
> +	int current_member_count;
>   	struct rte_ether_addr read_mac_addr, *mac_addr;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id,
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1]),
> -			"Failed to remove slave %d from bonded port (%d).",
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1],
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(test_params->bonded_port_id,
> +			test_params->member_port_ids[test_params->bonded_member_count-1]),
> +			"Failed to remove member %d from bonded port (%d).",
> +			test_params->member_port_ids[test_params->bonded_member_count-1],
>   			test_params->bonded_port_id);
>   
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count - 1,
> -			"Number of slaves (%d) is great than expected (%d).\n",
> -			current_slave_count, test_params->bonded_slave_count - 1);
> +	TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count - 1,
> +			"Number of members (%d) is great than expected (%d).\n",
> +			current_member_count, test_params->bonded_member_count - 1);
>   
>   
> -	mac_addr = (struct rte_ether_addr *)slave_mac;
> +	mac_addr = (struct rte_ether_addr *)member_mac;
>   	mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =
> -			test_params->bonded_slave_count-1;
> +			test_params->bonded_member_count-1;
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1],
> +			test_params->member_port_ids[test_params->bonded_member_count-1],
>   			&read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1]);
> +			test_params->member_port_ids[test_params->bonded_member_count-1]);
>   	TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
>   			"bonded port mac address not set to that of primary port\n");
>   
>   	rte_eth_stats_reset(
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1]);
> +			test_params->member_port_ids[test_params->bonded_member_count-1]);
>   
>   	virtual_ethdev_simulate_link_status_interrupt(test_params->bonded_port_id,
>   			0);
>   
> -	test_params->bonded_slave_count--;
> +	test_params->bonded_member_count--;
>   
>   	return 0;
>   }
>   
>   static int
> -test_remove_slave_from_invalid_bonded_device(void)
> +test_remove_member_from_invalid_bonded_device(void)
>   {
>   	/* Invalid port ID */
> -	TEST_ASSERT_FAIL(rte_eth_bond_slave_remove(
> +	TEST_ASSERT_FAIL(rte_eth_bond_member_remove(
>   			test_params->bonded_port_id + 5,
> -			test_params->slave_port_ids[test_params->bonded_slave_count - 1]),
> +			test_params->member_port_ids[test_params->bonded_member_count - 1]),
>   			"Expected call to failed as invalid port specified.");
>   
>   	/* Non bonded device */
> -	TEST_ASSERT_FAIL(rte_eth_bond_slave_remove(
> -			test_params->slave_port_ids[0],
> -			test_params->slave_port_ids[test_params->bonded_slave_count - 1]),
> +	TEST_ASSERT_FAIL(rte_eth_bond_member_remove(
> +			test_params->member_port_ids[0],
> +			test_params->member_port_ids[test_params->bonded_member_count - 1]),
>   			"Expected call to failed as invalid port specified.");
>   
>   	return 0;
> @@ -441,19 +441,19 @@ test_remove_slave_from_invalid_bonded_device(void)
>   static int bonded_id = 2;
>   
>   static int
> -test_add_already_bonded_slave_to_bonded_device(void)
> +test_add_already_bonded_member_to_bonded_device(void)
>   {
> -	int port_id, current_slave_count;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	int port_id, current_member_count;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   	char pmd_name[RTE_ETH_NAME_MAX_LEN];
>   
> -	test_add_slave_to_bonded_device();
> +	test_add_member_to_bonded_device();
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, 1,
> -			"Number of slaves (%d) is not that expected (%d).",
> -			current_slave_count, 1);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, 1,
> +			"Number of members (%d) is not that expected (%d).",
> +			current_member_count, 1);
>   
>   	snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d", BONDED_DEV_NAME, ++bonded_id);
>   
> @@ -461,93 +461,93 @@ test_add_already_bonded_slave_to_bonded_device(void)
>   			rte_socket_id());
>   	TEST_ASSERT(port_id >= 0, "Failed to create bonded device.");
>   
> -	TEST_ASSERT(rte_eth_bond_slave_add(port_id,
> -			test_params->slave_port_ids[test_params->bonded_slave_count - 1])
> +	TEST_ASSERT(rte_eth_bond_member_add(port_id,
> +			test_params->member_port_ids[test_params->bonded_member_count - 1])
>   			< 0,
> -			"Added slave (%d) to bonded port (%d) unexpectedly.",
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1],
> +			"Added member (%d) to bonded port (%d) unexpectedly.",
> +			test_params->member_port_ids[test_params->bonded_member_count-1],
>   			port_id);
>   
> -	return test_remove_slave_from_bonded_device();
> +	return test_remove_member_from_bonded_device();
>   }
>   
>   
>   static int
> -test_get_slaves_from_bonded_device(void)
> +test_get_members_from_bonded_device(void)
>   {
> -	int current_slave_count;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	int current_member_count;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -			"Failed to add slave to bonded device");
> +	TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +			"Failed to add member to bonded device");
>   
>   	/* Invalid port id */
> -	current_slave_count = rte_eth_bond_slaves_get(INVALID_PORT_ID, slaves,
> +	current_member_count = rte_eth_bond_members_get(INVALID_PORT_ID, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> +	TEST_ASSERT(current_member_count < 0,
>   			"Invalid port id unexpectedly succeeded");
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(INVALID_PORT_ID,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> +	current_member_count = rte_eth_bond_active_members_get(INVALID_PORT_ID,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT(current_member_count < 0,
>   			"Invalid port id unexpectedly succeeded");
>   
> -	/* Invalid slaves pointer */
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> +	/* Invalid members pointer */
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
>   			NULL, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> -			"Invalid slave array unexpectedly succeeded");
> +	TEST_ASSERT(current_member_count < 0,
> +			"Invalid member array unexpectedly succeeded");
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> +	current_member_count = rte_eth_bond_active_members_get(
>   			test_params->bonded_port_id, NULL, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> -			"Invalid slave array unexpectedly succeeded");
> +	TEST_ASSERT(current_member_count < 0,
> +			"Invalid member array unexpectedly succeeded");
>   
>   	/* non bonded device*/
> -	current_slave_count = rte_eth_bond_slaves_get(
> -			test_params->slave_port_ids[0], NULL, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> +	current_member_count = rte_eth_bond_members_get(
> +			test_params->member_port_ids[0], NULL, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT(current_member_count < 0,
>   			"Invalid port id unexpectedly succeeded");
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> -			test_params->slave_port_ids[0],	NULL, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT(current_slave_count < 0,
> +	current_member_count = rte_eth_bond_active_members_get(
> +			test_params->member_port_ids[0],	NULL, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT(current_member_count < 0,
>   			"Invalid port id unexpectedly succeeded");
>   
> -	TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),
> -			"Failed to remove slaves from bonded device");
> +	TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(),
> +			"Failed to remove members from bonded device");
>   
>   	return 0;
>   }
>   
>   
>   static int
> -test_add_remove_multiple_slaves_to_from_bonded_device(void)
> +test_add_remove_multiple_members_to_from_bonded_device(void)
>   {
>   	int i;
>   
>   	for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++)
> -		TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -				"Failed to add slave to bonded device");
> +		TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +				"Failed to add member to bonded device");
>   
>   	for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++)
> -		TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),
> -				"Failed to remove slaves from bonded device");
> +		TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(),
> +				"Failed to remove members from bonded device");
>   
>   	return 0;
>   }
>   
>   static void
> -enable_bonded_slaves(void)
> +enable_bonded_members(void)
>   {
>   	int i;
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		virtual_ethdev_tx_burst_fn_set_success(test_params->slave_port_ids[i],
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		virtual_ethdev_tx_burst_fn_set_success(test_params->member_port_ids[i],
>   				1);
>   
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 1);
> +				test_params->member_port_ids[i], 1);
>   	}
>   }
>   
> @@ -556,34 +556,36 @@ test_start_bonded_device(void)
>   {
>   	struct rte_eth_link link_status;
>   
> -	int current_slave_count, current_bonding_mode, primary_port;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	int current_member_count, current_bonding_mode, primary_port;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   	int retval;
>   
> -	/* Add slave to bonded device*/
> -	TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -			"Failed to add slave to bonded device");
> +	/* Add member to bonded device*/
> +	TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +			"Failed to add member to bonded device");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id),
>   		"Failed to start bonded pmd eth device %d.",
>   		test_params->bonded_port_id);
>   
> -	/* Change link status of virtual pmd so it will be added to the active
> -	 * slave list of the bonded device*/
> +	/*
> +	 * Change link status of virtual pmd so it will be added to the active
> +	 * member list of the bonded device.
> +	 */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[test_params->bonded_slave_count-1], 1);
> +			test_params->member_port_ids[test_params->bonded_member_count-1], 1);
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,
> -			"Number of slaves (%d) is not expected value (%d).",
> -			current_slave_count, test_params->bonded_slave_count);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count,
> +			"Number of members (%d) is not expected value (%d).",
> +			current_member_count, test_params->bonded_member_count);
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,
> -			"Number of active slaves (%d) is not expected value (%d).",
> -			current_slave_count, test_params->bonded_slave_count);
> +	current_member_count = rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count,
> +			"Number of active members (%d) is not expected value (%d).",
> +			current_member_count, test_params->bonded_member_count);
>   
>   	current_bonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id);
>   	TEST_ASSERT_EQUAL(current_bonding_mode, test_params->bonding_mode,
> @@ -591,9 +593,9 @@ test_start_bonded_device(void)
>   			current_bonding_mode, test_params->bonding_mode);
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
> -	TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0],
> +	TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0],
>   			"Primary port (%d) is not expected value (%d).",
> -			primary_port, test_params->slave_port_ids[0]);
> +			primary_port, test_params->member_port_ids[0]);
>   
>   	retval = rte_eth_link_get(test_params->bonded_port_id, &link_status);
>   	TEST_ASSERT(retval >= 0,
> @@ -609,8 +611,8 @@ test_start_bonded_device(void)
>   static int
>   test_stop_bonded_device(void)
>   {
> -	int current_slave_count;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	int current_member_count;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
>   	struct rte_eth_link link_status;
>   	int retval;
> @@ -627,29 +629,29 @@ test_stop_bonded_device(void)
>   			"Bonded port (%d) status (%d) is not expected value (%d).",
>   			test_params->bonded_port_id, link_status.link_status, 0);
>   
> -	current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count,
> -			"Number of slaves (%d) is not expected value (%d).",
> -			current_slave_count, test_params->bonded_slave_count);
> +	current_member_count = rte_eth_bond_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, test_params->bonded_member_count,
> +			"Number of members (%d) is not expected value (%d).",
> +			current_member_count, test_params->bonded_member_count);
>   
> -	current_slave_count = rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(current_slave_count, 0,
> -			"Number of active slaves (%d) is not expected value (%d).",
> -			current_slave_count, 0);
> +	current_member_count = rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(current_member_count, 0,
> +			"Number of active members (%d) is not expected value (%d).",
> +			current_member_count, 0);
>   
>   	return 0;
>   }
>   
>   static int
> -remove_slaves_and_stop_bonded_device(void)
> +remove_members_and_stop_bonded_device(void)
>   {
> -	/* Clean up and remove slaves from bonded device */
> +	/* Clean up and remove members from bonded device */
>   	free_virtualpmd_tx_queue();
> -	while (test_params->bonded_slave_count > 0)
> -		TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(),
> -				"test_remove_slave_from_bonded_device failed");
> +	while (test_params->bonded_member_count > 0)
> +		TEST_ASSERT_SUCCESS(test_remove_member_from_bonded_device(),
> +				"test_remove_member_from_bonded_device failed");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
> @@ -681,10 +683,10 @@ test_set_bonding_mode(void)
>   				INVALID_PORT_ID);
>   
>   		/* Non bonded device */
> -		TEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->slave_port_ids[0],
> +		TEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->member_port_ids[0],
>   				bonding_modes[i]),
>   				"Expected call to failed as invalid port (%d) specified.",
> -				test_params->slave_port_ids[0]);
> +				test_params->member_port_ids[0]);
>   
>   		TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id,
>   				bonding_modes[i]),
> @@ -704,26 +706,26 @@ test_set_bonding_mode(void)
>   				INVALID_PORT_ID);
>   
>   		/* Non bonded device */
> -		bonding_mode = rte_eth_bond_mode_get(test_params->slave_port_ids[0]);
> +		bonding_mode = rte_eth_bond_mode_get(test_params->member_port_ids[0]);
>   		TEST_ASSERT(bonding_mode < 0,
>   				"Expected call to failed as invalid port (%d) specified.",
> -				test_params->slave_port_ids[0]);
> +				test_params->member_port_ids[0]);
>   	}
>   
> -	return remove_slaves_and_stop_bonded_device();
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> -test_set_primary_slave(void)
> +test_set_primary_member(void)
>   {
>   	int i, j, retval;
>   	struct rte_ether_addr read_mac_addr;
>   	struct rte_ether_addr *expected_mac_addr;
>   
> -	/* Add 4 slaves to bonded device */
> -	for (i = test_params->bonded_slave_count; i < 4; i++)
> -		TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -				"Failed to add slave to bonded device.");
> +	/* Add 4 members to bonded device */
> +	for (i = test_params->bonded_member_count; i < 4; i++)
> +		TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +				"Failed to add member to bonded device.");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id,
>   			BONDING_MODE_ROUND_ROBIN),
> @@ -732,34 +734,34 @@ test_set_primary_slave(void)
>   
>   	/* Invalid port ID */
>   	TEST_ASSERT_FAIL(rte_eth_bond_primary_set(INVALID_PORT_ID,
> -			test_params->slave_port_ids[i]),
> +			test_params->member_port_ids[i]),
>   			"Expected call to failed as invalid port specified.");
>   
>   	/* Non bonded device */
> -	TEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->slave_port_ids[i],
> -			test_params->slave_port_ids[i]),
> +	TEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->member_port_ids[i],
> +			test_params->member_port_ids[i]),
>   			"Expected call to failed as invalid port specified.");
>   
> -	/* Set slave as primary
> -	 * Verify slave it is now primary slave
> -	 * Verify that MAC address of bonded device is that of primary slave
> -	 * Verify that MAC address of all bonded slaves are that of primary slave
> +	/* Set member as primary
> +	 * Verify member it is now primary member
> +	 * Verify that MAC address of bonded device is that of primary member
> +	 * Verify that MAC address of all bonded members are that of primary member
>   	 */
>   	for (i = 0; i < 4; i++) {
>   		TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -				test_params->slave_port_ids[i]),
> +				test_params->member_port_ids[i]),
>   				"Failed to set bonded port (%d) primary port to (%d)",
> -				test_params->bonded_port_id, test_params->slave_port_ids[i]);
> +				test_params->bonded_port_id, test_params->member_port_ids[i]);
>   
>   		retval = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   		TEST_ASSERT(retval >= 0,
>   				"Failed to read primary port from bonded port (%d)\n",
>   					test_params->bonded_port_id);
>   
> -		TEST_ASSERT_EQUAL(retval, test_params->slave_port_ids[i],
> +		TEST_ASSERT_EQUAL(retval, test_params->member_port_ids[i],
>   				"Bonded port (%d) primary port (%d) not expected value (%d)\n",
>   				test_params->bonded_port_id, retval,
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   
>   		/* stop/start bonded eth dev to apply new MAC */
>   		TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
> @@ -770,13 +772,14 @@ test_set_primary_slave(void)
>   				"Failed to start bonded port %d",
>   				test_params->bonded_port_id);
>   
> -		expected_mac_addr = (struct rte_ether_addr *)&slave_mac;
> +		expected_mac_addr = (struct rte_ether_addr *)&member_mac;
>   		expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
>   
> -		/* Check primary slave MAC */
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +		/* Check primary member MAC */
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
>   				sizeof(read_mac_addr)),
>   				"bonded port mac address not set to that of primary port\n");
> @@ -789,16 +792,17 @@ test_set_primary_slave(void)
>   				sizeof(read_mac_addr)),
>   				"bonded port mac address not set to that of primary port\n");
>   
> -		/* Check other slaves MACs */
> +		/* Check other members MACs */
>   		for (j = 0; j < 4; j++) {
>   			if (j != i) {
> -				TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[j],
> +				TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(
> +						test_params->member_port_ids[j],
>   						&read_mac_addr),
>   						"Failed to get mac address (port %d)",
> -						test_params->slave_port_ids[j]);
> +						test_params->member_port_ids[j]);
>   				TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
>   						sizeof(read_mac_addr)),
> -						"slave port mac address not set to that of primary "
> +						"member port mac address not set to that of primary "
>   						"port");
>   			}
>   		}
> @@ -809,14 +813,14 @@ test_set_primary_slave(void)
>   	TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->bonded_port_id + 10),
>   			"read primary port from expectedly");
>   
> -	/* Test with slave port */
> -	TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->slave_port_ids[0]),
> +	/* Test with member port */
> +	TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->member_port_ids[0]),
>   			"read primary port from expectedly\n");
>   
> -	TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),
> -			"Failed to stop and remove slaves from bonded device");
> +	TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(),
> +			"Failed to stop and remove members from bonded device");
>   
> -	/* No slaves  */
> +	/* No members  */
>   	TEST_ASSERT(rte_eth_bond_primary_get(test_params->bonded_port_id)  < 0,
>   			"read primary port from expectedly\n");
>   
> @@ -840,7 +844,7 @@ test_set_explicit_bonded_mac(void)
>   
>   	/* Non bonded device */
>   	TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(
> -			test_params->slave_port_ids[0],	mac_addr),
> +			test_params->member_port_ids[0],	mac_addr),
>   			"Expected call to failed as invalid port specified.");
>   
>   	/* NULL MAC address */
> @@ -853,10 +857,10 @@ test_set_explicit_bonded_mac(void)
>   			"Failed to set MAC address on bonded port (%d)",
>   			test_params->bonded_port_id);
>   
> -	/* Add 4 slaves to bonded device */
> -	for (i = test_params->bonded_slave_count; i < 4; i++) {
> -		TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -				"Failed to add slave to bonded device.\n");
> +	/* Add 4 members to bonded device */
> +	for (i = test_params->bonded_member_count; i < 4; i++) {
> +		TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +				"Failed to add member to bonded device.\n");
>   	}
>   
>   	/* Check bonded MAC */
> @@ -866,14 +870,15 @@ test_set_explicit_bonded_mac(void)
>   	TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)),
>   			"bonded port mac address not set to that of primary port");
>   
> -	/* Check other slaves MACs */
> +	/* Check other members MACs */
>   	for (i = 0; i < 4; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port mac address not set to that of primary port");
> +				"member port mac address not set to that of primary port");
>   	}
>   
>   	/* test resetting mac address on bonded device */
> @@ -883,13 +888,13 @@ test_set_explicit_bonded_mac(void)
>   			test_params->bonded_port_id);
>   
>   	TEST_ASSERT_FAIL(
> -			rte_eth_bond_mac_address_reset(test_params->slave_port_ids[0]),
> +			rte_eth_bond_mac_address_reset(test_params->member_port_ids[0]),
>   			"Reset MAC address on bonded port (%d) unexpectedly",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	/* test resetting mac address on bonded device with no slaves */
> -	TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),
> -			"Failed to remove slaves and stop bonded device");
> +	/* test resetting mac address on bonded device with no members */
> +	TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(),
> +			"Failed to remove members and stop bonded device");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_port_id),
>   			"Failed to reset MAC address on bonded port (%d)",
> @@ -898,25 +903,25 @@ test_set_explicit_bonded_mac(void)
>   	return 0;
>   }
>   
> -#define BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT (3)
> +#define BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT (3)
>   
>   static int
>   test_set_bonded_port_initialization_mac_assignment(void)
>   {
> -	int i, slave_count;
> +	int i, member_count;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   	static int bonded_port_id = -1;
> -	static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT];
> +	static int member_port_ids[BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT];
>   
> -	struct rte_ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr;
> +	struct rte_ether_addr member_mac_addr, bonded_mac_addr, read_mac_addr;
>   
>   	/* Initialize default values for MAC addresses */
> -	memcpy(&slave_mac_addr, slave_mac, sizeof(struct rte_ether_addr));
> -	memcpy(&bonded_mac_addr, slave_mac, sizeof(struct rte_ether_addr));
> +	memcpy(&member_mac_addr, member_mac, sizeof(struct rte_ether_addr));
> +	memcpy(&bonded_mac_addr, member_mac, sizeof(struct rte_ether_addr));
>   
>   	/*
> -	 * 1. a - Create / configure  bonded / slave ethdevs
> +	 * 1. a - Create / configure  bonded / member ethdevs
>   	 */
>   	if (bonded_port_id == -1) {
>   		bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test",
> @@ -927,46 +932,46 @@ test_set_bonded_port_initialization_mac_assignment(void)
>   					"Failed to configure bonded ethdev");
>   	}
>   
> -	if (!mac_slaves_initialized) {
> -		for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
> +	if (!mac_members_initialized) {
> +		for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) {
>   			char pmd_name[RTE_ETH_NAME_MAX_LEN];
>   
> -			slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
> +			member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
>   				i + 100;
>   
>   			snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN,
> -				"eth_slave_%d", i);
> +				"eth_member_%d", i);
>   
> -			slave_port_ids[i] = virtual_ethdev_create(pmd_name,
> -					&slave_mac_addr, rte_socket_id(), 1);
> +			member_port_ids[i] = virtual_ethdev_create(pmd_name,
> +					&member_mac_addr, rte_socket_id(), 1);
>   
> -			TEST_ASSERT(slave_port_ids[i] >= 0,
> -					"Failed to create slave ethdev %s",
> +			TEST_ASSERT(member_port_ids[i] >= 0,
> +					"Failed to create member ethdev %s",
>   					pmd_name);
>   
> -			TEST_ASSERT_SUCCESS(configure_ethdev(slave_port_ids[i], 1, 0),
> +			TEST_ASSERT_SUCCESS(configure_ethdev(member_port_ids[i], 1, 0),
>   					"Failed to configure virtual ethdev %s",
>   					pmd_name);
>   		}
> -		mac_slaves_initialized = 1;
> +		mac_members_initialized = 1;
>   	}
>   
>   
>   	/*
> -	 * 2. Add slave ethdevs to bonded device
> +	 * 2. Add member ethdevs to bonded device
>   	 */
> -	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(bonded_port_id,
> -				slave_port_ids[i]),
> -				"Failed to add slave (%d) to bonded port (%d).",
> -				slave_port_ids[i], bonded_port_id);
> +	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(bonded_port_id,
> +				member_port_ids[i]),
> +				"Failed to add member (%d) to bonded port (%d).",
> +				member_port_ids[i], bonded_port_id);
>   	}
>   
> -	slave_count = rte_eth_bond_slaves_get(bonded_port_id, slaves,
> +	member_count = rte_eth_bond_members_get(bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT, slave_count,
> -			"Number of slaves (%d) is not as expected (%d)",
> -			slave_count, BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT);
> +	TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT, member_count,
> +			"Number of members (%d) is not as expected (%d)",
> +			member_count, BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT);
>   
>   
>   	/*
> @@ -982,16 +987,16 @@ test_set_bonded_port_initialization_mac_assignment(void)
>   
>   
>   	/* 4. a - Start bonded ethdev
> -	 *    b - Enable slave devices
> -	 *    c - Verify bonded/slaves ethdev MAC addresses
> +	 *    b - Enable member devices
> +	 *    c - Verify bonded/members ethdev MAC addresses
>   	 */
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonded_port_id),
>   			"Failed to start bonded pmd eth device %d.",
>   			bonded_port_id);
>   
> -	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
> +	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) {
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				slave_port_ids[i], 1);
> +				member_port_ids[i], 1);
>   	}
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr),
> @@ -1001,36 +1006,36 @@ test_set_bonded_port_initialization_mac_assignment(void)
>   			sizeof(read_mac_addr)),
>   			"bonded port mac address not as expected");
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[0]);
> +			member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 0 mac address not as expected");
> +			"member port 0 mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[1]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[1]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 1 mac address not as expected");
> +			"member port 1 mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[2], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[2]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[2]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 2 mac address not as expected");
> +			"member port 2 mac address not as expected");
>   
>   
>   	/* 7. a - Change primary port
>   	 *    b - Stop / Start bonded port
> -	 *    d - Verify slave ethdev MAC addresses
> +	 *    d - Verify member ethdev MAC addresses
>   	 */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(bonded_port_id,
> -			slave_port_ids[2]),
> +			member_port_ids[2]),
>   			"failed to set primary port on bonded device.");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id),
> @@ -1048,94 +1053,94 @@ test_set_bonded_port_initialization_mac_assignment(void)
>   			sizeof(read_mac_addr)),
>   			"bonded port mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 0 mac address not as expected");
> +			"member port 0 mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[1]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[1]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 1 mac address not as expected");
> +			"member port 1 mac address not as expected");
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[2], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[2]);
> +			member_port_ids[2]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 2 mac address not as expected");
> +			"member port 2 mac address not as expected");
>   
>   	/* 6. a - Stop bonded ethdev
> -	 *    b - remove slave ethdevs
> -	 *    c - Verify slave ethdevs MACs are restored
> +	 *    b - remove member ethdevs
> +	 *    c - Verify member ethdevs MACs are restored
>   	 */
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id),
>   			"Failed to stop bonded port %u",
>   			bonded_port_id);
>   
> -	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(bonded_port_id,
> -				slave_port_ids[i]),
> -				"Failed to remove slave %d from bonded port (%d).",
> -				slave_port_ids[i], bonded_port_id);
> +	for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(bonded_port_id,
> +				member_port_ids[i]),
> +				"Failed to remove member %d from bonded port (%d).",
> +				member_port_ids[i], bonded_port_id);
>   	}
>   
> -	slave_count = rte_eth_bond_slaves_get(bonded_port_id, slaves,
> +	member_count = rte_eth_bond_members_get(bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(slave_count, 0,
> -			"Number of slaves (%d) is great than expected (%d).",
> -			slave_count, 0);
> +	TEST_ASSERT_EQUAL(member_count, 0,
> +			"Number of members (%d) is great than expected (%d).",
> +			member_count, 0);
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 0 mac address not as expected");
> +			"member port 0 mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[1]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[1]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 1 mac address not as expected");
> +			"member port 1 mac address not as expected");
>   
> -	slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr),
> +	member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(member_port_ids[2], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			slave_port_ids[2]);
> -	TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
> +			member_port_ids[2]);
> +	TEST_ASSERT_SUCCESS(memcmp(&member_mac_addr, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port 2 mac address not as expected");
> +			"member port 2 mac address not as expected");
>   
>   	return 0;
>   }
>   
>   
>   static int
> -initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr,
> -		uint16_t number_of_slaves, uint8_t enable_slave)
> +initialize_bonded_device_with_members(uint8_t bonding_mode, uint8_t bond_en_isr,
> +		uint16_t number_of_members, uint8_t enable_member)
>   {
>   	/* Configure bonded device */
>   	TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0,
>   			bond_en_isr), "Failed to configure bonding port (%d) in mode %d "
> -			"with (%d) slaves.", test_params->bonded_port_id, bonding_mode,
> -			number_of_slaves);
> -
> -	/* Add slaves to bonded device */
> -	while (number_of_slaves > test_params->bonded_slave_count)
> -		TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(),
> -				"Failed to add slave (%d to  bonding port (%d).",
> -				test_params->bonded_slave_count - 1,
> +			"with (%d) members.", test_params->bonded_port_id, bonding_mode,
> +			number_of_members);
> +
> +	/* Add members to bonded device */
> +	while (number_of_members > test_params->bonded_member_count)
> +		TEST_ASSERT_SUCCESS(test_add_member_to_bonded_device(),
> +				"Failed to add member (%d to  bonding port (%d).",
> +				test_params->bonded_member_count - 1,
>   				test_params->bonded_port_id);
>   
>   	/* Set link bonding mode  */
> @@ -1148,40 +1153,40 @@ initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr,
>   		"Failed to start bonded pmd eth device %d.",
>   		test_params->bonded_port_id);
>   
> -	if (enable_slave)
> -		enable_bonded_slaves();
> +	if (enable_member)
> +		enable_bonded_members();
>   
>   	return 0;
>   }
>   
>   static int
> -test_adding_slave_after_bonded_device_started(void)
> +test_adding_member_after_bonded_device_started(void)
>   {
>   	int i;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0, 4, 0),
> -			"Failed to add slaves to bonded device");
> +			"Failed to add members to bonded device");
>   
> -	/* Enabled slave devices */
> -	for (i = 0; i < test_params->bonded_slave_count + 1; i++) {
> +	/* Enabled member devices */
> +	for (i = 0; i < test_params->bonded_member_count + 1; i++) {
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 1);
> +				test_params->member_port_ids[i], 1);
>   	}
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id,
> -			test_params->slave_port_ids[test_params->bonded_slave_count]),
> -			"Failed to add slave to bonded port.\n");
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id,
> +			test_params->member_port_ids[test_params->bonded_member_count]),
> +			"Failed to add member to bonded port.\n");
>   
>   	rte_eth_stats_reset(
> -			test_params->slave_port_ids[test_params->bonded_slave_count]);
> +			test_params->member_port_ids[test_params->bonded_member_count]);
>   
> -	test_params->bonded_slave_count++;
> +	test_params->bonded_member_count++;
>   
> -	return remove_slaves_and_stop_bonded_device();
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_STATUS_INTERRUPT_SLAVE_COUNT	4
> +#define TEST_STATUS_INTERRUPT_MEMBER_COUNT	4
>   #define TEST_LSC_WAIT_TIMEOUT_US	500000
>   
>   int test_lsc_interrupt_count;
> @@ -1237,13 +1242,13 @@ lsc_timeout(int wait_us)
>   static int
>   test_status_interrupt(void)
>   {
> -	int slave_count;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	int member_count;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	/* initialized bonding device with T slaves */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* initialized bonding device with T members */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 1,
> -			TEST_STATUS_INTERRUPT_SLAVE_COUNT, 1),
> +			TEST_STATUS_INTERRUPT_MEMBER_COUNT, 1),
>   			"Failed to initialise bonded device");
>   
>   	test_lsc_interrupt_count = 0;
> @@ -1253,27 +1258,27 @@ test_status_interrupt(void)
>   			RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
>   			&test_params->bonded_port_id);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT,
> -			"Number of active slaves (%d) is not as expected (%d)",
> -			slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT);
> +	TEST_ASSERT_EQUAL(member_count, TEST_STATUS_INTERRUPT_MEMBER_COUNT,
> +			"Number of active members (%d) is not as expected (%d)",
> +			member_count, TEST_STATUS_INTERRUPT_MEMBER_COUNT);
>   
> -	/* Bring all 4 slaves link status to down and test that we have received a
> +	/* Bring all 4 members link status to down and test that we have received a
>   	 * lsc interrupts */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 0);
> +			test_params->member_port_ids[0], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[2], 0);
> +			test_params->member_port_ids[2], 0);
>   
>   	TEST_ASSERT_EQUAL(test_lsc_interrupt_count, 0,
>   			"Received a link status change interrupt unexpectedly");
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
>   	TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0,
>   			"timed out waiting for interrupt");
> @@ -1281,18 +1286,18 @@ test_status_interrupt(void)
>   	TEST_ASSERT(test_lsc_interrupt_count > 0,
>   			"Did not receive link status change interrupt");
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
>   
> -	TEST_ASSERT_EQUAL(slave_count, 0,
> -			"Number of active slaves (%d) is not as expected (%d)",
> -			slave_count, 0);
> +	TEST_ASSERT_EQUAL(member_count, 0,
> +			"Number of active members (%d) is not as expected (%d)",
> +			member_count, 0);
>   
> -	/* bring one slave port up so link status will change */
> +	/* bring one member port up so link status will change */
>   	test_lsc_interrupt_count = 0;
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 1);
> +			test_params->member_port_ids[0], 1);
>   
>   	TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0,
>   			"timed out waiting for interrupt");
> @@ -1301,12 +1306,12 @@ test_status_interrupt(void)
>   	TEST_ASSERT(test_lsc_interrupt_count > 0,
>   			"Did not receive link status change interrupt");
>   
> -	/* Verify that calling the same slave lsc interrupt doesn't cause another
> +	/* Verify that calling the same member lsc interrupt doesn't cause another
>   	 * lsc interrupt from bonded device */
>   	test_lsc_interrupt_count = 0;
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 1);
> +			test_params->member_port_ids[0], 1);
>   
>   	TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) != 0,
>   			"received unexpected interrupt");
> @@ -1320,8 +1325,8 @@ test_status_interrupt(void)
>   				RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
>   				&test_params->bonded_port_id);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -1398,11 +1403,11 @@ test_roundrobin_tx_burst(void)
>   	struct rte_mbuf *pkt_burst[MAX_PKT_BURST];
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0, 2, 1),
>   			"Failed to initialise bonded device");
>   
> -	burst_size = 20 * test_params->bonded_slave_count;
> +	burst_size = 20 * test_params->bonded_member_count;
>   
>   	TEST_ASSERT(burst_size <= MAX_PKT_BURST,
>   			"Burst size specified is greater than supported.");
> @@ -1423,20 +1428,20 @@ test_roundrobin_tx_burst(void)
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
>   			burst_size);
>   
> -	/* Verify slave ports tx stats */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);
> +	/* Verify member ports tx stats */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		rte_eth_stats_get(test_params->member_port_ids[i], &port_stats);
>   		TEST_ASSERT_EQUAL(port_stats.opackets,
> -				(uint64_t)burst_size / test_params->bonded_slave_count,
> -				"Slave Port (%d) opackets value (%u) not as expected (%d)\n",
> +				(uint64_t)burst_size / test_params->bonded_member_count,
> +				"Member Port (%d) opackets value (%u) not as expected (%d)\n",
>   				test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -				burst_size / test_params->bonded_slave_count);
> +				burst_size / test_params->bonded_member_count);
>   	}
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -1444,8 +1449,8 @@ test_roundrobin_tx_burst(void)
>   			pkt_burst, burst_size), 0,
>   			"tx burst return unexpected value");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -1471,13 +1476,13 @@ free_mbufs(struct rte_mbuf **mbufs, int nb_mbufs)
>   		rte_pktmbuf_free(mbufs[i]);
>   }
>   
> -#define TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT		(2)
> -#define TEST_RR_SLAVE_TX_FAIL_BURST_SIZE		(64)
> -#define TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT		(22)
> -#define TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX	(1)
> +#define TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT		(2)
> +#define TEST_RR_MEMBER_TX_FAIL_BURST_SIZE		(64)
> +#define TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT		(22)
> +#define TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX	(1)
>   
>   static int
> -test_roundrobin_tx_burst_slave_tx_fail(void)
> +test_roundrobin_tx_burst_member_tx_fail(void)
>   {
>   	struct rte_mbuf *pkt_burst[MAX_PKT_BURST];
>   	struct rte_mbuf *expected_tx_fail_pkts[MAX_PKT_BURST];
> @@ -1486,49 +1491,51 @@ test_roundrobin_tx_burst_slave_tx_fail(void)
>   
>   	int i, first_fail_idx, tx_count;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0,
> -			TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT, 1),
> +			TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT, 1),
>   			"Failed to initialise bonded device");
>   
>   	/* Generate test bursts of packets to transmit */
>   	TEST_ASSERT_EQUAL(generate_test_burst(pkt_burst,
> -			TEST_RR_SLAVE_TX_FAIL_BURST_SIZE, 0, 1, 0, 0, 0),
> -			TEST_RR_SLAVE_TX_FAIL_BURST_SIZE,
> +			TEST_RR_MEMBER_TX_FAIL_BURST_SIZE, 0, 1, 0, 0, 0),
> +			TEST_RR_MEMBER_TX_FAIL_BURST_SIZE,
>   			"Failed to generate test packet burst");
>   
>   	/* Copy references to packets which we expect not to be transmitted */
> -	first_fail_idx = (TEST_RR_SLAVE_TX_FAIL_BURST_SIZE -
> -			(TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT *
> -			TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT)) +
> -			TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX;
> +	first_fail_idx = (TEST_RR_MEMBER_TX_FAIL_BURST_SIZE -
> +			(TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT *
> +			TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT)) +
> +			TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX;
>   
> -	for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) {
> +	for (i = 0; i < TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT; i++) {
>   		expected_tx_fail_pkts[i] = pkt_burst[first_fail_idx +
> -				(i * TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT)];
> +				(i * TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT)];
>   	}
>   
> -	/* Set virtual slave to only fail transmission of
> -	 * TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT packets in burst */
> +	/*
> +	 * Set virtual member to only fail transmission of
> +	 * TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT packets in burst.
> +	 */
>   	virtual_ethdev_tx_burst_fn_set_success(
> -			test_params->slave_port_ids[TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX],
> +			test_params->member_port_ids[TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX],
>   			0);
>   
>   	virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(
> -			test_params->slave_port_ids[TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX],
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			test_params->member_port_ids[TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX],
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
>   	tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst,
> -			TEST_RR_SLAVE_TX_FAIL_BURST_SIZE);
> +			TEST_RR_MEMBER_TX_FAIL_BURST_SIZE);
>   
> -	TEST_ASSERT_EQUAL(tx_count, TEST_RR_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT,
> +	TEST_ASSERT_EQUAL(tx_count, TEST_RR_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT,
>   			"Transmitted (%d) an unexpected (%d) number of packets", tx_count,
> -			TEST_RR_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			TEST_RR_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
>   	/* Verify that failed packet are expected failed packets */
> -	for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) {
> +	for (i = 0; i < TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(expected_tx_fail_pkts[i], pkt_burst[i + tx_count],
>   				"expected mbuf (%d) pointer %p not expected pointer %p",
>   				i, expected_tx_fail_pkts[i], pkt_burst[i + tx_count]);
> @@ -1538,45 +1545,45 @@ test_roundrobin_tx_burst_slave_tx_fail(void)
>   	rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)TEST_RR_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT,
> +			(uint64_t)TEST_RR_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT,
>   			"Bonded Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -			TEST_RR_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			TEST_RR_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
> -	/* Verify slave ports tx stats */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		int slave_expected_tx_count;
> +	/* Verify member ports tx stats */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		int member_expected_tx_count;
>   
> -		rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);
> +		rte_eth_stats_get(test_params->member_port_ids[i], &port_stats);
>   
> -		slave_expected_tx_count = TEST_RR_SLAVE_TX_FAIL_BURST_SIZE /
> -				test_params->bonded_slave_count;
> +		member_expected_tx_count = TEST_RR_MEMBER_TX_FAIL_BURST_SIZE /
> +				test_params->bonded_member_count;
>   
> -		if (i == TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX)
> -			slave_expected_tx_count = slave_expected_tx_count -
> -					TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT;
> +		if (i == TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX)
> +			member_expected_tx_count = member_expected_tx_count -
> +					TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT;
>   
>   		TEST_ASSERT_EQUAL(port_stats.opackets,
> -				(uint64_t)slave_expected_tx_count,
> -				"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -				test_params->slave_port_ids[i],
> -				(unsigned int)port_stats.opackets, slave_expected_tx_count);
> +				(uint64_t)member_expected_tx_count,
> +				"Member Port (%d) opackets value (%u) not as expected (%d)",
> +				test_params->member_port_ids[i],
> +				(unsigned int)port_stats.opackets, member_expected_tx_count);
>   	}
>   
>   	/* Verify that all mbufs have a ref value of zero */
>   	TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkt_burst[tx_count],
> -			TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT, 1),
> +			TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT, 1),
>   			"mbufs refcnts not as expected");
> -	free_mbufs(&pkt_burst[tx_count], TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT);
> +	free_mbufs(&pkt_burst[tx_count], TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> -test_roundrobin_rx_burst_on_single_slave(void)
> +test_roundrobin_rx_burst_on_single_member(void)
>   {
>   	struct rte_mbuf *gen_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
> @@ -1585,19 +1592,19 @@ test_roundrobin_rx_burst_on_single_slave(void)
>   
>   	int i, j, burst_size = 25;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0, 4, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
>   	/* Generate test bursts of packets to transmit */
>   	TEST_ASSERT_EQUAL(generate_test_burst(
>   			gen_pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size,
>   			"burst generation failed");
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		/* Add rx data to slave */
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		/* Add rx data to member */
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[0], burst_size);
>   
>   		/* Call rx burst on bonded device */
> @@ -1616,25 +1623,25 @@ test_roundrobin_rx_burst_on_single_slave(void)
>   
>   
>   
> -		/* Verify bonded slave devices rx count */
> -		/* Verify slave ports tx stats */
> -		for (j = 0; j < test_params->bonded_slave_count; j++) {
> -			rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);
> +		/* Verify bonded member devices rx count */
> +		/* Verify member ports tx stats */
> +		for (j = 0; j < test_params->bonded_member_count; j++) {
> +			rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
>   
>   			if (i == j) {
>   				TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
> -						"Slave Port (%d) ipackets value (%u) not as expected"
> -						" (%d)", test_params->slave_port_ids[i],
> +						"Member Port (%d) ipackets value (%u) not as expected"
> +						" (%d)", test_params->member_port_ids[i],
>   						(unsigned int)port_stats.ipackets, burst_size);
>   			} else {
>   				TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -						"Slave Port (%d) ipackets value (%u) not as expected"
> -						" (%d)", test_params->slave_port_ids[i],
> +						"Member Port (%d) ipackets value (%u) not as expected"
> +						" (%d)", test_params->member_port_ids[i],
>   						(unsigned int)port_stats.ipackets, 0);
>   			}
>   
> -			/* Reset bonded slaves stats */
> -			rte_eth_stats_reset(test_params->slave_port_ids[j]);
> +			/* Reset bonded members stats */
> +			rte_eth_stats_reset(test_params->member_port_ids[j]);
>   		}
>   		/* reset bonded device stats */
>   		rte_eth_stats_reset(test_params->bonded_port_id);
> @@ -1646,38 +1653,38 @@ test_roundrobin_rx_burst_on_single_slave(void)
>   	}
>   
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT (3)
> +#define TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT (3)
>   
>   static int
> -test_roundrobin_rx_burst_on_multiple_slaves(void)
> +test_roundrobin_rx_burst_on_multiple_members(void)
>   {
> -	struct rte_mbuf *gen_pkt_burst[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *gen_pkt_burst[TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT][MAX_PKT_BURST];
>   
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	int burst_size[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT] = { 15, 13, 36 };
> +	int burst_size[TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT] = { 15, 13, 36 };
>   	int i, nb_rx;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0, 4, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
>   	/* Generate test bursts of packets to transmit */
> -	for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[i][0], burst_size[i], 0, 1, 0, 0, 0),
>   				burst_size[i], "burst generation failed");
>   	}
>   
> -	/* Add rx data to slaves */
> -	for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) {
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +	/* Add rx data to members */
> +	for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT; i++) {
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[i][0], burst_size[i]);
>   	}
>   
> @@ -1697,29 +1704,29 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)
>   			test_params->bonded_port_id, (unsigned int)port_stats.ipackets,
>   			burst_size[0] + burst_size[1] + burst_size[2]);
>   
> -	/* Verify bonded slave devices rx counts */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify bonded member devices rx counts */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0],
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0],
>   			(unsigned int)port_stats.ipackets, burst_size[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[1], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[1], (unsigned int)port_stats.ipackets,
>   			burst_size[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -				test_params->slave_port_ids[2],
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +				test_params->member_port_ids[2],
>   				(unsigned int)port_stats.ipackets, burst_size[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[3],
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[3],
>   			(unsigned int)port_stats.ipackets, 0);
>   
>   	/* free mbufs */
> @@ -1727,8 +1734,8 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)
>   		rte_pktmbuf_free(rx_pkt_burst[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -1739,48 +1746,54 @@ test_roundrobin_verify_mac_assignment(void)
>   
>   	int i;
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0],
> +			&expected_mac_addr_0),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_2),
> +			test_params->member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[2],
> +			&expected_mac_addr_2),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[2]);
> +			test_params->member_port_ids[2]);
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   				BONDING_MODE_ROUND_ROBIN, 0, 4, 1),
> -				"Failed to initialize bonded device with slaves");
> +				"Failed to initialize bonded device with members");
>   
> -	/* Verify that all MACs are the same as first slave added to bonded dev */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	/* Verify that all MACs are the same as first member added to bonded dev */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address not set to that of primary port",
> -				test_params->slave_port_ids[i]);
> +				"member port (%d) mac address not set to that of primary port",
> +				test_params->member_port_ids[i]);
>   	}
>   
>   	/* change primary and verify that MAC addresses haven't changed */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -			test_params->slave_port_ids[2]),
> +			test_params->member_port_ids[2]),
>   			"Failed to set bonded port (%d) primary port to (%d)",
> -			test_params->bonded_port_id, test_params->slave_port_ids[i]);
> +			test_params->bonded_port_id, test_params->member_port_ids[i]);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address has changed to that of primary"
> +				"member port (%d) mac address has changed to that of primary"
>   				" port without stop/start toggle of bonded device",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* stop / start bonded device and verify that primary MAC address is
> -	 * propagate to bonded device and slaves */
> +	/*
> +	 * stop / start bonded device and verify that primary MAC address is
> +	 * propagate to bonded device and members.
> +	 */
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
>   			test_params->bonded_port_id);
> @@ -1794,16 +1807,17 @@ test_roundrobin_verify_mac_assignment(void)
>   	TEST_ASSERT_SUCCESS(
>   			memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)),
>   			"bonded port (%d) mac address not set to that of new primary port",
> -			test_params->slave_port_ids[i]);
> +			test_params->member_port_ids[i]);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_2, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address not set to that of new primary"
> -				" port", test_params->slave_port_ids[i]);
> +				"member port (%d) mac address not set to that of new primary"
> +				" port", test_params->member_port_ids[i]);
>   	}
>   
>   	/* Set explicit MAC address */
> @@ -1818,19 +1832,20 @@ test_roundrobin_verify_mac_assignment(void)
>   	TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
>   			"bonded port (%d) mac address not set to that of new primary port",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
> -				sizeof(read_mac_addr)), "slave port (%d) mac address not set to"
> -				" that of new primary port\n", test_params->slave_port_ids[i]);
> +				sizeof(read_mac_addr)), "member port (%d) mac address not set to"
> +				" that of new primary port\n", test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -1839,10 +1854,10 @@ test_roundrobin_verify_promiscuous_enable_disable(void)
>   	int i, promiscuous_en;
>   	int ret;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ROUND_ROBIN, 0, 4, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
>   	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
>   	TEST_ASSERT_SUCCESS(ret,
> @@ -1854,12 +1869,12 @@ test_roundrobin_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not enabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_EQUAL(promiscuous_en, 1,
> -				"slave port (%d) promiscuous mode not enabled",
> -				test_params->slave_port_ids[i]);
> +				"member port (%d) promiscuous mode not enabled",
> +				test_params->member_port_ids[i]);
>   	}
>   
>   	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
> @@ -1872,76 +1887,76 @@ test_roundrobin_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not disabled\n",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_EQUAL(promiscuous_en, 0,
>   				"Port (%d) promiscuous mode not disabled\n",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_RR_LINK_STATUS_SLAVE_COUNT (4)
> -#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT (2)
> +#define TEST_RR_LINK_STATUS_MEMBER_COUNT (4)
> +#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT (2)
>   
>   static int
> -test_roundrobin_verify_slave_link_status_change_behaviour(void)
> +test_roundrobin_verify_member_link_status_change_behaviour(void)
>   {
>   	struct rte_mbuf *tx_pkt_burst[MAX_PKT_BURST] = { NULL };
> -	struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_MEMBER_COUNT][MAX_PKT_BURST];
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   
>   	struct rte_eth_stats port_stats;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	int i, burst_size, slave_count;
> +	int i, burst_size, member_count;
>   
>   	/* NULL all pointers in array to simplify cleanup */
>   	memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));
>   
> -	/* Initialize bonded device with TEST_RR_LINK_STATUS_SLAVE_COUNT slaves
> +	/* Initialize bonded device with TEST_RR_LINK_STATUS_MEMBER_COUNT members
>   	 * in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> -			BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_SLAVE_COUNT, 1),
> -			"Failed to initialize bonded device with slaves");
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
> +			BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_MEMBER_COUNT, 1),
> +			"Failed to initialize bonded device with members");
>   
> -	/* Verify Current Slaves Count /Active Slave Count is */
> -	slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,
> +	/* Verify Current Members Count /Active Member Count is */
> +	member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT,
> -			"Number of slaves (%d) is not as expected (%d).",
> -			slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT);
> +	TEST_ASSERT_EQUAL(member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT,
> +			"Number of members (%d) is not as expected (%d).",
> +			member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, TEST_RR_LINK_STATUS_MEMBER_COUNT);
>   
> -	/* Set 2 slaves eth_devs link status to down */
> +	/* Set 2 members eth_devs link status to down */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count,
> -			TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT,
> -			"Number of active slaves (%d) is not as expected (%d).\n",
> -			slave_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count,
> +			TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT,
> +			"Number of active members (%d) is not as expected (%d).\n",
> +			member_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT);
>   
>   	burst_size = 20;
>   
> -	/* Verify that pkts are not sent on slaves with link status down:
> +	/* Verify that pkts are not sent on members with link status down:
>   	 *
>   	 * 1. Generate test burst of traffic
>   	 * 2. Transmit burst on bonded eth_dev
>   	 * 3. Verify stats for bonded eth_dev (opackets = burst_size)
> -	 * 4. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)
> +	 * 4. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)
>   	 */
>   	TEST_ASSERT_EQUAL(
>   			generate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0),
> @@ -1960,41 +1975,41 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)
>   			test_params->bonded_port_id, (int)port_stats.opackets,
>   			burst_size);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)10,
>   			"Port (%d) opackets stats (%d) not expected (%d) value",
> -			test_params->slave_port_ids[0], (int)port_stats.opackets, 10);
> +			test_params->member_port_ids[0], (int)port_stats.opackets, 10);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)0,
>   			"Port (%d) opackets stats (%d) not expected (%d) value",
> -			test_params->slave_port_ids[1], (int)port_stats.opackets, 0);
> +			test_params->member_port_ids[1], (int)port_stats.opackets, 0);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)10,
>   			"Port (%d) opackets stats (%d) not expected (%d) value",
> -			test_params->slave_port_ids[2], (int)port_stats.opackets, 10);
> +			test_params->member_port_ids[2], (int)port_stats.opackets, 10);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)0,
>   			"Port (%d) opackets stats (%d) not expected (%d) value",
> -			test_params->slave_port_ids[3], (int)port_stats.opackets, 0);
> +			test_params->member_port_ids[3], (int)port_stats.opackets, 0);
>   
> -	/* Verify that pkts are not sent on slaves with link status down:
> +	/* Verify that pkts are not sent on members with link status down:
>   	 *
>   	 * 1. Generate test bursts of traffic
>   	 * 2. Add bursts on to virtual eth_devs
>   	 * 3. Rx burst on bonded eth_dev, expected (burst_ size *
> -	 *    TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT) received
> +	 *    TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT) received
>   	 * 4. Verify stats for bonded eth_dev
> -	 * 6. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)
> +	 * 6. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0)
>   	 */
> -	for (i = 0; i < TEST_RR_LINK_STATUS_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_RR_LINK_STATUS_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0),
>   				burst_size, "failed to generate packet burst");
>   
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[i][0], burst_size);
>   	}
>   
> @@ -2014,49 +2029,49 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)
>   		rte_pktmbuf_free(rx_pkt_burst[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT (2)
> +#define TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT (2)
>   
> -uint8_t polling_slave_mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 };
> +uint8_t polling_member_mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 };
>   
>   
> -int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT] = { -1, -1 };
> +int polling_test_members[TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT] = { -1, -1 };
>   
>   static int
> -test_roundrobin_verfiy_polling_slave_link_status_change(void)
> +test_roundrobin_verify_polling_member_link_status_change(void)
>   {
>   	struct rte_ether_addr *mac_addr =
> -		(struct rte_ether_addr *)polling_slave_mac;
> -	char slave_name[RTE_ETH_NAME_MAX_LEN];
> +		(struct rte_ether_addr *)polling_member_mac;
> +	char member_name[RTE_ETH_NAME_MAX_LEN];
>   
>   	int i;
>   
> -	for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) {
> -		/* Generate slave name / MAC address */
> -		snprintf(slave_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_poll_%d", i);
> +	for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT; i++) {
> +		/* Generate member name / MAC address */
> +		snprintf(member_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_poll_%d", i);
>   		mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
>   
> -		/* Create slave devices with no ISR Support */
> -		if (polling_test_slaves[i] == -1) {
> -			polling_test_slaves[i] = virtual_ethdev_create(slave_name, mac_addr,
> +		/* Create member devices with no ISR Support */
> +		if (polling_test_members[i] == -1) {
> +			polling_test_members[i] = virtual_ethdev_create(member_name, mac_addr,
>   					rte_socket_id(), 0);
> -			TEST_ASSERT(polling_test_slaves[i] >= 0,
> -					"Failed to create virtual virtual ethdev %s\n", slave_name);
> +			TEST_ASSERT(polling_test_members[i] >= 0,
> +					"Failed to create virtual ethdev %s\n", member_name);
>   
> -			/* Configure slave */
> -			TEST_ASSERT_SUCCESS(configure_ethdev(polling_test_slaves[i], 0, 0),
> -					"Failed to configure virtual ethdev %s(%d)", slave_name,
> -					polling_test_slaves[i]);
> +			/* Configure member */
> +			TEST_ASSERT_SUCCESS(configure_ethdev(polling_test_members[i], 0, 0),
> +					"Failed to configure virtual ethdev %s(%d)", member_name,
> +					polling_test_members[i]);
>   		}
>   
> -		/* Add slave to bonded device */
> -		TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id,
> -				polling_test_slaves[i]),
> -				"Failed to add slave %s(%d) to bonded device %d",
> -				slave_name, polling_test_slaves[i],
> +		/* Add member to bonded device */
> +		TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params->bonded_port_id,
> +				polling_test_members[i]),
> +				"Failed to add member %s(%d) to bonded device %d",
> +				member_name, polling_test_members[i],
>   				test_params->bonded_port_id);
>   	}
>   
> @@ -2071,26 +2086,26 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)
>   			RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback,
>   			&test_params->bonded_port_id);
>   
> -	/* link status change callback for first slave link up */
> +	/* link status change callback for first member link up */
>   	test_lsc_interrupt_count = 0;
>   
> -	virtual_ethdev_set_link_status(polling_test_slaves[0], 1);
> +	virtual_ethdev_set_link_status(polling_test_members[0], 1);
>   
>   	TEST_ASSERT_SUCCESS(lsc_timeout(15000), "timed out waiting for interrupt");
>   
>   
> -	/* no link status change callback for second slave link up */
> +	/* no link status change callback for second member link up */
>   	test_lsc_interrupt_count = 0;
>   
> -	virtual_ethdev_set_link_status(polling_test_slaves[1], 1);
> +	virtual_ethdev_set_link_status(polling_test_members[1], 1);
>   
>   	TEST_ASSERT_FAIL(lsc_timeout(15000), "unexpectedly succeeded");
>   
> -	/* link status change callback for both slave links down */
> +	/* link status change callback for both member links down */
>   	test_lsc_interrupt_count = 0;
>   
> -	virtual_ethdev_set_link_status(polling_test_slaves[0], 0);
> -	virtual_ethdev_set_link_status(polling_test_slaves[1], 0);
> +	virtual_ethdev_set_link_status(polling_test_members[0], 0);
> +	virtual_ethdev_set_link_status(polling_test_members[1], 0);
>   
>   	TEST_ASSERT_SUCCESS(lsc_timeout(20000), "timed out waiting for interrupt");
>   
> @@ -2100,17 +2115,17 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)
>   			&test_params->bonded_port_id);
>   
>   
> -	/* Clean up and remove slaves from bonded device */
> -	for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) {
> +	/* Clean up and remove members from bonded device */
> +	for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT; i++) {
>   
>   		TEST_ASSERT_SUCCESS(
> -				rte_eth_bond_slave_remove(test_params->bonded_port_id,
> -						polling_test_slaves[i]),
> -				"Failed to remove slave %d from bonded port (%d)",
> -				polling_test_slaves[i], test_params->bonded_port_id);
> +				rte_eth_bond_member_remove(test_params->bonded_port_id,
> +						polling_test_members[i]),
> +				"Failed to remove member %d from bonded port (%d)",
> +				polling_test_members[i], test_params->bonded_port_id);
>   	}
>   
> -	return remove_slaves_and_stop_bonded_device();
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   
> @@ -2123,9 +2138,9 @@ test_activebackup_tx_burst(void)
>   	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0, 1, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
>   	initialize_eth_header(test_params->pkt_eth_hdr,
>   			(struct rte_ether_addr *)src_mac,
> @@ -2136,7 +2151,7 @@ test_activebackup_tx_burst(void)
>   	pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr,
>   			dst_addr_0, pktlen);
>   
> -	burst_size = 20 * test_params->bonded_slave_count;
> +	burst_size = 20 * test_params->bonded_member_count;
>   
>   	TEST_ASSERT(burst_size < MAX_PKT_BURST,
>   			"Burst size specified is greater than supported.");
> @@ -2160,38 +2175,38 @@ test_activebackup_tx_burst(void)
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   
> -	/* Verify slave ports tx stats */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);
> -		if (test_params->slave_port_ids[i] == primary_port) {
> +	/* Verify member ports tx stats */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		rte_eth_stats_get(test_params->member_port_ids[i], &port_stats);
> +		if (test_params->member_port_ids[i] == primary_port) {
>   			TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
> -					"Slave Port (%d) opackets value (%u) not as expected (%d)",
> +					"Member Port (%d) opackets value (%u) not as expected (%d)",
>   					test_params->bonded_port_id,
>   					(unsigned int)port_stats.opackets,
> -					burst_size / test_params->bonded_slave_count);
> +					burst_size / test_params->bonded_member_count);
>   		} else {
>   			TEST_ASSERT_EQUAL(port_stats.opackets, 0,
> -					"Slave Port (%d) opackets value (%u) not as expected (%d)",
> +					"Member Port (%d) opackets value (%u) not as expected (%d)",
>   					test_params->bonded_port_id,
>   					(unsigned int)port_stats.opackets, 0);
>   		}
>   	}
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
>   	TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,
>   			pkts_burst, burst_size), 0, "Sending empty burst failed");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT (4)
> +#define TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT (4)
>   
>   static int
>   test_activebackup_rx_burst(void)
> @@ -2205,24 +2220,24 @@ test_activebackup_rx_burst(void)
>   
>   	int i, j, burst_size = 17;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0,
> -			TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1),
> -			"Failed to initialize bonded device with slaves");
> +			TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT, 1),
> +			"Failed to initialize bonded device with members");
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   	TEST_ASSERT(primary_port >= 0,
> -			"failed to get primary slave for bonded port (%d)",
> +			"failed to get primary member for bonded port (%d)",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		/* Generate test bursts of packets to transmit */
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0),
>   				burst_size, "burst generation failed");
>   
> -		/* Add rx data to slave */
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +		/* Add rx data to member */
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[0], burst_size);
>   
>   		/* Call rx burst on bonded device */
> @@ -2230,7 +2245,7 @@ test_activebackup_rx_burst(void)
>   				&rx_pkt_burst[0], MAX_PKT_BURST), burst_size,
>   				"rte_eth_rx_burst failed");
>   
> -		if (test_params->slave_port_ids[i] == primary_port) {
> +		if (test_params->member_port_ids[i] == primary_port) {
>   			/* Verify bonded device rx count */
>   			rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
>   			TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
> @@ -2238,27 +2253,30 @@ test_activebackup_rx_burst(void)
>   					test_params->bonded_port_id,
>   					(unsigned int)port_stats.ipackets, burst_size);
>   
> -			/* Verify bonded slave devices rx count */
> -			for (j = 0; j < test_params->bonded_slave_count; j++) {
> -				rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);
> +			/* Verify bonded member devices rx count */
> +			for (j = 0; j < test_params->bonded_member_count; j++) {
> +				rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
>   				if (i == j) {
>   					TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
> -							"Slave Port (%d) ipackets value (%u) not as "
> -							"expected (%d)", test_params->slave_port_ids[i],
> -							(unsigned int)port_stats.ipackets, burst_size);
> +							"Member Port (%d) ipackets value (%u) not as "
> +							"expected (%d)",
> +							test_params->member_port_ids[i],
> +							(unsigned int)port_stats.ipackets,
> +							burst_size);
>   				} else {
>   					TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -							"Slave Port (%d) ipackets value (%u) not as "
> -							"expected (%d)\n", test_params->slave_port_ids[i],
> +							"Member Port (%d) ipackets value (%u) not as "
> +							"expected (%d)\n",
> +							test_params->member_port_ids[i],
>   							(unsigned int)port_stats.ipackets, 0);
>   				}
>   			}
>   		} else {
> -			for (j = 0; j < test_params->bonded_slave_count; j++) {
> -				rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);
> +			for (j = 0; j < test_params->bonded_member_count; j++) {
> +				rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
>   				TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -						"Slave Port (%d) ipackets value (%u) not as expected "
> -						"(%d)", test_params->slave_port_ids[i],
> +						"Member Port (%d) ipackets value (%u) not as expected "
> +						"(%d)", test_params->member_port_ids[i],
>   						(unsigned int)port_stats.ipackets, 0);
>   			}
>   		}
> @@ -2275,8 +2293,8 @@ test_activebackup_rx_burst(void)
>   		rte_eth_stats_reset(test_params->bonded_port_id);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -2285,14 +2303,14 @@ test_activebackup_verify_promiscuous_enable_disable(void)
>   	int i, primary_port, promiscuous_en;
>   	int ret;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0, 4, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   	TEST_ASSERT(primary_port >= 0,
> -			"failed to get primary slave for bonded port (%d)",
> +			"failed to get primary member for bonded port (%d)",
>   			test_params->bonded_port_id);
>   
>   	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
> @@ -2304,17 +2322,17 @@ test_activebackup_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not enabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> -		if (primary_port == test_params->slave_port_ids[i]) {
> +				test_params->member_port_ids[i]);
> +		if (primary_port == test_params->member_port_ids[i]) {
>   			TEST_ASSERT_EQUAL(promiscuous_en, 1,
> -					"slave port (%d) promiscuous mode not enabled",
> -					test_params->slave_port_ids[i]);
> +					"member port (%d) promiscuous mode not enabled",
> +					test_params->member_port_ids[i]);
>   		} else {
>   			TEST_ASSERT_EQUAL(promiscuous_en, 0,
> -					"slave port (%d) promiscuous mode enabled",
> -					test_params->slave_port_ids[i]);
> +					"member port (%d) promiscuous mode enabled",
> +					test_params->member_port_ids[i]);
>   		}
>   
>   	}
> @@ -2328,16 +2346,16 @@ test_activebackup_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not disabled\n",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_EQUAL(promiscuous_en, 0,
> -				"slave port (%d) promiscuous mode not disabled\n",
> -				test_params->slave_port_ids[i]);
> +				"member port (%d) promiscuous mode not disabled\n",
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -2346,19 +2364,21 @@ test_activebackup_verify_mac_assignment(void)
>   	struct rte_ether_addr read_mac_addr;
>   	struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0],
> +			&expected_mac_addr_0),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
> +			test_params->member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1],
> +			&expected_mac_addr_1),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	/* Initialize bonded device with 2 slaves in active backup mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 2 members in active backup mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1),
> -			"Failed to initialize bonded device with slaves");
> +			"Failed to initialize bonded device with members");
>   
> -	/* Verify that bonded MACs is that of first slave and that the other slave
> +	/* Verify that bonded MACs is that of first member and that the other member
>   	 * MAC hasn't been changed */
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> @@ -2368,27 +2388,27 @@ test_activebackup_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[1]);
>   
>   	/* change primary and verify that MAC addresses haven't changed */
>   	TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -			test_params->slave_port_ids[1]), 0,
> +			test_params->member_port_ids[1]), 0,
>   			"Failed to set bonded port (%d) primary port to (%d)",
> -			test_params->bonded_port_id, test_params->slave_port_ids[1]);
> +			test_params->bonded_port_id, test_params->member_port_ids[1]);
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> @@ -2398,24 +2418,26 @@ test_activebackup_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[1]);
>   
> -	/* stop / start bonded device and verify that primary MAC address is
> -	 * propagated to bonded device and slaves */
> +	/*
> +	 * stop / start bonded device and verify that primary MAC address is
> +	 * propagated to bonded device and members.
> +	 */
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
> @@ -2432,21 +2454,21 @@ test_activebackup_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[1]);
>   
>   	/* Set explicit MAC address */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(
> @@ -2462,36 +2484,36 @@ test_activebackup_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of bonded port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of bonded port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of bonded port",
> +			test_params->member_port_ids[1]);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> -test_activebackup_verify_slave_link_status_change_failover(void)
> +test_activebackup_verify_member_link_status_change_failover(void)
>   {
> -	struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT][MAX_PKT_BURST];
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	int i, burst_size, slave_count, primary_port;
> +	int i, burst_size, member_count, primary_port;
>   
>   	burst_size = 21;
>   
> @@ -2502,96 +2524,96 @@ test_activebackup_verify_slave_link_status_change_failover(void)
>   			&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size,
>   			"generate_test_burst failed");
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0,
> -			TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1),
> -			"Failed to initialize bonded device with slaves");
> +			TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT, 1),
> +			"Failed to initialize bonded device with members");
>   
> -	/* Verify Current Slaves Count /Active Slave Count is */
> -	slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,
> +	/* Verify Current Members Count /Active Member Count is */
> +	member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 4,
> -			"Number of slaves (%d) is not as expected (%d).",
> -			slave_count, 4);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of members (%d) is not as expected (%d).",
> +			member_count, 4);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 4,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 4);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 4);
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
> -	TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0],
> +	TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0],
>   			"Primary port not as expected");
>   
> -	/* Bring 2 slaves down and verify active slave count */
> +	/* Bring 2 members down and verify active member count */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 2);
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 2);
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 1);
> +			test_params->member_port_ids[1], 1);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 1);
> +			test_params->member_port_ids[3], 1);
>   
>   
> -	/* Bring primary port down, verify that active slave count is 3 and primary
> +	/* Bring primary port down, verify that active member count is 3 and primary
>   	 *  has changed */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 0);
> +			test_params->member_port_ids[0], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS),
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS),
>   			3,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 3);
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 3);
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
> -	TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[2],
> +	TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[2],
>   			"Primary port not as expected");
>   
> -	/* Verify that pkts are sent on new primary slave */
> +	/* Verify that pkts are sent on new primary member */
>   
>   	TEST_ASSERT_EQUAL(rte_eth_tx_burst(
>   			test_params->bonded_port_id, 0, &pkt_burst[0][0],
>   			burst_size), burst_size, "rte_eth_tx_burst failed");
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[2]);
> +			test_params->member_port_ids[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[3]);
> +			test_params->member_port_ids[3]);
>   
>   	/* Generate packet burst for testing */
>   
> -	for (i = 0; i < TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size,
>   				"generate_test_burst failed");
>   
>   		virtual_ethdev_add_mbufs_to_rx_queue(
> -			test_params->slave_port_ids[i], &pkt_burst[i][0], burst_size);
> +			test_params->member_port_ids[i], &pkt_burst[i][0], burst_size);
>   	}
>   
>   	TEST_ASSERT_EQUAL(rte_eth_rx_burst(
> @@ -2604,28 +2626,28 @@ test_activebackup_verify_slave_link_status_change_failover(void)
>   			"(%d) port_stats.ipackets not as expected",
>   			test_params->bonded_port_id);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[2]);
> +			test_params->member_port_ids[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[3]);
> +			test_params->member_port_ids[3]);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   /** Balance Mode Tests */
> @@ -2633,9 +2655,9 @@ test_activebackup_verify_slave_link_status_change_failover(void)
>   static int
>   test_balance_xmit_policy_configuration(void)
>   {
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	/* Invalid port id */
>   	TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set(
> @@ -2644,7 +2666,7 @@ test_balance_xmit_policy_configuration(void)
>   
>   	/* Set xmit policy on non bonded device */
>   	TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set(
> -			test_params->slave_port_ids[0],	BALANCE_XMIT_POLICY_LAYER2),
> +			test_params->member_port_ids[0],	BALANCE_XMIT_POLICY_LAYER2),
>   			"Expected call to failed as invalid port specified.");
>   
>   
> @@ -2677,25 +2699,25 @@ test_balance_xmit_policy_configuration(void)
>   	TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_get(INVALID_PORT_ID),
>   			"Expected call to failed as invalid port specified.");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT (2)
> +#define TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT (2)
>   
>   static int
>   test_balance_l2_tx_burst(void)
>   {
> -	struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT][MAX_PKT_BURST];
> -	int burst_size[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT] = { 10, 15 };
> +	struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT][MAX_PKT_BURST];
> +	int burst_size[TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT] = { 10, 15 };
>   
>   	uint16_t pktlen;
>   	int i;
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> -			BONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
> +			BONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT, 1),
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(
>   			test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2),
> @@ -2730,7 +2752,7 @@ test_balance_l2_tx_burst(void)
>   			"failed to generate packet burst");
>   
>   	/* Send burst 1 on bonded port */
> -	for (i = 0; i < TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0,
>   				&pkts_burst[i][0], burst_size[i]),
>   				burst_size[i], "Failed to transmit packet burst");
> @@ -2745,24 +2767,24 @@ test_balance_l2_tx_burst(void)
>   			burst_size[0] + burst_size[1]);
>   
>   
> -	/* Verify slave ports tx stats */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify member ports tx stats */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[0],
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0], (unsigned int)port_stats.opackets,
>   			burst_size[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[1],
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)\n",
> -			test_params->slave_port_ids[1], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)\n",
> +			test_params->member_port_ids[1], (unsigned int)port_stats.opackets,
>   			burst_size[1]);
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -2770,8 +2792,8 @@ test_balance_l2_tx_burst(void)
>   			test_params->bonded_port_id, 0, &pkts_burst[0][0], burst_size[0]),
>   			0, "Expected zero packet");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -2785,9 +2807,9 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0, 2, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(
>   			test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23),
> @@ -2825,24 +2847,24 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
>   			nb_tx_1 + nb_tx_2);
>   
> -	/* Verify slave ports tx stats */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify member ports tx stats */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1,
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0], (unsigned int)port_stats.opackets,
>   			nb_tx_1);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_2,
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[1], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[1], (unsigned int)port_stats.opackets,
>   			nb_tx_2);
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -2851,8 +2873,8 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   			burst_size_1), 0, "Expected zero packet");
>   
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -2897,9 +2919,9 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0, 2, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(
>   			test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34),
> @@ -2938,24 +2960,24 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
>   			nb_tx_1 + nb_tx_2);
>   
> -	/* Verify slave ports tx stats */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify member ports tx stats */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1,
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0], (unsigned int)port_stats.opackets,
>   			nb_tx_1);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_2,
> -			"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[1], (unsigned int)port_stats.opackets,
> +			"Member Port (%d) opackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[1], (unsigned int)port_stats.opackets,
>   			nb_tx_2);
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -2963,8 +2985,8 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4,
>   			test_params->bonded_port_id, 0, pkts_burst_1,
>   			burst_size_1), 0, "Expected zero packet");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3003,27 +3025,27 @@ test_balance_l34_tx_burst_ipv6_toggle_udp_port(void)
>   	return balance_l34_tx_burst(0, 0, 0, 0, 1);
>   }
>   
> -#define TEST_BAL_SLAVE_TX_FAIL_SLAVE_COUNT			(2)
> -#define TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1			(40)
> -#define TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2			(20)
> -#define TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT		(25)
> -#define TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX	(0)
> +#define TEST_BAL_MEMBER_TX_FAIL_MEMBER_COUNT			(2)
> +#define TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1			(40)
> +#define TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2			(20)
> +#define TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT		(25)
> +#define TEST_BAL_MEMBER_TX_FAIL_FAILING_MEMBER_IDX	(0)
>   
>   static int
> -test_balance_tx_burst_slave_tx_fail(void)
> +test_balance_tx_burst_member_tx_fail(void)
>   {
> -	struct rte_mbuf *pkts_burst_1[TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1];
> -	struct rte_mbuf *pkts_burst_2[TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2];
> +	struct rte_mbuf *pkts_burst_1[TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1];
> +	struct rte_mbuf *pkts_burst_2[TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2];
>   
> -	struct rte_mbuf *expected_fail_pkts[TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT];
> +	struct rte_mbuf *expected_fail_pkts[TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT];
>   
>   	struct rte_eth_stats port_stats;
>   
>   	int i, first_tx_fail_idx, tx_count_1, tx_count_2;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0,
> -			TEST_BAL_SLAVE_TX_FAIL_SLAVE_COUNT, 1),
> +			TEST_BAL_MEMBER_TX_FAIL_MEMBER_COUNT, 1),
>   			"Failed to initialise bonded device");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(
> @@ -3033,46 +3055,48 @@ test_balance_tx_burst_slave_tx_fail(void)
>   
>   	/* Generate test bursts for transmission */
>   	TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_1,
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1, 0, 0, 0, 0, 0),
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1,
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1, 0, 0, 0, 0, 0),
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1,
>   			"Failed to generate test packet burst 1");
>   
> -	first_tx_fail_idx = TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT;
> +	first_tx_fail_idx = TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT;
>   
>   	/* copy mbuf references for expected transmission failures */
> -	for (i = 0; i < TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT; i++)
> +	for (i = 0; i < TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT; i++)
>   		expected_fail_pkts[i] = pkts_burst_1[i + first_tx_fail_idx];
>   
>   	TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_2,
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2, 0, 0, 1, 0, 0),
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2,
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2, 0, 0, 1, 0, 0),
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2,
>   			"Failed to generate test packet burst 2");
>   
>   
> -	/* Set virtual slave TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX to only fail
> -	 * transmission of TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT packets of burst */
> +	/*
> +	 * Set virtual member TEST_BAL_MEMBER_TX_FAIL_FAILING_MEMBER_IDX to only fail
> +	 * transmission of TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT packets of burst.
> +	 */
>   	virtual_ethdev_tx_burst_fn_set_success(
> -			test_params->slave_port_ids[TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX],
> +			test_params->member_port_ids[TEST_BAL_MEMBER_TX_FAIL_FAILING_MEMBER_IDX],
>   			0);
>   
>   	virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(
> -			test_params->slave_port_ids[TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX],
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			test_params->member_port_ids[TEST_BAL_MEMBER_TX_FAIL_FAILING_MEMBER_IDX],
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
>   
>   	/* Transmit burst 1 */
>   	tx_count_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1,
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1);
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1);
>   
> -	TEST_ASSERT_EQUAL(tx_count_1, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT,
> +	TEST_ASSERT_EQUAL(tx_count_1, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT,
>   			"Transmitted (%d) packets, expected to transmit (%d) packets",
> -			tx_count_1, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			tx_count_1, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
>   	/* Verify that failed packet are expected failed packets */
> -	for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) {
> +	for (i = 0; i < TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(expected_fail_pkts[i], pkts_burst_1[i + tx_count_1],
>   				"expected mbuf (%d) pointer %p not expected pointer %p",
>   				i, expected_fail_pkts[i], pkts_burst_1[i + tx_count_1]);
> @@ -3080,94 +3104,94 @@ test_balance_tx_burst_slave_tx_fail(void)
>   
>   	/* Transmit burst 2 */
>   	tx_count_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2,
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2);
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2);
>   
> -	TEST_ASSERT_EQUAL(tx_count_2, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2,
> +	TEST_ASSERT_EQUAL(tx_count_2, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2,
>   			"Transmitted (%d) packets, expected to transmit (%d) packets",
> -			tx_count_2, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2);
> +			tx_count_2, TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2);
>   
>   
>   	/* Verify bonded port tx stats */
>   	rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)((TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT) +
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2),
> +			(uint64_t)((TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT) +
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2),
>   			"Bonded Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -			(TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT) +
> -			TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2);
> +			(TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT) +
> +			TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2);
>   
> -	/* Verify slave ports tx stats */
> +	/* Verify member ports tx stats */
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)
> -				TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -				TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT,
> -				"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -				test_params->slave_port_ids[0],
> +				TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +				TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT,
> +				"Member Port (%d) opackets value (%u) not as expected (%d)",
> +				test_params->member_port_ids[0],
>   				(unsigned int)port_stats.opackets,
> -				TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 -
> -				TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT);
> +				TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_1 -
> +				TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
>   
>   
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -				(uint64_t)TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2,
> -				"Slave Port (%d) opackets value (%u) not as expected (%d)",
> -				test_params->slave_port_ids[1],
> +				(uint64_t)TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2,
> +				"Member Port (%d) opackets value (%u) not as expected (%d)",
> +				test_params->member_port_ids[1],
>   				(unsigned int)port_stats.opackets,
> -				TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2);
> +				TEST_BAL_MEMBER_TX_FAIL_BURST_SIZE_2);
>   
>   	/* Verify that all mbufs have a ref value of zero */
>   	TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkts_burst_1[tx_count_1],
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT, 1),
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT, 1),
>   			"mbufs refcnts not as expected");
>   
>   	free_mbufs(&pkts_burst_1[tx_count_1],
> -			TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT);
> +			TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_BALANCE_RX_BURST_SLAVE_COUNT (3)
> +#define TEST_BALANCE_RX_BURST_MEMBER_COUNT (3)
>   
>   static int
>   test_balance_rx_burst(void)
>   {
> -	struct rte_mbuf *gen_pkt_burst[TEST_BALANCE_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *gen_pkt_burst[TEST_BALANCE_RX_BURST_MEMBER_COUNT][MAX_PKT_BURST];
>   
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	int burst_size[TEST_BALANCE_RX_BURST_SLAVE_COUNT] = { 10, 5, 30 };
> +	int burst_size[TEST_BALANCE_RX_BURST_MEMBER_COUNT] = { 10, 5, 30 };
>   	int i, j;
>   
>   	memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0, 3, 1),
>   			"Failed to initialise bonded device");
>   
>   	/* Generate test bursts of packets to transmit */
> -	for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_BALANCE_RX_BURST_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1,
>   				0, 0), burst_size[i],
>   				"failed to generate packet burst");
>   	}
>   
> -	/* Add rx data to slaves */
> -	for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +	/* Add rx data to members */
> +	for (i = 0; i < TEST_BALANCE_RX_BURST_MEMBER_COUNT; i++) {
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[i][0], burst_size[i]);
>   	}
>   
> @@ -3187,33 +3211,33 @@ test_balance_rx_burst(void)
>   			burst_size[0] + burst_size[1] + burst_size[2]);
>   
>   
> -	/* Verify bonded slave devices rx counts */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify bonded member devices rx counts */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -				test_params->slave_port_ids[0],
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +				test_params->member_port_ids[0],
>   				(unsigned int)port_stats.ipackets, burst_size[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[1], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[1], (unsigned int)port_stats.ipackets,
>   			burst_size[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[2], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[2], (unsigned int)port_stats.ipackets,
>   			burst_size[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[3],	(unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[3],	(unsigned int)port_stats.ipackets,
>   			0);
>   
>   	/* free mbufs */
> -	for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_BALANCE_RX_BURST_MEMBER_COUNT; i++) {
>   		for (j = 0; j < MAX_PKT_BURST; j++) {
>   			if (gen_pkt_burst[i][j] != NULL) {
>   				rte_pktmbuf_free(gen_pkt_burst[i][j]);
> @@ -3222,8 +3246,8 @@ test_balance_rx_burst(void)
>   		}
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3232,8 +3256,8 @@ test_balance_verify_promiscuous_enable_disable(void)
>   	int i;
>   	int ret;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0, 4, 1),
>   			"Failed to initialise bonded device");
>   
> @@ -3246,11 +3270,11 @@ test_balance_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not enabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]), 1,
> +				test_params->member_port_ids[i]), 1,
>   				"Port (%d) promiscuous mode not enabled",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
>   	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
> @@ -3262,15 +3286,15 @@ test_balance_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not disabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]), 0,
> +				test_params->member_port_ids[i]), 0,
>   				"Port (%d) promiscuous mode not disabled",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3279,19 +3303,21 @@ test_balance_verify_mac_assignment(void)
>   	struct rte_ether_addr read_mac_addr;
>   	struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0],
> +			&expected_mac_addr_0),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
> +			test_params->member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1],
> +			&expected_mac_addr_1),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	/* Initialize bonded device with 2 slaves in active backup mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 2 members in active backup mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BALANCE, 0, 2, 1),
>   			"Failed to initialise bonded device");
>   
> -	/* Verify that bonded MACs is that of first slave and that the other slave
> +	/* Verify that bonded MACs is that of first member and that the other member
>   	 * MAC hasn't been changed */
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> @@ -3301,27 +3327,27 @@ test_balance_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[1]);
>   
>   	/* change primary and verify that MAC addresses haven't changed */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -			test_params->slave_port_ids[1]),
> +			test_params->member_port_ids[1]),
>   			"Failed to set bonded port (%d) primary port to (%d)\n",
> -			test_params->bonded_port_id, test_params->slave_port_ids[1]);
> +			test_params->bonded_port_id, test_params->member_port_ids[1]);
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> @@ -3331,24 +3357,26 @@ test_balance_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[1]);
>   
> -	/* stop / start bonded device and verify that primary MAC address is
> -	 * propagated to bonded device and slaves */
> +	/*
> +	 * stop / start bonded device and verify that primary MAC address is
> +	 * propagated to bonded device and members.
> +	 */
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
> @@ -3365,21 +3393,21 @@ test_balance_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[1]);
>   
>   	/* Set explicit MAC address */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(
> @@ -3395,44 +3423,44 @@ test_balance_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of bonded port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected\n",
> -				test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not as expected\n",
> +				test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of bonded port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of bonded port",
> +			test_params->member_port_ids[1]);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_BALANCE_LINK_STATUS_SLAVE_COUNT (4)
> +#define TEST_BALANCE_LINK_STATUS_MEMBER_COUNT (4)
>   
>   static int
> -test_balance_verify_slave_link_status_change_behaviour(void)
> +test_balance_verify_member_link_status_change_behaviour(void)
>   {
> -	struct rte_mbuf *pkt_burst[TEST_BALANCE_LINK_STATUS_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *pkt_burst[TEST_BALANCE_LINK_STATUS_MEMBER_COUNT][MAX_PKT_BURST];
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	int i, burst_size, slave_count;
> +	int i, burst_size, member_count;
>   
>   	memset(pkt_burst, 0, sizeof(pkt_burst));
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> -			BONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, 1),
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
> +			BONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT, 1),
>   			"Failed to initialise bonded device");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set(
> @@ -3440,32 +3468,34 @@ test_balance_verify_slave_link_status_change_behaviour(void)
>   			"Failed to set balance xmit policy.");
>   
>   
> -	/* Verify Current Slaves Count /Active Slave Count is */
> -	slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,
> +	/* Verify Current Members Count /Active Member Count is */
> +	member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT,
> -			"Number of slaves (%d) is not as expected (%d).",
> -			slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT);
> +	TEST_ASSERT_EQUAL(member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT,
> +			"Number of members (%d) is not as expected (%d).",
> +			member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, TEST_BALANCE_LINK_STATUS_MEMBER_COUNT);
>   
> -	/* Set 2 slaves link status to down */
> +	/* Set 2 members link status to down */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 2);
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 2);
>   
> -	/* Send to sets of packet burst and verify that they are balanced across
> -	 *  slaves */
> +	/*
> +	 * Send to sets of packet burst and verify that they are balanced across
> +	 *  members.
> +	 */
>   	burst_size = 21;
>   
>   	TEST_ASSERT_EQUAL(generate_test_burst(
> @@ -3491,27 +3521,27 @@ test_balance_verify_slave_link_status_change_behaviour(void)
>   			test_params->bonded_port_id, (int)port_stats.opackets,
>   			burst_size + burst_size);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets (%d) not as expected (%d).",
> -			test_params->slave_port_ids[0], (int)port_stats.opackets,
> +			test_params->member_port_ids[0], (int)port_stats.opackets,
>   			burst_size);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets (%d) not as expected (%d).",
> -			test_params->slave_port_ids[2], (int)port_stats.opackets,
> +			test_params->member_port_ids[2], (int)port_stats.opackets,
>   			burst_size);
>   
> -	/* verify that all packets get send on primary slave when no other slaves
> +	/* verify that all packets get send on primary member when no other members
>   	 * are available */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[2], 0);
> +			test_params->member_port_ids[2], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 1,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 1);
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 1,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 1);
>   
>   	TEST_ASSERT_EQUAL(generate_test_burst(
>   			&pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0), burst_size,
> @@ -3528,31 +3558,31 @@ test_balance_verify_slave_link_status_change_behaviour(void)
>   			test_params->bonded_port_id, (int)port_stats.opackets,
>   			burst_size + burst_size + burst_size);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size),
>   			"(%d) port_stats.opackets (%d) not as expected (%d).",
> -			test_params->slave_port_ids[0], (int)port_stats.opackets,
> +			test_params->member_port_ids[0], (int)port_stats.opackets,
>   			burst_size + burst_size);
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 0);
> +			test_params->member_port_ids[0], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 1);
> +			test_params->member_port_ids[1], 1);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[2], 1);
> +			test_params->member_port_ids[2], 1);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 1);
> +			test_params->member_port_ids[3], 1);
>   
> -	for (i = 0; i < TEST_BALANCE_LINK_STATUS_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_BALANCE_LINK_STATUS_MEMBER_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size,
>   				"Failed to generate packet burst");
>   
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&pkt_burst[i][0], burst_size);
>   	}
>   
> -	/* Verify that pkts are not received on slaves with link status down */
> +	/* Verify that pkts are not received on members with link status down */
>   
>   	rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,
>   			MAX_PKT_BURST);
> @@ -3564,8 +3594,8 @@ test_balance_verify_slave_link_status_change_behaviour(void)
>   			test_params->bonded_port_id, (int)port_stats.ipackets,
>   			burst_size * 3);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3576,7 +3606,7 @@ test_broadcast_tx_burst(void)
>   
>   	struct rte_eth_stats port_stats;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BROADCAST, 0, 2, 1),
>   			"Failed to initialise bonded device");
>   
> @@ -3590,7 +3620,7 @@ test_broadcast_tx_burst(void)
>   	pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr,
>   			dst_addr_0, pktlen);
>   
> -	burst_size = 20 * test_params->bonded_slave_count;
> +	burst_size = 20 * test_params->bonded_member_count;
>   
>   	TEST_ASSERT(burst_size < MAX_PKT_BURST,
>   			"Burst size specified is greater than supported.");
> @@ -3611,25 +3641,25 @@ test_broadcast_tx_burst(void)
>   	/* Verify bonded port tx stats */
>   	rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)burst_size * test_params->bonded_slave_count,
> +			(uint64_t)burst_size * test_params->bonded_member_count,
>   			"Bonded Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
>   			burst_size);
>   
> -	/* Verify slave ports tx stats */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats);
> +	/* Verify member ports tx stats */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		rte_eth_stats_get(test_params->member_port_ids[i], &port_stats);
>   		TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
> -				"Slave Port (%d) opackets value (%u) not as expected (%d)\n",
> +				"Member Port (%d) opackets value (%u) not as expected (%d)\n",
>   				test_params->bonded_port_id,
>   				(unsigned int)port_stats.opackets, burst_size);
>   	}
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -3637,159 +3667,161 @@ test_broadcast_tx_burst(void)
>   			test_params->bonded_port_id, 0, pkts_burst, burst_size),  0,
>   			"transmitted an unexpected number of packets");
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   
> -#define TEST_BCAST_SLAVE_TX_FAIL_SLAVE_COUNT		(3)
> -#define TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE			(40)
> -#define TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT	(15)
> -#define TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT	(10)
> +#define TEST_BCAST_MEMBER_TX_FAIL_MEMBER_COUNT		(3)
> +#define TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE			(40)
> +#define TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT	(15)
> +#define TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT	(10)
>   
>   static int
> -test_broadcast_tx_burst_slave_tx_fail(void)
> +test_broadcast_tx_burst_member_tx_fail(void)
>   {
> -	struct rte_mbuf *pkts_burst[TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE];
> -	struct rte_mbuf *expected_fail_pkts[TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT];
> +	struct rte_mbuf *pkts_burst[TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE];
> +	struct rte_mbuf *expected_fail_pkts[TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT];
>   
>   	struct rte_eth_stats port_stats;
>   
>   	int i, tx_count;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BROADCAST, 0,
> -			TEST_BCAST_SLAVE_TX_FAIL_SLAVE_COUNT, 1),
> +			TEST_BCAST_MEMBER_TX_FAIL_MEMBER_COUNT, 1),
>   			"Failed to initialise bonded device");
>   
>   	/* Generate test bursts for transmission */
>   	TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst,
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE, 0, 0, 0, 0, 0),
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE,
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE, 0, 0, 0, 0, 0),
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE,
>   			"Failed to generate test packet burst");
>   
> -	for (i = 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) {
> -		expected_fail_pkts[i] = pkts_burst[TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT + i];
> +	for (i = 0; i < TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT; i++) {
> +		expected_fail_pkts[i] = pkts_burst[TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT + i];
>   	}
>   
> -	/* Set virtual slave TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX to only fail
> -	 * transmission of TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT packets of burst */
> +	/*
> +	 * Set virtual member TEST_BAL_MEMBER_TX_FAIL_FAILING_MEMBER_IDX to only fail
> +	 * transmission of TEST_BAL_MEMBER_TX_FAIL_PACKETS_COUNT packets of burst.
> +	 */
>   	virtual_ethdev_tx_burst_fn_set_success(
> -			test_params->slave_port_ids[0],
> +			test_params->member_port_ids[0],
>   			0);
>   	virtual_ethdev_tx_burst_fn_set_success(
> -			test_params->slave_port_ids[1],
> +			test_params->member_port_ids[1],
>   			0);
>   	virtual_ethdev_tx_burst_fn_set_success(
> -			test_params->slave_port_ids[2],
> +			test_params->member_port_ids[2],
>   			0);
>   
>   	virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(
> -			test_params->slave_port_ids[0],
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT);
> +			test_params->member_port_ids[0],
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT);
>   
>   	virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(
> -			test_params->slave_port_ids[1],
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT);
> +			test_params->member_port_ids[1],
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT);
>   
>   	virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count(
> -			test_params->slave_port_ids[2],
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT);
> +			test_params->member_port_ids[2],
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT);
>   
>   	/* Transmit burst */
>   	tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst,
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE);
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE);
>   
> -	TEST_ASSERT_EQUAL(tx_count, TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT,
> +	TEST_ASSERT_EQUAL(tx_count, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT,
>   			"Transmitted (%d) packets, expected to transmit (%d) packets",
> -			tx_count, TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT);
> +			tx_count, TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT);
>   
>   	/* Verify that failed packet are expected failed packets */
> -	for (i = 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) {
> +	for (i = 0; i < TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT; i++) {
>   		TEST_ASSERT_EQUAL(expected_fail_pkts[i], pkts_burst[i + tx_count],
>   				"expected mbuf (%d) pointer %p not expected pointer %p",
>   				i, expected_fail_pkts[i], pkts_burst[i + tx_count]);
>   	}
>   
> -	/* Verify slave ports tx stats */
> +	/* Verify member ports tx stats */
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT,
> +			(uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT,
>   			"Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT);
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT);
>   
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT,
> +			(uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT,
>   			"Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT);
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   
>   	TEST_ASSERT_EQUAL(port_stats.opackets,
> -			(uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT,
> +			(uint64_t)TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT,
>   			"Port (%d) opackets value (%u) not as expected (%d)",
>   			test_params->bonded_port_id, (unsigned int)port_stats.opackets,
> -			TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE -
> -			TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT);
> +			TEST_BCAST_MEMBER_TX_FAIL_BURST_SIZE -
> +			TEST_BCAST_MEMBER_TX_FAIL_MAX_PACKETS_COUNT);
>   
>   
>   	/* Verify that all mbufs who transmission failed have a ref value of one */
>   	TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkts_burst[tx_count],
> -			TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT, 1),
> +			TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT, 1),
>   			"mbufs refcnts not as expected");
>   
>   	free_mbufs(&pkts_burst[tx_count],
> -		TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT);
> +		TEST_BCAST_MEMBER_TX_FAIL_MIN_PACKETS_COUNT);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define BROADCAST_RX_BURST_NUM_OF_SLAVES (3)
> +#define BROADCAST_RX_BURST_NUM_OF_MEMBERS (3)
>   
>   static int
>   test_broadcast_rx_burst(void)
>   {
> -	struct rte_mbuf *gen_pkt_burst[BROADCAST_RX_BURST_NUM_OF_SLAVES][MAX_PKT_BURST];
> +	struct rte_mbuf *gen_pkt_burst[BROADCAST_RX_BURST_NUM_OF_MEMBERS][MAX_PKT_BURST];
>   
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	int burst_size[BROADCAST_RX_BURST_NUM_OF_SLAVES] = { 10, 5, 30 };
> +	int burst_size[BROADCAST_RX_BURST_NUM_OF_MEMBERS] = { 10, 5, 30 };
>   	int i, j;
>   
>   	memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst));
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BROADCAST, 0, 3, 1),
>   			"Failed to initialise bonded device");
>   
>   	/* Generate test bursts of packets to transmit */
> -	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) {
> +	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_MEMBERS; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0, 0),
>   				burst_size[i], "failed to generate packet burst");
>   	}
>   
> -	/* Add rx data to slave 0 */
> -	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) {
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +	/* Add rx data to member 0 */
> +	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_MEMBERS; i++) {
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[i][0], burst_size[i]);
>   	}
>   
> @@ -3810,33 +3842,33 @@ test_broadcast_rx_burst(void)
>   			burst_size[0] + burst_size[1] + burst_size[2]);
>   
>   
> -	/* Verify bonded slave devices rx counts */
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	/* Verify bonded member devices rx counts */
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0], (unsigned int)port_stats.ipackets,
>   			burst_size[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[0], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[0], (unsigned int)port_stats.ipackets,
>   			burst_size[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2],
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[2], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[2], (unsigned int)port_stats.ipackets,
>   			burst_size[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.ipackets, 0,
> -			"Slave Port (%d) ipackets value (%u) not as expected (%d)",
> -			test_params->slave_port_ids[3], (unsigned int)port_stats.ipackets,
> +			"Member Port (%d) ipackets value (%u) not as expected (%d)",
> +			test_params->member_port_ids[3], (unsigned int)port_stats.ipackets,
>   			0);
>   
>   	/* free mbufs allocate for rx testing */
> -	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) {
> +	for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_MEMBERS; i++) {
>   		for (j = 0; j < MAX_PKT_BURST; j++) {
>   			if (gen_pkt_burst[i][j] != NULL) {
>   				rte_pktmbuf_free(gen_pkt_burst[i][j]);
> @@ -3845,8 +3877,8 @@ test_broadcast_rx_burst(void)
>   		}
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3855,8 +3887,8 @@ test_broadcast_verify_promiscuous_enable_disable(void)
>   	int i;
>   	int ret;
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BROADCAST, 0, 4, 1),
>   			"Failed to initialise bonded device");
>   
> @@ -3870,11 +3902,11 @@ test_broadcast_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not enabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]), 1,
> +				test_params->member_port_ids[i]), 1,
>   				"Port (%d) promiscuous mode not enabled",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
>   	ret = rte_eth_promiscuous_disable(test_params->bonded_port_id);
> @@ -3886,15 +3918,15 @@ test_broadcast_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not disabled",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		TEST_ASSERT_EQUAL(rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]), 0,
> +				test_params->member_port_ids[i]), 0,
>   				"Port (%d) promiscuous mode not disabled",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -3905,49 +3937,55 @@ test_broadcast_verify_mac_assignment(void)
>   
>   	int i;
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0],
> +			&expected_mac_addr_0),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_1),
> +			test_params->member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[2],
> +			&expected_mac_addr_1),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[2]);
> +			test_params->member_port_ids[2]);
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_BROADCAST, 0, 4, 1),
>   			"Failed to initialise bonded device");
>   
> -	/* Verify that all MACs are the same as first slave added to bonded
> +	/* Verify that all MACs are the same as first member added to bonded
>   	 * device */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address not set to that of primary port",
> -				test_params->slave_port_ids[i]);
> +				"member port (%d) mac address not set to that of primary port",
> +				test_params->member_port_ids[i]);
>   	}
>   
>   	/* change primary and verify that MAC addresses haven't changed */
>   	TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -			test_params->slave_port_ids[2]),
> +			test_params->member_port_ids[2]),
>   			"Failed to set bonded port (%d) primary port to (%d)",
> -			test_params->bonded_port_id, test_params->slave_port_ids[i]);
> +			test_params->bonded_port_id, test_params->member_port_ids[i]);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address has changed to that of primary "
> +				"member port (%d) mac address has changed to that of primary "
>   				"port without stop/start toggle of bonded device",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* stop / start bonded device and verify that primary MAC address is
> -	 * propagated to bonded device and slaves */
> +	/*
> +	 * stop / start bonded device and verify that primary MAC address is
> +	 * propagated to bonded device and members.
> +	 */
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
> @@ -3962,16 +4000,17 @@ test_broadcast_verify_mac_assignment(void)
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
>   			"bonded port (%d) mac address not set to that of new primary  port",
> -			test_params->slave_port_ids[i]);
> +			test_params->member_port_ids[i]);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address not set to that of new primary "
> -				"port", test_params->slave_port_ids[i]);
> +				"member port (%d) mac address not set to that of new primary "
> +				"port", test_params->member_port_ids[i]);
>   	}
>   
>   	/* Set explicit MAC address */
> @@ -3986,71 +4025,72 @@ test_broadcast_verify_mac_assignment(void)
>   	TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
>   			"bonded port (%d) mac address not set to that of new primary port",
> -			test_params->slave_port_ids[i]);
> +			test_params->member_port_ids[i]);
>   
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr),
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[i],
> +				&read_mac_addr),
>   				"Failed to get mac address (port %d)",
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr,
>   				sizeof(read_mac_addr)),
> -				"slave port (%d) mac address not set to that of new primary "
> -				"port", test_params->slave_port_ids[i]);
> +				"member port (%d) mac address not set to that of new primary "
> +				"port", test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define BROADCAST_LINK_STATUS_NUM_OF_SLAVES (4)
> +#define BROADCAST_LINK_STATUS_NUM_OF_MEMBERS (4)
>   static int
> -test_broadcast_verify_slave_link_status_change_behaviour(void)
> +test_broadcast_verify_member_link_status_change_behaviour(void)
>   {
> -	struct rte_mbuf *pkt_burst[BROADCAST_LINK_STATUS_NUM_OF_SLAVES][MAX_PKT_BURST];
> +	struct rte_mbuf *pkt_burst[BROADCAST_LINK_STATUS_NUM_OF_MEMBERS][MAX_PKT_BURST];
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	int i, burst_size, slave_count;
> +	int i, burst_size, member_count;
>   
>   	memset(pkt_burst, 0, sizeof(pkt_burst));
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> -				BONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_SLAVES,
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
> +				BONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_MEMBERS,
>   				1), "Failed to initialise bonded device");
>   
> -	/* Verify Current Slaves Count /Active Slave Count is */
> -	slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,
> +	/* Verify Current Members Count /Active Member Count is */
> +	member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 4,
> -			"Number of slaves (%d) is not as expected (%d).",
> -			slave_count, 4);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of members (%d) is not as expected (%d).",
> +			member_count, 4);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 4,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 4);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 4);
>   
> -	/* Set 2 slaves link status to down */
> +	/* Set 2 members link status to down */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 2,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 2);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, 2,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 2);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++)
> -		rte_eth_stats_reset(test_params->slave_port_ids[i]);
> +	for (i = 0; i < test_params->bonded_member_count; i++)
> +		rte_eth_stats_reset(test_params->member_port_ids[i]);
>   
> -	/* Verify that pkts are not sent on slaves with link status down */
> +	/* Verify that pkts are not sent on members with link status down */
>   	burst_size = 21;
>   
>   	TEST_ASSERT_EQUAL(generate_test_burst(
> @@ -4062,43 +4102,43 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)
>   			"rte_eth_tx_burst failed\n");
>   
>   	rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
> -	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * slave_count),
> +	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * member_count),
>   			"(%d) port_stats.opackets (%d) not as expected (%d)\n",
>   			test_params->bonded_port_id, (int)port_stats.opackets,
> -			burst_size * slave_count);
> +			burst_size * member_count);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected",
> -				test_params->slave_port_ids[1]);
> +				test_params->member_port_ids[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size,
>   			"(%d) port_stats.opackets not as expected",
> -				test_params->slave_port_ids[2]);
> +				test_params->member_port_ids[2]);
>   
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, 0,
>   			"(%d) port_stats.opackets not as expected",
> -			test_params->slave_port_ids[3]);
> +			test_params->member_port_ids[3]);
>   
>   
> -	for (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_SLAVES; i++) {
> +	for (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_MEMBERS; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&pkt_burst[i][0], burst_size, 0, 0, 1, 0, 0),
>   				burst_size, "failed to generate packet burst");
>   
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&pkt_burst[i][0], burst_size);
>   	}
>   
> -	/* Verify that pkts are not received on slaves with link status down */
> +	/* Verify that pkts are not received on members with link status down */
>   	TEST_ASSERT_EQUAL(rte_eth_rx_burst(
>   			test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST),
>   			burst_size + burst_size, "rte_eth_rx_burst failed");
> @@ -4110,8 +4150,8 @@ test_broadcast_verify_slave_link_status_change_behaviour(void)
>   			"(%d) port_stats.ipackets not as expected\n",
>   			test_params->bonded_port_id);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -4146,21 +4186,21 @@ testsuite_teardown(void)
>   	free(test_params->pkt_eth_hdr);
>   	test_params->pkt_eth_hdr = NULL;
>   
> -	/* Clean up and remove slaves from bonded device */
> -	remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	remove_members_and_stop_bonded_device();
>   }
>   
>   static void
>   free_virtualpmd_tx_queue(void)
>   {
> -	int i, slave_port, to_free_cnt;
> +	int i, member_port, to_free_cnt;
>   	struct rte_mbuf *pkts_to_free[MAX_PKT_BURST];
>   
>   	/* Free tx queue of virtual pmd */
> -	for (slave_port = 0; slave_port < test_params->bonded_slave_count;
> -			slave_port++) {
> +	for (member_port = 0; member_port < test_params->bonded_member_count;
> +			member_port++) {
>   		to_free_cnt = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_port],
> +				test_params->member_port_ids[member_port],
>   				pkts_to_free, MAX_PKT_BURST);
>   		for (i = 0; i < to_free_cnt; i++)
>   			rte_pktmbuf_free(pkts_to_free[i]);
> @@ -4177,11 +4217,11 @@ test_tlb_tx_burst(void)
>   	uint64_t sum_ports_opackets = 0, all_bond_opackets = 0, all_bond_obytes = 0;
>   	uint16_t pktlen;
>   
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members
>   			(BONDING_MODE_TLB, 1, 3, 1),
>   			"Failed to initialise bonded device");
>   
> -	burst_size = 20 * test_params->bonded_slave_count;
> +	burst_size = 20 * test_params->bonded_member_count;
>   
>   	TEST_ASSERT(burst_size < MAX_PKT_BURST,
>   			"Burst size specified is greater than supported.\n");
> @@ -4197,7 +4237,7 @@ test_tlb_tx_burst(void)
>   					RTE_ETHER_TYPE_IPV4, 0, 0);
>   		} else {
>   			initialize_eth_header(test_params->pkt_eth_hdr,
> -					(struct rte_ether_addr *)test_params->default_slave_mac,
> +					(struct rte_ether_addr *)test_params->default_member_mac,
>   					(struct rte_ether_addr *)dst_mac_0,
>   					RTE_ETHER_TYPE_IPV4, 0, 0);
>   		}
> @@ -4234,26 +4274,26 @@ test_tlb_tx_burst(void)
>   			burst_size);
>   
>   
> -	/* Verify slave ports tx stats */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> -		rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats[i]);
> +	/* Verify member ports tx stats */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
> +		rte_eth_stats_get(test_params->member_port_ids[i], &port_stats[i]);
>   		sum_ports_opackets += port_stats[i].opackets;
>   	}
>   
>   	TEST_ASSERT_EQUAL(sum_ports_opackets, (uint64_t)all_bond_opackets,
> -			"Total packets sent by slaves is not equal to packets sent by bond interface");
> +			"Total packets sent by members is not equal to packets sent by bond interface");
>   
> -	/* checking if distribution of packets is balanced over slaves */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* checking if distribution of packets is balanced over members */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		TEST_ASSERT(port_stats[i].obytes > 0 &&
>   				port_stats[i].obytes < all_bond_obytes,
> -						"Packets are not balanced over slaves");
> +						"Packets are not balanced over members");
>   	}
>   
> -	/* Put all slaves down and try and transmit */
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	/* Put all members down and try and transmit */
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		virtual_ethdev_simulate_link_status_interrupt(
> -				test_params->slave_port_ids[i], 0);
> +				test_params->member_port_ids[i], 0);
>   	}
>   
>   	/* Send burst on bonded port */
> @@ -4261,11 +4301,11 @@ test_tlb_tx_burst(void)
>   			burst_size);
>   	TEST_ASSERT_EQUAL(nb_tx, 0, " bad number of packet in burst");
>   
> -	/* Clean ugit checkout masterp and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean ugit checkout masterp and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT (4)
> +#define TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT (4)
>   
>   static int
>   test_tlb_rx_burst(void)
> @@ -4279,26 +4319,26 @@ test_tlb_rx_burst(void)
>   
>   	uint16_t i, j, nb_rx, burst_size = 17;
>   
> -	/* Initialize bonded device with 4 slaves in transmit load balancing mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in transmit load balancing mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_TLB,
> -			TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1, 1),
> +			TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT, 1, 1),
>   			"Failed to initialize bonded device");
>   
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   	TEST_ASSERT(primary_port >= 0,
> -			"failed to get primary slave for bonded port (%d)",
> +			"failed to get primary member for bonded port (%d)",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		/* Generate test bursts of packets to transmit */
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0), burst_size,
>   				"burst generation failed");
>   
> -		/* Add rx data to slave */
> -		virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i],
> +		/* Add rx data to member */
> +		virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[i],
>   				&gen_pkt_burst[0], burst_size);
>   
>   		/* Call rx burst on bonded device */
> @@ -4307,7 +4347,7 @@ test_tlb_rx_burst(void)
>   
>   		TEST_ASSERT_EQUAL(nb_rx, burst_size, "rte_eth_rx_burst failed\n");
>   
> -		if (test_params->slave_port_ids[i] == primary_port) {
> +		if (test_params->member_port_ids[i] == primary_port) {
>   			/* Verify bonded device rx count */
>   			rte_eth_stats_get(test_params->bonded_port_id, &port_stats);
>   			TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
> @@ -4315,27 +4355,27 @@ test_tlb_rx_burst(void)
>   					test_params->bonded_port_id,
>   					(unsigned int)port_stats.ipackets, burst_size);
>   
> -			/* Verify bonded slave devices rx count */
> -			for (j = 0; j < test_params->bonded_slave_count; j++) {
> -				rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);
> +			/* Verify bonded member devices rx count */
> +			for (j = 0; j < test_params->bonded_member_count; j++) {
> +				rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
>   				if (i == j) {
>   					TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,
> -							"Slave Port (%d) ipackets value (%u) not as expected (%d)\n",
> -							test_params->slave_port_ids[i],
> +							"Member Port (%d) ipackets value (%u) not as expected (%d)\n",
> +							test_params->member_port_ids[i],
>   							(unsigned int)port_stats.ipackets, burst_size);
>   				} else {
>   					TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)0,
> -							"Slave Port (%d) ipackets value (%u) not as expected (%d)\n",
> -							test_params->slave_port_ids[i],
> +							"Member Port (%d) ipackets value (%u) not as expected (%d)\n",
> +							test_params->member_port_ids[i],
>   							(unsigned int)port_stats.ipackets, 0);
>   				}
>   			}
>   		} else {
> -			for (j = 0; j < test_params->bonded_slave_count; j++) {
> -				rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats);
> +			for (j = 0; j < test_params->bonded_member_count; j++) {
> +				rte_eth_stats_get(test_params->member_port_ids[j], &port_stats);
>   				TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)0,
> -						"Slave Port (%d) ipackets value (%u) not as expected (%d)\n",
> -						test_params->slave_port_ids[i],
> +						"Member Port (%d) ipackets value (%u) not as expected (%d)\n",
> +						test_params->member_port_ids[i],
>   						(unsigned int)port_stats.ipackets, 0);
>   			}
>   		}
> @@ -4348,8 +4388,8 @@ test_tlb_rx_burst(void)
>   		rte_eth_stats_reset(test_params->bonded_port_id);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -4358,14 +4398,14 @@ test_tlb_verify_promiscuous_enable_disable(void)
>   	int i, primary_port, promiscuous_en;
>   	int ret;
>   
> -	/* Initialize bonded device with 4 slaves in transmit load balancing mode */
> -	TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in transmit load balancing mode */
> +	TEST_ASSERT_SUCCESS( initialize_bonded_device_with_members(
>   			BONDING_MODE_TLB, 0, 4, 1),
>   			"Failed to initialize bonded device");
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
>   	TEST_ASSERT(primary_port >= 0,
> -			"failed to get primary slave for bonded port (%d)",
> +			"failed to get primary member for bonded port (%d)",
>   			test_params->bonded_port_id);
>   
>   	ret = rte_eth_promiscuous_enable(test_params->bonded_port_id);
> @@ -4377,10 +4417,10 @@ test_tlb_verify_promiscuous_enable_disable(void)
>   	TEST_ASSERT_EQUAL(promiscuous_en, (int)1,
>   			"Port (%d) promiscuous mode not enabled\n",
>   			test_params->bonded_port_id);
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> -		if (primary_port == test_params->slave_port_ids[i]) {
> +				test_params->member_port_ids[i]);
> +		if (primary_port == test_params->member_port_ids[i]) {
>   			TEST_ASSERT_EQUAL(promiscuous_en, (int)1,
>   					"Port (%d) promiscuous mode not enabled\n",
>   					test_params->bonded_port_id);
> @@ -4402,16 +4442,16 @@ test_tlb_verify_promiscuous_enable_disable(void)
>   			"Port (%d) promiscuous mode not disabled\n",
>   			test_params->bonded_port_id);
>   
> -	for (i = 0; i < test_params->bonded_slave_count; i++) {
> +	for (i = 0; i < test_params->bonded_member_count; i++) {
>   		promiscuous_en = rte_eth_promiscuous_get(
> -				test_params->slave_port_ids[i]);
> +				test_params->member_port_ids[i]);
>   		TEST_ASSERT_EQUAL(promiscuous_en, (int)0,
> -				"slave port (%d) promiscuous mode not disabled\n",
> -				test_params->slave_port_ids[i]);
> +				"member port (%d) promiscuous mode not disabled\n",
> +				test_params->member_port_ids[i]);
>   	}
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> @@ -4420,20 +4460,24 @@ test_tlb_verify_mac_assignment(void)
>   	struct rte_ether_addr read_mac_addr;
>   	struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1;
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0],
> +			&expected_mac_addr_0),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1),
> +			test_params->member_port_ids[0]);
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1],
> +			&expected_mac_addr_1),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	/* Initialize bonded device with 2 slaves in active backup mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 2 members in active backup mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_TLB, 0, 2, 1),
>   			"Failed to initialize bonded device");
>   
> -	/* Verify that bonded MACs is that of first slave and that the other slave
> -	 * MAC hasn't been changed */
> +	/*
> +	 * Verify that bonded MACs is that of first member and that the other member
> +	 * MAC hasn't been changed.
> +	 */
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
>   			test_params->bonded_port_id);
> @@ -4442,27 +4486,27 @@ test_tlb_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[1]);
>   
>   	/* change primary and verify that MAC addresses haven't changed */
>   	TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id,
> -			test_params->slave_port_ids[1]), 0,
> +			test_params->member_port_ids[1]), 0,
>   			"Failed to set bonded port (%d) primary port to (%d)",
> -			test_params->bonded_port_id, test_params->slave_port_ids[1]);
> +			test_params->bonded_port_id, test_params->member_port_ids[1]);
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> @@ -4472,24 +4516,26 @@ test_tlb_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[1]);
>   
> -	/* stop / start bonded device and verify that primary MAC address is
> -	 * propagated to bonded device and slaves */
> +	/*
> +	 * stop / start bonded device and verify that primary MAC address is
> +	 * propagated to bonded device and members.
> +	 */
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),
>   			"Failed to stop bonded port %u",
> @@ -4506,21 +4552,21 @@ test_tlb_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of primary port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of primary port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of primary port",
> +			test_params->member_port_ids[1]);
>   
>   
>   	/* Set explicit MAC address */
> @@ -4537,36 +4583,36 @@ test_tlb_verify_mac_assignment(void)
>   			"bonded port (%d) mac address not set to that of bonded port",
>   			test_params->bonded_port_id);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[0], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   	TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not as expected",
> -			test_params->slave_port_ids[0]);
> +			"member port (%d) mac address not as expected",
> +			test_params->member_port_ids[0]);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr),
> +	TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->member_port_ids[1], &read_mac_addr),
>   			"Failed to get mac address (port %d)",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   	TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr,
>   			sizeof(read_mac_addr)),
> -			"slave port (%d) mac address not set to that of bonded port",
> -			test_params->slave_port_ids[1]);
> +			"member port (%d) mac address not set to that of bonded port",
> +			test_params->member_port_ids[1]);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static int
> -test_tlb_verify_slave_link_status_change_failover(void)
> +test_tlb_verify_member_link_status_change_failover(void)
>   {
> -	struct rte_mbuf *pkt_burst[TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST];
> +	struct rte_mbuf *pkt_burst[TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT][MAX_PKT_BURST];
>   	struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL };
>   	struct rte_eth_stats port_stats;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	int i, burst_size, slave_count, primary_port;
> +	int i, burst_size, member_count, primary_port;
>   
>   	burst_size = 21;
>   
> @@ -4574,61 +4620,63 @@ test_tlb_verify_slave_link_status_change_failover(void)
>   
>   
>   
> -	/* Initialize bonded device with 4 slaves in round robin mode */
> -	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves(
> +	/* Initialize bonded device with 4 members in round robin mode */
> +	TEST_ASSERT_SUCCESS(initialize_bonded_device_with_members(
>   			BONDING_MODE_TLB, 0,
> -			TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1),
> -			"Failed to initialize bonded device with slaves");
> +			TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT, 1),
> +			"Failed to initialize bonded device with members");
>   
> -	/* Verify Current Slaves Count /Active Slave Count is */
> -	slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves,
> +	/* Verify Current Members Count /Active Member Count is */
> +	member_count = rte_eth_bond_members_get(test_params->bonded_port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, 4,
> -			"Number of slaves (%d) is not as expected (%d).\n",
> -			slave_count, 4);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of members (%d) is not as expected (%d).\n",
> +			member_count, 4);
>   
> -	slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id,
> -			slaves, RTE_MAX_ETHPORTS);
> -	TEST_ASSERT_EQUAL(slave_count, (int)4,
> -			"Number of slaves (%d) is not as expected (%d).\n",
> -			slave_count, 4);
> +	member_count = rte_eth_bond_active_members_get(test_params->bonded_port_id,
> +			members, RTE_MAX_ETHPORTS);
> +	TEST_ASSERT_EQUAL(member_count, 4,
> +			"Number of members (%d) is not as expected (%d).\n",
> +			member_count, 4);
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
> -	TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0],
> +	TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[0],
>   			"Primary port not as expected");
>   
> -	/* Bring 2 slaves down and verify active slave count */
> +	/* Bring 2 members down and verify active member count */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 0);
> +			test_params->member_port_ids[1], 0);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 0);
> +			test_params->member_port_ids[3], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 2);
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 2,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 2);
>   
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[1], 1);
> +			test_params->member_port_ids[1], 1);
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[3], 1);
> +			test_params->member_port_ids[3], 1);
>   
>   
> -	/* Bring primary port down, verify that active slave count is 3 and primary
> -	 *  has changed */
> +	/*
> +	 * Bring primary port down, verify that active member count is 3 and primary
> +	 *  has changed.
> +	 */
>   	virtual_ethdev_simulate_link_status_interrupt(
> -			test_params->slave_port_ids[0], 0);
> +			test_params->member_port_ids[0], 0);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get(
> -			test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 3,
> -			"Number of active slaves (%d) is not as expected (%d).",
> -			slave_count, 3);
> +	TEST_ASSERT_EQUAL(rte_eth_bond_active_members_get(
> +			test_params->bonded_port_id, members, RTE_MAX_ETHPORTS), 3,
> +			"Number of active members (%d) is not as expected (%d).",
> +			member_count, 3);
>   
>   	primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id);
> -	TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[2],
> +	TEST_ASSERT_EQUAL(primary_port, test_params->member_port_ids[2],
>   			"Primary port not as expected");
>   	rte_delay_us(500000);
> -	/* Verify that pkts are sent on new primary slave */
> +	/* Verify that pkts are sent on new primary member */
>   	for (i = 0; i < 4; i++) {
>   		TEST_ASSERT_EQUAL(generate_test_burst(
>   				&pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size,
> @@ -4639,36 +4687,36 @@ test_tlb_verify_slave_link_status_change_failover(void)
>   		rte_delay_us(11000);
>   	}
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[0], &port_stats);
>   	TEST_ASSERT_EQUAL(port_stats.opackets, (int8_t)0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[0]);
> +			test_params->member_port_ids[0]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[1], &port_stats);
>   	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[1]);
> +			test_params->member_port_ids[1]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[2], &port_stats);
>   	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[2]);
> +			test_params->member_port_ids[2]);
>   
> -	rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats);
> +	rte_eth_stats_get(test_params->member_port_ids[3], &port_stats);
>   	TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0,
>   			"(%d) port_stats.opackets not as expected\n",
> -			test_params->slave_port_ids[3]);
> +			test_params->member_port_ids[3]);
>   
>   
>   	/* Generate packet burst for testing */
>   
> -	for (i = 0; i < TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT; i++) {
> +	for (i = 0; i < TEST_ADAPTIVE_TLB_RX_BURST_MEMBER_COUNT; i++) {
>   		if (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0) !=
>   				burst_size)
>   			return -1;
>   
>   		virtual_ethdev_add_mbufs_to_rx_queue(
> -				test_params->slave_port_ids[i], &pkt_burst[i][0], burst_size);
> +				test_params->member_port_ids[i], &pkt_burst[i][0], burst_size);
>   	}
>   
>   	if (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst,
> @@ -4684,11 +4732,11 @@ test_tlb_verify_slave_link_status_change_failover(void)
>   			"(%d) port_stats.ipackets not as expected\n",
>   			test_params->bonded_port_id);
>   
> -	/* Clean up and remove slaves from bonded device */
> -	return remove_slaves_and_stop_bonded_device();
> +	/* Clean up and remove members from bonded device */
> +	return remove_members_and_stop_bonded_device();
>   }
>   
> -#define TEST_ALB_SLAVE_COUNT	2
> +#define TEST_ALB_MEMBER_COUNT	2
>   
>   static uint8_t mac_client1[] = {0x00, 0xAA, 0x55, 0xFF, 0xCC, 1};
>   static uint8_t mac_client2[] = {0x00, 0xAA, 0x55, 0xFF, 0xCC, 2};
> @@ -4710,23 +4758,23 @@ test_alb_change_mac_in_reply_sent(void)
>   	struct rte_ether_hdr *eth_pkt;
>   	struct rte_arp_hdr *arp_pkt;
>   
> -	int slave_idx, nb_pkts, pkt_idx;
> +	int member_idx, nb_pkts, pkt_idx;
>   	int retval = 0;
>   
>   	struct rte_ether_addr bond_mac, client_mac;
> -	struct rte_ether_addr *slave_mac1, *slave_mac2;
> +	struct rte_ether_addr *member_mac1, *member_mac2;
>   
>   	TEST_ASSERT_SUCCESS(
> -			initialize_bonded_device_with_slaves(BONDING_MODE_ALB,
> -					0, TEST_ALB_SLAVE_COUNT, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			initialize_bonded_device_with_members(BONDING_MODE_ALB,
> +					0, TEST_ALB_MEMBER_COUNT, 1),
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	/* Flush tx queue */
>   	rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0);
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count;
> -			slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count;
> +			member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent,
> +				test_params->member_port_ids[member_idx], pkts_sent,
>   				MAX_PKT_BURST);
>   	}
>   
> @@ -4782,18 +4830,18 @@ test_alb_change_mac_in_reply_sent(void)
>   			RTE_ARP_OP_REPLY);
>   	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
>   
> -	slave_mac1 =
> -			rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs;
> -	slave_mac2 =
> -			rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs;
> +	member_mac1 =
> +			rte_eth_devices[test_params->member_port_ids[0]].data->mac_addrs;
> +	member_mac2 =
> +			rte_eth_devices[test_params->member_port_ids[1]].data->mac_addrs;
>   
>   	/*
>   	 * Checking if packets are properly distributed on bonding ports. Packets
>   	 * 0 and 2 should be sent on port 0 and packets 1 and 3 on port 1.
>   	 */
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent,
> +				test_params->member_port_ids[member_idx], pkts_sent,
>   				MAX_PKT_BURST);
>   
>   		for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
> @@ -4802,14 +4850,14 @@ test_alb_change_mac_in_reply_sent(void)
>   			arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
>   						sizeof(struct rte_ether_hdr));
>   
> -			if (slave_idx%2 == 0) {
> -				if (!rte_is_same_ether_addr(slave_mac1,
> +			if (member_idx%2 == 0) {
> +				if (!rte_is_same_ether_addr(member_mac1,
>   						&arp_pkt->arp_data.arp_sha)) {
>   					retval = -1;
>   					goto test_end;
>   				}
>   			} else {
> -				if (!rte_is_same_ether_addr(slave_mac2,
> +				if (!rte_is_same_ether_addr(member_mac2,
>   						&arp_pkt->arp_data.arp_sha)) {
>   					retval = -1;
>   					goto test_end;
> @@ -4819,7 +4867,7 @@ test_alb_change_mac_in_reply_sent(void)
>   	}
>   
>   test_end:
> -	retval += remove_slaves_and_stop_bonded_device();
> +	retval += remove_members_and_stop_bonded_device();
>   	return retval;
>   }
>   
> @@ -4832,22 +4880,22 @@ test_alb_reply_from_client(void)
>   	struct rte_mbuf *pkt;
>   	struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
>   
> -	int slave_idx, nb_pkts, pkt_idx, nb_pkts_sum = 0;
> +	int member_idx, nb_pkts, pkt_idx, nb_pkts_sum = 0;
>   	int retval = 0;
>   
>   	struct rte_ether_addr bond_mac, client_mac;
> -	struct rte_ether_addr *slave_mac1, *slave_mac2;
> +	struct rte_ether_addr *member_mac1, *member_mac2;
>   
>   	TEST_ASSERT_SUCCESS(
> -			initialize_bonded_device_with_slaves(BONDING_MODE_ALB,
> -					0, TEST_ALB_SLAVE_COUNT, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			initialize_bonded_device_with_members(BONDING_MODE_ALB,
> +					0, TEST_ALB_MEMBER_COUNT, 1),
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	/* Flush tx queue */
>   	rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0);
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent,
> +				test_params->member_port_ids[member_idx], pkts_sent,
>   				MAX_PKT_BURST);
>   	}
>   
> @@ -4868,7 +4916,7 @@ test_alb_reply_from_client(void)
>   					sizeof(struct rte_ether_hdr));
>   	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
>   			RTE_ARP_OP_REPLY);
> -	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
> +	virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt,
>   			1);
>   
>   	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
> @@ -4880,7 +4928,7 @@ test_alb_reply_from_client(void)
>   					sizeof(struct rte_ether_hdr));
>   	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host,
>   			RTE_ARP_OP_REPLY);
> -	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
> +	virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt,
>   			1);
>   
>   	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
> @@ -4892,7 +4940,7 @@ test_alb_reply_from_client(void)
>   					sizeof(struct rte_ether_hdr));
>   	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host,
>   			RTE_ARP_OP_REPLY);
> -	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
> +	virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt,
>   			1);
>   
>   	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
> @@ -4904,7 +4952,7 @@ test_alb_reply_from_client(void)
>   					sizeof(struct rte_ether_hdr));
>   	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host,
>   			RTE_ARP_OP_REPLY);
> -	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
> +	virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt,
>   			1);
>   
>   	/*
> @@ -4914,15 +4962,15 @@ test_alb_reply_from_client(void)
>   	rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST);
>   	rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0);
>   
> -	slave_mac1 = rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs;
> -	slave_mac2 = rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs;
> +	member_mac1 = rte_eth_devices[test_params->member_port_ids[0]].data->mac_addrs;
> +	member_mac2 = rte_eth_devices[test_params->member_port_ids[1]].data->mac_addrs;
>   
>   	/*
> -	 * Checking if update ARP packets were properly send on slave ports.
> +	 * Checking if update ARP packets were properly send on member ports.
>   	 */
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent, MAX_PKT_BURST);
> +				test_params->member_port_ids[member_idx], pkts_sent, MAX_PKT_BURST);
>   		nb_pkts_sum += nb_pkts;
>   
>   		for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
> @@ -4931,14 +4979,14 @@ test_alb_reply_from_client(void)
>   			arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
>   						sizeof(struct rte_ether_hdr));
>   
> -			if (slave_idx%2 == 0) {
> -				if (!rte_is_same_ether_addr(slave_mac1,
> +			if (member_idx%2 == 0) {
> +				if (!rte_is_same_ether_addr(member_mac1,
>   						&arp_pkt->arp_data.arp_sha)) {
>   					retval = -1;
>   					goto test_end;
>   				}
>   			} else {
> -				if (!rte_is_same_ether_addr(slave_mac2,
> +				if (!rte_is_same_ether_addr(member_mac2,
>   						&arp_pkt->arp_data.arp_sha)) {
>   					retval = -1;
>   					goto test_end;
> @@ -4954,7 +5002,7 @@ test_alb_reply_from_client(void)
>   	}
>   
>   test_end:
> -	retval += remove_slaves_and_stop_bonded_device();
> +	retval += remove_members_and_stop_bonded_device();
>   	return retval;
>   }
>   
> @@ -4968,21 +5016,21 @@ test_alb_receive_vlan_reply(void)
>   	struct rte_mbuf *pkt;
>   	struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
>   
> -	int slave_idx, nb_pkts, pkt_idx;
> +	int member_idx, nb_pkts, pkt_idx;
>   	int retval = 0;
>   
>   	struct rte_ether_addr bond_mac, client_mac;
>   
>   	TEST_ASSERT_SUCCESS(
> -			initialize_bonded_device_with_slaves(BONDING_MODE_ALB,
> -					0, TEST_ALB_SLAVE_COUNT, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			initialize_bonded_device_with_members(BONDING_MODE_ALB,
> +					0, TEST_ALB_MEMBER_COUNT, 1),
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	/* Flush tx queue */
>   	rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0);
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent,
> +				test_params->member_port_ids[member_idx], pkts_sent,
>   				MAX_PKT_BURST);
>   	}
>   
> @@ -5007,7 +5055,7 @@ test_alb_receive_vlan_reply(void)
>   	arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1));
>   	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
>   			RTE_ARP_OP_REPLY);
> -	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
> +	virtual_ethdev_add_mbufs_to_rx_queue(test_params->member_port_ids[0], &pkt,
>   			1);
>   
>   	rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST);
> @@ -5016,9 +5064,9 @@ test_alb_receive_vlan_reply(void)
>   	/*
>   	 * Checking if VLAN headers in generated ARP Update packet are correct.
>   	 */
> -	for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) {
> +	for (member_idx = 0; member_idx < test_params->bonded_member_count; member_idx++) {
>   		nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue(
> -				test_params->slave_port_ids[slave_idx], pkts_sent,
> +				test_params->member_port_ids[member_idx], pkts_sent,
>   				MAX_PKT_BURST);
>   
>   		for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
> @@ -5049,7 +5097,7 @@ test_alb_receive_vlan_reply(void)
>   	}
>   
>   test_end:
> -	retval += remove_slaves_and_stop_bonded_device();
> +	retval += remove_members_and_stop_bonded_device();
>   	return retval;
>   }
>   
> @@ -5062,9 +5110,9 @@ test_alb_ipv4_tx(void)
>   	retval = 0;
>   
>   	TEST_ASSERT_SUCCESS(
> -			initialize_bonded_device_with_slaves(BONDING_MODE_ALB,
> -					0, TEST_ALB_SLAVE_COUNT, 1),
> -			"Failed to initialize_bonded_device_with_slaves.");
> +			initialize_bonded_device_with_members(BONDING_MODE_ALB,
> +					0, TEST_ALB_MEMBER_COUNT, 1),
> +			"Failed to initialize_bonded_device_with_members.");
>   
>   	burst_size = 32;
>   
> @@ -5085,7 +5133,7 @@ test_alb_ipv4_tx(void)
>   	}
>   
>   test_end:
> -	retval += remove_slaves_and_stop_bonded_device();
> +	retval += remove_members_and_stop_bonded_device();
>   	return retval;
>   }
>   
> @@ -5096,34 +5144,34 @@ static struct unit_test_suite link_bonding_test_suite  = {
>   	.unit_test_cases = {
>   		TEST_CASE(test_create_bonded_device),
>   		TEST_CASE(test_create_bonded_device_with_invalid_params),
> -		TEST_CASE(test_add_slave_to_bonded_device),
> -		TEST_CASE(test_add_slave_to_invalid_bonded_device),
> -		TEST_CASE(test_remove_slave_from_bonded_device),
> -		TEST_CASE(test_remove_slave_from_invalid_bonded_device),
> -		TEST_CASE(test_get_slaves_from_bonded_device),
> -		TEST_CASE(test_add_already_bonded_slave_to_bonded_device),
> -		TEST_CASE(test_add_remove_multiple_slaves_to_from_bonded_device),
> +		TEST_CASE(test_add_member_to_bonded_device),
> +		TEST_CASE(test_add_member_to_invalid_bonded_device),
> +		TEST_CASE(test_remove_member_from_bonded_device),
> +		TEST_CASE(test_remove_member_from_invalid_bonded_device),
> +		TEST_CASE(test_get_members_from_bonded_device),
> +		TEST_CASE(test_add_already_bonded_member_to_bonded_device),
> +		TEST_CASE(test_add_remove_multiple_members_to_from_bonded_device),
>   		TEST_CASE(test_start_bonded_device),
>   		TEST_CASE(test_stop_bonded_device),
>   		TEST_CASE(test_set_bonding_mode),
> -		TEST_CASE(test_set_primary_slave),
> +		TEST_CASE(test_set_primary_member),
>   		TEST_CASE(test_set_explicit_bonded_mac),
>   		TEST_CASE(test_set_bonded_port_initialization_mac_assignment),
>   		TEST_CASE(test_status_interrupt),
> -		TEST_CASE(test_adding_slave_after_bonded_device_started),
> +		TEST_CASE(test_adding_member_after_bonded_device_started),
>   		TEST_CASE(test_roundrobin_tx_burst),
> -		TEST_CASE(test_roundrobin_tx_burst_slave_tx_fail),
> -		TEST_CASE(test_roundrobin_rx_burst_on_single_slave),
> -		TEST_CASE(test_roundrobin_rx_burst_on_multiple_slaves),
> +		TEST_CASE(test_roundrobin_tx_burst_member_tx_fail),
> +		TEST_CASE(test_roundrobin_rx_burst_on_single_member),
> +		TEST_CASE(test_roundrobin_rx_burst_on_multiple_members),
>   		TEST_CASE(test_roundrobin_verify_promiscuous_enable_disable),
>   		TEST_CASE(test_roundrobin_verify_mac_assignment),
> -		TEST_CASE(test_roundrobin_verify_slave_link_status_change_behaviour),
> -		TEST_CASE(test_roundrobin_verfiy_polling_slave_link_status_change),
> +		TEST_CASE(test_roundrobin_verify_member_link_status_change_behaviour),
> +		TEST_CASE(test_roundrobin_verify_polling_member_link_status_change),
>   		TEST_CASE(test_activebackup_tx_burst),
>   		TEST_CASE(test_activebackup_rx_burst),
>   		TEST_CASE(test_activebackup_verify_promiscuous_enable_disable),
>   		TEST_CASE(test_activebackup_verify_mac_assignment),
> -		TEST_CASE(test_activebackup_verify_slave_link_status_change_failover),
> +		TEST_CASE(test_activebackup_verify_member_link_status_change_failover),
>   		TEST_CASE(test_balance_xmit_policy_configuration),
>   		TEST_CASE(test_balance_l2_tx_burst),
>   		TEST_CASE(test_balance_l23_tx_burst_ipv4_toggle_ip_addr),
> @@ -5137,26 +5185,26 @@ static struct unit_test_suite link_bonding_test_suite  = {
>   		TEST_CASE(test_balance_l34_tx_burst_ipv6_toggle_ip_addr),
>   		TEST_CASE(test_balance_l34_tx_burst_vlan_ipv6_toggle_ip_addr),
>   		TEST_CASE(test_balance_l34_tx_burst_ipv6_toggle_udp_port),
> -		TEST_CASE(test_balance_tx_burst_slave_tx_fail),
> +		TEST_CASE(test_balance_tx_burst_member_tx_fail),
>   		TEST_CASE(test_balance_rx_burst),
>   		TEST_CASE(test_balance_verify_promiscuous_enable_disable),
>   		TEST_CASE(test_balance_verify_mac_assignment),
> -		TEST_CASE(test_balance_verify_slave_link_status_change_behaviour),
> +		TEST_CASE(test_balance_verify_member_link_status_change_behaviour),
>   		TEST_CASE(test_tlb_tx_burst),
>   		TEST_CASE(test_tlb_rx_burst),
>   		TEST_CASE(test_tlb_verify_mac_assignment),
>   		TEST_CASE(test_tlb_verify_promiscuous_enable_disable),
> -		TEST_CASE(test_tlb_verify_slave_link_status_change_failover),
> +		TEST_CASE(test_tlb_verify_member_link_status_change_failover),
>   		TEST_CASE(test_alb_change_mac_in_reply_sent),
>   		TEST_CASE(test_alb_reply_from_client),
>   		TEST_CASE(test_alb_receive_vlan_reply),
>   		TEST_CASE(test_alb_ipv4_tx),
>   		TEST_CASE(test_broadcast_tx_burst),
> -		TEST_CASE(test_broadcast_tx_burst_slave_tx_fail),
> +		TEST_CASE(test_broadcast_tx_burst_member_tx_fail),
>   		TEST_CASE(test_broadcast_rx_burst),
>   		TEST_CASE(test_broadcast_verify_promiscuous_enable_disable),
>   		TEST_CASE(test_broadcast_verify_mac_assignment),
> -		TEST_CASE(test_broadcast_verify_slave_link_status_change_behaviour),
> +		TEST_CASE(test_broadcast_verify_member_link_status_change_behaviour),
>   		TEST_CASE(test_reconfigure_bonded_device),
>   		TEST_CASE(test_close_bonded_device),
>   
> diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
> index 21c512c94b..2de907e7f3 100644
> --- a/app/test/test_link_bonding_mode4.c
> +++ b/app/test/test_link_bonding_mode4.c
> @@ -31,7 +31,7 @@
>   
>   #include "test.h"
>   
> -#define SLAVE_COUNT (4)
> +#define MEMBER_COUNT (4)
>   
>   #define RX_RING_SIZE 1024
>   #define TX_RING_SIZE 1024
> @@ -46,15 +46,15 @@
>   
>   #define BONDED_DEV_NAME         ("net_bonding_m4_bond_dev")
>   
> -#define SLAVE_DEV_NAME_FMT      ("net_virt_%d")
> -#define SLAVE_RX_QUEUE_FMT      ("net_virt_%d_rx")
> -#define SLAVE_TX_QUEUE_FMT      ("net_virt_%d_tx")
> +#define MEMBER_DEV_NAME_FMT      ("net_virt_%d")
> +#define MEMBER_RX_QUEUE_FMT      ("net_virt_%d_rx")
> +#define MEMBER_TX_QUEUE_FMT      ("net_virt_%d_tx")
>   
>   #define INVALID_SOCKET_ID       (-1)
>   #define INVALID_PORT_ID         (0xFF)
>   #define INVALID_BONDING_MODE    (-1)
>   
> -static const struct rte_ether_addr slave_mac_default = {
> +static const struct rte_ether_addr member_mac_default = {
>   	{ 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }
>   };
>   
> @@ -70,7 +70,7 @@ static const struct rte_ether_addr slow_protocol_mac_addr = {
>   	{ 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 }
>   };
>   
> -struct slave_conf {
> +struct member_conf {
>   	struct rte_ring *rx_queue;
>   	struct rte_ring *tx_queue;
>   	uint16_t port_id;
> @@ -86,21 +86,21 @@ struct ether_vlan_hdr {
>   
>   struct link_bonding_unittest_params {
>   	uint8_t bonded_port_id;
> -	struct slave_conf slave_ports[SLAVE_COUNT];
> +	struct member_conf member_ports[MEMBER_COUNT];
>   
>   	struct rte_mempool *mbuf_pool;
>   };
>   
> -#define TEST_DEFAULT_SLAVE_COUNT     RTE_DIM(test_params.slave_ports)
> -#define TEST_RX_SLAVE_COUT           TEST_DEFAULT_SLAVE_COUNT
> -#define TEST_TX_SLAVE_COUNT          TEST_DEFAULT_SLAVE_COUNT
> -#define TEST_MARKER_SLAVE_COUT       TEST_DEFAULT_SLAVE_COUNT
> -#define TEST_EXPIRED_SLAVE_COUNT     TEST_DEFAULT_SLAVE_COUNT
> -#define TEST_PROMISC_SLAVE_COUNT     TEST_DEFAULT_SLAVE_COUNT
> +#define TEST_DEFAULT_MEMBER_COUNT     RTE_DIM(test_params.member_ports)
> +#define TEST_RX_MEMBER_COUT           TEST_DEFAULT_MEMBER_COUNT
> +#define TEST_TX_MEMBER_COUNT          TEST_DEFAULT_MEMBER_COUNT
> +#define TEST_MARKER_MEMBER_COUT       TEST_DEFAULT_MEMBER_COUNT
> +#define TEST_EXPIRED_MEMBER_COUNT     TEST_DEFAULT_MEMBER_COUNT
> +#define TEST_PROMISC_MEMBER_COUNT     TEST_DEFAULT_MEMBER_COUNT
>   
>   static struct link_bonding_unittest_params test_params  = {
>   	.bonded_port_id = INVALID_PORT_ID,
> -	.slave_ports = { [0 ... SLAVE_COUNT - 1] = { .port_id = INVALID_PORT_ID} },
> +	.member_ports = { [0 ... MEMBER_COUNT - 1] = { .port_id = INVALID_PORT_ID} },
>   
>   	.mbuf_pool = NULL,
>   };
> @@ -120,58 +120,58 @@ static uint8_t lacpdu_rx_count[RTE_MAX_ETHPORTS] = {0, };
>   #define FOR_EACH(_i, _item, _array, _size) \
>   	for (_i = 0, _item = &_array[0]; _i < _size && (_item = &_array[_i]); _i++)
>   
> -/* Macro for iterating over every port that can be used as a slave
> +/* Macro for iterating over every port that can be used as a member
>    * in this test.
> - * _i variable used as an index in test_params->slave_ports
> - * _slave pointer to &test_params->slave_ports[_idx]
> + * _i variable used as an index in test_params->member_ports
> + * _member pointer to &test_params->member_ports[_idx]
>    */
>   #define FOR_EACH_PORT(_i, _port) \
> -	FOR_EACH(_i, _port, test_params.slave_ports, \
> -		RTE_DIM(test_params.slave_ports))
> +	FOR_EACH(_i, _port, test_params.member_ports, \
> +		RTE_DIM(test_params.member_ports))
>   
> -/* Macro for iterating over every port that can be used as a slave
> +/* Macro for iterating over every port that can be used as a member
>    * in this test and satisfy given condition.
>    *
> - * _i variable used as an index in test_params->slave_ports
> - * _slave pointer to &test_params->slave_ports[_idx]
> + * _i variable used as an index in test_params->member_ports
> + * _member pointer to &test_params->member_ports[_idx]
>    * _condition condition that need to be checked
>    */
>   #define FOR_EACH_PORT_IF(_i, _port, _condition) FOR_EACH_PORT((_i), (_port)) \
>   	if (!!(_condition))
>   
> -/* Macro for iterating over every port that is currently a slave of a bonded
> +/* Macro for iterating over every port that is currently a member of a bonded
>    * device.
> - * _i variable used as an index in test_params->slave_ports
> - * _slave pointer to &test_params->slave_ports[_idx]
> + * _i variable used as an index in test_params->member_ports
> + * _member pointer to &test_params->member_ports[_idx]
>    * */
> -#define FOR_EACH_SLAVE(_i, _slave) \
> -	FOR_EACH_PORT_IF(_i, _slave, (_slave)->bonded != 0)
> +#define FOR_EACH_MEMBER(_i, _member) \
> +	FOR_EACH_PORT_IF(_i, _member, (_member)->bonded != 0)
>   
>   /*
> - * Returns packets from slaves TX queue.
> - * slave slave port
> + * Returns packets from members TX queue.
> + * member port
>    * buffer for packets
>    * size size of buffer
>    * return number of packets or negative error number
>    */
>   static int
> -slave_get_pkts(struct slave_conf *slave, struct rte_mbuf **buf, uint16_t size)
> +member_get_pkts(struct member_conf *member, struct rte_mbuf **buf, uint16_t size)
>   {
> -	return rte_ring_dequeue_burst(slave->tx_queue, (void **)buf,
> +	return rte_ring_dequeue_burst(member->tx_queue, (void **)buf,
>   			size, NULL);
>   }
>   
>   /*
> - * Injects given packets into slaves RX queue.
> - * slave slave port
> + * Injects given packets into members RX queue.
> + * member port
>    * buffer for packets
>    * size number of packets to be injected
>    * return number of queued packets or negative error number
>    */
>   static int
> -slave_put_pkts(struct slave_conf *slave, struct rte_mbuf **buf, uint16_t size)
> +member_put_pkts(struct member_conf *member, struct rte_mbuf **buf, uint16_t size)
>   {
> -	return rte_ring_enqueue_burst(slave->rx_queue, (void **)buf,
> +	return rte_ring_enqueue_burst(member->rx_queue, (void **)buf,
>   			size, NULL);
>   }
>   
> @@ -219,79 +219,79 @@ configure_ethdev(uint16_t port_id, uint8_t start)
>   }
>   
>   static int
> -add_slave(struct slave_conf *slave, uint8_t start)
> +add_member(struct member_conf *member, uint8_t start)
>   {
>   	struct rte_ether_addr addr, addr_check;
>   	int retval;
>   
>   	/* Some sanity check */
> -	RTE_VERIFY(test_params.slave_ports <= slave &&
> -		slave - test_params.slave_ports < (int)RTE_DIM(test_params.slave_ports));
> -	RTE_VERIFY(slave->bonded == 0);
> -	RTE_VERIFY(slave->port_id != INVALID_PORT_ID);
> +	RTE_VERIFY(test_params.member_ports <= member &&
> +		member - test_params.member_ports < (int)RTE_DIM(test_params.member_ports));
> +	RTE_VERIFY(member->bonded == 0);
> +	RTE_VERIFY(member->port_id != INVALID_PORT_ID);
>   
> -	rte_ether_addr_copy(&slave_mac_default, &addr);
> -	addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
> +	rte_ether_addr_copy(&member_mac_default, &addr);
> +	addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = member->port_id;
>   
> -	rte_eth_dev_mac_addr_remove(slave->port_id, &addr);
> +	rte_eth_dev_mac_addr_remove(member->port_id, &addr);
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_dev_mac_addr_add(slave->port_id, &addr, 0),
> -		"Failed to set slave MAC address");
> +	TEST_ASSERT_SUCCESS(rte_eth_dev_mac_addr_add(member->port_id, &addr, 0),
> +		"Failed to set member MAC address");
>   
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bonded_port_id,
> -		slave->port_id),
> -			"Failed to add slave (idx=%u, id=%u) to bonding (id=%u)",
> -			(uint8_t)(slave - test_params.slave_ports), slave->port_id,
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params.bonded_port_id,
> +		member->port_id),
> +			"Failed to add member (idx=%u, id=%u) to bonding (id=%u)",
> +			(uint8_t)(member - test_params.member_ports), member->port_id,
>   			test_params.bonded_port_id);
>   
> -	slave->bonded = 1;
> +	member->bonded = 1;
>   	if (start) {
> -		TEST_ASSERT_SUCCESS(rte_eth_dev_start(slave->port_id),
> -			"Failed to start slave %u", slave->port_id);
> +		TEST_ASSERT_SUCCESS(rte_eth_dev_start(member->port_id),
> +			"Failed to start member %u", member->port_id);
>   	}
>   
> -	retval = rte_eth_macaddr_get(slave->port_id, &addr_check);
> -	TEST_ASSERT_SUCCESS(retval, "Failed to get slave mac address: %s",
> +	retval = rte_eth_macaddr_get(member->port_id, &addr_check);
> +	TEST_ASSERT_SUCCESS(retval, "Failed to get member mac address: %s",
>   			    strerror(-retval));
>   	TEST_ASSERT_EQUAL(rte_is_same_ether_addr(&addr, &addr_check), 1,
> -			"Slave MAC address is not as expected");
> +			"Member MAC address is not as expected");
>   
> -	RTE_VERIFY(slave->lacp_parnter_state == 0);
> +	RTE_VERIFY(member->lacp_parnter_state == 0);
>   	return 0;
>   }
>   
>   static int
> -remove_slave(struct slave_conf *slave)
> +remove_member(struct member_conf *member)
>   {
> -	ptrdiff_t slave_idx = slave - test_params.slave_ports;
> +	ptrdiff_t member_idx = member - test_params.member_ports;
>   
> -	RTE_VERIFY(test_params.slave_ports <= slave &&
> -		slave_idx < (ptrdiff_t)RTE_DIM(test_params.slave_ports));
> +	RTE_VERIFY(test_params.member_ports <= member &&
> +		member_idx < (ptrdiff_t)RTE_DIM(test_params.member_ports));
>   
> -	RTE_VERIFY(slave->bonded == 1);
> -	RTE_VERIFY(slave->port_id != INVALID_PORT_ID);
> +	RTE_VERIFY(member->bonded == 1);
> +	RTE_VERIFY(member->port_id != INVALID_PORT_ID);
>   
> -	TEST_ASSERT_EQUAL(rte_ring_count(slave->rx_queue), 0,
> -		"Slave %u tx queue not empty while removing from bonding.",
> -		slave->port_id);
> +	TEST_ASSERT_EQUAL(rte_ring_count(member->rx_queue), 0,
> +		"Member %u tx queue not empty while removing from bonding.",
> +		member->port_id);
>   
> -	TEST_ASSERT_EQUAL(rte_ring_count(slave->rx_queue), 0,
> -		"Slave %u tx queue not empty while removing from bonding.",
> -		slave->port_id);
> +	TEST_ASSERT_EQUAL(rte_ring_count(member->rx_queue), 0,
> +		"Member %u tx queue not empty while removing from bonding.",
> +		member->port_id);
>   
> -	TEST_ASSERT_EQUAL(rte_eth_bond_slave_remove(test_params.bonded_port_id,
> -			slave->port_id), 0,
> -			"Failed to remove slave (idx=%u, id=%u) from bonding (id=%u)",
> -			(uint8_t)slave_idx, slave->port_id,
> +	TEST_ASSERT_EQUAL(rte_eth_bond_member_remove(test_params.bonded_port_id,
> +			member->port_id), 0,
> +			"Failed to remove member (idx=%u, id=%u) from bonding (id=%u)",
> +			(uint8_t)member_idx, member->port_id,
>   			test_params.bonded_port_id);
>   
> -	slave->bonded = 0;
> -	slave->lacp_parnter_state = 0;
> +	member->bonded = 0;
> +	member->lacp_parnter_state = 0;
>   	return 0;
>   }
>   
>   static void
> -lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt)
> +lacp_recv_cb(uint16_t member_id, struct rte_mbuf *lacp_pkt)
>   {
>   	struct rte_ether_hdr *hdr;
>   	struct slow_protocol_frame *slow_hdr;
> @@ -304,22 +304,22 @@ lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt)
>   	slow_hdr = rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *);
>   	RTE_VERIFY(slow_hdr->slow_protocol.subtype == SLOW_SUBTYPE_LACP);
>   
> -	lacpdu_rx_count[slave_id]++;
> +	lacpdu_rx_count[member_id]++;
>   	rte_pktmbuf_free(lacp_pkt);
>   }
>   
>   static int
> -initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm)
> +initialize_bonded_device_with_members(uint16_t member_count, uint8_t external_sm)
>   {
>   	uint8_t i;
>   	int ret;
>   
>   	RTE_VERIFY(test_params.bonded_port_id != INVALID_PORT_ID);
>   
> -	for (i = 0; i < slave_count; i++) {
> -		TEST_ASSERT_SUCCESS(add_slave(&test_params.slave_ports[i], 1),
> +	for (i = 0; i < member_count; i++) {
> +		TEST_ASSERT_SUCCESS(add_member(&test_params.member_ports[i], 1),
>   			"Failed to add port %u to bonded device.\n",
> -			test_params.slave_ports[i].port_id);
> +			test_params.member_ports[i].port_id);
>   	}
>   
>   	/* Reset mode 4 configuration */
> @@ -345,34 +345,34 @@ initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm)
>   }
>   
>   static int
> -remove_slaves_and_stop_bonded_device(void)
> +remove_members_and_stop_bonded_device(void)
>   {
> -	struct slave_conf *slave;
> +	struct member_conf *member;
>   	int retval;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   	uint16_t i;
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonded_port_id),
>   			"Failed to stop bonded port %u",
>   			test_params.bonded_port_id);
>   
> -	FOR_EACH_SLAVE(i, slave)
> -		remove_slave(slave);
> +	FOR_EACH_MEMBER(i, member)
> +		remove_member(member);
>   
> -	retval = rte_eth_bond_slaves_get(test_params.bonded_port_id, slaves,
> -		RTE_DIM(slaves));
> +	retval = rte_eth_bond_members_get(test_params.bonded_port_id, members,
> +		RTE_DIM(members));
>   
>   	TEST_ASSERT_EQUAL(retval, 0,
> -		"Expected bonded device %u have 0 slaves but returned %d.",
> +		"Expected bonded device %u have 0 members but returned %d.",
>   			test_params.bonded_port_id, retval);
>   
> -	FOR_EACH_PORT(i, slave) {
> -		TEST_ASSERT_SUCCESS(rte_eth_dev_stop(slave->port_id),
> +	FOR_EACH_PORT(i, member) {
> +		TEST_ASSERT_SUCCESS(rte_eth_dev_stop(member->port_id),
>   				"Failed to stop bonded port %u",
> -				slave->port_id);
> +				member->port_id);
>   
> -		TEST_ASSERT(slave->bonded == 0,
> -			"Port id=%u is still marked as enslaved.", slave->port_id);
> +		TEST_ASSERT(member->bonded == 0,
> +			"Port id=%u is still marked as enmemberd.", member->port_id);
>   	}
>   
>   	return TEST_SUCCESS;
> @@ -383,7 +383,7 @@ test_setup(void)
>   {
>   	int retval, nb_mbuf_per_pool;
>   	char name[RTE_ETH_NAME_MAX_LEN];
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	const uint8_t socket_id = rte_socket_id();
>   	uint16_t i;
>   
> @@ -400,10 +400,10 @@ test_setup(void)
>   
>   	/* Create / initialize ring eth devs. */
>   	FOR_EACH_PORT(i, port) {
> -		port = &test_params.slave_ports[i];
> +		port = &test_params.member_ports[i];
>   
>   		if (port->rx_queue == NULL) {
> -			retval = snprintf(name, RTE_DIM(name), SLAVE_RX_QUEUE_FMT, i);
> +			retval = snprintf(name, RTE_DIM(name), MEMBER_RX_QUEUE_FMT, i);
>   			TEST_ASSERT(retval <= (int)RTE_DIM(name) - 1, "Name too long");
>   			port->rx_queue = rte_ring_create(name, RX_RING_SIZE, socket_id, 0);
>   			TEST_ASSERT(port->rx_queue != NULL,
> @@ -412,7 +412,7 @@ test_setup(void)
>   		}
>   
>   		if (port->tx_queue == NULL) {
> -			retval = snprintf(name, RTE_DIM(name), SLAVE_TX_QUEUE_FMT, i);
> +			retval = snprintf(name, RTE_DIM(name), MEMBER_TX_QUEUE_FMT, i);
>   			TEST_ASSERT(retval <= (int)RTE_DIM(name) - 1, "Name too long");
>   			port->tx_queue = rte_ring_create(name, TX_RING_SIZE, socket_id, 0);
>   			TEST_ASSERT_NOT_NULL(port->tx_queue,
> @@ -421,7 +421,7 @@ test_setup(void)
>   		}
>   
>   		if (port->port_id == INVALID_PORT_ID) {
> -			retval = snprintf(name, RTE_DIM(name), SLAVE_DEV_NAME_FMT, i);
> +			retval = snprintf(name, RTE_DIM(name), MEMBER_DEV_NAME_FMT, i);
>   			TEST_ASSERT(retval < (int)RTE_DIM(name) - 1, "Name too long");
>   			retval = rte_eth_from_rings(name, &port->rx_queue, 1,
>   					&port->tx_queue, 1, socket_id);
> @@ -460,7 +460,7 @@ test_setup(void)
>   static void
>   testsuite_teardown(void)
>   {
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	uint8_t i;
>   
>   	/* Only stop ports.
> @@ -480,7 +480,7 @@ testsuite_teardown(void)
>    * frame but not LACP
>    */
>   static int
> -make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
> +make_lacp_reply(struct member_conf *member, struct rte_mbuf *pkt)
>   {
>   	struct rte_ether_hdr *hdr;
>   	struct slow_protocol_frame *slow_hdr;
> @@ -501,11 +501,11 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
>   	/* Change source address to partner address */
>   	rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.src_addr);
>   	slow_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
> -		slave->port_id;
> +		member->port_id;
>   
>   	lacp = (struct lacpdu *) &slow_hdr->slow_protocol;
>   	/* Save last received state */
> -	slave->lacp_parnter_state = lacp->actor.state;
> +	member->lacp_parnter_state = lacp->actor.state;
>   	/* Change it into LACP replay by matching parameters. */
>   	memcpy(&lacp->partner.port_params, &lacp->actor.port_params,
>   		sizeof(struct port_params));
> @@ -523,27 +523,27 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
>   }
>   
>   /*
> - * Reads packets from given slave, search for LACP packet and reply them.
> + * Reads packets from given member, search for LACP packet and reply them.
>    *
> - * Receives burst of packets from slave. Looks for LACP packet. Drops
> + * Receives burst of packets from member. Looks for LACP packet. Drops
>    * all other packets. Prepares response LACP and sends it back.
>    *
>    * return number of LACP received and replied, -1 on error.
>    */
>   static int
> -bond_handshake_reply(struct slave_conf *slave)
> +bond_handshake_reply(struct member_conf *member)
>   {
>   	int retval;
>   	struct rte_mbuf *rx_buf[MAX_PKT_BURST];
>   	struct rte_mbuf *lacp_tx_buf[MAX_PKT_BURST];
>   	uint16_t lacp_tx_buf_cnt = 0, i;
>   
> -	retval = slave_get_pkts(slave, rx_buf, RTE_DIM(rx_buf));
> -	TEST_ASSERT(retval >= 0, "Getting slave %u packets failed.",
> -			slave->port_id);
> +	retval = member_get_pkts(member, rx_buf, RTE_DIM(rx_buf));
> +	TEST_ASSERT(retval >= 0, "Getting member %u packets failed.",
> +			member->port_id);
>   
>   	for (i = 0; i < (uint16_t)retval; i++) {
> -		if (make_lacp_reply(slave, rx_buf[i]) == 0) {
> +		if (make_lacp_reply(member, rx_buf[i]) == 0) {
>   			/* reply with actor's LACP */
>   			lacp_tx_buf[lacp_tx_buf_cnt++] = rx_buf[i];
>   		} else
> @@ -553,7 +553,7 @@ bond_handshake_reply(struct slave_conf *slave)
>   	if (lacp_tx_buf_cnt == 0)
>   		return 0;
>   
> -	retval = slave_put_pkts(slave, lacp_tx_buf, lacp_tx_buf_cnt);
> +	retval = member_put_pkts(member, lacp_tx_buf, lacp_tx_buf_cnt);
>   	if (retval <= lacp_tx_buf_cnt) {
>   		/* retval might be negative */
>   		for (i = RTE_MAX(0, retval); retval < lacp_tx_buf_cnt; retval++)
> @@ -561,24 +561,24 @@ bond_handshake_reply(struct slave_conf *slave)
>   	}
>   
>   	TEST_ASSERT_EQUAL(retval, lacp_tx_buf_cnt,
> -		"Failed to equeue lacp packets into slave %u tx queue.",
> -		slave->port_id);
> +		"Failed to equeue lacp packets into member %u tx queue.",
> +		member->port_id);
>   
>   	return lacp_tx_buf_cnt;
>   }
>   
>   /*
> - * Function check if given slave tx queue contains packets that make mode 4
> - * handshake complete. It will drain slave queue.
> + * Function check if given member tx queue contains packets that make mode 4
> + * handshake complete. It will drain member queue.
>    * return 0 if handshake not completed, 1 if handshake was complete,
>    */
>   static int
> -bond_handshake_done(struct slave_conf *slave)
> +bond_handshake_done(struct member_conf *member)
>   {
>   	const uint8_t expected_state = STATE_LACP_ACTIVE | STATE_SYNCHRONIZATION |
>   			STATE_AGGREGATION | STATE_COLLECTING | STATE_DISTRIBUTING;
>   
> -	return slave->lacp_parnter_state == expected_state;
> +	return member->lacp_parnter_state == expected_state;
>   }
>   
>   static unsigned
> @@ -603,32 +603,32 @@ bond_get_update_timeout_ms(void)
>   static int
>   bond_handshake(void)
>   {
> -	struct slave_conf *slave;
> +	struct member_conf *member;
>   	struct rte_mbuf *buf[MAX_PKT_BURST];
>   	uint16_t nb_pkts;
> -	uint8_t all_slaves_done, i, j;
> -	uint8_t status[RTE_DIM(test_params.slave_ports)] = { 0 };
> +	uint8_t all_members_done, i, j;
> +	uint8_t status[RTE_DIM(test_params.member_ports)] = { 0 };
>   	const unsigned delay = bond_get_update_timeout_ms();
>   
>   	/* Exchange LACP frames */
> -	all_slaves_done = 0;
> -	for (i = 0; i < 30 && all_slaves_done == 0; ++i) {
> +	all_members_done = 0;
> +	for (i = 0; i < 30 && all_members_done == 0; ++i) {
>   		rte_delay_ms(delay);
>   
> -		all_slaves_done = 1;
> -		FOR_EACH_SLAVE(j, slave) {
> -			/* If response already send, skip slave */
> +		all_members_done = 1;
> +		FOR_EACH_MEMBER(j, member) {
> +			/* If response already send, skip member */
>   			if (status[j] != 0)
>   				continue;
>   
> -			if (bond_handshake_reply(slave) < 0) {
> -				all_slaves_done = 0;
> +			if (bond_handshake_reply(member) < 0) {
> +				all_members_done = 0;
>   				break;
>   			}
>   
> -			status[j] = bond_handshake_done(slave);
> +			status[j] = bond_handshake_done(member);
>   			if (status[j] == 0)
> -				all_slaves_done = 0;
> +				all_members_done = 0;
>   		}
>   
>   		nb_pkts = bond_tx(NULL, 0);
> @@ -639,26 +639,26 @@ bond_handshake(void)
>   		TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets received unexpectedly");
>   	}
>   	/* If response didn't send - report failure */
> -	TEST_ASSERT_EQUAL(all_slaves_done, 1, "Bond handshake failed\n");
> +	TEST_ASSERT_EQUAL(all_members_done, 1, "Bond handshake failed\n");
>   
>   	/* If flags doesn't match - report failure */
> -	return all_slaves_done == 1 ? TEST_SUCCESS : TEST_FAILED;
> +	return all_members_done == 1 ? TEST_SUCCESS : TEST_FAILED;
>   }
>   
> -#define TEST_LACP_SLAVE_COUT RTE_DIM(test_params.slave_ports)
> +#define TEST_LACP_MEMBER_COUT RTE_DIM(test_params.member_ports)
>   static int
>   test_mode4_lacp(void)
>   {
>   	int retval;
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   	/* Test LACP handshake function */
>   	retval = bond_handshake();
>   	TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -668,7 +668,7 @@ test_mode4_agg_mode_selection(void)
>   {
>   	int retval;
>   	/* Test and verify for Stable mode */
> -	retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   
> @@ -684,12 +684,12 @@ test_mode4_agg_mode_selection(void)
>   	TEST_ASSERT_EQUAL(retval, AGG_STABLE,
>   			"Wrong agg mode received from bonding device");
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   
>   	/* test and verify for Bandwidth mode */
> -	retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   
> @@ -706,11 +706,11 @@ test_mode4_agg_mode_selection(void)
>   	TEST_ASSERT_EQUAL(retval, AGG_BANDWIDTH,
>   			"Wrong agg mode received from bonding device");
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   	/* test and verify selection for count mode */
> -	retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_LACP_MEMBER_COUT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   
> @@ -726,7 +726,7 @@ test_mode4_agg_mode_selection(void)
>   	TEST_ASSERT_EQUAL(retval, AGG_COUNT,
>   			"Wrong agg mode received from bonding device");
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -780,7 +780,7 @@ generate_packets(struct rte_ether_addr *src_mac,
>   }
>   
>   static int
> -generate_and_put_packets(struct slave_conf *slave,
> +generate_and_put_packets(struct member_conf *member,
>   			struct rte_ether_addr *src_mac,
>   			struct rte_ether_addr *dst_mac, uint16_t count)
>   {
> @@ -791,12 +791,12 @@ generate_and_put_packets(struct slave_conf *slave,
>   	if (retval != (int)count)
>   		return retval;
>   
> -	retval = slave_put_pkts(slave, pkts, count);
> +	retval = member_put_pkts(member, pkts, count);
>   	if (retval > 0 && retval != count)
>   		free_pkts(&pkts[retval], count - retval);
>   
>   	TEST_ASSERT_EQUAL(retval, count,
> -		"Failed to enqueue packets into slave %u RX queue", slave->port_id);
> +		"Failed to enqueue packets into member %u RX queue", member->port_id);
>   
>   	return TEST_SUCCESS;
>   }
> @@ -804,7 +804,7 @@ generate_and_put_packets(struct slave_conf *slave,
>   static int
>   test_mode4_rx(void)
>   {
> -	struct slave_conf *slave;
> +	struct member_conf *member;
>   	uint16_t i, j;
>   
>   	uint16_t expected_pkts_cnt;
> @@ -819,7 +819,7 @@ test_mode4_rx(void)
>   	struct rte_ether_addr dst_mac;
>   	struct rte_ether_addr bonded_mac;
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_PROMISC_SLAVE_COUNT,
> +	retval = initialize_bonded_device_with_members(TEST_PROMISC_MEMBER_COUNT,
>   						      0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
> @@ -838,7 +838,7 @@ test_mode4_rx(void)
>   	dst_mac.addr_bytes[0] += 2;
>   
>   	/* First try with promiscuous mode enabled.
> -	 * Add 2 packets to each slave. First with bonding MAC address, second with
> +	 * Add 2 packets to each member. First with bonding MAC address, second with
>   	 * different. Check if we received all of them. */
>   	retval = rte_eth_promiscuous_enable(test_params.bonded_port_id);
>   	TEST_ASSERT_SUCCESS(retval,
> @@ -846,16 +846,16 @@ test_mode4_rx(void)
>   			test_params.bonded_port_id, rte_strerror(-retval));
>   
>   	expected_pkts_cnt = 0;
> -	FOR_EACH_SLAVE(i, slave) {
> -		retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1);
> -		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u",
> -			slave->port_id);
> +	FOR_EACH_MEMBER(i, member) {
> +		retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1);
> +		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u",
> +			member->port_id);
>   
> -		retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1);
> -		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u",
> -			slave->port_id);
> +		retval = generate_and_put_packets(member, &src_mac, &dst_mac, 1);
> +		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u",
> +			member->port_id);
>   
> -		/* Expect 2 packets per slave */
> +		/* Expect 2 packets per member */
>   		expected_pkts_cnt += 2;
>   	}
>   
> @@ -894,16 +894,16 @@ test_mode4_rx(void)
>   		test_params.bonded_port_id, rte_strerror(-retval));
>   
>   	expected_pkts_cnt = 0;
> -	FOR_EACH_SLAVE(i, slave) {
> -		retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1);
> -		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u",
> -			slave->port_id);
> +	FOR_EACH_MEMBER(i, member) {
> +		retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1);
> +		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u",
> +			member->port_id);
>   
> -		retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1);
> -		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u",
> -			slave->port_id);
> +		retval = generate_and_put_packets(member, &src_mac, &dst_mac, 1);
> +		TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to member %u",
> +			member->port_id);
>   
> -		/* Expect only one packet per slave */
> +		/* Expect only one packet per member */
>   		expected_pkts_cnt += 1;
>   	}
>   
> @@ -927,19 +927,19 @@ test_mode4_rx(void)
>   	TEST_ASSERT_EQUAL(retval, expected_pkts_cnt,
>   		"Expected %u packets but received only %d", expected_pkts_cnt, retval);
>   
> -	/* Link down test: simulate link down for first slave. */
> +	/* Link down test: simulate link down for first member. */
>   	delay = bond_get_update_timeout_ms();
>   
> -	uint8_t slave_down_id = INVALID_PORT_ID;
> +	uint8_t member_down_id = INVALID_PORT_ID;
>   
> -	/* Find first slave and make link down on it*/
> -	FOR_EACH_SLAVE(i, slave) {
> -		rte_eth_dev_set_link_down(slave->port_id);
> -		slave_down_id = slave->port_id;
> +	/* Find first member and make link down on it*/
> +	FOR_EACH_MEMBER(i, member) {
> +		rte_eth_dev_set_link_down(member->port_id);
> +		member_down_id = member->port_id;
>   		break;
>   	}
>   
> -	RTE_VERIFY(slave_down_id != INVALID_PORT_ID);
> +	RTE_VERIFY(member_down_id != INVALID_PORT_ID);
>   
>   	/* Give some time to rearrange bonding */
>   	for (i = 0; i < 3; i++) {
> @@ -949,16 +949,16 @@ test_mode4_rx(void)
>   
>   	TEST_ASSERT_SUCCESS(bond_handshake(), "Handshake after link down failed");
>   
> -	/* Put packet to each slave */
> -	FOR_EACH_SLAVE(i, slave) {
> +	/* Put packet to each member */
> +	FOR_EACH_MEMBER(i, member) {
>   		void *pkt = NULL;
>   
> -		dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
> -		retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1);
> +		dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = member->port_id;
> +		retval = generate_and_put_packets(member, &src_mac, &dst_mac, 1);
>   		TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst.");
>   
> -		src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
> -		retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1);
> +		src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = member->port_id;
> +		retval = generate_and_put_packets(member, &src_mac, &bonded_mac, 1);
>   		TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst.");
>   
>   		retval = bond_rx(pkts, RTE_DIM(pkts));
> @@ -967,36 +967,36 @@ test_mode4_rx(void)
>   		if (retval > 0)
>   			free_pkts(pkts, retval);
>   
> -		while (rte_ring_dequeue(slave->rx_queue, (void **)&pkt) == 0)
> +		while (rte_ring_dequeue(member->rx_queue, (void **)&pkt) == 0)
>   			rte_pktmbuf_free(pkt);
>   
> -		if (slave_down_id == slave->port_id)
> +		if (member_down_id == member->port_id)
>   			TEST_ASSERT_EQUAL(retval, 0, "Packets received unexpectedly.");
>   		else
>   			TEST_ASSERT_NOT_EQUAL(retval, 0,
> -				"Expected to receive some packets on slave %u.",
> -				slave->port_id);
> -		rte_eth_dev_start(slave->port_id);
> +				"Expected to receive some packets on member %u.",
> +				member->port_id);
> +		rte_eth_dev_start(member->port_id);
>   
>   		for (j = 0; j < 5; j++) {
> -			TEST_ASSERT(bond_handshake_reply(slave) >= 0,
> +			TEST_ASSERT(bond_handshake_reply(member) >= 0,
>   				"Handshake after link up");
>   
> -			if (bond_handshake_done(slave) == 1)
> +			if (bond_handshake_done(member) == 1)
>   				break;
>   		}
>   
> -		TEST_ASSERT(j < 5, "Failed to aggregate slave after link up");
> +		TEST_ASSERT(j < 5, "Failed to aggregate member after link up");
>   	}
>   
> -	remove_slaves_and_stop_bonded_device();
> +	remove_members_and_stop_bonded_device();
>   	return TEST_SUCCESS;
>   }
>   
>   static int
>   test_mode4_tx_burst(void)
>   {
> -	struct slave_conf *slave;
> +	struct member_conf *member;
>   	uint16_t i, j;
>   
>   	uint16_t exp_pkts_cnt, pkts_cnt = 0;
> @@ -1008,7 +1008,7 @@ test_mode4_tx_burst(void)
>   		{ 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } };
>   	struct rte_ether_addr bonded_mac;
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   	retval = bond_handshake();
> @@ -1036,19 +1036,19 @@ test_mode4_tx_burst(void)
>   
>   	TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed");
>   
> -	/* Check if packets were transmitted properly. Every slave should have
> +	/* Check if packets were transmitted properly. Every member should have
>   	 * at least one packet, and sum must match. Under normal operation
>   	 * there should be no LACP nor MARKER frames. */
>   	pkts_cnt = 0;
> -	FOR_EACH_SLAVE(i, slave) {
> +	FOR_EACH_MEMBER(i, member) {
>   		uint16_t normal_cnt, slow_cnt;
>   
> -		retval = slave_get_pkts(slave, pkts, RTE_DIM(pkts));
> +		retval = member_get_pkts(member, pkts, RTE_DIM(pkts));
>   		normal_cnt = 0;
>   		slow_cnt = 0;
>   
>   		for (j = 0; j < retval; j++) {
> -			if (make_lacp_reply(slave, pkts[j]) == 1)
> +			if (make_lacp_reply(member, pkts[j]) == 1)
>   				normal_cnt++;
>   			else
>   				slow_cnt++;
> @@ -1056,11 +1056,11 @@ test_mode4_tx_burst(void)
>   
>   		free_pkts(pkts, normal_cnt + slow_cnt);
>   		TEST_ASSERT_EQUAL(slow_cnt, 0,
> -			"slave %u unexpectedly transmitted %d SLOW packets", slave->port_id,
> +			"member %u unexpectedly transmitted %d SLOW packets", member->port_id,
>   			slow_cnt);
>   
>   		TEST_ASSERT_NOT_EQUAL(normal_cnt, 0,
> -			"slave %u did not transmitted any packets", slave->port_id);
> +			"member %u did not transmitted any packets", member->port_id);
>   
>   		pkts_cnt += normal_cnt;
>   	}
> @@ -1068,19 +1068,21 @@ test_mode4_tx_burst(void)
>   	TEST_ASSERT_EQUAL(exp_pkts_cnt, pkts_cnt,
>   		"Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt);
>   
> -	/* Link down test:
> -	 * simulate link down for first slave. */
> +	/*
> +	 * Link down test:
> +	 * simulate link down for first member.
> +	 */
>   	delay = bond_get_update_timeout_ms();
>   
> -	uint8_t slave_down_id = INVALID_PORT_ID;
> +	uint8_t member_down_id = INVALID_PORT_ID;
>   
> -	FOR_EACH_SLAVE(i, slave) {
> -		rte_eth_dev_set_link_down(slave->port_id);
> -		slave_down_id = slave->port_id;
> +	FOR_EACH_MEMBER(i, member) {
> +		rte_eth_dev_set_link_down(member->port_id);
> +		member_down_id = member->port_id;
>   		break;
>   	}
>   
> -	RTE_VERIFY(slave_down_id != INVALID_PORT_ID);
> +	RTE_VERIFY(member_down_id != INVALID_PORT_ID);
>   
>   	/* Give some time to rearrange bonding. */
>   	for (i = 0; i < 3; i++) {
> @@ -1110,19 +1112,19 @@ test_mode4_tx_burst(void)
>   
>   	TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed");
>   
> -	/* Check if packets was transmitted properly. Every slave should have
> +	/* Check if packets was transmitted properly. Every member should have
>   	 * at least one packet, and sum must match. Under normal operation
>   	 * there should be no LACP nor MARKER frames. */
>   	pkts_cnt = 0;
> -	FOR_EACH_SLAVE(i, slave) {
> +	FOR_EACH_MEMBER(i, member) {
>   		uint16_t normal_cnt, slow_cnt;
>   
> -		retval = slave_get_pkts(slave, pkts, RTE_DIM(pkts));
> +		retval = member_get_pkts(member, pkts, RTE_DIM(pkts));
>   		normal_cnt = 0;
>   		slow_cnt = 0;
>   
>   		for (j = 0; j < retval; j++) {
> -			if (make_lacp_reply(slave, pkts[j]) == 1)
> +			if (make_lacp_reply(member, pkts[j]) == 1)
>   				normal_cnt++;
>   			else
>   				slow_cnt++;
> @@ -1130,17 +1132,17 @@ test_mode4_tx_burst(void)
>   
>   		free_pkts(pkts, normal_cnt + slow_cnt);
>   
> -		if (slave_down_id == slave->port_id) {
> +		if (member_down_id == member->port_id) {
>   			TEST_ASSERT_EQUAL(normal_cnt + slow_cnt, 0,
> -				"slave %u enexpectedly transmitted %u packets",
> -				normal_cnt + slow_cnt, slave->port_id);
> +				"member %u enexpectedly transmitted %u packets",
> +				normal_cnt + slow_cnt, member->port_id);
>   		} else {
>   			TEST_ASSERT_EQUAL(slow_cnt, 0,
> -				"slave %u unexpectedly transmitted %d SLOW packets",
> -				slave->port_id, slow_cnt);
> +				"member %u unexpectedly transmitted %d SLOW packets",
> +				member->port_id, slow_cnt);
>   
>   			TEST_ASSERT_NOT_EQUAL(normal_cnt, 0,
> -				"slave %u did not transmitted any packets", slave->port_id);
> +				"member %u did not transmitted any packets", member->port_id);
>   		}
>   
>   		pkts_cnt += normal_cnt;
> @@ -1149,11 +1151,11 @@ test_mode4_tx_burst(void)
>   	TEST_ASSERT_EQUAL(exp_pkts_cnt, pkts_cnt,
>   		"Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt);
>   
> -	return remove_slaves_and_stop_bonded_device();
> +	return remove_members_and_stop_bonded_device();
>   }
>   
>   static void
> -init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
> +init_marker(struct rte_mbuf *pkt, struct member_conf *member)
>   {
>   	struct marker_header *marker_hdr = rte_pktmbuf_mtod(pkt,
>   			struct marker_header *);
> @@ -1166,7 +1168,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
>   	rte_ether_addr_copy(&parnter_mac_default,
>   			&marker_hdr->eth_hdr.src_addr);
>   	marker_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
> -		slave->port_id;
> +		member->port_id;
>   
>   	marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);
>   
> @@ -1177,7 +1179,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
>   			offsetof(struct marker, reserved_90) -
>   			offsetof(struct marker, requester_port);
>   	RTE_VERIFY(marker_hdr->marker.info_length == 16);
> -	marker_hdr->marker.requester_port = slave->port_id + 1;
> +	marker_hdr->marker.requester_port = member->port_id + 1;
>   	marker_hdr->marker.tlv_type_terminator = TLV_TYPE_TERMINATOR_INFORMATION;
>   	marker_hdr->marker.terminator_length = 0;
>   }
> @@ -1185,7 +1187,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
>   static int
>   test_mode4_marker(void)
>   {
> -	struct slave_conf *slave;
> +	struct member_conf *member;
>   	struct rte_mbuf *pkts[MAX_PKT_BURST];
>   	struct rte_mbuf *marker_pkt;
>   	struct marker_header *marker_hdr;
> @@ -1196,7 +1198,7 @@ test_mode4_marker(void)
>   	uint8_t i, j;
>   	const uint16_t ethtype_slow_be = rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW);
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_MARKER_SLAVE_COUT,
> +	retval = initialize_bonded_device_with_members(TEST_MARKER_MEMBER_COUT,
>   						      0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
> @@ -1205,17 +1207,17 @@ test_mode4_marker(void)
>   	TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
>   
>   	delay = bond_get_update_timeout_ms();
> -	FOR_EACH_SLAVE(i, slave) {
> +	FOR_EACH_MEMBER(i, member) {
>   		marker_pkt = rte_pktmbuf_alloc(test_params.mbuf_pool);
>   		TEST_ASSERT_NOT_NULL(marker_pkt, "Failed to allocate marker packet");
> -		init_marker(marker_pkt, slave);
> +		init_marker(marker_pkt, member);
>   
> -		retval = slave_put_pkts(slave, &marker_pkt, 1);
> +		retval = member_put_pkts(member, &marker_pkt, 1);
>   		if (retval != 1)
>   			rte_pktmbuf_free(marker_pkt);
>   
>   		TEST_ASSERT_EQUAL(retval, 1,
> -			"Failed to send marker packet to slave %u", slave->port_id);
> +			"Failed to send marker packet to member %u", member->port_id);
>   
>   		for (j = 0; j < 20; ++j) {
>   			rte_delay_ms(delay);
> @@ -1233,13 +1235,13 @@ test_mode4_marker(void)
>   
>   			/* Check if LACP packet was send by state machines
>   			   First and only packet must be a maker response */
> -			retval = slave_get_pkts(slave, pkts, MAX_PKT_BURST);
> +			retval = member_get_pkts(member, pkts, MAX_PKT_BURST);
>   			if (retval == 0)
>   				continue;
>   			if (retval > 1)
>   				free_pkts(pkts, retval);
>   
> -			TEST_ASSERT_EQUAL(retval, 1, "failed to get slave packets");
> +			TEST_ASSERT_EQUAL(retval, 1, "failed to get member packets");
>   			nb_pkts = retval;
>   
>   			marker_hdr = rte_pktmbuf_mtod(pkts[0], struct marker_header *);
> @@ -1263,7 +1265,7 @@ test_mode4_marker(void)
>   		TEST_ASSERT(j < 20, "Marker response not found");
>   	}
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval,	"Test cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -1272,7 +1274,7 @@ test_mode4_marker(void)
>   static int
>   test_mode4_expired(void)
>   {
> -	struct slave_conf *slave, *exp_slave = NULL;
> +	struct member_conf *member, *exp_member = NULL;
>   	struct rte_mbuf *pkts[MAX_PKT_BURST];
>   	int retval;
>   	uint32_t old_delay;
> @@ -1282,7 +1284,7 @@ test_mode4_expired(void)
>   
>   	struct rte_eth_bond_8023ad_conf conf;
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_EXPIRED_SLAVE_COUNT,
> +	retval = initialize_bonded_device_with_members(TEST_EXPIRED_MEMBER_COUNT,
>   						      0);
>   	/* Set custom timeouts to make test last shorter. */
>   	rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf);
> @@ -1298,8 +1300,8 @@ test_mode4_expired(void)
>   
>   	/* Wait for new settings to be applied. */
>   	for (i = 0; i < old_delay/conf.update_timeout_ms * 2; i++) {
> -		FOR_EACH_SLAVE(j, slave)
> -			bond_handshake_reply(slave);
> +		FOR_EACH_MEMBER(j, member)
> +			bond_handshake_reply(member);
>   
>   		rte_delay_ms(conf.update_timeout_ms);
>   	}
> @@ -1307,13 +1309,13 @@ test_mode4_expired(void)
>   	retval = bond_handshake();
>   	TEST_ASSERT_SUCCESS(retval, "Initial handshake failed");
>   
> -	/* Find first slave */
> -	FOR_EACH_SLAVE(i, slave) {
> -		exp_slave = slave;
> +	/* Find first member */
> +	FOR_EACH_MEMBER(i, member) {
> +		exp_member = member;
>   		break;
>   	}
>   
> -	RTE_VERIFY(exp_slave != NULL);
> +	RTE_VERIFY(exp_member != NULL);
>   
>   	/* When one of partners do not send or respond to LACP frame in
>   	 * conf.long_timeout_ms time, internal state machines should detect this
> @@ -1325,16 +1327,16 @@ test_mode4_expired(void)
>   		TEST_ASSERT_EQUAL(retval, 0, "Unexpectedly received %d packets",
>   			retval);
>   
> -		FOR_EACH_SLAVE(i, slave) {
> -			retval = bond_handshake_reply(slave);
> +		FOR_EACH_MEMBER(i, member) {
> +			retval = bond_handshake_reply(member);
>   			TEST_ASSERT(retval >= 0, "Handshake failed");
>   
> -			/* Remove replay for slave that suppose to be expired. */
> -			if (slave == exp_slave) {
> -				while (rte_ring_count(slave->rx_queue) > 0) {
> +			/* Remove replay for member that suppose to be expired. */
> +			if (member == exp_member) {
> +				while (rte_ring_count(member->rx_queue) > 0) {
>   					void *pkt = NULL;
>   
> -					rte_ring_dequeue(slave->rx_queue, &pkt);
> +					rte_ring_dequeue(member->rx_queue, &pkt);
>   					rte_pktmbuf_free(pkt);
>   				}
>   			}
> @@ -1348,17 +1350,17 @@ test_mode4_expired(void)
>   			retval);
>   	}
>   
> -	/* After test only expected slave should be in EXPIRED state */
> -	FOR_EACH_SLAVE(i, slave) {
> -		if (slave == exp_slave)
> -			TEST_ASSERT(slave->lacp_parnter_state & STATE_EXPIRED,
> -				"Slave %u should be in expired.", slave->port_id);
> +	/* After test only expected member should be in EXPIRED state */
> +	FOR_EACH_MEMBER(i, member) {
> +		if (member == exp_member)
> +			TEST_ASSERT(member->lacp_parnter_state & STATE_EXPIRED,
> +				"Member %u should be in expired.", member->port_id);
>   		else
> -			TEST_ASSERT_EQUAL(bond_handshake_done(slave), 1,
> -				"Slave %u should be operational.", slave->port_id);
> +			TEST_ASSERT_EQUAL(bond_handshake_done(member), 1,
> +				"Member %u should be operational.", member->port_id);
>   	}
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -1372,17 +1374,17 @@ test_mode4_ext_ctrl(void)
>   	 *   . try to transmit lacpdu (should fail)
>   	 *   . try to set collecting and distributing flags (should fail)
>   	 * reconfigure w/external sm
> -	 *   . transmit one lacpdu on each slave using new api
> -	 *   . make sure each slave receives one lacpdu using the callback api
> -	 *   . transmit one data pdu on each slave (should fail)
> +	 *   . transmit one lacpdu on each member using new api
> +	 *   . make sure each member receives one lacpdu using the callback api
> +	 *   . transmit one data pdu on each member (should fail)
>   	 *   . enable distribution and collection, send one data pdu each again
>   	 */
>   
>   	int retval;
> -	struct slave_conf *slave = NULL;
> +	struct member_conf *member = NULL;
>   	uint8_t i;
>   
> -	struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT];
> +	struct rte_mbuf *lacp_tx_buf[MEMBER_COUNT];
>   	struct rte_ether_addr src_mac, dst_mac;
>   	struct lacpdu_header lacpdu = {
>   		.lacpdu = {
> @@ -1396,30 +1398,30 @@ test_mode4_ext_ctrl(void)
>   	initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac,
>   			      RTE_ETHER_TYPE_SLOW, 0, 0);
>   
> -	for (i = 0; i < SLAVE_COUNT; i++) {
> +	for (i = 0; i < MEMBER_COUNT; i++) {
>   		lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
>   		rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
>   			   &lacpdu, sizeof(lacpdu));
>   		rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
>   	}
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0);
> +	retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 0);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
> -	FOR_EACH_SLAVE(i, slave) {
> +	FOR_EACH_MEMBER(i, member) {
>   		TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_slowtx(
>   						test_params.bonded_port_id,
> -						slave->port_id, lacp_tx_buf[i]),
> -				 "Slave should not allow manual LACP xmit");
> +						member->port_id, lacp_tx_buf[i]),
> +				 "Member should not allow manual LACP xmit");
>   		TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_collect(
>   						test_params.bonded_port_id,
> -						slave->port_id, 1),
> -				 "Slave should not allow external state controls");
> +						member->port_id, 1),
> +				 "Member should not allow external state controls");
>   	}
>   
>   	free_pkts(lacp_tx_buf, RTE_DIM(lacp_tx_buf));
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Bonded device cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -1430,13 +1432,13 @@ static int
>   test_mode4_ext_lacp(void)
>   {
>   	int retval;
> -	struct slave_conf *slave = NULL;
> -	uint8_t all_slaves_done = 0, i;
> +	struct member_conf *member = NULL;
> +	uint8_t all_members_done = 0, i;
>   	uint16_t nb_pkts;
>   	const unsigned int delay = bond_get_update_timeout_ms();
>   
> -	struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT];
> -	struct rte_mbuf *buf[SLAVE_COUNT];
> +	struct rte_mbuf *lacp_tx_buf[MEMBER_COUNT];
> +	struct rte_mbuf *buf[MEMBER_COUNT];
>   	struct rte_ether_addr src_mac, dst_mac;
>   	struct lacpdu_header lacpdu = {
>   		.lacpdu = {
> @@ -1450,14 +1452,14 @@ test_mode4_ext_lacp(void)
>   	initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac,
>   			      RTE_ETHER_TYPE_SLOW, 0, 0);
>   
> -	for (i = 0; i < SLAVE_COUNT; i++) {
> +	for (i = 0; i < MEMBER_COUNT; i++) {
>   		lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
>   		rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *),
>   			   &lacpdu, sizeof(lacpdu));
>   		rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu);
>   	}
>   
> -	retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 1);
> +	retval = initialize_bonded_device_with_members(TEST_TX_MEMBER_COUNT, 1);
>   	TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device");
>   
>   	memset(lacpdu_rx_count, 0, sizeof(lacpdu_rx_count));
> @@ -1466,22 +1468,22 @@ test_mode4_ext_lacp(void)
>   	for (i = 0; i < 30; ++i)
>   		rte_delay_ms(delay);
>   
> -	FOR_EACH_SLAVE(i, slave) {
> +	FOR_EACH_MEMBER(i, member) {
>   		retval = rte_eth_bond_8023ad_ext_slowtx(
>   						test_params.bonded_port_id,
> -						slave->port_id, lacp_tx_buf[i]);
> +						member->port_id, lacp_tx_buf[i]);
>   		TEST_ASSERT_SUCCESS(retval,
> -				    "Slave should allow manual LACP xmit");
> +				    "Member should allow manual LACP xmit");
>   	}
>   
>   	nb_pkts = bond_tx(NULL, 0);
>   	TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets transmitted unexpectedly");
>   
> -	FOR_EACH_SLAVE(i, slave) {
> -		nb_pkts = slave_get_pkts(slave, buf, RTE_DIM(buf));
> -		TEST_ASSERT_EQUAL(nb_pkts, 1, "found %u packets on slave %d\n",
> +	FOR_EACH_MEMBER(i, member) {
> +		nb_pkts = member_get_pkts(member, buf, RTE_DIM(buf));
> +		TEST_ASSERT_EQUAL(nb_pkts, 1, "found %u packets on member %d\n",
>   				  nb_pkts, i);
> -		slave_put_pkts(slave, buf, nb_pkts);
> +		member_put_pkts(member, buf, nb_pkts);
>   	}
>   
>   	nb_pkts = bond_rx(buf, RTE_DIM(buf));
> @@ -1489,26 +1491,26 @@ test_mode4_ext_lacp(void)
>   	TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets received unexpectedly");
>   
>   	/* wait for the periodic callback to run */
> -	for (i = 0; i < 30 && all_slaves_done == 0; ++i) {
> +	for (i = 0; i < 30 && all_members_done == 0; ++i) {
>   		uint8_t s, total = 0;
>   
>   		rte_delay_ms(delay);
> -		FOR_EACH_SLAVE(s, slave) {
> -			total += lacpdu_rx_count[slave->port_id];
> +		FOR_EACH_MEMBER(s, member) {
> +			total += lacpdu_rx_count[member->port_id];
>   		}
>   
> -		if (total >= SLAVE_COUNT)
> -			all_slaves_done = 1;
> +		if (total >= MEMBER_COUNT)
> +			all_members_done = 1;
>   	}
>   
> -	FOR_EACH_SLAVE(i, slave) {
> -		TEST_ASSERT_EQUAL(lacpdu_rx_count[slave->port_id], 1,
> -				  "Slave port %u should have received 1 lacpdu (count=%u)",
> -				  slave->port_id,
> -				  lacpdu_rx_count[slave->port_id]);
> +	FOR_EACH_MEMBER(i, member) {
> +		TEST_ASSERT_EQUAL(lacpdu_rx_count[member->port_id], 1,
> +				  "Member port %u should have received 1 lacpdu (count=%u)",
> +				  member->port_id,
> +				  lacpdu_rx_count[member->port_id]);
>   	}
>   
> -	retval = remove_slaves_and_stop_bonded_device();
> +	retval = remove_members_and_stop_bonded_device();
>   	TEST_ASSERT_SUCCESS(retval, "Test cleanup failed.");
>   
>   	return TEST_SUCCESS;
> @@ -1517,10 +1519,10 @@ test_mode4_ext_lacp(void)
>   static int
>   check_environment(void)
>   {
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	uint8_t i, env_state;
> -	uint16_t slaves[RTE_DIM(test_params.slave_ports)];
> -	int slaves_count;
> +	uint16_t members[RTE_DIM(test_params.member_ports)];
> +	int members_count;
>   
>   	env_state = 0;
>   	FOR_EACH_PORT(i, port) {
> @@ -1540,20 +1542,20 @@ check_environment(void)
>   			break;
>   	}
>   
> -	slaves_count = rte_eth_bond_slaves_get(test_params.bonded_port_id,
> -			slaves, RTE_DIM(slaves));
> +	members_count = rte_eth_bond_members_get(test_params.bonded_port_id,
> +			members, RTE_DIM(members));
>   
> -	if (slaves_count != 0)
> +	if (members_count != 0)
>   		env_state |= 0x10;
>   
>   	TEST_ASSERT_EQUAL(env_state, 0,
>   		"Environment not clean (port %u):%s%s%s%s%s",
>   		port->port_id,
> -		env_state & 0x01 ? " slave rx queue not clean" : "",
> -		env_state & 0x02 ? " slave tx queue not clean" : "",
> -		env_state & 0x04 ? " port marked as enslaved" : "",
> -		env_state & 0x80 ? " slave state is not reset" : "",
> -		env_state & 0x10 ? " slave count not equal 0" : ".");
> +		env_state & 0x01 ? " member rx queue not clean" : "",
> +		env_state & 0x02 ? " member tx queue not clean" : "",
> +		env_state & 0x04 ? " port marked as enmemberd" : "",
> +		env_state & 0x80 ? " member state is not reset" : "",
> +		env_state & 0x10 ? " member count not equal 0" : ".");
>   
>   
>   	return TEST_SUCCESS;
> @@ -1562,7 +1564,7 @@ check_environment(void)
>   static int
>   test_mode4_executor(int (*test_func)(void))
>   {
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	int test_result;
>   	uint8_t i;
>   	void *pkt;
> @@ -1581,7 +1583,7 @@ test_mode4_executor(int (*test_func)(void))
>   
>   	/* Reset environment in case test failed to do that. */
>   	if (test_result != TEST_SUCCESS) {
> -		TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),
> +		TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(),
>   			"Failed to stop bonded device");
>   
>   		FOR_EACH_PORT(i, port) {
> diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
> index 464fb2dbd0..1f888b4771 100644
> --- a/app/test/test_link_bonding_rssconf.c
> +++ b/app/test/test_link_bonding_rssconf.c
> @@ -27,15 +27,15 @@
>   
>   #include "test.h"
>   
> -#define SLAVE_COUNT (4)
> +#define MEMBER_COUNT (4)
>   
>   #define RXTX_RING_SIZE			1024
>   #define RXTX_QUEUE_COUNT		4
>   
>   #define BONDED_DEV_NAME         ("net_bonding_rss")
>   
> -#define SLAVE_DEV_NAME_FMT      ("net_null%d")
> -#define SLAVE_RXTX_QUEUE_FMT      ("rssconf_slave%d_q%d")
> +#define MEMBER_DEV_NAME_FMT      ("net_null%d")
> +#define MEMBER_RXTX_QUEUE_FMT      ("rssconf_member%d_q%d")
>   
>   #define NUM_MBUFS 8191
>   #define MBUF_SIZE (1600 + RTE_PKTMBUF_HEADROOM)
> @@ -46,7 +46,7 @@
>   #define INVALID_PORT_ID         (0xFF)
>   #define INVALID_BONDING_MODE    (-1)
>   
> -struct slave_conf {
> +struct member_conf {
>   	uint16_t port_id;
>   	struct rte_eth_dev_info dev_info;
>   
> @@ -54,7 +54,7 @@ struct slave_conf {
>   	uint8_t rss_key[40];
>   	struct rte_eth_rss_reta_entry64 reta_conf[512 / RTE_ETH_RETA_GROUP_SIZE];
>   
> -	uint8_t is_slave;
> +	uint8_t is_member;
>   	struct rte_ring *rxtx_queue[RXTX_QUEUE_COUNT];
>   };
>   
> @@ -62,15 +62,15 @@ struct link_bonding_rssconf_unittest_params {
>   	uint8_t bond_port_id;
>   	struct rte_eth_dev_info bond_dev_info;
>   	struct rte_eth_rss_reta_entry64 bond_reta_conf[512 / RTE_ETH_RETA_GROUP_SIZE];
> -	struct slave_conf slave_ports[SLAVE_COUNT];
> +	struct member_conf member_ports[MEMBER_COUNT];
>   
>   	struct rte_mempool *mbuf_pool;
>   };
>   
>   static struct link_bonding_rssconf_unittest_params test_params  = {
>   	.bond_port_id = INVALID_PORT_ID,
> -	.slave_ports = {
> -		[0 ... SLAVE_COUNT - 1] = { .port_id = INVALID_PORT_ID, .is_slave = 0}
> +	.member_ports = {
> +		[0 ... MEMBER_COUNT - 1] = { .port_id = INVALID_PORT_ID, .is_member = 0}
>   	},
>   	.mbuf_pool = NULL,
>   };
> @@ -107,14 +107,14 @@ static struct rte_eth_conf rss_pmd_conf = {
>   #define FOR_EACH(_i, _item, _array, _size) \
>   	for (_i = 0, _item = &_array[0]; _i < _size && (_item = &_array[_i]); _i++)
>   
> -/* Macro for iterating over every port that can be used as a slave
> +/* Macro for iterating over every port that can be used as a member
>    * in this test.
> - * _i variable used as an index in test_params->slave_ports
> - * _slave pointer to &test_params->slave_ports[_idx]
> + * _i variable used as an index in test_params->member_ports
> + * _member pointer to &test_params->member_ports[_idx]
>    */
>   #define FOR_EACH_PORT(_i, _port) \
> -	FOR_EACH(_i, _port, test_params.slave_ports, \
> -		RTE_DIM(test_params.slave_ports))
> +	FOR_EACH(_i, _port, test_params.member_ports, \
> +		RTE_DIM(test_params.member_ports))
>   
>   static int
>   configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf,
> @@ -151,21 +151,21 @@ configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf,
>   }
>   
>   /**
> - * Remove all slaves from bonding
> + * Remove all members from bonding
>    */
>   static int
> -remove_slaves(void)
> +remove_members(void)
>   {
>   	unsigned n;
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   
>   	FOR_EACH_PORT(n, port) {
> -		port = &test_params.slave_ports[n];
> -		if (port->is_slave) {
> -			TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(
> +		port = &test_params.member_ports[n];
> +		if (port->is_member) {
> +			TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(
>   					test_params.bond_port_id, port->port_id),
> -					"Cannot remove slave %d from bonding", port->port_id);
> -			port->is_slave = 0;
> +					"Cannot remove member %d from bonding", port->port_id);
> +			port->is_member = 0;
>   		}
>   	}
>   
> @@ -173,30 +173,30 @@ remove_slaves(void)
>   }
>   
>   static int
> -remove_slaves_and_stop_bonded_device(void)
> +remove_members_and_stop_bonded_device(void)
>   {
> -	TEST_ASSERT_SUCCESS(remove_slaves(), "Removing slaves");
> +	TEST_ASSERT_SUCCESS(remove_members(), "Removing members");
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bond_port_id),
>   			"Failed to stop port %u", test_params.bond_port_id);
>   	return TEST_SUCCESS;
>   }
>   
>   /**
> - * Add all slaves to bonding
> + * Add all members to bonding
>    */
>   static int
> -bond_slaves(void)
> +bond_members(void)
>   {
>   	unsigned n;
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   
>   	FOR_EACH_PORT(n, port) {
> -		port = &test_params.slave_ports[n];
> -		if (!port->is_slave) {
> -			TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bond_port_id,
> -					port->port_id), "Cannot attach slave %d to the bonding",
> +		port = &test_params.member_ports[n];
> +		if (!port->is_member) {
> +			TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params.bond_port_id,
> +					port->port_id), "Cannot attach member %d to the bonding",
>   					port->port_id);
> -			port->is_slave = 1;
> +			port->is_member = 1;
>   		}
>   	}
>   
> @@ -223,11 +223,11 @@ reta_set(uint16_t port_id, uint8_t value, int reta_size)
>   }
>   
>   /**
> - * Check if slaves RETA is synchronized with bonding port. Returns 1 if slave
> + * Check if members RETA is synchronized with bonding port. Returns 1 if member
>    * port is synced with bonding port.
>    */
>   static int
> -reta_check_synced(struct slave_conf *port)
> +reta_check_synced(struct member_conf *port)
>   {
>   	unsigned i;
>   
> @@ -264,10 +264,10 @@ bond_reta_fetch(void) {
>   }
>   
>   /**
> - * Fetch slaves RETA
> + * Fetch members RETA
>    */
>   static int
> -slave_reta_fetch(struct slave_conf *port) {
> +member_reta_fetch(struct member_conf *port) {
>   	unsigned j;
>   
>   	for (j = 0; j < port->dev_info.reta_size / RTE_ETH_RETA_GROUP_SIZE; j++)
> @@ -280,49 +280,49 @@ slave_reta_fetch(struct slave_conf *port) {
>   }
>   
>   /**
> - * Remove and add slave to check if slaves configuration is synced with
> - * the bonding ports values after adding new slave.
> + * Remove and add member to check if members configuration is synced with
> + * the bonding ports values after adding new member.
>    */
>   static int
> -slave_remove_and_add(void)
> +member_remove_and_add(void)
>   {
> -	struct slave_conf *port = &(test_params.slave_ports[0]);
> +	struct member_conf *port = &(test_params.member_ports[0]);
>   
> -	/* 1. Remove first slave from bonding */
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params.bond_port_id,
> -			port->port_id), "Cannot remove slave #d from bonding");
> +	/* 1. Remove first member from bonding */
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_remove(test_params.bond_port_id,
> +			port->port_id), "Cannot remove member #d from bonding");
>   
> -	/* 2. Change removed (ex-)slave and bonding configuration to different
> +	/* 2. Change removed (ex-)member and bonding configuration to different
>   	 *    values
>   	 */
>   	reta_set(test_params.bond_port_id, 1, test_params.bond_dev_info.reta_size);
>   	bond_reta_fetch();
>   
>   	reta_set(port->port_id, 2, port->dev_info.reta_size);
> -	slave_reta_fetch(port);
> +	member_reta_fetch(port);
>   
>   	TEST_ASSERT(reta_check_synced(port) == 0,
> -			"Removed slave didn't should be synchronized with bonding port");
> +			"Removed member didn't should be synchronized with bonding port");
>   
> -	/* 3. Add (ex-)slave and check if configuration changed*/
> -	TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bond_port_id,
> -			port->port_id), "Cannot add slave");
> +	/* 3. Add (ex-)member and check if configuration changed*/
> +	TEST_ASSERT_SUCCESS(rte_eth_bond_member_add(test_params.bond_port_id,
> +			port->port_id), "Cannot add member");
>   
>   	bond_reta_fetch();
> -	slave_reta_fetch(port);
> +	member_reta_fetch(port);
>   
>   	return reta_check_synced(port);
>   }
>   
>   /**
> - * Test configuration propagation over slaves.
> + * Test configuration propagation over members.
>    */
>   static int
>   test_propagate(void)
>   {
>   	unsigned i;
>   	uint8_t n;
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	uint8_t bond_rss_key[40];
>   	struct rte_eth_rss_conf bond_rss_conf;
>   
> @@ -349,18 +349,18 @@ test_propagate(void)
>   
>   			retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id,
>   					&bond_rss_conf);
> -			TEST_ASSERT_SUCCESS(retval, "Cannot set slaves hash function");
> +			TEST_ASSERT_SUCCESS(retval, "Cannot set members hash function");
>   
>   			FOR_EACH_PORT(n, port) {
> -				port = &test_params.slave_ports[n];
> +				port = &test_params.member_ports[n];
>   
>   				retval = rte_eth_dev_rss_hash_conf_get(port->port_id,
>   						&port->rss_conf);
>   				TEST_ASSERT_SUCCESS(retval,
> -						"Cannot take slaves RSS configuration");
> +						"Cannot take members RSS configuration");
>   
>   				TEST_ASSERT(port->rss_conf.rss_hf == rss_hf,
> -						"Hash function not propagated for slave %d",
> +						"Hash function not propagated for member %d",
>   						port->port_id);
>   			}
>   
> @@ -376,11 +376,11 @@ test_propagate(void)
>   
>   		/* Set all keys to zero */
>   		FOR_EACH_PORT(n, port) {
> -			port = &test_params.slave_ports[n];
> +			port = &test_params.member_ports[n];
>   			memset(port->rss_conf.rss_key, 0, 40);
>   			retval = rte_eth_dev_rss_hash_update(port->port_id,
>   					&port->rss_conf);
> -			TEST_ASSERT_SUCCESS(retval, "Cannot set slaves RSS keys");
> +			TEST_ASSERT_SUCCESS(retval, "Cannot set members RSS keys");
>   		}
>   
>   		memset(bond_rss_key, i, sizeof(bond_rss_key));
> @@ -393,18 +393,18 @@ test_propagate(void)
>   		TEST_ASSERT_SUCCESS(retval, "Cannot set bonded port RSS keys");
>   
>   		FOR_EACH_PORT(n, port) {
> -			port = &test_params.slave_ports[n];
> +			port = &test_params.member_ports[n];
>   
>   			retval = rte_eth_dev_rss_hash_conf_get(port->port_id,
>   					&(port->rss_conf));
>   
>   			TEST_ASSERT_SUCCESS(retval,
> -					"Cannot take slaves RSS configuration");
> +					"Cannot take members RSS configuration");
>   
>   			/* compare keys */
>   			retval = memcmp(port->rss_conf.rss_key, bond_rss_key,
>   					sizeof(bond_rss_key));
> -			TEST_ASSERT(retval == 0, "Key value not propagated for slave %d",
> +			TEST_ASSERT(retval == 0, "Key value not propagated for member %d",
>   					port->port_id);
>   		}
>   	}
> @@ -416,10 +416,10 @@ test_propagate(void)
>   
>   		/* Set all keys to zero */
>   		FOR_EACH_PORT(n, port) {
> -			port = &test_params.slave_ports[n];
> +			port = &test_params.member_ports[n];
>   			retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT,
>   					port->dev_info.reta_size);
> -			TEST_ASSERT_SUCCESS(retval, "Cannot set slaves RETA");
> +			TEST_ASSERT_SUCCESS(retval, "Cannot set members RETA");
>   		}
>   
>   		TEST_ASSERT_SUCCESS(reta_set(test_params.bond_port_id,
> @@ -429,9 +429,9 @@ test_propagate(void)
>   		bond_reta_fetch();
>   
>   		FOR_EACH_PORT(n, port) {
> -			port = &test_params.slave_ports[n];
> +			port = &test_params.member_ports[n];
>   
> -			slave_reta_fetch(port);
> +			member_reta_fetch(port);
>   			TEST_ASSERT(reta_check_synced(port) == 1, "RETAs inconsistent");
>   		}
>   	}
> @@ -459,29 +459,29 @@ test_rss(void)
>   			"Error during getting device (port %u) info: %s\n",
>   			test_params.bond_port_id, strerror(-ret));
>   
> -	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
> +	TEST_ASSERT_SUCCESS(bond_members(), "Bonding members failed");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id),
>   			"Failed to start bonding port (%d).", test_params.bond_port_id);
>   
>   	TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed");
>   
> -	TEST_ASSERT(slave_remove_and_add() == 1, "remove and add slaves success.");
> +	TEST_ASSERT(member_remove_and_add() == 1, "remove and add members success.");
>   
> -	remove_slaves_and_stop_bonded_device();
> +	remove_members_and_stop_bonded_device();
>   
>   	return TEST_SUCCESS;
>   }
>   
>   
>   /**
> - * Test RSS configuration over bonded and slaves.
> + * Test RSS configuration over bonded and members.
>    */
>   static int
>   test_rss_config_lazy(void)
>   {
>   	struct rte_eth_rss_conf bond_rss_conf = {0};
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	uint8_t rss_key[40];
>   	uint64_t rss_hf;
>   	int retval;
> @@ -502,18 +502,18 @@ test_rss_config_lazy(void)
>   		TEST_ASSERT(retval != 0, "Succeeded in setting bonded port hash function");
>   	}
>   
> -	/* Set all keys to zero for all slaves */
> +	/* Set all keys to zero for all members */
>   	FOR_EACH_PORT(n, port) {
> -		port = &test_params.slave_ports[n];
> +		port = &test_params.member_ports[n];
>   		retval = rte_eth_dev_rss_hash_conf_get(port->port_id,
>   						       &port->rss_conf);
> -		TEST_ASSERT_SUCCESS(retval, "Cannot get slaves RSS configuration");
> +		TEST_ASSERT_SUCCESS(retval, "Cannot get members RSS configuration");
>   		memset(port->rss_key, 0, sizeof(port->rss_key));
>   		port->rss_conf.rss_key = port->rss_key;
>   		port->rss_conf.rss_key_len = sizeof(port->rss_key);
>   		retval = rte_eth_dev_rss_hash_update(port->port_id,
>   						     &port->rss_conf);
> -		TEST_ASSERT(retval != 0, "Succeeded in setting slaves RSS keys");
> +		TEST_ASSERT(retval != 0, "Succeeded in setting members RSS keys");
>   	}
>   
>   	/* Set RSS keys for bonded port */
> @@ -529,10 +529,10 @@ test_rss_config_lazy(void)
>   	/*  Test RETA propagation */
>   	for (i = 0; i < RXTX_QUEUE_COUNT; i++) {
>   		FOR_EACH_PORT(n, port) {
> -			port = &test_params.slave_ports[n];
> +			port = &test_params.member_ports[n];
>   			retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT,
>   					  port->dev_info.reta_size);
> -			TEST_ASSERT(retval != 0, "Succeeded in setting slaves RETA");
> +			TEST_ASSERT(retval != 0, "Succeeded in setting members RETA");
>   		}
>   
>   		retval = reta_set(test_params.bond_port_id, i % RXTX_QUEUE_COUNT,
> @@ -560,14 +560,14 @@ test_rss_lazy(void)
>   			"Error during getting device (port %u) info: %s\n",
>   			test_params.bond_port_id, strerror(-ret));
>   
> -	TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed");
> +	TEST_ASSERT_SUCCESS(bond_members(), "Bonding members failed");
>   
>   	TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id),
>   			"Failed to start bonding port (%d).", test_params.bond_port_id);
>   
>   	TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS hash when RX_RSS mq_mode is turned off");
>   
> -	remove_slaves_and_stop_bonded_device();
> +	remove_members_and_stop_bonded_device();
>   
>   	return TEST_SUCCESS;
>   }
> @@ -579,13 +579,13 @@ test_setup(void)
>   	int retval;
>   	int port_id;
>   	char name[256];
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	struct rte_ether_addr mac_addr = { .addr_bytes = {0} };
>   
>   	if (test_params.mbuf_pool == NULL) {
>   
>   		test_params.mbuf_pool = rte_pktmbuf_pool_create(
> -			"RSS_MBUF_POOL", NUM_MBUFS * SLAVE_COUNT,
> +			"RSS_MBUF_POOL", NUM_MBUFS * MEMBER_COUNT,
>   			MBUF_CACHE_SIZE, 0, MBUF_SIZE, rte_socket_id());
>   
>   		TEST_ASSERT(test_params.mbuf_pool != NULL,
> @@ -594,10 +594,10 @@ test_setup(void)
>   
>   	/* Create / initialize ring eth devs. */
>   	FOR_EACH_PORT(n, port) {
> -		port = &test_params.slave_ports[n];
> +		port = &test_params.member_ports[n];
>   
>   		port_id = rte_eth_dev_count_avail();
> -		snprintf(name, sizeof(name), SLAVE_DEV_NAME_FMT, port_id);
> +		snprintf(name, sizeof(name), MEMBER_DEV_NAME_FMT, port_id);
>   
>   		retval = rte_vdev_init(name, "size=64,copy=0");
>   		TEST_ASSERT_SUCCESS(retval, "Failed to create null device '%s'\n",
> @@ -647,7 +647,7 @@ test_setup(void)
>   static void
>   testsuite_teardown(void)
>   {
> -	struct slave_conf *port;
> +	struct member_conf *port;
>   	uint8_t i;
>   
>   	/* Only stop ports.
> @@ -685,7 +685,7 @@ test_rssconf_executor(int (*test_func)(void))
>   
>   	/* Reset environment in case test failed to do that. */
>   	if (test_result != TEST_SUCCESS) {
> -		TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(),
> +		TEST_ASSERT_SUCCESS(remove_members_and_stop_bonded_device(),
>   			"Failed to stop bonded device");
>   	}
>   
> diff --git a/doc/guides/howto/lm_bond_virtio_sriov.rst b/doc/guides/howto/lm_bond_virtio_sriov.rst
> index e854ae214e..c06d1bc43c 100644
> --- a/doc/guides/howto/lm_bond_virtio_sriov.rst
> +++ b/doc/guides/howto/lm_bond_virtio_sriov.rst
> @@ -17,8 +17,8 @@ Test Setup
>   ----------
>   
>   A bonded device is created in the VM.
> -The virtio and VF PMD's are added as slaves to the bonded device.
> -The VF is set as the primary slave of the bonded device.
> +The virtio and VF PMD's are added as members to the bonded device.
> +The VF is set as the primary member of the bonded device.
>   
>   A bridge must be set up on the Host connecting the tap device, which is the
>   backend of the Virtio device and the Physical Function (PF) device.
> @@ -116,13 +116,13 @@ Bonding is port 2 (P2).
>   
>      testpmd> create bonded device 1 0
>      Created new bonded device net_bond_testpmd_0 on (port 2).
> -   testpmd> add bonding slave 0 2
> -   testpmd> add bonding slave 1 2
> +   testpmd> add bonding member 0 2
> +   testpmd> add bonding member 1 2
>      testpmd> show bonding config 2
>   
>   The syntax of the ``testpmd`` command is:
>   
> -set bonding primary (slave id) (port id)
> +set bonding primary (member id) (port id)
>   
>   Set primary to P1 before starting bonding port.
>   
> @@ -139,7 +139,7 @@ Set primary to P1 before starting bonding port.
>   
>      testpmd> show bonding config 2
>   
> -Primary is now P1. There are 2 active slaves.
> +Primary is now P1. There are 2 active members.
>   
>   Use P2 only for forwarding.
>   
> @@ -151,7 +151,7 @@ Use P2 only for forwarding.
>      testpmd> start
>      testpmd> show bonding config 2
>   
> -Primary is now P1. There are 2 active slaves.
> +Primary is now P1. There are 2 active members.
>   
>   .. code-block:: console
>   
> @@ -163,10 +163,10 @@ VF traffic is seen at P1 and P2.
>   
>      testpmd> clear port stats all
>      testpmd> set bonding primary 0 2
> -   testpmd> remove bonding slave 1 2
> +   testpmd> remove bonding member 1 2
>      testpmd> show bonding config 2
>   
> -Primary is now P0. There is 1 active slave.
> +Primary is now P0. There is 1 active member.
>   
>   .. code-block:: console
>   
> @@ -210,7 +210,7 @@ On host_server_1: Terminal 1
>   
>      testpmd> show bonding config 2
>   
> -Primary is now P0. There is 1 active slave.
> +Primary is now P0. There is 1 active member.
>   
>   .. code-block:: console
>   
> @@ -346,7 +346,7 @@ The ``mac_addr`` command only works with the Kernel PF for Niantic.
>      testpmd> show port stats all.
>      testpmd> show config fwd
>      testpmd> show bonding config 2
> -   testpmd> add bonding slave 1 2
> +   testpmd> add bonding member 1 2
>      testpmd> set bonding primary 1 2
>      testpmd> show bonding config 2
>      testpmd> show port stats all
> @@ -355,7 +355,7 @@ VF traffic is seen at P1 (VF) and P2 (Bonded device).
>   
>   .. code-block:: console
>   
> -   testpmd> remove bonding slave 0 2
> +   testpmd> remove bonding member 0 2
>      testpmd> show bonding config 2
>      testpmd> port stop 0
>      testpmd> port close 0
> diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst
> index 70242ab2ce..6db880d632 100644
> --- a/doc/guides/nics/bnxt.rst
> +++ b/doc/guides/nics/bnxt.rst
> @@ -781,8 +781,8 @@ DPDK implements a light-weight library to allow PMDs to be bonded together and p
>   
>   .. code-block:: console
>   
> -    dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=0,slave=<PCI B:D.F device 1>,slave=<PCI B:D.F device 2>,mac=XX:XX:XX:XX:XX:XX’ – --socket_num=1 – -i --port-topology=chained
> -    (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=0,slave=0000:82:00.0,slave=0000:82:00.1,mac=00:1e:67:1d:fd:1d' – --socket-num=1 – -i --port-topology=chained
> +    dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=0,member=<PCI B:D.F device 1>,member=<PCI B:D.F device 2>,mac=XX:XX:XX:XX:XX:XX’ – --socket_num=1 – -i --port-topology=chained
> +    (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=0,member=0000:82:00.0,member=0000:82:00.1,mac=00:1e:67:1d:fd:1d' – --socket-num=1 – -i --port-topology=chained
>   
>   Vector Processing
>   -----------------
> diff --git a/doc/guides/prog_guide/img/bond-mode-1.svg b/doc/guides/prog_guide/img/bond-mode-1.svg
> index 7c81b856b7..5a9271facf 100644
> --- a/doc/guides/prog_guide/img/bond-mode-1.svg
> +++ b/doc/guides/prog_guide/img/bond-mode-1.svg
> @@ -53,7 +53,7 @@
>        v:langID="1033"
>        v:metric="true"
>        v:viewMarkup="false"><v:userDefs><v:ud
> -         v:nameU="msvSubprocessMaster"
> +         v:nameU="msvSubprocessMain"
>            v:prompt=""
>            v:val="VT4(Rectangle)" /><v:ud
>            v:nameU="msvNoAutoConnect"
> diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> index 1f66154e35..58e5ef41da 100644
> --- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> +++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst
> @@ -16,14 +16,14 @@ allows physical PMDs to be bonded together to create a single logical PMD.
>   The Link Bonding PMD library(librte_net_bond) supports bonding of groups of
>   ``rte_eth_dev`` ports of the same speed and duplex to provide similar
>   capabilities to that found in Linux bonding driver to allow the aggregation
> -of multiple (slave) NICs into a single logical interface between a server
> +of multiple (member) NICs into a single logical interface between a server
>   and a switch. The new bonded PMD will then process these interfaces based on
>   the mode of operation specified to provide support for features such as
>   redundant links, fault tolerance and/or load balancing.
>   
>   The librte_net_bond library exports a C API which provides an API for the
>   creation of bonded devices as well as the configuration and management of the
> -bonded device and its slave devices.
> +bonded device and its member devices.
>   
>   .. note::
>   
> @@ -45,7 +45,7 @@ Currently the Link Bonding PMD library supports following modes of operation:
>   
>   
>       This mode provides load balancing and fault tolerance by transmission of
> -    packets in sequential order from the first available slave device through
> +    packets in sequential order from the first available member device through
>       the last. Packets are bulk dequeued from devices then serviced in a
>       round-robin manner. This mode does not guarantee in order reception of
>       packets and down stream should be able to handle out of order packets.
> @@ -57,9 +57,9 @@ Currently the Link Bonding PMD library supports following modes of operation:
>      Active Backup (Mode 1)
>   
>   
> -    In this mode only one slave in the bond is active at any time, a different
> -    slave becomes active if, and only if, the primary active slave fails,
> -    thereby providing fault tolerance to slave failure. The single logical
> +    In this mode only one member in the bond is active at any time, a different
> +    member becomes active if, and only if, the primary active member fails,
> +    thereby providing fault tolerance to member failure. The single logical
>       bonded interface's MAC address is externally visible on only one NIC (port)
>       to avoid confusing the network switch.
>   
> @@ -73,10 +73,10 @@ Currently the Link Bonding PMD library supports following modes of operation:
>       This mode provides transmit load balancing (based on the selected
>       transmission policy) and fault tolerance. The default policy (layer2) uses
>       a simple calculation based on the packet flow source and destination MAC
> -    addresses as well as the number of active slaves available to the bonded
> -    device to classify the packet to a specific slave to transmit on. Alternate
> +    addresses as well as the number of active members available to the bonded
> +    device to classify the packet to a specific member to transmit on. Alternate
>       transmission policies supported are layer 2+3, this takes the IP source and
> -    destination addresses into the calculation of the transmit slave port and
> +    destination addresses into the calculation of the transmit member port and
>       the final supported policy is layer 3+4, this uses IP source and
>       destination addresses as well as the TCP/UDP source and destination port.
>   
> @@ -92,7 +92,7 @@ Currently the Link Bonding PMD library supports following modes of operation:
>      Broadcast (Mode 3)
>   
>   
> -    This mode provides fault tolerance by transmission of packets on all slave
> +    This mode provides fault tolerance by transmission of packets on all member
>       ports.
>   
>   *   **Link Aggregation 802.3AD (Mode 4):**
> @@ -114,7 +114,7 @@ Currently the Link Bonding PMD library supports following modes of operation:
>          intervals period of less than 100ms.
>   
>       #. Calls to ``rte_eth_tx_burst`` must have a buffer size of at least 2xN,
> -       where N is the number of slaves. This is a space required for LACP
> +       where N is the number of members. This is a space required for LACP
>          frames. Additionally LACP packets are included in the statistics, but
>          they are not returned to the application.
>   
> @@ -126,7 +126,7 @@ Currently the Link Bonding PMD library supports following modes of operation:
>   
>   
>       This mode provides an adaptive transmit load balancing. It dynamically
> -    changes the transmitting slave, according to the computed load. Statistics
> +    changes the transmitting member, according to the computed load. Statistics
>       are collected in 100ms intervals and scheduled every 10ms.
>   
>   
> @@ -140,74 +140,74 @@ The Link Bonding Library supports the creation of bonded devices at application
>   startup time during EAL initialization using the ``--vdev`` option as well as
>   programmatically via the C API ``rte_eth_bond_create`` function.
>   
> -Bonded devices support the dynamical addition and removal of slave devices using
> -the ``rte_eth_bond_slave_add`` / ``rte_eth_bond_slave_remove`` APIs.
> +Bonded devices support the dynamical addition and removal of member devices using
> +the ``rte_eth_bond_member_add`` / ``rte_eth_bond_member_remove`` APIs.
>   
> -After a slave device is added to a bonded device slave is stopped using
> +After a member device is added to a bonded device member is stopped using
>   ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure``
>   the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` /
>   ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding
>   device. If RSS is enabled for bonding device, this mode is also enabled on new
> -slave and configured as well.
> +member and configured as well.
>   Any flow which was configured to the bond device also is configured to the added
> -slave.
> +member.
>   
>   Setting up multi-queue mode for bonding device to RSS, makes it fully
> -RSS-capable, so all slaves are synchronized with its configuration. This mode is
> -intended to provide RSS configuration on slaves transparent for client
> +RSS-capable, so all members are synchronized with its configuration. This mode is
> +intended to provide RSS configuration on members transparent for client
>   application implementation.
>   
>   Bonding device stores its own version of RSS settings i.e. RETA, RSS hash
> -function and RSS key, used to set up its slaves. That let to define the meaning
> +function and RSS key, used to set up its members. That let to define the meaning
>   of RSS configuration of bonding device as desired configuration of whole bonding
> -(as one unit), without pointing any of slave inside. It is required to ensure
> +(as one unit), without pointing any of member inside. It is required to ensure
>   consistency and made it more error-proof.
>   
>   RSS hash function set for bonding device, is a maximal set of RSS hash functions
> -supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so
> -it can be easily used as a pattern providing expected behavior, even if slave
> +supported by all bonded members. RETA size is a GCD of all its RETA's sizes, so
> +it can be easily used as a pattern providing expected behavior, even if member
>   RETAs' sizes are different. If RSS Key is not set for bonded device, it's not
> -changed on the slaves and default key for device is used.
> +changed on the members and default key for device is used.
>   
> -As RSS configurations, there is flow consistency in the bonded slaves for the
> +As RSS configurations, there is flow consistency in the bonded members for the
>   next rte flow operations:
>   
>   Validate:
> -	- Validate flow for each slave, failure at least for one slave causes to
> +	- Validate flow for each member, failure at least for one member causes to
>   	  bond validation failure.
>   
>   Create:
> -	- Create the flow in all slaves.
> -	- Save all the slaves created flows objects in bonding internal flow
> +	- Create the flow in all members.
> +	- Save all the members created flows objects in bonding internal flow
>   	  structure.
> -	- Failure in flow creation for existed slave rejects the flow.
> -	- Failure in flow creation for new slaves in slave adding time rejects
> -	  the slave.
> +	- Failure in flow creation for existed member rejects the flow.
> +	- Failure in flow creation for new members in member adding time rejects
> +	  the member.
>   
>   Destroy:
> -	- Destroy the flow in all slaves and release the bond internal flow
> +	- Destroy the flow in all members and release the bond internal flow
>   	  memory.
>   
>   Flush:
> -	- Destroy all the bonding PMD flows in all the slaves.
> +	- Destroy all the bonding PMD flows in all the members.
>   
>   .. note::
>   
> -    Don't call slaves flush directly, It destroys all the slave flows which
> +    Don't call members flush directly, It destroys all the member flows which
>       may include external flows or the bond internal LACP flow.
>   
>   Query:
> -	- Summarize flow counters from all the slaves, relevant only for
> +	- Summarize flow counters from all the members, relevant only for
>   	  ``RTE_FLOW_ACTION_TYPE_COUNT``.
>   
>   Isolate:
> -	- Call to flow isolate for all slaves.
> -	- Failure in flow isolation for existed slave rejects the isolate mode.
> -	- Failure in flow isolation for new slaves in slave adding time rejects
> -	  the slave.
> +	- Call to flow isolate for all members.
> +	- Failure in flow isolation for existed member rejects the isolate mode.
> +	- Failure in flow isolation for new members in member adding time rejects
> +	  the member.
>   
>   All settings are managed through the bonding port API and always are propagated
> -in one direction (from bonding to slaves).
> +in one direction (from bonding to members).
>   
>   Link Status Change Interrupts / Polling
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> @@ -215,16 +215,16 @@ Link Status Change Interrupts / Polling
>   Link bonding devices support the registration of a link status change callback,
>   using the ``rte_eth_dev_callback_register`` API, this will be called when the
>   status of the bonding device changes. For example in the case of a bonding
> -device which has 3 slaves, the link status will change to up when one slave
> -becomes active or change to down when all slaves become inactive. There is no
> -callback notification when a single slave changes state and the previous
> -conditions are not met. If a user wishes to monitor individual slaves then they
> -must register callbacks with that slave directly.
> +device which has 3 members, the link status will change to up when one member
> +becomes active or change to down when all members become inactive. There is no
> +callback notification when a single member changes state and the previous
> +conditions are not met. If a user wishes to monitor individual members then they
> +must register callbacks with that member directly.
>   
>   The link bonding library also supports devices which do not implement link
>   status change interrupts, this is achieved by polling the devices link status at
>   a defined period which is set using the ``rte_eth_bond_link_monitoring_set``
> -API, the default polling interval is 10ms. When a device is added as a slave to
> +API, the default polling interval is 10ms. When a device is added as a member to
>   a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag
>   whether the device supports interrupts or whether the link status should be
>   monitored by polling it.
> @@ -233,30 +233,30 @@ Requirements / Limitations
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~
>   
>   The current implementation only supports devices that support the same speed
> -and duplex to be added as a slaves to the same bonded device. The bonded device
> -inherits these attributes from the first active slave added to the bonded
> -device and then all further slaves added to the bonded device must support
> +and duplex to be added as a members to the same bonded device. The bonded device
> +inherits these attributes from the first active member added to the bonded
> +device and then all further members added to the bonded device must support
>   these parameters.
>   
> -A bonding device must have a minimum of one slave before the bonding device
> +A bonding device must have a minimum of one member before the bonding device
>   itself can be started.
>   
>   To use a bonding device dynamic RSS configuration feature effectively, it is
> -also required, that all slaves should be RSS-capable and support, at least one
> +also required, that all members should be RSS-capable and support, at least one
>   common hash function available for each of them. Changing RSS key is only
> -possible, when all slave devices support the same key size.
> +possible, when all member devices support the same key size.
>   
> -To prevent inconsistency on how slaves process packets, once a device is added
> +To prevent inconsistency on how members process packets, once a device is added
>   to a bonding device, RSS and rte flow configurations should be managed through
> -the bonding device API, and not directly on the slave.
> +the bonding device API, and not directly on the member.
>   
>   Like all other PMD, all functions exported by a PMD are lock-free functions
>   that are assumed not to be invoked in parallel on different logical cores to
>   work on the same target object.
>   
>   It should also be noted that the PMD receive function should not be invoked
> -directly on a slave devices after they have been to a bonded device since
> -packets read directly from the slave device will no longer be available to the
> +directly on a member devices after they have been to a bonded device since
> +packets read directly from the member device will no longer be available to the
>   bonded device to read.
>   
>   Configuration
> @@ -265,25 +265,25 @@ Configuration
>   Link bonding devices are created using the ``rte_eth_bond_create`` API
>   which requires a unique device name, the bonding mode,
>   and the socket Id to allocate the bonding device's resources on.
> -The other configurable parameters for a bonded device are its slave devices,
> -its primary slave, a user defined MAC address and transmission policy to use if
> +The other configurable parameters for a bonded device are its member devices,
> +its primary member, a user defined MAC address and transmission policy to use if
>   the device is in balance XOR mode.
>   
> -Slave Devices
> -^^^^^^^^^^^^^
> +Member Devices
> +^^^^^^^^^^^^^^
>   
> -Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` slave devices
> -of the same speed and duplex. Ethernet devices can be added as a slave to a
> -maximum of one bonded device. Slave devices are reconfigured with the
> +Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` member devices
> +of the same speed and duplex. Ethernet devices can be added as a member to a
> +maximum of one bonded device. Member devices are reconfigured with the
>   configuration of the bonded device on being added to a bonded device.
>   
> -The bonded also guarantees to return the MAC address of the slave device to its
> -original value of removal of a slave from it.
> +The bonded also guarantees to return the MAC address of the member device to its
> +original value of removal of a member from it.
>   
> -Primary Slave
> -^^^^^^^^^^^^^
> +Primary Member
> +^^^^^^^^^^^^^^
>   
> -The primary slave is used to define the default port to use when a bonded
> +The primary member is used to define the default port to use when a bonded
>   device is in active backup mode. A different port will only be used if, and
>   only if, the current primary port goes down. If the user does not specify a
>   primary port it will default to being the first port added to the bonded device.
> @@ -292,14 +292,14 @@ MAC Address
>   ^^^^^^^^^^^
>   
>   The bonded device can be configured with a user specified MAC address, this
> -address will be inherited by the some/all slave devices depending on the
> +address will be inherited by the some/all member devices depending on the
>   operating mode. If the device is in active backup mode then only the primary
> -device will have the user specified MAC, all other slaves will retain their
> -original MAC address. In mode 0, 2, 3, 4 all slaves devices are configure with
> +device will have the user specified MAC, all other members will retain their
> +original MAC address. In mode 0, 2, 3, 4 all members devices are configure with
>   the bonded devices MAC address.
>   
>   If a user defined MAC address is not defined then the bonded device will
> -default to using the primary slaves MAC address.
> +default to using the primary members MAC address.
>   
>   Balance XOR Transmit Policies
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> @@ -310,17 +310,17 @@ Balance XOR mode. Layer 2, Layer 2+3, Layer 3+4.
>   *   **Layer 2:**   Ethernet MAC address based balancing is the default
>       transmission policy for Balance XOR bonding mode. It uses a simple XOR
>       calculation on the source MAC address and destination MAC address of the
> -    packet and then calculate the modulus of this value to calculate the slave
> +    packet and then calculate the modulus of this value to calculate the member
>       device to transmit the packet on.
>   
>   *   **Layer 2 + 3:** Ethernet MAC address & IP Address based balancing uses a
>       combination of source/destination MAC addresses and the source/destination
> -    IP addresses of the data packet to decide which slave port the packet will
> +    IP addresses of the data packet to decide which member port the packet will
>       be transmitted on.
>   
>   *   **Layer 3 + 4:**  IP Address & UDP Port based  balancing uses a combination
>       of source/destination IP Address and the source/destination UDP ports of
> -    the packet of the data packet to decide which slave port the packet will be
> +    the packet of the data packet to decide which member port the packet will be
>       transmitted on.
>   
>   All these policies support 802.1Q VLAN Ethernet packets, as well as IPv4, IPv6
> @@ -350,13 +350,13 @@ device configure API ``rte_eth_dev_configure`` and then the RX and TX queues
>   which will be used must be setup using ``rte_eth_tx_queue_setup`` /
>   ``rte_eth_rx_queue_setup``.
>   
> -Slave devices can be dynamically added and removed from a link bonding device
> -using the ``rte_eth_bond_slave_add`` / ``rte_eth_bond_slave_remove``
> -APIs but at least one slave device must be added to the link bonding device
> +Member devices can be dynamically added and removed from a link bonding device
> +using the ``rte_eth_bond_member_add`` / ``rte_eth_bond_member_remove``
> +APIs but at least one member device must be added to the link bonding device
>   before it can be started using ``rte_eth_dev_start``.
>   
> -The link status of a bonded device is dictated by that of its slaves, if all
> -slave device link status are down or if all slaves are removed from the link
> +The link status of a bonded device is dictated by that of its members, if all
> +member device link status are down or if all members are removed from the link
>   bonding device then the link status of the bonding device will go down.
>   
>   It is also possible to configure / query the configuration of the control
> @@ -390,7 +390,7 @@ long as the following two rules are respected:
>       where X can be any combination of numbers and/or letters,
>       and the name is no greater than 32 characters long.
>   
> -*   A least one slave device is provided with for each bonded device definition.
> +*   A least one member device is provided with for each bonded device definition.
>   
>   *   The operation mode of the bonded device being created is provided.
>   
> @@ -404,20 +404,20 @@ The different options are:
>   
>           mode=2
>   
> -*   slave: Defines the PMD device which will be added as slave to the bonded
> +*   member: Defines the PMD device which will be added as member to the bonded
>       device. This option can be selected multiple times, for each device to be
> -    added as a slave. Physical devices should be specified using their PCI
> +    added as a member. Physical devices should be specified using their PCI
>       address, in the format domain:bus:devid.function
>   
>   .. code-block:: console
>   
> -        slave=0000:0a:00.0,slave=0000:0a:00.1
> +        member=0000:0a:00.0,member=0000:0a:00.1
>   
> -*   primary: Optional parameter which defines the primary slave port,
> -    is used in active backup mode to select the primary slave for data TX/RX if
> +*   primary: Optional parameter which defines the primary member port,
> +    is used in active backup mode to select the primary member for data TX/RX if
>       it is available. The primary port also is used to select the MAC address to
> -    use when it is not defined by the user. This defaults to the first slave
> -    added to the device if it is specified. The primary device must be a slave
> +    use when it is not defined by the user. This defaults to the first member
> +    added to the device if it is specified. The primary device must be a member
>       of the bonded device.
>   
>   .. code-block:: console
> @@ -432,7 +432,7 @@ The different options are:
>           socket_id=0
>   
>   *   mac: Optional parameter to select a MAC address for link bonding device,
> -    this overrides the value of the primary slave device.
> +    this overrides the value of the primary member device.
>   
>   .. code-block:: console
>   
> @@ -474,29 +474,29 @@ The different options are:
>   Examples of Usage
>   ^^^^^^^^^^^^^^^^^
>   
> -Create a bonded device in round robin mode with two slaves specified by their PCI address:
> +Create a bonded device in round robin mode with two members specified by their PCI address:
>   
>   .. code-block:: console
>   
> -    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,slave=0000:0a:00.01,slave=0000:04:00.00' -- --port-topology=chained
> +    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,member=0000:0a:00.01,member=0000:04:00.00' -- --port-topology=chained
>   
> -Create a bonded device in round robin mode with two slaves specified by their PCI address and an overriding MAC address:
> +Create a bonded device in round robin mode with two members specified by their PCI address and an overriding MAC address:
>   
>   .. code-block:: console
>   
> -    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,slave=0000:0a:00.01,slave=0000:04:00.00,mac=00:1e:67:1d:fd:1d' -- --port-topology=chained
> +    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,member=0000:0a:00.01,member=0000:04:00.00,mac=00:1e:67:1d:fd:1d' -- --port-topology=chained
>   
> -Create a bonded device in active backup mode with two slaves specified, and a primary slave specified by their PCI addresses:
> +Create a bonded device in active backup mode with two members specified, and a primary member specified by their PCI addresses:
>   
>   .. code-block:: console
>   
> -    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=1,slave=0000:0a:00.01,slave=0000:04:00.00,primary=0000:0a:00.01' -- --port-topology=chained
> +    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=1,member=0000:0a:00.01,member=0000:04:00.00,primary=0000:0a:00.01' -- --port-topology=chained
>   
> -Create a bonded device in balance mode with two slaves specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding:
> +Create a bonded device in balance mode with two members specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding:
>   
>   .. code-block:: console
>   
> -    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=2,slave=0000:0a:00.01,slave=0000:04:00.00,xmit_policy=l34' -- --port-topology=chained
> +    ./<build_dir>/app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=2,member=0000:0a:00.01,member=0000:04:00.00,xmit_policy=l34' -- --port-topology=chained
>   
>   .. _bonding_testpmd_commands:
>   
> @@ -517,28 +517,28 @@ For example, to create a bonded device in mode 1 on socket 0::
>      testpmd> create bonded device 1 0
>      created new bonded device (port X)
>   
> -add bonding slave
> -~~~~~~~~~~~~~~~~~
> +add bonding member
> +~~~~~~~~~~~~~~~~~~
>   
>   Adds Ethernet device to a Link Bonding device::
>   
> -   testpmd> add bonding slave (slave id) (port id)
> +   testpmd> add bonding member (member id) (port id)
>   
>   For example, to add Ethernet device (port 6) to a Link Bonding device (port 10)::
>   
> -   testpmd> add bonding slave 6 10
> +   testpmd> add bonding member 6 10
>   
>   
> -remove bonding slave
> -~~~~~~~~~~~~~~~~~~~~
> +remove bonding member
> +~~~~~~~~~~~~~~~~~~~~~
>   
> -Removes an Ethernet slave device from a Link Bonding device::
> +Removes an Ethernet member device from a Link Bonding device::
>   
> -   testpmd> remove bonding slave (slave id) (port id)
> +   testpmd> remove bonding member (member id) (port id)
>   
> -For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10)::
> +For example, to remove Ethernet member device (port 6) to a Link Bonding device (port 10)::
>   
> -   testpmd> remove bonding slave 6 10
> +   testpmd> remove bonding member 6 10
>   
>   set bonding mode
>   ~~~~~~~~~~~~~~~~
> @@ -554,11 +554,11 @@ For example, to set the bonding mode of a Link Bonding device (port 10) to broad
>   set bonding primary
>   ~~~~~~~~~~~~~~~~~~~
>   
> -Set an Ethernet slave device as the primary device on a Link Bonding device::
> +Set an Ethernet member device as the primary device on a Link Bonding device::
>   
> -   testpmd> set bonding primary (slave id) (port id)
> +   testpmd> set bonding primary (member id) (port id)
>   
> -For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10)::
> +For example, to set the Ethernet member device (port 6) as the primary port of a Link Bonding device (port 10)::
>   
>      testpmd> set bonding primary 6 10
>   
> @@ -590,7 +590,7 @@ set bonding mon_period
>   
>   Set the link status monitoring polling period in milliseconds for a bonding device.
>   
> -This adds support for PMD slave devices which do not support link status interrupts.
> +This adds support for PMD member devices which do not support link status interrupts.
>   When the mon_period is set to a value greater than 0 then all PMD's which do not support
>   link status ISR will be queried every polling interval to check if their link status has changed::
>   
> @@ -604,7 +604,7 @@ For example, to set the link status monitoring polling period of bonded device (
>   set bonding lacp dedicated_queue
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   
> -Enable dedicated tx/rx queues on bonding devices slaves to handle LACP control plane traffic
> +Enable dedicated tx/rx queues on bonding devices members to handle LACP control plane traffic
>   when in mode 4 (link-aggregation-802.3ad)::
>   
>      testpmd> set bonding lacp dedicated_queues (port_id) (enable|disable)
> @@ -627,13 +627,13 @@ it also shows link-aggregation-802.3ad information if the link mode is mode 4::
>      testpmd> show bonding config (port id)
>   
>   For example,
> -to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4)
> +to show the configuration a Link Bonding device (port 9) with 3 member devices (1, 3, 4)
>   in balance mode with a transmission policy of layer 2+3::
>   
>      testpmd> show bonding config 9
>        - Dev basic:
>           Bonding mode: BALANCE(2)
>           Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23
> -        Slaves (3): [1 3 4]
> -        Active Slaves (3): [1 3 4]
> +        Members (3): [1 3 4]
> +        Active Members (3): [1 3 4]
>           Primary: [3]
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 82455f9e18..535a361a22 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -124,22 +124,6 @@ Deprecation Notices
>     The legacy actions should be removed
>     once ``MODIFY_FIELD`` alternative is implemented in drivers.
>   
> -* bonding: The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be
> -  renamed to ``struct rte_eth_bond_8023ad_member_info`` in DPDK 23.11.
> -  The following functions will be removed in DPDK 23.11.
> -  The old functions:
> -  ``rte_eth_bond_8023ad_slave_info``,
> -  ``rte_eth_bond_active_slaves_get``,
> -  ``rte_eth_bond_slave_add``,
> -  ``rte_eth_bond_slave_remove``, and
> -  ``rte_eth_bond_slaves_get``
> -  will be replaced by:
> -  ``rte_eth_bond_8023ad_member_info``,
> -  ``rte_eth_bond_active_members_get``,
> -  ``rte_eth_bond_member_add``,
> -  ``rte_eth_bond_member_remove``, and
> -  ``rte_eth_bond_members_get``.
> -
>   * cryptodev: The function ``rte_cryptodev_cb_fn`` will be updated
>     to have another parameter ``qp_id`` to return the queue pair ID
>     which got error interrupt to the application,
> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst
> index 2fae9539e2..f0ef597351 100644
> --- a/doc/guides/rel_notes/release_23_11.rst
> +++ b/doc/guides/rel_notes/release_23_11.rst
> @@ -109,6 +109,23 @@ API Changes
>      Also, make sure to start the actual text at the margin.
>      =======================================================
>   
> +* bonding: Replace master/slave to main/member. The data structure
> +  ``struct rte_eth_bond_8023ad_slave_info`` was renamed to
> +  ``struct rte_eth_bond_8023ad_member_info`` in DPDK 23.11.
> +  The following functions were removed in DPDK 23.11.
> +  The old functions:
> +  ``rte_eth_bond_8023ad_slave_info``,
> +  ``rte_eth_bond_active_slaves_get``,
> +  ``rte_eth_bond_slave_add``,
> +  ``rte_eth_bond_slave_remove``, and
> +  ``rte_eth_bond_slaves_get``
> +  will be replaced by:
> +  ``rte_eth_bond_8023ad_member_info``,
> +  ``rte_eth_bond_active_members_get``,
> +  ``rte_eth_bond_member_add``,
> +  ``rte_eth_bond_member_remove``, and
> +  ``rte_eth_bond_members_get``.
> +
>   
>   ABI Changes
>   -----------
> diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c
> index b3c12cada0..1fe85839ed 100644
> --- a/drivers/net/bonding/bonding_testpmd.c
> +++ b/drivers/net/bonding/bonding_testpmd.c
> @@ -279,7 +279,7 @@ struct cmd_set_bonding_primary_result {
>   	cmdline_fixed_string_t set;
>   	cmdline_fixed_string_t bonding;
>   	cmdline_fixed_string_t primary;
> -	portid_t slave_id;
> +	portid_t member_id;
>   	portid_t port_id;
>   };
>   
> @@ -287,13 +287,13 @@ static void cmd_set_bonding_primary_parsed(void *parsed_result,
>   	__rte_unused struct cmdline *cl, __rte_unused void *data)
>   {
>   	struct cmd_set_bonding_primary_result *res = parsed_result;
> -	portid_t master_port_id = res->port_id;
> -	portid_t slave_port_id = res->slave_id;
> +	portid_t main_port_id = res->port_id;
> +	portid_t member_port_id = res->member_id;
>   
> -	/* Set the primary slave for a bonded device. */
> -	if (rte_eth_bond_primary_set(master_port_id, slave_port_id) != 0) {
> -		fprintf(stderr, "\t Failed to set primary slave for port = %d.\n",
> -			master_port_id);
> +	/* Set the primary member for a bonded device. */
> +	if (rte_eth_bond_primary_set(main_port_id, member_port_id) != 0) {
> +		fprintf(stderr, "\t Failed to set primary member for port = %d.\n",
> +			main_port_id);
>   		return;
>   	}
>   	init_port_config();
> @@ -308,141 +308,141 @@ static cmdline_parse_token_string_t cmd_setbonding_primary_bonding =
>   static cmdline_parse_token_string_t cmd_setbonding_primary_primary =
>   	TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_primary_result,
>   		primary, "primary");
> -static cmdline_parse_token_num_t cmd_setbonding_primary_slave =
> +static cmdline_parse_token_num_t cmd_setbonding_primary_member =
>   	TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_primary_result,
> -		slave_id, RTE_UINT16);
> +		member_id, RTE_UINT16);
>   static cmdline_parse_token_num_t cmd_setbonding_primary_port =
>   	TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_primary_result,
>   		port_id, RTE_UINT16);
>   
>   static cmdline_parse_inst_t cmd_set_bonding_primary = {
>   	.f = cmd_set_bonding_primary_parsed,
> -	.help_str = "set bonding primary <slave_id> <port_id>: "
> -		"Set the primary slave for port_id",
> +	.help_str = "set bonding primary <member_id> <port_id>: "
> +		"Set the primary member for port_id",
>   	.data = NULL,
>   	.tokens = {
>   		(void *)&cmd_setbonding_primary_set,
>   		(void *)&cmd_setbonding_primary_bonding,
>   		(void *)&cmd_setbonding_primary_primary,
> -		(void *)&cmd_setbonding_primary_slave,
> +		(void *)&cmd_setbonding_primary_member,
>   		(void *)&cmd_setbonding_primary_port,
>   		NULL
>   	}
>   };
>   
> -/* *** ADD SLAVE *** */
> -struct cmd_add_bonding_slave_result {
> +/* *** ADD Member *** */
> +struct cmd_add_bonding_member_result {
>   	cmdline_fixed_string_t add;
>   	cmdline_fixed_string_t bonding;
> -	cmdline_fixed_string_t slave;
> -	portid_t slave_id;
> +	cmdline_fixed_string_t member;
> +	portid_t member_id;
>   	portid_t port_id;
>   };
>   
> -static void cmd_add_bonding_slave_parsed(void *parsed_result,
> +static void cmd_add_bonding_member_parsed(void *parsed_result,
>   	__rte_unused struct cmdline *cl, __rte_unused void *data)
>   {
> -	struct cmd_add_bonding_slave_result *res = parsed_result;
> -	portid_t master_port_id = res->port_id;
> -	portid_t slave_port_id = res->slave_id;
> +	struct cmd_add_bonding_member_result *res = parsed_result;
> +	portid_t main_port_id = res->port_id;
> +	portid_t member_port_id = res->member_id;
>   
> -	/* add the slave for a bonded device. */
> -	if (rte_eth_bond_slave_add(master_port_id, slave_port_id) != 0) {
> +	/* add the member for a bonded device. */
> +	if (rte_eth_bond_member_add(main_port_id, member_port_id) != 0) {
>   		fprintf(stderr,
> -			"\t Failed to add slave %d to master port = %d.\n",
> -			slave_port_id, master_port_id);
> +			"\t Failed to add member %d to main port = %d.\n",
> +			member_port_id, main_port_id);
>   		return;
>   	}
> -	ports[master_port_id].update_conf = 1;
> +	ports[main_port_id].update_conf = 1;
>   	init_port_config();
> -	set_port_slave_flag(slave_port_id);
> +	set_port_member_flag(member_port_id);
>   }
>   
> -static cmdline_parse_token_string_t cmd_addbonding_slave_add =
> -	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_addbonding_member_add =
> +	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_member_result,
>   		add, "add");
> -static cmdline_parse_token_string_t cmd_addbonding_slave_bonding =
> -	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_addbonding_member_bonding =
> +	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_member_result,
>   		bonding, "bonding");
> -static cmdline_parse_token_string_t cmd_addbonding_slave_slave =
> -	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result,
> -		slave, "slave");
> -static cmdline_parse_token_num_t cmd_addbonding_slave_slaveid =
> -	TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result,
> -		slave_id, RTE_UINT16);
> -static cmdline_parse_token_num_t cmd_addbonding_slave_port =
> -	TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_addbonding_member_member =
> +	TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_member_result,
> +		member, "member");
> +static cmdline_parse_token_num_t cmd_addbonding_member_memberid =
> +	TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_member_result,
> +		member_id, RTE_UINT16);
> +static cmdline_parse_token_num_t cmd_addbonding_member_port =
> +	TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_member_result,
>   		port_id, RTE_UINT16);
>   
> -static cmdline_parse_inst_t cmd_add_bonding_slave = {
> -	.f = cmd_add_bonding_slave_parsed,
> -	.help_str = "add bonding slave <slave_id> <port_id>: "
> -		"Add a slave device to a bonded device",
> +static cmdline_parse_inst_t cmd_add_bonding_member = {
> +	.f = cmd_add_bonding_member_parsed,
> +	.help_str = "add bonding member <member_id> <port_id>: "
> +		"Add a member device to a bonded device",
>   	.data = NULL,
>   	.tokens = {
> -		(void *)&cmd_addbonding_slave_add,
> -		(void *)&cmd_addbonding_slave_bonding,
> -		(void *)&cmd_addbonding_slave_slave,
> -		(void *)&cmd_addbonding_slave_slaveid,
> -		(void *)&cmd_addbonding_slave_port,
> +		(void *)&cmd_addbonding_member_add,
> +		(void *)&cmd_addbonding_member_bonding,
> +		(void *)&cmd_addbonding_member_member,
> +		(void *)&cmd_addbonding_member_memberid,
> +		(void *)&cmd_addbonding_member_port,
>   		NULL
>   	}
>   };
>   
> -/* *** REMOVE SLAVE *** */
> -struct cmd_remove_bonding_slave_result {
> +/* *** REMOVE Member *** */
> +struct cmd_remove_bonding_member_result {
>   	cmdline_fixed_string_t remove;
>   	cmdline_fixed_string_t bonding;
> -	cmdline_fixed_string_t slave;
> -	portid_t slave_id;
> +	cmdline_fixed_string_t member;
> +	portid_t member_id;
>   	portid_t port_id;
>   };
>   
> -static void cmd_remove_bonding_slave_parsed(void *parsed_result,
> +static void cmd_remove_bonding_member_parsed(void *parsed_result,
>   	__rte_unused struct cmdline *cl, __rte_unused void *data)
>   {
> -	struct cmd_remove_bonding_slave_result *res = parsed_result;
> -	portid_t master_port_id = res->port_id;
> -	portid_t slave_port_id = res->slave_id;
> +	struct cmd_remove_bonding_member_result *res = parsed_result;
> +	portid_t main_port_id = res->port_id;
> +	portid_t member_port_id = res->member_id;
>   
> -	/* remove the slave from a bonded device. */
> -	if (rte_eth_bond_slave_remove(master_port_id, slave_port_id) != 0) {
> +	/* remove the member from a bonded device. */
> +	if (rte_eth_bond_member_remove(main_port_id, member_port_id) != 0) {
>   		fprintf(stderr,
> -			"\t Failed to remove slave %d from master port = %d.\n",
> -			slave_port_id, master_port_id);
> +			"\t Failed to remove member %d from main port = %d.\n",
> +			member_port_id, main_port_id);
>   		return;
>   	}
>   	init_port_config();
> -	clear_port_slave_flag(slave_port_id);
> +	clear_port_member_flag(member_port_id);
>   }
>   
> -static cmdline_parse_token_string_t cmd_removebonding_slave_remove =
> -	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_removebonding_member_remove =
> +	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_member_result,
>   		remove, "remove");
> -static cmdline_parse_token_string_t cmd_removebonding_slave_bonding =
> -	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_removebonding_member_bonding =
> +	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_member_result,
>   		bonding, "bonding");
> -static cmdline_parse_token_string_t cmd_removebonding_slave_slave =
> -	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result,
> -		slave, "slave");
> -static cmdline_parse_token_num_t cmd_removebonding_slave_slaveid =
> -	TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result,
> -		slave_id, RTE_UINT16);
> -static cmdline_parse_token_num_t cmd_removebonding_slave_port =
> -	TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result,
> +static cmdline_parse_token_string_t cmd_removebonding_member_member =
> +	TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_member_result,
> +		member, "member");
> +static cmdline_parse_token_num_t cmd_removebonding_member_memberid =
> +	TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_member_result,
> +		member_id, RTE_UINT16);
> +static cmdline_parse_token_num_t cmd_removebonding_member_port =
> +	TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_member_result,
>   		port_id, RTE_UINT16);
>   
> -static cmdline_parse_inst_t cmd_remove_bonding_slave = {
> -	.f = cmd_remove_bonding_slave_parsed,
> -	.help_str = "remove bonding slave <slave_id> <port_id>: "
> -		"Remove a slave device from a bonded device",
> +static cmdline_parse_inst_t cmd_remove_bonding_member = {
> +	.f = cmd_remove_bonding_member_parsed,
> +	.help_str = "remove bonding member <member_id> <port_id>: "
> +		"Remove a member device from a bonded device",
>   	.data = NULL,
>   	.tokens = {
> -		(void *)&cmd_removebonding_slave_remove,
> -		(void *)&cmd_removebonding_slave_bonding,
> -		(void *)&cmd_removebonding_slave_slave,
> -		(void *)&cmd_removebonding_slave_slaveid,
> -		(void *)&cmd_removebonding_slave_port,
> +		(void *)&cmd_removebonding_member_remove,
> +		(void *)&cmd_removebonding_member_bonding,
> +		(void *)&cmd_removebonding_member_member,
> +		(void *)&cmd_removebonding_member_memberid,
> +		(void *)&cmd_removebonding_member_port,
>   		NULL
>   	}
>   };
> @@ -706,18 +706,18 @@ static struct testpmd_driver_commands bonding_cmds = {
>   	},
>   	{
>   		&cmd_set_bonding_primary,
> -		"set bonding primary (slave_id) (port_id)\n"
> -		"	Set the primary slave for a bonded device.\n",
> +		"set bonding primary (member_id) (port_id)\n"
> +		"	Set the primary member for a bonded device.\n",
>   	},
>   	{
> -		&cmd_add_bonding_slave,
> -		"add bonding slave (slave_id) (port_id)\n"
> -		"	Add a slave device to a bonded device.\n",
> +		&cmd_add_bonding_member,
> +		"add bonding member (member_id) (port_id)\n"
> +		"	Add a member device to a bonded device.\n",
>   	},
>   	{
> -		&cmd_remove_bonding_slave,
> -		"remove bonding slave (slave_id) (port_id)\n"
> -		"	Remove a slave device from a bonded device.\n",
> +		&cmd_remove_bonding_member,
> +		"remove bonding member (member_id) (port_id)\n"
> +		"	Remove a member device from a bonded device.\n",
>   	},
>   	{
>   		&cmd_create_bonded_device,
> diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h
> index a5e1fffea1..77892c0601 100644
> --- a/drivers/net/bonding/eth_bond_8023ad_private.h
> +++ b/drivers/net/bonding/eth_bond_8023ad_private.h
> @@ -15,10 +15,10 @@
>   #include "rte_eth_bond_8023ad.h"
>   
>   #define BOND_MODE_8023AX_UPDATE_TIMEOUT_MS  100
> -/** Maximum number of packets to one slave queued in TX ring. */
> -#define BOND_MODE_8023AX_SLAVE_RX_PKTS        3
> -/** Maximum number of LACP packets from one slave queued in TX ring. */
> -#define BOND_MODE_8023AX_SLAVE_TX_PKTS        1
> +/** Maximum number of packets to one member queued in TX ring. */
> +#define BOND_MODE_8023AX_MEMBER_RX_PKTS        3
> +/** Maximum number of LACP packets from one member queued in TX ring. */
> +#define BOND_MODE_8023AX_MEMBER_TX_PKTS        1
>   /**
>    * Timeouts definitions (5.4.4 in 802.1AX documentation).
>    */
> @@ -113,7 +113,7 @@ struct port {
>   	enum rte_bond_8023ad_selection selected;
>   
>   	/** Indicates if either allmulti or promisc has been enforced on the
> -	 * slave so that we can receive lacp packets
> +	 * member so that we can receive lacp packets
>   	 */
>   #define BOND_8023AD_FORCED_ALLMULTI (1 << 0)
>   #define BOND_8023AD_FORCED_PROMISC (1 << 1)
> @@ -162,8 +162,8 @@ struct mode8023ad_private {
>   	uint8_t external_sm;
>   	struct rte_ether_addr mac_addr;
>   
> -	struct rte_eth_link slave_link;
> -	/***< slave link properties */
> +	struct rte_eth_link member_link;
> +	/***< member link properties */
>   
>   	/**
>   	 * Configuration of dedicated hardware queues for control plane
> @@ -208,7 +208,7 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev,
>   /**
>    * @internal
>    *
> - * Enables 802.1AX mode and all active slaves on bonded interface.
> + * Enables 802.1AX mode and all active members on bonded interface.
>    *
>    * @param dev Bonded interface
>    * @return
> @@ -220,7 +220,7 @@ bond_mode_8023ad_enable(struct rte_eth_dev *dev);
>   /**
>    * @internal
>    *
> - * Disables 802.1AX mode of the bonded interface and slaves.
> + * Disables 802.1AX mode of the bonded interface and members.
>    *
>    * @param dev Bonded interface
>    * @return
> @@ -256,43 +256,43 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev);
>    *
>    * Passes given slow packet to state machines management logic.
>    * @param internals Bonded device private data.
> - * @param slave_id Slave port id.
> + * @param member_id Member port id.
>    * @param slot_pkt Slow packet.
>    */
>   void
>   bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
> -				 uint16_t slave_id, struct rte_mbuf *pkt);
> +				 uint16_t member_id, struct rte_mbuf *pkt);
>   
>   /**
>    * @internal
>    *
> - * Appends given slave used slave
> + * Appends given member used member
>    *
>    * @param dev       Bonded interface.
> - * @param port_id   Slave port ID to be added
> + * @param port_id   Member port ID to be added
>    *
>    * @return
>    *  0 on success, negative value otherwise.
>    */
>   void
> -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id);
> +bond_mode_8023ad_activate_member(struct rte_eth_dev *dev, uint16_t port_id);
>   
>   /**
>    * @internal
>    *
> - * Denitializes and removes given slave from 802.1AX mode.
> + * Denitializes and removes given member from 802.1AX mode.
>    *
>    * @param dev       Bonded interface.
> - * @param slave_num Position of slave in active_slaves array
> + * @param member_num Position of member in active_members array
>    *
>    * @return
>    *  0 on success, negative value otherwise.
>    */
>   int
> -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos);
> +bond_mode_8023ad_deactivate_member(struct rte_eth_dev *dev, uint16_t member_pos);
>   
>   /**
> - * Updates state when MAC was changed on bonded device or one of its slaves.
> + * Updates state when MAC was changed on bonded device or one of its members.
>    * @param bond_dev Bonded device
>    */
>   void
> @@ -300,10 +300,10 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev);
>   
>   int
>   bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
> -		uint16_t slave_port);
> +		uint16_t member_port);
>   
>   int
> -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port);
> +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t member_port);
>   
>   int
>   bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id);
> diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h
> index d4f1fb27d4..93d03b0a79 100644
> --- a/drivers/net/bonding/eth_bond_private.h
> +++ b/drivers/net/bonding/eth_bond_private.h
> @@ -18,8 +18,8 @@
>   #include "eth_bond_8023ad_private.h"
>   #include "rte_eth_bond_alb.h"
>   
> -#define PMD_BOND_SLAVE_PORT_KVARG			("slave")
> -#define PMD_BOND_PRIMARY_SLAVE_KVARG		("primary")
> +#define PMD_BOND_MEMBER_PORT_KVARG			("member")
> +#define PMD_BOND_PRIMARY_MEMBER_KVARG		("primary")
>   #define PMD_BOND_MODE_KVARG					("mode")
>   #define PMD_BOND_AGG_MODE_KVARG				("agg_mode")
>   #define PMD_BOND_XMIT_POLICY_KVARG			("xmit_policy")
> @@ -50,8 +50,8 @@ extern const struct rte_flow_ops bond_flow_ops;
>   /** Port Queue Mapping Structure */
>   struct bond_rx_queue {
>   	uint16_t queue_id;
> -	/**< Next active_slave to poll */
> -	uint16_t active_slave;
> +	/**< Next active_member to poll */
> +	uint16_t active_member;
>   	/**< Queue Id */
>   	struct bond_dev_private *dev_private;
>   	/**< Reference to eth_dev private structure */
> @@ -74,19 +74,19 @@ struct bond_tx_queue {
>   	/**< Copy of TX configuration structure for queue */
>   };
>   
> -/** Bonded slave devices structure */
> -struct bond_ethdev_slave_ports {
> -	uint16_t slaves[RTE_MAX_ETHPORTS];	/**< Slave port id array */
> -	uint16_t slave_count;				/**< Number of slaves */
> +/** Bonded member devices structure */
> +struct bond_ethdev_member_ports {
> +	uint16_t members[RTE_MAX_ETHPORTS];	/**< Member port id array */
> +	uint16_t member_count;				/**< Number of members */
>   };
>   
> -struct bond_slave_details {
> +struct bond_member_details {
>   	uint16_t port_id;
>   
>   	uint8_t link_status_poll_enabled;
>   	uint8_t link_status_wait_to_complete;
>   	uint8_t last_link_status;
> -	/**< Port Id of slave eth_dev */
> +	/**< Port Id of member eth_dev */
>   	struct rte_ether_addr persisted_mac_addr;
>   
>   	uint16_t reta_size;
> @@ -94,7 +94,7 @@ struct bond_slave_details {
>   
>   struct rte_flow {
>   	TAILQ_ENTRY(rte_flow) next;
> -	/* Slaves flows */
> +	/* Members flows */
>   	struct rte_flow *flows[RTE_MAX_ETHPORTS];
>   	/* Flow description for synchronization */
>   	struct rte_flow_conv_rule rule;
> @@ -102,7 +102,7 @@ struct rte_flow {
>   };
>   
>   typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves);
> +		uint16_t member_count, uint16_t *members);
>   
>   /** Link Bonding PMD device private configuration Structure */
>   struct bond_dev_private {
> @@ -112,8 +112,8 @@ struct bond_dev_private {
>   	rte_spinlock_t lock;
>   	rte_spinlock_t lsc_lock;
>   
> -	uint16_t primary_port;			/**< Primary Slave Port */
> -	uint16_t current_primary_port;		/**< Primary Slave Port */
> +	uint16_t primary_port;			/**< Primary Member Port */
> +	uint16_t current_primary_port;		/**< Primary Member Port */
>   	uint16_t user_defined_primary_port;
>   	/**< Flag for whether primary port is user defined or not */
>   
> @@ -137,16 +137,16 @@ struct bond_dev_private {
>   	uint16_t nb_rx_queues;			/**< Total number of rx queues */
>   	uint16_t nb_tx_queues;			/**< Total number of tx queues*/
>   
> -	uint16_t active_slave_count;		/**< Number of active slaves */
> -	uint16_t active_slaves[RTE_MAX_ETHPORTS];    /**< Active slave list */
> +	uint16_t active_member_count;		/**< Number of active members */
> +	uint16_t active_members[RTE_MAX_ETHPORTS];    /**< Active member list */
>   
> -	uint16_t slave_count;			/**< Number of bonded slaves */
> -	struct bond_slave_details slaves[RTE_MAX_ETHPORTS];
> -	/**< Array of bonded slaves details */
> +	uint16_t member_count;			/**< Number of bonded members */
> +	struct bond_member_details members[RTE_MAX_ETHPORTS];
> +	/**< Array of bonded members details */
>   
>   	struct mode8023ad_private mode4;
> -	uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS];
> -	/**< TLB active slaves send order */
> +	uint16_t tlb_members_order[RTE_MAX_ETHPORTS];
> +	/**< TLB active members send order */
>   	struct mode_alb_private mode6;
>   
>   	uint64_t rx_offload_capa;       /** Rx offload capability */
> @@ -177,7 +177,7 @@ struct bond_dev_private {
>   	uint8_t rss_key_len;				/**< hash key length in bytes. */
>   
>   	struct rte_kvargs *kvlist;
> -	uint8_t slave_update_idx;
> +	uint8_t member_update_idx;
>   
>   	bool kvargs_processing_is_done;
>   
> @@ -191,19 +191,21 @@ struct bond_dev_private {
>   extern const struct eth_dev_ops default_dev_ops;
>   
>   int
> -check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev);
> +check_for_main_bonded_ethdev(const struct rte_eth_dev *eth_dev);
>   
>   int
>   check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev);
>   
> -/* Search given slave array to find position of given id.
> - * Return slave pos or slaves_count if not found. */
> +/*
> + * Search given member array to find position of given id.
> + * Return member pos or members_count if not found.
> + */
>   static inline uint16_t
> -find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) {
> +find_member_by_id(uint16_t *members, uint16_t members_count, uint16_t member_id) {
>   
>   	uint16_t pos;
> -	for (pos = 0; pos < slaves_count; pos++) {
> -		if (slave_id == slaves[pos])
> +	for (pos = 0; pos < members_count; pos++) {
> +		if (member_id == members[pos])
>   			break;
>   	}
>   
> @@ -217,13 +219,13 @@ int
>   valid_bonded_port_id(uint16_t port_id);
>   
>   int
> -valid_slave_port_id(struct bond_dev_private *internals, uint16_t port_id);
> +valid_member_port_id(struct bond_dev_private *internals, uint16_t port_id);
>   
>   void
> -deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id);
> +deactivate_member(struct rte_eth_dev *eth_dev, uint16_t port_id);
>   
>   void
> -activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id);
> +activate_member(struct rte_eth_dev *eth_dev, uint16_t port_id);
>   
>   int
>   mac_address_set(struct rte_eth_dev *eth_dev,
> @@ -234,66 +236,66 @@ mac_address_get(struct rte_eth_dev *eth_dev,
>   		struct rte_ether_addr *dst_mac_addr);
>   
>   int
> -mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev);
> +mac_address_members_update(struct rte_eth_dev *bonded_eth_dev);
>   
>   int
> -slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> -		uint16_t slave_port_id);
> +member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> +		uint16_t member_port_id);
>   
>   int
> -slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> -		uint16_t slave_port_id);
> +member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> +		uint16_t member_port_id);
>   
>   int
>   bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode);
>   
>   int
> -slave_configure(struct rte_eth_dev *bonded_eth_dev,
> -		struct rte_eth_dev *slave_eth_dev);
> +member_configure(struct rte_eth_dev *bonded_eth_dev,
> +		struct rte_eth_dev *member_eth_dev);
>   
>   int
> -slave_start(struct rte_eth_dev *bonded_eth_dev,
> -		struct rte_eth_dev *slave_eth_dev);
> +member_start(struct rte_eth_dev *bonded_eth_dev,
> +		struct rte_eth_dev *member_eth_dev);
>   
>   void
> -slave_remove(struct bond_dev_private *internals,
> -		struct rte_eth_dev *slave_eth_dev);
> +member_remove(struct bond_dev_private *internals,
> +		struct rte_eth_dev *member_eth_dev);
>   
>   void
> -slave_add(struct bond_dev_private *internals,
> -		struct rte_eth_dev *slave_eth_dev);
> +member_add(struct bond_dev_private *internals,
> +		struct rte_eth_dev *member_eth_dev);
>   
>   void
>   burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves);
> +		uint16_t member_count, uint16_t *members);
>   
>   void
>   burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves);
> +		uint16_t member_count, uint16_t *members);
>   
>   void
>   burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves);
> +		uint16_t member_count, uint16_t *members);
>   
>   
>   void
>   bond_ethdev_primary_set(struct bond_dev_private *internals,
> -		uint16_t slave_port_id);
> +		uint16_t member_port_id);
>   
>   int
>   bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
>   		void *param, void *ret_param);
>   
>   int
> -bond_ethdev_parse_slave_port_kvarg(const char *key,
> +bond_ethdev_parse_member_port_kvarg(const char *key,
>   		const char *value, void *extra_args);
>   
>   int
> -bond_ethdev_parse_slave_mode_kvarg(const char *key,
> +bond_ethdev_parse_member_mode_kvarg(const char *key,
>   		const char *value, void *extra_args);
>   
>   int
> -bond_ethdev_parse_slave_agg_mode_kvarg(const char *key __rte_unused,
> +bond_ethdev_parse_member_agg_mode_kvarg(const char *key __rte_unused,
>   		const char *value, void *extra_args);
>   
>   int
> @@ -301,7 +303,7 @@ bond_ethdev_parse_socket_id_kvarg(const char *key,
>   		const char *value, void *extra_args);
>   
>   int
> -bond_ethdev_parse_primary_slave_port_id_kvarg(const char *key,
> +bond_ethdev_parse_primary_member_port_id_kvarg(const char *key,
>   		const char *value, void *extra_args);
>   
>   int
> @@ -323,7 +325,7 @@ void
>   bond_tlb_enable(struct bond_dev_private *internals);
>   
>   void
> -bond_tlb_activate_slave(struct bond_dev_private *internals);
> +bond_tlb_activate_member(struct bond_dev_private *internals);
>   
>   int
>   bond_ethdev_stop(struct rte_eth_dev *eth_dev);
> diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h
> index 874aa91a5f..f0cd5767ad 100644
> --- a/drivers/net/bonding/rte_eth_bond.h
> +++ b/drivers/net/bonding/rte_eth_bond.h
> @@ -10,7 +10,7 @@
>    *
>    * RTE Link Bonding Ethernet Device
>    * Link Bonding for 1GbE and 10GbE ports to allow the aggregation of multiple
> - * (slave) NICs into a single logical interface. The bonded device processes
> + * (member) NICs into a single logical interface. The bonded device processes
>    * these interfaces based on the mode of operation specified and supported.
>    * This implementation supports 4 modes of operation round robin, active backup
>    * balance and broadcast. Providing redundant links, fault tolerance and/or
> @@ -28,24 +28,28 @@ extern "C" {
>   #define BONDING_MODE_ROUND_ROBIN		(0)
>   /**< Round Robin (Mode 0).
>    * In this mode all transmitted packets will be balanced equally across all
> - * active slaves of the bonded in a round robin fashion. */
> + * active members of the bonded in a round robin fashion.
> + */
>   #define BONDING_MODE_ACTIVE_BACKUP		(1)
>   /**< Active Backup (Mode 1).
>    * In this mode all packets transmitted will be transmitted on the primary
> - * slave until such point as the primary slave is no longer available and then
> - * transmitted packets will be sent on the next available slaves. The primary
> - * slave can be defined by the user but defaults to the first active slave
> - * available if not specified. */
> + * member until such point as the primary member is no longer available and then
> + * transmitted packets will be sent on the next available members. The primary
> + * member can be defined by the user but defaults to the first active member
> + * available if not specified.
> + */
>   #define BONDING_MODE_BALANCE			(2)
>   /**< Balance (Mode 2).
>    * In this mode all packets transmitted will be balanced across the available
> - * slaves using one of three available transmit policies - l2, l2+3 or l3+4.
> + * members using one of three available transmit policies - l2, l2+3 or l3+4.
>    * See BALANCE_XMIT_POLICY macros definitions for further details on transmit
> - * policies. */
> + * policies.
> + */
>   #define BONDING_MODE_BROADCAST			(3)
>   /**< Broadcast (Mode 3).
>    * In this mode all transmitted packets will be transmitted on all available
> - * active slaves of the bonded. */
> + * active members of the bonded.
> + */
>   #define BONDING_MODE_8023AD				(4)
>   /**< 802.3AD (Mode 4).
>    *
> @@ -62,22 +66,22 @@ extern "C" {
>    * be handled with the expected latency and this may cause the link status to be
>    * incorrectly marked as down or failure to correctly negotiate with peers.
>    * - For optimal performance during initial handshaking the array of mbufs provided
> - * to rx_burst should be at least 2 times the slave count size.
> - *
> + * to rx_burst should be at least 2 times the member count size.
>    */
>   #define BONDING_MODE_TLB	(5)
>   /**< Adaptive TLB (Mode 5)
>    * This mode provides an adaptive transmit load balancing. It dynamically
> - * changes the transmitting slave, according to the computed load. Statistics
> - * are collected in 100ms intervals and scheduled every 10ms */
> + * changes the transmitting member, according to the computed load. Statistics
> + * are collected in 100ms intervals and scheduled every 10ms.
> + */
>   #define BONDING_MODE_ALB	(6)
>   /**< Adaptive Load Balancing (Mode 6)
>    * This mode includes adaptive TLB and receive load balancing (RLB). In RLB the
>    * bonding driver intercepts ARP replies send by local system and overwrites its
>    * source MAC address, so that different peers send data to the server on
> - * different slave interfaces. When local system sends ARP request, it saves IP
> + * different member interfaces. When local system sends ARP request, it saves IP
>    * information from it. When ARP reply from that peer is received, its MAC is
> - * stored, one of slave MACs assigned and ARP reply send to that peer.
> + * stored, one of member MACs assigned and ARP reply send to that peer.
>    */
>   
>   /* Balance Mode Transmit Policies */
> @@ -113,28 +117,30 @@ int
>   rte_eth_bond_free(const char *name);
>   
>   /**
> - * Add a rte_eth_dev device as a slave to the bonded device
> + * Add a rte_eth_dev device as a member to the bonded device
>    *
>    * @param bonded_port_id	Port ID of bonded device.
> - * @param slave_port_id		Port ID of slave device.
> + * @param member_port_id		Port ID of member device.
>    *
>    * @return
>    *	0 on success, negative value otherwise
>    */
> +__rte_experimental
>   int
> -rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id);
> +rte_eth_bond_member_add(uint16_t bonded_port_id, uint16_t member_port_id);
>   
>   /**
> - * Remove a slave rte_eth_dev device from the bonded device
> + * Remove a member rte_eth_dev device from the bonded device
>    *
>    * @param bonded_port_id	Port ID of bonded device.
> - * @param slave_port_id		Port ID of slave device.
> + * @param member_port_id		Port ID of member device.
>    *
>    * @return
>    *	0 on success, negative value otherwise
>    */
> +__rte_experimental
>   int
> -rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id);
> +rte_eth_bond_member_remove(uint16_t bonded_port_id, uint16_t member_port_id);
>   
>   /**
>    * Set link bonding mode of bonded device
> @@ -160,65 +166,67 @@ int
>   rte_eth_bond_mode_get(uint16_t bonded_port_id);
>   
>   /**
> - * Set slave rte_eth_dev as primary slave of bonded device
> + * Set member rte_eth_dev as primary member of bonded device
>    *
>    * @param bonded_port_id	Port ID of bonded device.
> - * @param slave_port_id		Port ID of slave device.
> + * @param member_port_id		Port ID of member device.
>    *
>    * @return
>    *	0 on success, negative value otherwise
>    */
>   int
> -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id);
> +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t member_port_id);
>   
>   /**
> - * Get primary slave of bonded device
> + * Get primary member of bonded device
>    *
>    * @param bonded_port_id	Port ID of bonded device.
>    *
>    * @return
> - *	Port Id of primary slave on success, -1 on failure
> + *	Port Id of primary member on success, -1 on failure
>    */
>   int
>   rte_eth_bond_primary_get(uint16_t bonded_port_id);
>   
>   /**
> - * Populate an array with list of the slaves port id's of the bonded device
> + * Populate an array with list of the members port id's of the bonded device
>    *
>    * @param bonded_port_id	Port ID of bonded eth_dev to interrogate
> - * @param slaves			Array to be populated with the current active slaves
> - * @param len				Length of slaves array
> + * @param members			Array to be populated with the current active members
> + * @param len				Length of members array
>    *
>    * @return
> - *	Number of slaves associated with bonded device on success,
> + *	Number of members associated with bonded device on success,
>    *	negative value otherwise
>    */
> +__rte_experimental
>   int
> -rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
> -			uint16_t len);
> +rte_eth_bond_members_get(uint16_t bonded_port_id, uint16_t members[],
> +		uint16_t len);
>   
>   /**
> - * Populate an array with list of the active slaves port id's of the bonded
> + * Populate an array with list of the active members port id's of the bonded
>    * device.
>    *
>    * @param bonded_port_id	Port ID of bonded eth_dev to interrogate
> - * @param slaves			Array to be populated with the current active slaves
> - * @param len				Length of slaves array
> + * @param members			Array to be populated with the current active members
> + * @param len				Length of members array
>    *
>    * @return
> - *	Number of active slaves associated with bonded device on success,
> + *	Number of active members associated with bonded device on success,
>    *	negative value otherwise
>    */
> +__rte_experimental
>   int
> -rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
> -				uint16_t len);
> +rte_eth_bond_active_members_get(uint16_t bonded_port_id, uint16_t members[],
> +		uint16_t len);
>   
>   /**
> - * Set explicit MAC address to use on bonded device and it's slaves.
> + * Set explicit MAC address to use on bonded device and it's members.
>    *
>    * @param bonded_port_id	Port ID of bonded device.
>    * @param mac_addr			MAC Address to use on bonded device overriding
> - *							slaves MAC addresses
> + *							members MAC addresses
>    *
>    * @return
>    *	0 on success, negative value otherwise
> @@ -228,8 +236,8 @@ rte_eth_bond_mac_address_set(uint16_t bonded_port_id,
>   		struct rte_ether_addr *mac_addr);
>   
>   /**
> - * Reset bonded device to use MAC from primary slave on bonded device and it's
> - * slaves.
> + * Reset bonded device to use MAC from primary member on bonded device and it's
> + * members.
>    *
>    * @param bonded_port_id	Port ID of bonded device.
>    *
> @@ -266,7 +274,7 @@ rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id);
>   
>   /**
>    * Set the link monitoring frequency (in ms) for monitoring the link status of
> - * slave devices
> + * member devices
>    *
>    * @param bonded_port_id	Port ID of bonded device.
>    * @param internal_ms		Monitoring interval in milliseconds
> @@ -280,7 +288,7 @@ rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms);
>   
>   /**
>    * Get the current link monitoring frequency (in ms) for monitoring of the link
> - * status of slave devices
> + * status of member devices
>    *
>    * @param bonded_port_id	Port ID of bonded device.
>    *
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index 4a266bb2ca..ac9f414e74 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -19,7 +19,7 @@ static void bond_mode_8023ad_ext_periodic_cb(void *arg);
>   #define MODE4_DEBUG(fmt, ...)				\
>   	rte_log(RTE_LOG_DEBUG, bond_logtype,		\
>   		"%6u [Port %u: %s] " fmt,		\
> -		bond_dbg_get_time_diff_ms(), slave_id,	\
> +		bond_dbg_get_time_diff_ms(), member_id,	\
>   		__func__, ##__VA_ARGS__)
>   
>   static uint64_t start_time;
> @@ -184,9 +184,9 @@ set_warning_flags(struct port *port, uint16_t flags)
>   }
>   
>   static void
> -show_warnings(uint16_t slave_id)
> +show_warnings(uint16_t member_id)
>   {
> -	struct port *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_id];
>   	uint8_t warnings;
>   
>   	do {
> @@ -205,36 +205,36 @@ show_warnings(uint16_t slave_id)
>   
>   	if (warnings & WRN_RX_QUEUE_FULL) {
>   		RTE_BOND_LOG(DEBUG,
> -			     "Slave %u: failed to enqueue LACP packet into RX ring.\n"
> +			     "Member %u: failed to enqueue LACP packet into RX ring.\n"
>   			     "Receive and transmit functions must be invoked on bonded"
>   			     "interface at least 10 times per second or LACP will notwork correctly",
> -			     slave_id);
> +			     member_id);
>   	}
>   
>   	if (warnings & WRN_TX_QUEUE_FULL) {
>   		RTE_BOND_LOG(DEBUG,
> -			     "Slave %u: failed to enqueue LACP packet into TX ring.\n"
> +			     "Member %u: failed to enqueue LACP packet into TX ring.\n"
>   			     "Receive and transmit functions must be invoked on bonded"
>   			     "interface at least 10 times per second or LACP will not work correctly",
> -			     slave_id);
> +			     member_id);
>   	}
>   
>   	if (warnings & WRN_RX_MARKER_TO_FAST)
> -		RTE_BOND_LOG(INFO, "Slave %u: marker to early - ignoring.",
> -			     slave_id);
> +		RTE_BOND_LOG(INFO, "Member %u: marker to early - ignoring.",
> +			     member_id);
>   
>   	if (warnings & WRN_UNKNOWN_SLOW_TYPE) {
>   		RTE_BOND_LOG(INFO,
> -			"Slave %u: ignoring unknown slow protocol frame type",
> -			     slave_id);
> +			"Member %u: ignoring unknown slow protocol frame type",
> +			     member_id);
>   	}
>   
>   	if (warnings & WRN_UNKNOWN_MARKER_TYPE)
> -		RTE_BOND_LOG(INFO, "Slave %u: ignoring unknown marker type",
> -			     slave_id);
> +		RTE_BOND_LOG(INFO, "Member %u: ignoring unknown marker type",
> +			     member_id);
>   
>   	if (warnings & WRN_NOT_LACP_CAPABLE)
> -		MODE4_DEBUG("Port %u is not LACP capable!\n", slave_id);
> +		MODE4_DEBUG("Port %u is not LACP capable!\n", member_id);
>   }
>   
>   static void
> @@ -256,10 +256,10 @@ record_default(struct port *port)
>    * @param port			Port on which LACPDU was received.
>    */
>   static void
> -rx_machine(struct bond_dev_private *internals, uint16_t slave_id,
> +rx_machine(struct bond_dev_private *internals, uint16_t member_id,
>   		struct lacpdu *lacp)
>   {
> -	struct port *agg, *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *agg, *port = &bond_mode_8023ad_ports[member_id];
>   	uint64_t timeout;
>   
>   	if (SM_FLAG(port, BEGIN)) {
> @@ -389,9 +389,9 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id,
>    * @param port			Port to handle state machine.
>    */
>   static void
> -periodic_machine(struct bond_dev_private *internals, uint16_t slave_id)
> +periodic_machine(struct bond_dev_private *internals, uint16_t member_id)
>   {
> -	struct port *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_id];
>   	/* Calculate if either site is LACP enabled */
>   	uint64_t timeout;
>   	uint8_t active = ACTOR_STATE(port, LACP_ACTIVE) ||
> @@ -451,9 +451,9 @@ periodic_machine(struct bond_dev_private *internals, uint16_t slave_id)
>    * @param port			Port to handle state machine.
>    */
>   static void
> -mux_machine(struct bond_dev_private *internals, uint16_t slave_id)
> +mux_machine(struct bond_dev_private *internals, uint16_t member_id)
>   {
> -	struct port *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_id];
>   
>   	/* Save current state for later use */
>   	const uint8_t state_mask = STATE_SYNCHRONIZATION | STATE_DISTRIBUTING |
> @@ -527,8 +527,8 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id)
>   				SM_FLAG_SET(port, NTT);
>   				MODE4_DEBUG("COLLECTING -> DISTRIBUTING\n");
>   				RTE_BOND_LOG(INFO,
> -					"Bond %u: slave id %u distributing started.",
> -					internals->port_id, slave_id);
> +					"Bond %u: member id %u distributing started.",
> +					internals->port_id, member_id);
>   			}
>   		} else {
>   			if (!PARTNER_STATE(port, COLLECTING)) {
> @@ -538,8 +538,8 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id)
>   				SM_FLAG_SET(port, NTT);
>   				MODE4_DEBUG("DISTRIBUTING -> COLLECTING\n");
>   				RTE_BOND_LOG(INFO,
> -					"Bond %u: slave id %u distributing stopped.",
> -					internals->port_id, slave_id);
> +					"Bond %u: member id %u distributing stopped.",
> +					internals->port_id, member_id);
>   			}
>   		}
>   	}
> @@ -554,9 +554,9 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id)
>    * @param port
>    */
>   static void
> -tx_machine(struct bond_dev_private *internals, uint16_t slave_id)
> +tx_machine(struct bond_dev_private *internals, uint16_t member_id)
>   {
> -	struct port *agg, *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *agg, *port = &bond_mode_8023ad_ports[member_id];
>   
>   	struct rte_mbuf *lacp_pkt = NULL;
>   	struct lacpdu_header *hdr;
> @@ -587,7 +587,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id)
>   
>   	/* Source and destination MAC */
>   	rte_ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.dst_addr);
> -	rte_eth_macaddr_get(slave_id, &hdr->eth_hdr.src_addr);
> +	rte_eth_macaddr_get(member_id, &hdr->eth_hdr.src_addr);
>   	hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);
>   
>   	lacpdu = &hdr->lacpdu;
> @@ -635,10 +635,10 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id)
>   			return;
>   		}
>   	} else {
> -		uint16_t pkts_sent = rte_eth_tx_prepare(slave_id,
> +		uint16_t pkts_sent = rte_eth_tx_prepare(member_id,
>   				internals->mode4.dedicated_queues.tx_qid,
>   				&lacp_pkt, 1);
> -		pkts_sent = rte_eth_tx_burst(slave_id,
> +		pkts_sent = rte_eth_tx_burst(member_id,
>   				internals->mode4.dedicated_queues.tx_qid,
>   				&lacp_pkt, pkts_sent);
>   		if (pkts_sent != 1) {
> @@ -679,40 +679,40 @@ max_index(uint64_t *a, int n)
>    * @param port_pos			Port to assign.
>    */
>   static void
> -selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
> +selection_logic(struct bond_dev_private *internals, uint16_t member_id)
>   {
>   	struct port *agg, *port;
> -	uint16_t slaves_count, new_agg_id, i, j = 0;
> -	uint16_t *slaves;
> +	uint16_t members_count, new_agg_id, i, j = 0;
> +	uint16_t *members;
>   	uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0};
>   	uint64_t agg_count[RTE_MAX_ETHPORTS] = {0};
> -	uint16_t default_slave = 0;
> +	uint16_t default_member = 0;
>   	struct rte_eth_link link_info;
>   	uint16_t agg_new_idx = 0;
>   	int ret;
>   
> -	slaves = internals->active_slaves;
> -	slaves_count = internals->active_slave_count;
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	members = internals->active_members;
> +	members_count = internals->active_member_count;
> +	port = &bond_mode_8023ad_ports[member_id];
>   
>   	/* Search for aggregator suitable for this port */
> -	for (i = 0; i < slaves_count; ++i) {
> -		agg = &bond_mode_8023ad_ports[slaves[i]];
> +	for (i = 0; i < members_count; ++i) {
> +		agg = &bond_mode_8023ad_ports[members[i]];
>   		/* Skip ports that are not aggregators */
> -		if (agg->aggregator_port_id != slaves[i])
> +		if (agg->aggregator_port_id != members[i])
>   			continue;
>   
> -		ret = rte_eth_link_get_nowait(slaves[i], &link_info);
> +		ret = rte_eth_link_get_nowait(members[i], &link_info);
>   		if (ret < 0) {
>   			RTE_BOND_LOG(ERR,
> -				"Slave (port %u) link get failed: %s\n",
> -				slaves[i], rte_strerror(-ret));
> +				"Member (port %u) link get failed: %s\n",
> +				members[i], rte_strerror(-ret));
>   			continue;
>   		}
>   		agg_count[i] += 1;
>   		agg_bandwidth[i] += link_info.link_speed;
>   
> -		/* Actors system ID is not checked since all slave device have the same
> +		/* Actors system ID is not checked since all member device have the same
>   		 * ID (MAC address). */
>   		if ((agg->actor.key == port->actor.key &&
>   			agg->partner.system_priority == port->partner.system_priority &&
> @@ -724,31 +724,31 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
>   				rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) != 0) {
>   
>   			if (j == 0)
> -				default_slave = i;
> +				default_member = i;
>   			j++;
>   		}
>   	}
>   
>   	switch (internals->mode4.agg_selection) {
>   	case AGG_COUNT:
> -		agg_new_idx = max_index(agg_count, slaves_count);
> -		new_agg_id = slaves[agg_new_idx];
> +		agg_new_idx = max_index(agg_count, members_count);
> +		new_agg_id = members[agg_new_idx];
>   		break;
>   	case AGG_BANDWIDTH:
> -		agg_new_idx = max_index(agg_bandwidth, slaves_count);
> -		new_agg_id = slaves[agg_new_idx];
> +		agg_new_idx = max_index(agg_bandwidth, members_count);
> +		new_agg_id = members[agg_new_idx];
>   		break;
>   	case AGG_STABLE:
> -		if (default_slave == slaves_count)
> -			new_agg_id = slaves[slave_id];
> +		if (default_member == members_count)
> +			new_agg_id = members[member_id];
>   		else
> -			new_agg_id = slaves[default_slave];
> +			new_agg_id = members[default_member];
>   		break;
>   	default:
> -		if (default_slave == slaves_count)
> -			new_agg_id = slaves[slave_id];
> +		if (default_member == members_count)
> +			new_agg_id = members[member_id];
>   		else
> -			new_agg_id = slaves[default_slave];
> +			new_agg_id = members[default_member];
>   		break;
>   	}
>   
> @@ -758,7 +758,7 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)
>   		MODE4_DEBUG("-> SELECTED: ID=%3u\n"
>   			"\t%s aggregator ID=%3u\n",
>   			port->aggregator_port_id,
> -			port->aggregator_port_id == slave_id ?
> +			port->aggregator_port_id == member_id ?
>   				"aggregator not found, using default" : "aggregator found",
>   			port->aggregator_port_id);
>   	}
> @@ -802,7 +802,7 @@ link_speed_key(uint16_t speed) {
>   }
>   
>   static void
> -rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
> +rx_machine_update(struct bond_dev_private *internals, uint16_t member_id,
>   		struct rte_mbuf *lacp_pkt) {
>   	struct lacpdu_header *lacp;
>   	struct lacpdu_actor_partner_params *partner;
> @@ -813,7 +813,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
>   		RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP);
>   
>   		partner = &lacp->lacpdu.partner;
> -		port = &bond_mode_8023ad_ports[slave_id];
> +		port = &bond_mode_8023ad_ports[member_id];
>   		agg = &bond_mode_8023ad_ports[port->aggregator_port_id];
>   
>   		if (rte_is_zero_ether_addr(&partner->port_params.system) ||
> @@ -822,7 +822,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
>   			/* This LACP frame is sending to the bonding port
>   			 * so pass it to rx_machine.
>   			 */
> -			rx_machine(internals, slave_id, &lacp->lacpdu);
> +			rx_machine(internals, member_id, &lacp->lacpdu);
>   		} else {
>   			char preferred_system_name[RTE_ETHER_ADDR_FMT_SIZE];
>   			char self_system_name[RTE_ETHER_ADDR_FMT_SIZE];
> @@ -837,16 +837,16 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
>   		}
>   		rte_pktmbuf_free(lacp_pkt);
>   	} else
> -		rx_machine(internals, slave_id, NULL);
> +		rx_machine(internals, member_id, NULL);
>   }
>   
>   static void
>   bond_mode_8023ad_dedicated_rxq_process(struct bond_dev_private *internals,
> -			uint16_t slave_id)
> +			uint16_t member_id)
>   {
>   #define DEDICATED_QUEUE_BURST_SIZE 32
>   	struct rte_mbuf *lacp_pkt[DEDICATED_QUEUE_BURST_SIZE];
> -	uint16_t rx_count = rte_eth_rx_burst(slave_id,
> +	uint16_t rx_count = rte_eth_rx_burst(member_id,
>   				internals->mode4.dedicated_queues.rx_qid,
>   				lacp_pkt, DEDICATED_QUEUE_BURST_SIZE);
>   
> @@ -854,10 +854,10 @@ bond_mode_8023ad_dedicated_rxq_process(struct bond_dev_private *internals,
>   		uint16_t i;
>   
>   		for (i = 0; i < rx_count; i++)
> -			bond_mode_8023ad_handle_slow_pkt(internals, slave_id,
> +			bond_mode_8023ad_handle_slow_pkt(internals, member_id,
>   					lacp_pkt[i]);
>   	} else {
> -		rx_machine_update(internals, slave_id, NULL);
> +		rx_machine_update(internals, member_id, NULL);
>   	}
>   }
>   
> @@ -868,23 +868,23 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
>   	struct port *port;
>   	struct rte_eth_link link_info;
> -	struct rte_ether_addr slave_addr;
> +	struct rte_ether_addr member_addr;
>   	struct rte_mbuf *lacp_pkt = NULL;
> -	uint16_t slave_id;
> +	uint16_t member_id;
>   	uint16_t i;
>   
>   
>   	/* Update link status on each port */
> -	for (i = 0; i < internals->active_slave_count; i++) {
> +	for (i = 0; i < internals->active_member_count; i++) {
>   		uint16_t key;
>   		int ret;
>   
> -		slave_id = internals->active_slaves[i];
> -		ret = rte_eth_link_get_nowait(slave_id, &link_info);
> +		member_id = internals->active_members[i];
> +		ret = rte_eth_link_get_nowait(member_id, &link_info);
>   		if (ret < 0) {
>   			RTE_BOND_LOG(ERR,
> -				"Slave (port %u) link get failed: %s\n",
> -				slave_id, rte_strerror(-ret));
> +				"Member (port %u) link get failed: %s\n",
> +				member_id, rte_strerror(-ret));
>   		}
>   
>   		if (ret >= 0 && link_info.link_status != 0) {
> @@ -895,8 +895,8 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   			key = 0;
>   		}
>   
> -		rte_eth_macaddr_get(slave_id, &slave_addr);
> -		port = &bond_mode_8023ad_ports[slave_id];
> +		rte_eth_macaddr_get(member_id, &member_addr);
> +		port = &bond_mode_8023ad_ports[member_id];
>   
>   		key = rte_cpu_to_be_16(key);
>   		if (key != port->actor.key) {
> @@ -907,16 +907,16 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   			SM_FLAG_SET(port, NTT);
>   		}
>   
> -		if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) {
> -			rte_ether_addr_copy(&slave_addr, &port->actor.system);
> -			if (port->aggregator_port_id == slave_id)
> +		if (!rte_is_same_ether_addr(&port->actor.system, &member_addr)) {
> +			rte_ether_addr_copy(&member_addr, &port->actor.system);
> +			if (port->aggregator_port_id == member_id)
>   				SM_FLAG_SET(port, NTT);
>   		}
>   	}
>   
> -	for (i = 0; i < internals->active_slave_count; i++) {
> -		slave_id = internals->active_slaves[i];
> -		port = &bond_mode_8023ad_ports[slave_id];
> +	for (i = 0; i < internals->active_member_count; i++) {
> +		member_id = internals->active_members[i];
> +		port = &bond_mode_8023ad_ports[member_id];
>   
>   		if ((port->actor.key &
>   				rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) == 0) {
> @@ -947,19 +947,19 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   			if (retval != 0)
>   				lacp_pkt = NULL;
>   
> -			rx_machine_update(internals, slave_id, lacp_pkt);
> +			rx_machine_update(internals, member_id, lacp_pkt);
>   		} else {
>   			bond_mode_8023ad_dedicated_rxq_process(internals,
> -					slave_id);
> +					member_id);
>   		}
>   
> -		periodic_machine(internals, slave_id);
> -		mux_machine(internals, slave_id);
> -		tx_machine(internals, slave_id);
> -		selection_logic(internals, slave_id);
> +		periodic_machine(internals, member_id);
> +		mux_machine(internals, member_id);
> +		tx_machine(internals, member_id);
> +		selection_logic(internals, member_id);
>   
>   		SM_FLAG_CLR(port, BEGIN);
> -		show_warnings(slave_id);
> +		show_warnings(member_id);
>   	}
>   
>   	rte_eal_alarm_set(internals->mode4.update_timeout_us,
> @@ -967,34 +967,34 @@ bond_mode_8023ad_periodic_cb(void *arg)
>   }
>   
>   static int
> -bond_mode_8023ad_register_lacp_mac(uint16_t slave_id)
> +bond_mode_8023ad_register_lacp_mac(uint16_t member_id)
>   {
>   	int ret;
>   
> -	ret = rte_eth_allmulticast_enable(slave_id);
> +	ret = rte_eth_allmulticast_enable(member_id);
>   	if (ret != 0) {
>   		RTE_BOND_LOG(ERR,
>   			"failed to enable allmulti mode for port %u: %s",
> -			slave_id, rte_strerror(-ret));
> +			member_id, rte_strerror(-ret));
>   	}
> -	if (rte_eth_allmulticast_get(slave_id)) {
> +	if (rte_eth_allmulticast_get(member_id)) {
>   		RTE_BOND_LOG(DEBUG, "forced allmulti for port %u",
> -			     slave_id);
> -		bond_mode_8023ad_ports[slave_id].forced_rx_flags =
> +			     member_id);
> +		bond_mode_8023ad_ports[member_id].forced_rx_flags =
>   				BOND_8023AD_FORCED_ALLMULTI;
>   		return 0;
>   	}
>   
> -	ret = rte_eth_promiscuous_enable(slave_id);
> +	ret = rte_eth_promiscuous_enable(member_id);
>   	if (ret != 0) {
>   		RTE_BOND_LOG(ERR,
>   			"failed to enable promiscuous mode for port %u: %s",
> -			slave_id, rte_strerror(-ret));
> +			member_id, rte_strerror(-ret));
>   	}
> -	if (rte_eth_promiscuous_get(slave_id)) {
> +	if (rte_eth_promiscuous_get(member_id)) {
>   		RTE_BOND_LOG(DEBUG, "forced promiscuous for port %u",
> -			     slave_id);
> -		bond_mode_8023ad_ports[slave_id].forced_rx_flags =
> +			     member_id);
> +		bond_mode_8023ad_ports[member_id].forced_rx_flags =
>   				BOND_8023AD_FORCED_PROMISC;
>   		return 0;
>   	}
> @@ -1003,27 +1003,27 @@ bond_mode_8023ad_register_lacp_mac(uint16_t slave_id)
>   }
>   
>   static void
> -bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id)
> +bond_mode_8023ad_unregister_lacp_mac(uint16_t member_id)
>   {
>   	int ret;
>   
> -	switch (bond_mode_8023ad_ports[slave_id].forced_rx_flags) {
> +	switch (bond_mode_8023ad_ports[member_id].forced_rx_flags) {
>   	case BOND_8023AD_FORCED_ALLMULTI:
> -		RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", slave_id);
> -		ret = rte_eth_allmulticast_disable(slave_id);
> +		RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", member_id);
> +		ret = rte_eth_allmulticast_disable(member_id);
>   		if (ret != 0)
>   			RTE_BOND_LOG(ERR,
>   				"failed to disable allmulti mode for port %u: %s",
> -				slave_id, rte_strerror(-ret));
> +				member_id, rte_strerror(-ret));
>   		break;
>   
>   	case BOND_8023AD_FORCED_PROMISC:
> -		RTE_BOND_LOG(DEBUG, "unset promisc for port %u", slave_id);
> -		ret = rte_eth_promiscuous_disable(slave_id);
> +		RTE_BOND_LOG(DEBUG, "unset promisc for port %u", member_id);
> +		ret = rte_eth_promiscuous_disable(member_id);
>   		if (ret != 0)
>   			RTE_BOND_LOG(ERR,
>   				"failed to disable promiscuous mode for port %u: %s",
> -				slave_id, rte_strerror(-ret));
> +				member_id, rte_strerror(-ret));
>   		break;
>   
>   	default:
> @@ -1032,12 +1032,12 @@ bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id)
>   }
>   
>   void
> -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
> -				uint16_t slave_id)
> +bond_mode_8023ad_activate_member(struct rte_eth_dev *bond_dev,
> +				uint16_t member_id)
>   {
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
>   
> -	struct port *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_id];
>   	struct port_params initial = {
>   			.system = { { 0 } },
>   			.system_priority = rte_cpu_to_be_16(0xFFFF),
> @@ -1053,15 +1053,15 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	struct bond_tx_queue *bd_tx_q;
>   	uint16_t q_id;
>   
> -	/* Given slave mus not be in active list */
> -	RTE_ASSERT(find_slave_by_id(internals->active_slaves,
> -	internals->active_slave_count, slave_id) == internals->active_slave_count);
> +	/* Given member mus not be in active list */
> +	RTE_ASSERT(find_member_by_id(internals->active_members,
> +	internals->active_member_count, member_id) == internals->active_member_count);
>   	RTE_SET_USED(internals); /* used only for assert when enabled */
>   
>   	memcpy(&port->actor, &initial, sizeof(struct port_params));
>   	/* Standard requires that port ID must be grater than 0.
>   	 * Add 1 do get corresponding port_number */
> -	port->actor.port_number = rte_cpu_to_be_16(slave_id + 1);
> +	port->actor.port_number = rte_cpu_to_be_16(member_id + 1);
>   
>   	memcpy(&port->partner, &initial, sizeof(struct port_params));
>   	memcpy(&port->partner_admin, &initial, sizeof(struct port_params));
> @@ -1072,11 +1072,11 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	port->sm_flags = SM_FLAGS_BEGIN;
>   
>   	/* use this port as aggregator */
> -	port->aggregator_port_id = slave_id;
> +	port->aggregator_port_id = member_id;
>   
> -	if (bond_mode_8023ad_register_lacp_mac(slave_id) < 0) {
> -		RTE_BOND_LOG(WARNING, "slave %u is most likely broken and won't receive LACP packets",
> -			     slave_id);
> +	if (bond_mode_8023ad_register_lacp_mac(member_id) < 0) {
> +		RTE_BOND_LOG(WARNING, "member %u is most likely broken and won't receive LACP packets",
> +			     member_id);
>   	}
>   
>   	timer_cancel(&port->warning_timer);
> @@ -1087,22 +1087,24 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	RTE_ASSERT(port->rx_ring == NULL);
>   	RTE_ASSERT(port->tx_ring == NULL);
>   
> -	socket_id = rte_eth_dev_socket_id(slave_id);
> +	socket_id = rte_eth_dev_socket_id(member_id);
>   	if (socket_id == -1)
>   		socket_id = rte_socket_id();
>   
>   	element_size = sizeof(struct slow_protocol_frame) +
>   				RTE_PKTMBUF_HEADROOM;
>   
> -	/* The size of the mempool should be at least:
> -	 * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */
> -	total_tx_desc = BOND_MODE_8023AX_SLAVE_TX_PKTS;
> +	/*
> +	 * The size of the mempool should be at least:
> +	 * the sum of the TX descriptors + BOND_MODE_8023AX_MEMBER_TX_PKTS.
> +	 */
> +	total_tx_desc = BOND_MODE_8023AX_MEMBER_TX_PKTS;
>   	for (q_id = 0; q_id < bond_dev->data->nb_tx_queues; q_id++) {
>   		bd_tx_q = (struct bond_tx_queue*)bond_dev->data->tx_queues[q_id];
>   		total_tx_desc += bd_tx_q->nb_tx_desc;
>   	}
>   
> -	snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool", slave_id);
> +	snprintf(mem_name, RTE_DIM(mem_name), "member_port%u_pool", member_id);
>   	port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc,
>   		RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ?
>   			32 : RTE_MEMPOOL_CACHE_MAX_SIZE,
> @@ -1111,39 +1113,39 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
>   	/* Any memory allocation failure in initialization is critical because
>   	 * resources can't be free, so reinitialization is impossible. */
>   	if (port->mbuf_pool == NULL) {
> -		rte_panic("Slave %u: Failed to create memory pool '%s': %s\n",
> -			slave_id, mem_name, rte_strerror(rte_errno));
> +		rte_panic("Member %u: Failed to create memory pool '%s': %s\n",
> +			member_id, mem_name, rte_strerror(rte_errno));
>   	}
>   
> -	snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_rx", slave_id);
> +	snprintf(mem_name, RTE_DIM(mem_name), "member_%u_rx", member_id);
>   	port->rx_ring = rte_ring_create(mem_name,
> -			rte_align32pow2(BOND_MODE_8023AX_SLAVE_RX_PKTS), socket_id, 0);
> +			rte_align32pow2(BOND_MODE_8023AX_MEMBER_RX_PKTS), socket_id, 0);
>   
>   	if (port->rx_ring == NULL) {
> -		rte_panic("Slave %u: Failed to create rx ring '%s': %s\n", slave_id,
> +		rte_panic("Member %u: Failed to create rx ring '%s': %s\n", member_id,
>   			mem_name, rte_strerror(rte_errno));
>   	}
>   
>   	/* TX ring is at least one pkt longer to make room for marker packet. */
> -	snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_tx", slave_id);
> +	snprintf(mem_name, RTE_DIM(mem_name), "member_%u_tx", member_id);
>   	port->tx_ring = rte_ring_create(mem_name,
> -			rte_align32pow2(BOND_MODE_8023AX_SLAVE_TX_PKTS + 1), socket_id, 0);
> +			rte_align32pow2(BOND_MODE_8023AX_MEMBER_TX_PKTS + 1), socket_id, 0);
>   
>   	if (port->tx_ring == NULL) {
> -		rte_panic("Slave %u: Failed to create tx ring '%s': %s\n", slave_id,
> +		rte_panic("Member %u: Failed to create tx ring '%s': %s\n", member_id,
>   			mem_name, rte_strerror(rte_errno));
>   	}
>   }
>   
>   int
> -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unused,
> -		uint16_t slave_id)
> +bond_mode_8023ad_deactivate_member(struct rte_eth_dev *bond_dev __rte_unused,
> +		uint16_t member_id)
>   {
>   	void *pkt = NULL;
>   	struct port *port = NULL;
>   	uint8_t old_partner_state;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   
>   	ACTOR_STATE_CLR(port, AGGREGATION);
>   	port->selected = UNSELECTED;
> @@ -1151,7 +1153,7 @@ bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unused,
>   	old_partner_state = port->partner_state;
>   	record_default(port);
>   
> -	bond_mode_8023ad_unregister_lacp_mac(slave_id);
> +	bond_mode_8023ad_unregister_lacp_mac(member_id);
>   
>   	/* If partner timeout state changes then disable timer */
>   	if (!((old_partner_state ^ port->partner_state) &
> @@ -1174,30 +1176,30 @@ void
>   bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev)
>   {
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
> -	struct rte_ether_addr slave_addr;
> -	struct port *slave, *agg_slave;
> -	uint16_t slave_id, i, j;
> +	struct rte_ether_addr member_addr;
> +	struct port *member, *agg_member;
> +	uint16_t member_id, i, j;
>   
>   	bond_mode_8023ad_stop(bond_dev);
>   
> -	for (i = 0; i < internals->active_slave_count; i++) {
> -		slave_id = internals->active_slaves[i];
> -		slave = &bond_mode_8023ad_ports[slave_id];
> -		rte_eth_macaddr_get(slave_id, &slave_addr);
> +	for (i = 0; i < internals->active_member_count; i++) {
> +		member_id = internals->active_members[i];
> +		member = &bond_mode_8023ad_ports[member_id];
> +		rte_eth_macaddr_get(member_id, &member_addr);
>   
> -		if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system))
> +		if (rte_is_same_ether_addr(&member_addr, &member->actor.system))
>   			continue;
>   
> -		rte_ether_addr_copy(&slave_addr, &slave->actor.system);
> +		rte_ether_addr_copy(&member_addr, &member->actor.system);
>   		/* Do nothing if this port is not an aggregator. In other case
>   		 * Set NTT flag on every port that use this aggregator. */
> -		if (slave->aggregator_port_id != slave_id)
> +		if (member->aggregator_port_id != member_id)
>   			continue;
>   
> -		for (j = 0; j < internals->active_slave_count; j++) {
> -			agg_slave = &bond_mode_8023ad_ports[internals->active_slaves[j]];
> -			if (agg_slave->aggregator_port_id == slave_id)
> -				SM_FLAG_SET(agg_slave, NTT);
> +		for (j = 0; j < internals->active_member_count; j++) {
> +			agg_member = &bond_mode_8023ad_ports[internals->active_members[j]];
> +			if (agg_member->aggregator_port_id == member_id)
> +				SM_FLAG_SET(agg_member, NTT);
>   		}
>   	}
>   
> @@ -1288,9 +1290,9 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev)
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
>   	uint16_t i;
>   
> -	for (i = 0; i < internals->active_slave_count; i++)
> -		bond_mode_8023ad_activate_slave(bond_dev,
> -				internals->active_slaves[i]);
> +	for (i = 0; i < internals->active_member_count; i++)
> +		bond_mode_8023ad_activate_member(bond_dev,
> +				internals->active_members[i]);
>   
>   	return 0;
>   }
> @@ -1326,10 +1328,10 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev)
>   
>   void
>   bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
> -				  uint16_t slave_id, struct rte_mbuf *pkt)
> +				  uint16_t member_id, struct rte_mbuf *pkt)
>   {
>   	struct mode8023ad_private *mode4 = &internals->mode4;
> -	struct port *port = &bond_mode_8023ad_ports[slave_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_id];
>   	struct marker_header *m_hdr;
>   	uint64_t marker_timer, old_marker_timer;
>   	int retval;
> @@ -1362,7 +1364,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
>   		} while (unlikely(retval == 0));
>   
>   		m_hdr->marker.tlv_type_marker = MARKER_TLV_TYPE_RESP;
> -		rte_eth_macaddr_get(slave_id, &m_hdr->eth_hdr.src_addr);
> +		rte_eth_macaddr_get(member_id, &m_hdr->eth_hdr.src_addr);
>   
>   		if (internals->mode4.dedicated_queues.enabled == 0) {
>   			if (rte_ring_enqueue(port->tx_ring, pkt) != 0) {
> @@ -1373,10 +1375,10 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
>   			}
>   		} else {
>   			/* Send packet directly to the slow queue */
> -			uint16_t tx_count = rte_eth_tx_prepare(slave_id,
> +			uint16_t tx_count = rte_eth_tx_prepare(member_id,
>   					internals->mode4.dedicated_queues.tx_qid,
>   					&pkt, 1);
> -			tx_count = rte_eth_tx_burst(slave_id,
> +			tx_count = rte_eth_tx_burst(member_id,
>   					internals->mode4.dedicated_queues.tx_qid,
>   					&pkt, tx_count);
>   			if (tx_count != 1) {
> @@ -1394,7 +1396,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals,
>   				goto free_out;
>   			}
>   		} else
> -			rx_machine_update(internals, slave_id, pkt);
> +			rx_machine_update(internals, member_id, pkt);
>   	} else {
>   		wrn = WRN_UNKNOWN_SLOW_TYPE;
>   		goto free_out;
> @@ -1517,8 +1519,8 @@ rte_eth_bond_8023ad_setup(uint16_t port_id,
>   
>   
>   int
> -rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
> -		struct rte_eth_bond_8023ad_slave_info *info)
> +rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id,
> +		struct rte_eth_bond_8023ad_member_info *info)
>   {
>   	struct rte_eth_dev *bond_dev;
>   	struct bond_dev_private *internals;
> @@ -1531,12 +1533,12 @@ rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
>   	bond_dev = &rte_eth_devices[port_id];
>   
>   	internals = bond_dev->data->dev_private;
> -	if (find_slave_by_id(internals->active_slaves,
> -			internals->active_slave_count, slave_id) ==
> -				internals->active_slave_count)
> +	if (find_member_by_id(internals->active_members,
> +			internals->active_member_count, member_id) ==
> +				internals->active_member_count)
>   		return -EINVAL;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   	info->selected = port->selected;
>   
>   	info->actor_state = port->actor_state;
> @@ -1550,7 +1552,7 @@ rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
>   }
>   
>   static int
> -bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id)
> +bond_8023ad_ext_validate(uint16_t port_id, uint16_t member_id)
>   {
>   	struct rte_eth_dev *bond_dev;
>   	struct bond_dev_private *internals;
> @@ -1565,9 +1567,9 @@ bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id)
>   		return -EINVAL;
>   
>   	internals = bond_dev->data->dev_private;
> -	if (find_slave_by_id(internals->active_slaves,
> -			internals->active_slave_count, slave_id) ==
> -				internals->active_slave_count)
> +	if (find_member_by_id(internals->active_members,
> +			internals->active_member_count, member_id) ==
> +				internals->active_member_count)
>   		return -EINVAL;
>   
>   	mode4 = &internals->mode4;
> @@ -1578,17 +1580,17 @@ bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id)
>   }
>   
>   int
> -rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t member_id,
>   				int enabled)
>   {
>   	struct port *port;
>   	int res;
>   
> -	res = bond_8023ad_ext_validate(port_id, slave_id);
> +	res = bond_8023ad_ext_validate(port_id, member_id);
>   	if (res != 0)
>   		return res;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   
>   	if (enabled)
>   		ACTOR_STATE_SET(port, COLLECTING);
> @@ -1599,17 +1601,17 @@ rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id,
>   }
>   
>   int
> -rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t member_id,
>   				int enabled)
>   {
>   	struct port *port;
>   	int res;
>   
> -	res = bond_8023ad_ext_validate(port_id, slave_id);
> +	res = bond_8023ad_ext_validate(port_id, member_id);
>   	if (res != 0)
>   		return res;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   
>   	if (enabled)
>   		ACTOR_STATE_SET(port, DISTRIBUTING);
> @@ -1620,45 +1622,45 @@ rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id,
>   }
>   
>   int
> -rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id)
> +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t member_id)
>   {
>   	struct port *port;
>   	int err;
>   
> -	err = bond_8023ad_ext_validate(port_id, slave_id);
> +	err = bond_8023ad_ext_validate(port_id, member_id);
>   	if (err != 0)
>   		return err;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   	return ACTOR_STATE(port, DISTRIBUTING);
>   }
>   
>   int
> -rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id)
> +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t member_id)
>   {
>   	struct port *port;
>   	int err;
>   
> -	err = bond_8023ad_ext_validate(port_id, slave_id);
> +	err = bond_8023ad_ext_validate(port_id, member_id);
>   	if (err != 0)
>   		return err;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   	return ACTOR_STATE(port, COLLECTING);
>   }
>   
>   int
> -rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t member_id,
>   		struct rte_mbuf *lacp_pkt)
>   {
>   	struct port *port;
>   	int res;
>   
> -	res = bond_8023ad_ext_validate(port_id, slave_id);
> +	res = bond_8023ad_ext_validate(port_id, member_id);
>   	if (res != 0)
>   		return res;
>   
> -	port = &bond_mode_8023ad_ports[slave_id];
> +	port = &bond_mode_8023ad_ports[member_id];
>   
>   	if (rte_pktmbuf_pkt_len(lacp_pkt) < sizeof(struct lacpdu_header))
>   		return -EINVAL;
> @@ -1683,11 +1685,11 @@ bond_mode_8023ad_ext_periodic_cb(void *arg)
>   	struct mode8023ad_private *mode4 = &internals->mode4;
>   	struct port *port;
>   	void *pkt = NULL;
> -	uint16_t i, slave_id;
> +	uint16_t i, member_id;
>   
> -	for (i = 0; i < internals->active_slave_count; i++) {
> -		slave_id = internals->active_slaves[i];
> -		port = &bond_mode_8023ad_ports[slave_id];
> +	for (i = 0; i < internals->active_member_count; i++) {
> +		member_id = internals->active_members[i];
> +		port = &bond_mode_8023ad_ports[member_id];
>   
>   		if (rte_ring_dequeue(port->rx_ring, &pkt) == 0) {
>   			struct rte_mbuf *lacp_pkt = pkt;
> @@ -1700,7 +1702,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg)
>   			/* This is LACP frame so pass it to rx callback.
>   			 * Callback is responsible for freeing mbuf.
>   			 */
> -			mode4->slowrx_cb(slave_id, lacp_pkt);
> +			mode4->slowrx_cb(member_id, lacp_pkt);
>   		}
>   	}
>   
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h
> index 921b4446b7..589141d42c 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.h
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h
> @@ -35,7 +35,7 @@ extern "C" {
>   #define MARKER_TLV_TYPE_INFO                0x01
>   #define MARKER_TLV_TYPE_RESP                0x02
>   
> -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id,
> +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t member_id,
>   						  struct rte_mbuf *lacp_pkt);
>   
>   enum rte_bond_8023ad_selection {
> @@ -66,13 +66,13 @@ struct port_params {
>   	uint16_t system_priority;
>   	/**< System priority (unused in current implementation) */
>   	struct rte_ether_addr system;
> -	/**< System ID - Slave MAC address, same as bonding MAC address */
> +	/**< System ID - Member MAC address, same as bonding MAC address */
>   	uint16_t key;
>   	/**< Speed information (implementation dependent) and duplex. */
>   	uint16_t port_priority;
>   	/**< Priority of this (unused in current implementation) */
>   	uint16_t port_number;
> -	/**< Port number. It corresponds to slave port id. */
> +	/**< Port number. It corresponds to member port id. */
>   } __rte_packed __rte_aligned(2);
>   
>   struct lacpdu_actor_partner_params {
> @@ -141,7 +141,7 @@ struct rte_eth_bond_8023ad_conf {
>   	enum rte_bond_8023ad_agg_selection agg_selection;
>   };
>   
> -struct rte_eth_bond_8023ad_slave_info {
> +struct rte_eth_bond_8023ad_member_info {
>   	enum rte_bond_8023ad_selection selected;
>   	uint8_t actor_state;
>   	struct port_params actor;
> @@ -184,100 +184,101 @@ rte_eth_bond_8023ad_setup(uint16_t port_id,
>   /**
>    * @internal
>    *
> - * Function returns current state of given slave device.
> + * Function returns current state of given member device.
>    *
> - * @param slave_id  Port id of valid slave.
> + * @param member_id  Port id of valid member.
>    * @param conf		buffer for configuration
>    * @return
>    *   0 - if ok
> - *   -EINVAL if conf is NULL or slave id is invalid (not a slave of given
> + *   -EINVAL if conf is NULL or member id is invalid (not a member of given
>    *       bonded device or is not inactive).
>    */
> +__rte_experimental
>   int
> -rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id,
> -		struct rte_eth_bond_8023ad_slave_info *conf);
> +rte_eth_bond_8023ad_member_info(uint16_t port_id, uint16_t member_id,
> +		struct rte_eth_bond_8023ad_member_info *conf);
>   
>   /**
> - * Configure a slave port to start collecting.
> + * Configure a member port to start collecting.
>    *
>    * @param port_id	Bonding device id
> - * @param slave_id	Port id of valid slave.
> + * @param member_id	Port id of valid member.
>    * @param enabled	Non-zero when collection enabled.
>    * @return
>    *   0 - if ok
> - *   -EINVAL if slave is not valid.
> + *   -EINVAL if member is not valid.
>    */
>   int
> -rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t member_id,
>   				int enabled);
>   
>   /**
> - * Get COLLECTING flag from slave port actor state.
> + * Get COLLECTING flag from member port actor state.
>    *
>    * @param port_id	Bonding device id
> - * @param slave_id	Port id of valid slave.
> + * @param member_id	Port id of valid member.
>    * @return
>    *   0 - if not set
>    *   1 - if set
> - *   -EINVAL if slave is not valid.
> + *   -EINVAL if member is not valid.
>    */
>   int
> -rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id);
> +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t member_id);
>   
>   /**
> - * Configure a slave port to start distributing.
> + * Configure a member port to start distributing.
>    *
>    * @param port_id	Bonding device id
> - * @param slave_id	Port id of valid slave.
> + * @param member_id	Port id of valid member.
>    * @param enabled	Non-zero when distribution enabled.
>    * @return
>    *   0 - if ok
> - *   -EINVAL if slave is not valid.
> + *   -EINVAL if member is not valid.
>    */
>   int
> -rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t member_id,
>   				int enabled);
>   
>   /**
> - * Get DISTRIBUTING flag from slave port actor state.
> + * Get DISTRIBUTING flag from member port actor state.
>    *
>    * @param port_id	Bonding device id
> - * @param slave_id	Port id of valid slave.
> + * @param member_id	Port id of valid member.
>    * @return
>    *   0 - if not set
>    *   1 - if set
> - *   -EINVAL if slave is not valid.
> + *   -EINVAL if member is not valid.
>    */
>   int
> -rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id);
> +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t member_id);
>   
>   /**
>    * LACPDU transmit path for external 802.3ad state machine.  Caller retains
>    * ownership of the packet on failure.
>    *
>    * @param port_id	Bonding device id
> - * @param slave_id	Port ID of valid slave device.
> + * @param member_id	Port ID of valid member device.
>    * @param lacp_pkt	mbuf containing LACPDU.
>    *
>    * @return
>    *   0 on success, negative value otherwise.
>    */
>   int
> -rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id,
> +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t member_id,
>   		struct rte_mbuf *lacp_pkt);
>   
>   /**
> - * Enable dedicated hw queues for 802.3ad control plane traffic on slaves
> + * Enable dedicated hw queues for 802.3ad control plane traffic on members
>    *
> - * This function creates an additional tx and rx queue on each slave for
> + * This function creates an additional tx and rx queue on each member for
>    * dedicated 802.3ad control plane traffic . A flow filtering rule is
> - * programmed on each slave to redirect all LACP slow packets to that rx queue
> + * programmed on each member to redirect all LACP slow packets to that rx queue
>    * for processing in the LACP state machine, this removes the need to filter
>    * these packets in the bonded devices data path. The additional tx queue is
>    * used to enable the LACP state machine to enqueue LACP packets directly to
> - * slave hw independently of the bonded devices data path.
> + * member hw independently of the bonded devices data path.
>    *
> - * To use this feature all slaves must support the programming of the flow
> + * To use this feature all members must support the programming of the flow
>    * filter rule required for rx and have enough queues that one rx and tx queue
>    * can be reserved for the LACP state machines control packets.
>    *
> @@ -292,7 +293,7 @@ int
>   rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id);
>   
>   /**
> - * Disable slow queue on slaves
> + * Disable slow queue on members
>    *
>    * This function disables hardware slow packet filter.
>    *
> diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c
> index 86335a7971..56945e2349 100644
> --- a/drivers/net/bonding/rte_eth_bond_alb.c
> +++ b/drivers/net/bonding/rte_eth_bond_alb.c
> @@ -19,13 +19,13 @@ simple_hash(uint8_t *hash_start, int hash_size)
>   }
>   
>   static uint16_t
> -calculate_slave(struct bond_dev_private *internals)
> +calculate_member(struct bond_dev_private *internals)
>   {
>   	uint16_t idx;
>   
> -	idx = (internals->mode6.last_slave + 1) % internals->active_slave_count;
> -	internals->mode6.last_slave = idx;
> -	return internals->active_slaves[idx];
> +	idx = (internals->mode6.last_member + 1) % internals->active_member_count;
> +	internals->mode6.last_member = idx;
> +	return internals->active_members[idx];
>   }
>   
>   int
> @@ -41,7 +41,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)
>   	/* Fill hash table with initial values */
>   	memset(hash_table, 0, sizeof(struct client_data) * ALB_HASH_TABLE_SIZE);
>   	rte_spinlock_init(&internals->mode6.lock);
> -	internals->mode6.last_slave = ALB_NULL_INDEX;
> +	internals->mode6.last_member = ALB_NULL_INDEX;
>   	internals->mode6.ntt = 0;
>   
>   	/* Initialize memory pool for ARP packets to send */
> @@ -96,7 +96,7 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,
>   	/*
>   	 * We got reply for ARP Request send by the application. We need to
>   	 * update client table when received data differ from what is stored
> -	 * in ALB table and issue sending update packet to that slave.
> +	 * in ALB table and issue sending update packet to that member.
>   	 */
>   	rte_spinlock_lock(&internals->mode6.lock);
>   	if (client_info->in_use == 0 ||
> @@ -112,8 +112,8 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,
>   		client_info->cli_ip = arp->arp_data.arp_sip;
>   		rte_ether_addr_copy(&arp->arp_data.arp_sha,
>   				&client_info->cli_mac);
> -		client_info->slave_idx = calculate_slave(internals);
> -		rte_eth_macaddr_get(client_info->slave_idx,
> +		client_info->member_idx = calculate_member(internals);
> +		rte_eth_macaddr_get(client_info->member_idx,
>   				&client_info->app_mac);
>   		rte_ether_addr_copy(&client_info->app_mac,
>   				&arp->arp_data.arp_tha);
> @@ -166,33 +166,33 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset,
>   						&arp->arp_data.arp_tha,
>   						&client_info->cli_mac);
>   				}
> -				rte_eth_macaddr_get(client_info->slave_idx,
> +				rte_eth_macaddr_get(client_info->member_idx,
>   						&client_info->app_mac);
>   				rte_ether_addr_copy(&client_info->app_mac,
>   						&arp->arp_data.arp_sha);
>   				memcpy(client_info->vlan, eth_h + 1, offset);
>   				client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr);
>   				rte_spinlock_unlock(&internals->mode6.lock);
> -				return client_info->slave_idx;
> +				return client_info->member_idx;
>   			}
>   		}
>   
> -		/* Assign new slave to this client and update src mac in ARP */
> +		/* Assign new member to this client and update src mac in ARP */
>   		client_info->in_use = 1;
>   		client_info->ntt = 0;
>   		client_info->app_ip = arp->arp_data.arp_sip;
>   		rte_ether_addr_copy(&arp->arp_data.arp_tha,
>   				&client_info->cli_mac);
>   		client_info->cli_ip = arp->arp_data.arp_tip;
> -		client_info->slave_idx = calculate_slave(internals);
> -		rte_eth_macaddr_get(client_info->slave_idx,
> +		client_info->member_idx = calculate_member(internals);
> +		rte_eth_macaddr_get(client_info->member_idx,
>   				&client_info->app_mac);
>   		rte_ether_addr_copy(&client_info->app_mac,
>   				&arp->arp_data.arp_sha);
>   		memcpy(client_info->vlan, eth_h + 1, offset);
>   		client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr);
>   		rte_spinlock_unlock(&internals->mode6.lock);
> -		return client_info->slave_idx;
> +		return client_info->member_idx;
>   	}
>   
>   	/* If packet is not ARP Reply, send it on current primary port. */
> @@ -208,7 +208,7 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
>   {
>   	struct rte_ether_hdr *eth_h;
>   	struct rte_arp_hdr *arp_h;
> -	uint16_t slave_idx;
> +	uint16_t member_idx;
>   
>   	rte_spinlock_lock(&internals->mode6.lock);
>   	eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
> @@ -238,10 +238,10 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
>   	arp_h->arp_plen = sizeof(uint32_t);
>   	arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
>   
> -	slave_idx = client_info->slave_idx;
> +	member_idx = client_info->member_idx;
>   	rte_spinlock_unlock(&internals->mode6.lock);
>   
> -	return slave_idx;
> +	return member_idx;
>   }
>   
>   void
> @@ -252,18 +252,18 @@ bond_mode_alb_client_list_upd(struct rte_eth_dev *bond_dev)
>   
>   	int i;
>   
> -	/* If active slave count is 0, it's pointless to refresh alb table */
> -	if (internals->active_slave_count <= 0)
> +	/* If active member count is 0, it's pointless to refresh alb table */
> +	if (internals->active_member_count <= 0)
>   		return;
>   
>   	rte_spinlock_lock(&internals->mode6.lock);
> -	internals->mode6.last_slave = ALB_NULL_INDEX;
> +	internals->mode6.last_member = ALB_NULL_INDEX;
>   
>   	for (i = 0; i < ALB_HASH_TABLE_SIZE; i++) {
>   		client_info = &internals->mode6.client_table[i];
>   		if (client_info->in_use) {
> -			client_info->slave_idx = calculate_slave(internals);
> -			rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac);
> +			client_info->member_idx = calculate_member(internals);
> +			rte_eth_macaddr_get(client_info->member_idx, &client_info->app_mac);
>   			internals->mode6.ntt = 1;
>   		}
>   	}
> diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h
> index 4e9aeda9bc..beb2e619f9 100644
> --- a/drivers/net/bonding/rte_eth_bond_alb.h
> +++ b/drivers/net/bonding/rte_eth_bond_alb.h
> @@ -22,8 +22,8 @@ struct client_data {
>   	uint32_t cli_ip;
>   	/**< Client IP address */
>   
> -	uint16_t slave_idx;
> -	/**< Index of slave on which we connect with that client */
> +	uint16_t member_idx;
> +	/**< Index of member on which we connect with that client */
>   	uint8_t in_use;
>   	/**< Flag indicating if entry in client table is currently used */
>   	uint8_t ntt;
> @@ -42,8 +42,8 @@ struct mode_alb_private {
>   	/**< Mempool for creating ARP update packets */
>   	uint8_t ntt;
>   	/**< Flag indicating if we need to send update to any client on next tx */
> -	uint32_t last_slave;
> -	/**< Index of last used slave in client table */
> +	uint32_t last_member;
> +	/**< Index of last used member in client table */
>   	rte_spinlock_t lock;
>   };
>   
> @@ -72,9 +72,9 @@ bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,
>   		struct bond_dev_private *internals);
>   
>   /**
> - * Function handles ARP packet transmission. It also decides on which slave
> - * send that packet. If packet is ARP Request, it is send on primary slave.
> - * If it is ARP Reply, it is send on slave stored in client table for that
> + * Function handles ARP packet transmission. It also decides on which member
> + * send that packet. If packet is ARP Request, it is send on primary member.
> + * If it is ARP Reply, it is send on member stored in client table for that
>    * connection. On Reply function also updates data in client table.
>    *
>    * @param eth_h			ETH header of transmitted packet.
> @@ -82,7 +82,7 @@ bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,
>    * @param internals		Bonding data.
>    *
>    * @return
> - * Index of slave on which packet should be sent.
> + * Index of member on which packet should be sent.
>    */
>   uint16_t
>   bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset,
> @@ -96,14 +96,14 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset,
>    * @param internals		Bonding data.
>    *
>    * @return
> - * Index of slave on which packet should be sent.
> + * Index of member on which packet should be sent.
>    */
>   uint16_t
>   bond_mode_alb_arp_upd(struct client_data *client_info,
>   		struct rte_mbuf *pkt, struct bond_dev_private *internals);
>   
>   /**
> - * Function updates slave indexes of active connections.
> + * Function updates member indexes of active connections.
>    *
>    * @param bond_dev		Pointer to bonded device struct.
>    */
> diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
> index 8b6cdce34a..b366c02564 100644
> --- a/drivers/net/bonding/rte_eth_bond_api.c
> +++ b/drivers/net/bonding/rte_eth_bond_api.c
> @@ -37,7 +37,7 @@ valid_bonded_port_id(uint16_t port_id)
>   }
>   
>   int
> -check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev)
> +check_for_main_bonded_ethdev(const struct rte_eth_dev *eth_dev)
>   {
>   	int i;
>   	struct bond_dev_private *internals;
> @@ -47,31 +47,31 @@ check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev)
>   
>   	internals = eth_dev->data->dev_private;
>   
> -	/* Check if any of slave devices is a bonded device */
> -	for (i = 0; i < internals->slave_count; i++)
> -		if (valid_bonded_port_id(internals->slaves[i].port_id) == 0)
> +	/* Check if any of member devices is a bonded device */
> +	for (i = 0; i < internals->member_count; i++)
> +		if (valid_bonded_port_id(internals->members[i].port_id) == 0)
>   			return 1;
>   
>   	return 0;
>   }
>   
>   int
> -valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_port_id)
> +valid_member_port_id(struct bond_dev_private *internals, uint16_t member_port_id)
>   {
> -	RTE_ETH_VALID_PORTID_OR_ERR_RET(slave_port_id, -1);
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(member_port_id, -1);
>   
> -	/* Verify that slave_port_id refers to a non bonded port */
> -	if (check_for_bonded_ethdev(&rte_eth_devices[slave_port_id]) == 0 &&
> +	/* Verify that member_port_id refers to a non bonded port */
> +	if (check_for_bonded_ethdev(&rte_eth_devices[member_port_id]) == 0 &&
>   			internals->mode == BONDING_MODE_8023AD) {
> -		RTE_BOND_LOG(ERR, "Cannot add slave to bonded device in 802.3ad"
> -				" mode as slave is also a bonded device, only "
> +		RTE_BOND_LOG(ERR, "Cannot add member to bonded device in 802.3ad"
> +				" mode as member is also a bonded device, only "
>   				"physical devices can be support in this mode.");
>   		return -1;
>   	}
>   
> -	if (internals->port_id == slave_port_id) {
> +	if (internals->port_id == member_port_id) {
>   		RTE_BOND_LOG(ERR,
> -			"Cannot add the bonded device itself as its slave.");
> +			"Cannot add the bonded device itself as its member.");
>   		return -1;
>   	}
>   
> @@ -79,61 +79,63 @@ valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_port_id)
>   }
>   
>   void
> -activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id)
> +activate_member(struct rte_eth_dev *eth_dev, uint16_t port_id)
>   {
>   	struct bond_dev_private *internals = eth_dev->data->dev_private;
> -	uint16_t active_count = internals->active_slave_count;
> +	uint16_t active_count = internals->active_member_count;
>   
>   	if (internals->mode == BONDING_MODE_8023AD)
> -		bond_mode_8023ad_activate_slave(eth_dev, port_id);
> +		bond_mode_8023ad_activate_member(eth_dev, port_id);
>   
>   	if (internals->mode == BONDING_MODE_TLB
>   			|| internals->mode == BONDING_MODE_ALB) {
>   
> -		internals->tlb_slaves_order[active_count] = port_id;
> +		internals->tlb_members_order[active_count] = port_id;
>   	}
>   
> -	RTE_ASSERT(internals->active_slave_count <
> -			(RTE_DIM(internals->active_slaves) - 1));
> +	RTE_ASSERT(internals->active_member_count <
> +			(RTE_DIM(internals->active_members) - 1));
>   
> -	internals->active_slaves[internals->active_slave_count] = port_id;
> -	internals->active_slave_count++;
> +	internals->active_members[internals->active_member_count] = port_id;
> +	internals->active_member_count++;
>   
>   	if (internals->mode == BONDING_MODE_TLB)
> -		bond_tlb_activate_slave(internals);
> +		bond_tlb_activate_member(internals);
>   	if (internals->mode == BONDING_MODE_ALB)
>   		bond_mode_alb_client_list_upd(eth_dev);
>   }
>   
>   void
> -deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id)
> +deactivate_member(struct rte_eth_dev *eth_dev, uint16_t port_id)
>   {
> -	uint16_t slave_pos;
> +	uint16_t member_pos;
>   	struct bond_dev_private *internals = eth_dev->data->dev_private;
> -	uint16_t active_count = internals->active_slave_count;
> +	uint16_t active_count = internals->active_member_count;
>   
>   	if (internals->mode == BONDING_MODE_8023AD) {
>   		bond_mode_8023ad_stop(eth_dev);
> -		bond_mode_8023ad_deactivate_slave(eth_dev, port_id);
> +		bond_mode_8023ad_deactivate_member(eth_dev, port_id);
>   	} else if (internals->mode == BONDING_MODE_TLB
>   			|| internals->mode == BONDING_MODE_ALB)
>   		bond_tlb_disable(internals);
>   
> -	slave_pos = find_slave_by_id(internals->active_slaves, active_count,
> +	member_pos = find_member_by_id(internals->active_members, active_count,
>   			port_id);
>   
> -	/* If slave was not at the end of the list
> -	 * shift active slaves up active array list */
> -	if (slave_pos < active_count) {
> +	/*
> +	 * If member was not at the end of the list
> +	 * shift active members up active array list.
> +	 */
> +	if (member_pos < active_count) {
>   		active_count--;
> -		memmove(internals->active_slaves + slave_pos,
> -				internals->active_slaves + slave_pos + 1,
> -				(active_count - slave_pos) *
> -					sizeof(internals->active_slaves[0]));
> +		memmove(internals->active_members + member_pos,
> +				internals->active_members + member_pos + 1,
> +				(active_count - member_pos) *
> +					sizeof(internals->active_members[0]));
>   	}
>   
> -	RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves));
> -	internals->active_slave_count = active_count;
> +	RTE_ASSERT(active_count < RTE_DIM(internals->active_members));
> +	internals->active_member_count = active_count;
>   
>   	if (eth_dev->data->dev_started) {
>   		if (internals->mode == BONDING_MODE_8023AD) {
> @@ -192,7 +194,7 @@ rte_eth_bond_free(const char *name)
>   }
>   
>   static int
> -slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id)
> +member_vlan_filter_set(uint16_t bonded_port_id, uint16_t member_port_id)
>   {
>   	struct rte_eth_dev *bonded_eth_dev;
>   	struct bond_dev_private *internals;
> @@ -224,7 +226,7 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id)
>   			if (unlikely(slab & mask)) {
>   				uint16_t vlan_id = pos + i;
>   
> -				res = rte_eth_dev_vlan_filter(slave_port_id,
> +				res = rte_eth_dev_vlan_filter(member_port_id,
>   							      vlan_id, 1);
>   			}
>   		}
> @@ -236,45 +238,45 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id)
>   }
>   
>   static int
> -slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals)
> +member_rte_flow_prepare(uint16_t member_id, struct bond_dev_private *internals)
>   {
>   	struct rte_flow *flow;
>   	struct rte_flow_error ferror;
> -	uint16_t slave_port_id = internals->slaves[slave_id].port_id;
> +	uint16_t member_port_id = internals->members[member_id].port_id;
>   
>   	if (internals->flow_isolated_valid != 0) {
> -		if (rte_eth_dev_stop(slave_port_id) != 0) {
> +		if (rte_eth_dev_stop(member_port_id) != 0) {
>   			RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
> -				     slave_port_id);
> +				     member_port_id);
>   			return -1;
>   		}
>   
> -		if (rte_flow_isolate(slave_port_id, internals->flow_isolated,
> +		if (rte_flow_isolate(member_port_id, internals->flow_isolated,
>   		    &ferror)) {
> -			RTE_BOND_LOG(ERR, "rte_flow_isolate failed for slave"
> -				     " %d: %s", slave_id, ferror.message ?
> +			RTE_BOND_LOG(ERR, "rte_flow_isolate failed for member"
> +				     " %d: %s", member_id, ferror.message ?
>   				     ferror.message : "(no stated reason)");
>   			return -1;
>   		}
>   	}
>   	TAILQ_FOREACH(flow, &internals->flow_list, next) {
> -		flow->flows[slave_id] = rte_flow_create(slave_port_id,
> +		flow->flows[member_id] = rte_flow_create(member_port_id,
>   							flow->rule.attr,
>   							flow->rule.pattern,
>   							flow->rule.actions,
>   							&ferror);
> -		if (flow->flows[slave_id] == NULL) {
> -			RTE_BOND_LOG(ERR, "Cannot create flow for slave"
> -				     " %d: %s", slave_id,
> +		if (flow->flows[member_id] == NULL) {
> +			RTE_BOND_LOG(ERR, "Cannot create flow for member"
> +				     " %d: %s", member_id,
>   				     ferror.message ? ferror.message :
>   				     "(no stated reason)");
> -			/* Destroy successful bond flows from the slave */
> +			/* Destroy successful bond flows from the member */
>   			TAILQ_FOREACH(flow, &internals->flow_list, next) {
> -				if (flow->flows[slave_id] != NULL) {
> -					rte_flow_destroy(slave_port_id,
> -							 flow->flows[slave_id],
> +				if (flow->flows[member_id] != NULL) {
> +					rte_flow_destroy(member_port_id,
> +							 flow->flows[member_id],
>   							 &ferror);
> -					flow->flows[slave_id] = NULL;
> +					flow->flows[member_id] = NULL;
>   				}
>   			}
>   			return -1;
> @@ -284,7 +286,7 @@ slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals)
>   }
>   
>   static void
> -eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals,
> +eth_bond_member_inherit_dev_info_rx_first(struct bond_dev_private *internals,
>   					 const struct rte_eth_dev_info *di)
>   {
>   	struct rte_eth_rxconf *rxconf_i = &internals->default_rxconf;
> @@ -292,20 +294,20 @@ eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals,
>   	internals->reta_size = di->reta_size;
>   	internals->rss_key_len = di->hash_key_size;
>   
> -	/* Inherit Rx offload capabilities from the first slave device */
> +	/* Inherit Rx offload capabilities from the first member device */
>   	internals->rx_offload_capa = di->rx_offload_capa;
>   	internals->rx_queue_offload_capa = di->rx_queue_offload_capa;
>   	internals->flow_type_rss_offloads = di->flow_type_rss_offloads;
>   
> -	/* Inherit maximum Rx packet size from the first slave device */
> +	/* Inherit maximum Rx packet size from the first member device */
>   	internals->candidate_max_rx_pktlen = di->max_rx_pktlen;
>   
> -	/* Inherit default Rx queue settings from the first slave device */
> +	/* Inherit default Rx queue settings from the first member device */
>   	memcpy(rxconf_i, &di->default_rxconf, sizeof(*rxconf_i));
>   
>   	/*
>   	 * Turn off descriptor prefetch and writeback by default for all
> -	 * slave devices. Applications may tweak this setting if need be.
> +	 * member devices. Applications may tweak this setting if need be.
>   	 */
>   	rxconf_i->rx_thresh.pthresh = 0;
>   	rxconf_i->rx_thresh.hthresh = 0;
> @@ -314,26 +316,26 @@ eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals,
>   	/* Setting this to zero should effectively enable default values */
>   	rxconf_i->rx_free_thresh = 0;
>   
> -	/* Disable deferred start by default for all slave devices */
> +	/* Disable deferred start by default for all member devices */
>   	rxconf_i->rx_deferred_start = 0;
>   }
>   
>   static void
> -eth_bond_slave_inherit_dev_info_tx_first(struct bond_dev_private *internals,
> +eth_bond_member_inherit_dev_info_tx_first(struct bond_dev_private *internals,
>   					 const struct rte_eth_dev_info *di)
>   {
>   	struct rte_eth_txconf *txconf_i = &internals->default_txconf;
>   
> -	/* Inherit Tx offload capabilities from the first slave device */
> +	/* Inherit Tx offload capabilities from the first member device */
>   	internals->tx_offload_capa = di->tx_offload_capa;
>   	internals->tx_queue_offload_capa = di->tx_queue_offload_capa;
>   
> -	/* Inherit default Tx queue settings from the first slave device */
> +	/* Inherit default Tx queue settings from the first member device */
>   	memcpy(txconf_i, &di->default_txconf, sizeof(*txconf_i));
>   
>   	/*
>   	 * Turn off descriptor prefetch and writeback by default for all
> -	 * slave devices. Applications may tweak this setting if need be.
> +	 * member devices. Applications may tweak this setting if need be.
>   	 */
>   	txconf_i->tx_thresh.pthresh = 0;
>   	txconf_i->tx_thresh.hthresh = 0;
> @@ -341,17 +343,17 @@ eth_bond_slave_inherit_dev_info_tx_first(struct bond_dev_private *internals,
>   
>   	/*
>   	 * Setting these parameters to zero assumes that default
> -	 * values will be configured implicitly by slave devices.
> +	 * values will be configured implicitly by member devices.
>   	 */
>   	txconf_i->tx_free_thresh = 0;
>   	txconf_i->tx_rs_thresh = 0;
>   
> -	/* Disable deferred start by default for all slave devices */
> +	/* Disable deferred start by default for all member devices */
>   	txconf_i->tx_deferred_start = 0;
>   }
>   
>   static void
> -eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals,
> +eth_bond_member_inherit_dev_info_rx_next(struct bond_dev_private *internals,
>   					const struct rte_eth_dev_info *di)
>   {
>   	struct rte_eth_rxconf *rxconf_i = &internals->default_rxconf;
> @@ -362,32 +364,32 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals,
>   	internals->flow_type_rss_offloads &= di->flow_type_rss_offloads;
>   
>   	/*
> -	 * If at least one slave device suggests enabling this
> -	 * setting by default, enable it for all slave devices
> +	 * If at least one member device suggests enabling this
> +	 * setting by default, enable it for all member devices
>   	 * since disabling it may not be necessarily supported.
>   	 */
>   	if (rxconf->rx_drop_en == 1)
>   		rxconf_i->rx_drop_en = 1;
>   
>   	/*
> -	 * Adding a new slave device may cause some of previously inherited
> +	 * Adding a new member device may cause some of previously inherited
>   	 * offloads to be withdrawn from the internal rx_queue_offload_capa
>   	 * value. Thus, the new internal value of default Rx queue offloads
>   	 * has to be masked by rx_queue_offload_capa to make sure that only
>   	 * commonly supported offloads are preserved from both the previous
> -	 * value and the value being inherited from the new slave device.
> +	 * value and the value being inherited from the new member device.
>   	 */
>   	rxconf_i->offloads = (rxconf_i->offloads | rxconf->offloads) &
>   			     internals->rx_queue_offload_capa;
>   
>   	/*
> -	 * RETA size is GCD of all slaves RETA sizes, so, if all sizes will be
> +	 * RETA size is GCD of all members RETA sizes, so, if all sizes will be
>   	 * the power of 2, the lower one is GCD
>   	 */
>   	if (internals->reta_size > di->reta_size)
>   		internals->reta_size = di->reta_size;
>   	if (internals->rss_key_len > di->hash_key_size) {
> -		RTE_BOND_LOG(WARNING, "slave has different rss key size, "
> +		RTE_BOND_LOG(WARNING, "member has different rss key size, "
>   				"configuring rss may fail");
>   		internals->rss_key_len = di->hash_key_size;
>   	}
> @@ -398,7 +400,7 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals,
>   }
>   
>   static void
> -eth_bond_slave_inherit_dev_info_tx_next(struct bond_dev_private *internals,
> +eth_bond_member_inherit_dev_info_tx_next(struct bond_dev_private *internals,
>   					const struct rte_eth_dev_info *di)
>   {
>   	struct rte_eth_txconf *txconf_i = &internals->default_txconf;
> @@ -408,34 +410,34 @@ eth_bond_slave_inherit_dev_info_tx_next(struct bond_dev_private *internals,
>   	internals->tx_queue_offload_capa &= di->tx_queue_offload_capa;
>   
>   	/*
> -	 * Adding a new slave device may cause some of previously inherited
> +	 * Adding a new member device may cause some of previously inherited
>   	 * offloads to be withdrawn from the internal tx_queue_offload_capa
>   	 * value. Thus, the new internal value of default Tx queue offloads
>   	 * has to be masked by tx_queue_offload_capa to make sure that only
>   	 * commonly supported offloads are preserved from both the previous
> -	 * value and the value being inherited from the new slave device.
> +	 * value and the value being inherited from the new member device.
>   	 */
>   	txconf_i->offloads = (txconf_i->offloads | txconf->offloads) &
>   			     internals->tx_queue_offload_capa;
>   }
>   
>   static void
> -eth_bond_slave_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_lim,
> -		const struct rte_eth_desc_lim *slave_desc_lim)
> +eth_bond_member_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_lim,
> +		const struct rte_eth_desc_lim *member_desc_lim)
>   {
> -	memcpy(bond_desc_lim, slave_desc_lim, sizeof(*bond_desc_lim));
> +	memcpy(bond_desc_lim, member_desc_lim, sizeof(*bond_desc_lim));
>   }
>   
>   static int
> -eth_bond_slave_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim,
> -		const struct rte_eth_desc_lim *slave_desc_lim)
> +eth_bond_member_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim,
> +		const struct rte_eth_desc_lim *member_desc_lim)
>   {
>   	bond_desc_lim->nb_max = RTE_MIN(bond_desc_lim->nb_max,
> -					slave_desc_lim->nb_max);
> +					member_desc_lim->nb_max);
>   	bond_desc_lim->nb_min = RTE_MAX(bond_desc_lim->nb_min,
> -					slave_desc_lim->nb_min);
> +					member_desc_lim->nb_min);
>   	bond_desc_lim->nb_align = RTE_MAX(bond_desc_lim->nb_align,
> -					  slave_desc_lim->nb_align);
> +					  member_desc_lim->nb_align);
>   
>   	if (bond_desc_lim->nb_min > bond_desc_lim->nb_max ||
>   	    bond_desc_lim->nb_align > bond_desc_lim->nb_max) {
> @@ -444,22 +446,22 @@ eth_bond_slave_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim,
>   	}
>   
>   	/* Treat maximum number of segments equal to 0 as unspecified */
> -	if (slave_desc_lim->nb_seg_max != 0 &&
> +	if (member_desc_lim->nb_seg_max != 0 &&
>   	    (bond_desc_lim->nb_seg_max == 0 ||
> -	     slave_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max))
> -		bond_desc_lim->nb_seg_max = slave_desc_lim->nb_seg_max;
> -	if (slave_desc_lim->nb_mtu_seg_max != 0 &&
> +	     member_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max))
> +		bond_desc_lim->nb_seg_max = member_desc_lim->nb_seg_max;
> +	if (member_desc_lim->nb_mtu_seg_max != 0 &&
>   	    (bond_desc_lim->nb_mtu_seg_max == 0 ||
> -	     slave_desc_lim->nb_mtu_seg_max < bond_desc_lim->nb_mtu_seg_max))
> -		bond_desc_lim->nb_mtu_seg_max = slave_desc_lim->nb_mtu_seg_max;
> +	     member_desc_lim->nb_mtu_seg_max < bond_desc_lim->nb_mtu_seg_max))
> +		bond_desc_lim->nb_mtu_seg_max = member_desc_lim->nb_mtu_seg_max;
>   
>   	return 0;
>   }
>   
>   static int
> -__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
> +__eth_bond_member_add_lock_free(uint16_t bonded_port_id, uint16_t member_port_id)
>   {
> -	struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev;
> +	struct rte_eth_dev *bonded_eth_dev, *member_eth_dev;
>   	struct bond_dev_private *internals;
>   	struct rte_eth_link link_props;
>   	struct rte_eth_dev_info dev_info;
> @@ -468,78 +470,78 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
>   	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
>   	internals = bonded_eth_dev->data->dev_private;
>   
> -	if (valid_slave_port_id(internals, slave_port_id) != 0)
> +	if (valid_member_port_id(internals, member_port_id) != 0)
>   		return -1;
>   
> -	slave_eth_dev = &rte_eth_devices[slave_port_id];
> -	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDING_MEMBER) {
> -		RTE_BOND_LOG(ERR, "Slave device is already a slave of a bonded device");
> +	member_eth_dev = &rte_eth_devices[member_port_id];
> +	if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDING_MEMBER) {
> +		RTE_BOND_LOG(ERR, "Member device is already a member of a bonded device");
>   		return -1;
>   	}
>   
> -	ret = rte_eth_dev_info_get(slave_port_id, &dev_info);
> +	ret = rte_eth_dev_info_get(member_port_id, &dev_info);
>   	if (ret != 0) {
>   		RTE_BOND_LOG(ERR,
>   			"%s: Error during getting device (port %u) info: %s\n",
> -			__func__, slave_port_id, strerror(-ret));
> +			__func__, member_port_id, strerror(-ret));
>   
>   		return ret;
>   	}
>   	if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) {
> -		RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small",
> -			     slave_port_id);
> +		RTE_BOND_LOG(ERR, "Member (port %u) max_rx_pktlen too small",
> +			     member_port_id);
>   		return -1;
>   	}
>   
> -	slave_add(internals, slave_eth_dev);
> +	member_add(internals, member_eth_dev);
>   
> -	/* We need to store slaves reta_size to be able to synchronize RETA for all
> -	 * slave devices even if its sizes are different.
> +	/* We need to store members reta_size to be able to synchronize RETA for all
> +	 * member devices even if its sizes are different.
>   	 */
> -	internals->slaves[internals->slave_count].reta_size = dev_info.reta_size;
> +	internals->members[internals->member_count].reta_size = dev_info.reta_size;
>   
> -	if (internals->slave_count < 1) {
> -		/* if MAC is not user defined then use MAC of first slave add to
> +	if (internals->member_count < 1) {
> +		/* if MAC is not user defined then use MAC of first member add to
>   		 * bonded device */
>   		if (!internals->user_defined_mac) {
>   			if (mac_address_set(bonded_eth_dev,
> -					    slave_eth_dev->data->mac_addrs)) {
> +					    member_eth_dev->data->mac_addrs)) {
>   				RTE_BOND_LOG(ERR, "Failed to set MAC address");
>   				return -1;
>   			}
>   		}
>   
> -		/* Make primary slave */
> -		internals->primary_port = slave_port_id;
> -		internals->current_primary_port = slave_port_id;
> +		/* Make primary member */
> +		internals->primary_port = member_port_id;
> +		internals->current_primary_port = member_port_id;
>   
>   		internals->speed_capa = dev_info.speed_capa;
>   
> -		/* Inherit queues settings from first slave */
> -		internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues;
> -		internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues;
> +		/* Inherit queues settings from first member */
> +		internals->nb_rx_queues = member_eth_dev->data->nb_rx_queues;
> +		internals->nb_tx_queues = member_eth_dev->data->nb_tx_queues;
>   
> -		eth_bond_slave_inherit_dev_info_rx_first(internals, &dev_info);
> -		eth_bond_slave_inherit_dev_info_tx_first(internals, &dev_info);
> +		eth_bond_member_inherit_dev_info_rx_first(internals, &dev_info);
> +		eth_bond_member_inherit_dev_info_tx_first(internals, &dev_info);
>   
> -		eth_bond_slave_inherit_desc_lim_first(&internals->rx_desc_lim,
> +		eth_bond_member_inherit_desc_lim_first(&internals->rx_desc_lim,
>   						      &dev_info.rx_desc_lim);
> -		eth_bond_slave_inherit_desc_lim_first(&internals->tx_desc_lim,
> +		eth_bond_member_inherit_desc_lim_first(&internals->tx_desc_lim,
>   						      &dev_info.tx_desc_lim);
>   	} else {
>   		int ret;
>   
>   		internals->speed_capa &= dev_info.speed_capa;
> -		eth_bond_slave_inherit_dev_info_rx_next(internals, &dev_info);
> -		eth_bond_slave_inherit_dev_info_tx_next(internals, &dev_info);
> +		eth_bond_member_inherit_dev_info_rx_next(internals, &dev_info);
> +		eth_bond_member_inherit_dev_info_tx_next(internals, &dev_info);
>   
> -		ret = eth_bond_slave_inherit_desc_lim_next(
> -				&internals->rx_desc_lim, &dev_info.rx_desc_lim);
> +		ret = eth_bond_member_inherit_desc_lim_next(&internals->rx_desc_lim,
> +							&dev_info.rx_desc_lim);
>   		if (ret != 0)
>   			return ret;
>   
> -		ret = eth_bond_slave_inherit_desc_lim_next(
> -				&internals->tx_desc_lim, &dev_info.tx_desc_lim);
> +		ret = eth_bond_member_inherit_desc_lim_next(&internals->tx_desc_lim,
> +							&dev_info.tx_desc_lim);
>   		if (ret != 0)
>   			return ret;
>   	}
> @@ -552,79 +554,81 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id)
>   	bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=
>   			internals->flow_type_rss_offloads;
>   
> -	if (slave_rte_flow_prepare(internals->slave_count, internals) != 0) {
> -		RTE_BOND_LOG(ERR, "Failed to prepare new slave flows: port=%d",
> -			     slave_port_id);
> +	if (member_rte_flow_prepare(internals->member_count, internals) != 0) {
> +		RTE_BOND_LOG(ERR, "Failed to prepare new member flows: port=%d",
> +			     member_port_id);
>   		return -1;
>   	}
>   
> -	/* Add additional MAC addresses to the slave */
> -	if (slave_add_mac_addresses(bonded_eth_dev, slave_port_id) != 0) {
> -		RTE_BOND_LOG(ERR, "Failed to add mac address(es) to slave %hu",
> -				slave_port_id);
> +	/* Add additional MAC addresses to the member */
> +	if (member_add_mac_addresses(bonded_eth_dev, member_port_id) != 0) {
> +		RTE_BOND_LOG(ERR, "Failed to add mac address(es) to member %hu",
> +				member_port_id);
>   		return -1;
>   	}
>   
> -	internals->slave_count++;
> +	internals->member_count++;
>   
>   	if (bonded_eth_dev->data->dev_started) {
> -		if (slave_configure(bonded_eth_dev, slave_eth_dev) != 0) {
> -			internals->slave_count--;
> -			RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=%d",
> -					slave_port_id);
> +		if (member_configure(bonded_eth_dev, member_eth_dev) != 0) {
> +			internals->member_count--;
> +			RTE_BOND_LOG(ERR, "rte_bond_members_configure: port=%d",
> +					member_port_id);
>   			return -1;
>   		}
> -		if (slave_start(bonded_eth_dev, slave_eth_dev) != 0) {
> -			internals->slave_count--;
> -			RTE_BOND_LOG(ERR, "rte_bond_slaves_start: port=%d",
> -					slave_port_id);
> +		if (member_start(bonded_eth_dev, member_eth_dev) != 0) {
> +			internals->member_count--;
> +			RTE_BOND_LOG(ERR, "rte_bond_members_start: port=%d",
> +					member_port_id);
>   			return -1;
>   		}
>   	}
>   
> -	/* Update all slave devices MACs */
> -	mac_address_slaves_update(bonded_eth_dev);
> +	/* Update all member devices MACs */
> +	mac_address_members_update(bonded_eth_dev);
>   
>   	/* Register link status change callback with bonded device pointer as
>   	 * argument*/
> -	rte_eth_dev_callback_register(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
> +	rte_eth_dev_callback_register(member_port_id, RTE_ETH_EVENT_INTR_LSC,
>   			bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id);
>   
> -	/* If bonded device is started then we can add the slave to our active
> -	 * slave array */
> +	/*
> +	 * If bonded device is started then we can add the member to our active
> +	 * member array.
> +	 */
>   	if (bonded_eth_dev->data->dev_started) {
> -		ret = rte_eth_link_get_nowait(slave_port_id, &link_props);
> +		ret = rte_eth_link_get_nowait(member_port_id, &link_props);
>   		if (ret < 0) {
> -			rte_eth_dev_callback_unregister(slave_port_id,
> +			rte_eth_dev_callback_unregister(member_port_id,
>   					RTE_ETH_EVENT_INTR_LSC,
>   					bond_ethdev_lsc_event_callback,
>   					&bonded_eth_dev->data->port_id);
> -			internals->slave_count--;
> +			internals->member_count--;
>   			RTE_BOND_LOG(ERR,
> -				"Slave (port %u) link get failed: %s\n",
> -				slave_port_id, rte_strerror(-ret));
> +				"Member (port %u) link get failed: %s\n",
> +				member_port_id, rte_strerror(-ret));
>   			return -1;
>   		}
>   
>   		if (link_props.link_status == RTE_ETH_LINK_UP) {
> -			if (internals->active_slave_count == 0 &&
> +			if (internals->active_member_count == 0 &&
>   			    !internals->user_defined_primary_port)
>   				bond_ethdev_primary_set(internals,
> -							slave_port_id);
> +							member_port_id);
>   		}
>   	}
>   
> -	/* Add slave details to bonded device */
> -	slave_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDING_MEMBER;
> +	/* Add member details to bonded device */
> +	member_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDING_MEMBER;
>   
> -	slave_vlan_filter_set(bonded_port_id, slave_port_id);
> +	member_vlan_filter_set(bonded_port_id, member_port_id);
>   
>   	return 0;
>   
>   }
>   
>   int
> -rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id)
> +rte_eth_bond_member_add(uint16_t bonded_port_id, uint16_t member_port_id)
>   {
>   	struct rte_eth_dev *bonded_eth_dev;
>   	struct bond_dev_private *internals;
> @@ -637,12 +641,12 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id)
>   	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
>   	internals = bonded_eth_dev->data->dev_private;
>   
> -	if (valid_slave_port_id(internals, slave_port_id) != 0)
> +	if (valid_member_port_id(internals, member_port_id) != 0)
>   		return -1;
>   
>   	rte_spinlock_lock(&internals->lock);
>   
> -	retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id);
> +	retval = __eth_bond_member_add_lock_free(bonded_port_id, member_port_id);
>   
>   	rte_spinlock_unlock(&internals->lock);
>   
> @@ -650,103 +654,105 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id)
>   }
>   
>   static int
> -__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
> -				   uint16_t slave_port_id)
> +__eth_bond_member_remove_lock_free(uint16_t bonded_port_id,
> +				   uint16_t member_port_id)
>   {
>   	struct rte_eth_dev *bonded_eth_dev;
>   	struct bond_dev_private *internals;
> -	struct rte_eth_dev *slave_eth_dev;
> +	struct rte_eth_dev *member_eth_dev;
>   	struct rte_flow_error flow_error;
>   	struct rte_flow *flow;
> -	int i, slave_idx;
> +	int i, member_idx;
>   
>   	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
>   	internals = bonded_eth_dev->data->dev_private;
>   
> -	if (valid_slave_port_id(internals, slave_port_id) < 0)
> +	if (valid_member_port_id(internals, member_port_id) < 0)
>   		return -1;
>   
> -	/* first remove from active slave list */
> -	slave_idx = find_slave_by_id(internals->active_slaves,
> -		internals->active_slave_count, slave_port_id);
> +	/* first remove from active member list */
> +	member_idx = find_member_by_id(internals->active_members,
> +		internals->active_member_count, member_port_id);
>   
> -	if (slave_idx < internals->active_slave_count)
> -		deactivate_slave(bonded_eth_dev, slave_port_id);
> +	if (member_idx < internals->active_member_count)
> +		deactivate_member(bonded_eth_dev, member_port_id);
>   
> -	slave_idx = -1;
> -	/* now find in slave list */
> -	for (i = 0; i < internals->slave_count; i++)
> -		if (internals->slaves[i].port_id == slave_port_id) {
> -			slave_idx = i;
> +	member_idx = -1;
> +	/* now find in member list */
> +	for (i = 0; i < internals->member_count; i++)
> +		if (internals->members[i].port_id == member_port_id) {
> +			member_idx = i;
>   			break;
>   		}
>   
> -	if (slave_idx < 0) {
> -		RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u",
> -				internals->slave_count);
> +	if (member_idx < 0) {
> +		RTE_BOND_LOG(ERR, "Could not find member in port list, member count %u",
> +				internals->member_count);
>   		return -1;
>   	}
>   
>   	/* Un-register link status change callback with bonded device pointer as
>   	 * argument*/
> -	rte_eth_dev_callback_unregister(slave_port_id, RTE_ETH_EVENT_INTR_LSC,
> +	rte_eth_dev_callback_unregister(member_port_id, RTE_ETH_EVENT_INTR_LSC,
>   			bond_ethdev_lsc_event_callback,
>   			&rte_eth_devices[bonded_port_id].data->port_id);
>   
> -	/* Restore original MAC address of slave device */
> -	rte_eth_dev_default_mac_addr_set(slave_port_id,
> -			&(internals->slaves[slave_idx].persisted_mac_addr));
> +	/* Restore original MAC address of member device */
> +	rte_eth_dev_default_mac_addr_set(member_port_id,
> +			&internals->members[member_idx].persisted_mac_addr);
>   
> -	/* remove additional MAC addresses from the slave */
> -	slave_remove_mac_addresses(bonded_eth_dev, slave_port_id);
> +	/* remove additional MAC addresses from the member */
> +	member_remove_mac_addresses(bonded_eth_dev, member_port_id);
>   
>   	/*
> -	 * Remove bond device flows from slave device.
> +	 * Remove bond device flows from member device.
>   	 * Note: don't restore flow isolate mode.
>   	 */
>   	TAILQ_FOREACH(flow, &internals->flow_list, next) {
> -		if (flow->flows[slave_idx] != NULL) {
> -			rte_flow_destroy(slave_port_id, flow->flows[slave_idx],
> +		if (flow->flows[member_idx] != NULL) {
> +			rte_flow_destroy(member_port_id, flow->flows[member_idx],
>   					 &flow_error);
> -			flow->flows[slave_idx] = NULL;
> +			flow->flows[member_idx] = NULL;
>   		}
>   	}
>   
>   	/* Remove the dedicated queues flow */
>   	if (internals->mode == BONDING_MODE_8023AD &&
>   		internals->mode4.dedicated_queues.enabled == 1 &&
> -		internals->mode4.dedicated_queues.flow[slave_port_id] != NULL) {
> -		rte_flow_destroy(slave_port_id,
> -				internals->mode4.dedicated_queues.flow[slave_port_id],
> +		internals->mode4.dedicated_queues.flow[member_port_id] != NULL) {
> +		rte_flow_destroy(member_port_id,
> +				internals->mode4.dedicated_queues.flow[member_port_id],
>   				&flow_error);
> -		internals->mode4.dedicated_queues.flow[slave_port_id] = NULL;
> +		internals->mode4.dedicated_queues.flow[member_port_id] = NULL;
>   	}
>   
> -	slave_eth_dev = &rte_eth_devices[slave_port_id];
> -	slave_remove(internals, slave_eth_dev);
> -	slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDING_MEMBER);
> +	member_eth_dev = &rte_eth_devices[member_port_id];
> +	member_remove(internals, member_eth_dev);
> +	member_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDING_MEMBER);
>   
> -	/*  first slave in the active list will be the primary by default,
> +	/*  first member in the active list will be the primary by default,
>   	 *  otherwise use first device in list */
> -	if (internals->current_primary_port == slave_port_id) {
> -		if (internals->active_slave_count > 0)
> -			internals->current_primary_port = internals->active_slaves[0];
> -		else if (internals->slave_count > 0)
> -			internals->current_primary_port = internals->slaves[0].port_id;
> +	if (internals->current_primary_port == member_port_id) {
> +		if (internals->active_member_count > 0)
> +			internals->current_primary_port = internals->active_members[0];
> +		else if (internals->member_count > 0)
> +			internals->current_primary_port = internals->members[0].port_id;
>   		else
>   			internals->primary_port = 0;
> -		mac_address_slaves_update(bonded_eth_dev);
> +		mac_address_members_update(bonded_eth_dev);
>   	}
>   
> -	if (internals->active_slave_count < 1) {
> -		/* if no slaves are any longer attached to bonded device and MAC is not
> +	if (internals->active_member_count < 1) {
> +		/*
> +		 * if no members are any longer attached to bonded device and MAC is not
>   		 * user defined then clear MAC of bonded device as it will be reset
> -		 * when a new slave is added */
> -		if (internals->slave_count < 1 && !internals->user_defined_mac)
> +		 * when a new member is added.
> +		 */
> +		if (internals->member_count < 1 && !internals->user_defined_mac)
>   			memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0,
>   					sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs)));
>   	}
> -	if (internals->slave_count == 0) {
> +	if (internals->member_count == 0) {
>   		internals->rx_offload_capa = 0;
>   		internals->tx_offload_capa = 0;
>   		internals->rx_queue_offload_capa = 0;
> @@ -760,7 +766,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
>   }
>   
>   int
> -rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id)
> +rte_eth_bond_member_remove(uint16_t bonded_port_id, uint16_t member_port_id)
>   {
>   	struct rte_eth_dev *bonded_eth_dev;
>   	struct bond_dev_private *internals;
> @@ -774,7 +780,7 @@ rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id)
>   
>   	rte_spinlock_lock(&internals->lock);
>   
> -	retval = __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_id);
> +	retval = __eth_bond_member_remove_lock_free(bonded_port_id, member_port_id);
>   
>   	rte_spinlock_unlock(&internals->lock);
>   
> @@ -791,7 +797,7 @@ rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode)
>   
>   	bonded_eth_dev = &rte_eth_devices[bonded_port_id];
>   
> -	if (check_for_master_bonded_ethdev(bonded_eth_dev) != 0 &&
> +	if (check_for_main_bonded_ethdev(bonded_eth_dev) != 0 &&
>   			mode == BONDING_MODE_8023AD)
>   		return -1;
>   
> @@ -812,7 +818,7 @@ rte_eth_bond_mode_get(uint16_t bonded_port_id)
>   }
>   
>   int
> -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id)
> +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t member_port_id)
>   {
>   	struct bond_dev_private *internals;
>   
> @@ -821,13 +827,13 @@ rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id)
>   
>   	internals = rte_eth_devices[bonded_port_id].data->dev_private;
>   
> -	if (valid_slave_port_id(internals, slave_port_id) != 0)
> +	if (valid_member_port_id(internals, member_port_id) != 0)
>   		return -1;
>   
>   	internals->user_defined_primary_port = 1;
> -	internals->primary_port = slave_port_id;
> +	internals->primary_port = member_port_id;
>   
> -	bond_ethdev_primary_set(internals, slave_port_id);
> +	bond_ethdev_primary_set(internals, member_port_id);
>   
>   	return 0;
>   }
> @@ -842,14 +848,14 @@ rte_eth_bond_primary_get(uint16_t bonded_port_id)
>   
>   	internals = rte_eth_devices[bonded_port_id].data->dev_private;
>   
> -	if (internals->slave_count < 1)
> +	if (internals->member_count < 1)
>   		return -1;
>   
>   	return internals->current_primary_port;
>   }
>   
>   int
> -rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
> +rte_eth_bond_members_get(uint16_t bonded_port_id, uint16_t members[],
>   			uint16_t len)
>   {
>   	struct bond_dev_private *internals;
> @@ -858,22 +864,22 @@ rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
>   	if (valid_bonded_port_id(bonded_port_id) != 0)
>   		return -1;
>   
> -	if (slaves == NULL)
> +	if (members == NULL)
>   		return -1;
>   
>   	internals = rte_eth_devices[bonded_port_id].data->dev_private;
>   
> -	if (internals->slave_count > len)
> +	if (internals->member_count > len)
>   		return -1;
>   
> -	for (i = 0; i < internals->slave_count; i++)
> -		slaves[i] = internals->slaves[i].port_id;
> +	for (i = 0; i < internals->member_count; i++)
> +		members[i] = internals->members[i].port_id;
>   
> -	return internals->slave_count;
> +	return internals->member_count;
>   }
>   
>   int
> -rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
> +rte_eth_bond_active_members_get(uint16_t bonded_port_id, uint16_t members[],
>   		uint16_t len)
>   {
>   	struct bond_dev_private *internals;
> @@ -881,18 +887,18 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],
>   	if (valid_bonded_port_id(bonded_port_id) != 0)
>   		return -1;
>   
> -	if (slaves == NULL)
> +	if (members == NULL)
>   		return -1;
>   
>   	internals = rte_eth_devices[bonded_port_id].data->dev_private;
>   
> -	if (internals->active_slave_count > len)
> +	if (internals->active_member_count > len)
>   		return -1;
>   
> -	memcpy(slaves, internals->active_slaves,
> -	internals->active_slave_count * sizeof(internals->active_slaves[0]));
> +	memcpy(members, internals->active_members,
> +	internals->active_member_count * sizeof(internals->active_members[0]));
>   
> -	return internals->active_slave_count;
> +	return internals->active_member_count;
>   }
>   
>   int
> @@ -914,9 +920,9 @@ rte_eth_bond_mac_address_set(uint16_t bonded_port_id,
>   
>   	internals->user_defined_mac = 1;
>   
> -	/* Update all slave devices MACs*/
> -	if (internals->slave_count > 0)
> -		return mac_address_slaves_update(bonded_eth_dev);
> +	/* Update all member devices MACs*/
> +	if (internals->member_count > 0)
> +		return mac_address_members_update(bonded_eth_dev);
>   
>   	return 0;
>   }
> @@ -935,30 +941,30 @@ rte_eth_bond_mac_address_reset(uint16_t bonded_port_id)
>   
>   	internals->user_defined_mac = 0;
>   
> -	if (internals->slave_count > 0) {
> -		int slave_port;
> -		/* Get the primary slave location based on the primary port
> -		 * number as, while slave_add(), we will keep the primary
> -		 * slave based on slave_count,but not based on the primary port.
> +	if (internals->member_count > 0) {
> +		int member_port;
> +		/* Get the primary member location based on the primary port
> +		 * number as, while member_add(), we will keep the primary
> +		 * member based on member_count,but not based on the primary port.
>   		 */
> -		for (slave_port = 0; slave_port < internals->slave_count;
> -		     slave_port++) {
> -			if (internals->slaves[slave_port].port_id ==
> +		for (member_port = 0; member_port < internals->member_count;
> +		     member_port++) {
> +			if (internals->members[member_port].port_id ==
>   			    internals->primary_port)
>   				break;
>   		}
>   
>   		/* Set MAC Address of Bonded Device */
>   		if (mac_address_set(bonded_eth_dev,
> -			&internals->slaves[slave_port].persisted_mac_addr)
> +			&internals->members[member_port].persisted_mac_addr)
>   				!= 0) {
>   			RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device");
>   			return -1;
>   		}
> -		/* Update all slave devices MAC addresses */
> -		return mac_address_slaves_update(bonded_eth_dev);
> +		/* Update all member devices MAC addresses */
> +		return mac_address_members_update(bonded_eth_dev);
>   	}
> -	/* No need to update anything as no slaves present */
> +	/* No need to update anything as no members present */
>   	return 0;
>   }
>   
> diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c
> index c137efd55f..bdec5d61d4 100644
> --- a/drivers/net/bonding/rte_eth_bond_args.c
> +++ b/drivers/net/bonding/rte_eth_bond_args.c
> @@ -12,8 +12,8 @@
>   #include "eth_bond_private.h"
>   
>   const char *pmd_bond_init_valid_arguments[] = {
> -	PMD_BOND_SLAVE_PORT_KVARG,
> -	PMD_BOND_PRIMARY_SLAVE_KVARG,
> +	PMD_BOND_MEMBER_PORT_KVARG,
> +	PMD_BOND_PRIMARY_MEMBER_KVARG,
>   	PMD_BOND_MODE_KVARG,
>   	PMD_BOND_XMIT_POLICY_KVARG,
>   	PMD_BOND_SOCKET_ID_KVARG,
> @@ -109,31 +109,31 @@ parse_port_id(const char *port_str)
>   }
>   
>   int
> -bond_ethdev_parse_slave_port_kvarg(const char *key,
> +bond_ethdev_parse_member_port_kvarg(const char *key,
>   		const char *value, void *extra_args)
>   {
> -	struct bond_ethdev_slave_ports *slave_ports;
> +	struct bond_ethdev_member_ports *member_ports;
>   
>   	if (value == NULL || extra_args == NULL)
>   		return -1;
>   
> -	slave_ports = extra_args;
> +	member_ports = extra_args;
>   
> -	if (strcmp(key, PMD_BOND_SLAVE_PORT_KVARG) == 0) {
> +	if (strcmp(key, PMD_BOND_MEMBER_PORT_KVARG) == 0) {
>   		int port_id = parse_port_id(value);
>   		if (port_id < 0) {
> -			RTE_BOND_LOG(ERR, "Invalid slave port value (%s) specified",
> +			RTE_BOND_LOG(ERR, "Invalid member port value (%s) specified",
>   				     value);
>   			return -1;
>   		} else
> -			slave_ports->slaves[slave_ports->slave_count++] =
> +			member_ports->members[member_ports->member_count++] =
>   					port_id;
>   	}
>   	return 0;
>   }
>   
>   int
> -bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused,
> +bond_ethdev_parse_member_mode_kvarg(const char *key __rte_unused,
>   		const char *value, void *extra_args)
>   {
>   	uint8_t *mode;
> @@ -160,13 +160,13 @@ bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused,
>   	case BONDING_MODE_ALB:
>   		return 0;
>   	default:
> -		RTE_BOND_LOG(ERR, "Invalid slave mode value (%s) specified", value);
> +		RTE_BOND_LOG(ERR, "Invalid member mode value (%s) specified", value);
>   		return -1;
>   	}
>   }
>   
>   int
> -bond_ethdev_parse_slave_agg_mode_kvarg(const char *key __rte_unused,
> +bond_ethdev_parse_member_agg_mode_kvarg(const char *key __rte_unused,
>   		const char *value, void *extra_args)
>   {
>   	uint8_t *agg_mode;
> @@ -227,19 +227,19 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused,
>   }
>   
>   int
> -bond_ethdev_parse_primary_slave_port_id_kvarg(const char *key __rte_unused,
> +bond_ethdev_parse_primary_member_port_id_kvarg(const char *key __rte_unused,
>   		const char *value, void *extra_args)
>   {
> -	int primary_slave_port_id;
> +	int primary_member_port_id;
>   
>   	if (value == NULL || extra_args == NULL)
>   		return -1;
>   
> -	primary_slave_port_id = parse_port_id(value);
> -	if (primary_slave_port_id < 0)
> +	primary_member_port_id = parse_port_id(value);
> +	if (primary_member_port_id < 0)
>   		return -1;
>   
> -	*(uint16_t *)extra_args = (uint16_t)primary_slave_port_id;
> +	*(uint16_t *)extra_args = (uint16_t)primary_member_port_id;
>   
>   	return 0;
>   }
> diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
> index 65b77faae7..71a91675f7 100644
> --- a/drivers/net/bonding/rte_eth_bond_flow.c
> +++ b/drivers/net/bonding/rte_eth_bond_flow.c
> @@ -69,12 +69,12 @@ bond_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
>   	int i;
>   	int ret;
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		ret = rte_flow_validate(internals->slaves[i].port_id, attr,
> +	for (i = 0; i < internals->member_count; i++) {
> +		ret = rte_flow_validate(internals->members[i].port_id, attr,
>   					patterns, actions, err);
>   		if (ret) {
>   			RTE_BOND_LOG(ERR, "Operation rte_flow_validate failed"
> -				     " for slave %d with error %d", i, ret);
> +				     " for member %d with error %d", i, ret);
>   			return ret;
>   		}
>   	}
> @@ -97,11 +97,11 @@ bond_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
>   				   NULL, rte_strerror(ENOMEM));
>   		return NULL;
>   	}
> -	for (i = 0; i < internals->slave_count; i++) {
> -		flow->flows[i] = rte_flow_create(internals->slaves[i].port_id,
> +	for (i = 0; i < internals->member_count; i++) {
> +		flow->flows[i] = rte_flow_create(internals->members[i].port_id,
>   						 attr, patterns, actions, err);
>   		if (unlikely(flow->flows[i] == NULL)) {
> -			RTE_BOND_LOG(ERR, "Failed to create flow on slave %d",
> +			RTE_BOND_LOG(ERR, "Failed to create flow on member %d",
>   				     i);
>   			goto err;
>   		}
> @@ -109,10 +109,10 @@ bond_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
>   	TAILQ_INSERT_TAIL(&internals->flow_list, flow, next);
>   	return flow;
>   err:
> -	/* Destroy all slaves flows. */
> -	for (i = 0; i < internals->slave_count; i++) {
> +	/* Destroy all members flows. */
> +	for (i = 0; i < internals->member_count; i++) {
>   		if (flow->flows[i] != NULL)
> -			rte_flow_destroy(internals->slaves[i].port_id,
> +			rte_flow_destroy(internals->members[i].port_id,
>   					 flow->flows[i], err);
>   	}
>   	bond_flow_release(&flow);
> @@ -127,15 +127,15 @@ bond_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow,
>   	int i;
>   	int ret = 0;
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> +	for (i = 0; i < internals->member_count; i++) {
>   		int lret;
>   
>   		if (unlikely(flow->flows[i] == NULL))
>   			continue;
> -		lret = rte_flow_destroy(internals->slaves[i].port_id,
> +		lret = rte_flow_destroy(internals->members[i].port_id,
>   					flow->flows[i], err);
>   		if (unlikely(lret != 0)) {
> -			RTE_BOND_LOG(ERR, "Failed to destroy flow on slave %d:"
> +			RTE_BOND_LOG(ERR, "Failed to destroy flow on member %d:"
>   				     " %d", i, lret);
>   			ret = lret;
>   		}
> @@ -154,7 +154,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err)
>   	int ret = 0;
>   	int lret;
>   
> -	/* Destroy all bond flows from its slaves instead of flushing them to
> +	/* Destroy all bond flows from its members instead of flushing them to
>   	 * keep the LACP flow or any other external flows.
>   	 */
>   	RTE_TAILQ_FOREACH_SAFE(flow, &internals->flow_list, next, tmp) {
> @@ -163,7 +163,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err)
>   			ret = lret;
>   	}
>   	if (unlikely(ret != 0))
> -		RTE_BOND_LOG(ERR, "Failed to flush flow in all slaves");
> +		RTE_BOND_LOG(ERR, "Failed to flush flow in all members");
>   	return ret;
>   }
>   
> @@ -174,26 +174,26 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow,
>   		      struct rte_flow_error *err)
>   {
>   	struct bond_dev_private *internals = dev->data->dev_private;
> -	struct rte_flow_query_count slave_count;
> +	struct rte_flow_query_count member_count;
>   	int i;
>   	int ret;
>   
>   	count->bytes = 0;
>   	count->hits = 0;
> -	rte_memcpy(&slave_count, count, sizeof(slave_count));
> -	for (i = 0; i < internals->slave_count; i++) {
> -		ret = rte_flow_query(internals->slaves[i].port_id,
> +	rte_memcpy(&member_count, count, sizeof(member_count));
> +	for (i = 0; i < internals->member_count; i++) {
> +		ret = rte_flow_query(internals->members[i].port_id,
>   				     flow->flows[i], action,
> -				     &slave_count, err);
> +				     &member_count, err);
>   		if (unlikely(ret != 0)) {
>   			RTE_BOND_LOG(ERR, "Failed to query flow on"
> -				     " slave %d: %d", i, ret);
> +				     " member %d: %d", i, ret);
>   			return ret;
>   		}
> -		count->bytes += slave_count.bytes;
> -		count->hits += slave_count.hits;
> -		slave_count.bytes = 0;
> -		slave_count.hits = 0;
> +		count->bytes += member_count.bytes;
> +		count->hits += member_count.hits;
> +		member_count.bytes = 0;
> +		member_count.hits = 0;
>   	}
>   	return 0;
>   }
> @@ -221,11 +221,11 @@ bond_flow_isolate(struct rte_eth_dev *dev, int set,
>   	int i;
>   	int ret;
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		ret = rte_flow_isolate(internals->slaves[i].port_id, set, err);
> +	for (i = 0; i < internals->member_count; i++) {
> +		ret = rte_flow_isolate(internals->members[i].port_id, set, err);
>   		if (unlikely(ret != 0)) {
>   			RTE_BOND_LOG(ERR, "Operation rte_flow_isolate failed"
> -				     " for slave %d with error %d", i, ret);
> +				     " for member %d with error %d", i, ret);
>   			internals->flow_isolated_valid = 0;
>   			return ret;
>   		}
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 73205f78f4..499c980db8 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -61,33 +61,35 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   	struct bond_dev_private *internals;
>   
>   	uint16_t num_rx_total = 0;
> -	uint16_t slave_count;
> -	uint16_t active_slave;
> +	uint16_t member_count;
> +	uint16_t active_member;
>   	int i;
>   
>   	/* Cast to structure, containing bonded device's port id and queue id */
>   	struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
>   	internals = bd_rx_q->dev_private;
> -	slave_count = internals->active_slave_count;
> -	active_slave = bd_rx_q->active_slave;
> +	member_count = internals->active_member_count;
> +	active_member = bd_rx_q->active_member;
>   
> -	for (i = 0; i < slave_count && nb_pkts; i++) {
> -		uint16_t num_rx_slave;
> +	for (i = 0; i < member_count && nb_pkts; i++) {
> +		uint16_t num_rx_member;
>   
> -		/* Offset of pointer to *bufs increases as packets are received
> -		 * from other slaves */
> -		num_rx_slave =
> -			rte_eth_rx_burst(internals->active_slaves[active_slave],
> +		/*
> +		 * Offset of pointer to *bufs increases as packets are received
> +		 * from other members.
> +		 */
> +		num_rx_member =
> +			rte_eth_rx_burst(internals->active_members[active_member],
>   					 bd_rx_q->queue_id,
>   					 bufs + num_rx_total, nb_pkts);
> -		num_rx_total += num_rx_slave;
> -		nb_pkts -= num_rx_slave;
> -		if (++active_slave >= slave_count)
> -			active_slave = 0;
> +		num_rx_total += num_rx_member;
> +		nb_pkts -= num_rx_member;
> +		if (++active_member >= member_count)
> +			active_member = 0;
>   	}
>   
> -	if (++bd_rx_q->active_slave >= slave_count)
> -		bd_rx_q->active_slave = 0;
> +	if (++bd_rx_q->active_member >= member_count)
> +		bd_rx_q->active_member = 0;
>   	return num_rx_total;
>   }
>   
> @@ -158,8 +160,8 @@ const struct rte_flow_attr flow_attr_8023ad = {
>   
>   int
>   bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
> -		uint16_t slave_port) {
> -	struct rte_eth_dev_info slave_info;
> +		uint16_t member_port) {
> +	struct rte_eth_dev_info member_info;
>   	struct rte_flow_error error;
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
>   
> @@ -177,29 +179,29 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev,
>   		}
>   	};
>   
> -	int ret = rte_flow_validate(slave_port, &flow_attr_8023ad,
> +	int ret = rte_flow_validate(member_port, &flow_attr_8023ad,
>   			flow_item_8023ad, actions, &error);
>   	if (ret < 0) {
> -		RTE_BOND_LOG(ERR, "%s: %s (slave_port=%d queue_id=%d)",
> -				__func__, error.message, slave_port,
> +		RTE_BOND_LOG(ERR, "%s: %s (member_port=%d queue_id=%d)",
> +				__func__, error.message, member_port,
>   				internals->mode4.dedicated_queues.rx_qid);
>   		return -1;
>   	}
>   
> -	ret = rte_eth_dev_info_get(slave_port, &slave_info);
> +	ret = rte_eth_dev_info_get(member_port, &member_info);
>   	if (ret != 0) {
>   		RTE_BOND_LOG(ERR,
>   			"%s: Error during getting device (port %u) info: %s\n",
> -			__func__, slave_port, strerror(-ret));
> +			__func__, member_port, strerror(-ret));
>   
>   		return ret;
>   	}
>   
> -	if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
> -			slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
> +	if (member_info.max_rx_queues < bond_dev->data->nb_rx_queues ||
> +			member_info.max_tx_queues < bond_dev->data->nb_tx_queues) {
>   		RTE_BOND_LOG(ERR,
> -			"%s: Slave %d capabilities doesn't allow allocating additional queues",
> -			__func__, slave_port);
> +			"%s: Member %d capabilities doesn't allow allocating additional queues",
> +			__func__, member_port);
>   		return -1;
>   	}
>   
> @@ -214,8 +216,8 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) {
>   	uint16_t idx;
>   	int ret;
>   
> -	/* Verify if all slaves in bonding supports flow director and */
> -	if (internals->slave_count > 0) {
> +	/* Verify if all members in bonding supports flow director and */
> +	if (internals->member_count > 0) {
>   		ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info);
>   		if (ret != 0) {
>   			RTE_BOND_LOG(ERR,
> @@ -229,9 +231,9 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) {
>   		internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues;
>   		internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues;
>   
> -		for (idx = 0; idx < internals->slave_count; idx++) {
> +		for (idx = 0; idx < internals->member_count; idx++) {
>   			if (bond_ethdev_8023ad_flow_verify(bond_dev,
> -					internals->slaves[idx].port_id) != 0)
> +					internals->members[idx].port_id) != 0)
>   				return -1;
>   		}
>   	}
> @@ -240,7 +242,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) {
>   }
>   
>   int
> -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) {
> +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t member_port) {
>   
>   	struct rte_flow_error error;
>   	struct bond_dev_private *internals = bond_dev->data->dev_private;
> @@ -258,12 +260,12 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) {
>   		}
>   	};
>   
> -	internals->mode4.dedicated_queues.flow[slave_port] = rte_flow_create(slave_port,
> +	internals->mode4.dedicated_queues.flow[member_port] = rte_flow_create(member_port,
>   			&flow_attr_8023ad, flow_item_8023ad, actions, &error);
> -	if (internals->mode4.dedicated_queues.flow[slave_port] == NULL) {
> +	if (internals->mode4.dedicated_queues.flow[member_port] == NULL) {
>   		RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: %s "
> -				"(slave_port=%d queue_id=%d)",
> -				error.message, slave_port,
> +				"(member_port=%d queue_id=%d)",
> +				error.message, member_port,
>   				internals->mode4.dedicated_queues.rx_qid);
>   		return -1;
>   	}
> @@ -304,10 +306,10 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
>   	const uint16_t ether_type_slow_be =
>   		rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW);
>   	uint16_t num_rx_total = 0;	/* Total number of received packets */
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> -	uint16_t slave_count, idx;
> +	uint16_t members[RTE_MAX_ETHPORTS];
> +	uint16_t member_count, idx;
>   
> -	uint8_t collecting;  /* current slave collecting status */
> +	uint8_t collecting;  /* current member collecting status */
>   	const uint8_t promisc = rte_eth_promiscuous_get(internals->port_id);
>   	const uint8_t allmulti = rte_eth_allmulticast_get(internals->port_id);
>   	uint8_t subtype;
> @@ -315,24 +317,24 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
>   	uint16_t j;
>   	uint16_t k;
>   
> -	/* Copy slave list to protect against slave up/down changes during tx
> +	/* Copy member list to protect against member up/down changes during tx
>   	 * bursting */
> -	slave_count = internals->active_slave_count;
> -	memcpy(slaves, internals->active_slaves,
> -			sizeof(internals->active_slaves[0]) * slave_count);
> +	member_count = internals->active_member_count;
> +	memcpy(members, internals->active_members,
> +			sizeof(internals->active_members[0]) * member_count);
>   
> -	idx = bd_rx_q->active_slave;
> -	if (idx >= slave_count) {
> -		bd_rx_q->active_slave = 0;
> +	idx = bd_rx_q->active_member;
> +	if (idx >= member_count) {
> +		bd_rx_q->active_member = 0;
>   		idx = 0;
>   	}
> -	for (i = 0; i < slave_count && num_rx_total < nb_pkts; i++) {
> +	for (i = 0; i < member_count && num_rx_total < nb_pkts; i++) {
>   		j = num_rx_total;
> -		collecting = ACTOR_STATE(&bond_mode_8023ad_ports[slaves[idx]],
> +		collecting = ACTOR_STATE(&bond_mode_8023ad_ports[members[idx]],
>   					 COLLECTING);
>   
> -		/* Read packets from this slave */
> -		num_rx_total += rte_eth_rx_burst(slaves[idx], bd_rx_q->queue_id,
> +		/* Read packets from this member */
> +		num_rx_total += rte_eth_rx_burst(members[idx], bd_rx_q->queue_id,
>   				&bufs[num_rx_total], nb_pkts - num_rx_total);
>   
>   		for (k = j; k < 2 && k < num_rx_total; k++)
> @@ -348,7 +350,7 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
>   
>   			/* Remove packet from array if:
>   			 * - it is slow packet but no dedicated rxq is present,
> -			 * - slave is not in collecting state,
> +			 * - member is not in collecting state,
>   			 * - bonding interface is not in promiscuous mode and
>   			 *   packet address isn't in mac_addrs array:
>   			 *   - packet is unicast,
> @@ -367,7 +369,7 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
>   				  !allmulti)))) {
>   				if (hdr->ether_type == ether_type_slow_be) {
>   					bond_mode_8023ad_handle_slow_pkt(
> -					    internals, slaves[idx], bufs[j]);
> +					    internals, members[idx], bufs[j]);
>   				} else
>   					rte_pktmbuf_free(bufs[j]);
>   
> @@ -380,12 +382,12 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts,
>   			} else
>   				j++;
>   		}
> -		if (unlikely(++idx == slave_count))
> +		if (unlikely(++idx == member_count))
>   			idx = 0;
>   	}
>   
> -	if (++bd_rx_q->active_slave >= slave_count)
> -		bd_rx_q->active_slave = 0;
> +	if (++bd_rx_q->active_member >= member_count)
> +		bd_rx_q->active_member = 0;
>   
>   	return num_rx_total;
>   }
> @@ -406,7 +408,7 @@ bond_ethdev_rx_burst_8023ad_fast_queue(void *queue, struct rte_mbuf **bufs,
>   
>   #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1)
>   uint32_t burstnumberRX;
> -uint32_t burstnumberTX;
> +uint32_t burst_number_TX;
>   
>   #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
>   
> @@ -583,59 +585,61 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs,
>   	struct bond_dev_private *internals;
>   	struct bond_tx_queue *bd_tx_q;
>   
> -	struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts];
> -	uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 };
> +	struct rte_mbuf *member_bufs[RTE_MAX_ETHPORTS][nb_pkts];
> +	uint16_t member_nb_pkts[RTE_MAX_ETHPORTS] = { 0 };
>   
> -	uint16_t num_of_slaves;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t num_of_members;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
> -	uint16_t num_tx_total = 0, num_tx_slave;
> +	uint16_t num_tx_total = 0, num_tx_member;
>   
> -	static int slave_idx = 0;
> -	int i, cslave_idx = 0, tx_fail_total = 0;
> +	static int member_idx;
> +	int i, cmember_idx = 0, tx_fail_total = 0;
>   
>   	bd_tx_q = (struct bond_tx_queue *)queue;
>   	internals = bd_tx_q->dev_private;
>   
> -	/* Copy slave list to protect against slave up/down changes during tx
> +	/* Copy member list to protect against member up/down changes during tx
>   	 * bursting */
> -	num_of_slaves = internals->active_slave_count;
> -	memcpy(slaves, internals->active_slaves,
> -			sizeof(internals->active_slaves[0]) * num_of_slaves);
> +	num_of_members = internals->active_member_count;
> +	memcpy(members, internals->active_members,
> +			sizeof(internals->active_members[0]) * num_of_members);
>   
> -	if (num_of_slaves < 1)
> +	if (num_of_members < 1)
>   		return num_tx_total;
>   
> -	/* Populate slaves mbuf with which packets are to be sent on it  */
> +	/* Populate members mbuf with which packets are to be sent on it  */
>   	for (i = 0; i < nb_pkts; i++) {
> -		cslave_idx = (slave_idx + i) % num_of_slaves;
> -		slave_bufs[cslave_idx][(slave_nb_pkts[cslave_idx])++] = bufs[i];
> +		cmember_idx = (member_idx + i) % num_of_members;
> +		member_bufs[cmember_idx][(member_nb_pkts[cmember_idx])++] = bufs[i];
>   	}
>   
> -	/* increment current slave index so the next call to tx burst starts on the
> -	 * next slave */
> -	slave_idx = ++cslave_idx;
> +	/*
> +	 * increment current member index so the next call to tx burst starts on the
> +	 * next member.
> +	 */
> +	member_idx = ++cmember_idx;
>   
> -	/* Send packet burst on each slave device */
> -	for (i = 0; i < num_of_slaves; i++) {
> -		if (slave_nb_pkts[i] > 0) {
> -			num_tx_slave = rte_eth_tx_prepare(slaves[i],
> -					bd_tx_q->queue_id, slave_bufs[i],
> -					slave_nb_pkts[i]);
> -			num_tx_slave = rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id,
> -					slave_bufs[i], num_tx_slave);
> +	/* Send packet burst on each member device */
> +	for (i = 0; i < num_of_members; i++) {
> +		if (member_nb_pkts[i] > 0) {
> +			num_tx_member = rte_eth_tx_prepare(members[i],
> +					bd_tx_q->queue_id, member_bufs[i],
> +					member_nb_pkts[i]);
> +			num_tx_member = rte_eth_tx_burst(members[i], bd_tx_q->queue_id,
> +					member_bufs[i], num_tx_member);
>   
>   			/* if tx burst fails move packets to end of bufs */
> -			if (unlikely(num_tx_slave < slave_nb_pkts[i])) {
> -				int tx_fail_slave = slave_nb_pkts[i] - num_tx_slave;
> +			if (unlikely(num_tx_member < member_nb_pkts[i])) {
> +				int tx_fail_member = member_nb_pkts[i] - num_tx_member;
>   
> -				tx_fail_total += tx_fail_slave;
> +				tx_fail_total += tx_fail_member;
>   
>   				memcpy(&bufs[nb_pkts - tx_fail_total],
> -				       &slave_bufs[i][num_tx_slave],
> -				       tx_fail_slave * sizeof(bufs[0]));
> +				       &member_bufs[i][num_tx_member],
> +				       tx_fail_member * sizeof(bufs[0]));
>   			}
> -			num_tx_total += num_tx_slave;
> +			num_tx_total += num_tx_member;
>   		}
>   	}
>   
> @@ -653,7 +657,7 @@ bond_ethdev_tx_burst_active_backup(void *queue,
>   	bd_tx_q = (struct bond_tx_queue *)queue;
>   	internals = bd_tx_q->dev_private;
>   
> -	if (internals->active_slave_count < 1)
> +	if (internals->active_member_count < 1)
>   		return 0;
>   
>   	nb_prep_pkts = rte_eth_tx_prepare(internals->current_primary_port,
> @@ -699,7 +703,7 @@ ipv6_hash(struct rte_ipv6_hdr *ipv6_hdr)
>   
>   void
>   burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves)
> +		uint16_t member_count, uint16_t *members)
>   {
>   	struct rte_ether_hdr *eth_hdr;
>   	uint32_t hash;
> @@ -710,13 +714,13 @@ burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
>   
>   		hash = ether_hash(eth_hdr);
>   
> -		slaves[i] = (hash ^= hash >> 8) % slave_count;
> +		members[i] = (hash ^= hash >> 8) % member_count;
>   	}
>   }
>   
>   void
>   burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves)
> +		uint16_t member_count, uint16_t *members)
>   {
>   	uint16_t i;
>   	struct rte_ether_hdr *eth_hdr;
> @@ -748,13 +752,13 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
>   		hash ^= hash >> 16;
>   		hash ^= hash >> 8;
>   
> -		slaves[i] = hash % slave_count;
> +		members[i] = hash % member_count;
>   	}
>   }
>   
>   void
>   burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
> -		uint16_t slave_count, uint16_t *slaves)
> +		uint16_t member_count, uint16_t *members)
>   {
>   	struct rte_ether_hdr *eth_hdr;
>   	uint16_t proto;
> @@ -822,30 +826,29 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
>   		hash ^= hash >> 16;
>   		hash ^= hash >> 8;
>   
> -		slaves[i] = hash % slave_count;
> +		members[i] = hash % member_count;
>   	}
>   }
>   
> -struct bwg_slave {
> +struct bwg_member {
>   	uint64_t bwg_left_int;
>   	uint64_t bwg_left_remainder;
> -	uint16_t slave;
> +	uint16_t member;
>   };
>   
>   void
> -bond_tlb_activate_slave(struct bond_dev_private *internals) {
> +bond_tlb_activate_member(struct bond_dev_private *internals) {
>   	int i;
>   
> -	for (i = 0; i < internals->active_slave_count; i++) {
> -		tlb_last_obytets[internals->active_slaves[i]] = 0;
> -	}
> +	for (i = 0; i < internals->active_member_count; i++)
> +		tlb_last_obytets[internals->active_members[i]] = 0;
>   }
>   
>   static int
>   bandwidth_cmp(const void *a, const void *b)
>   {
> -	const struct bwg_slave *bwg_a = a;
> -	const struct bwg_slave *bwg_b = b;
> +	const struct bwg_member *bwg_a = a;
> +	const struct bwg_member *bwg_b = b;
>   	int64_t diff = (int64_t)bwg_b->bwg_left_int - (int64_t)bwg_a->bwg_left_int;
>   	int64_t diff2 = (int64_t)bwg_b->bwg_left_remainder -
>   			(int64_t)bwg_a->bwg_left_remainder;
> @@ -863,14 +866,14 @@ bandwidth_cmp(const void *a, const void *b)
>   
>   static void
>   bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx,
> -		struct bwg_slave *bwg_slave)
> +		struct bwg_member *bwg_member)
>   {
>   	struct rte_eth_link link_status;
>   	int ret;
>   
>   	ret = rte_eth_link_get_nowait(port_id, &link_status);
>   	if (ret < 0) {
> -		RTE_BOND_LOG(ERR, "Slave (port %u) link get failed: %s",
> +		RTE_BOND_LOG(ERR, "Member (port %u) link get failed: %s",
>   			     port_id, rte_strerror(-ret));
>   		return;
>   	}
> @@ -878,51 +881,51 @@ bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx,
>   	if (link_bwg == 0)
>   		return;
>   	link_bwg = link_bwg * (update_idx+1) * REORDER_PERIOD_MS;
> -	bwg_slave->bwg_left_int = (link_bwg - 1000*load) / link_bwg;
> -	bwg_slave->bwg_left_remainder = (link_bwg - 1000*load) % link_bwg;
> +	bwg_member->bwg_left_int = (link_bwg - 1000 * load) / link_bwg;
> +	bwg_member->bwg_left_remainder = (link_bwg - 1000 * load) % link_bwg;
>   }
>   
>   static void
> -bond_ethdev_update_tlb_slave_cb(void *arg)
> +bond_ethdev_update_tlb_member_cb(void *arg)
>   {
>   	struct bond_dev_private *internals = arg;
> -	struct rte_eth_stats slave_stats;
> -	struct bwg_slave bwg_array[RTE_MAX_ETHPORTS];
> -	uint16_t slave_count;
> +	struct rte_eth_stats member_stats;
> +	struct bwg_member bwg_array[RTE_MAX_ETHPORTS];
> +	uint16_t member_count;
>   	uint64_t tx_bytes;
>   
>   	uint8_t update_stats = 0;
> -	uint16_t slave_id;
> +	uint16_t member_id;
>   	uint16_t i;
>   
> -	internals->slave_update_idx++;
> +	internals->member_update_idx++;
>   
>   
> -	if (internals->slave_update_idx >= REORDER_PERIOD_MS)
> +	if (internals->member_update_idx >= REORDER_PERIOD_MS)
>   		update_stats = 1;
>   
> -	for (i = 0; i < internals->active_slave_count; i++) {
> -		slave_id = internals->active_slaves[i];
> -		rte_eth_stats_get(slave_id, &slave_stats);
> -		tx_bytes = slave_stats.obytes - tlb_last_obytets[slave_id];
> -		bandwidth_left(slave_id, tx_bytes,
> -				internals->slave_update_idx, &bwg_array[i]);
> -		bwg_array[i].slave = slave_id;
> +	for (i = 0; i < internals->active_member_count; i++) {
> +		member_id = internals->active_members[i];
> +		rte_eth_stats_get(member_id, &member_stats);
> +		tx_bytes = member_stats.obytes - tlb_last_obytets[member_id];
> +		bandwidth_left(member_id, tx_bytes,
> +				internals->member_update_idx, &bwg_array[i]);
> +		bwg_array[i].member = member_id;
>   
>   		if (update_stats) {
> -			tlb_last_obytets[slave_id] = slave_stats.obytes;
> +			tlb_last_obytets[member_id] = member_stats.obytes;
>   		}
>   	}
>   
>   	if (update_stats == 1)
> -		internals->slave_update_idx = 0;
> +		internals->member_update_idx = 0;
>   
> -	slave_count = i;
> -	qsort(bwg_array, slave_count, sizeof(bwg_array[0]), bandwidth_cmp);
> -	for (i = 0; i < slave_count; i++)
> -		internals->tlb_slaves_order[i] = bwg_array[i].slave;
> +	member_count = i;
> +	qsort(bwg_array, member_count, sizeof(bwg_array[0]), bandwidth_cmp);
> +	for (i = 0; i < member_count; i++)
> +		internals->tlb_members_order[i] = bwg_array[i].member;
>   
> -	rte_eal_alarm_set(REORDER_PERIOD_MS * 1000, bond_ethdev_update_tlb_slave_cb,
> +	rte_eal_alarm_set(REORDER_PERIOD_MS * 1000, bond_ethdev_update_tlb_member_cb,
>   			(struct bond_dev_private *)internals);
>   }
>   
> @@ -937,29 +940,29 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   	uint16_t num_tx_total = 0, num_tx_prep;
>   	uint16_t i, j;
>   
> -	uint16_t num_of_slaves = internals->active_slave_count;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t num_of_members = internals->active_member_count;
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   
>   	struct rte_ether_hdr *ether_hdr;
> -	struct rte_ether_addr primary_slave_addr;
> -	struct rte_ether_addr active_slave_addr;
> +	struct rte_ether_addr primary_member_addr;
> +	struct rte_ether_addr active_member_addr;
>   
> -	if (num_of_slaves < 1)
> +	if (num_of_members < 1)
>   		return num_tx_total;
>   
> -	memcpy(slaves, internals->tlb_slaves_order,
> -				sizeof(internals->tlb_slaves_order[0]) * num_of_slaves);
> +	memcpy(members, internals->tlb_members_order,
> +				sizeof(internals->tlb_members_order[0]) * num_of_members);
>   
>   
> -	rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_slave_addr);
> +	rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_member_addr);
>   
>   	if (nb_pkts > 3) {
>   		for (i = 0; i < 3; i++)
>   			rte_prefetch0(rte_pktmbuf_mtod(bufs[i], void*));
>   	}
>   
> -	for (i = 0; i < num_of_slaves; i++) {
> -		rte_eth_macaddr_get(slaves[i], &active_slave_addr);
> +	for (i = 0; i < num_of_members; i++) {
> +		rte_eth_macaddr_get(members[i], &active_member_addr);
>   		for (j = num_tx_total; j < nb_pkts; j++) {
>   			if (j + 3 < nb_pkts)
>   				rte_prefetch0(rte_pktmbuf_mtod(bufs[j+3], void*));
> @@ -967,17 +970,18 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   			ether_hdr = rte_pktmbuf_mtod(bufs[j],
>   						struct rte_ether_hdr *);
>   			if (rte_is_same_ether_addr(&ether_hdr->src_addr,
> -							&primary_slave_addr))
> -				rte_ether_addr_copy(&active_slave_addr,
> +							&primary_member_addr))
> +				rte_ether_addr_copy(&active_member_addr,
>   						&ether_hdr->src_addr);
>   #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1)
> -					mode6_debug("TX IPv4:", ether_hdr, slaves[i], &burstnumberTX);
> +					mode6_debug("TX IPv4:", ether_hdr, members[i],
> +						&burst_number_TX);
>   #endif
>   		}
>   
> -		num_tx_prep = rte_eth_tx_prepare(slaves[i], bd_tx_q->queue_id,
> +		num_tx_prep = rte_eth_tx_prepare(members[i], bd_tx_q->queue_id,
>   				bufs + num_tx_total, nb_pkts - num_tx_total);
> -		num_tx_total += rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id,
> +		num_tx_total += rte_eth_tx_burst(members[i], bd_tx_q->queue_id,
>   				bufs + num_tx_total, num_tx_prep);
>   
>   		if (num_tx_total == nb_pkts)
> @@ -990,13 +994,13 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   void
>   bond_tlb_disable(struct bond_dev_private *internals)
>   {
> -	rte_eal_alarm_cancel(bond_ethdev_update_tlb_slave_cb, internals);
> +	rte_eal_alarm_cancel(bond_ethdev_update_tlb_member_cb, internals);
>   }
>   
>   void
>   bond_tlb_enable(struct bond_dev_private *internals)
>   {
> -	bond_ethdev_update_tlb_slave_cb(internals);
> +	bond_ethdev_update_tlb_member_cb(internals);
>   }
>   
>   static uint16_t
> @@ -1011,11 +1015,11 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   	struct client_data *client_info;
>   
>   	/*
> -	 * We create transmit buffers for every slave and one additional to send
> +	 * We create transmit buffers for every member and one additional to send
>   	 * through tlb. In worst case every packet will be send on one port.
>   	 */
> -	struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS + 1][nb_pkts];
> -	uint16_t slave_bufs_pkts[RTE_MAX_ETHPORTS + 1] = { 0 };
> +	struct rte_mbuf *member_bufs[RTE_MAX_ETHPORTS + 1][nb_pkts];
> +	uint16_t member_bufs_pkts[RTE_MAX_ETHPORTS + 1] = { 0 };
>   
>   	/*
>   	 * We create separate transmit buffers for update packets as they won't
> @@ -1029,7 +1033,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   
>   	uint16_t num_send, num_not_send = 0;
>   	uint16_t num_tx_total = 0;
> -	uint16_t slave_idx;
> +	uint16_t member_idx;
>   
>   	int i, j;
>   
> @@ -1040,19 +1044,19 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   		offset = get_vlan_offset(eth_h, &ether_type);
>   
>   		if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP)) {
> -			slave_idx = bond_mode_alb_arp_xmit(eth_h, offset, internals);
> +			member_idx = bond_mode_alb_arp_xmit(eth_h, offset, internals);
>   
>   			/* Change src mac in eth header */
> -			rte_eth_macaddr_get(slave_idx, &eth_h->src_addr);
> +			rte_eth_macaddr_get(member_idx, &eth_h->src_addr);
>   
> -			/* Add packet to slave tx buffer */
> -			slave_bufs[slave_idx][slave_bufs_pkts[slave_idx]] = bufs[i];
> -			slave_bufs_pkts[slave_idx]++;
> +			/* Add packet to member tx buffer */
> +			member_bufs[member_idx][member_bufs_pkts[member_idx]] = bufs[i];
> +			member_bufs_pkts[member_idx]++;
>   		} else {
>   			/* If packet is not ARP, send it with TLB policy */
> -			slave_bufs[RTE_MAX_ETHPORTS][slave_bufs_pkts[RTE_MAX_ETHPORTS]] =
> +			member_bufs[RTE_MAX_ETHPORTS][member_bufs_pkts[RTE_MAX_ETHPORTS]] =
>   					bufs[i];
> -			slave_bufs_pkts[RTE_MAX_ETHPORTS]++;
> +			member_bufs_pkts[RTE_MAX_ETHPORTS]++;
>   		}
>   	}
>   
> @@ -1062,7 +1066,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   			client_info = &internals->mode6.client_table[i];
>   
>   			if (client_info->in_use) {
> -				/* Allocate new packet to send ARP update on current slave */
> +				/* Allocate new packet to send ARP update on current member */
>   				upd_pkt = rte_pktmbuf_alloc(internals->mode6.mempool);
>   				if (upd_pkt == NULL) {
>   					RTE_BOND_LOG(ERR,
> @@ -1076,44 +1080,44 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   				upd_pkt->data_len = pkt_size;
>   				upd_pkt->pkt_len = pkt_size;
>   
> -				slave_idx = bond_mode_alb_arp_upd(client_info, upd_pkt,
> +				member_idx = bond_mode_alb_arp_upd(client_info, upd_pkt,
>   						internals);
>   
>   				/* Add packet to update tx buffer */
> -				update_bufs[slave_idx][update_bufs_pkts[slave_idx]] = upd_pkt;
> -				update_bufs_pkts[slave_idx]++;
> +				update_bufs[member_idx][update_bufs_pkts[member_idx]] = upd_pkt;
> +				update_bufs_pkts[member_idx]++;
>   			}
>   		}
>   		internals->mode6.ntt = 0;
>   	}
>   
> -	/* Send ARP packets on proper slaves */
> +	/* Send ARP packets on proper members */
>   	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
> -		if (slave_bufs_pkts[i] > 0) {
> +		if (member_bufs_pkts[i] > 0) {
>   			num_send = rte_eth_tx_prepare(i, bd_tx_q->queue_id,
> -					slave_bufs[i], slave_bufs_pkts[i]);
> +					member_bufs[i], member_bufs_pkts[i]);
>   			num_send = rte_eth_tx_burst(i, bd_tx_q->queue_id,
> -					slave_bufs[i], num_send);
> -			for (j = 0; j < slave_bufs_pkts[i] - num_send; j++) {
> +					member_bufs[i], num_send);
> +			for (j = 0; j < member_bufs_pkts[i] - num_send; j++) {
>   				bufs[nb_pkts - 1 - num_not_send - j] =
> -						slave_bufs[i][nb_pkts - 1 - j];
> +						member_bufs[i][nb_pkts - 1 - j];
>   			}
>   
>   			num_tx_total += num_send;
> -			num_not_send += slave_bufs_pkts[i] - num_send;
> +			num_not_send += member_bufs_pkts[i] - num_send;
>   
>   #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1)
>   	/* Print TX stats including update packets */
> -			for (j = 0; j < slave_bufs_pkts[i]; j++) {
> -				eth_h = rte_pktmbuf_mtod(slave_bufs[i][j],
> +			for (j = 0; j < member_bufs_pkts[i]; j++) {
> +				eth_h = rte_pktmbuf_mtod(member_bufs[i][j],
>   							struct rte_ether_hdr *);
> -				mode6_debug("TX ARP:", eth_h, i, &burstnumberTX);
> +				mode6_debug("TX ARP:", eth_h, i, &burst_number_TX);
>   			}
>   #endif
>   		}
>   	}
>   
> -	/* Send update packets on proper slaves */
> +	/* Send update packets on proper members */
>   	for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
>   		if (update_bufs_pkts[i] > 0) {
>   			num_send = rte_eth_tx_prepare(i, bd_tx_q->queue_id,
> @@ -1127,21 +1131,21 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   			for (j = 0; j < update_bufs_pkts[i]; j++) {
>   				eth_h = rte_pktmbuf_mtod(update_bufs[i][j],
>   							struct rte_ether_hdr *);
> -				mode6_debug("TX ARPupd:", eth_h, i, &burstnumberTX);
> +				mode6_debug("TX ARPupd:", eth_h, i, &burst_number_TX);
>   			}
>   #endif
>   		}
>   	}
>   
>   	/* Send non-ARP packets using tlb policy */
> -	if (slave_bufs_pkts[RTE_MAX_ETHPORTS] > 0) {
> +	if (member_bufs_pkts[RTE_MAX_ETHPORTS] > 0) {
>   		num_send = bond_ethdev_tx_burst_tlb(queue,
> -				slave_bufs[RTE_MAX_ETHPORTS],
> -				slave_bufs_pkts[RTE_MAX_ETHPORTS]);
> +				member_bufs[RTE_MAX_ETHPORTS],
> +				member_bufs_pkts[RTE_MAX_ETHPORTS]);
>   
> -		for (j = 0; j < slave_bufs_pkts[RTE_MAX_ETHPORTS]; j++) {
> +		for (j = 0; j < member_bufs_pkts[RTE_MAX_ETHPORTS]; j++) {
>   			bufs[nb_pkts - 1 - num_not_send - j] =
> -					slave_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j];
> +					member_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j];
>   		}
>   
>   		num_tx_total += num_send;
> @@ -1152,59 +1156,59 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>   
>   static inline uint16_t
>   tx_burst_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs,
> -		 uint16_t *slave_port_ids, uint16_t slave_count)
> +		 uint16_t *member_port_ids, uint16_t member_count)
>   {
>   	struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue;
>   	struct bond_dev_private *internals = bd_tx_q->dev_private;
>   
> -	/* Array to sort mbufs for transmission on each slave into */
> -	struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_bufs];
> -	/* Number of mbufs for transmission on each slave */
> -	uint16_t slave_nb_bufs[RTE_MAX_ETHPORTS] = { 0 };
> -	/* Mapping array generated by hash function to map mbufs to slaves */
> -	uint16_t bufs_slave_port_idxs[nb_bufs];
> +	/* Array to sort mbufs for transmission on each member into */
> +	struct rte_mbuf *member_bufs[RTE_MAX_ETHPORTS][nb_bufs];
> +	/* Number of mbufs for transmission on each member */
> +	uint16_t member_nb_bufs[RTE_MAX_ETHPORTS] = { 0 };
> +	/* Mapping array generated by hash function to map mbufs to members */
> +	uint16_t bufs_member_port_idxs[nb_bufs];
>   
> -	uint16_t slave_tx_count;
> +	uint16_t member_tx_count;
>   	uint16_t total_tx_count = 0, total_tx_fail_count = 0;
>   
>   	uint16_t i;
>   
>   	/*
> -	 * Populate slaves mbuf with the packets which are to be sent on it
> -	 * selecting output slave using hash based on xmit policy
> +	 * Populate members mbuf with the packets which are to be sent on it
> +	 * selecting output member using hash based on xmit policy
>   	 */
> -	internals->burst_xmit_hash(bufs, nb_bufs, slave_count,
> -			bufs_slave_port_idxs);
> +	internals->burst_xmit_hash(bufs, nb_bufs, member_count,
> +			bufs_member_port_idxs);
>   
>   	for (i = 0; i < nb_bufs; i++) {
> -		/* Populate slave mbuf arrays with mbufs for that slave. */
> -		uint16_t slave_idx = bufs_slave_port_idxs[i];
> +		/* Populate member mbuf arrays with mbufs for that member. */
> +		uint16_t member_idx = bufs_member_port_idxs[i];
>   
> -		slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = bufs[i];
> +		member_bufs[member_idx][member_nb_bufs[member_idx]++] = bufs[i];
>   	}
>   
> -	/* Send packet burst on each slave device */
> -	for (i = 0; i < slave_count; i++) {
> -		if (slave_nb_bufs[i] == 0)
> +	/* Send packet burst on each member device */
> +	for (i = 0; i < member_count; i++) {
> +		if (member_nb_bufs[i] == 0)
>   			continue;
>   
> -		slave_tx_count = rte_eth_tx_prepare(slave_port_ids[i],
> -				bd_tx_q->queue_id, slave_bufs[i],
> -				slave_nb_bufs[i]);
> -		slave_tx_count = rte_eth_tx_burst(slave_port_ids[i],
> -				bd_tx_q->queue_id, slave_bufs[i],
> -				slave_tx_count);
> +		member_tx_count = rte_eth_tx_prepare(member_port_ids[i],
> +				bd_tx_q->queue_id, member_bufs[i],
> +				member_nb_bufs[i]);
> +		member_tx_count = rte_eth_tx_burst(member_port_ids[i],
> +				bd_tx_q->queue_id, member_bufs[i],
> +				member_tx_count);
>   
> -		total_tx_count += slave_tx_count;
> +		total_tx_count += member_tx_count;
>   
>   		/* If tx burst fails move packets to end of bufs */
> -		if (unlikely(slave_tx_count < slave_nb_bufs[i])) {
> -			int slave_tx_fail_count = slave_nb_bufs[i] -
> -					slave_tx_count;
> -			total_tx_fail_count += slave_tx_fail_count;
> +		if (unlikely(member_tx_count < member_nb_bufs[i])) {
> +			int member_tx_fail_count = member_nb_bufs[i] -
> +					member_tx_count;
> +			total_tx_fail_count += member_tx_fail_count;
>   			memcpy(&bufs[nb_bufs - total_tx_fail_count],
> -			       &slave_bufs[i][slave_tx_count],
> -			       slave_tx_fail_count * sizeof(bufs[0]));
> +			       &member_bufs[i][member_tx_count],
> +			       member_tx_fail_count * sizeof(bufs[0]));
>   		}
>   	}
>   
> @@ -1218,23 +1222,23 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs,
>   	struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue;
>   	struct bond_dev_private *internals = bd_tx_q->dev_private;
>   
> -	uint16_t slave_port_ids[RTE_MAX_ETHPORTS];
> -	uint16_t slave_count;
> +	uint16_t member_port_ids[RTE_MAX_ETHPORTS];
> +	uint16_t member_count;
>   
>   	if (unlikely(nb_bufs == 0))
>   		return 0;
>   
> -	/* Copy slave list to protect against slave up/down changes during tx
> +	/* Copy member list to protect against member up/down changes during tx
>   	 * bursting
>   	 */
> -	slave_count = internals->active_slave_count;
> -	if (unlikely(slave_count < 1))
> +	member_count = internals->active_member_count;
> +	if (unlikely(member_count < 1))
>   		return 0;
>   
> -	memcpy(slave_port_ids, internals->active_slaves,
> -			sizeof(slave_port_ids[0]) * slave_count);
> -	return tx_burst_balance(queue, bufs, nb_bufs, slave_port_ids,
> -				slave_count);
> +	memcpy(member_port_ids, internals->active_members,
> +			sizeof(member_port_ids[0]) * member_count);
> +	return tx_burst_balance(queue, bufs, nb_bufs, member_port_ids,
> +				member_count);
>   }
>   
>   static inline uint16_t
> @@ -1244,31 +1248,31 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs,
>   	struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue;
>   	struct bond_dev_private *internals = bd_tx_q->dev_private;
>   
> -	uint16_t slave_port_ids[RTE_MAX_ETHPORTS];
> -	uint16_t slave_count;
> +	uint16_t member_port_ids[RTE_MAX_ETHPORTS];
> +	uint16_t member_count;
>   
> -	uint16_t dist_slave_port_ids[RTE_MAX_ETHPORTS];
> -	uint16_t dist_slave_count;
> +	uint16_t dist_member_port_ids[RTE_MAX_ETHPORTS];
> +	uint16_t dist_member_count;
>   
> -	uint16_t slave_tx_count;
> +	uint16_t member_tx_count;
>   
>   	uint16_t i;
>   
> -	/* Copy slave list to protect against slave up/down changes during tx
> +	/* Copy member list to protect against member up/down changes during tx
>   	 * bursting */
> -	slave_count = internals->active_slave_count;
> -	if (unlikely(slave_count < 1))
> +	member_count = internals->active_member_count;
> +	if (unlikely(member_count < 1))
>   		return 0;
>   
> -	memcpy(slave_port_ids, internals->active_slaves,
> -			sizeof(slave_port_ids[0]) * slave_count);
> +	memcpy(member_port_ids, internals->active_members,
> +			sizeof(member_port_ids[0]) * member_count);
>   
>   	if (dedicated_txq)
>   		goto skip_tx_ring;
>   
>   	/* Check for LACP control packets and send if available */
> -	for (i = 0; i < slave_count; i++) {
> -		struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]];
> +	for (i = 0; i < member_count; i++) {
> +		struct port *port = &bond_mode_8023ad_ports[member_port_ids[i]];
>   		struct rte_mbuf *ctrl_pkt = NULL;
>   
>   		if (likely(rte_ring_empty(port->tx_ring)))
> @@ -1276,15 +1280,15 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs,
>   
>   		if (rte_ring_dequeue(port->tx_ring,
>   				     (void **)&ctrl_pkt) != -ENOENT) {
> -			slave_tx_count = rte_eth_tx_prepare(slave_port_ids[i],
> +			member_tx_count = rte_eth_tx_prepare(member_port_ids[i],
>   					bd_tx_q->queue_id, &ctrl_pkt, 1);
> -			slave_tx_count = rte_eth_tx_burst(slave_port_ids[i],
> -					bd_tx_q->queue_id, &ctrl_pkt, slave_tx_count);
> +			member_tx_count = rte_eth_tx_burst(member_port_ids[i],
> +					bd_tx_q->queue_id, &ctrl_pkt, member_tx_count);
>   			/*
>   			 * re-enqueue LAG control plane packets to buffering
>   			 * ring if transmission fails so the packet isn't lost.
>   			 */
> -			if (slave_tx_count != 1)
> +			if (member_tx_count != 1)
>   				rte_ring_enqueue(port->tx_ring,	ctrl_pkt);
>   		}
>   	}
> @@ -1293,20 +1297,20 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs,
>   	if (unlikely(nb_bufs == 0))
>   		return 0;
>   
> -	dist_slave_count = 0;
> -	for (i = 0; i < slave_count; i++) {
> -		struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]];
> +	dist_member_count = 0;
> +	for (i = 0; i < member_count; i++) {
> +		struct port *port = &bond_mode_8023ad_ports[member_port_ids[i]];
>   
>   		if (ACTOR_STATE(port, DISTRIBUTING))
> -			dist_slave_port_ids[dist_slave_count++] =
> -					slave_port_ids[i];
> +			dist_member_port_ids[dist_member_count++] =
> +					member_port_ids[i];
>   	}
>   
> -	if (unlikely(dist_slave_count < 1))
> +	if (unlikely(dist_member_count < 1))
>   		return 0;
>   
> -	return tx_burst_balance(queue, bufs, nb_bufs, dist_slave_port_ids,
> -				dist_slave_count);
> +	return tx_burst_balance(queue, bufs, nb_bufs, dist_member_port_ids,
> +				dist_member_count);
>   }
>   
>   static uint16_t
> @@ -1330,78 +1334,78 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs,
>   	struct bond_dev_private *internals;
>   	struct bond_tx_queue *bd_tx_q;
>   
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> +	uint16_t members[RTE_MAX_ETHPORTS];
>   	uint8_t tx_failed_flag = 0;
> -	uint16_t num_of_slaves;
> +	uint16_t num_of_members;
>   
>   	uint16_t max_nb_of_tx_pkts = 0;
>   
> -	int slave_tx_total[RTE_MAX_ETHPORTS];
> -	int i, most_successful_tx_slave = -1;
> +	int member_tx_total[RTE_MAX_ETHPORTS];
> +	int i, most_successful_tx_member = -1;
>   
>   	bd_tx_q = (struct bond_tx_queue *)queue;
>   	internals = bd_tx_q->dev_private;
>   
> -	/* Copy slave list to protect against slave up/down changes during tx
> +	/* Copy member list to protect against member up/down changes during tx
>   	 * bursting */
> -	num_of_slaves = internals->active_slave_count;
> -	memcpy(slaves, internals->active_slaves,
> -			sizeof(internals->active_slaves[0]) * num_of_slaves);
> +	num_of_members = internals->active_member_count;
> +	memcpy(members, internals->active_members,
> +			sizeof(internals->active_members[0]) * num_of_members);
>   
> -	if (num_of_slaves < 1)
> +	if (num_of_members < 1)
>   		return 0;
>   
>   	/* It is rare that bond different PMDs together, so just call tx-prepare once */
> -	nb_pkts = rte_eth_tx_prepare(slaves[0], bd_tx_q->queue_id, bufs, nb_pkts);
> +	nb_pkts = rte_eth_tx_prepare(members[0], bd_tx_q->queue_id, bufs, nb_pkts);
>   
>   	/* Increment reference count on mbufs */
>   	for (i = 0; i < nb_pkts; i++)
> -		rte_pktmbuf_refcnt_update(bufs[i], num_of_slaves - 1);
> +		rte_pktmbuf_refcnt_update(bufs[i], num_of_members - 1);
>   
> -	/* Transmit burst on each active slave */
> -	for (i = 0; i < num_of_slaves; i++) {
> -		slave_tx_total[i] = rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id,
> +	/* Transmit burst on each active member */
> +	for (i = 0; i < num_of_members; i++) {
> +		member_tx_total[i] = rte_eth_tx_burst(members[i], bd_tx_q->queue_id,
>   					bufs, nb_pkts);
>   
> -		if (unlikely(slave_tx_total[i] < nb_pkts))
> +		if (unlikely(member_tx_total[i] < nb_pkts))
>   			tx_failed_flag = 1;
>   
> -		/* record the value and slave index for the slave which transmits the
> +		/* record the value and member index for the member which transmits the
>   		 * maximum number of packets */
> -		if (slave_tx_total[i] > max_nb_of_tx_pkts) {
> -			max_nb_of_tx_pkts = slave_tx_total[i];
> -			most_successful_tx_slave = i;
> +		if (member_tx_total[i] > max_nb_of_tx_pkts) {
> +			max_nb_of_tx_pkts = member_tx_total[i];
> +			most_successful_tx_member = i;
>   		}
>   	}
>   
> -	/* if slaves fail to transmit packets from burst, the calling application
> +	/* if members fail to transmit packets from burst, the calling application
>   	 * is not expected to know about multiple references to packets so we must
> -	 * handle failures of all packets except those of the most successful slave
> +	 * handle failures of all packets except those of the most successful member
>   	 */
>   	if (unlikely(tx_failed_flag))
> -		for (i = 0; i < num_of_slaves; i++)
> -			if (i != most_successful_tx_slave)
> -				while (slave_tx_total[i] < nb_pkts)
> -					rte_pktmbuf_free(bufs[slave_tx_total[i]++]);
> +		for (i = 0; i < num_of_members; i++)
> +			if (i != most_successful_tx_member)
> +				while (member_tx_total[i] < nb_pkts)
> +					rte_pktmbuf_free(bufs[member_tx_total[i]++]);
>   
>   	return max_nb_of_tx_pkts;
>   }
>   
>   static void
> -link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link)
> +link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *member_link)
>   {
>   	struct bond_dev_private *bond_ctx = ethdev->data->dev_private;
>   
>   	if (bond_ctx->mode == BONDING_MODE_8023AD) {
>   		/**
>   		 * If in mode 4 then save the link properties of the first
> -		 * slave, all subsequent slaves must match these properties
> +		 * member, all subsequent members must match these properties
>   		 */
> -		struct rte_eth_link *bond_link = &bond_ctx->mode4.slave_link;
> +		struct rte_eth_link *bond_link = &bond_ctx->mode4.member_link;
>   
> -		bond_link->link_autoneg = slave_link->link_autoneg;
> -		bond_link->link_duplex = slave_link->link_duplex;
> -		bond_link->link_speed = slave_link->link_speed;
> +		bond_link->link_autoneg = member_link->link_autoneg;
> +		bond_link->link_duplex = member_link->link_duplex;
> +		bond_link->link_speed = member_link->link_speed;
>   	} else {
>   		/**
>   		 * In any other mode the link properties are set to default
> @@ -1414,16 +1418,16 @@ link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link)
>   
>   static int
>   link_properties_valid(struct rte_eth_dev *ethdev,
> -		struct rte_eth_link *slave_link)
> +		struct rte_eth_link *member_link)
>   {
>   	struct bond_dev_private *bond_ctx = ethdev->data->dev_private;
>   
>   	if (bond_ctx->mode == BONDING_MODE_8023AD) {
> -		struct rte_eth_link *bond_link = &bond_ctx->mode4.slave_link;
> +		struct rte_eth_link *bond_link = &bond_ctx->mode4.member_link;
>   
> -		if (bond_link->link_duplex != slave_link->link_duplex ||
> -			bond_link->link_autoneg != slave_link->link_autoneg ||
> -			bond_link->link_speed != slave_link->link_speed)
> +		if (bond_link->link_duplex != member_link->link_duplex ||
> +			bond_link->link_autoneg != member_link->link_autoneg ||
> +			bond_link->link_speed != member_link->link_speed)
>   			return -1;
>   	}
>   
> @@ -1480,11 +1484,11 @@ mac_address_set(struct rte_eth_dev *eth_dev,
>   static const struct rte_ether_addr null_mac_addr;
>   
>   /*
> - * Add additional MAC addresses to the slave
> + * Add additional MAC addresses to the member
>    */
>   int
> -slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> -		uint16_t slave_port_id)
> +member_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> +		uint16_t member_port_id)
>   {
>   	int i, ret;
>   	struct rte_ether_addr *mac_addr;
> @@ -1494,11 +1498,11 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
>   		if (rte_is_same_ether_addr(mac_addr, &null_mac_addr))
>   			break;
>   
> -		ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0);
> +		ret = rte_eth_dev_mac_addr_add(member_port_id, mac_addr, 0);
>   		if (ret < 0) {
>   			/* rollback */
>   			for (i--; i > 0; i--)
> -				rte_eth_dev_mac_addr_remove(slave_port_id,
> +				rte_eth_dev_mac_addr_remove(member_port_id,
>   					&bonded_eth_dev->data->mac_addrs[i]);
>   			return ret;
>   		}
> @@ -1508,11 +1512,11 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
>   }
>   
>   /*
> - * Remove additional MAC addresses from the slave
> + * Remove additional MAC addresses from the member
>    */
>   int
> -slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> -		uint16_t slave_port_id)
> +member_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
> +		uint16_t member_port_id)
>   {
>   	int i, rc, ret;
>   	struct rte_ether_addr *mac_addr;
> @@ -1523,7 +1527,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
>   		if (rte_is_same_ether_addr(mac_addr, &null_mac_addr))
>   			break;
>   
> -		ret = rte_eth_dev_mac_addr_remove(slave_port_id, mac_addr);
> +		ret = rte_eth_dev_mac_addr_remove(member_port_id, mac_addr);
>   		/* save only the first error */
>   		if (ret < 0 && rc == 0)
>   			rc = ret;
> @@ -1533,26 +1537,26 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
>   }
>   
>   int
> -mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
> +mac_address_members_update(struct rte_eth_dev *bonded_eth_dev)
>   {
>   	struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
>   	bool set;
>   	int i;
>   
> -	/* Update slave devices MAC addresses */
> -	if (internals->slave_count < 1)
> +	/* Update member devices MAC addresses */
> +	if (internals->member_count < 1)
>   		return -1;
>   
>   	switch (internals->mode) {
>   	case BONDING_MODE_ROUND_ROBIN:
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
> -		for (i = 0; i < internals->slave_count; i++) {
> +		for (i = 0; i < internals->member_count; i++) {
>   			if (rte_eth_dev_default_mac_addr_set(
> -					internals->slaves[i].port_id,
> +					internals->members[i].port_id,
>   					bonded_eth_dev->data->mac_addrs)) {
>   				RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
> -						internals->slaves[i].port_id);
> +						internals->members[i].port_id);
>   				return -1;
>   			}
>   		}
> @@ -1565,8 +1569,8 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
>   	case BONDING_MODE_ALB:
>   	default:
>   		set = true;
> -		for (i = 0; i < internals->slave_count; i++) {
> -			if (internals->slaves[i].port_id ==
> +		for (i = 0; i < internals->member_count; i++) {
> +			if (internals->members[i].port_id ==
>   					internals->current_primary_port) {
>   				if (rte_eth_dev_default_mac_addr_set(
>   						internals->current_primary_port,
> @@ -1577,10 +1581,10 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
>   				}
>   			} else {
>   				if (rte_eth_dev_default_mac_addr_set(
> -						internals->slaves[i].port_id,
> -						&internals->slaves[i].persisted_mac_addr)) {
> +						internals->members[i].port_id,
> +						&internals->members[i].persisted_mac_addr)) {
>   					RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
> -							internals->slaves[i].port_id);
> +							internals->members[i].port_id);
>   				}
>   			}
>   		}
> @@ -1655,55 +1659,55 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
>   
>   
>   static int
> -slave_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev,
> -		struct rte_eth_dev *slave_eth_dev)
> +member_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev,
> +		struct rte_eth_dev *member_eth_dev)
>   {
>   	int errval = 0;
>   	struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
> -	struct port *port = &bond_mode_8023ad_ports[slave_eth_dev->data->port_id];
> +	struct port *port = &bond_mode_8023ad_ports[member_eth_dev->data->port_id];
>   
>   	if (port->slow_pool == NULL) {
>   		char mem_name[256];
> -		int slave_id = slave_eth_dev->data->port_id;
> +		int member_id = member_eth_dev->data->port_id;
>   
> -		snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_slow_pool",
> -				slave_id);
> +		snprintf(mem_name, RTE_DIM(mem_name), "member_port%u_slow_pool",
> +				member_id);
>   		port->slow_pool = rte_pktmbuf_pool_create(mem_name, 8191,
>   			250, 0, RTE_MBUF_DEFAULT_BUF_SIZE,
> -			slave_eth_dev->data->numa_node);
> +			member_eth_dev->data->numa_node);
>   
>   		/* Any memory allocation failure in initialization is critical because
>   		 * resources can't be free, so reinitialization is impossible. */
>   		if (port->slow_pool == NULL) {
> -			rte_panic("Slave %u: Failed to create memory pool '%s': %s\n",
> -				slave_id, mem_name, rte_strerror(rte_errno));
> +			rte_panic("Member %u: Failed to create memory pool '%s': %s\n",
> +				member_id, mem_name, rte_strerror(rte_errno));
>   		}
>   	}
>   
>   	if (internals->mode4.dedicated_queues.enabled == 1) {
>   		/* Configure slow Rx queue */
>   
> -		errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id,
> +		errval = rte_eth_rx_queue_setup(member_eth_dev->data->port_id,
>   				internals->mode4.dedicated_queues.rx_qid, 128,
> -				rte_eth_dev_socket_id(slave_eth_dev->data->port_id),
> +				rte_eth_dev_socket_id(member_eth_dev->data->port_id),
>   				NULL, port->slow_pool);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   					"rte_eth_rx_queue_setup: port=%d queue_id %d, err (%d)",
> -					slave_eth_dev->data->port_id,
> +					member_eth_dev->data->port_id,
>   					internals->mode4.dedicated_queues.rx_qid,
>   					errval);
>   			return errval;
>   		}
>   
> -		errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id,
> +		errval = rte_eth_tx_queue_setup(member_eth_dev->data->port_id,
>   				internals->mode4.dedicated_queues.tx_qid, 512,
> -				rte_eth_dev_socket_id(slave_eth_dev->data->port_id),
> +				rte_eth_dev_socket_id(member_eth_dev->data->port_id),
>   				NULL);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   				"rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)",
> -				slave_eth_dev->data->port_id,
> +				member_eth_dev->data->port_id,
>   				internals->mode4.dedicated_queues.tx_qid,
>   				errval);
>   			return errval;
> @@ -1713,8 +1717,8 @@ slave_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev,
>   }
>   
>   int
> -slave_configure(struct rte_eth_dev *bonded_eth_dev,
> -		struct rte_eth_dev *slave_eth_dev)
> +member_configure(struct rte_eth_dev *bonded_eth_dev,
> +		struct rte_eth_dev *member_eth_dev)
>   {
>   	uint16_t nb_rx_queues;
>   	uint16_t nb_tx_queues;
> @@ -1723,45 +1727,45 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   
>   	struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
>   
> -	/* Stop slave */
> -	errval = rte_eth_dev_stop(slave_eth_dev->data->port_id);
> +	/* Stop member */
> +	errval = rte_eth_dev_stop(member_eth_dev->data->port_id);
>   	if (errval != 0)
>   		RTE_BOND_LOG(ERR, "rte_eth_dev_stop: port %u, err (%d)",
> -			     slave_eth_dev->data->port_id, errval);
> +			     member_eth_dev->data->port_id, errval);
>   
> -	/* Enable interrupts on slave device if supported */
> -	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
> -		slave_eth_dev->data->dev_conf.intr_conf.lsc = 1;
> +	/* Enable interrupts on member device if supported */
> +	if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
> +		member_eth_dev->data->dev_conf.intr_conf.lsc = 1;
>   
> -	/* If RSS is enabled for bonding, try to enable it for slaves  */
> +	/* If RSS is enabled for bonding, try to enable it for members  */
>   	if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) {
>   		/* rss_key won't be empty if RSS is configured in bonded dev */
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =
>   					internals->rss_key_len;
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =
>   					internals->rss_key;
>   
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
>   				bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
> -		slave_eth_dev->data->dev_conf.rxmode.mq_mode =
> +		member_eth_dev->data->dev_conf.rxmode.mq_mode =
>   				bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
>   	} else {
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0;
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
> -		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;
> -		slave_eth_dev->data->dev_conf.rxmode.mq_mode =
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0;
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
> +		member_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;
> +		member_eth_dev->data->dev_conf.rxmode.mq_mode =
>   				bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
>   	}
>   
> -	slave_eth_dev->data->dev_conf.rxmode.mtu =
> +	member_eth_dev->data->dev_conf.rxmode.mtu =
>   			bonded_eth_dev->data->dev_conf.rxmode.mtu;
> -	slave_eth_dev->data->dev_conf.link_speeds =
> +	member_eth_dev->data->dev_conf.link_speeds =
>   			bonded_eth_dev->data->dev_conf.link_speeds;
>   
> -	slave_eth_dev->data->dev_conf.txmode.offloads =
> +	member_eth_dev->data->dev_conf.txmode.offloads =
>   			bonded_eth_dev->data->dev_conf.txmode.offloads;
>   
> -	slave_eth_dev->data->dev_conf.rxmode.offloads =
> +	member_eth_dev->data->dev_conf.rxmode.offloads =
>   			bonded_eth_dev->data->dev_conf.rxmode.offloads;
>   
>   	nb_rx_queues = bonded_eth_dev->data->nb_rx_queues;
> @@ -1775,28 +1779,28 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   	}
>   
>   	/* Configure device */
> -	errval = rte_eth_dev_configure(slave_eth_dev->data->port_id,
> +	errval = rte_eth_dev_configure(member_eth_dev->data->port_id,
>   			nb_rx_queues, nb_tx_queues,
> -			&(slave_eth_dev->data->dev_conf));
> +			&member_eth_dev->data->dev_conf);
>   	if (errval != 0) {
> -		RTE_BOND_LOG(ERR, "Cannot configure slave device: port %u, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +		RTE_BOND_LOG(ERR, "Cannot configure member device: port %u, err (%d)",
> +				member_eth_dev->data->port_id, errval);
>   		return errval;
>   	}
>   
> -	errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id,
> +	errval = rte_eth_dev_set_mtu(member_eth_dev->data->port_id,
>   				     bonded_eth_dev->data->mtu);
>   	if (errval != 0 && errval != -ENOTSUP) {
>   		RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +				member_eth_dev->data->port_id, errval);
>   		return errval;
>   	}
>   	return 0;
>   }
>   
>   int
> -slave_start(struct rte_eth_dev *bonded_eth_dev,
> -		struct rte_eth_dev *slave_eth_dev)
> +member_start(struct rte_eth_dev *bonded_eth_dev,
> +		struct rte_eth_dev *member_eth_dev)
>   {
>   	int errval = 0;
>   	struct bond_rx_queue *bd_rx_q;
> @@ -1804,19 +1808,20 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
>   	uint16_t q_id;
>   	struct rte_flow_error flow_error;
>   	struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
> +	uint16_t member_port_id = member_eth_dev->data->port_id;
>   
>   	/* Setup Rx Queues */
>   	for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) {
>   		bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id];
>   
> -		errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, q_id,
> +		errval = rte_eth_rx_queue_setup(member_port_id, q_id,
>   				bd_rx_q->nb_rx_desc,
> -				rte_eth_dev_socket_id(slave_eth_dev->data->port_id),
> +				rte_eth_dev_socket_id(member_port_id),
>   				&(bd_rx_q->rx_conf), bd_rx_q->mb_pool);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   					"rte_eth_rx_queue_setup: port=%d queue_id %d, err (%d)",
> -					slave_eth_dev->data->port_id, q_id, errval);
> +					member_port_id, q_id, errval);
>   			return errval;
>   		}
>   	}
> @@ -1825,58 +1830,58 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
>   	for (q_id = 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) {
>   		bd_tx_q = (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id];
>   
> -		errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, q_id,
> +		errval = rte_eth_tx_queue_setup(member_port_id, q_id,
>   				bd_tx_q->nb_tx_desc,
> -				rte_eth_dev_socket_id(slave_eth_dev->data->port_id),
> +				rte_eth_dev_socket_id(member_port_id),
>   				&bd_tx_q->tx_conf);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   				"rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)",
> -				slave_eth_dev->data->port_id, q_id, errval);
> +				member_port_id, q_id, errval);
>   			return errval;
>   		}
>   	}
>   
>   	if (internals->mode == BONDING_MODE_8023AD &&
>   			internals->mode4.dedicated_queues.enabled == 1) {
> -		if (slave_configure_slow_queue(bonded_eth_dev, slave_eth_dev)
> +		if (member_configure_slow_queue(bonded_eth_dev, member_eth_dev)
>   				!= 0)
>   			return errval;
>   
>   		errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
> -				slave_eth_dev->data->port_id);
> +				member_port_id);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   				"bond_ethdev_8023ad_flow_verify: port=%d, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +				member_port_id, errval);
>   			return errval;
>   		}
>   
> -		if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL) {
> -			errval = rte_flow_destroy(slave_eth_dev->data->port_id,
> -					internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id],
> +		if (internals->mode4.dedicated_queues.flow[member_port_id] != NULL) {
> +			errval = rte_flow_destroy(member_port_id,
> +					internals->mode4.dedicated_queues.flow[member_port_id],
>   					&flow_error);
>   			RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_destroy: port=%d, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +				member_port_id, errval);
>   		}
>   	}
>   
>   	/* Start device */
> -	errval = rte_eth_dev_start(slave_eth_dev->data->port_id);
> +	errval = rte_eth_dev_start(member_port_id);
>   	if (errval != 0) {
>   		RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +				member_port_id, errval);
>   		return -1;
>   	}
>   
>   	if (internals->mode == BONDING_MODE_8023AD &&
>   			internals->mode4.dedicated_queues.enabled == 1) {
>   		errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev,
> -				slave_eth_dev->data->port_id);
> +				member_port_id);
>   		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
>   				"bond_ethdev_8023ad_flow_set: port=%d, err (%d)",
> -				slave_eth_dev->data->port_id, errval);
> +				member_port_id, errval);
>   			return errval;
>   		}
>   	}
> @@ -1888,27 +1893,27 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
>   
>   		internals = bonded_eth_dev->data->dev_private;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			if (internals->slaves[i].port_id == slave_eth_dev->data->port_id) {
> +		for (i = 0; i < internals->member_count; i++) {
> +			if (internals->members[i].port_id == member_port_id) {
>   				errval = rte_eth_dev_rss_reta_update(
> -						slave_eth_dev->data->port_id,
> +						member_port_id,
>   						&internals->reta_conf[0],
> -						internals->slaves[i].reta_size);
> +						internals->members[i].reta_size);
>   				if (errval != 0) {
>   					RTE_BOND_LOG(WARNING,
> -						     "rte_eth_dev_rss_reta_update on slave port %d fails (err %d)."
> +						     "rte_eth_dev_rss_reta_update on member port %d fails (err %d)."
>   						     " RSS Configuration for bonding may be inconsistent.",
> -						     slave_eth_dev->data->port_id, errval);
> +						     member_port_id, errval);
>   				}
>   				break;
>   			}
>   		}
>   	}
>   
> -	/* If lsc interrupt is set, check initial slave's link status */
> -	if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
> -		slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0);
> -		bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,
> +	/* If lsc interrupt is set, check initial member's link status */
> +	if (member_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {
> +		member_eth_dev->dev_ops->link_update(member_eth_dev, 0);
> +		bond_ethdev_lsc_event_callback(member_port_id,
>   			RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id,
>   			NULL);
>   	}
> @@ -1917,75 +1922,74 @@ slave_start(struct rte_eth_dev *bonded_eth_dev,
>   }
>   
>   void
> -slave_remove(struct bond_dev_private *internals,
> -		struct rte_eth_dev *slave_eth_dev)
> +member_remove(struct bond_dev_private *internals,
> +		struct rte_eth_dev *member_eth_dev)
>   {
>   	uint16_t i;
>   
> -	for (i = 0; i < internals->slave_count; i++)
> -		if (internals->slaves[i].port_id ==
> -				slave_eth_dev->data->port_id)
> +	for (i = 0; i < internals->member_count; i++)
> +		if (internals->members[i].port_id ==
> +				member_eth_dev->data->port_id)
>   			break;
>   
> -	if (i < (internals->slave_count - 1)) {
> +	if (i < (internals->member_count - 1)) {
>   		struct rte_flow *flow;
>   
> -		memmove(&internals->slaves[i], &internals->slaves[i + 1],
> -				sizeof(internals->slaves[0]) *
> -				(internals->slave_count - i - 1));
> +		memmove(&internals->members[i], &internals->members[i + 1],
> +				sizeof(internals->members[0]) *
> +				(internals->member_count - i - 1));
>   		TAILQ_FOREACH(flow, &internals->flow_list, next) {
>   			memmove(&flow->flows[i], &flow->flows[i + 1],
>   				sizeof(flow->flows[0]) *
> -				(internals->slave_count - i - 1));
> -			flow->flows[internals->slave_count - 1] = NULL;
> +				(internals->member_count - i - 1));
> +			flow->flows[internals->member_count - 1] = NULL;
>   		}
>   	}
>   
> -	internals->slave_count--;
> +	internals->member_count--;
>   
> -	/* force reconfiguration of slave interfaces */
> -	rte_eth_dev_internal_reset(slave_eth_dev);
> +	/* force reconfiguration of member interfaces */
> +	rte_eth_dev_internal_reset(member_eth_dev);
>   }
>   
>   static void
> -bond_ethdev_slave_link_status_change_monitor(void *cb_arg);
> +bond_ethdev_member_link_status_change_monitor(void *cb_arg);
>   
>   void
> -slave_add(struct bond_dev_private *internals,
> -		struct rte_eth_dev *slave_eth_dev)
> +member_add(struct bond_dev_private *internals,
> +		struct rte_eth_dev *member_eth_dev)
>   {
> -	struct bond_slave_details *slave_details =
> -			&internals->slaves[internals->slave_count];
> +	struct bond_member_details *member_details =
> +			&internals->members[internals->member_count];
>   
> -	slave_details->port_id = slave_eth_dev->data->port_id;
> -	slave_details->last_link_status = 0;
> +	member_details->port_id = member_eth_dev->data->port_id;
> +	member_details->last_link_status = 0;
>   
> -	/* Mark slave devices that don't support interrupts so we can
> +	/* Mark member devices that don't support interrupts so we can
>   	 * compensate when we start the bond
>   	 */
> -	if (!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) {
> -		slave_details->link_status_poll_enabled = 1;
> -	}
> +	if (!(member_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC))
> +		member_details->link_status_poll_enabled = 1;
>   
> -	slave_details->link_status_wait_to_complete = 0;
> +	member_details->link_status_wait_to_complete = 0;
>   	/* clean tlb_last_obytes when adding port for bonding device */
> -	memcpy(&(slave_details->persisted_mac_addr), slave_eth_dev->data->mac_addrs,
> +	memcpy(&member_details->persisted_mac_addr, member_eth_dev->data->mac_addrs,
>   			sizeof(struct rte_ether_addr));
>   }
>   
>   void
>   bond_ethdev_primary_set(struct bond_dev_private *internals,
> -		uint16_t slave_port_id)
> +		uint16_t member_port_id)
>   {
>   	int i;
>   
> -	if (internals->active_slave_count < 1)
> -		internals->current_primary_port = slave_port_id;
> +	if (internals->active_member_count < 1)
> +		internals->current_primary_port = member_port_id;
>   	else
> -		/* Search bonded device slave ports for new proposed primary port */
> -		for (i = 0; i < internals->active_slave_count; i++) {
> -			if (internals->active_slaves[i] == slave_port_id)
> -				internals->current_primary_port = slave_port_id;
> +		/* Search bonded device member ports for new proposed primary port */
> +		for (i = 0; i < internals->active_member_count; i++) {
> +			if (internals->active_members[i] == member_port_id)
> +				internals->current_primary_port = member_port_id;
>   		}
>   }
>   
> @@ -1998,9 +2002,9 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
>   	struct bond_dev_private *internals;
>   	int i;
>   
> -	/* slave eth dev will be started by bonded device */
> +	/* member eth dev will be started by bonded device */
>   	if (check_for_bonded_ethdev(eth_dev)) {
> -		RTE_BOND_LOG(ERR, "User tried to explicitly start a slave eth_dev (%d)",
> +		RTE_BOND_LOG(ERR, "User tried to explicitly start a member eth_dev (%d)",
>   				eth_dev->data->port_id);
>   		return -1;
>   	}
> @@ -2010,17 +2014,17 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
>   
>   	internals = eth_dev->data->dev_private;
>   
> -	if (internals->slave_count == 0) {
> -		RTE_BOND_LOG(ERR, "Cannot start port since there are no slave devices");
> +	if (internals->member_count == 0) {
> +		RTE_BOND_LOG(ERR, "Cannot start port since there are no member devices");
>   		goto out_err;
>   	}
>   
>   	if (internals->user_defined_mac == 0) {
>   		struct rte_ether_addr *new_mac_addr = NULL;
>   
> -		for (i = 0; i < internals->slave_count; i++)
> -			if (internals->slaves[i].port_id == internals->primary_port)
> -				new_mac_addr = &internals->slaves[i].persisted_mac_addr;
> +		for (i = 0; i < internals->member_count; i++)
> +			if (internals->members[i].port_id == internals->primary_port)
> +				new_mac_addr = &internals->members[i].persisted_mac_addr;
>   
>   		if (new_mac_addr == NULL)
>   			goto out_err;
> @@ -2042,28 +2046,28 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
>   	}
>   
>   
> -	/* Reconfigure each slave device if starting bonded device */
> -	for (i = 0; i < internals->slave_count; i++) {
> -		struct rte_eth_dev *slave_ethdev =
> -				&(rte_eth_devices[internals->slaves[i].port_id]);
> -		if (slave_configure(eth_dev, slave_ethdev) != 0) {
> +	/* Reconfigure each member device if starting bonded device */
> +	for (i = 0; i < internals->member_count; i++) {
> +		struct rte_eth_dev *member_ethdev =
> +				&(rte_eth_devices[internals->members[i].port_id]);
> +		if (member_configure(eth_dev, member_ethdev) != 0) {
>   			RTE_BOND_LOG(ERR,
> -				"bonded port (%d) failed to reconfigure slave device (%d)",
> +				"bonded port (%d) failed to reconfigure member device (%d)",
>   				eth_dev->data->port_id,
> -				internals->slaves[i].port_id);
> +				internals->members[i].port_id);
>   			goto out_err;
>   		}
> -		if (slave_start(eth_dev, slave_ethdev) != 0) {
> +		if (member_start(eth_dev, member_ethdev) != 0) {
>   			RTE_BOND_LOG(ERR,
> -				"bonded port (%d) failed to start slave device (%d)",
> +				"bonded port (%d) failed to start member device (%d)",
>   				eth_dev->data->port_id,
> -				internals->slaves[i].port_id);
> +				internals->members[i].port_id);
>   			goto out_err;
>   		}
> -		/* We will need to poll for link status if any slave doesn't
> +		/* We will need to poll for link status if any member doesn't
>   		 * support interrupts
>   		 */
> -		if (internals->slaves[i].link_status_poll_enabled)
> +		if (internals->members[i].link_status_poll_enabled)
>   			internals->link_status_polling_enabled = 1;
>   	}
>   
> @@ -2071,12 +2075,12 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)
>   	if (internals->link_status_polling_enabled) {
>   		rte_eal_alarm_set(
>   			internals->link_status_polling_interval_ms * 1000,
> -			bond_ethdev_slave_link_status_change_monitor,
> +			bond_ethdev_member_link_status_change_monitor,
>   			(void *)&rte_eth_devices[internals->port_id]);
>   	}
>   
> -	/* Update all slave devices MACs*/
> -	if (mac_address_slaves_update(eth_dev) != 0)
> +	/* Update all member devices MACs*/
> +	if (mac_address_members_update(eth_dev) != 0)
>   		goto out_err;
>   
>   	if (internals->user_defined_primary_port)
> @@ -2132,8 +2136,8 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
>   		bond_mode_8023ad_stop(eth_dev);
>   
>   		/* Discard all messages to/from mode 4 state machines */
> -		for (i = 0; i < internals->active_slave_count; i++) {
> -			port = &bond_mode_8023ad_ports[internals->active_slaves[i]];
> +		for (i = 0; i < internals->active_member_count; i++) {
> +			port = &bond_mode_8023ad_ports[internals->active_members[i]];
>   
>   			RTE_ASSERT(port->rx_ring != NULL);
>   			while (rte_ring_dequeue(port->rx_ring, &pkt) != -ENOENT)
> @@ -2148,30 +2152,30 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev)
>   	if (internals->mode == BONDING_MODE_TLB ||
>   			internals->mode == BONDING_MODE_ALB) {
>   		bond_tlb_disable(internals);
> -		for (i = 0; i < internals->active_slave_count; i++)
> -			tlb_last_obytets[internals->active_slaves[i]] = 0;
> +		for (i = 0; i < internals->active_member_count; i++)
> +			tlb_last_obytets[internals->active_members[i]] = 0;
>   	}
>   
>   	eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
>   	eth_dev->data->dev_started = 0;
>   
>   	internals->link_status_polling_enabled = 0;
> -	for (i = 0; i < internals->slave_count; i++) {
> -		uint16_t slave_id = internals->slaves[i].port_id;
> +	for (i = 0; i < internals->member_count; i++) {
> +		uint16_t member_id = internals->members[i].port_id;
>   
> -		internals->slaves[i].last_link_status = 0;
> -		ret = rte_eth_dev_stop(slave_id);
> +		internals->members[i].last_link_status = 0;
> +		ret = rte_eth_dev_stop(member_id);
>   		if (ret != 0) {
>   			RTE_BOND_LOG(ERR, "Failed to stop device on port %u",
> -				     slave_id);
> +				     member_id);
>   			return ret;
>   		}
>   
> -		/* active slaves need to be deactivated. */
> -		if (find_slave_by_id(internals->active_slaves,
> -				internals->active_slave_count, slave_id) !=
> -					internals->active_slave_count)
> -			deactivate_slave(eth_dev, slave_id);
> +		/* active members need to be deactivated. */
> +		if (find_member_by_id(internals->active_members,
> +				internals->active_member_count, member_id) !=
> +					internals->active_member_count)
> +			deactivate_member(eth_dev, member_id);
>   	}
>   
>   	return 0;
> @@ -2188,8 +2192,8 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool remove)
>   	/* Flush flows in all back-end devices before removing them */
>   	bond_flow_ops.flush(dev, &ferror);
>   
> -	while (internals->slave_count != skipped) {
> -		uint16_t port_id = internals->slaves[skipped].port_id;
> +	while (internals->member_count != skipped) {
> +		uint16_t port_id = internals->members[skipped].port_id;
>   		int ret;
>   
>   		ret = rte_eth_dev_stop(port_id);
> @@ -2203,7 +2207,7 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool remove)
>   			continue;
>   		}
>   
> -		if (rte_eth_bond_slave_remove(bond_port_id, port_id) != 0) {
> +		if (rte_eth_bond_member_remove(bond_port_id, port_id) != 0) {
>   			RTE_BOND_LOG(ERR,
>   				     "Failed to remove port %d from bonded device %s",
>   				     port_id, dev->device->name);
> @@ -2246,7 +2250,7 @@ static int
>   bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>   {
>   	struct bond_dev_private *internals = dev->data->dev_private;
> -	struct bond_slave_details slave;
> +	struct bond_member_details member;
>   	int ret;
>   
>   	uint16_t max_nb_rx_queues = UINT16_MAX;
> @@ -2259,31 +2263,31 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>   			RTE_ETHER_MAX_JUMBO_FRAME_LEN;
>   
>   	/* Max number of tx/rx queues that the bonded device can support is the
> -	 * minimum values of the bonded slaves, as all slaves must be capable
> +	 * minimum values of the bonded members, as all members must be capable
>   	 * of supporting the same number of tx/rx queues.
>   	 */
> -	if (internals->slave_count > 0) {
> -		struct rte_eth_dev_info slave_info;
> +	if (internals->member_count > 0) {
> +		struct rte_eth_dev_info member_info;
>   		uint16_t idx;
>   
> -		for (idx = 0; idx < internals->slave_count; idx++) {
> -			slave = internals->slaves[idx];
> -			ret = rte_eth_dev_info_get(slave.port_id, &slave_info);
> +		for (idx = 0; idx < internals->member_count; idx++) {
> +			member = internals->members[idx];
> +			ret = rte_eth_dev_info_get(member.port_id, &member_info);
>   			if (ret != 0) {
>   				RTE_BOND_LOG(ERR,
>   					"%s: Error during getting device (port %u) info: %s\n",
>   					__func__,
> -					slave.port_id,
> +					member.port_id,
>   					strerror(-ret));
>   
>   				return ret;
>   			}
>   
> -			if (slave_info.max_rx_queues < max_nb_rx_queues)
> -				max_nb_rx_queues = slave_info.max_rx_queues;
> +			if (member_info.max_rx_queues < max_nb_rx_queues)
> +				max_nb_rx_queues = member_info.max_rx_queues;
>   
> -			if (slave_info.max_tx_queues < max_nb_tx_queues)
> -				max_nb_tx_queues = slave_info.max_tx_queues;
> +			if (member_info.max_tx_queues < max_nb_tx_queues)
> +				max_nb_tx_queues = member_info.max_tx_queues;
>   		}
>   	}
>   
> @@ -2332,7 +2336,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
>   	uint16_t i;
>   	struct bond_dev_private *internals = dev->data->dev_private;
>   
> -	/* don't do this while a slave is being added */
> +	/* don't do this while a member is being added */
>   	rte_spinlock_lock(&internals->lock);
>   
>   	if (on)
> @@ -2340,13 +2344,13 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
>   	else
>   		rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id);
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		uint16_t port_id = internals->slaves[i].port_id;
> +	for (i = 0; i < internals->member_count; i++) {
> +		uint16_t port_id = internals->members[i].port_id;
>   
>   		res = rte_eth_dev_vlan_filter(port_id, vlan_id, on);
>   		if (res == ENOTSUP)
>   			RTE_BOND_LOG(WARNING,
> -				     "Setting VLAN filter on slave port %u not supported.",
> +				     "Setting VLAN filter on member port %u not supported.",
>   				     port_id);
>   	}
>   
> @@ -2424,14 +2428,14 @@ bond_ethdev_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_id)
>   }
>   
>   static void
> -bond_ethdev_slave_link_status_change_monitor(void *cb_arg)
> +bond_ethdev_member_link_status_change_monitor(void *cb_arg)
>   {
> -	struct rte_eth_dev *bonded_ethdev, *slave_ethdev;
> +	struct rte_eth_dev *bonded_ethdev, *member_ethdev;
>   	struct bond_dev_private *internals;
>   
> -	/* Default value for polling slave found is true as we don't want to
> +	/* Default value for polling member found is true as we don't want to
>   	 * disable the polling thread if we cannot get the lock */
> -	int i, polling_slave_found = 1;
> +	int i, polling_member_found = 1;
>   
>   	if (cb_arg == NULL)
>   		return;
> @@ -2443,28 +2447,28 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg)
>   		!internals->link_status_polling_enabled)
>   		return;
>   
> -	/* If device is currently being configured then don't check slaves link
> +	/* If device is currently being configured then don't check members link
>   	 * status, wait until next period */
>   	if (rte_spinlock_trylock(&internals->lock)) {
> -		if (internals->slave_count > 0)
> -			polling_slave_found = 0;
> +		if (internals->member_count > 0)
> +			polling_member_found = 0;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			if (!internals->slaves[i].link_status_poll_enabled)
> +		for (i = 0; i < internals->member_count; i++) {
> +			if (!internals->members[i].link_status_poll_enabled)
>   				continue;
>   
> -			slave_ethdev = &rte_eth_devices[internals->slaves[i].port_id];
> -			polling_slave_found = 1;
> +			member_ethdev = &rte_eth_devices[internals->members[i].port_id];
> +			polling_member_found = 1;
>   
> -			/* Update slave link status */
> -			(*slave_ethdev->dev_ops->link_update)(slave_ethdev,
> -					internals->slaves[i].link_status_wait_to_complete);
> +			/* Update member link status */
> +			(*member_ethdev->dev_ops->link_update)(member_ethdev,
> +					internals->members[i].link_status_wait_to_complete);
>   
>   			/* if link status has changed since last checked then call lsc
>   			 * event callback */
> -			if (slave_ethdev->data->dev_link.link_status !=
> -					internals->slaves[i].last_link_status) {
> -				bond_ethdev_lsc_event_callback(internals->slaves[i].port_id,
> +			if (member_ethdev->data->dev_link.link_status !=
> +					internals->members[i].last_link_status) {
> +				bond_ethdev_lsc_event_callback(internals->members[i].port_id,
>   						RTE_ETH_EVENT_INTR_LSC,
>   						&bonded_ethdev->data->port_id,
>   						NULL);
> @@ -2473,10 +2477,10 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg)
>   		rte_spinlock_unlock(&internals->lock);
>   	}
>   
> -	if (polling_slave_found)
> -		/* Set alarm to continue monitoring link status of slave ethdev's */
> +	if (polling_member_found)
> +		/* Set alarm to continue monitoring link status of member ethdev's */
>   		rte_eal_alarm_set(internals->link_status_polling_interval_ms * 1000,
> -				bond_ethdev_slave_link_status_change_monitor, cb_arg);
> +				bond_ethdev_member_link_status_change_monitor, cb_arg);
>   }
>   
>   static int
> @@ -2485,7 +2489,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
>   	int (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link);
>   
>   	struct bond_dev_private *bond_ctx;
> -	struct rte_eth_link slave_link;
> +	struct rte_eth_link member_link;
>   
>   	bool one_link_update_succeeded;
>   	uint32_t idx;
> @@ -2496,7 +2500,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
>   	ethdev->data->dev_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
>   
>   	if (ethdev->data->dev_started == 0 ||
> -			bond_ctx->active_slave_count == 0) {
> +			bond_ctx->active_member_count == 0) {
>   		ethdev->data->dev_link.link_status = RTE_ETH_LINK_DOWN;
>   		return 0;
>   	}
> @@ -2512,51 +2516,51 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
>   	case BONDING_MODE_BROADCAST:
>   		/**
>   		 * Setting link speed to UINT32_MAX to ensure we pick up the
> -		 * value of the first active slave
> +		 * value of the first active member
>   		 */
>   		ethdev->data->dev_link.link_speed = UINT32_MAX;
>   
>   		/**
> -		 * link speed is minimum value of all the slaves link speed as
> -		 * packet loss will occur on this slave if transmission at rates
> +		 * link speed is minimum value of all the members link speed as
> +		 * packet loss will occur on this member if transmission at rates
>   		 * greater than this are attempted
>   		 */
> -		for (idx = 0; idx < bond_ctx->active_slave_count; idx++) {
> -			ret = link_update(bond_ctx->active_slaves[idx],
> -					  &slave_link);
> +		for (idx = 0; idx < bond_ctx->active_member_count; idx++) {
> +			ret = link_update(bond_ctx->active_members[idx],
> +					  &member_link);
>   			if (ret < 0) {
>   				ethdev->data->dev_link.link_speed =
>   					RTE_ETH_SPEED_NUM_NONE;
>   				RTE_BOND_LOG(ERR,
> -					"Slave (port %u) link get failed: %s",
> -					bond_ctx->active_slaves[idx],
> +					"Member (port %u) link get failed: %s",
> +					bond_ctx->active_members[idx],
>   					rte_strerror(-ret));
>   				return 0;
>   			}
>   
> -			if (slave_link.link_speed <
> +			if (member_link.link_speed <
>   					ethdev->data->dev_link.link_speed)
>   				ethdev->data->dev_link.link_speed =
> -						slave_link.link_speed;
> +						member_link.link_speed;
>   		}
>   		break;
>   	case BONDING_MODE_ACTIVE_BACKUP:
> -		/* Current primary slave */
> -		ret = link_update(bond_ctx->current_primary_port, &slave_link);
> +		/* Current primary member */
> +		ret = link_update(bond_ctx->current_primary_port, &member_link);
>   		if (ret < 0) {
> -			RTE_BOND_LOG(ERR, "Slave (port %u) link get failed: %s",
> +			RTE_BOND_LOG(ERR, "Member (port %u) link get failed: %s",
>   				bond_ctx->current_primary_port,
>   				rte_strerror(-ret));
>   			return 0;
>   		}
>   
> -		ethdev->data->dev_link.link_speed = slave_link.link_speed;
> +		ethdev->data->dev_link.link_speed = member_link.link_speed;
>   		break;
>   	case BONDING_MODE_8023AD:
>   		ethdev->data->dev_link.link_autoneg =
> -				bond_ctx->mode4.slave_link.link_autoneg;
> +				bond_ctx->mode4.member_link.link_autoneg;
>   		ethdev->data->dev_link.link_duplex =
> -				bond_ctx->mode4.slave_link.link_duplex;
> +				bond_ctx->mode4.member_link.link_duplex;
>   		/* fall through */
>   		/* to update link speed */
>   	case BONDING_MODE_ROUND_ROBIN:
> @@ -2566,29 +2570,29 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete)
>   	default:
>   		/**
>   		 * In theses mode the maximum theoretical link speed is the sum
> -		 * of all the slaves
> +		 * of all the members
>   		 */
>   		ethdev->data->dev_link.link_speed = RTE_ETH_SPEED_NUM_NONE;
>   		one_link_update_succeeded = false;
>   
> -		for (idx = 0; idx < bond_ctx->active_slave_count; idx++) {
> -			ret = link_update(bond_ctx->active_slaves[idx],
> -					&slave_link);
> +		for (idx = 0; idx < bond_ctx->active_member_count; idx++) {
> +			ret = link_update(bond_ctx->active_members[idx],
> +					&member_link);
>   			if (ret < 0) {
>   				RTE_BOND_LOG(ERR,
> -					"Slave (port %u) link get failed: %s",
> -					bond_ctx->active_slaves[idx],
> +					"Member (port %u) link get failed: %s",
> +					bond_ctx->active_members[idx],
>   					rte_strerror(-ret));
>   				continue;
>   			}
>   
>   			one_link_update_succeeded = true;
>   			ethdev->data->dev_link.link_speed +=
> -					slave_link.link_speed;
> +					member_link.link_speed;
>   		}
>   
>   		if (!one_link_update_succeeded) {
> -			RTE_BOND_LOG(ERR, "All slaves link get failed");
> +			RTE_BOND_LOG(ERR, "All members link get failed");
>   			return 0;
>   		}
>   	}
> @@ -2602,27 +2606,27 @@ static int
>   bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
>   {
>   	struct bond_dev_private *internals = dev->data->dev_private;
> -	struct rte_eth_stats slave_stats;
> +	struct rte_eth_stats member_stats;
>   	int i, j;
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		rte_eth_stats_get(internals->slaves[i].port_id, &slave_stats);
> +	for (i = 0; i < internals->member_count; i++) {
> +		rte_eth_stats_get(internals->members[i].port_id, &member_stats);
>   
> -		stats->ipackets += slave_stats.ipackets;
> -		stats->opackets += slave_stats.opackets;
> -		stats->ibytes += slave_stats.ibytes;
> -		stats->obytes += slave_stats.obytes;
> -		stats->imissed += slave_stats.imissed;
> -		stats->ierrors += slave_stats.ierrors;
> -		stats->oerrors += slave_stats.oerrors;
> -		stats->rx_nombuf += slave_stats.rx_nombuf;
> +		stats->ipackets += member_stats.ipackets;
> +		stats->opackets += member_stats.opackets;
> +		stats->ibytes += member_stats.ibytes;
> +		stats->obytes += member_stats.obytes;
> +		stats->imissed += member_stats.imissed;
> +		stats->ierrors += member_stats.ierrors;
> +		stats->oerrors += member_stats.oerrors;
> +		stats->rx_nombuf += member_stats.rx_nombuf;
>   
>   		for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) {
> -			stats->q_ipackets[j] += slave_stats.q_ipackets[j];
> -			stats->q_opackets[j] += slave_stats.q_opackets[j];
> -			stats->q_ibytes[j] += slave_stats.q_ibytes[j];
> -			stats->q_obytes[j] += slave_stats.q_obytes[j];
> -			stats->q_errors[j] += slave_stats.q_errors[j];
> +			stats->q_ipackets[j] += member_stats.q_ipackets[j];
> +			stats->q_opackets[j] += member_stats.q_opackets[j];
> +			stats->q_ibytes[j] += member_stats.q_ibytes[j];
> +			stats->q_obytes[j] += member_stats.q_obytes[j];
> +			stats->q_errors[j] += member_stats.q_errors[j];
>   		}
>   
>   	}
> @@ -2638,8 +2642,8 @@ bond_ethdev_stats_reset(struct rte_eth_dev *dev)
>   	int err;
>   	int ret;
>   
> -	for (i = 0, err = 0; i < internals->slave_count; i++) {
> -		ret = rte_eth_stats_reset(internals->slaves[i].port_id);
> +	for (i = 0, err = 0; i < internals->member_count; i++) {
> +		ret = rte_eth_stats_reset(internals->members[i].port_id);
>   		if (ret != 0)
>   			err = ret;
>   	}
> @@ -2656,15 +2660,15 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
>   	uint16_t port_id;
>   
>   	switch (internals->mode) {
> -	/* Promiscuous mode is propagated to all slaves */
> +	/* Promiscuous mode is propagated to all members */
>   	case BONDING_MODE_ROUND_ROBIN:
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD: {
> -		unsigned int slave_ok = 0;
> +		unsigned int member_ok = 0;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			port_id = internals->slaves[i].port_id;
> +		for (i = 0; i < internals->member_count; i++) {
> +			port_id = internals->members[i].port_id;
>   
>   			ret = rte_eth_promiscuous_enable(port_id);
>   			if (ret != 0)
> @@ -2672,23 +2676,23 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev)
>   					"Failed to enable promiscuous mode for port %u: %s",
>   					port_id, rte_strerror(-ret));
>   			else
> -				slave_ok++;
> +				member_ok++;
>   		}
>   		/*
>   		 * Report success if operation is successful on at least
> -		 * on one slave. Otherwise return last error code.
> +		 * on one member. Otherwise return last error code.
>   		 */
> -		if (slave_ok > 0)
> +		if (member_ok > 0)
>   			ret = 0;
>   		break;
>   	}
> -	/* Promiscuous mode is propagated only to primary slave */
> +	/* Promiscuous mode is propagated only to primary member */
>   	case BONDING_MODE_ACTIVE_BACKUP:
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
>   		/* Do not touch promisc when there cannot be primary ports */
> -		if (internals->slave_count == 0)
> +		if (internals->member_count == 0)
>   			break;
>   		port_id = internals->current_primary_port;
>   		ret = rte_eth_promiscuous_enable(port_id);
> @@ -2710,20 +2714,20 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
>   	uint16_t port_id;
>   
>   	switch (internals->mode) {
> -	/* Promiscuous mode is propagated to all slaves */
> +	/* Promiscuous mode is propagated to all members */
>   	case BONDING_MODE_ROUND_ROBIN:
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD: {
> -		unsigned int slave_ok = 0;
> +		unsigned int member_ok = 0;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			port_id = internals->slaves[i].port_id;
> +		for (i = 0; i < internals->member_count; i++) {
> +			port_id = internals->members[i].port_id;
>   
>   			if (internals->mode == BONDING_MODE_8023AD &&
>   			    bond_mode_8023ad_ports[port_id].forced_rx_flags ==
>   					BOND_8023AD_FORCED_PROMISC) {
> -				slave_ok++;
> +				member_ok++;
>   				continue;
>   			}
>   			ret = rte_eth_promiscuous_disable(port_id);
> @@ -2732,23 +2736,23 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
>   					"Failed to disable promiscuous mode for port %u: %s",
>   					port_id, rte_strerror(-ret));
>   			else
> -				slave_ok++;
> +				member_ok++;
>   		}
>   		/*
>   		 * Report success if operation is successful on at least
> -		 * on one slave. Otherwise return last error code.
> +		 * on one member. Otherwise return last error code.
>   		 */
> -		if (slave_ok > 0)
> +		if (member_ok > 0)
>   			ret = 0;
>   		break;
>   	}
> -	/* Promiscuous mode is propagated only to primary slave */
> +	/* Promiscuous mode is propagated only to primary member */
>   	case BONDING_MODE_ACTIVE_BACKUP:
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
>   		/* Do not touch promisc when there cannot be primary ports */
> -		if (internals->slave_count == 0)
> +		if (internals->member_count == 0)
>   			break;
>   		port_id = internals->current_primary_port;
>   		ret = rte_eth_promiscuous_disable(port_id);
> @@ -2772,7 +2776,7 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev)
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD:
> -		/* As promiscuous mode is propagated to all slaves for these
> +		/* As promiscuous mode is propagated to all members for these
>   		 * mode, no need to update for bonding device.
>   		 */
>   		break;
> @@ -2780,9 +2784,9 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev)
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
> -		/* As promiscuous mode is propagated only to primary slave
> +		/* As promiscuous mode is propagated only to primary member
>   		 * for these mode. When active/standby switchover, promiscuous
> -		 * mode should be set to new primary slave according to bonding
> +		 * mode should be set to new primary member according to bonding
>   		 * device.
>   		 */
>   		if (rte_eth_promiscuous_get(internals->port_id) == 1)
> @@ -2803,15 +2807,15 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
>   	uint16_t port_id;
>   
>   	switch (internals->mode) {
> -	/* allmulti mode is propagated to all slaves */
> +	/* allmulti mode is propagated to all members */
>   	case BONDING_MODE_ROUND_ROBIN:
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD: {
> -		unsigned int slave_ok = 0;
> +		unsigned int member_ok = 0;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			port_id = internals->slaves[i].port_id;
> +		for (i = 0; i < internals->member_count; i++) {
> +			port_id = internals->members[i].port_id;
>   
>   			ret = rte_eth_allmulticast_enable(port_id);
>   			if (ret != 0)
> @@ -2819,23 +2823,23 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
>   					"Failed to enable allmulti mode for port %u: %s",
>   					port_id, rte_strerror(-ret));
>   			else
> -				slave_ok++;
> +				member_ok++;
>   		}
>   		/*
>   		 * Report success if operation is successful on at least
> -		 * on one slave. Otherwise return last error code.
> +		 * on one member. Otherwise return last error code.
>   		 */
> -		if (slave_ok > 0)
> +		if (member_ok > 0)
>   			ret = 0;
>   		break;
>   	}
> -	/* allmulti mode is propagated only to primary slave */
> +	/* allmulti mode is propagated only to primary member */
>   	case BONDING_MODE_ACTIVE_BACKUP:
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
>   		/* Do not touch allmulti when there cannot be primary ports */
> -		if (internals->slave_count == 0)
> +		if (internals->member_count == 0)
>   			break;
>   		port_id = internals->current_primary_port;
>   		ret = rte_eth_allmulticast_enable(port_id);
> @@ -2857,15 +2861,15 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
>   	uint16_t port_id;
>   
>   	switch (internals->mode) {
> -	/* allmulti mode is propagated to all slaves */
> +	/* allmulti mode is propagated to all members */
>   	case BONDING_MODE_ROUND_ROBIN:
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD: {
> -		unsigned int slave_ok = 0;
> +		unsigned int member_ok = 0;
>   
> -		for (i = 0; i < internals->slave_count; i++) {
> -			uint16_t port_id = internals->slaves[i].port_id;
> +		for (i = 0; i < internals->member_count; i++) {
> +			uint16_t port_id = internals->members[i].port_id;
>   
>   			if (internals->mode == BONDING_MODE_8023AD &&
>   			    bond_mode_8023ad_ports[port_id].forced_rx_flags ==
> @@ -2878,23 +2882,23 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
>   					"Failed to disable allmulti mode for port %u: %s",
>   					port_id, rte_strerror(-ret));
>   			else
> -				slave_ok++;
> +				member_ok++;
>   		}
>   		/*
>   		 * Report success if operation is successful on at least
> -		 * on one slave. Otherwise return last error code.
> +		 * on one member. Otherwise return last error code.
>   		 */
> -		if (slave_ok > 0)
> +		if (member_ok > 0)
>   			ret = 0;
>   		break;
>   	}
> -	/* allmulti mode is propagated only to primary slave */
> +	/* allmulti mode is propagated only to primary member */
>   	case BONDING_MODE_ACTIVE_BACKUP:
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
>   		/* Do not touch allmulti when there cannot be primary ports */
> -		if (internals->slave_count == 0)
> +		if (internals->member_count == 0)
>   			break;
>   		port_id = internals->current_primary_port;
>   		ret = rte_eth_allmulticast_disable(port_id);
> @@ -2918,7 +2922,7 @@ bond_ethdev_allmulticast_update(struct rte_eth_dev *dev)
>   	case BONDING_MODE_BALANCE:
>   	case BONDING_MODE_BROADCAST:
>   	case BONDING_MODE_8023AD:
> -		/* As allmulticast mode is propagated to all slaves for these
> +		/* As allmulticast mode is propagated to all members for these
>   		 * mode, no need to update for bonding device.
>   		 */
>   		break;
> @@ -2926,9 +2930,9 @@ bond_ethdev_allmulticast_update(struct rte_eth_dev *dev)
>   	case BONDING_MODE_TLB:
>   	case BONDING_MODE_ALB:
>   	default:
> -		/* As allmulticast mode is propagated only to primary slave
> +		/* As allmulticast mode is propagated only to primary member
>   		 * for these mode. When active/standby switchover, allmulticast
> -		 * mode should be set to new primary slave according to bonding
> +		 * mode should be set to new primary member according to bonding
>   		 * device.
>   		 */
>   		if (rte_eth_allmulticast_get(internals->port_id) == 1)
> @@ -2961,8 +2965,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
>   	int ret;
>   
>   	uint8_t lsc_flag = 0;
> -	int valid_slave = 0;
> -	uint16_t active_pos, slave_idx;
> +	int valid_member = 0;
> +	uint16_t active_pos, member_idx;
>   	uint16_t i;
>   
>   	if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL)
> @@ -2979,62 +2983,62 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
>   	if (!bonded_eth_dev->data->dev_started)
>   		return rc;
>   
> -	/* verify that port_id is a valid slave of bonded port */
> -	for (i = 0; i < internals->slave_count; i++) {
> -		if (internals->slaves[i].port_id == port_id) {
> -			valid_slave = 1;
> -			slave_idx = i;
> +	/* verify that port_id is a valid member of bonded port */
> +	for (i = 0; i < internals->member_count; i++) {
> +		if (internals->members[i].port_id == port_id) {
> +			valid_member = 1;
> +			member_idx = i;
>   			break;
>   		}
>   	}
>   
> -	if (!valid_slave)
> +	if (!valid_member)
>   		return rc;
>   
>   	/* Synchronize lsc callback parallel calls either by real link event
> -	 * from the slaves PMDs or by the bonding PMD itself.
> +	 * from the members PMDs or by the bonding PMD itself.
>   	 */
>   	rte_spinlock_lock(&internals->lsc_lock);
>   
>   	/* Search for port in active port list */
> -	active_pos = find_slave_by_id(internals->active_slaves,
> -			internals->active_slave_count, port_id);
> +	active_pos = find_member_by_id(internals->active_members,
> +			internals->active_member_count, port_id);
>   
>   	ret = rte_eth_link_get_nowait(port_id, &link);
>   	if (ret < 0)
> -		RTE_BOND_LOG(ERR, "Slave (port %u) link get failed", port_id);
> +		RTE_BOND_LOG(ERR, "Member (port %u) link get failed", port_id);
>   
>   	if (ret == 0 && link.link_status) {
> -		if (active_pos < internals->active_slave_count)
> +		if (active_pos < internals->active_member_count)
>   			goto link_update;
>   
>   		/* check link state properties if bonded link is up*/
>   		if (bonded_eth_dev->data->dev_link.link_status == RTE_ETH_LINK_UP) {
>   			if (link_properties_valid(bonded_eth_dev, &link) != 0)
>   				RTE_BOND_LOG(ERR, "Invalid link properties "
> -					     "for slave %d in bonding mode %d",
> +					     "for member %d in bonding mode %d",
>   					     port_id, internals->mode);
>   		} else {
> -			/* inherit slave link properties */
> +			/* inherit member link properties */
>   			link_properties_set(bonded_eth_dev, &link);
>   		}
>   
> -		/* If no active slave ports then set this port to be
> +		/* If no active member ports then set this port to be
>   		 * the primary port.
>   		 */
> -		if (internals->active_slave_count < 1) {
> -			/* If first active slave, then change link status */
> +		if (internals->active_member_count < 1) {
> +			/* If first active member, then change link status */
>   			bonded_eth_dev->data->dev_link.link_status =
>   								RTE_ETH_LINK_UP;
>   			internals->current_primary_port = port_id;
>   			lsc_flag = 1;
>   
> -			mac_address_slaves_update(bonded_eth_dev);
> +			mac_address_members_update(bonded_eth_dev);
>   			bond_ethdev_promiscuous_update(bonded_eth_dev);
>   			bond_ethdev_allmulticast_update(bonded_eth_dev);
>   		}
>   
> -		activate_slave(bonded_eth_dev, port_id);
> +		activate_member(bonded_eth_dev, port_id);
>   
>   		/* If the user has defined the primary port then default to
>   		 * using it.
> @@ -3043,24 +3047,24 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
>   				internals->primary_port == port_id)
>   			bond_ethdev_primary_set(internals, port_id);
>   	} else {
> -		if (active_pos == internals->active_slave_count)
> +		if (active_pos == internals->active_member_count)
>   			goto link_update;
>   
> -		/* Remove from active slave list */
> -		deactivate_slave(bonded_eth_dev, port_id);
> +		/* Remove from active member list */
> +		deactivate_member(bonded_eth_dev, port_id);
>   
> -		if (internals->active_slave_count < 1)
> +		if (internals->active_member_count < 1)
>   			lsc_flag = 1;
>   
> -		/* Update primary id, take first active slave from list or if none
> +		/* Update primary id, take first active member from list or if none
>   		 * available set to -1 */
>   		if (port_id == internals->current_primary_port) {
> -			if (internals->active_slave_count > 0)
> +			if (internals->active_member_count > 0)
>   				bond_ethdev_primary_set(internals,
> -						internals->active_slaves[0]);
> +						internals->active_members[0]);
>   			else
>   				internals->current_primary_port = internals->primary_port;
> -			mac_address_slaves_update(bonded_eth_dev);
> +			mac_address_members_update(bonded_eth_dev);
>   			bond_ethdev_promiscuous_update(bonded_eth_dev);
>   			bond_ethdev_allmulticast_update(bonded_eth_dev);
>   		}
> @@ -3069,10 +3073,10 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
>   link_update:
>   	/**
>   	 * Update bonded device link properties after any change to active
> -	 * slaves
> +	 * members
>   	 */
>   	bond_ethdev_link_update(bonded_eth_dev, 0);
> -	internals->slaves[slave_idx].last_link_status = link.link_status;
> +	internals->members[member_idx].last_link_status = link.link_status;
>   
>   	if (lsc_flag) {
>   		/* Cancel any possible outstanding interrupts if delays are enabled */
> @@ -3114,7 +3118,7 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev,
>   {
>   	unsigned i, j;
>   	int result = 0;
> -	int slave_reta_size;
> +	int member_reta_size;
>   	unsigned reta_count;
>   	struct bond_dev_private *internals = dev->data->dev_private;
>   
> @@ -3137,11 +3141,11 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev,
>   		memcpy(&internals->reta_conf[i], &internals->reta_conf[0],
>   				sizeof(internals->reta_conf[0]) * reta_count);
>   
> -	/* Propagate RETA over slaves */
> -	for (i = 0; i < internals->slave_count; i++) {
> -		slave_reta_size = internals->slaves[i].reta_size;
> -		result = rte_eth_dev_rss_reta_update(internals->slaves[i].port_id,
> -				&internals->reta_conf[0], slave_reta_size);
> +	/* Propagate RETA over members */
> +	for (i = 0; i < internals->member_count; i++) {
> +		member_reta_size = internals->members[i].reta_size;
> +		result = rte_eth_dev_rss_reta_update(internals->members[i].port_id,
> +				&internals->reta_conf[0], member_reta_size);
>   		if (result < 0)
>   			return result;
>   	}
> @@ -3194,8 +3198,8 @@ bond_ethdev_rss_hash_update(struct rte_eth_dev *dev,
>   		bond_rss_conf.rss_key_len = internals->rss_key_len;
>   	}
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		result = rte_eth_dev_rss_hash_update(internals->slaves[i].port_id,
> +	for (i = 0; i < internals->member_count; i++) {
> +		result = rte_eth_dev_rss_hash_update(internals->members[i].port_id,
>   				&bond_rss_conf);
>   		if (result < 0)
>   			return result;
> @@ -3221,21 +3225,21 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,
>   static int
>   bond_ethdev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
>   {
> -	struct rte_eth_dev *slave_eth_dev;
> +	struct rte_eth_dev *member_eth_dev;
>   	struct bond_dev_private *internals = dev->data->dev_private;
>   	int ret, i;
>   
>   	rte_spinlock_lock(&internals->lock);
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id];
> -		if (*slave_eth_dev->dev_ops->mtu_set == NULL) {
> +	for (i = 0; i < internals->member_count; i++) {
> +		member_eth_dev = &rte_eth_devices[internals->members[i].port_id];
> +		if (*member_eth_dev->dev_ops->mtu_set == NULL) {
>   			rte_spinlock_unlock(&internals->lock);
>   			return -ENOTSUP;
>   		}
>   	}
> -	for (i = 0; i < internals->slave_count; i++) {
> -		ret = rte_eth_dev_set_mtu(internals->slaves[i].port_id, mtu);
> +	for (i = 0; i < internals->member_count; i++) {
> +		ret = rte_eth_dev_set_mtu(internals->members[i].port_id, mtu);
>   		if (ret < 0) {
>   			rte_spinlock_unlock(&internals->lock);
>   			return ret;
> @@ -3271,29 +3275,29 @@ bond_ethdev_mac_addr_add(struct rte_eth_dev *dev,
>   			struct rte_ether_addr *mac_addr,
>   			__rte_unused uint32_t index, uint32_t vmdq)
>   {
> -	struct rte_eth_dev *slave_eth_dev;
> +	struct rte_eth_dev *member_eth_dev;
>   	struct bond_dev_private *internals = dev->data->dev_private;
>   	int ret, i;
>   
>   	rte_spinlock_lock(&internals->lock);
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id];
> -		if (*slave_eth_dev->dev_ops->mac_addr_add == NULL ||
> -			 *slave_eth_dev->dev_ops->mac_addr_remove == NULL) {
> +	for (i = 0; i < internals->member_count; i++) {
> +		member_eth_dev = &rte_eth_devices[internals->members[i].port_id];
> +		if (*member_eth_dev->dev_ops->mac_addr_add == NULL ||
> +			 *member_eth_dev->dev_ops->mac_addr_remove == NULL) {
>   			ret = -ENOTSUP;
>   			goto end;
>   		}
>   	}
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		ret = rte_eth_dev_mac_addr_add(internals->slaves[i].port_id,
> +	for (i = 0; i < internals->member_count; i++) {
> +		ret = rte_eth_dev_mac_addr_add(internals->members[i].port_id,
>   				mac_addr, vmdq);
>   		if (ret < 0) {
>   			/* rollback */
>   			for (i--; i >= 0; i--)
>   				rte_eth_dev_mac_addr_remove(
> -					internals->slaves[i].port_id, mac_addr);
> +					internals->members[i].port_id, mac_addr);
>   			goto end;
>   		}
>   	}
> @@ -3307,22 +3311,22 @@ bond_ethdev_mac_addr_add(struct rte_eth_dev *dev,
>   static void
>   bond_ethdev_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
>   {
> -	struct rte_eth_dev *slave_eth_dev;
> +	struct rte_eth_dev *member_eth_dev;
>   	struct bond_dev_private *internals = dev->data->dev_private;
>   	int i;
>   
>   	rte_spinlock_lock(&internals->lock);
>   
> -	for (i = 0; i < internals->slave_count; i++) {
> -		slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id];
> -		if (*slave_eth_dev->dev_ops->mac_addr_remove == NULL)
> +	for (i = 0; i < internals->member_count; i++) {
> +		member_eth_dev = &rte_eth_devices[internals->members[i].port_id];
> +		if (*member_eth_dev->dev_ops->mac_addr_remove == NULL)
>   			goto end;
>   	}
>   
>   	struct rte_ether_addr *mac_addr = &dev->data->mac_addrs[index];
>   
> -	for (i = 0; i < internals->slave_count; i++)
> -		rte_eth_dev_mac_addr_remove(internals->slaves[i].port_id,
> +	for (i = 0; i < internals->member_count; i++)
> +		rte_eth_dev_mac_addr_remove(internals->members[i].port_id,
>   				mac_addr);
>   
>   end:
> @@ -3402,30 +3406,30 @@ dump_basic(const struct rte_eth_dev *dev, FILE *f)
>   		fprintf(f, "\n");
>   	}
>   
> -	if (internals->slave_count > 0) {
> -		fprintf(f, "\tSlaves (%u): [", internals->slave_count);
> -		for (i = 0; i < internals->slave_count - 1; i++)
> -			fprintf(f, "%u ", internals->slaves[i].port_id);
> +	if (internals->member_count > 0) {
> +		fprintf(f, "\tMembers (%u): [", internals->member_count);
> +		for (i = 0; i < internals->member_count - 1; i++)
> +			fprintf(f, "%u ", internals->members[i].port_id);
>   
> -		fprintf(f, "%u]\n", internals->slaves[internals->slave_count - 1].port_id);
> +		fprintf(f, "%u]\n", internals->members[internals->member_count - 1].port_id);
>   	} else {
> -		fprintf(f, "\tSlaves: []\n");
> +		fprintf(f, "\tMembers: []\n");
>   	}
>   
> -	if (internals->active_slave_count > 0) {
> -		fprintf(f, "\tActive Slaves (%u): [", internals->active_slave_count);
> -		for (i = 0; i < internals->active_slave_count - 1; i++)
> -			fprintf(f, "%u ", internals->active_slaves[i]);
> +	if (internals->active_member_count > 0) {
> +		fprintf(f, "\tActive Members (%u): [", internals->active_member_count);
> +		for (i = 0; i < internals->active_member_count - 1; i++)
> +			fprintf(f, "%u ", internals->active_members[i]);
>   
> -		fprintf(f, "%u]\n", internals->active_slaves[internals->active_slave_count - 1]);
> +		fprintf(f, "%u]\n", internals->active_members[internals->active_member_count - 1]);
>   
>   	} else {
> -		fprintf(f, "\tActive Slaves: []\n");
> +		fprintf(f, "\tActive Members: []\n");
>   	}
>   
>   	if (internals->user_defined_primary_port)
>   		fprintf(f, "\tUser Defined Primary: [%u]\n", internals->primary_port);
> -	if (internals->slave_count > 0)
> +	if (internals->member_count > 0)
>   		fprintf(f, "\tCurrent Primary: [%u]\n", internals->current_primary_port);
>   }
>   
> @@ -3471,7 +3475,7 @@ dump_lacp_port_param(const struct port_params *params, FILE *f)
>   }
>   
>   static void
> -dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f)
> +dump_lacp_member(const struct rte_eth_bond_8023ad_member_info *info, FILE *f)
>   {
>   	char a_state[256] = { 0 };
>   	char p_state[256] = { 0 };
> @@ -3520,18 +3524,18 @@ dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f)
>   static void
>   dump_lacp(uint16_t port_id, FILE *f)
>   {
> -	struct rte_eth_bond_8023ad_slave_info slave_info;
> +	struct rte_eth_bond_8023ad_member_info member_info;
>   	struct rte_eth_bond_8023ad_conf port_conf;
> -	uint16_t slaves[RTE_MAX_ETHPORTS];
> -	int num_active_slaves;
> +	uint16_t members[RTE_MAX_ETHPORTS];
> +	int num_active_members;
>   	int i, ret;
>   
>   	fprintf(f, "  - Lacp info:\n");
>   
> -	num_active_slaves = rte_eth_bond_active_slaves_get(port_id, slaves,
> +	num_active_members = rte_eth_bond_active_members_get(port_id, members,
>   			RTE_MAX_ETHPORTS);
> -	if (num_active_slaves < 0) {
> -		fprintf(f, "\tFailed to get active slave list for port %u\n",
> +	if (num_active_members < 0) {
> +		fprintf(f, "\tFailed to get active member list for port %u\n",
>   				port_id);
>   		return;
>   	}
> @@ -3545,16 +3549,16 @@ dump_lacp(uint16_t port_id, FILE *f)
>   	}
>   	dump_lacp_conf(&port_conf, f);
>   
> -	for (i = 0; i < num_active_slaves; i++) {
> -		ret = rte_eth_bond_8023ad_slave_info(port_id, slaves[i],
> -				&slave_info);
> +	for (i = 0; i < num_active_members; i++) {
> +		ret = rte_eth_bond_8023ad_member_info(port_id, members[i],
> +				&member_info);
>   		if (ret) {
> -			fprintf(f, "\tGet slave device %u 8023ad info failed\n",
> -				slaves[i]);
> +			fprintf(f, "\tGet member device %u 8023ad info failed\n",
> +				members[i]);
>   			return;
>   		}
> -		fprintf(f, "\tSlave Port: %u\n", slaves[i]);
> -		dump_lacp_slave(&slave_info, f);
> +		fprintf(f, "\tMember Port: %u\n", members[i]);
> +		dump_lacp_member(&member_info, f);
>   	}
>   }
>   
> @@ -3655,8 +3659,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
>   	internals->link_down_delay_ms = 0;
>   	internals->link_up_delay_ms = 0;
>   
> -	internals->slave_count = 0;
> -	internals->active_slave_count = 0;
> +	internals->member_count = 0;
> +	internals->active_member_count = 0;
>   	internals->rx_offload_capa = 0;
>   	internals->tx_offload_capa = 0;
>   	internals->rx_queue_offload_capa = 0;
> @@ -3684,8 +3688,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
>   	internals->rx_desc_lim.nb_align = 1;
>   	internals->tx_desc_lim.nb_align = 1;
>   
> -	memset(internals->active_slaves, 0, sizeof(internals->active_slaves));
> -	memset(internals->slaves, 0, sizeof(internals->slaves));
> +	memset(internals->active_members, 0, sizeof(internals->active_members));
> +	memset(internals->members, 0, sizeof(internals->members));
>   
>   	TAILQ_INIT(&internals->flow_list);
>   	internals->flow_isolated_valid = 0;
> @@ -3770,7 +3774,7 @@ bond_probe(struct rte_vdev_device *dev)
>   	/* Parse link bonding mode */
>   	if (rte_kvargs_count(kvlist, PMD_BOND_MODE_KVARG) == 1) {
>   		if (rte_kvargs_process(kvlist, PMD_BOND_MODE_KVARG,
> -				&bond_ethdev_parse_slave_mode_kvarg,
> +				&bond_ethdev_parse_member_mode_kvarg,
>   				&bonding_mode) != 0) {
>   			RTE_BOND_LOG(ERR, "Invalid mode for bonded device %s",
>   					name);
> @@ -3815,7 +3819,7 @@ bond_probe(struct rte_vdev_device *dev)
>   	if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) {
>   		if (rte_kvargs_process(kvlist,
>   				PMD_BOND_AGG_MODE_KVARG,
> -				&bond_ethdev_parse_slave_agg_mode_kvarg,
> +				&bond_ethdev_parse_member_agg_mode_kvarg,
>   				&agg_mode) != 0) {
>   			RTE_BOND_LOG(ERR,
>   					"Failed to parse agg selection mode for bonded device %s",
> @@ -3865,7 +3869,7 @@ bond_remove(struct rte_vdev_device *dev)
>   	RTE_ASSERT(eth_dev->device == &dev->device);
>   
>   	internals = eth_dev->data->dev_private;
> -	if (internals->slave_count != 0)
> +	if (internals->member_count != 0)
>   		return -EBUSY;
>   
>   	if (eth_dev->data->dev_started == 1) {
> @@ -3877,7 +3881,7 @@ bond_remove(struct rte_vdev_device *dev)
>   	return ret;
>   }
>   
> -/* this part will resolve the slave portids after all the other pdev and vdev
> +/* this part will resolve the member portids after all the other pdev and vdev
>    * have been allocated */
>   static int
>   bond_ethdev_configure(struct rte_eth_dev *dev)
> @@ -3959,7 +3963,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>   	if (link_speeds & RTE_ETH_LINK_SPEED_FIXED) {
>   		if ((link_speeds &
>   		    (internals->speed_capa & ~RTE_ETH_LINK_SPEED_FIXED)) == 0) {
> -			RTE_BOND_LOG(ERR, "the fixed speed is not supported by all slave devices.");
> +			RTE_BOND_LOG(ERR, "the fixed speed is not supported by all member devices.");
>   			return -EINVAL;
>   		}
>   		/*
> @@ -4041,7 +4045,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>   	if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) {
>   		if (rte_kvargs_process(kvlist,
>   				       PMD_BOND_AGG_MODE_KVARG,
> -				       &bond_ethdev_parse_slave_agg_mode_kvarg,
> +				       &bond_ethdev_parse_member_agg_mode_kvarg,
>   				       &agg_mode) != 0) {
>   			RTE_BOND_LOG(ERR,
>   				     "Failed to parse agg selection mode for bonded device %s",
> @@ -4059,60 +4063,60 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>   		}
>   	}
>   
> -	/* Parse/add slave ports to bonded device */
> -	if (rte_kvargs_count(kvlist, PMD_BOND_SLAVE_PORT_KVARG) > 0) {
> -		struct bond_ethdev_slave_ports slave_ports;
> +	/* Parse/add member ports to bonded device */
> +	if (rte_kvargs_count(kvlist, PMD_BOND_MEMBER_PORT_KVARG) > 0) {
> +		struct bond_ethdev_member_ports member_ports;
>   		unsigned i;
>   
> -		memset(&slave_ports, 0, sizeof(slave_ports));
> +		memset(&member_ports, 0, sizeof(member_ports));
>   
> -		if (rte_kvargs_process(kvlist, PMD_BOND_SLAVE_PORT_KVARG,
> -				       &bond_ethdev_parse_slave_port_kvarg, &slave_ports) != 0) {
> +		if (rte_kvargs_process(kvlist, PMD_BOND_MEMBER_PORT_KVARG,
> +				       &bond_ethdev_parse_member_port_kvarg, &member_ports) != 0) {
>   			RTE_BOND_LOG(ERR,
> -				     "Failed to parse slave ports for bonded device %s",
> +				     "Failed to parse member ports for bonded device %s",
>   				     name);
>   			return -1;
>   		}
>   
> -		for (i = 0; i < slave_ports.slave_count; i++) {
> -			if (rte_eth_bond_slave_add(port_id, slave_ports.slaves[i]) != 0) {
> +		for (i = 0; i < member_ports.member_count; i++) {
> +			if (rte_eth_bond_member_add(port_id, member_ports.members[i]) != 0) {
>   				RTE_BOND_LOG(ERR,
> -					     "Failed to add port %d as slave to bonded device %s",
> -					     slave_ports.slaves[i], name);
> +					     "Failed to add port %d as member to bonded device %s",
> +					     member_ports.members[i], name);
>   			}
>   		}
>   
>   	} else {
> -		RTE_BOND_LOG(INFO, "No slaves specified for bonded device %s", name);
> +		RTE_BOND_LOG(INFO, "No members specified for bonded device %s", name);
>   		return -1;
>   	}
>   
> -	/* Parse/set primary slave port id*/
> -	arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG);
> +	/* Parse/set primary member port id*/
> +	arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_MEMBER_KVARG);
>   	if (arg_count == 1) {
> -		uint16_t primary_slave_port_id;
> +		uint16_t primary_member_port_id;
>   
>   		if (rte_kvargs_process(kvlist,
> -				       PMD_BOND_PRIMARY_SLAVE_KVARG,
> -				       &bond_ethdev_parse_primary_slave_port_id_kvarg,
> -				       &primary_slave_port_id) < 0) {
> +				       PMD_BOND_PRIMARY_MEMBER_KVARG,
> +				       &bond_ethdev_parse_primary_member_port_id_kvarg,
> +				       &primary_member_port_id) < 0) {
>   			RTE_BOND_LOG(INFO,
> -				     "Invalid primary slave port id specified for bonded device %s",
> +				     "Invalid primary member port id specified for bonded device %s",
>   				     name);
>   			return -1;
>   		}
>   
>   		/* Set balance mode transmit policy*/
> -		if (rte_eth_bond_primary_set(port_id, primary_slave_port_id)
> +		if (rte_eth_bond_primary_set(port_id, primary_member_port_id)
>   		    != 0) {
>   			RTE_BOND_LOG(ERR,
> -				     "Failed to set primary slave port %d on bonded device %s",
> -				     primary_slave_port_id, name);
> +				     "Failed to set primary member port %d on bonded device %s",
> +				     primary_member_port_id, name);
>   			return -1;
>   		}
>   	} else if (arg_count > 1) {
>   		RTE_BOND_LOG(INFO,
> -			     "Primary slave can be specified only once for bonded device %s",
> +			     "Primary member can be specified only once for bonded device %s",
>   			     name);
>   		return -1;
>   	}
> @@ -4206,15 +4210,15 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>   		return -1;
>   	}
>   
> -	/* configure slaves so we can pass mtu setting */
> -	for (i = 0; i < internals->slave_count; i++) {
> -		struct rte_eth_dev *slave_ethdev =
> -				&(rte_eth_devices[internals->slaves[i].port_id]);
> -		if (slave_configure(dev, slave_ethdev) != 0) {
> +	/* configure members so we can pass mtu setting */
> +	for (i = 0; i < internals->member_count; i++) {
> +		struct rte_eth_dev *member_ethdev =
> +				&(rte_eth_devices[internals->members[i].port_id]);
> +		if (member_configure(dev, member_ethdev) != 0) {
>   			RTE_BOND_LOG(ERR,
> -				"bonded port (%d) failed to configure slave device (%d)",
> +				"bonded port (%d) failed to configure member device (%d)",
>   				dev->data->port_id,
> -				internals->slaves[i].port_id);
> +				internals->members[i].port_id);
>   			return -1;
>   		}
>   	}
> @@ -4230,7 +4234,7 @@ RTE_PMD_REGISTER_VDEV(net_bonding, pmd_bond_drv);
>   RTE_PMD_REGISTER_ALIAS(net_bonding, eth_bond);
>   
>   RTE_PMD_REGISTER_PARAM_STRING(net_bonding,
> -	"slave=<ifc> "
> +	"member=<ifc> "
>   	"primary=<ifc> "
>   	"mode=[0-6] "
>   	"xmit_policy=[l2 | l23 | l34] "
> diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map
> index bd28ee78a5..09ee21c55f 100644
> --- a/drivers/net/bonding/version.map
> +++ b/drivers/net/bonding/version.map
> @@ -12,8 +12,6 @@ DPDK_24 {
>   	rte_eth_bond_8023ad_ext_distrib_get;
>   	rte_eth_bond_8023ad_ext_slowtx;
>   	rte_eth_bond_8023ad_setup;
> -	rte_eth_bond_8023ad_slave_info;
> -	rte_eth_bond_active_slaves_get;
>   	rte_eth_bond_create;
>   	rte_eth_bond_free;
>   	rte_eth_bond_link_monitoring_set;
> @@ -23,11 +21,18 @@ DPDK_24 {
>   	rte_eth_bond_mode_set;
>   	rte_eth_bond_primary_get;
>   	rte_eth_bond_primary_set;
> -	rte_eth_bond_slave_add;
> -	rte_eth_bond_slave_remove;
> -	rte_eth_bond_slaves_get;
>   	rte_eth_bond_xmit_policy_get;
>   	rte_eth_bond_xmit_policy_set;
>   
>   	local: *;
>   };
> +
> +EXPERIMENTAL {
> +	# added in 23.11
> +	global:
> +	rte_eth_bond_8023ad_member_info;
> +	rte_eth_bond_active_members_get;
> +	rte_eth_bond_member_add;
> +	rte_eth_bond_member_remove;
> +	rte_eth_bond_members_get;
> +};
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index 9b076bb39f..90f422ec11 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -105,8 +105,8 @@
>   		":%02"PRIx8":%02"PRIx8":%02"PRIx8,	\
>   		RTE_ETHER_ADDR_BYTES(&addr))
>   
> -uint16_t slaves[RTE_MAX_ETHPORTS];
> -uint16_t slaves_count;
> +uint16_t members[RTE_MAX_ETHPORTS];
> +uint16_t members_count;
>   
>   static uint16_t BOND_PORT = 0xffff;
>   
> @@ -128,7 +128,7 @@ static struct rte_eth_conf port_conf = {
>   };
>   
>   static void
> -slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
> +member_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
>   {
>   	int retval;
>   	uint16_t nb_rxd = RTE_RX_DESC_DEFAULT;
> @@ -252,10 +252,10 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>   		rte_exit(EXIT_FAILURE, "port %u: rte_eth_dev_adjust_nb_rx_tx_desc "
>   				"failed (res=%d)\n", BOND_PORT, retval);
>   
> -	for (i = 0; i < slaves_count; i++) {
> -		if (rte_eth_bond_slave_add(BOND_PORT, slaves[i]) == -1)
> -			rte_exit(-1, "Oooops! adding slave (%u) to bond (%u) failed!\n",
> -					slaves[i], BOND_PORT);
> +	for (i = 0; i < members_count; i++) {
> +		if (rte_eth_bond_member_add(BOND_PORT, members[i]) == -1)
> +			rte_exit(-1, "Oooops! adding member (%u) to bond (%u) failed!\n",
> +					members[i], BOND_PORT);
>   
>   	}
>   
> @@ -283,18 +283,18 @@ bond_port_init(struct rte_mempool *mbuf_pool)
>   	if (retval < 0)
>   		rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
>   
> -	printf("Waiting for slaves to become active...");
> +	printf("Waiting for members to become active...");
>   	while (wait_counter) {
> -		uint16_t act_slaves[16] = {0};
> -		if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) ==
> -				slaves_count) {
> +		uint16_t act_members[16] = {0};
> +		if (rte_eth_bond_active_members_get(BOND_PORT, act_members, 16) ==
> +				members_count) {
>   			printf("\n");
>   			break;
>   		}
>   		sleep(1);
>   		printf("...");
>   		if (--wait_counter == 0)
> -			rte_exit(-1, "\nFailed to activate slaves\n");
> +			rte_exit(-1, "\nFailed to activate members\n");
>   	}
>   
>   	retval = rte_eth_promiscuous_enable(BOND_PORT);
> @@ -631,7 +631,7 @@ static void cmd_help_parsed(__rte_unused void *parsed_result,
>   			"send IP	- sends one ARPrequest through bonding for IP.\n"
>   			"start		- starts listening ARPs.\n"
>   			"stop		- stops lcore_main.\n"
> -			"show		- shows some bond info: ex. active slaves etc.\n"
> +			"show		- shows some bond info: ex. active members etc.\n"
>   			"help		- prints help.\n"
>   			"quit		- terminate all threads and quit.\n"
>   		       );
> @@ -742,13 +742,13 @@ static void cmd_show_parsed(__rte_unused void *parsed_result,
>   			    struct cmdline *cl,
>   			    __rte_unused void *data)
>   {
> -	uint16_t slaves[16] = {0};
> +	uint16_t members[16] = {0};
>   	uint8_t len = 16;
>   	struct rte_ether_addr addr;
>   	uint16_t i;
>   	int ret;
>   
> -	for (i = 0; i < slaves_count; i++) {
> +	for (i = 0; i < members_count; i++) {
>   		ret = rte_eth_macaddr_get(i, &addr);
>   		if (ret != 0) {
>   			cmdline_printf(cl,
> @@ -763,9 +763,9 @@ static void cmd_show_parsed(__rte_unused void *parsed_result,
>   
>   	rte_spinlock_lock(&global_flag_stru_p->lock);
>   	cmdline_printf(cl,
> -			"Active_slaves:%d "
> +			"Active_members:%d "
>   			"packets received:Tot:%d Arp:%d IPv4:%d\n",
> -			rte_eth_bond_active_slaves_get(BOND_PORT, slaves, len),
> +			rte_eth_bond_active_members_get(BOND_PORT, members, len),
>   			global_flag_stru_p->port_packets[0],
>   			global_flag_stru_p->port_packets[1],
>   			global_flag_stru_p->port_packets[2]);
> @@ -836,10 +836,10 @@ main(int argc, char *argv[])
>   		rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");
>   
>   	/* initialize all ports */
> -	slaves_count = nb_ports;
> +	members_count = nb_ports;
>   	RTE_ETH_FOREACH_DEV(i) {
> -		slave_port_init(i, mbuf_pool);
> -		slaves[i] = i;
> +		member_port_init(i, mbuf_pool);
> +		members[i] = i;
>   	}
>   
>   	bond_port_init(mbuf_pool);

^ permalink raw reply	[relevance 0%]

Results 1001-1200 of ~18000   |  | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2022-04-20  8:16     [PATCH v1 0/5] Direct re-arming of buffers on receive side Feifei Wang
2023-08-22  7:27     ` [PATCH v11 0/4] Recycle mbufs from Tx queue into Rx queue Feifei Wang
2023-08-22  7:27  3%   ` [PATCH v11 1/4] ethdev: add API for mbufs recycle mode Feifei Wang
2023-08-22 23:33  0%     ` Konstantin Ananyev
2023-08-24  3:38  0%     ` Feifei Wang
2023-08-24  7:36     ` [PATCH v12 0/4] Recycle mbufs from Tx queue into Rx queue Feifei Wang
2023-08-24  7:36  3%   ` [PATCH v12 1/4] ethdev: add API for mbufs recycle mode Feifei Wang
2023-09-25  3:19     ` [PATCH v13 0/4] Recycle mbufs from Tx queue into Rx queue Feifei Wang
2023-09-25  3:19  3%   ` [PATCH v13 1/4] ethdev: add API for mbufs recycle mode Feifei Wang
2022-08-29 15:18     [RFC PATCH 0/3] Split logging out of EAL Bruce Richardson
2023-08-09 13:35     ` [PATCH v8 0/3] Split logging functionality " Bruce Richardson
2023-08-11 12:46       ` David Marchand
2023-10-23  7:37  0%     ` David Marchand
2023-03-09  8:56     [RFC 1/2] security: introduce out of place support for inline ingress Nithin Dabilpuram
2023-09-21  2:15  4% ` [PATCH v2 1/3] " Nithin Dabilpuram
2023-03-14 12:48     [PATCH 0/5] fix segment fault when parse args Chengwen Feng
2023-11-05  5:45     ` [PATCH v4 " Chengwen Feng
2023-11-05  5:45       ` [PATCH v4 1/5] kvargs: add one new process API Chengwen Feng
2023-11-06  3:18  4%     ` Stephen Hemminger
2023-11-06  7:13  0%       ` fengchengwen
2023-11-06 16:19  0%         ` Stephen Hemminger
2023-11-07  3:21  0%           ` fengchengwen
2023-03-15 11:00     [PATCH 0/5] support setting and querying RSS algorithms Dongdong Liu
2023-08-26  7:46     ` [PATCH v2 " Jie Hai
2023-08-26  7:46  5%   ` [PATCH v2 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
2023-08-30 11:46  0%     ` Thomas Monjalon
2023-08-31  0:10  0%       ` Ajit Khaparde
2023-08-31 10:59  0%         ` Jie Hai
2023-09-04  6:26  0%         ` Jie Hai
2023-09-04  7:10  0%       ` Jie Hai
2023-09-06 15:10  3%     ` Stephen Hemminger
2023-09-08  9:28  0%       ` Jie Hai
2023-09-08 20:58  3%         ` Stephen Hemminger
2023-09-12  1:49  0%           ` Jie Hai
2023-09-04  6:10  3%   ` [PATCH v3 0/5] support setting and querying RSS algorithms Jie Hai
2023-09-04  7:37  0%     ` Jie Hai
2023-09-04  7:28  3%   ` [PATCH " Jie Hai
2023-09-04  7:28  4%     ` [PATCH 1/5] ethdev: support setting and querying RSS algorithm Jie Hai
2023-09-08  8:00  3%     ` [PATCH v4 0/7] support setting and querying RSS algorithms Jie Hai
2023-09-08  8:00  4%       ` [PATCH v4 2/7] ethdev: support setting and querying RSS algorithm Jie Hai
2023-09-20 16:39  3%         ` Ferruh Yigit
2023-09-26 13:23  0%           ` Jie Hai
2023-10-11  9:27  2%       ` [PATCH v5 00/40] support setting and querying RSS algorithms Jie Hai
2023-10-11  9:27  4%         ` [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm Jie Hai
2023-10-11 17:39  4%           ` Stephen Hemminger
2023-10-12  2:21  0%             ` fengchengwen
2023-10-12 15:23  0%               ` Stephen Hemminger
2023-10-24 12:54  0%               ` Jie Hai
2023-10-11 18:19  0%         ` [PATCH v5 00/40] support setting and querying RSS algorithms Ferruh Yigit
2023-10-12 16:49  0%         ` Stephen Hemminger
2023-10-17 14:06             ` Thomas Monjalon
2023-10-17 14:26               ` Ferruh Yigit
2023-10-24 12:57  3%             ` lihuisong (C)
2023-10-26  8:53  0%               ` Thomas Monjalon
2023-10-27  9:28  3%         ` [PATCH 0/9] " Jie Hai
2023-10-27  9:28  4%           ` [PATCH 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
2023-10-28  1:46  3%           ` [PATCH v7 0/9] support setting and querying RSS algorithms Jie Hai
2023-10-28  1:46  4%             ` [PATCH v7 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
2023-10-28  3:01  3%               ` lihuisong (C)
2023-11-01 12:55  5%                 ` Ferruh Yigit
2023-11-01  2:04  0%             ` [PATCH v7 0/9] support setting and querying RSS algorithms Ferruh Yigit
2023-11-01  7:40  3% ` [PATCH v8 00/10] " Jie Hai
2023-11-01  7:40  4%   ` [PATCH v8 03/10] ethdev: support setting and querying RSS algorithm Jie Hai
2023-11-01 13:36  3%     ` Ferruh Yigit
2023-11-02  6:58  0%       ` Jie Hai
2023-11-01  9:44  0%   ` [PATCH v8 00/10] support setting and querying RSS algorithms fengchengwen
2023-11-02  8:20  3% ` [PATCH v9 0/9] " Jie Hai
2023-11-02  8:20  3%   ` [PATCH v9 1/9] ethdev: overwrite some comment related to RSS Jie Hai
2023-11-02  8:20  4%   ` [PATCH v9 2/9] ethdev: support setting and querying RSS algorithm Jie Hai
2023-11-02 13:11  0%   ` [PATCH v9 0/9] support setting and querying RSS algorithms Ferruh Yigit
2023-03-29 23:40     [PATCH v12 00/22] Covert static log types in libraries to dynamic Stephen Hemminger
2023-08-21 16:09  2% ` [PATCH v13 00/21] Convert static log types in libraries to dynamic types Stephen Hemminger
2023-08-21 16:09  2%   ` [PATCH v13 17/21] hash: move rte_hash_set_alg out header Stephen Hemminger
2023-04-19  9:54     [RFC PATCH 1/5] eventdev: add power monitoring API on event port Sivaprasad Tummala
2023-10-16 20:57     ` [PATCH v1 1/6] " Sivaprasad Tummala
2023-10-16 20:57       ` [PATCH v1 5/6] power: add eventdev support for power management Sivaprasad Tummala
2023-10-17  3:22         ` Jerin Jacob
2023-10-18  7:08  3%       ` Tummala, Sivaprasad
2023-10-18  7:13  0%         ` Jerin Jacob
2023-05-09  9:24     [PATCH v6 0/3] add telemetry cmds for ring Jie Hai
2023-07-04  9:04     ` [PATCH v7 " Jie Hai
2023-08-18  6:53  0%   ` Jie Hai
2023-09-12  1:52  0%   ` Jie Hai
2023-10-10  2:25  0%   ` Jie Hai
2023-10-25  1:22  0%   ` Jie Hai
2023-10-28  9:50  0%   ` Jie Hai
2023-11-08  2:55  0%   ` lihuisong (C)
2023-05-18  8:44     [PATCH v4] net/bonding: replace master/slave to main/member Chaoyong He
2023-08-16  6:27     ` [PATCH v5 0/2] " Chaoyong He
2023-08-16  6:27       ` [PATCH v5 2/2] net/bonding: " Chaoyong He
2023-08-17  2:36  0%     ` lihuisong (C)
2023-05-25 20:39     [PATCH] ethdev: validate reserved fields Stephen Hemminger
2023-05-26  8:15     ` Bruce Richardson
2023-09-21 15:12  0%   ` Ferruh Yigit
2023-09-21 16:33  0%     ` Ferruh Yigit
2023-09-22 15:23  0%       ` Ferruh Yigit
2023-06-07 21:00     [PATCH v1] event/dlb2: add support for disabling PASID Abdullah Sevincer
2023-10-30 21:12     ` [PATCH v3] event/dlb2: fix disable PASID for kernel 6.2 Abdullah Sevincer
2023-10-31  8:21       ` Jerin Jacob
2023-10-31 15:13         ` Sevincer, Abdullah
2023-10-31 17:06           ` Jerin Jacob
2023-10-31 17:15             ` Bruce Richardson
2023-10-31 18:42               ` Jerin Jacob
2023-10-31 20:44                 ` Bruce Richardson
2023-11-01  4:51                   ` Jerin Jacob
2023-11-01 19:05                     ` Sevincer, Abdullah
2023-11-02 10:23  4%                   ` Bruce Richardson
2023-11-02 10:48  0%                     ` Thomas Monjalon
2023-06-15 16:48     [PATCH v2 0/5] bbdev: API extension for 23.11 Nicolas Chautru
2023-06-15 16:48     ` [PATCH v2 2/5] bbdev: add new capabilities for FFT processing Nicolas Chautru
2023-09-18 15:08  3%   ` Maxime Coquelin
2023-09-18 15:42  0%     ` Maxime Coquelin
2023-09-18 20:50  0%       ` Chautru, Nicolas
2023-06-15 16:49     ` [PATCH v2 5/5] devtools: ignore changes into bbdev experimental API Nicolas Chautru
2023-09-06  6:17  0%   ` Hemant Agrawal
2023-09-12 20:32  0%     ` Vargas, Hernan
2023-09-13  9:31  0%       ` Hemant Agrawal
2023-09-18 15:22  0%   ` Maxime Coquelin
2023-07-17 22:28     ` [PATCH v2 0/5] bbdev: API extension for 23.11 Chautru, Nicolas
2023-08-04 16:14       ` Vargas, Hernan
2023-09-05 17:48  0%     ` Chautru, Nicolas
2023-09-06  6:20  0% ` Hemant Agrawal
2023-09-21  7:35  0% ` Maxime Coquelin
2023-07-05  6:52     [PATCH v2] bus/cdx: provide driver flag for optional resource mapping Abhijit Gangurde
2023-07-11  5:51     ` [PATCH v3] " Abhijit Gangurde
2023-09-29 15:17  3%   ` David Marchand
2023-10-04 10:06  0%     ` Gangurde, Abhijit
2023-10-04 12:54  0%       ` David Marchand
2023-10-13 11:51  0%         ` Gangurde, Abhijit
2023-10-13 12:15  0%           ` David Marchand
2023-07-16 21:25     [RFC] MAINTAINERS: add status information Stephen Hemminger
2023-10-31 22:08     ` [PATCH 0/3] net/tap: update and fix the BPF program Stephen Hemminger
2023-10-31 22:08  4%   ` [PATCH 1/3] net/tap: support infrastructure to build the BPF filter Stephen Hemminger
2023-10-31 22:42     ` [PATCH v5 0/3] net/tap: build and fix for BPF program Stephen Hemminger
2023-10-31 22:42  4%   ` [PATCH v5 1/3] net/tap: support infrastructure to build the BPF filter Stephen Hemminger
2023-11-01 18:02     ` [PATCH v6 0/3] net/tap: build and fix for BPF program Stephen Hemminger
2023-11-01 18:02  4%   ` [PATCH v6 1/3] net/tap: support infrastructure to build the BPF filter Stephen Hemminger
2023-08-02 21:11     [PATCH 1/2] eal: remove RTE_CPUFLAG_NUMFLAGS Sivaprasad Tummala
2023-08-11  6:07     ` [PATCH v2 1/2] test/cpuflags: removed test for NUMFLAGS Sivaprasad Tummala
2023-08-11  6:07       ` [PATCH v2 2/2] eal: remove NUMFLAGS enumeration Sivaprasad Tummala
2023-08-15  6:10         ` Stanisław Kardach
2023-09-19 14:47  0%       ` David Marchand
2023-09-20  6:00  4%         ` Stanisław Kardach
2023-09-20  7:34  0%           ` David Marchand
2023-09-21 13:18  4%             ` Tummala, Sivaprasad
2023-09-21 14:49  4%               ` Stanisław Kardach
2023-09-27 11:55  5%                 ` Ferruh Yigit
2023-09-27 13:48  4%                   ` Stanisław Kardach
2023-09-27 14:09  0%                     ` Ferruh Yigit
2023-09-27 15:03  0%                       ` Stanisław Kardach
2023-09-27 16:13  0%                         ` Ferruh Yigit
2023-09-27 13:13  0%     ` Ferruh Yigit
2023-09-28  9:31  0%       ` Tummala, Sivaprasad
2023-10-06  8:27  3%     ` David Marchand
2023-10-06 11:19  0%       ` Ferruh Yigit
2023-08-08 17:35     [PATCH 00/20] remove experimental flag from some API's Stephen Hemminger
2023-08-09  0:09     ` [PATCH v2 00/29] promote many API's to stable Stephen Hemminger
2023-10-18 19:14  0%   ` David Marchand
2023-10-18 19:41  3%     ` David Marchand
2023-10-19 16:55  3% ` [PATCH v3 00/29] Promote experimental " Stephen Hemminger
2023-10-19 16:55  2%   ` [PATCH v3 25/29] compressdev: remove experimental flag Stephen Hemminger
2023-10-19 19:09  3% ` [PATCH v4 00/28] Promote many experimental API's to stable Stephen Hemminger
2023-10-19 19:10  2%   ` [PATCH v4 24/28] compressdev: remove experimental flag Stephen Hemminger
2023-10-20 20:57  3% ` [PATCH v5 00/26] Promote many experimental API's to stable Stephen Hemminger
2023-10-20 20:57  2%   ` [PATCH v5 22/26] compressdev: remove experimental flag Stephen Hemminger
2023-10-23  9:12  0%     ` Bruce Richardson
2023-10-24  2:39  3% ` [PATCH v6 00/25] Promite many experimental API's to stable Stephen Hemminger
2023-10-24  2:53  3% ` [PATCH v7 00/25] Promote 22.11 and older " Stephen Hemminger
2023-10-24  2:54  2%   ` [PATCH v7 22/25] compressdev: remove experimental flag Stephen Hemminger
2023-10-24  7:20  0% ` [PATCH 00/20] remove experimental flag from some API's Maxime Coquelin
2023-08-11  1:31     [PATCH 0/6] RFC optional rte optional stdatomics API Tyler Retzlaff
2023-08-17 21:42  3% ` [PATCH v5 0/6] " Tyler Retzlaff
2023-08-17 21:42  2%   ` [PATCH v5 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
2023-08-21 22:27  0%   ` [PATCH v5 0/6] optional rte optional stdatomics API Konstantin Ananyev
2023-08-22 21:00  3% ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
2023-08-22 21:00  2%   ` [PATCH v6 3/6] eal: add rte atomic qualifier with casts Tyler Retzlaff
2023-08-29 15:57  0%   ` [PATCH v6 0/6] rte atomics API for optional stdatomic Tyler Retzlaff
2023-09-29 14:09  0%   ` David Marchand
2023-08-11  7:17     [RFC PATCH 0/3] add TLS record processing security offload Anoob Joseph
2023-08-11  7:17     ` [RFC PATCH 2/3] security: add TLS record processing Anoob Joseph
2023-09-20  9:23  3%   ` Van Haaren, Harry
2023-09-20 11:51  0%     ` Anoob Joseph
2023-09-21  8:38  0%       ` Van Haaren, Harry
2023-08-17 10:58     [RFC PATCH] app/test: add support for skipping tests Bruce Richardson
2023-09-14 15:16     ` [PATCH v4] " Bruce Richardson
2023-09-25 16:26       ` Aaron Conole
2023-10-02  9:20         ` David Marchand
2023-10-03 20:22           ` Patrick Robb
2023-10-04 15:13             ` Aaron Conole
2023-10-09 20:03               ` Patrick Robb
2023-10-20 15:02                 ` Patrick Robb
2023-10-20 15:08  3%               ` Bruce Richardson
2023-08-22 10:23  3% Minutes of Technical Board Meeting, 2023-August -9 Jerin Jacob Kollanukkaran
2023-08-24 11:09     [PATCH 00/27] refact the nfpcore module Chaoyong He
2023-08-24 11:09  2% ` [PATCH 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-08-24 11:09  3% ` [PATCH 05/27] net/nfp: standard the local variable " Chaoyong He
2023-08-24 11:09  1% ` [PATCH 07/27] net/nfp: standard the comment style Chaoyong He
2023-08-24 11:09  5% ` [PATCH 19/27] net/nfp: refact the nsp module Chaoyong He
2023-08-30  2:14     ` [PATCH v2 00/27] refact the nfpcore module Chaoyong He
2023-08-30  2:14  2%   ` [PATCH v2 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-08-30  2:14  3%   ` [PATCH v2 05/27] net/nfp: standard the local variable " Chaoyong He
2023-08-30  2:14  1%   ` [PATCH v2 07/27] net/nfp: standard the comment style Chaoyong He
2023-08-30  2:14  5%   ` [PATCH v2 19/27] net/nfp: refact the nsp module Chaoyong He
2023-09-15  9:15       ` [PATCH v3 00/27] refact the nfpcore module Chaoyong He
2023-09-15  9:15  1%     ` [PATCH v3 02/27] net/nfp: unify the indent coding style Chaoyong He
2023-09-15  9:15  3%     ` [PATCH v3 05/27] net/nfp: standard the local variable " Chaoyong He
2023-09-15  9:15  1%     ` [PATCH v3 07/27] net/nfp: standard the comment style Chaoyong He
2023-09-15  9:15  5%     ` [PATCH v3 19/27] net/nfp: refact the nsp module Chaoyong He
2023-09-18  2:45         ` [PATCH v4 00/26] refact the nfpcore module Chaoyong He
2023-09-18  2:45  1%       ` [PATCH v4 02/26] net/nfp: unify the indent coding style Chaoyong He
2023-09-18 11:53  0%         ` Niklas Söderlund
2023-09-18  2:45  3%       ` [PATCH v4 05/26] net/nfp: standard the local variable " Chaoyong He
2023-09-18  2:45  1%       ` [PATCH v4 07/26] net/nfp: standard the comment style Chaoyong He
2023-09-18  2:46  5%       ` [PATCH v4 18/26] net/nfp: refact the nsp module Chaoyong He
2023-09-19  9:54           ` [PATCH v5 00/26] refact the nfpcore module Chaoyong He
2023-09-19  9:54  1%         ` [PATCH v5 02/26] net/nfp: unify the indent coding style Chaoyong He
2023-09-19  9:54  3%         ` [PATCH v5 05/26] net/nfp: standard the local variable " Chaoyong He
2023-09-19  9:54  1%         ` [PATCH v5 07/26] net/nfp: standard the comment style Chaoyong He
2023-09-19  9:54  5%         ` [PATCH v5 18/26] net/nfp: refact the nsp module Chaoyong He
2023-08-30 15:52     [PATCH v1 0/3] Spec changes to support multi I/O models Srikanth Yalavarthi
2023-09-27 18:11     ` [PATCH v3 0/4] " Srikanth Yalavarthi
2023-09-27 18:11  4%   ` [PATCH v3 4/4] mldev: update release notes for 23.11 Srikanth Yalavarthi
2023-10-02  9:58     ` [PATCH v4 0/3] Spec changes to support multi I/O models Srikanth Yalavarthi
2023-10-02  9:58  2%   ` [PATCH v4 1/3] mldev: add support for arbitrary shape dimensions Srikanth Yalavarthi
2023-10-02  9:58  1%   ` [PATCH v4 2/3] mldev: introduce support for IO layout Srikanth Yalavarthi
2023-08-30 15:58     [PATCH v1 00/34] Implemenation of revised ml/cnxk driver Srikanth Yalavarthi
2023-10-18 13:53     ` [PATCH v6 00/34] Implementation " Srikanth Yalavarthi
2023-10-18 13:54       ` [PATCH v6 18/34] ml/cnxk: support config and close of tvmdp library Srikanth Yalavarthi
2023-10-18 18:34  5%     ` Jerin Jacob
2023-10-19  6:44  0%       ` [EXT] " Srikanth Yalavarthi
2023-08-31 12:10     [PATCH 0/3] enable PPC in test-meson-builds on ubuntu Bruce Richardson
2023-08-31 12:10 10% ` [PATCH 3/3] devtools: enable testing ppc builds " Bruce Richardson
2023-09-04 13:03     [PATCH v3 1/3] lib: introduce dispatcher library Mattias Rönnblom
2023-09-22  7:38     ` [PATCH v4 0/3] Add " Mattias Rönnblom
2023-09-22  7:38       ` [PATCH v4 1/3] lib: introduce " Mattias Rönnblom
2023-09-25  7:11         ` Mattias Rönnblom
2023-09-26 18:28           ` Jerin Jacob
2023-09-27  8:13  3%         ` Bruce Richardson
2023-09-28  7:44  0%           ` Mattias Rönnblom
2023-10-03 17:31  0%           ` Jerin Jacob
2023-09-28  7:30         ` [PATCH v5 0/3] Add " Mattias Rönnblom
2023-09-28  7:30           ` [PATCH v5 1/3] lib: introduce " Mattias Rönnblom
2023-10-05  8:36             ` David Marchand
2023-10-05 10:08               ` Mattias Rönnblom
2023-10-06  8:46                 ` David Marchand
2023-10-09 16:49                   ` Mattias Rönnblom
2023-10-11 14:57                     ` David Marchand
2023-10-11 20:51  3%                   ` Mattias Rönnblom
2023-09-06 16:12     [PATCH 00/11] rework thread management Thomas Monjalon
2023-09-06 16:12  3% ` [PATCH 03/11] eal: remove attributes from control thread creation Thomas Monjalon
2023-09-06 16:12  3% ` [PATCH 04/11] eal: promote thread API as stable Thomas Monjalon
2023-09-06 16:12  4% ` [PATCH 10/11] eal: remove deprecated thread functions Thomas Monjalon
2023-09-08  4:22  0%   ` Tyler Retzlaff
2023-09-13 10:34     ` [PATCH v2 00/11] rework thread management Thomas Monjalon
2023-09-13 10:34  3%   ` [PATCH v2 03/11] eal: remove attributes from control thread creation Thomas Monjalon
2023-09-13 10:34  3%   ` [PATCH v2 04/11] eal: promote thread API as stable Thomas Monjalon
2023-09-13 10:34  4%   ` [PATCH v2 10/11] eal: remove deprecated thread functions Thomas Monjalon
2023-09-13 11:28     ` [PATCH v3 00/11] rework thread management Thomas Monjalon
2023-09-13 11:28  3%   ` [PATCH v3 03/11] eal: remove attributes from control thread creation Thomas Monjalon
2023-09-13 11:28  3%   ` [PATCH v3 04/11] eal: promote thread API as stable Thomas Monjalon
2023-09-13 11:28  4%   ` [PATCH v3 10/11] eal: remove deprecated thread functions Thomas Monjalon
     [not found]     <PAXPR04MB932824B064C14CEAE1093E93891CA@PAXPR04MB9328.eurprd04.prod.outlook.com>
2023-09-18  5:18  3% ` Minutes of Technical Board Meeting, 2023-Jun-28 Hemant Agrawal
2023-09-20 10:40     [PATCH v2] security: hide security context Akhil Goyal
2023-09-26  7:19  2% ` [PATCH v3] " Akhil Goyal
2023-09-26  8:08  1%   ` [PATCH v4] " Akhil Goyal
2023-09-21  4:23     [PATCH 0/4] pcapng fixes Stephen Hemminger
2023-09-21  4:23     ` [PATCH 4/4] pcapng: move timestamp calculation into pdump Stephen Hemminger
2023-10-02  8:15       ` David Marchand
2023-10-04 17:13         ` Stephen Hemminger
2023-10-06  9:10  3%       ` David Marchand
2023-10-06 14:59  0%         ` Kevin Traynor
2023-09-29 14:15     [PATCH] ci: test stdatomic API David Marchand
2023-10-17  7:15  4% ` [PATCH v2] " David Marchand
2023-10-04 12:59  3% [PATCH 1/2] ethdev: add IPsec event subtype range for PMD specific code Nithin Dabilpuram
2023-10-10 13:10  0% ` Ferruh Yigit
2023-10-10 14:48  0%   ` [EXT] " Akhil Goyal
2023-10-12  9:32  0%     ` Ferruh Yigit
2023-10-10 14:50  0%   ` Anoob Joseph
2023-10-04 15:11  4% Minutes of Technical Board Meeting, 2023-05-31 Aaron Conole
2023-10-05 11:51     [RFC PATCH] eventdev: ensure 16-byte alignment for events Bruce Richardson
2023-10-05 12:06  3% ` Bruce Richardson
2023-10-05 13:11  0%   ` Jerin Jacob
2023-10-05 13:15         ` Bruce Richardson
2023-10-06  7:19  3%       ` Jerin Jacob
2023-10-06  9:37  5% ` [PATCH v2] " Bruce Richardson
2023-10-06  9:45  8% ` [PATCH v3] " Bruce Richardson
2023-10-06 10:29  8% ` [PATCH v4] " Bruce Richardson
     [not found]     <20220825024425.10534-1-lihuisong@huawei.com>
2023-08-02  3:15     ` [PATCH RESEND v6 0/5] app/testpmd: support multiple process attach and detach port Huisong Li
2023-10-09 10:34  0%   ` lihuisong (C)
2023-10-30 12:17  0%     ` lihuisong (C)
2023-10-13  4:27     [PATCH v2 0/3] example/l3fwd: relax l3fwd rx RSS/Offload if needed Trevor Tao
2023-10-13  4:27  9% ` [PATCH v2 3/3] doc: add a relax rx mode requirement option Trevor Tao
2023-10-17 12:35  3% [PATCH] event/cnxk: fix symbol map David Marchand
2023-10-17 12:38  0% ` [EXT] " Pavan Nikhilesh Bhagavatula
2023-10-17 20:36  4% release candidate 23.11-rc1 Thomas Monjalon
     [not found]     ` <MW4PR11MB5912D298978501DAC2092EA49FD4A@MW4PR11MB5912.namprd11.prod.outlook.com>
2023-10-27  9:19  0%   ` Xu, HailinX
2023-10-31 23:15  0% ` Thinh Tran
2023-10-20 14:19  7% [PATCH] docs: add note about experimental API in LTS Kevin Traynor
2023-11-02  2:23     [PATCH 00/11] Add the support of multiple PF Chaoyong He
2023-11-02  2:23  9% ` [PATCH 04/11] net/nfp: add flag to indicate multiple PFs support Chaoyong He
2023-11-02 18:19     [RFC] eal: RFC to refactor rte_eal_init into sub-functions Rahul Gupta
2023-11-02 18:37  3% ` Stephen Hemminger
2023-11-07 17:33  0%   ` rahul gupta
2023-11-08  4:38  0%   ` Rahul Gupta

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).