Commit Graph

4 Commits

Author SHA1 Message Date
Jim Harris
936726f847 env_dpdk: add dpdk_pci_init()
This checks the current version to make sure we have
a dpdk_fn_table that supports it.

This is easy for now, since the DPDK PCI API is
public.  Moving forward, DPDK 22.11 will likely make
these APIs private, requiring us to carry header file
copies for different DPDK versions so that we can
not only build against DPDK but also use the correct
data strucures and APIs to interact with those private
DPDK interfaces.  We will also need to consider
minor (i.e. stable or point) releases since they
could technically change PCI ABI as well - the current
year + month checks won't be sufficient.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic9f41d9d13778f3d078b20b08da48d8d16362b11
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14637
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-23 08:01:01 +00:00
Jim Harris
a25a834ae1 env_dpdk: move <=22.07 specific code to pci_dpdk_2207.c
Get ready to have multiple implementations of the
dpdk_fn_table.  We could do some fancy self-registering
constructor functions, but let's just keep it simple
for now and extern declare each implementation in
the pci_dpdk.h header file.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8f5621412d1c8bd22c95ab74ef66c5bcc41d1380
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14636
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-23 08:01:01 +00:00
Jim Harris
53cd692b95 env_dpdk: add struct dpdk_fn_table
This is the next step in supporting multiple DPDK
PCI device/driver ABIs once those APIs are no longer
public and subject to ABI versioning rules.

This patch does the following:
1) introduce dpdk_fn_table
2) rename the existing dpdk_xx functions to xx_2207,
   to denote these functions are valid for DPDK versions
   up to and including 22.07
3) create a dpdk_fn_table pointing to the xx_2207
   functions
4) create a global dpdk_fn_table pointer that points
   directly to the 2207 fn_table
5) create new dpdk_xx functions that just redirect
   to the associated dpdk_fn_table function pointer

Future patches will add the machinery to register
multiple function tables and pick the one to use at
run time based on rte_version() calls.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1171fbdb4f72ff117416ac1fb282ff6f9fa5cadf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14634
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-23 08:01:01 +00:00
Jim Harris
11313c2090 env_dpdk: move dpdk pci code to pci_dpdk.c/h
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I54489903f48a8a2e500f64c2e7f8530eed1e6882
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14548
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-22 12:38:25 +00:00