Commit Graph

8 Commits

Author SHA1 Message Date
paul luse
a6dbe3721e update Intel copyright notices
per Intel policy to include file commit date using git cmd
below.  The policy does not apply to non-Intel (C) notices.

git log --follow -C90% --format=%ad --date default <file> | tail -1

and then pull just the 4 digit year from the result.

Intel copyrights were not added to files where Intel either had
no contribution ot the contribution lacked substance (ie license
header updates, formatting changes, etc).  Contribution date used
"--follow -C95%" to get the most accurate date.

Note that several files in this patch didn't end the license/(c)
block with a blank comment line so these were added as the vast
majority of files do have this last blank line.  Simply there for
consistency.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Id5b7ce4f658fe87132f14139ead58d6e285c04d4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2022-11-10 08:28:53 +00:00
Tomasz Zawadzki
c34f15e09c env_dpdk: keep DPDK 20.11 compatiblity
Patch below added copies of pci realted headers to keep
compatiblity with <= DPDK 22.07.
(1eb35ac) env_dpdk: add copies of 22.07 pci-related header files

Unfortunetly the rte_bus/bus_pci/dev headers from DPDK 22.07 are
not compatibile going back to DPDK 20.11.

The issues are:
- lack of RTE_TAILQ_ENTRY defined in rte_os.h
- rte_intr_handle being part of rte_pci_device rather than pointer

pci_dpdk_2207.c even before this patch is not binary compatible with
DPDK 20.11 - see pci_device_*_interrupt_2207() functions.
There would need to be another copy of headers matching that version
of DPDK to resolve this issue.

SPDK supports up to two latest LTS releases. Which right now includes
DPDK 20.11, but soon will be dropped due to DPDK 22.11 release.

Having compile time defines here, keeps the older DPDK working.
Meanwhile backwards compatiblity in SPDK is no worse than before.
The recent changes to env_dpdk, are aiming to improve support
with newer versions of DPDK.

Change-Id: If4dc601cb03e18c2cad61f3a93080e8265ca5fcc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14795
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-30 15:56:33 +00:00
Jim Harris
c7f5010984 env_dpdk: add dpdk_pci_device_get_mem_resource
This allows eliminating dpdk_pci_device_vtophys and
dpdk_pci_device_map_bar, reducing the amount of
code we need to maintain in the per-DPDK version
implementations.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I73d15eb75bf7fe8340d85494425e15651fec5425
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14722
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 15:32:24 +00:00
Jim Harris
5be703ef35 env_dpdk: break up dpdk_pci_device_copy_identifiers
Break this function up into three APIs instead:

* dpdk_pci_device_get_addr
* dpdk_pci_device_get_id
* dpdk_pci_device_get_numa_node

This more clearly delineates the requirements we
have from the DPDK PCI device/driver APIs.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie585c8252d63c15c6e6884d60f8a064c3f0ab94f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14684
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 15:32:24 +00:00
Ben Walker
a36bc251df env_dpdk: Automatically map PCI BARs into VFIO
By doing the registration immediately upon mapping the BAR instead of
when the memory is inserted into the spdk_mem_map, we're able to
register BARs that are not 2MB multiples in size and alignment. The SPDK
API for registering a BAR already returns the physical/io address in the
map call, and it can be used directly without a call to
spdk_mem_register().

If the user does elect to later register the BAR using
spdk_mem_register(), we attempt to insert the 2MB aligned segments we
can into the spdk_mem_map. Users may still need to register memory for a
few reasons, such as making spdk_vtophys() work, or for setting up the
BAR as a target for RDMA. These cases still require 2MB aligned and
sized segments.

Change-Id: I395ae8803ec4bf22703f6f76db54200949e82532
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14017
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
2022-09-26 11:48:39 +00:00
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
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