[v3,00/25] add the NFP vDPA PMD

Message ID 20231026064324.177531-1-chaoyong.he@corigine.com (mailing list archive)
Headers
Series add the NFP vDPA PMD |

Message

Chaoyong He Oct. 26, 2023, 6:42 a.m. UTC
  This patch series aims to add the NFP vDPA PMD, we also grab the common
logic into the `drivers/common/nfp` directory.

---
v3:
* Replace 'pthread_xxx' API with 'rte_thread_xxx' API.
* Replace '__atomic_xxx' built-ins with 'rte_atomic_xxx'.
* Drop the check statement in meson.build file which prevent build of
  PMD.
* Fix a problem about the logtype prefix.
* Move the document modification to the commit which should be.
v2:
* Grab more logic into the `drivers/common/nfp` directory.
* Delete some logic which should be when moving logic.
---

Chaoyong He (25):
  drivers: introduce the NFP common library
  net/nfp: make VF PMD using of NFP common module
  net/nfp: rename common module name
  net/nfp: rename ctrl module name
  net/nfp: extract the cap data field
  net/nfp: extract the qcp data field
  net/nfp: extract the ctrl BAR data field
  net/nfp: extract the ctrl data field
  net/nfp: change the parameter of APIs
  net/nfp: change the parameter of reconfig
  net/nfp: extract the MAC address data field
  net/nfp: rename parameter in related logic
  drivers: add the common ctrl module
  drivers: add the nfp common module
  drivers: move queue logic to common module
  drivers: move platform module to common library
  drivers: move device module to common library
  drivers/vdpa: introduce the NFP vDPA library
  drivers: add the basic framework of vDPA PMD
  vdpa/nfp: add the logic of remap PCI memory
  vdpa/nfp: add the hardware init logic
  drivers: add the datapath update logic
  vdpa/nfp: add the notify related logic
  vdpa/nfp: add nfp vDPA device operations
  doc: add a entry in the release notes

 .mailmap                                      |   1 +
 MAINTAINERS                                   |   7 +
 doc/guides/rel_notes/release_23_11.rst        |   5 +
 doc/guides/vdpadevs/features/nfp.ini          |   8 +
 doc/guides/vdpadevs/index.rst                 |   1 +
 doc/guides/vdpadevs/nfp.rst                   |  54 ++
 drivers/common/nfp/meson.build                |  16 +
 drivers/common/nfp/nfp_common.c               | 226 +++++
 drivers/common/nfp/nfp_common.h               | 239 +++++
 .../nfp/nfp_common_ctrl.h}                    | 209 +---
 drivers/common/nfp/nfp_common_log.c           |   8 +
 drivers/common/nfp/nfp_common_log.h           |  16 +
 drivers/common/nfp/nfp_common_pci.c           | 275 ++++++
 drivers/common/nfp/nfp_common_pci.h           |  45 +
 .../{net/nfp/nfpcore => common/nfp}/nfp_dev.c |   3 +-
 .../{net/nfp/nfpcore => common/nfp}/nfp_dev.h |   3 +
 .../nfp/nfpcore => common/nfp}/nfp_platform.h |   0
 drivers/common/nfp/version.map                |  16 +
 drivers/meson.build                           |   1 +
 drivers/net/nfp/flower/nfp_flower.c           |  56 +-
 drivers/net/nfp/flower/nfp_flower.h           |   2 +-
 .../net/nfp/flower/nfp_flower_representor.c   |  10 +-
 drivers/net/nfp/meson.build                   |   7 +-
 drivers/net/nfp/nfd3/nfp_nfd3_dp.c            |  18 +-
 drivers/net/nfp/nfdk/nfp_nfdk_dp.c            |  22 +-
 drivers/net/nfp/nfp_cpp_bridge.h              |   2 +-
 drivers/net/nfp/nfp_ethdev.c                  |  80 +-
 drivers/net/nfp/nfp_ethdev_vf.c               |  74 +-
 drivers/net/nfp/nfp_flow.h                    |   2 +-
 drivers/net/nfp/nfp_ipsec.c                   |  86 +-
 .../nfp/{nfp_common.c => nfp_net_common.c}    | 493 ++++------
 .../nfp/{nfp_common.h => nfp_net_common.h}    | 219 +----
 .../net/nfp/{nfp_ctrl.c => nfp_net_ctrl.c}    |  21 +-
 drivers/net/nfp/nfp_net_ctrl.h                | 211 ++++
 drivers/net/nfp/nfp_rxtx.c                    |  20 +-
 drivers/net/nfp/nfpcore/nfp6000_pcie.h        |   2 +-
 drivers/net/nfp/nfpcore/nfp_cppcore.c         |   3 +-
 drivers/net/nfp/nfpcore/nfp_nsp.c             |   2 +-
 drivers/net/nfp/nfpcore/nfp_nsp_eth.c         |   3 +-
 drivers/vdpa/meson.build                      |   1 +
 drivers/vdpa/nfp/meson.build                  |  15 +
 drivers/vdpa/nfp/nfp_vdpa.c                   | 912 ++++++++++++++++++
 drivers/vdpa/nfp/nfp_vdpa_core.c              | 193 ++++
 drivers/vdpa/nfp/nfp_vdpa_core.h              |  51 +
 drivers/vdpa/nfp/nfp_vdpa_log.c               |   9 +
 drivers/vdpa/nfp/nfp_vdpa_log.h               |  21 +
 46 files changed, 2727 insertions(+), 941 deletions(-)
 create mode 100644 doc/guides/vdpadevs/features/nfp.ini
 create mode 100644 doc/guides/vdpadevs/nfp.rst
 create mode 100644 drivers/common/nfp/meson.build
 create mode 100644 drivers/common/nfp/nfp_common.c
 create mode 100644 drivers/common/nfp/nfp_common.h
 rename drivers/{net/nfp/nfp_ctrl.h => common/nfp/nfp_common_ctrl.h} (63%)
 create mode 100644 drivers/common/nfp/nfp_common_log.c
 create mode 100644 drivers/common/nfp/nfp_common_log.h
 create mode 100644 drivers/common/nfp/nfp_common_pci.c
 create mode 100644 drivers/common/nfp/nfp_common_pci.h
 rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.c (98%)
 rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_dev.h (96%)
 rename drivers/{net/nfp/nfpcore => common/nfp}/nfp_platform.h (100%)
 create mode 100644 drivers/common/nfp/version.map
 rename drivers/net/nfp/{nfp_common.c => nfp_net_common.c} (80%)
 rename drivers/net/nfp/{nfp_common.h => nfp_net_common.h} (64%)
 rename drivers/net/nfp/{nfp_ctrl.c => nfp_net_ctrl.c} (84%)
 create mode 100644 drivers/net/nfp/nfp_net_ctrl.h
 create mode 100644 drivers/vdpa/nfp/meson.build
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa.c
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_core.c
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_core.h
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.c
 create mode 100644 drivers/vdpa/nfp/nfp_vdpa_log.h
  

Comments

Ferruh Yigit Oct. 26, 2023, 2:47 p.m. UTC | #1
On 10/26/2023 7:42 AM, Chaoyong He wrote:
> This patch series aims to add the NFP vDPA PMD, we also grab the common
> logic into the `drivers/common/nfp` directory.
> 
> ---
> v3:
> * Replace 'pthread_xxx' API with 'rte_thread_xxx' API.
> * Replace '__atomic_xxx' built-ins with 'rte_atomic_xxx'.
> * Drop the check statement in meson.build file which prevent build of
>   PMD.
> * Fix a problem about the logtype prefix.
> * Move the document modification to the commit which should be.
> v2:
> * Grab more logic into the `drivers/common/nfp` directory.
> * Delete some logic which should be when moving logic.
> ---
> 
> Chaoyong He (25):
>   drivers: introduce the NFP common library
>   net/nfp: make VF PMD using of NFP common module
>   net/nfp: rename common module name
>   net/nfp: rename ctrl module name
>   net/nfp: extract the cap data field
>   net/nfp: extract the qcp data field
>   net/nfp: extract the ctrl BAR data field
>   net/nfp: extract the ctrl data field
>   net/nfp: change the parameter of APIs
>   net/nfp: change the parameter of reconfig
>   net/nfp: extract the MAC address data field
>   net/nfp: rename parameter in related logic
>   drivers: add the common ctrl module
>   drivers: add the nfp common module
>   drivers: move queue logic to common module
>   drivers: move platform module to common library
>   drivers: move device module to common library
>   drivers/vdpa: introduce the NFP vDPA library
>   drivers: add the basic framework of vDPA PMD
>   vdpa/nfp: add the logic of remap PCI memory
>   vdpa/nfp: add the hardware init logic
>   drivers: add the datapath update logic
>   vdpa/nfp: add the notify related logic
>   vdpa/nfp: add nfp vDPA device operations
>   doc: add a entry in the release notes
> 

There is a build error on atomics API [1] with clang [2], it is fine
with gcc, cc'ed Tyler and David for help.



[1]
../drivers/vdpa/nfp/nfp_vdpa.c:548:7:
error: address argument to atomic operation must be a pointer to _Atomic
type ('uint32_t *' (aka 'unsigned int *') invalid)
        if ((rte_atomic_load_explicit(&device->running, rte_memory...
             ^                        ~~~~~~~~~~~~~~~~

../lib/eal/include/rte_stdatomic.h:71:2:
note: expanded from macro 'rte_atomic_load_explicit'
        atomic_load_explicit(ptr, memorder)
        ^                    ~~~

/usr/lib/llvm-14/lib/clang/14.0.0/include/stdatomic.h:130:30:
note: expanded from macro 'atomic_load_explicit'
#define atomic_load_explicit __c11_atomic_load
                             ^

[2]
CC=clang meson -Denable_stdatomic=true build

$ clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
  
Ferruh Yigit Oct. 26, 2023, 2:55 p.m. UTC | #2
On 10/26/2023 7:42 AM, Chaoyong He wrote:
> This patch series aims to add the NFP vDPA PMD, we also grab the common
> logic into the `drivers/common/nfp` directory.
> 
> ---
> v3:
> * Replace 'pthread_xxx' API with 'rte_thread_xxx' API.
> * Replace '__atomic_xxx' built-ins with 'rte_atomic_xxx'.
> * Drop the check statement in meson.build file which prevent build of
>   PMD.
> * Fix a problem about the logtype prefix.
> * Move the document modification to the commit which should be.
> v2:
> * Grab more logic into the `drivers/common/nfp` directory.
> * Delete some logic which should be when moving logic.
> ---
> 
> Chaoyong He (25):
>   drivers: introduce the NFP common library
>   net/nfp: make VF PMD using of NFP common module
>   net/nfp: rename common module name
>   net/nfp: rename ctrl module name
>   net/nfp: extract the cap data field
>   net/nfp: extract the qcp data field
>   net/nfp: extract the ctrl BAR data field
>   net/nfp: extract the ctrl data field
>   net/nfp: change the parameter of APIs
>   net/nfp: change the parameter of reconfig
>   net/nfp: extract the MAC address data field
>   net/nfp: rename parameter in related logic
>   drivers: add the common ctrl module
>   drivers: add the nfp common module
>   drivers: move queue logic to common module
>   drivers: move platform module to common library
>   drivers: move device module to common library
>   drivers/vdpa: introduce the NFP vDPA library
>   drivers: add the basic framework of vDPA PMD
>   vdpa/nfp: add the logic of remap PCI memory
>   vdpa/nfp: add the hardware init logic
>   drivers: add the datapath update logic
>   vdpa/nfp: add the notify related logic
>   vdpa/nfp: add nfp vDPA device operations
>   doc: add a entry in the release notes
> 

I was about the merge this patch but recognized the build error, and I
assume there will be new version,
for new version can you please look following as patch subject suggestions:

 vdpa/nfp: add device operations
 vdpa/nfp: add notify related logic
 vdpa/nfp: add datapath update
 vdpa/nfp: add hardware init
 vdpa/nfp: add remap PCI memory
 vdpa/nfp: add basic framework
 vdpa/nfp: introduce driver
 common/nfp: move device module
 common/nfp: move platform module
 common/nfp: move queue logic
 common/nfp: add common module
 common/nfp: add common ctrl module
 net/nfp: rename parameter in related logic
 net/nfp: extract MAC address data field
 net/nfp: change parameter of reconfig
 net/nfp: change parameter of functions
 net/nfp: extract ctrl data field
 net/nfp: extract ctrl BAR data field
 net/nfp: extract qcp data field
 net/nfp: extract cap data field
 net/nfp: rename ctrl module
 net/nfp: rename net common module
 net/nfp: make VF PMD use NFP common driver
 common/nfp: introduce driver


I am aware some will generate checkpatch warning 'Wrong headline
prefix', that happens when patch has mixture of different modules, I
think better to have the warning than using 'driver: '.
  
Chaoyong He Oct. 27, 2023, 1:23 a.m. UTC | #3
> On 10/26/2023 7:42 AM, Chaoyong He wrote:
> > This patch series aims to add the NFP vDPA PMD, we also grab the
> > common logic into the `drivers/common/nfp` directory.
> >
> > ---
> > v3:
> > * Replace 'pthread_xxx' API with 'rte_thread_xxx' API.
> > * Replace '__atomic_xxx' built-ins with 'rte_atomic_xxx'.
> > * Drop the check statement in meson.build file which prevent build of
> >   PMD.
> > * Fix a problem about the logtype prefix.
> > * Move the document modification to the commit which should be.
> > v2:
> > * Grab more logic into the `drivers/common/nfp` directory.
> > * Delete some logic which should be when moving logic.
> > ---
> >
> > Chaoyong He (25):
> >   drivers: introduce the NFP common library
> >   net/nfp: make VF PMD using of NFP common module
> >   net/nfp: rename common module name
> >   net/nfp: rename ctrl module name
> >   net/nfp: extract the cap data field
> >   net/nfp: extract the qcp data field
> >   net/nfp: extract the ctrl BAR data field
> >   net/nfp: extract the ctrl data field
> >   net/nfp: change the parameter of APIs
> >   net/nfp: change the parameter of reconfig
> >   net/nfp: extract the MAC address data field
> >   net/nfp: rename parameter in related logic
> >   drivers: add the common ctrl module
> >   drivers: add the nfp common module
> >   drivers: move queue logic to common module
> >   drivers: move platform module to common library
> >   drivers: move device module to common library
> >   drivers/vdpa: introduce the NFP vDPA library
> >   drivers: add the basic framework of vDPA PMD
> >   vdpa/nfp: add the logic of remap PCI memory
> >   vdpa/nfp: add the hardware init logic
> >   drivers: add the datapath update logic
> >   vdpa/nfp: add the notify related logic
> >   vdpa/nfp: add nfp vDPA device operations
> >   doc: add a entry in the release notes
> >
> 
> I was about the merge this patch but recognized the build error, and I assume
> there will be new version, for new version can you please look following as
> patch subject suggestions:
> 
>  vdpa/nfp: add device operations
>  vdpa/nfp: add notify related logic
>  vdpa/nfp: add datapath update
>  vdpa/nfp: add hardware init
>  vdpa/nfp: add remap PCI memory
>  vdpa/nfp: add basic framework
>  vdpa/nfp: introduce driver
>  common/nfp: move device module
>  common/nfp: move platform module
>  common/nfp: move queue logic
>  common/nfp: add common module
>  common/nfp: add common ctrl module
>  net/nfp: rename parameter in related logic
>  net/nfp: extract MAC address data field
>  net/nfp: change parameter of reconfig
>  net/nfp: change parameter of functions
>  net/nfp: extract ctrl data field
>  net/nfp: extract ctrl BAR data field
>  net/nfp: extract qcp data field
>  net/nfp: extract cap data field
>  net/nfp: rename ctrl module
>  net/nfp: rename net common module
>  net/nfp: make VF PMD use NFP common driver
>  common/nfp: introduce driver
> 
> 
> I am aware some will generate checkpatch warning 'Wrong headline prefix',
> that happens when patch has mixture of different modules, I think better to
> have the warning than using 'driver: '.

Okay, got it. Thanks.