Removal of PCI bus ABIs
Subsystems (9)
cover Removal of PCI bus ABIs
As announced in the deprecation notice, most ABIs in PCI bus will be removed.
As there exist some applications that want to access PCI memory resource, two new APIs are defined in Patch 1 and corresponding changes are applied to testpmd in Patch 2.
Patch 3-4 clean up the unnecessary usage of PCI bus header in examples.
Patch 5-7 clean up the unused PCI related structure in kni library and related tests and examples.
Patch 8 finally removes most of ABIs in PCI bus.
Chenbo Xia (8):
bus/pci: add new memory resource access APIs app/testpmd: use PCI memory resource access APIs examples/ethtool: use PCI library API to get PCI address examples/kni: remove unused PCI bus header test/kni: remove setting of PCI ID and address examples/ip_pipeline: remove setting of PCI ID and address
kni: replace unused variable definition with reserved bytes bus/pci: remove ABIs in PCI bus
app/test-pmd/config.c | 38 +- app/test-pmd/testpmd.h | 46 +- app/test/test_kni.c | 57 --- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 7 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common.c | 78 ++++ drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 387 ++--------------- drivers/bus/pci/version.map | 28 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- examples/ethtool/lib/rte_ethtool.c | 14 +- examples/ethtool/meson.build | 2 +- examples/ip_pipeline/kni.c | 16 - examples/kni/main.c | 1 - lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- lib/kni/rte_kni.h | 4 +- 135 files changed, 699 insertions(+), 624 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
Signature · 1 line
2.17.1
PATCH 1/8 bus/pci: add new memory resource access APIs
Some applications wants to access PCI memory resource. Currently applications use struct rte_pci_device to access it. Since the structure will be made internal later, this patch adds two APIs for memory resource access.
--- doc/guides/rel_notes/release_21_11.rst | 5 ++ drivers/bus/pci/pci_common.c | 78 ++++++++++++++++++++++++++ drivers/bus/pci/rte_bus_pci.h | 36 ++++++++++++ drivers/bus/pci/version.map | 4 ++ 4 files changed, 123 insertions(+)
doc/guides/rel_notes/release_21_11.rst +5 -0
@@ -62,6 +62,11 @@ New Features * Added bus-level parsing of the devargs syntax. * Kept compatibility with the legacy syntax as parsing fallback. +* **Added new memory resource read/write APIs in PCI bus.** + + Added new memory resource read/write APIs ``rte_pci_mem_rd32`` and + ``rte_pci_mem_wr32`` for applications to read/write PCI memory + resource. Removed Items -------------
drivers/bus/pci/pci_common.c +78 -0
90 lines not on this page · raw message
drivers/bus/pci/rte_bus_pci.h +36 -0
@@ -392,6 +392,42 @@ void rte_pci_ioport_read(struct rte_pci_ioport *p,void rte_pci_ioport_write (struct rte_pci_ioport *p,const void *data,size_t len,off_t offset); +/** +* Read 4 bytes from PCI memory resource. +* +* @param name +* PCI device name (e.g., 0000:18:00.0). +* @param idx +* Memory resource index. +* @param data +* Data buffer where the bytes should be read into. +* @param offset +* The offset into the PCI memory resource. +* @return +* 0 on success, negative value on error. +*/ +__rte_experimental +int +rte_pci_mem_rd32 (const char *name,uint16_t idx,uint32_t *data,uint64_t offset); + +/** +* Write 4 bytes to PCI memory resource. +* +* @param name +* PCI device name (e.g., 0000:18:00.0). +* @param idx +* Memory resource index. +* @param data +* Buffer of data that should be written to PCI memory. +* @param offset +* The offset into the PCI memory resource. +* @return +* 0 on success, negative value on error. +*/ +__rte_experimental +int +rte_pci_mem_wr32 (const char *name,uint16_t idx,const uint32_t *data,uint64_t offset); + #ifdef __cplusplus }#endif
drivers/bus/pci/version.map +4 -0
@@ -24,4 +24,8 @@ EXPERIMENTAL { # added in 21.08 rte_pci_set_bus_master; + + # added in 21.11 + rte_pci_mem_rd32; + rte_pci_mem_wr32; };
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 1/8] bus/pci: add new memory resource access APIs
Quoted 5 lines · Chenbo Xia
Some applications wants to access PCI memory resource. Currently applications use struct
rte_pci_deviceto access it. Since the structure will be made internal later, this patch adds two APIs for memory resource access.
Quoted 8 lines
Signed-off-by Chenbo Xia <[email protected]>--- doc/guides/rel_notes/release_21_11.rst | 5 ++ drivers/bus/pci/pci_common.c | 78 ++++++++++++++++++++++++++ drivers/bus/pci/rte_bus_pci.h | 36 ++++++++++++ drivers/bus/pci/version.map | 4 ++ 4 files changed, 123 insertions(+)
PATCH 2/8 app/testpmd: use PCI memory resource access APIs
In reply to Chenbo XiaCurrently testpmd uses struct rte_pci_device to access PCI memory resource. Since this structure will be internal later, this patch replaces use of rte_pci_device with new PCI memory resource access APIs to read/write BAR 0.
--- app/test-pmd/config.c | 38 +++++++++++----------------------- app/test-pmd/testpmd.h | 46 +++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 49 deletions(-)
app/test-pmd/config.c +12 -26
@@ -950,10 +950,6 @@ vlan_id_is_invalid(uint16_t vlan_id)static int port_reg_off_is_invalid (portid_t port_id,uint32_t reg_off) { -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus; -uint64_t pci_len; -if (reg_off &0x3 ) { fprintf(stderr, "Port register offset 0x%X not aligned on a 4-byte boundary\n",
@@ -966,22 +962,6 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off)return 0 ; } - bus =rte_bus_find_by_device (ports[port_id].dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (ports[port_id].dev_info.device); - }else { -fprintf (stderr,"Not a PCI device\n" ); -return 1 ; - } - - pci_len = pci_dev->mem_resource[0 ].len; -if (reg_off >= pci_len) { -fprintf (stderr, -"Port %d: register offset %u (0x%X) out of port PCI resource (length=%" PRIu64")\n" , - port_id, (unsigned int )reg_off, (unsigned int )reg_off, - pci_len); -return 1 ; - }return 0 ; }
@@ -1009,14 +989,14 @@ port_reg_bit_display(portid_t port_id, uint32_t reg_off, uint8_t bit_x) {uint32_t reg_v; -if (port_id_is_invalid (port_id,ENABLED_WARN ))return ;if (port_reg_off_is_invalid (port_id, reg_off))return ;if (reg_bit_pos_is_invalid (bit_x))return ; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ;display_port_and_reg_off (port_id, (unsigned )reg_off);printf ("bit %d=%d\n" , bit_x, (int ) ((reg_v & (1 << bit_x)) >> bit_x)); }
@@ -1042,7 +1022,8 @@ port_reg_bit_field_display(portid_t port_id, uint32_t reg_off,else l_bit = bit1_pos, h_bit = bit2_pos; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; reg_v >>= l_bit;if (h_bit <31 ) reg_v &= ((1 << (h_bit - l_bit +1 )) -1 );
@@ -1060,7 +1041,8 @@ port_reg_display(portid_t port_id, uint32_t reg_off)return ;if (port_reg_off_is_invalid (port_id, reg_off))return ; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ;display_port_reg_value (port_id, reg_off, reg_v); }
@@ -1081,7 +1063,9 @@ port_reg_bit_set(portid_t port_id, uint32_t reg_off, uint8_t bit_pos, (int) bit_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; +if (bit_v ==0 ) reg_v &= ~(1 << bit_pos);else
@@ -1123,7 +1107,9 @@ port_reg_bit_field_set(portid_t port_id, uint32_t reg_off, (unsigned)max_v, (unsigned)max_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; + reg_v &= ~(max_v << l_bit);/* Keep unchanged bits */ reg_v |= (value << l_bit);/* Set changed bits */ port_id_pci_reg_write (port_id, reg_off, reg_v);
app/test-pmd/testpmd.h +23 -23
83 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 2/8] app/testpmd: use PCI memory resource access APIs
Hi
Quoted 17 lines
-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Friday, September 10, 2021 10:24
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>
Subject: [PATCH 2/8] app/testpmd: use PCI memory resource access APIsCurrently testpmd uses struct
rte_pci_deviceto access PCI memory resource. Since this structure will be internal later, this patch replaces use ofrte_pci_devicewith new PCI memory resource access APIs to read/write BAR 0.Signed-off-by Chenbo Xia <[email protected]>--- app/test-pmd/config.c | 38 +++++++++++----------------------- app/test-pmd/testpmd.h | 46 +++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 49 deletions(-)
<snip>
Quoted 24 lines
app/test-pmd/config.c +3
-1@@ -1081,7 +1063,9 @@ port_reg_bit_set(portid_t port_id, uint32_t reg_off,uint8_t bit_pos, (int) bit_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; +if (bit_v ==0 ) reg_v &= ~(1 << bit_pos);app/test-pmd/config.c +3
-1else @@ -1123,7 +1107,9 @@ port_reg_bit_field_set(portid_t port_id, uint32_t reg_off, (unsigned)max_v, (unsigned)max_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; + reg_v &= ~(max_v << l_bit);/* Keep unchanged bits */ reg_v |= (value << l_bit);/* Set changed bits */
Quoted 1 line
port_id_pci_reg_write(port_id, reg_off, reg_v); diff --git a/app/test-
In your implementation, port_id_pci_reg_write() can fail. Then the following display shouldn't be called. So change this function to have return value and check it before use it will be better.
Quoted 4 lines
pmd/testpmd.hb/app/test-pmd/testpmd.hindex16a3598e48..7922807a6e100644app/test-pmd/testpmd.h +0
-0
<snip>
Quoted 41 lines
static inline void
app/test-pmd/testpmd.h +9
-9-port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) +port_id_pci_reg_write(portid_t pt_id, uint32_t reg_off, uint32_t reg_v) { -const struct rte_pci_device *pci_dev; + struct rte_port *port = &ports[(pt_id)]; +char name[RTE_ETH_NAME_MAX_LEN ];const struct rte_bus *bus; -void *reg_addr;if (!port->dev_info.device) {fprintf (stderr,"Invalid device\n" );@@ -721,19 +721,19 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) bus =rte_bus_find_by_device (port->dev_info.device);if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); +rte_eth_dev_get_name_by_port (pt_id, name); }else {fprintf (stderr,"Not a PCI device\n" );return ; } - reg_addr = ((char *)pci_dev->mem_resource[0 ].addr + reg_off); - *((volatile uint32_t *)reg_addr) =rte_cpu_to_le_32 (reg_v); + reg_v =rte_cpu_to_le_32 (reg_v); +if (rte_pci_mem_wr32 (name,0 , ®_v, reg_off)) { +fprintf (stderr,"Failed to write register\n" ); +return ; + } } -#define port_id_pci_reg_write (pt_id, reg_off, reg_value) \ - port_pci_reg_write(&ports[(pt_id)], (reg_off), (reg_value)) -static inline void get_start_cycles (uint64_t *start_tsc){
--
2.17.1
Re: [dpdk-dev] [PATCH 2/8] app/testpmd: use PCI memory resource access APIs
Hi,
Quoted 48 lines
-----Original Message-----
From: Li, Xiaoyun <[email protected]>
Sent: Thursday, September 16, 2021 2:10 PM
To: Xia, Chenbo <[email protected]>; [email protected]
Subject: RE: [PATCH 2/8] app/testpmd: use PCI memory resource access APIsHi
Quoted 17 lines
-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Friday, September 10, 2021 10:24
To: [email protected]
Cc: Li, Xiaoyun <[email protected]>
Subject: [PATCH 2/8] app/testpmd: use PCI memory resource access APIsCurrently testpmd uses struct
rte_pci_deviceto access PCI memory resource. Since this structure will be internal later, this patch replaces use ofrte_pci_devicewith new PCI memory resource access APIs to read/write BAR 0.Signed-off-by Chenbo Xia <[email protected]>--- app/test-pmd/config.c | 38 +++++++++++----------------------- app/test-pmd/testpmd.h | 46 +++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 49 deletions(-)<snip>
Quoted 22 lines
app/test-pmd/config.c +3
-1@@ -1081,7 +1063,9 @@ port_reg_bit_set(portid_t port_id, uint32_t reg_off,uint8_t bit_pos, (int) bit_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; +if (bit_v ==0 ) reg_v &= ~(1 << bit_pos);app/test-pmd/config.c +3
-1else @@ -1123,7 +1107,9 @@ port_reg_bit_field_set(portid_t port_id, uint32_t reg_off, (unsigned)max_v, (unsigned)max_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; +
Quoted 8 lines
Quoted 3 lines
app/test-pmd/config.c +0
-0reg_v &= ~(max_v << l_bit);/* Keep unchanged bits */ reg_v |= (value << l_bit);/* Set changed bits */
port_id_pci_reg_write(port_id, reg_off, reg_v); diff --git a/app/test-In your implementation,
port_id_pci_reg_write()can fail. Then the following display shouldn't be called.
So change this function to have return value and check it before use it will be better.
Make sense. Will fix in v2.
Thanks,
Chenbo
Quoted 47 lines
Quoted 5 lines
pmd/testpmd.hb/app/test-pmd/testpmd.hindex16a3598e48..7922807a6e100644app/test-pmd/testpmd.h +0
-0<snip>
Quoted 41 lines
static inline void
app/test-pmd/testpmd.h +9
-9-port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) +port_id_pci_reg_write(portid_t pt_id, uint32_t reg_off, uint32_t reg_v) { -const struct rte_pci_device *pci_dev; + struct rte_port *port = &ports[(pt_id)]; +char name[RTE_ETH_NAME_MAX_LEN ];const struct rte_bus *bus; -void *reg_addr;if (!port->dev_info.device) {fprintf (stderr,"Invalid device\n" );@@ -721,19 +721,19 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) bus =rte_bus_find_by_device (port->dev_info.device);if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); +rte_eth_dev_get_name_by_port (pt_id, name); }else {fprintf (stderr,"Not a PCI device\n" );return ; } - reg_addr = ((char *)pci_dev->mem_resource[0 ].addr + reg_off); - *((volatile uint32_t *)reg_addr) =rte_cpu_to_le_32 (reg_v); + reg_v =rte_cpu_to_le_32 (reg_v); +if (rte_pci_mem_wr32 (name,0 , ®_v, reg_off)) { +fprintf (stderr,"Failed to write register\n" ); +return ; + } } -#define port_id_pci_reg_write (pt_id, reg_off, reg_value) \ - port_pci_reg_write(&ports[(pt_id)], (reg_off), (reg_value)) -static inline void get_start_cycles (uint64_t *start_tsc){
--
2.17.1
PATCH 3/8 examples/ethtool: use PCI library API to get PCI address
In reply to Chenbo XiaCurrently ethtool example uses struct rte_pci_device to know PCI address of a device. As this API will be removed later in PCI bus, this patch uses PCI library API to get the PCI address.
--- examples/ethtool/lib/rte_ethtool.c | 14 +++++++++----- examples/ethtool/meson.build | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-)
examples/ethtool/lib/rte_ethtool.c +9 -5
@@ -8,7 +8,7 @@#include <rte_version.h> #include <rte_ethdev.h> #include <rte_ether.h> -#include <rte_bus_pci.h> +#include <rte_pci.h> #ifdef RTE_NET_IXGBE #include <rte_pmd_ixgbe.h> #endif
@@ -23,8 +23,9 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) {struct rte_eth_dev_info dev_info;struct rte_dev_reg_info reg_info; -const struct rte_pci_device *pci_dev;const struct rte_bus *bus =NULL ; +char name[RTE_ETH_NAME_MAX_LEN ]; +struct rte_pci_addr addr;int n;int ret;
@@ -56,11 +57,14 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)if (dev_info.device) bus =rte_bus_find_by_device (dev_info.device);if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); +rte_eth_dev_get_name_by_port (port_id, name); +if (rte_pci_addr_parse (name, &addr)) { +printf ("Failed to parse pci address\n" ); +return -1 ; + }snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info),"%04x:%02x:%02x.%x" , - pci_dev->addr.domain, pci_dev->addr.bus, - pci_dev->addr.devid, pci_dev->addr.function); + addr.domain, addr.bus, addr.devid, addr.function); }else {snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info),"N/A" ); }
examples/ethtool/meson.build +1 -1
@@ -18,7 +18,7 @@ sources = files( ) includes = include_directories('lib', 'ethtool-app') -deps += 'bus_pci' +deps += 'pci' if dpdk_conf.has('RTE_NET_IXGBE') deps += 'net_ixgbe' endif
Signature · 1 line
2.17.1
PATCH 4/8 examples/kni: remove unused PCI bus header
In reply to Chenbo XiaThe header rte_bus_pci.h is included in kni example but nothing in it is used. So remove it.
--- examples/kni/main.c | 1 - 1 file changed, 1 deletion(-)
examples/kni/main.c +0 -1
@@ -31,7 +31,6 @@#include <rte_lcore.h> #include <rte_branch_prediction.h> #include <rte_interrupts.h> -#include <rte_bus_pci.h> #include <rte_debug.h> #include <rte_ether.h> #include <rte_ethdev.h>
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 4/8] examples/kni: remove unused PCI bus header
Quoted 4 lines · Chenbo Xia
The header
rte_bus_pci.his included in kni example but nothing in it is used. So remove it.Signed-off-by Chenbo Xia <[email protected]>
PATCH 5/8 test/kni: remove setting of PCI ID and address
In reply to Chenbo XiaPCI device id and address in structure rte_kni_conf are never used in the test and kni library. So remove the related code.
--- app/test/test_kni.c | 57 --------------------------------------------- 1 file changed, 57 deletions(-)
app/test/test_kni.c +0 -57
@@ -25,7 +25,6 @@ test_kni(void)#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_cycles.h> #include <rte_kni.h>
@@ -424,32 +423,14 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)unsigned i;struct rte_kni *kni;struct rte_kni_conf conf; -struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ;if (!mp)return -1 ;memset (&conf,0 ,sizeof (conf)); -memset (&info,0 ,sizeof (info));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); -return -1 ; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - }snprintf (conf.name,sizeof (conf.name),TEST_KNI_PORT );/* core id 1 configured for kernel thread */
@@ -543,10 +524,7 @@ test_kni(void)struct rte_kni *kni;struct rte_mempool *mp;struct rte_kni_conf conf; -struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus;FILE *fd;DIR *dir;char buf[16 ];
@@ -634,26 +612,9 @@ test_kni(void)fclose (fd);/* test of allocating KNI with NULL mempool pointer */ -memset (&info,0 ,sizeof (info));memset (&conf,0 ,sizeof (conf));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); -return -1 ; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
@@ -678,26 +639,8 @@ test_kni(void)/* test of allocating KNI without a name */ memset (&conf,0 ,sizeof (conf)); -memset (&info,0 ,sizeof (info));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); - ret =-1 ; - goto fail; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 5/8] test/kni: remove setting of PCI ID and address
Quoted 3 lines · Chenbo Xia
PCI device id and address in structure
rte_kni_confare never used in the test and kni library. So remove the related code.
This is probably a leftover after ethtool support removal. ea6b39b5b847 ("kni: remove ethtool support") ee3cac929ede ("kni: remove PCI related information")
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 5/8] test/kni: remove setting of PCI ID and address
In reply to Chenbo XiaQuoted 4 lines · Chenbo Xia
PCI device id and address in structure
rte_kni_confare never used in the test and kni library. So remove the related code.Signed-off-by Chenbo Xia <[email protected]>
When/If you merge, please feel free to keep the ack.
PATCH 6/8 examples/ip_pipeline: remove setting of PCI ID and address
In reply to Chenbo XiaPCI ID and address in structure rte_kni_conf are never used and will be removed in kni library. So remove the setting of them first in the example.
--- examples/ip_pipeline/kni.c | 16 ---------------- 1 file changed, 16 deletions(-)
examples/ip_pipeline/kni.c +0 -16
@@ -6,7 +6,6 @@#include <string.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_string_fns.h> #include "kni.h"
@@ -100,16 +99,12 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)struct kni *kni_create (const char *name,struct kni_params *params) { -struct rte_eth_dev_info dev_info;struct rte_kni_conf kni_conf;struct rte_kni_ops kni_ops;struct kni *kni;struct mempool *mempool;struct link *link;struct rte_kni *k; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ; -int ret;/* Check input params */ if ((name == NULL) ||
@@ -124,23 +119,12 @@ kni_create(const char *name, struct kni_params *params)return NULL ;/* Resource create */ - ret =rte_eth_dev_info_get (link->port_id, &dev_info); -if (ret !=0 ) -return NULL ; -memset (&kni_conf,0 ,sizeof (kni_conf));strlcpy (kni_conf.name, name,RTE_KNI_NAMESIZE ); kni_conf.force_bind = params->force_bind; kni_conf.core_id = params->thread_id; kni_conf.group_id = link->port_id; kni_conf.mbuf_size = mempool->buffer_size; -if (dev_info.device) - bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); - kni_conf.addr = pci_dev->addr; - kni_conf.id = pci_dev->id; - }memset (&kni_ops,0 ,sizeof (kni_ops)); kni_ops.port_id = link->port_id;
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address
Quoted 6 lines · Chenbo Xia
PCI ID and address in structure
rte_kni_confare never used and will be removed in kni library. So remove the setting of them first in the example.Signed-off-by Chenbo Xia <[email protected]>
(forgot to Cc: Ferruh in previous comment)
Ditto patch 5.
I would tag with a Fixes: on ethtool removal.
Plus, this is the same kind of cleanup wrt kni, you can squash those two patches together.
Too bad we do not have a deprecation notice.
lib/kni/rte_kni.h: struct rte_pci_addr addr; /* depreciated */ lib/kni/rte_kni.h: struct rte_pci_id id; /* depreciated */
Can we plan for this cleanup?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address
Hi David,
Quoted 15 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, September 10, 2021 3:18 PM
To: Xia, Chenbo <[email protected]>
Cc: dev <[email protected]>; Dumitrescu, Cristian <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and addressQuoted 5 lines · Chenbo Xia
PCI ID and address in structure
rte_kni_confare never used and will be removed in kni library. So remove the setting of them first in the example.
Quoted 8 lines
Quoted 1 line
Signed-off-by Chenbo Xia <[email protected]>(forgot to Cc: Ferruh in previous comment)
Ditto patch 5.I would tag with a Fixes: on ethtool removal.
Plus, this is the same kind of cleanup wrt kni, you can squash those two patches together.
OK. Will do.
Quoted 7 lines
Too bad we do not have a deprecation notice.
lib/kni/rte_kni.h: struct rte_pci_addr addr; /* depreciated */ lib/kni/rte_kni.h: struct rte_pci_id id; /* depreciated */Can we plan for this cleanup?
My bad. I did't notice this when I send the deprecation notice for PCI bus last release.
If we all agree, we can make this happen 22.11 (Or this release if tech-board agrees).
Thanks,
Chenbo
Quoted 4 lines
--
David Marchand
Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address
In reply to David MarchandHi David,
Quoted 15 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, September 10, 2021 3:18 PM
To: Xia, Chenbo <[email protected]>
Cc: dev <[email protected]>; Dumitrescu, Cristian <[email protected]>; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and addressQuoted 5 lines · Chenbo Xia
PCI ID and address in structure
rte_kni_confare never used and will be removed in kni library. So remove the setting of them first in the example.
Quoted 8 lines
Quoted 1 line
Signed-off-by Chenbo Xia <[email protected]>(forgot to Cc: Ferruh in previous comment)
Ditto patch 5.I would tag with a Fixes: on ethtool removal.
Plus, this is the same kind of cleanup wrt kni, you can squash those two patches together.
A question about squash patch 5 and 6, then how should I title the combined patch? Because there're both test change and example change. I'd like know your suggestion.
Thanks,
Chenbo
Quoted 11 lines
Too bad we do not have a deprecation notice.
lib/kni/rte_kni.h: struct rte_pci_addr addr; /* depreciated */ lib/kni/rte_kni.h: struct rte_pci_id id; /* depreciated */Can we plan for this cleanup?
--
David Marchand
Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address
Hi Chenbo,
Quoted 9 lines · Chenbo
Quoted 9 lines
Quoted 5 lines
PCI ID and address in structure
rte_kni_confare never used and will be removed in kni library. So remove the setting of them first in the example.Signed-off-by Chenbo Xia <[email protected]>(forgot to Cc: Ferruh in previous comment)
Ditto patch 5.
Quoted 8 lines
Quoted 3 lines
I would tag with a Fixes: on ethtool removal.
Plus, this is the same kind of cleanup wrt kni, you can squash those two patches together.A question about squash patch 5 and 6, then how should I title the combined patch? Because there're both test change and example change. I'd like know your suggestion.
Quoted 1 line
This is a cleanup on unused fields wrt KNI. "kni: remove unused PCI info from test and example" lgtm.
Ferruh, opinion?
And mark with:
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address
Quoted 21 lines · David Marchand
Hi Chenbo,
Quoted 9 lines · Chenbo
Quoted 9 lines
Quoted 5 lines
PCI ID and address in structure
rte_kni_confare never used and will be removed in kni library. So remove the setting of them first in the example.Signed-off-by Chenbo Xia <[email protected]>(forgot to Cc: Ferruh in previous comment)
Ditto patch 5.Quoted 8 lines
Quoted 3 lines
I would tag with a Fixes: on ethtool removal.
Plus, this is the same kind of cleanup wrt kni, you can squash those two patches together.A question about squash patch 5 and 6, then how should I title the combined patch? Because there're both test change and example change. I'd like know your suggestion.
Quoted 1 line
Quoted 5 lines
This is a cleanup on unused fields wrt KNI. "kni: remove unused PCI info from test and example" lgtm.
Ferruh, opinion?
Make sense to merge them and above suggestion looks good. Thanks.
Quoted 4 lines
And mark with:
Fixes ea6b39b5b847 ("kni: remove ethtool support")
PATCH 7/8 kni: replace unused variable definition with reserved bytes
In reply to Chenbo XiaPCI ID and address in structure rte_kni_conf are never used. And in order not to break ABI, replace these variables with reserved bytes.
--- lib/kni/rte_kni.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/kni/rte_kni.h +1 -3
@@ -17,7 +17,6 @@* and burst transmit packets to KNI interfaces. */ -#include <rte_pci.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h>
@@ -66,8 +65,7 @@ struct rte_kni_conf {uint32_t core_id;/* Core ID to bind kernel thread on */ uint16_t group_id;/* Group ID */ unsigned mbuf_size;/* mbuf size */ -struct rte_pci_addr addr;/* depreciated */ -struct rte_pci_id id;/* depreciated */ +uint8_t rsvd[20 ]; __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */
Signature · 1 line
2.17.1
PATCH 8/8 bus/pci: remove ABIs in PCI bus
In reply to Chenbo XiaAs announced in the deprecation note, most of ABIs in PCI bus are removed in this patch. Only the function rte_pci_dump is still ABI and experimental APIs are kept for future promotion.
This patch creates a new file named pci_driver.h and moves most of the content in original rte_bus_pci.h to it. After that, pci_driver.h is considered the interface for drivers and rte_bus_pci.h for applications. pci_driver.h is defined as driver_sdk_headers so that out-of-tree drivers can use it.
Then this patch replaces the including of rte_bus_pci.h with pci_driver.h in all related drivers.
--- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 375 +--------------- drivers/bus/pci/version.map | 32 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 126 files changed, 546 insertions(+), 508 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
app/test/virtual_pmd.c +1 -1
@@ -6,7 +6,7 @@#include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_memory.h>
doc/guides/rel_notes/release_21_11.rst +2 -0
@@ -112,6 +112,8 @@ ABI Changes Also, make sure to start the actual text at the margin. ======================================================= +* pci: Removed all ABIs defined in rte_bus_pci.h except the function + ``rte_pci_dump()``. Known Issues ------------
drivers/baseband/acc100/rte_acc100_pmd.c +1 -1
@@ -14,7 +14,7 @@#include <rte_branch_prediction.h> #include <rte_hexdump.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h> #endif
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/bus/pci/bsd/pci.c +0 -1
@@ -28,7 +28,6 @@#include <rte_interrupts.h> #include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_launch.h> #include <rte_memory.h>
drivers/bus/pci/linux/pci.c +0 -1
@@ -8,7 +8,6 @@#include <rte_log.h> #include <rte_bus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/pci/linux/pci_uio.c +0 -1
@@ -19,7 +19,6 @@#include <rte_string_fns.h> #include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/bus/pci/linux/pci_vfio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_eal_paging.h> #include <rte_malloc.h> #include <rte_vfio.h>
drivers/bus/pci/meson.build +4 -0
@@ -29,4 +29,8 @@ if is_windows includes += include_directories('windows') endif +driver_sdk_headers += files( + 'pci_driver.h', +) + deps += ['kvargs']
drivers/bus/pci/pci_common_uio.c +0 -1
@@ -11,7 +11,6 @@#include <rte_eal.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/bus/pci/pci_driver.h new file +402 -0
402 lines not on this page · raw message
drivers/bus/pci/pci_params.c +0 -1
@@ -3,7 +3,6 @@*/ #include <rte_bus.h> -#include <rte_bus_pci.h> #include <rte_dev.h> #include <rte_errno.h> #include <rte_kvargs.h>
drivers/bus/pci/private.h +2 -1
@@ -8,10 +8,11 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus_pci.h> #include <rte_os_shim.h> #include <rte_pci.h> +#include "pci_driver.h" +extern struct rte_pci_bus rte_pci_bus;struct rte_pci_driver ;
drivers/bus/pci/rte_bus_pci.h +2 -373
396 lines not on this page · raw message
drivers/bus/pci/version.map +17 -15
@@ -2,6 +2,22 @@ DPDK_22 { global: rte_pci_dump; + + local: *; +}; + +EXPERIMENTAL { + global: + + # added in 21.11 + rte_pci_mem_rd32; + rte_pci_mem_wr32; +}; + +INTERNAL { + global: + + rte_pci_find_ext_capability; rte_pci_get_sysfs_path; rte_pci_ioport_map; rte_pci_ioport_read;
@@ -10,22 +26,8 @@ DPDK_22 { rte_pci_map_device; rte_pci_read_config; rte_pci_register; + rte_pci_set_bus_master; rte_pci_unmap_device; rte_pci_unregister; rte_pci_write_config; - - local: *; -}; - -EXPERIMENTAL { - global: - - rte_pci_find_ext_capability; - - # added in 21.08 - rte_pci_set_bus_master; - - # added in 21.11 - rte_pci_mem_rd32; - rte_pci_mem_wr32; };
drivers/common/cnxk/roc_platform.h +1 -1
@@ -7,7 +7,7 @@#include <rte_alarm.h> #include <rte_bitmap.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/common/mlx5/linux/mlx5_common_verbs.c +1 -1
@@ -11,7 +11,7 @@#include <inttypes.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_auxiliary.h> #include "mlx5_common_utils.h"
drivers/common/mlx5/mlx5_common_pci.c +1 -1
@@ -9,7 +9,7 @@#include <rte_errno.h> #include <rte_class.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "mlx5_common_log.h" #include "mlx5_common_private.h"
drivers/common/octeontx2/otx2_dev.h +1 -1
@@ -5,7 +5,7 @@#ifndef _OTX2_DEV_H#define _OTX2_DEV_H -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "otx2_common.h" #include "otx2_irq.h"
drivers/common/octeontx2/otx2_sec_idev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_spinlock.h>
drivers/common/qat/qat_device.h +1 -1
@@ -4,7 +4,7 @@#ifndef _QAT_DEVICE_H_#define _QAT_DEVICE_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "qat_common.h" #include "qat_logs.h"
drivers/common/qat/qat_qp.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_memzone.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_prefetch.h>
drivers/common/sfc_efx/sfc_efx.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EFX_H_#define _SFC_EFX_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "efx.h" #include "efsys.h"
drivers/compress/mlx5/mlx5_compress.c +1 -1
@@ -5,7 +5,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_spinlock.h> #include <rte_comp.h> #include <rte_compressdev.h>
drivers/compress/octeontx/otx_zip.h +1 -1
@@ -7,7 +7,7 @@#include <unistd.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_comp.h> #include <rte_compressdev.h> #include <rte_compressdev_pmd.h>
drivers/compress/qat/qat_comp.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mbuf.h> #include <rte_hexdump.h> #include <rte_comp.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include <rte_memcpy.h> #include <rte_common.h>
drivers/crypto/ccp/ccp_dev.h +1 -1
@@ -10,7 +10,7 @@#include <stdint.h> #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_byteorder.h> #include <rte_io.h>
drivers/crypto/ccp/ccp_pci.h +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"#define PROC_MODULES "/proc/modules"
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn10k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn9k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/mlx5/mlx5_crypto.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_log.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memory.h> #include <mlx5_glue.h>
drivers/crypto/nitrox/nitrox_device.h +1 -1
@@ -5,7 +5,7 @@#ifndef _NITROX_DEVICE_H_#define _NITROX_DEVICE_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> struct nitrox_sym_device ;
drivers/crypto/octeontx/otx_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Cavium, Inc */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_cryptodev.h> #include <rte_cryptodev_pmd.h>
drivers/crypto/octeontx/otx_cryptodev_ops.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include <rte_cryptodev_pmd.h> #include <rte_eventdev.h>
drivers/crypto/octeontx2/otx2_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright (C) 2019 Marvell International Ltd. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/qat/qat_sym.c +1 -1
@@ -7,7 +7,7 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_crypto_sym.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include "qat_sym.h"
drivers/crypto/qat/qat_sym_pmd.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2015-2018 Intel Corporation */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_malloc.h>
drivers/crypto/virtio/virtio_cryptodev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_common.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include <rte_cryptodev_pmd.h> #include <rte_eal.h>
drivers/crypto/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <rte_eal_paging.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include "virtio_crypto.h"
drivers/event/dlb2/pf/dlb2_main.h +1 -1
@@ -9,7 +9,7 @@#include <rte_log.h> #include <rte_spinlock.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal_paging.h> #include "base/dlb2_hw_types.h"
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -25,7 +25,7 @@#include <rte_cycles.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eventdev.h> #include <eventdev_pmd.h> #include <eventdev_pmd_pci.h>
drivers/event/octeontx/ssovf_probe.c +1 -1
@@ -7,7 +7,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "octeontx_mbox.h" #include "ssovf_evdev.h"
drivers/event/octeontx/timvf_probe.c +1 -1
@@ -5,7 +5,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <octeontx_mbox.h>
drivers/event/octeontx2/otx2_evdev.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <eventdev_pmd_pci.h>
drivers/mempool/cnxk/cnxk_mempool.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_eal.h>
drivers/mempool/octeontx/octeontx_fpavf.c +1 -1
@@ -13,7 +13,7 @@#include <rte_atomic.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_malloc.h>
drivers/mempool/octeontx2/otx2_mempool.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_io.h>
drivers/mempool/octeontx2/otx2_mempool.h +1 -1
@@ -6,7 +6,7 @@#define __OTX2_MEMPOOL_H__#include <rte_bitmap.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_devargs.h> #include <rte_mempool.h>
drivers/mempool/octeontx2/otx2_mempool_irq.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <rte_common.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "otx2_common.h" #include "otx2_irq.h"
drivers/meson.build +4 -0
@@ -85,6 +85,7 @@ foreach subpath:subdirs name = drv sources = [] headers = [] + driver_sdk_headers = [] # public headers included by drivers objs = [] cflags = default_cflags includes = [include_directories(drv_path)]
@@ -150,6 +151,9 @@ foreach subpath:subdirs dpdk_extra_ldflags += pkgconfig_extra_libs install_headers(headers) + if get_option('enable_driver_sdk') + install_headers(driver_sdk_headers) + endif # generate pmdinfo sources by building a temporary # lib and then running pmdinfogen on the contents of
drivers/net/ark/ark_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <sys/stat.h> #include <dlfcn.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_kvargs.h>
drivers/net/avp/avp_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -16,7 +16,7 @@#include <rte_byteorder.h> #include <rte_spinlock.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_io.h> #include "bnx2x_osal.h"
drivers/net/bnxt/bnxt.h +1 -1
@@ -11,7 +11,7 @@#include <sys/queue.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <rte_memory.h> #include <rte_lcore.h>
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -4,7 +4,7 @@#include <rte_devargs.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_kvargs.h> #include "rte_eth_bond.h"
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -8,7 +8,7 @@#ifndef __T4_ADAPTER_H__#define __T4_ADAPTER_H__ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_io.h> #include <rte_rwlock.h>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_tailq.h>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_byteorder.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -18,7 +18,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memory.h> #include <rte_memcpy.h> #include <rte_memzone.h>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/igb_pf.c +1 -1
@@ -10,7 +10,7 @@#include <stdarg.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_interrupts.h> #include <rte_log.h> #include <rte_debug.h>
drivers/net/ena/ena_ethdev.h +1 -1
@@ -12,7 +12,7 @@#include <ethdev_pci.h> #include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_timer.h> #include <rte_dev.h> #include <rte_net.h>
drivers/net/enic/base/vnic_dev.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "enic_compat.h" #include "vnic_resource.h"
drivers/net/enic/enic_ethdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_dev.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_geneve.h>
drivers/net/enic/enic_main.c +1 -1
@@ -10,7 +10,7 @@#include <fcntl.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/enic/enic_vf_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <stdio.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <ethdev_driver.h>
drivers/net/hinic/base/hinic_pmd_hwdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_hash.h> #include <rte_jhash.h>
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "hinic_compat.h" #include "hinic_csr.h"
drivers/net/hinic/base/hinic_pmd_nicio.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "hinic_compat.h" #include "hinic_pmd_hwdev.h"
drivers/net/hinic/hinic_pmd_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_mbuf.h> #include <rte_malloc.h>
drivers/net/hns3/hns3_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> #include <rte_kvargs.h>
drivers/net/hns3/hns3_rxtx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2021 HiSilicon Limited. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_geneve.h>
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_eal.h> #include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -18,7 +18,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_memory.h>
drivers/net/i40e/i40e_vf_representor.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Intel Corporation. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/igc/igc_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_malloc.h>
drivers/net/ionic/ionic.h +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "ionic_dev.h" #include "ionic_if.h"
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <unistd.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_tm.c +1 -1
@@ -6,7 +6,7 @@#include <stdlib.h> #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_kvargs.h>
drivers/net/ixgbe/ixgbe_ethdev.h +1 -1
@@ -19,7 +19,7 @@#include <rte_time.h> #include <rte_hash.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -32,7 +32,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <ethdev_driver.h> #include <rte_ether.h>
drivers/net/mlx5/linux/mlx5_ethdev_os.c +1 -1
@@ -25,7 +25,7 @@#include <time.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -19,7 +19,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_auxiliary.h> #include <rte_common.h> #include <rte_kvargs.h>
drivers/net/mlx5/mlx5.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_kvargs.h> #include <rte_rwlock.h>
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <errno.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -13,7 +13,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal_paging.h>
drivers/net/netvsc/hn_vf.c +1 -1
@@ -21,7 +21,7 @@#include <rte_memory.h> #include <rte_bus_vmbus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_log.h> #include <rte_string_fns.h> #include <rte_alarm.h>
drivers/net/octeontx/base/octeontx_pkivf.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "../octeontx_logs.h" #include "octeontx_io.h"
drivers/net/octeontx/base/octeontx_pkovf.c +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_spinlock.h> #include "../octeontx_logs.h"
drivers/net/octeontx2/otx2_ethdev_irq.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include "otx2_ethdev.h"
drivers/net/qede/base/bcm_osal.h +1 -1
@@ -21,7 +21,7 @@#include <rte_ether.h> #include <rte_io.h> #include <rte_version.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> /* Forward declaration */ struct ecore_dev ;
drivers/net/sfc/sfc.h +1 -1
@@ -13,7 +13,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h>
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_ether.h>
drivers/net/sfc/sfc_sriov.c +1 -1
@@ -8,7 +8,7 @@*/ #include <rte_common.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "sfc.h" #include "sfc_log.h"
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -32,7 +32,7 @@#include <rte_malloc.h> #include <rte_random.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_kvargs.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -1
@@ -20,7 +20,7 @@#include <rte_ethdev_core.h> #include <rte_hash.h> #include <rte_hash_crc.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/txgbe/txgbe_flow.c +1 -1
@@ -4,7 +4,7 @@*/ #include <sys/queue.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/txgbe/txgbe_pf.c +1 -1
@@ -20,7 +20,7 @@#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "base/txgbe.h" #include "txgbe_ethdev.h"
drivers/net/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include "virtio.h"
drivers/net/virtio/virtio_pci_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_memory.h>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -19,7 +19,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/raw/cnxk_bphy/cnxk_bphy.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_eal.h>
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -3,7 +3,7 @@*/ #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/cnxk_bphy/cnxk_bphy_irq.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_pci.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/cnxk_bphy/cnxk_bphy_irq.h +1 -1
@@ -5,7 +5,7 @@#ifndef _CNXK_BPHY_IRQ_#define _CNXK_BPHY_IRQ_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_dev.h> #include <roc_api.h>
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_devargs.h> #include <rte_memcpy.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_kvargs.h> #include <rte_alarm.h> #include <rte_interrupts.h>
drivers/raw/ifpga/rte_pmd_ifpga.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> #include "rte_pmd_ifpga.h"
drivers/raw/ioat/idxd_pci.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_devargs.h>
drivers/raw/ioat/ioat_rawdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_cycles.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_string_fns.h> #include <rte_rawdev_pmd.h>
drivers/raw/ntb/ntb.c +1 -1
@@ -13,7 +13,7 @@#include <rte_log.h> #include <rte_pci.h> #include <rte_mbuf.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_memcpy.h> #include <rte_rawdev.h>
drivers/raw/ntb/ntb_hw_intel.c +1 -1
@@ -8,7 +8,7 @@#include <rte_io.h> #include <rte_eal.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c +1 -1
@@ -6,7 +6,7 @@#include <unistd.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_lcore.h>
drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c +1 -1
@@ -8,7 +8,7 @@#include <fcntl.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_mempool.h>
drivers/raw/octeontx2_ep/otx2_ep_rawdev.c +1 -1
@@ -5,7 +5,7 @@#include <unistd.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_mempool.h>
drivers/regex/mlx5/mlx5_regex.c +1 -1
@@ -9,7 +9,7 @@#include <rte_regexdev.h> #include <rte_regexdev_core.h> #include <rte_regexdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <mlx5_common.h> #include <mlx5_common_mr.h>
drivers/regex/mlx5/mlx5_regex_fastpath.c +1 -1
@@ -10,7 +10,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_pci.h> #include <rte_regexdev_driver.h> #include <rte_mbuf.h>
drivers/vdpa/ifc/base/ifcvf_osdep.h +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_log.h> #include <rte_io.h>
drivers/vdpa/ifc/ifcvf_vdpa.c +1 -1
@@ -14,7 +14,7 @@#include <rte_eal_paging.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_vhost.h> #include <rte_vdpa.h> #include <rte_vdpa_dev.h>
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
@@ -12,7 +12,7 @@#include <rte_log.h> #include <rte_errno.h> #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <mlx5_glue.h> #include <mlx5_common.h>
lib/ethdev/ethdev_pci.h +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_config.h> #include <ethdev_driver.h>
lib/eventdev/eventdev_pmd_pci.h +1 -1
@@ -24,7 +24,7 @@ extern "C" {#include <rte_eal.h> #include <rte_lcore.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "eventdev_pmd.h"
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus
Quoted 135 lines · Chenbo Xia
As announced in the deprecation note, most of ABIs in PCI bus are removed in this patch. Only the function
rte_pci_dumpis still ABI and experimental APIs are kept for future promotion.This patch creates a new file named
pci_driver.hand moves most of the content in originalrte_bus_pci.hto it. After that,pci_driver.his considered the interface for drivers andrte_bus_pci.hfor applications.pci_driver.his defined asdriver_sdk_headersso that out-of-tree drivers can use it.Then this patch replaces the including of
rte_bus_pci.hwithpci_driver.hin all related drivers.Signed-off-by Chenbo Xia <[email protected]>--- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 375 +--------------- drivers/bus/pci/version.map | 32 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +-
Quoted 9 lines
drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 126 files changed, 546 insertions(+), 508 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
Re: [dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus
In reply to Chenbo XiaQuoted 193 lines
-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Friday, September 10, 2021 10:24
To: [email protected]
Cc: Chautru, Nicolas <[email protected]>; Yigit, Ferruh <[email protected]>; Burakov, Anatoly <[email protected]>; Ray Kinsella <[email protected]>; Nithin Dabilpuram <[email protected]>; Kiran Kumar K <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Rao <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Viacheslav Ovsiienko <[email protected]>; Jerin Jacob <[email protected]>; Anoob Joseph <[email protected]>; Trahe, Fiona <[email protected]>; Griffin, John <[email protected]>; Jain, Deepak K <[email protected]>; Andrew Rybchenko <[email protected]>; Ashish Gupta <[email protected]>; Somalapuram Amaranath <[email protected]>; Ankur Dwivedi <[email protected]>; Tejasree Kondoj <[email protected]>; Nagadheeraj Rottela <[email protected]>; Srikanth Jampala <[email protected]>; Jay Zhou <[email protected]>; McDaniel, Timothy <[email protected]>; Pavan Nikhilesh <[email protected]>; Ashwin Sekhar T K <[email protected]>; Harman Kalra <[email protected]>; Shepard Siegel <[email protected]>; Ed Czeck <[email protected]>; John Miller <[email protected]>; Steven Webster <[email protected]>; Peters, Matt <[email protected]>; Rasesh Mody <[email protected]>; Shahed Shaikh <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Chas Williams <[email protected]>; Min Hu (Connor) <[email protected]>; Rahul Lakkireddy <[email protected]>; Wang, Haiyue <[email protected]>; Marcin Wojtas <[email protected]>; Michal Krawczyk <[email protected]>; Shai Brandes <[email protected]>; Evgeny Schemeilin <[email protected]>; Igor Chauskin <[email protected]>; Daley, John <[email protected]>; Hyong Youb Kim <[email protected]>; Ziyang Xuan <[email protected]>; Xiaoyun Wang <[email protected]>; Guoyang Zhou <[email protected]>; Yisen Zhuang <[email protected]>; Lijun Ou <[email protected]>; Xing, Beilei <[email protected]>; Andrew Boyer <[email protected]>; Xu, Rosen <[email protected]>; Stephen Hemminger <[email protected]>; Long Li <[email protected]>; Devendra Singh Rawat <[email protected]>; Maciej Czekaj <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Maxime Coquelin <[email protected]>; Yong Wang <[email protected]>; Jakub Palider <[email protected]>; Tomasz Duszynski <[email protected]>; Zhang, Tianfei <[email protected]>; Richardson, Bruce <[email protected]>; Li, Xiaoyun <[email protected]>; Wu, Jingjing <[email protected]>; Radha Mohan Chintakuntla <[email protected]>; Veerasenareddy Burru <[email protected]>; Ori Kam <[email protected]>; Wang, Xiao W <[email protected]>; Thomas Monjalon <[email protected]>
Subject: [PATCH 8/8] bus/pci: remove ABIs in PCI busAs announced in the deprecation note, most of ABIs in PCI bus are removed in this patch. Only the function
rte_pci_dumpis still ABI and experimental APIs are kept for future promotion.This patch creates a new file named
pci_driver.hand moves most of the content in originalrte_bus_pci.hto it. After that,pci_driver.his considered the interface for drivers andrte_bus_pci.hfor applications.pci_driver.his defined asdriver_sdk_headersso that out-of-tree drivers can use it.Then this patch replaces the including of
rte_bus_pci.hwithpci_driver.hin all related drivers.Signed-off-by Chenbo Xia <[email protected]>--- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 375 +--------------- drivers/bus/pci/version.map | 32 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +-
Quoted 9 lines
drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 126 files changed, 546 insertions(+), 508 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
v2 cover Removal of PCI bus ABIs
In reply to Chenbo XiaAs announced in the deprecation notice, most ABIs in PCI bus will be removed.
As there exist some applications that want to access PCI memory resource, two new APIs are defined in Patch 1 and corresponding changes are applied to testpmd in Patch 2.
Patch 3-4 clean up the unnecessary usage of PCI bus header in examples.
Patch 5-6 clean up the unused PCI related structure in kni library and related tests and examples.
Patch 7 finally removes most of ABIs in PCI bus.
---
v2:
- Add check on call of port_id_pci_reg_write (Xiaoyun)
- Combine two clean-up patches in test and example, and backport (David)
Chenbo Xia (7):
bus/pci: add new memory resource access APIs app/testpmd: use PCI memory resource access APIs examples/ethtool: use PCI library API to get PCI address examples/kni: remove unused PCI bus header
kni: remove unused PCI info from test and example
kni: replace unused variable definition with reserved bytes bus/pci: remove ABIs in PCI bus
app/test-pmd/config.c | 50 +-- app/test-pmd/testpmd.h | 54 +-- app/test/test_kni.c | 57 --- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 8 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common.c | 78 ++++ drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 387 ++--------------- drivers/bus/pci/version.map | 28 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- examples/ethtool/lib/rte_ethtool.c | 14 +- examples/ethtool/meson.build | 2 +- examples/ip_pipeline/kni.c | 16 - examples/kni/main.c | 1 - lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- lib/kni/rte_kni.h | 4 +- 135 files changed, 711 insertions(+), 633 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
Signature · 1 line
2.17.1
PATCH v2 1/7 bus/pci: add new memory resource access APIs
Some applications wants to access PCI memory resource. Currently applications use struct rte_pci_device to access it. Since the structure will be made internal later, this patch adds two APIs for memory resource access.
--- doc/guides/rel_notes/release_21_11.rst | 6 ++ drivers/bus/pci/pci_common.c | 78 ++++++++++++++++++++++++++ drivers/bus/pci/rte_bus_pci.h | 36 ++++++++++++ drivers/bus/pci/version.map | 4 ++ 4 files changed, 124 insertions(+)
doc/guides/rel_notes/release_21_11.rst +6 -0
@@ -55,6 +55,12 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* **Added new memory resource read/write APIs in PCI bus.** + + Added new memory resource read/write APIs ``rte_pci_mem_rd32`` and + ``rte_pci_mem_wr32`` for applications to read/write PCI memory + resource. + * **Enabled new devargs parser.** * Enabled devargs syntax
drivers/bus/pci/pci_common.c +78 -0
90 lines not on this page · raw message
drivers/bus/pci/rte_bus_pci.h +36 -0
@@ -392,6 +392,42 @@ void rte_pci_ioport_read(struct rte_pci_ioport *p,void rte_pci_ioport_write (struct rte_pci_ioport *p,const void *data,size_t len,off_t offset); +/** +* Read 4 bytes from PCI memory resource. +* +* @param name +* PCI device name (e.g., 0000:18:00.0). +* @param idx +* Memory resource index. +* @param data +* Data buffer where the bytes should be read into. +* @param offset +* The offset into the PCI memory resource. +* @return +* 0 on success, negative value on error. +*/ +__rte_experimental +int +rte_pci_mem_rd32 (const char *name,uint16_t idx,uint32_t *data,uint64_t offset); + +/** +* Write 4 bytes to PCI memory resource. +* +* @param name +* PCI device name (e.g., 0000:18:00.0). +* @param idx +* Memory resource index. +* @param data +* Buffer of data that should be written to PCI memory. +* @param offset +* The offset into the PCI memory resource. +* @return +* 0 on success, negative value on error. +*/ +__rte_experimental +int +rte_pci_mem_wr32 (const char *name,uint16_t idx,const uint32_t *data,uint64_t offset); + #ifdef __cplusplus }#endif
drivers/bus/pci/version.map +4 -0
@@ -24,4 +24,8 @@ EXPERIMENTAL { # added in 21.08 rte_pci_set_bus_master; + + # added in 21.11 + rte_pci_mem_rd32; + rte_pci_mem_wr32; };
Signature · 1 line
2.17.1
PATCH v2 2/7 app/testpmd: use PCI memory resource access APIs
In reply to Chenbo XiaCurrently testpmd uses struct rte_pci_device to access PCI memory resource. Since this structure will be internal later, this patch replaces use of rte_pci_device with new PCI memory resource access APIs to read/write BAR 0.
--- app/test-pmd/config.c | 50 ++++++++++++++------------------------ app/test-pmd/testpmd.h | 54 ++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 58 deletions(-)
app/test-pmd/config.c +18 -32
@@ -948,10 +948,6 @@ vlan_id_is_invalid(uint16_t vlan_id)static int port_reg_off_is_invalid (portid_t port_id,uint32_t reg_off) { -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus; -uint64_t pci_len; -if (reg_off &0x3 ) { fprintf(stderr, "Port register offset 0x%X not aligned on a 4-byte boundary\n",
@@ -964,22 +960,6 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off)return 0 ; } - bus =rte_bus_find_by_device (ports[port_id].dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (ports[port_id].dev_info.device); - }else { -fprintf (stderr,"Not a PCI device\n" ); -return 1 ; - } - - pci_len = pci_dev->mem_resource[0 ].len; -if (reg_off >= pci_len) { -fprintf (stderr, -"Port %d: register offset %u (0x%X) out of port PCI resource (length=%" PRIu64")\n" , - port_id, (unsigned int )reg_off, (unsigned int )reg_off, - pci_len); -return 1 ; - }return 0 ; }
@@ -1007,14 +987,14 @@ port_reg_bit_display(portid_t port_id, uint32_t reg_off, uint8_t bit_x) {uint32_t reg_v; -if (port_id_is_invalid (port_id,ENABLED_WARN ))return ;if (port_reg_off_is_invalid (port_id, reg_off))return ;if (reg_bit_pos_is_invalid (bit_x))return ; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ;display_port_and_reg_off (port_id, (unsigned )reg_off);printf ("bit %d=%d\n" , bit_x, (int ) ((reg_v & (1 << bit_x)) >> bit_x)); }
@@ -1040,7 +1020,8 @@ port_reg_bit_field_display(portid_t port_id, uint32_t reg_off,else l_bit = bit1_pos, h_bit = bit2_pos; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; reg_v >>= l_bit;if (h_bit <31 ) reg_v &= ((1 << (h_bit - l_bit +1 )) -1 );
@@ -1058,7 +1039,8 @@ port_reg_display(portid_t port_id, uint32_t reg_off)return ;if (port_reg_off_is_invalid (port_id, reg_off))return ; - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ;display_port_reg_value (port_id, reg_off, reg_v); }
@@ -1079,13 +1061,15 @@ port_reg_bit_set(portid_t port_id, uint32_t reg_off, uint8_t bit_pos, (int) bit_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; +if (bit_v ==0 ) reg_v &= ~(1 << bit_pos);else reg_v |= (1 << bit_pos); -port_id_pci_reg_write (port_id, reg_off, reg_v); -display_port_reg_value (port_id, reg_off, reg_v); +if (!port_id_pci_reg_write (port_id, reg_off, reg_v)) +display_port_reg_value (port_id, reg_off, reg_v); }void
@@ -1121,11 +1105,13 @@ port_reg_bit_field_set(portid_t port_id, uint32_t reg_off, (unsigned)max_v, (unsigned)max_v);return ; } - reg_v =port_id_pci_reg_read (port_id, reg_off); +if (port_id_pci_reg_read (port_id, reg_off, ®_v)) +return ; + reg_v &= ~(max_v << l_bit);/* Keep unchanged bits */ reg_v |= (value << l_bit);/* Set changed bits */ -port_id_pci_reg_write (port_id, reg_off, reg_v); -display_port_reg_value (port_id, reg_off, reg_v); +if (!port_id_pci_reg_write (port_id, reg_off, reg_v)) +display_port_reg_value (port_id, reg_off, reg_v); }void
@@ -1135,8 +1121,8 @@ port_reg_set(portid_t port_id, uint32_t reg_off, uint32_t reg_v)return ;if (port_reg_off_is_invalid (port_id, reg_off))return ; -port_id_pci_reg_write (port_id, reg_off, reg_v); -display_port_reg_value (port_id, reg_off, reg_v); +if (!port_id_pci_reg_write (port_id, reg_off, reg_v)) +display_port_reg_value (port_id, reg_off, reg_v); }void
app/test-pmd/testpmd.h +28 -26
89 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v2 2/7] app/testpmd: use PCI memory resource access APIs
Quoted 11 lines
-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Saturday, September 18, 2021 10:25
To: [email protected]; [email protected]
Cc: Li, Xiaoyun <[email protected]>
Subject: [PATCH v2 2/7] app/testpmd: use PCI memory resource access APIsCurrently testpmd uses struct
rte_pci_deviceto access PCI memory resource. Since this structure will be internal later, this patch replaces use ofrte_pci_devicewith new PCI memory resource access APIs to read/write BAR 0.
Quoted 5 lines
Signed-off-by Chenbo Xia <[email protected]>--- app/test-pmd/config.c | 50 ++++++++++++++------------------------ app/test-pmd/testpmd.h | 54 ++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 58 deletions(-)
PATCH v2 3/7 examples/ethtool: use PCI library API to get PCI address
In reply to Chenbo XiaCurrently ethtool example uses struct rte_pci_device to know PCI address of a device. As this API will be removed later in PCI bus, this patch uses PCI library API to get the PCI address.
--- examples/ethtool/lib/rte_ethtool.c | 14 +++++++++----- examples/ethtool/meson.build | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-)
examples/ethtool/lib/rte_ethtool.c +9 -5
@@ -8,7 +8,7 @@#include <rte_version.h> #include <rte_ethdev.h> #include <rte_ether.h> -#include <rte_bus_pci.h> +#include <rte_pci.h> #ifdef RTE_NET_IXGBE #include <rte_pmd_ixgbe.h> #endif
@@ -23,8 +23,9 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) {struct rte_eth_dev_info dev_info;struct rte_dev_reg_info reg_info; -const struct rte_pci_device *pci_dev;const struct rte_bus *bus =NULL ; +char name[RTE_ETH_NAME_MAX_LEN ]; +struct rte_pci_addr addr;int n;int ret;
@@ -56,11 +57,14 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)if (dev_info.device) bus =rte_bus_find_by_device (dev_info.device);if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); +rte_eth_dev_get_name_by_port (port_id, name); +if (rte_pci_addr_parse (name, &addr)) { +printf ("Failed to parse pci address\n" ); +return -1 ; + }snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info),"%04x:%02x:%02x.%x" , - pci_dev->addr.domain, pci_dev->addr.bus, - pci_dev->addr.devid, pci_dev->addr.function); + addr.domain, addr.bus, addr.devid, addr.function); }else {snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info),"N/A" ); }
examples/ethtool/meson.build +1 -1
@@ -18,7 +18,7 @@ sources = files( ) includes = include_directories('lib', 'ethtool-app') -deps += 'bus_pci' +deps += 'pci' if dpdk_conf.has('RTE_NET_IXGBE') deps += 'net_ixgbe' endif
Signature · 1 line
2.17.1
PATCH v2 4/7 examples/kni: remove unused PCI bus header
In reply to Chenbo XiaThe header rte_bus_pci.h is included in kni example but nothing in it is used. So remove it.
--- examples/kni/main.c | 1 - 1 file changed, 1 deletion(-)
examples/kni/main.c +0 -1
@@ -31,7 +31,6 @@#include <rte_lcore.h> #include <rte_branch_prediction.h> #include <rte_interrupts.h> -#include <rte_bus_pci.h> #include <rte_debug.h> #include <rte_ether.h> #include <rte_ethdev.h>
Signature · 1 line
2.17.1
PATCH v2 5/7 kni: remove unused PCI info from test and example
In reply to Chenbo XiaPCI device id and address in structure rte_kni_conf are never used in the test, example and kni library. So remove the related code.
--- app/test/test_kni.c | 57 -------------------------------------- examples/ip_pipeline/kni.c | 16 ----------- 2 files changed, 73 deletions(-)
app/test/test_kni.c +0 -57
@@ -25,7 +25,6 @@ test_kni(void)#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_cycles.h> #include <rte_kni.h>
@@ -424,32 +423,14 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)unsigned i;struct rte_kni *kni;struct rte_kni_conf conf; -struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ;if (!mp)return -1 ;memset (&conf,0 ,sizeof (conf)); -memset (&info,0 ,sizeof (info));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); -return -1 ; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - }snprintf (conf.name,sizeof (conf.name),TEST_KNI_PORT );/* core id 1 configured for kernel thread */
@@ -543,10 +524,7 @@ test_kni(void)struct rte_kni *kni;struct rte_mempool *mp;struct rte_kni_conf conf; -struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus;FILE *fd;DIR *dir;char buf[16 ];
@@ -634,26 +612,9 @@ test_kni(void)fclose (fd);/* test of allocating KNI with NULL mempool pointer */ -memset (&info,0 ,sizeof (info));memset (&conf,0 ,sizeof (conf));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); -return -1 ; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
@@ -678,26 +639,8 @@ test_kni(void)/* test of allocating KNI without a name */ memset (&conf,0 ,sizeof (conf)); -memset (&info,0 ,sizeof (info));memset (&ops,0 ,sizeof (ops)); - ret =rte_eth_dev_info_get (port_id, &info); -if (ret !=0 ) { -printf ("Error during getting device (port %u) info: %s\n" , - port_id,strerror (-ret)); - ret =-1 ; - goto fail; - } - -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
examples/ip_pipeline/kni.c +0 -16
@@ -6,7 +6,6 @@#include <string.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_string_fns.h> #include "kni.h"
@@ -100,16 +99,12 @@ kni_change_mtu(uint16_t port_id, unsigned int new_mtu)struct kni *kni_create (const char *name,struct kni_params *params) { -struct rte_eth_dev_info dev_info;struct rte_kni_conf kni_conf;struct rte_kni_ops kni_ops;struct kni *kni;struct mempool *mempool;struct link *link;struct rte_kni *k; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ; -int ret;/* Check input params */ if ((name == NULL) ||
@@ -124,23 +119,12 @@ kni_create(const char *name, struct kni_params *params)return NULL ;/* Resource create */ - ret =rte_eth_dev_info_get (link->port_id, &dev_info); -if (ret !=0 ) -return NULL ; -memset (&kni_conf,0 ,sizeof (kni_conf));strlcpy (kni_conf.name, name,RTE_KNI_NAMESIZE ); kni_conf.force_bind = params->force_bind; kni_conf.core_id = params->thread_id; kni_conf.group_id = link->port_id; kni_conf.mbuf_size = mempool->buffer_size; -if (dev_info.device) - bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); - kni_conf.addr = pci_dev->addr; - kni_conf.id = pci_dev->id; - }memset (&kni_ops,0 ,sizeof (kni_ops)); kni_ops.port_id = link->port_id;
Signature · 1 line
2.17.1
PATCH v2 6/7 kni: replace unused variable definition with reserved bytes
In reply to Chenbo XiaPCI ID and address in structure rte_kni_conf are never used. And in order not to break ABI, replace these variables with reserved bytes.
--- lib/kni/rte_kni.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/kni/rte_kni.h +1 -3
@@ -17,7 +17,6 @@* and burst transmit packets to KNI interfaces. */ -#include <rte_pci.h> #include <rte_memory.h> #include <rte_mempool.h> #include <rte_ether.h>
@@ -66,8 +65,7 @@ struct rte_kni_conf {uint32_t core_id;/* Core ID to bind kernel thread on */ uint16_t group_id;/* Group ID */ unsigned mbuf_size;/* mbuf size */ -struct rte_pci_addr addr;/* depreciated */ -struct rte_pci_id id;/* depreciated */ +uint8_t rsvd[20 ]; __extension__ uint8_t force_bind : 1; /* Flag to bind kernel thread */
Signature · 1 line
2.17.1
PATCH v2 7/7 bus/pci: remove ABIs in PCI bus
In reply to Chenbo XiaAs announced in the deprecation note, most of ABIs in PCI bus are removed in this patch. Only the function rte_pci_dump is still ABI and experimental APIs are kept for future promotion.
This patch creates a new file named pci_driver.h and moves most of the content in original rte_bus_pci.h to it. After that, pci_driver.h is considered the interface for drivers and rte_bus_pci.h for applications. pci_driver.h is defined as driver_sdk_headers so that out-of-tree drivers can use it.
Then this patch replaces the including of rte_bus_pci.h with pci_driver.h in all related drivers.
--- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 375 +--------------- drivers/bus/pci/version.map | 32 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 126 files changed, 546 insertions(+), 508 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h
app/test/virtual_pmd.c +1 -1
@@ -6,7 +6,7 @@#include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_memory.h>
doc/guides/rel_notes/release_21_11.rst +2 -0
@@ -153,6 +153,8 @@ ABI Changes Also, make sure to start the actual text at the margin. ======================================================= +* pci: Removed all ABIs defined in rte_bus_pci.h except the function + ``rte_pci_dump()``. Known Issues ------------
drivers/baseband/acc100/rte_acc100_pmd.c +1 -1
@@ -14,7 +14,7 @@#include <rte_branch_prediction.h> #include <rte_hexdump.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h> #endif
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/bus/pci/bsd/pci.c +0 -1
@@ -28,7 +28,6 @@#include <rte_interrupts.h> #include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_launch.h> #include <rte_memory.h>
drivers/bus/pci/linux/pci.c +0 -1
@@ -8,7 +8,6 @@#include <rte_log.h> #include <rte_bus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/pci/linux/pci_uio.c +0 -1
@@ -19,7 +19,6 @@#include <rte_string_fns.h> #include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/bus/pci/linux/pci_vfio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_eal_paging.h> #include <rte_malloc.h> #include <rte_vfio.h>
drivers/bus/pci/meson.build +4 -0
@@ -29,4 +29,8 @@ if is_windows includes += include_directories('windows') endif +driver_sdk_headers += files( + 'pci_driver.h', +) + deps += ['kvargs']
drivers/bus/pci/pci_common_uio.c +0 -1
@@ -11,7 +11,6 @@#include <rte_eal.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/bus/pci/pci_driver.h new file +402 -0
402 lines not on this page · raw message
drivers/bus/pci/pci_params.c +0 -1
@@ -3,7 +3,6 @@*/ #include <rte_bus.h> -#include <rte_bus_pci.h> #include <rte_dev.h> #include <rte_errno.h> #include <rte_kvargs.h>
drivers/bus/pci/private.h +2 -1
@@ -8,10 +8,11 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus_pci.h> #include <rte_os_shim.h> #include <rte_pci.h> +#include "pci_driver.h" +extern struct rte_pci_bus rte_pci_bus;struct rte_pci_driver ;
drivers/bus/pci/rte_bus_pci.h +2 -373
396 lines not on this page · raw message
drivers/bus/pci/version.map +17 -15
@@ -2,6 +2,22 @@ DPDK_22 { global: rte_pci_dump; + + local: *; +}; + +EXPERIMENTAL { + global: + + # added in 21.11 + rte_pci_mem_rd32; + rte_pci_mem_wr32; +}; + +INTERNAL { + global: + + rte_pci_find_ext_capability; rte_pci_get_sysfs_path; rte_pci_ioport_map; rte_pci_ioport_read;
@@ -10,22 +26,8 @@ DPDK_22 { rte_pci_map_device; rte_pci_read_config; rte_pci_register; + rte_pci_set_bus_master; rte_pci_unmap_device; rte_pci_unregister; rte_pci_write_config; - - local: *; -}; - -EXPERIMENTAL { - global: - - rte_pci_find_ext_capability; - - # added in 21.08 - rte_pci_set_bus_master; - - # added in 21.11 - rte_pci_mem_rd32; - rte_pci_mem_wr32; };
drivers/common/cnxk/roc_platform.h +1 -1
@@ -7,7 +7,7 @@#include <rte_alarm.h> #include <rte_bitmap.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/common/mlx5/linux/mlx5_common_verbs.c +1 -1
@@ -11,7 +11,7 @@#include <inttypes.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_auxiliary.h> #include "mlx5_common_utils.h"
drivers/common/mlx5/mlx5_common_pci.c +1 -1
@@ -9,7 +9,7 @@#include <rte_errno.h> #include <rte_class.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "mlx5_common_log.h" #include "mlx5_common_private.h"
drivers/common/octeontx2/otx2_dev.h +1 -1
@@ -5,7 +5,7 @@#ifndef _OTX2_DEV_H#define _OTX2_DEV_H -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "otx2_common.h" #include "otx2_irq.h"
drivers/common/octeontx2/otx2_sec_idev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_spinlock.h>
drivers/common/qat/qat_device.h +1 -1
@@ -4,7 +4,7 @@#ifndef _QAT_DEVICE_H_#define _QAT_DEVICE_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "qat_common.h" #include "qat_logs.h"
drivers/common/qat/qat_qp.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_memzone.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_prefetch.h>
drivers/common/sfc_efx/sfc_efx.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EFX_H_#define _SFC_EFX_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "efx.h" #include "efsys.h"
drivers/compress/mlx5/mlx5_compress.c +1 -1
@@ -5,7 +5,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_spinlock.h> #include <rte_comp.h> #include <rte_compressdev.h>
drivers/compress/octeontx/otx_zip.h +1 -1
@@ -7,7 +7,7 @@#include <unistd.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_comp.h> #include <rte_compressdev.h> #include <rte_compressdev_pmd.h>
drivers/compress/qat/qat_comp.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mbuf.h> #include <rte_hexdump.h> #include <rte_comp.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include <rte_memcpy.h> #include <rte_common.h>
drivers/crypto/ccp/ccp_dev.h +1 -1
@@ -10,7 +10,7 @@#include <stdint.h> #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_byteorder.h> #include <rte_io.h>
drivers/crypto/ccp/ccp_pci.h +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"#define PROC_MODULES "/proc/modules"
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn10k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn9k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/mlx5/mlx5_crypto.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_log.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memory.h> #include <mlx5_glue.h>
drivers/crypto/nitrox/nitrox_device.h +1 -1
@@ -5,7 +5,7 @@#ifndef _NITROX_DEVICE_H_#define _NITROX_DEVICE_H_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> struct nitrox_sym_device ;
drivers/crypto/octeontx/otx_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Cavium, Inc */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h>
drivers/crypto/octeontx/otx_cryptodev_ops.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_eventdev.h>
drivers/crypto/octeontx2/otx2_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright (C) 2019 Marvell International Ltd. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/qat/qat_sym.c +1 -1
@@ -7,7 +7,7 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_crypto_sym.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_byteorder.h> #include "qat_sym.h"
drivers/crypto/qat/qat_sym_pmd.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2015-2018 Intel Corporation */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_malloc.h>
drivers/crypto/virtio/virtio_cryptodev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_common.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_eal.h>
drivers/crypto/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <rte_eal_paging.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_cryptodev.h> #include "virtio_crypto.h"
drivers/event/dlb2/pf/dlb2_main.h +1 -1
@@ -9,7 +9,7 @@#include <rte_log.h> #include <rte_spinlock.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal_paging.h> #include "base/dlb2_hw_types.h"
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -25,7 +25,7 @@#include <rte_cycles.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eventdev.h> #include <eventdev_pmd.h> #include <eventdev_pmd_pci.h>
drivers/event/octeontx/ssovf_probe.c +1 -1
@@ -7,7 +7,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "octeontx_mbox.h" #include "ssovf_evdev.h"
drivers/event/octeontx/timvf_probe.c +1 -1
@@ -5,7 +5,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <octeontx_mbox.h>
drivers/event/octeontx2/otx2_evdev.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <eventdev_pmd_pci.h>
drivers/mempool/cnxk/cnxk_mempool.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_eal.h>
drivers/mempool/octeontx/octeontx_fpavf.c +1 -1
@@ -13,7 +13,7 @@#include <rte_atomic.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_malloc.h>
drivers/mempool/octeontx2/otx2_mempool.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_io.h>
drivers/mempool/octeontx2/otx2_mempool.h +1 -1
@@ -6,7 +6,7 @@#define __OTX2_MEMPOOL_H__#include <rte_bitmap.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_devargs.h> #include <rte_mempool.h>
drivers/mempool/octeontx2/otx2_mempool_irq.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <rte_common.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "otx2_common.h" #include "otx2_irq.h"
drivers/meson.build +4 -0
@@ -85,6 +85,7 @@ foreach subpath:subdirs name = drv sources = [] headers = [] + driver_sdk_headers = [] # public headers included by drivers objs = [] cflags = default_cflags includes = [include_directories(drv_path)]
@@ -153,6 +154,9 @@ foreach subpath:subdirs dpdk_extra_ldflags += pkgconfig_extra_libs install_headers(headers) + if get_option('enable_driver_sdk') + install_headers(driver_sdk_headers) + endif # generate pmdinfo sources by building a temporary # lib and then running pmdinfogen on the contents of
drivers/net/ark/ark_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <sys/stat.h> #include <dlfcn.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_kvargs.h>
drivers/net/avp/avp_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -16,7 +16,7 @@#include <rte_byteorder.h> #include <rte_spinlock.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_io.h> #include "bnx2x_osal.h"
drivers/net/bnxt/bnxt.h +1 -1
@@ -11,7 +11,7 @@#include <sys/queue.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <rte_memory.h> #include <rte_lcore.h>
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -4,7 +4,7 @@#include <rte_devargs.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_kvargs.h> #include "rte_eth_bond.h"
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -8,7 +8,7 @@#ifndef __T4_ADAPTER_H__#define __T4_ADAPTER_H__ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_io.h> #include <rte_rwlock.h>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_tailq.h>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_byteorder.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -18,7 +18,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memory.h> #include <rte_memcpy.h> #include <rte_memzone.h>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/igb_pf.c +1 -1
@@ -10,7 +10,7 @@#include <stdarg.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_interrupts.h> #include <rte_log.h> #include <rte_debug.h>
drivers/net/ena/ena_ethdev.h +1 -1
@@ -12,7 +12,7 @@#include <ethdev_pci.h> #include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_timer.h> #include <rte_dev.h> #include <rte_net.h>
drivers/net/enic/base/vnic_dev.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "enic_compat.h" #include "vnic_resource.h"
drivers/net/enic/enic_ethdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_dev.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_geneve.h>
drivers/net/enic/enic_main.c +1 -1
@@ -10,7 +10,7 @@#include <fcntl.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/enic/enic_vf_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <stdio.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <ethdev_driver.h>
drivers/net/hinic/base/hinic_pmd_hwdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_hash.h> #include <rte_jhash.h>
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "hinic_compat.h" #include "hinic_csr.h"
drivers/net/hinic/base/hinic_pmd_nicio.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "hinic_compat.h" #include "hinic_pmd_hwdev.h"
drivers/net/hinic/hinic_pmd_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_mbuf.h> #include <rte_malloc.h>
drivers/net/hns3/hns3_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> #include <rte_kvargs.h>
drivers/net/hns3/hns3_rxtx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2021 HiSilicon Limited. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_geneve.h>
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_eal.h> #include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -18,7 +18,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_memory.h>
drivers/net/i40e/i40e_vf_representor.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Intel Corporation. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/igc/igc_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_malloc.h>
drivers/net/ionic/ionic.h +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "ionic_dev.h" #include "ionic_if.h"
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <unistd.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_tm.c +1 -1
@@ -6,7 +6,7 @@#include <stdlib.h> #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_kvargs.h>
drivers/net/ixgbe/ixgbe_ethdev.h +1 -1
@@ -19,7 +19,7 @@#include <rte_time.h> #include <rte_hash.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -32,7 +32,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <ethdev_driver.h> #include <rte_ether.h>
drivers/net/mlx5/linux/mlx5_ethdev_os.c +1 -1
@@ -25,7 +25,7 @@#include <time.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -19,7 +19,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_bus_auxiliary.h> #include <rte_common.h> #include <rte_kvargs.h>
drivers/net/mlx5/mlx5.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_kvargs.h> #include <rte_rwlock.h>
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <errno.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -13,7 +13,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal_paging.h>
drivers/net/netvsc/hn_vf.c +1 -1
@@ -21,7 +21,7 @@#include <rte_memory.h> #include <rte_bus_vmbus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_log.h> #include <rte_string_fns.h> #include <rte_alarm.h>
drivers/net/octeontx/base/octeontx_pkivf.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "../octeontx_logs.h" #include "octeontx_io.h"
drivers/net/octeontx/base/octeontx_pkovf.c +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_spinlock.h> #include "../octeontx_logs.h"
drivers/net/octeontx2/otx2_ethdev_irq.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include "otx2_ethdev.h"
drivers/net/qede/base/bcm_osal.h +1 -1
@@ -21,7 +21,7 @@#include <rte_ether.h> #include <rte_io.h> #include <rte_version.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> /* Forward declaration */ struct ecore_dev ;
drivers/net/sfc/sfc.h +1 -1
@@ -13,7 +13,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h>
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_ether.h>
drivers/net/sfc/sfc_sriov.c +1 -1
@@ -8,7 +8,7 @@*/ #include <rte_common.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "sfc.h" #include "sfc_log.h"
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -32,7 +32,7 @@#include <rte_malloc.h> #include <rte_random.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_kvargs.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -1
@@ -20,7 +20,7 @@#include <rte_ethdev_core.h> #include <rte_hash.h> #include <rte_hash_crc.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/txgbe/txgbe_flow.c +1 -1
@@ -4,7 +4,7 @@*/ #include <sys/queue.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_malloc.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/txgbe/txgbe_pf.c +1 -1
@@ -20,7 +20,7 @@#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "base/txgbe.h" #include "txgbe_ethdev.h"
drivers/net/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <ethdev_driver.h> #include "virtio.h"
drivers/net/virtio/virtio_pci_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_errno.h> #include <rte_memory.h>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -19,7 +19,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/raw/cnxk_bphy/cnxk_bphy.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_eal.h>
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -3,7 +3,7 @@*/ #include <string.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/cnxk_bphy/cnxk_bphy_irq.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_pci.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/cnxk_bphy/cnxk_bphy_irq.h +1 -1
@@ -5,7 +5,7 @@#ifndef _CNXK_BPHY_IRQ_#define _CNXK_BPHY_IRQ_ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_dev.h> #include <roc_api.h>
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_devargs.h> #include <rte_memcpy.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_kvargs.h> #include <rte_alarm.h> #include <rte_interrupts.h>
drivers/raw/ifpga/rte_pmd_ifpga.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> #include "rte_pmd_ifpga.h"
drivers/raw/ioat/idxd_pci.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_devargs.h>
drivers/raw/ioat/ioat_rawdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_cycles.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_string_fns.h> #include <rte_rawdev_pmd.h>
drivers/raw/ntb/ntb.c +1 -1
@@ -13,7 +13,7 @@#include <rte_log.h> #include <rte_pci.h> #include <rte_mbuf.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_memzone.h> #include <rte_memcpy.h> #include <rte_rawdev.h>
drivers/raw/ntb/ntb_hw_intel.c +1 -1
@@ -8,7 +8,7 @@#include <rte_io.h> #include <rte_eal.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c +1 -1
@@ -6,7 +6,7 @@#include <unistd.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_lcore.h>
drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c +1 -1
@@ -8,7 +8,7 @@#include <fcntl.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_mempool.h>
drivers/raw/octeontx2_ep/otx2_ep_rawdev.c +1 -1
@@ -5,7 +5,7 @@#include <unistd.h> #include <rte_bus.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_mempool.h>
drivers/regex/mlx5/mlx5_regex.c +1 -1
@@ -9,7 +9,7 @@#include <rte_regexdev.h> #include <rte_regexdev_core.h> #include <rte_regexdev_driver.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <mlx5_common.h> #include <mlx5_common_mr.h>
drivers/regex/mlx5/mlx5_regex_fastpath.c +1 -1
@@ -10,7 +10,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_pci.h> #include <rte_regexdev_driver.h> #include <rte_mbuf.h>
drivers/vdpa/ifc/base/ifcvf_osdep.h +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_log.h> #include <rte_io.h>
drivers/vdpa/ifc/ifcvf_vdpa.c +1 -1
@@ -14,7 +14,7 @@#include <rte_eal_paging.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_vhost.h> #include <rte_vdpa.h> #include <rte_vdpa_dev.h>
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
@@ -12,7 +12,7 @@#include <rte_log.h> #include <rte_errno.h> #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <mlx5_glue.h> #include <mlx5_common.h>
lib/ethdev/ethdev_pci.h +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include <rte_config.h> #include <ethdev_driver.h>
lib/eventdev/eventdev_pmd_pci.h +1 -1
@@ -24,7 +24,7 @@ extern "C" {#include <rte_eal.h> #include <rte_lcore.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <pci_driver.h> #include "eventdev_pmd.h"
Signature · 1 line
2.17.1
Gentle ping for comments..
@David, could you help me understand what is the compile error in Fedora 31? DPDK_compile_spdk failure is expected as the header name for SPDK is changed, I am not sure if it's the same error...
Thanks,
Chenbo
Quoted 173 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Chenbo Xia
Sent: Saturday, September 18, 2021 10:25 AM
To: [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsAs announced in the deprecation notice, most ABIs in PCI bus will be removed.
As there exist some applications that want to access PCI memory resource, two new APIs are defined in Patch 1 and corresponding changes are applied to testpmd in Patch 2.
Patch 3-4 clean up the unnecessary usage of PCI bus header in examples.
Patch 5-6 clean up the unused PCI related structure in kni library and related tests and examples.
Patch 7 finally removes most of ABIs in PCI bus.
---
v2:
- Add check on call ofport_id_pci_reg_write(Xiaoyun)
- Combine two clean-up patches in test and example, and backport (David)Chenbo Xia (7):
bus/pci: add new memory resource access APIs app/testpmd: use PCI memory resource access APIs examples/ethtool: use PCI library API to get PCI address examples/kni: remove unused PCI bus header
kni: remove unused PCI info from test and example
kni: replace unused variable definition with reserved bytes bus/pci: remove ABIs in PCI busapp/test-pmd/config.c | 50 +-- app/test-pmd/testpmd.h | 54 +-- app/test/test_kni.c | 57 --- app/test/virtual_pmd.c | 2 +- doc/guides/rel_notes/release_21_11.rst | 8 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/linux/pci_uio.c | 1 - drivers/bus/pci/linux/pci_vfio.c | 1 - drivers/bus/pci/meson.build | 4 + drivers/bus/pci/pci_common.c | 78 ++++ drivers/bus/pci/pci_common_uio.c | 1 - drivers/bus/pci/pci_driver.h | 402 ++++++++++++++++++ drivers/bus/pci/pci_params.c | 1 - drivers/bus/pci/private.h | 3 +- drivers/bus/pci/rte_bus_pci.h | 387 ++--------------- drivers/bus/pci/version.map | 28 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_verbs.c | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/octeontx2/otx2_dev.h | 2 +- drivers/common/octeontx2/otx2_sec_idev.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/octeontx2/otx2_cryptodev.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/qat/qat_sym_pmd.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/event/octeontx2/otx2_evdev.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.c | 2 +- drivers/mempool/octeontx2/otx2_mempool.h | 2 +- drivers/mempool/octeontx2/otx2_mempool_irq.c | 2 +- drivers/meson.build | 4 + drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/octeontx2/otx2_ethdev_irq.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 2 +- drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- examples/ethtool/lib/rte_ethtool.c | 14 +- examples/ethtool/meson.build | 2 +- examples/ip_pipeline/kni.c | 16 - examples/kni/main.c | 1 - lib/ethdev/ethdev_pci.h | 2 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- lib/kni/rte_kni.h | 4 +- 135 files changed, 711 insertions(+), 633 deletions(-) create mode 100644 drivers/bus/pci/pci_driver.h--
2.17.1
Hello Chenbo,
Quoted 2 lines · Chenbo
Gentle ping for comments..
Sorry, I'll try to look at it.
Quoted 4 lines
@David, could you help me understand what is the compile error in Fedora 31?
DPDK_compile_spdkfailure is expected as the header name for SPDK is changed, I am not sure if it's the same error...
The error log is odd (no compilation "backtrace"). You'll need to test spdk manually I guess.
Signature · 1 line
David Marchand
Quoted 7 lines · David Marchand
Quoted 3 lines · Chenbo
@David, could you help me understand what is the compile error in Fedora 31?
DPDK_compile_spdkfailure is expected as the header name for SPDK is changed, I am not sure if it's the same error...The error log is odd (no compilation "backtrace"). You'll need to test spdk manually I guess.
Tried your series with SPDK (w/o and w/ enable_driver_sdk). I think the same, and the error is likely due to the file rename.
$ make
CC lib/env_dpdk/env.o
In file included from env.c:39:0:
env_internal.h:64:25: error: field ‘driver’ has incomplete type
struct rte_pci_driver driver;
^
env_internal.h:75:59: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
int pci_device_init(struct rte_pci_driver *driver, struct
rte_pci_device *device);
^
env_internal.h:75:59: warning: its scope is only this definition or
declaration, which is probably not what you want [enabled by default]
env_internal.h:76:28: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
int pci_device_fini(struct rte_pci_device *device);
^
env_internal.h:89:38: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
void vtophys_pci_device_added(struct rte_pci_device *pci_device);
^
env_internal.h:96:40: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
void vtophys_pci_device_removed(struct rte_pci_device *pci_device);
^
make[2]: *** [env.o] Error 1
make[1]: *** [env_dpdk] Error 2
make: *** [lib] Error 2So basically, SPDK needs some updates since it has its own pci drivers. I copied some SPDK folks for info.
*Disclaimer* I only checked it links fine against my 21.11 dpdk env, and did not test the other cases:
dpdkbuild/Makefile +0 -0
@@ -166,6 +166,7 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp $(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk
$(SPDK_ROOT_DIR)/include/spdk/config.h
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson--prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Ddisable_drivers="$(shell echo $(DPDK_DISABLED_DRVERS) | sed -E "s/ +/,/g")" build-tmp
+ $(Q)! meson configure build-tmp | grep -qw enable_driver_sdk
|| meson configure build-tmp -Denable_driver_sdk=true
$(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH
.*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h
$(Q) \
# TODO Meson build adds libbsd dependency when it's available.
This means any app will be \
lib/env_dpdk/env.mk +2 -0
@@ -172,6 +172,12 @@ DPDK_PRIVATE_LINKER_ARGS += -lnuma endif endif +ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h)) +ifneq (,$(shell grep -e "define RTE_HAS_LIBARCHIVE 1"
$(DPDK_INC_DIR)/rte_build_config.h))
+DPDK_PRIVATE_LINKER_ARGS += -larchive
+endif
+endif
+
ifeq ($(OS),Linux)
DPDK_PRIVATE_LINKER_ARGS += -ldl
endif
lib/env_dpdk/env_internal.h +6 -1
@@ -43,13 +43,18 @@#include <rte_eal.h> #include <rte_bus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_dev.h> #if RTE_VERSION <RTE_VERSION_NUM (19 ,11 ,0 ,0 )#error RTE_VERSION is too old! Minimum 19.11 is required.#endif +#if RTE_VERSION <RTE_VERSION_NUM (21 ,11 ,0 ,0 ) +#include <rte_bus_pci.h> +#else +#include <pci_driver.h> +#endif +/* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47], * which is enough to cover 256 TB. */
Signature · 1 line
David Marchand
Adding Changpeng Liu from SPDK side.
On 10/4/21, 6:48 AM, "David Marchand" <[email protected]> wrote:
On Thu, Sep 30, 2021 at 10:45 AM David Marchand
<[email protected]> wrote:
> On Wed, Sep 29, 2021 at 9:38 AM Xia, Chenbo <[email protected]> wrote:
> > @David, could you help me understand what is the compile error in Fedora 31?
> > DPDK_compile_spdk failure is expected as the header name for SPDK is changed,
> > I am not sure if it's the same error...
>
> The error log is odd (no compilation "backtrace").
> You'll need to test spdk manually I guess.
Tried your series with SPDK (w/o and w/ enable_driver_sdk).
I think the same, and the error is likely due to the file rename.
$ make
CC lib/env_dpdk/env.o
In file included from env.c:39:0:
env_internal.h:64:25: error: field ‘driver’ has incomplete type
struct rte_pci_driver driver;
^
env_internal.h:75:59: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
int pci_device_init(struct rte_pci_driver *driver, struct
rte_pci_device *device);
^
env_internal.h:75:59: warning: its scope is only this definition or
declaration, which is probably not what you want [enabled by default]
env_internal.h:76:28: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
int pci_device_fini(struct rte_pci_device *device);
^
env_internal.h:89:38: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
void vtophys_pci_device_added(struct rte_pci_device *pci_device);
^
env_internal.h:96:40: warning: ‘struct rte_pci_device’ declared inside
parameter list [enabled by default]
void vtophys_pci_device_removed(struct rte_pci_device *pci_device);
^
make[2]: *** [env.o] Error 1
make[1]: *** [env_dpdk] Error 2
make: *** [lib] Error 2
So basically, SPDK needs some updates since it has its own pci drivers.
I copied some SPDK folks for info.
*Disclaimer* I only checked it links fine against my 21.11 dpdk env,
and did not test the other cases:
diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile
index d51b1a6e5..0e666735d 100644
--- a/dpdkbuild/Makefile
+++ b/dpdkbuild/Makefile
@@ -166,6 +166,7 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk
$(SPDK_ROOT_DIR)/include/spdk/config.h
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson
--prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)"
-Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS)
-Ddisable_drivers="$(shell echo $(DPDK_DISABLED_DRVERS) | sed -E "s/
+/,/g")" build-tmp
+ $(Q)! meson configure build-tmp | grep -qw enable_driver_sdk
|| meson configure build-tmp -Denable_driver_sdk=true
$(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH
.*/#define RTE_EAL_PMD_PATH ""/g'
$(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h
$(Q) \
# TODO Meson build adds libbsd dependency when it's available.
This means any app will be \
diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk
index cc7db8aab..e24c6942f 100644bits with an embedded dpdk
--- a/lib/env_dpdk/env.mk
+++ b/lib/env_dpdk/env.mk
@@ -172,6 +172,12 @@ DPDK_PRIVATE_LINKER_ARGS += -lnuma
endif
endif
+ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h))
+ifneq (,$(shell grep -e "define RTE_HAS_LIBARCHIVE 1"
$(DPDK_INC_DIR)/rte_build_config.h))
+DPDK_PRIVATE_LINKER_ARGS += -larchive
+endif
+endif
+
ifeq ($(OS),Linux)
DPDK_PRIVATE_LINKER_ARGS += -ldl
endif
diff --git a/lib/env_dpdk/env_internal.h b/lib/env_dpdk/env_internal.h
index 2303f432c..24b377545 100644
--- a/lib/env_dpdk/env_internal.h
+++ b/lib/env_dpdk/env_internal.h
@@ -43,13 +43,18 @@
#include <rte_eal.h>
#include <rte_bus.h>
#include <rte_pci.h>
-#include <rte_bus_pci.h>
#include <rte_dev.h>
#if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0)
#error RTE_VERSION is too old! Minimum 19.11 is required.
#endif
+#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0)
+#include <rte_bus_pci.h>
+#else
+#include <pci_driver.h>
+#endif
+
/* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47],
* which is enough to cover 256 TB.
*/
--
David MarchandThanks David for helping check this and including SPDK folks!
Hi Changpeng,
Although we have synced about this during last release's deprecation notice, I’d like to summarize two points for SPDK to change if this patchset applied.
1. The pci bus header for drivers will only be exposed if meson option 'enable_driver_sdk' is added, so SPDK need this DPDK meson option to build.
2. As some functions in pci bus is needed for apps and the rest for drivers, the header for driver is renamed to pci_driver.h (header for app is rte_bus_pci.h). So SPDK drivers will need pci_driver.h instead of rte_bus_pci.h starting from DPDK 21.11. David showed some tests he did below.
Could you help check above two updates are fine to SPDK?
Thanks,
Chenbo
Quoted 138 lines
-----Original Message-----
From: Harris, James R <[email protected]>
Sent: Monday, October 4, 2021 11:56 PM
To: David Marchand <[email protected]>; Xia, Chenbo <[email protected]>; Liu, Changpeng <[email protected]>
Cc: [email protected]; [email protected]; Aaron Conole <[email protected]>; dpdklab <[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsAdding Changpeng Liu from SPDK side.
On 10/4/21, 6:48 AM, "David Marchand" <[email protected]> wrote:
On Thu, Sep 30, 2021 at 10:45 AM David Marchand <[email protected]> wrote: > On Wed, Sep 29, 2021 at 9:38 AM Xia, Chenbo <[email protected]>Quoted 1 line · wrote:
Quoted 1 line
@David, could you help me understand what is the compile error in
Fedora 31?
Quoted 1 line
Quoted 1 line
DPDK_compile_spdkfailure is expected as the header name for SPDKis changed,
Quoted 4 lines
Quoted 1 line
I am not sure if it's the same error...
The error log is odd (no compilation "backtrace"). You'll need to test spdk manually I guess.
Tried your series with SPDK (w/o and w/
enable_driver_sdk). I think the same, and the error is likely due to the file rename.$ make
CClib/env_dpdk/env.o
In file included from env.c:39:0:
env_internal.h:64:25: error: field ‘driver’ has incomplete type
structrte_pci_driverdriver;
^
env_internal.h:75:59: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
int pci_device_init(structrte_pci_driver*driver, struct
rte_pci_device*device);
^
env_internal.h:75:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] env_internal.h:76:28: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
intpci_device_fini(struct rte_pci_device *device);
^
env_internal.h:89:38: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
voidvtophys_pci_device_added(struct rte_pci_device *pci_device);
^
env_internal.h:96:40: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
voidvtophys_pci_device_removed(struct rte_pci_device *pci_device);
^
make[2]: *** [env.o] Error 1
make[1]: *** [env_dpdk] Error 2
make: *** [lib] Error 2So basically, SPDK needs some updates since it has its own pci drivers. I copied some SPDK folks for info.
*Disclaimer* I only checked it links fine against my 21.11 dpdk env, and did not test the other cases:
diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index
d51b1a6e5..0e666735d100644
--- a/dpdkbuild/Makefile
+++ b/dpdkbuild/Makefile
@@ -166,6 +166,7 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk
$(SPDK_ROOT_DIR)/include/spdk/config.h
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build
$(SPDK_ROOT_DIR)/dpdk/build-tmp$(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Ddisable_drivers="$(shell echo $(DPDK_DISABLED_DRVERS) | sed -E "s/ +/,/g")" build-tmp + $(Q)! meson configure build-tmp | grep -qw enable_driver_sdk || meson configure build-tmp -Denable_driver_sdk=true $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH .*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h $(Q) \ # TODO Meson build adds libbsd dependency when it's available. This means any app will be \ diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index cc7db8aab..e24c6942f 100644bits with an embedded dpdk --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -172,6 +172,12 @@ DPDK_PRIVATE_LINKER_ARGS += -lnuma endif endif +ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h)) +ifneq (,$(shell grep -e "define RTE_HAS_LIBARCHIVE 1" $(DPDK_INC_DIR)/rte_build_config.h)) +DPDK_PRIVATE_LINKER_ARGS += -larchive +endif +endif + ifeq ($(OS),Linux) DPDK_PRIVATE_LINKER_ARGS += -ldl endif diff --git a/lib/env_dpdk/env_internal.h b/lib/env_dpdk/env_internal.h index 2303f432c..24b377545 100644 --- a/lib/env_dpdk/env_internal.h +++ b/lib/env_dpdk/env_internal.h @@ -43,13 +43,18 @@ #include <rte_eal.h> #include <rte_bus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_dev.h> #if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0) #error RTE_VERSION is too old! Minimum 19.11 is required. #endif +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) +#include <rte_bus_pci.h> +#else +#include <pci_driver.h> +#endif + /* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47], * which is enough to cover 256 TB. */ -- David Marchand
I tried the above DPDK patches, and got the following errors:
pci.c:115:7: error: call to ‘rte_pci_read_config’ declared with attribute error: Symbol is not public ABI
115 | rc = rte_pci_read_config(dev->dev_handle, value, len, offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pci.c: In function ‘cfg_write_rte’:
pci.c:125:7: error: call to ‘rte_pci_write_config’ declared with attribute error: Symbol is not public ABI
125 | rc = rte_pci_write_config(dev->dev_handle, value, len, offset);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pci.c: In function ‘register_rte_driver’:
pci.c:375:2: error: call to ‘rte_pci_register’ declared with attribute error: Symbol is not public ABI
375 | rte_pci_register(&driver->driver);
We may use the new added API to replace rte_pci_write_config and rte_pci_read_config, but SPDK do require rte_pci_register().
Quoted 171 lines
-----Original Message-----
From: Xia, Chenbo <[email protected]>
Sent: Wednesday, October 6, 2021 12:26 PM
To: Harris, James R <[email protected]>; David Marchand <[email protected]>; Liu, Changpeng <[email protected]>
Cc: [email protected]; [email protected]; Aaron Conole <[email protected]>; dpdklab <[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsThanks David for helping check this and including SPDK folks!
Hi Changpeng,
Although we have synced about this during last release's deprecation notice, I’d like to summarize two points for SPDK to change if this patchset applied.
1. The pci bus header for drivers will only be exposed if meson option '
enable_driver_sdk' is added, so SPDK need this DPDK meson option to build.2. As some functions in pci bus is needed for apps and the rest for drivers, the header for driver is renamed to
pci_driver.h(header for app isrte_bus_pci.h). So SPDK drivers will needpci_driver.hinstead ofrte_bus_pci.hstarting from DPDK
21.11. David showed some tests he did below.Could you help check above two updates are fine to SPDK?
Thanks,
ChenboQuoted 6 lines
-----Original Message-----
From: Harris, James R <[email protected]>
Sent: Monday, October 4, 2021 11:56 PM
To: David Marchand <[email protected]>; Xia, Chenbo <[email protected]>; Liu, Changpeng <[email protected]>
Cc: [email protected]; [email protected]; Aaron Conole <[email protected]>;dpdklab
Quoted 7 lines
<[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsAdding Changpeng Liu from SPDK side.
On 10/4/21, 6:48 AM, "David Marchand" <[email protected]>
Quoted 125 lines · wrote:
On Thu, Sep 30, 2021 at 10:45 AM David Marchand <[email protected]> wrote: > On Wed, Sep 29, 2021 at 9:38 AM Xia, Chenbo <[email protected]>Quoted 1 line · wrote:
Quoted 1 line
@David, could you help me understand what is the compile error in
Fedora 31?
Quoted 1 line
Quoted 1 line
DPDK_compile_spdkfailure is expected as the header name for SPDKis changed,
Quoted 4 lines
Quoted 1 line
I am not sure if it's the same error...
The error log is odd (no compilation "backtrace"). You'll need to test spdk manually I guess.
Tried your series with SPDK (w/o and w/
enable_driver_sdk). I think the same, and the error is likely due to the file rename.$ make
CClib/env_dpdk/env.o
In file included from env.c:39:0:
env_internal.h:64:25: error: field ‘driver’ has incomplete type
structrte_pci_driverdriver;
^
env_internal.h:75:59: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
int pci_device_init(structrte_pci_driver*driver, struct
rte_pci_device*device);
^
env_internal.h:75:59: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] env_internal.h:76:28: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
intpci_device_fini(struct rte_pci_device *device);
^
env_internal.h:89:38: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
voidvtophys_pci_device_added(struct rte_pci_device *pci_device);
^
env_internal.h:96:40: warning: ‘struct rte_pci_device’ declared inside parameter list [enabled by default]
voidvtophys_pci_device_removed(struct rte_pci_device *pci_device);
^
make[2]: *** [env.o] Error 1
make[1]: *** [env_dpdk] Error 2
make: *** [lib] Error 2So basically, SPDK needs some updates since it has its own pci drivers. I copied some SPDK folks for info.
*Disclaimer* I only checked it links fine against my 21.11 dpdk env, and did not test the other cases:
diff --git a/dpdkbuild/Makefile b/dpdkbuild/Makefile index
d51b1a6e5..0e666735d100644
--- a/dpdkbuild/Makefile
+++ b/dpdkbuild/Makefile
@@ -166,6 +166,7 @@ all: $(SPDK_ROOT_DIR)/dpdk/build-tmp
$(SPDK_ROOT_DIR)/dpdk/build-tmp: $(SPDK_ROOT_DIR)/mk/cc.mk
$(SPDK_ROOT_DIR)/include/spdk/config.h
$(Q)rm -rf $(SPDK_ROOT_DIR)/dpdk/build
$(SPDK_ROOT_DIR)/dpdk/build-tmp$(Q)cd "$(SPDK_ROOT_DIR)/dpdk"; CC="$(SUB_CC)" meson --prefix="$(MESON_PREFIX)" --libdir lib -Dc_args="$(DPDK_CFLAGS)" -Dc_link_args="$(DPDK_LDFLAGS)" $(DPDK_OPTS) -Ddisable_drivers="$(shell echo $(DPDK_DISABLED_DRVERS) | sed -E "s/ +/,/g")" build-tmp + $(Q)! meson configure build-tmp | grep -qw enable_driver_sdk || meson configure build-tmp -Denable_driver_sdk=true $(Q)sed $(SED_INPLACE_FLAG) 's/#define RTE_EAL_PMD_PATH .*/#define RTE_EAL_PMD_PATH ""/g' $(SPDK_ROOT_DIR)/dpdk/build-tmp/rte_build_config.h $(Q) \ # TODO Meson build adds libbsd dependency when it's available. This means any app will be \ diff --git a/lib/env_dpdk/env.mk b/lib/env_dpdk/env.mk index cc7db8aab..e24c6942f 100644bits with an embedded dpdk --- a/lib/env_dpdk/env.mk +++ b/lib/env_dpdk/env.mk @@ -172,6 +172,12 @@ DPDK_PRIVATE_LINKER_ARGS += -lnuma endif endif +ifneq (,$(wildcard $(DPDK_INC_DIR)/rte_build_config.h)) +ifneq (,$(shell grep -e "define RTE_HAS_LIBARCHIVE 1" $(DPDK_INC_DIR)/rte_build_config.h)) +DPDK_PRIVATE_LINKER_ARGS += -larchive +endif +endif + ifeq ($(OS),Linux) DPDK_PRIVATE_LINKER_ARGS += -ldl endif diff --git a/lib/env_dpdk/env_internal.h b/lib/env_dpdk/env_internal.h index 2303f432c..24b377545 100644 --- a/lib/env_dpdk/env_internal.h +++ b/lib/env_dpdk/env_internal.h @@ -43,13 +43,18 @@ #include <rte_eal.h> #include <rte_bus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_dev.h> #if RTE_VERSION < RTE_VERSION_NUM(19, 11, 0, 0) #error RTE_VERSION is too old! Minimum 19.11 is required. #endif +#if RTE_VERSION < RTE_VERSION_NUM(21, 11, 0, 0) +#include <rte_bus_pci.h> +#else +#include <pci_driver.h> +#endif + /* x86-64 and ARM userspace virtual addresses use only the low 48 bits [0..47], * which is enough to cover 256 TB. */ -- David Marchand
Hello,
Quoted 10 lines · Changpeng
I tried the above DPDK patches, and got the following errors:
pci.c:115:7: error: call to ‘rte_pci_read_config’ declared with attribute error: Symbol is not public ABI
115 | rc = rte_pci_read_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pci.c: In function ‘cfg_write_rte’: pci.c:125:7: error: call to ‘rte_pci_write_config’ declared with attribute error: Symbol is not public ABI 125 | rc = rte_pci_write_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 3 lines
pci.c: In function ‘register_rte_driver’:
pci.c:375:2: error: call to ‘rte_pci_register’ declared with attribute error: Symbol is not public ABI
375 |rte_pci_register(&driver->driver);
I should have got this warning... but compilation passed fine for me. Happy you tested it.
Quoted 3 lines
We may use the new added API to replace
rte_pci_write_configandrte_pci_read_config, but SPDK do requirerte_pci_register().
Since SPDK has a PCI driver, you'll need to compile code that calls those PCI driver internal API with ALLOW_INTERNAL_API defined. You can probably add a #define ALLOW_INTERNAL_API first thing (it's important to have it defined before including any dpdk header) in pci.c
Another option, is to add it to lib/env_dpdk/env.mk:ENV_CFLAGS = $(DPDK_INC) -DALLOW_EXPERIMENTAL_API.
Can someone from SPDK take over this and sync with Chenbo?
Thanks.
Signature · 1 line
David Marchand
Thanks, I have worked with Chenbo to address this issue before. After enable the ALLOW_INTERNAL_API option, it works now with SPDK.
Another issue raised by Jim Harris is that for distro packaged DPDK, since this option isn't enabled by default, this will not allow SPDK to use the distro packaged DPDK after this release.
Quoted 54 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, October 8, 2021 3:08 PM
To: Liu, Changpeng <[email protected]>
Cc: Xia, Chenbo <[email protected]>; Harris, James R <[email protected]>; [email protected]; [email protected]; Aaron Conole <[email protected]>; dpdklab <[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsHello,
Quoted 4 lines · Changpeng
I tried the above DPDK patches, and got the following errors:
pci.c:115:7: error: call to ‘rte_pci_read_config’ declared with attribute error:
Symbol is not public ABI
Quoted 4 lines
115 | rc = rte_pci_read_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pci.c: In function ‘cfg_write_rte’:
pci.c:125:7: error: call to ‘rte_pci_write_config’ declared with attribute error:Symbol is not public ABI
Quoted 4 lines
125 | rc = rte_pci_write_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pci.c: In function ‘register_rte_driver’:
pci.c:375:2: error: call to ‘rte_pci_register’ declared with attribute error:Symbol is not public ABI
Quoted 1 line
375 | rte_pci_register(&driver->driver);I should have got this warning... but compilation passed fine for me. Happy you tested it.
Quoted 2 lines
We may use the new added API to replace
rte_pci_write_configand
rte_pci_read_config, but SPDKQuoted 1 line
do require
rte_pci_register().Since SPDK has a PCI driver, you'll need to compile code that calls those PCI driver internal API with
ALLOW_INTERNAL_APIdefined. You can probably add a #defineALLOW_INTERNAL_APIfirst thing (it's important to have it defined before including any dpdk header) inpci.cAnother option, is to add it to lib/env_dpdk/env.mk:ENV_CFLAGS = $(DPDK_INC) -DALLOW_EXPERIMENTAL_API.
Can someone from SPDK take over this and sync with Chenbo?
Thanks.
--
David Marchand
Hi David & Changpeng,
Quoted 10 lines
-----Original Message-----
From: Liu, Changpeng <[email protected]>
Sent: Friday, October 8, 2021 3:45 PM
To: David Marchand <[email protected]>; Harris, James R <[email protected]>
Cc: Xia, Chenbo <[email protected]>; [email protected]; [email protected]; Aaron Conole <[email protected]>; dpdklab <[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs
Quoted 6 lines
Thanks, I have worked with Chenbo to address this issue before. After enable the
ALLOW_INTERNAL_APIoption, it works now with SPDK.Another issue raised by Jim Harris is that for distro packaged DPDK, since this option isn't enabled by default, this will not allow SPDK to use the distro packaged DPDK after this release.
I think for this problem, we have two options: enable driver sdk by default or let OSV configure the option when building distros. I'm fine with either option.
@David, What do you think?
Thanks,
Chenbo
Quoted 59 lines
Quoted 14 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, October 8, 2021 3:08 PM
To: Liu, Changpeng <[email protected]>
Cc: Xia, Chenbo <[email protected]>; Harris, James R <[email protected]>; [email protected]; [email protected]; Aaron Conole <[email protected]>; dpdklab <[email protected]>; Zawadzki, Tomasz <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIsHello,
On Fri, Oct 8, 2021 at 8:15 AM Liu, Changpeng <[email protected]>
Quoted 4 lines · wrote:
Quoted 4 lines
I tried the above DPDK patches, and got the following errors:
pci.c:115:7: error: call to ‘rte_pci_read_config’ declared with attribute
error:
Quoted 5 lines
Symbol is not public ABI
Quoted 4 lines
115 | rc = rte_pci_read_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pci.c: In function ‘cfg_write_rte’:
pci.c:125:7: error: call to ‘rte_pci_write_config’ declared with attributeerror:
Quoted 5 lines
Symbol is not public ABI
Quoted 4 lines
125 | rc = rte_pci_write_config(dev->dev_handle, value, len, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pci.c: In function ‘register_rte_driver’:
pci.c:375:2: error: call to ‘rte_pci_register’ declared with attributeerror:
Quoted 27 lines
Symbol is not public ABI
Quoted 1 line
375 | rte_pci_register(&driver->driver);I should have got this warning... but compilation passed fine for me. Happy you tested it.
Quoted 2 lines
We may use the new added API to replace
rte_pci_write_configand
rte_pci_read_config, but SPDKQuoted 1 line
do require
rte_pci_register().Since SPDK has a PCI driver, you'll need to compile code that calls those PCI driver internal API with
ALLOW_INTERNAL_APIdefined. You can probably add a #defineALLOW_INTERNAL_APIfirst thing (it's important to have it defined before including any dpdk header) inpci.cAnother option, is to add it to lib/env_dpdk/env.mk:ENV_CFLAGS = $(DPDK_INC) -DALLOW_EXPERIMENTAL_API.
Can someone from SPDK take over this and sync with Chenbo?
Thanks.
--
David Marchand
11/10/2021 08:58, Xia, Chenbo:
Quoted 7 lines
From: Liu, Changpeng <[email protected]>
Quoted 3 lines
Another issue raised by Jim Harris is that for distro packaged DPDK, since this option isn't enabled by default, this will not allow SPDK to use the distro packaged DPDK after this release.
I think for this problem, we have two options: enable driver sdk by default or let OSV configure the option when building distros. I'm fine with either option.
The meson option enable_driver_sdk is described as "Install headers to build drivers." Standard development packages should provide headers to build an application. This option is for projects extending DPDK drivers out of the tree.
The preferred option is to develop drivers inside DPDK.
If a project needs the special option enable_driver_sdk, 1/ it is not following the recommended approach,
2/ it has to manage the burden of driver compatibility with DPDK, 3/ it can compile DPDK itself.
So I think we neither need to make it a default, nor force distros to enable it. Am I missing something?
On 10/11/21, 5:55 AM, "Thomas Monjalon" <[email protected]> wrote:
11/10/2021 08:58, Xia, Chenbo:
> From: Liu, Changpeng <[email protected]>
> > Another issue raised by Jim Harris is that for distro packaged DPDK, since > > this option isn't enabled by default, this will not allow SPDK
> > to use the distro packaged DPDK after this release.
>
> I think for this problem, we have two options: enable driver sdk by default or > let OSV configure the option when building distros. I'm fine with either option.
The meson option enable_driver_sdk is described as "Install headers to build drivers." Standard development packages should provide headers to build an application. This option is for projects extending DPDK drivers out of the tree.
The preferred option is to develop drivers inside DPDK.
If a project needs the special option enable_driver_sdk, 1/ it is not following the recommended approach,
2/ it has to manage the burden of driver compatibility with DPDK, 3/ it can compile DPDK itself.
So I think we neither need to make it a default, nor force distros to enable it. Am I missing something?
Hi Thomas,
This preference to develop PCI drivers inside of DPDK seems to be a very recent preference. enable_driver_sdk was just added in DPDK 21.05, and for building out-of-tree ethdev drivers. But DPDK has always enabled building out-of-tree PCI drivers with its default build configuration - SPDK has relied on these APIs since its inception.
We have always viewed DPDK as being a very useful toolkit for building userspace drivers (especially storage drivers!) that aren't part of DPDK itself. We hope that continues to be the case.
All of that being said, SPDK already compiles DPDK itself as the default configuration. We maintain a DPDK fork for patches that have not yet hit DPDK upstream. If this gets merged we can document that users building DPDK themselves must set enable_driver_sdk. We can also document to our users that SPDK may not build against distro DPDK packages, once distros pick up these changes.
-Jim
12/10/2021 02:35, Harris, James R:
Quoted 21 lines
On 10/11/21, 5:55 AM, "Thomas Monjalon" <[email protected]> wrote:
11/10/2021 08:58, Xia, Chenbo:
> From: Liu, Changpeng <[email protected]>
> > Another issue raised by Jim Harris is that for distro packaged DPDK, since > > this option isn't enabled by default, this will not allow SPDK
> > to use the distro packaged DPDK after this release.
>
> I think for this problem, we have two options: enable driver sdk by default or > let OSV configure the option when building distros. I'm fine with either option.The meson option
enable_driver_sdkis described as "Install headers to build drivers." Standard development packages should provide headers to build an application. This option is for projects extending DPDK drivers out of the tree.
The preferred option is to develop drivers inside DPDK.If a project needs the special option
enable_driver_sdk, 1/ it is not following the recommended approach,
2/ it has to manage the burden of driver compatibility with DPDK, 3/ it can compile DPDK itself.
Quoted 6 lines
So I think we neither need to make it a default, nor force distros to enable it. Am I missing something?
Hi Thomas,
This preference to develop PCI drivers inside of DPDK seems to be a very recent preference.
enable_driver_sdkwas just added in DPDK 21.05, and for building out-of-tree ethdev drivers. But DPDK has always enabled building out-of-tree PCI drivers with its default build configuration - SPDK has relied on these APIs since its inception.
Yes DPDK allows out-of-tree drivers, but it has never been recommended.
We have introduced enable_driver_sdk option recently to keep allowing out-of-tree drivers.
Quoted 1 line
We have always viewed DPDK as being a very useful toolkit for building userspace drivers (especially storage drivers!) that aren't part of DPDK itself. We hope that continues to be the case.
Yes, there is no plan to stop that, but also no plan to make it easier.
Quoted 1 line
All of that being said, SPDK already compiles DPDK itself as the default configuration. We maintain a DPDK fork for patches that have not yet hit DPDK upstream. If this gets merged we can document that users building DPDK themselves must set
enable_driver_sdk. We can also document to our users that SPDK may not build against distro DPDK packages, once distros pick up these changes.
Yes I think that's the right thing to do.
Note: I don't remember the reason to keep your drivers out of DPDK?
Quoted 22 lines
From: dev <[email protected]> On Behalf Of Thomas Monjalon
12/10/2021 02:35, Harris, James R:
Quoted 3 lines
On 10/11/21, 5:55 AM, "Thomas Monjalon" <[email protected]> wrote:
The meson option
enable_driver_sdkis described as "Install headers to builddrivers."
Quoted 1 line
Standard development packages should provide headers to build an
application.
Quoted 13 lines
This option is for projects extending DPDK drivers out of the tree. The preferred option is to develop drivers inside DPDK.
If a project needs the special option
enable_driver_sdk, 1/ it is not following the recommended approach,
2/ it has to manage the burden of driver compatibility with DPDK, 3/ it can compile DPDK itself.So I think we neither need to make it a default, nor force distros to enable it. Am I missing something?
Hi Thomas,
Quoted 7 lines
Quoted 1 line
This preference to develop PCI drivers inside of DPDK seems to be a very
recent preference.
enable_driver_sdkwas just added in DPDK 21.05, and for building out-of-tree ethdev drivers. But DPDK has always enabled building out- of-tree PCI drivers with its default build configuration - SPDK has relied on these APIs since its inception.Yes DPDK allows out-of-tree drivers, but it has never been recommended.
For networking drivers, maybe. But certainly years and years ago when SPDK was started no one recommended putting an nvme driver into DPDK.
Quoted 8 lines
We have introduced
enable_driver_sdkoption recently to keep allowing out-of- tree drivers.Quoted 1 line
We have always viewed DPDK as being a very useful toolkit for building
userspace drivers (especially storage drivers!) that aren't part of DPDK itself. We hope that continues to be the case.
Yes, there is no plan to stop that, but also no plan to make it easier.
To be clear, this change actively makes it harder. DPDK has changed the longstanding status quo.
Quoted 10 lines
Quoted 2 lines
All of that being said, SPDK already compiles DPDK itself as the default
configuration. We maintain a DPDK fork for patches that have not yet hit DPDK upstream. If this gets merged we can document that users building DPDK themselves must set
enable_driver_sdk. We can also document to our users that SPDK may not build against distro DPDK packages, once distros pick up these changes.Yes I think that's the right thing to do.
This means that a distro-packaged SPDK cannot exist, because it cannot use a distro-packaged DPDK as a dependency. While using a distro-packaged SPDK is not the common case (people just build it themselves), my personal view is that we need to be able to support this and this change from DPDK is unacceptable.
Quoted 1 line
Note: I don't remember the reason to keep your drivers out of DPDK?
SPDK uses DPDK as a framework for writing user space drivers only - scanning the PCI bus, allocating DMA-safe memory, etc. This functionality is hidden behind an abstraction layer that can be reimplemented by our users to remove the DPDK dependency entirely, and real production users have elected to do this. The reasons they do this are varied, but the shortest way to say it is that DPDK is a framework that requires their application to buy-in across the board, whereas SPDK is a set of libraries that integrates into their existing application more easily.
SPDK simply uses DPDK as the default implementation for this functionality. We cannot port our drivers into DPDK or it would break this use case.
Thanks,
Ben
12/10/2021 18:59, Walker, Benjamin:
Quoted 22 lines
Quoted 22 lines
From: dev <[email protected]> On Behalf Of Thomas Monjalon 12/10/2021 02:35, Harris, James R:
Quoted 3 lines
On 10/11/21, 5:55 AM, "Thomas Monjalon" <[email protected]> wrote:
The meson option
enable_driver_sdkis described as "Install headers to builddrivers."
Quoted 1 line
Standard development packages should provide headers to build an
application.
Quoted 14 lines
This option is for projects extending DPDK drivers out of the tree. The preferred option is to develop drivers inside DPDK.
If a project needs the special option
enable_driver_sdk, 1/ it is not following the recommended approach,
2/ it has to manage the burden of driver compatibility with DPDK, 3/ it can compile DPDK itself.So I think we neither need to make it a default, nor force distros to enable it. Am I missing something?
Hi Thomas,
This preference to develop PCI drivers inside of DPDK seems to be a very
Quoted 8 lines
Quoted 6 lines
recent preference.
enable_driver_sdkwas just added in DPDK 21.05, and for building out-of-tree ethdev drivers. But DPDK has always enabled building out- of-tree PCI drivers with its default build configuration - SPDK has relied on these APIs since its inception.Yes DPDK allows out-of-tree drivers, but it has never been recommended.
For networking drivers, maybe. But certainly years and years ago when SPDK was started no one recommended putting an nvme driver into DPDK.
No one from SPDK project proposed such thing. I asked several times in person why that, and even the DPDK techboard asked for such a merge:
https://mails.dpdk.org/archives/dev/2018-December/120706.html
The reply:
http://inbox.dpdk.org/dev/20181217141030.bhe5pwlqnzb3w3i7@platinum/
Even older question in 2015:
http://inbox.dpdk.org/dev/6421280.5XkMhqyP4M@xps13/
Quoted 10 lines
Quoted 8 lines
We have introduced
enable_driver_sdkoption recently to keep allowing out-of- tree drivers.Quoted 1 line
We have always viewed DPDK as being a very useful toolkit for building
userspace drivers (especially storage drivers!) that aren't part of DPDK itself. We hope that continues to be the case.
Yes, there is no plan to stop that, but also no plan to make it easier.
To be clear, this change actively makes it harder. DPDK has changed the longstanding status quo.
Yes it requires a compilation option.
Quoted 10 lines
Quoted 8 lines
Quoted 1 line
All of that being said, SPDK already compiles DPDK itself as the default
configuration. We maintain a DPDK fork for patches that have not yet hit DPDK upstream. If this gets merged we can document that users building DPDK themselves must set
enable_driver_sdk. We can also document to our users that SPDK may not build against distro DPDK packages, once distros pick up these changes.Yes I think that's the right thing to do.
This means that a distro-packaged SPDK cannot exist, because it cannot use a distro-packaged DPDK as a dependency.
I don't think so.
Once SPDK is packaged, what do you need from DPDK?
I think you need only .so files for some libs like EAL and PCI, so that's available in the DPDK package, right?
Quoted 2 lines
While using a distro-packaged SPDK is not the common case (people just build it themselves), my personal view is that we need to be able to support this and this change from DPDK is unacceptable.
I agree you should be able to package SPDK.
Quoted 8 lines
Quoted 1 line
Note: I don't remember the reason to keep your drivers out of DPDK?
SPDK uses DPDK as a framework for writing user space drivers only - scanning the PCI bus, allocating DMA-safe memory, etc. This functionality is hidden behind an abstraction layer that can be reimplemented by our users to remove the DPDK dependency entirely, and real production users have elected to do this. The reasons they do this are varied, but the shortest way to say it is that DPDK is a framework that requires their application to buy-in across the board, whereas SPDK is a set of libraries that integrates into their existing application more easily.
SPDK simply uses DPDK as the default implementation for this functionality. We cannot port our drivers into DPDK or it would break this use case.
Thanks,
Ben
Quoted 5 lines
From: Thomas Monjalon <[email protected]>
12/10/2021 18:59, Walker, Benjamin:Quoted 1 line
For networking drivers, maybe. But certainly years and years ago when SPDK
was started no one recommended putting an nvme driver into DPDK.
Quoted 9 lines
No one from SPDK project proposed such thing.
I asked several times in person why that, and even the DPDK techboard asked for such a merge:
https://mails.dpdk.org/archives/dev/2018-December/120706.html
The reply:
http://inbox.dpdk.org/dev/20181217141030.bhe5pwlqnzb3w3i7@platinum/
Even older question in 2015:
http://inbox.dpdk.org/dev/6421280.5XkMhqyP4M@xps13/
For my part in these discussions, it was always about merging the governance of the projects rather than the code. I don't think a merger even occurred to anyone I spoke with during that - certainly it didn't to me. SPDK is huge and beyond its use of EAL/PCI doesn't share much in common with the rest of DPDK (SPDK uses lightweight green threading, all virtual addresses, etc.). Anyway, as I pointed out one of our key use cases for several users is the ability to replace DPDK entirely, so merging isn't an option.
Quoted 8 lines
Quoted 1 line
This means that a distro-packaged SPDK cannot exist, because it cannot use a
distro-packaged DPDK as a dependency.
I don't think so.
Once SPDK is packaged, what do you need from DPDK?
I think you need only .so files for some libs like EAL and PCI, so that's available in the DPDK package, right?
So is DPDK committed to maintaining the existing ABI, such that the necessary symbols are still exported even when enable_driver_sdk is off? This option will, into the foreseeable future, only impact the installation of those header files? If that's the case, we can just copy the header file into SPDK, as could anyone else that wants to continue using DPDK to implement out of tree drivers. Can you clarify if something like this scheme would be considered a supported use of DPDK?
Thanks,
Ben
12/10/2021 21:26, Walker, Benjamin:
Quoted 15 lines
Quoted 5 lines
From: Thomas Monjalon <[email protected]>
12/10/2021 18:59, Walker, Benjamin:Quoted 1 line
For networking drivers, maybe. But certainly years and years ago when SPDK
was started no one recommended putting an nvme driver into DPDK.
Quoted 9 lines
No one from SPDK project proposed such thing.
I asked several times in person why that, and even the DPDK techboard asked for such a merge:
https://mails.dpdk.org/archives/dev/2018-December/120706.html
The reply:
http://inbox.dpdk.org/dev/20181217141030.bhe5pwlqnzb3w3i7@platinum/
Even older question in 2015:
http://inbox.dpdk.org/dev/6421280.5XkMhqyP4M@xps13/
Quoted 1 line
For my part in these discussions, it was always about merging the governance of the projects rather than the code. I don't think a merger even occurred to anyone I spoke with during that - certainly it didn't to me. SPDK is huge and beyond its use of EAL/PCI doesn't share much in common with the rest of DPDK (SPDK uses lightweight green threading, all virtual addresses, etc.). Anyway, as I pointed out one of our key use cases for several users is the ability to replace DPDK entirely, so merging isn't an option.
OK I understand, that's clear.
I would be interesting to know if the NVMe drivers could be split in two parts:
one part in DPDK, and the other part in SPDK for the non-DPDK case. I ask because it may ease things for DPDK integration in SPDK. There is probably a cost for the SPDK project, so it could be interesting to compare pros and cons, if possible at all.
Quoted 9 lines
Quoted 8 lines
Quoted 1 line
This means that a distro-packaged SPDK cannot exist, because it cannot use a
distro-packaged DPDK as a dependency.
I don't think so.
Once SPDK is packaged, what do you need from DPDK?
I think you need only .so files for some libs like EAL and PCI, so that's available in the DPDK package, right?
Quoted 3 lines
So is DPDK committed to maintaining the existing ABI, such that the necessary symbols are still exported even when
enable_driver_sdkis off?
Symbols required by drivers are necessarily exported. Do you think I am missing something?
Do you need EAL internal functions?
We should check which functions are called by SPDK, because there is a trend to export less functions if not needed.
Quoted 2 lines
This option will, into the foreseeable future, only impact the installation of those header files?
I don't see what else it could impact.
Quoted 4 lines
If that's the case, we can just copy the header file into SPDK,
as could anyone else that wants to continue using DPDK
to implement out of tree drivers.
Can you clarify if something like this scheme would be considered a supported use of DPDK?
DPDK can be used by anybody as far as the (permissive) license is respected. I consider copying files as a source of sync issues, but you are free.
In order to be perfectly clear, all the changes done
around this option enable_driver_sdk share the goal of tidying stuff in DPDK so that ABI becomes better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorry about that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.
Thanks for your understanding
Quoted 11 lines
From: Thomas Monjalon <[email protected]>
In order to be perfectly clear, all the changes done around this option
enable_driver_sdkshare the goal of tidying stuff in DPDK so that ABI becomes better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorry about that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.Thanks for your understanding
I completely understand the desire to make the ABI manageable. If I were in your shoes, I'd be doing the same exact thing. What I don't currently understand is the motivation behind this enable_driver_sdk option. My guess is that it's one of two things.
\1 ABI manageability: You say that's the purpose above, and that was my initial assumption. But wouldn't that necessarily mean, over time, no longer considering the symbols that were defined by the header files as part of the stable ABI? If you still consider these symbols as part of the ABI in shared library builds, then the enable_driver_sdk option does absolutely nothing to improve the ABI situation, so why bother to have it at all? We can't have packaged SPDK relying on symbols in a packaged DPDK that are not part of the official ABI. \2 Not supporting out-of-tree drivers: Another option is that you just don't want people writing out of tree drivers. You can't just drop it outright because people already do it, but you'd like to not support it for shared library builds at least.
So I'd like to really understand which of these two motivated the enable_driver_sdk option . Maybe it's not even one of the two above. If it is #1, then I think maybe we can work with DPDK to define a very small set of out-of-tree driver APIs/ABIs that need to continue to exist in the shared libraries by default. I do think SPDK needs only a very small number. If it's #2, then that's the entire SPDK use case and I'd ask you to reconsider the direction.
Thanks,
Ben
13/10/2021 19:56, Walker, Benjamin:
Quoted 10 lines
Quoted 10 lines
From: Thomas Monjalon <[email protected]>
In order to be perfectly clear, all the changes done around this option
enable_driver_sdkshare the goal of tidying stuff in DPDK so that ABI becomes better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorry about that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.
Quoted 5 lines
Quoted 1 line
Thanks for your understanding
I completely understand the desire to make the ABI manageable. If I were in your shoes, I'd be doing the same exact thing. What I don't currently understand is the motivation behind this
enable_driver_sdkoption. My guess is that it's one of two things.\1 ABI manageability: You say that's the purpose above, and that was my initial assumption. But wouldn't that necessarily mean, over time, no longer considering the symbols that were defined by the header files as part of the stable ABI?
Absolutely. The idea is that we don't guarantee ABI for the drivers.
Quoted 3 lines
If you still consider these symbols as part of the ABI in shared library builds, then the
enable_driver_sdkoption does absolutely nothing to improve the ABI situation, so why bother to have it at all? We can't have packaged SPDK relying on symbols in a packaged DPDK that are not part of the official ABI.\2 Not supporting out-of-tree drivers: Another option is that you just don't want people writing out of tree drivers.
We don't want complications due to support of out-of-tree drivers, but we don't want to forbid them.
Quoted 2 lines
You can't just drop it outright because people already do it, but you'd like to not support it for shared library builds at least.
I didn't think about it in these terms.
But saying we don't offer compatibility for shared library drivers is not too far of "no support" indeed.
Quoted 1 line
So I'd like to really understand which of these two motivated the
enable_driver_sdkoption . Maybe it's not even one of the two above. If it is #1, then I think maybe we can work with DPDK to define a very small set of out-of-tree driver APIs/ABIs that need to continue to exist in the shared libraries by default. I do think SPDK needs only a very small number. If it's #2, then that's the entire SPDK use case and I'd ask you to reconsider the direction.
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
We've added a task to our backlog to propose a stable ABI for out of tree drivers here. It's not as simple as just keeping a couple of the existing functions - we're currently manipulating structures directly. We'll need to work a bit to design the simplest possible set of functions that we need.
14/10/2021 00:48, Walker, Benjamin:
Quoted 6 lines
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
We've added a task to our backlog to propose a stable ABI for out of tree drivers here. It's not as simple as just keeping a couple of the existing functions - we're currently manipulating structures directly. We'll need to work a bit to design the simplest possible set of functions that we need.
OK thanks
9 months have passed. Do you have any news from SPDK side?
14/10/2021 08:41, Thomas Monjalon:
Quoted 9 lines
14/10/2021 00:48, Walker, Benjamin:
Quoted 6 lines
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
We've added a task to our backlog to propose a stable ABI for out of tree drivers here. It's not as simple as just keeping a couple of the existing functions - we're currently manipulating structures directly. We'll need to work a bit to design the simplest possible set of functions that we need.
OK thanks
Hi Thomas,
Quoted 65 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, October 14, 2021 3:00 AM
To: Harris, James R <[email protected]>; Walker, Benjamin <[email protected]>
Cc: Liu, Changpeng <[email protected]>; Xia, Chenbo <[email protected]>; David Marchand <[email protected]>; [email protected]; Aaron Conole <[email protected]>; Zawadzki, Tomasz <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs13/10/2021 19:56, Walker, Benjamin:
Quoted 4 lines
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
In order to be perfectly clear, all the changes done around this option
enable_driver_sdkshare the goal of tidying stuff in DPDK so that ABIbecomes
Quoted 3 lines
Quoted 3 lines
better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorryabout
Quoted 6 lines
Quoted 4 lines
that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.
Thanks for your understanding
I completely understand the desire to make the ABI manageable. If I were in
your shoes, I'd be doing the same exact thing. What I don't currently understand is the motivation behind this
enable_driver_sdkoption. My guess is that it's one of two things.Quoted 2 lines
\1 ABI manageability: You say that's the purpose above, and that was my
initial assumption. But wouldn't that necessarily mean, over time, no longer considering the symbols that were defined by the header files as part of the stable ABI?
Absolutely. The idea is that we don't guarantee ABI for the drivers.
Quoted 1 line
If you still consider these symbols as part of the ABI in shared library
builds, then the
enable_driver_sdkoption does absolutely nothing to improve the ABI situation, so why bother to have it at all? We can't have packaged SPDK relying on symbols in a packaged DPDK that are not part of the official ABI.Quoted 1 line
\2 Not supporting out-of-tree drivers: Another option is that you just don't
want people writing out of tree drivers.
We don't want complications due to support of out-of-tree drivers, but we don't want to forbid them.
Quoted 2 lines
You can't just drop it outright because people already do it, but you'd like to not support it for shared library builds at least.
I didn't think about it in these terms.
But saying we don't offer compatibility for shared library drivers is not too far of "no support" indeed.Quoted 1 line
So I'd like to really understand which of these two motivated the
enable_driver_sdkoption . Maybe it's not even one of the two above. If it is #1, then I think maybe we can work with DPDK to define a very small set of out-of-tree driver APIs/ABIs that need to continue to exist in the shared libraries by default. I do think SPDK needs only a very small number. If it's #2, then that's the entire SPDK use case and I'd ask you to reconsider the direction.
Quoted 2 lines
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers but could have driver ABI in the future?
Thanks,
Chenbo
Quoted 1 line
14/10/2021 04:21, Xia, Chenbo:
Quoted 55 lines
From: Thomas Monjalon <[email protected]>
Quoted 54 lines
13/10/2021 19:56, Walker, Benjamin:
Quoted 4 lines
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
In order to be perfectly clear, all the changes done around this option
enable_driver_sdkshare the goal of tidying stuff in DPDK so that ABIbecomes
Quoted 3 lines
Quoted 3 lines
better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorryabout
Quoted 6 lines
Quoted 4 lines
that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.
Thanks for your understanding
I completely understand the desire to make the ABI manageable. If I were in
your shoes, I'd be doing the same exact thing. What I don't currently understand is the motivation behind this
enable_driver_sdkoption. My guess is that it's one of two things.Quoted 2 lines
\1 ABI manageability: You say that's the purpose above, and that was my
initial assumption. But wouldn't that necessarily mean, over time, no longer considering the symbols that were defined by the header files as part of the stable ABI?
Absolutely. The idea is that we don't guarantee ABI for the drivers.
Quoted 1 line
If you still consider these symbols as part of the ABI in shared library
builds, then the
enable_driver_sdkoption does absolutely nothing to improve the ABI situation, so why bother to have it at all? We can't have packaged SPDK relying on symbols in a packaged DPDK that are not part of the official ABI.Quoted 1 line
\2 Not supporting out-of-tree drivers: Another option is that you just don't
want people writing out of tree drivers.
We don't want complications due to support of out-of-tree drivers, but we don't want to forbid them.
Quoted 2 lines
You can't just drop it outright because people already do it, but you'd like to not support it for shared library builds at least.
I didn't think about it in these terms.
But saying we don't offer compatibility for shared library drivers is not too far of "no support" indeed.Quoted 1 line
So I'd like to really understand which of these two motivated the
enable_driver_sdkoption . Maybe it's not even one of the two above. If it is #1, then I think maybe we can work with DPDK to define a very small set of out-of-tree driver APIs/ABIs that need to continue to exist in the shared libraries by default. I do think SPDK needs only a very small number. If it's #2, then that's the entire SPDK use case and I'd ask you to reconsider the direction.
Quoted 4 lines
Quoted 2 lines
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Yes
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.
Quoted 81 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, October 14, 2021 2:42 PM
To: Harris, James R <[email protected]>; Walker, Benjamin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: Liu, Changpeng <[email protected]>; David Marchand <[email protected]>; [email protected]; Aaron Conole <[email protected]>; Zawadzki, Tomasz <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs14/10/2021 04:21, Xia, Chenbo:
Quoted 5 lines
From: Thomas Monjalon <[email protected]>
Quoted 4 lines
13/10/2021 19:56, Walker, Benjamin:
Quoted 3 lines
Quoted 3 lines
From: Thomas Monjalon <[email protected]>
In order to be perfectly clear, all the changes done around this
option
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
enable_driver_sdkshare the goal of tidying stuff in DPDK so that ABIbecomes
Quoted 3 lines
Quoted 3 lines
better manageable.
I think that nobody want to annoy the SPDK project.
I understand that the changes effectively add troubles, and I am sorryQuoted 7 lines
Quoted 7 lines
about
Quoted 6 lines
Quoted 4 lines
that. If SPDK and other projects can manage with this change, good. If there is a real blocker, we should discuss what are the options.
Thanks for your understanding
I completely understand the desire to make the ABI manageable. If I were
in
Quoted 2 lines
Quoted 2 lines
your shoes, I'd be doing the same exact thing. What I don't currently understand is the motivation behind this
enable_driver_sdkoption. Myguess is
Quoted 4 lines
Quoted 4 lines
that it's one of two things.
Quoted 2 lines
\1 ABI manageability: You say that's the purpose above, and that was my
initial assumption. But wouldn't that necessarily mean, over time, no
longer
Quoted 1 line
Quoted 1 line
considering the symbols that were defined by the header files as part of
the
Quoted 6 lines
Quoted 6 lines
stable ABI?
Absolutely. The idea is that we don't guarantee ABI for the drivers.
Quoted 1 line
If you still consider these symbols as part of the ABI in shared library
builds, then the
enable_driver_sdkoption does absolutely nothing toimprove
Quoted 2 lines
Quoted 2 lines
the ABI situation, so why bother to have it at all? We can't have packaged SPDK relying on symbols in a packaged DPDK that are not part of the
official
Quoted 3 lines
Quoted 3 lines
ABI.
Quoted 1 line
\2 Not supporting out-of-tree drivers: Another option is that you just
don't
Quoted 8 lines
Quoted 8 lines
want people writing out of tree drivers.
We don't want complications due to support of out-of-tree drivers, but we don't want to forbid them.
Quoted 2 lines
You can't just drop it outright because people already do it, but you'd like to not support it for shared library builds at least.
Quoted 6 lines
Quoted 6 lines
I didn't think about it in these terms.
But saying we don't offer compatibility for shared library drivers is not too far of "no support" indeed.Quoted 1 line
So I'd like to really understand which of these two motivated the
enable_driver_sdkoption . Maybe it's not even one of the two above. If itis
Quoted 3 lines
Quoted 3 lines
#1, then I think maybe we can work with DPDK to define a very small set of out-of-tree driver APIs/ABIs that need to continue to exist in the shared libraries by default. I do think SPDK needs only a very small number. If
it's
Quoted 7 lines
Quoted 5 lines
#2, then that's the entire SPDK use case and I'd ask you to reconsider the direction.
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Quoted 7 lines
Yes
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.
So the problem here is exposing some APIs to SPDK directly? Without the 'enable_driver_sdk' option, I don't see a solution of both exposed and not-ABI. Any idea in your mind?
Thanks,
Chenbo
Quoted 2 lines
14/10/2021 09:00, Xia, Chenbo:
Quoted 10 lines
From: Thomas Monjalon <[email protected]>
Quoted 9 lines
14/10/2021 04:21, Xia, Chenbo:
Quoted 5 lines
From: Thomas Monjalon <[email protected]>
Quoted 2 lines
Yes I think we need to agree on functions to keep as-is for compatibility. Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Yes
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.So the problem here is exposing some APIs to SPDK directly? Without the '
enable_driver_sdk' option, I don't see a solution of both exposed and not-ABI. Any idea in your mind?
No the idea is to keep using enable_driver_sdk.
But so far, there is no compatibility guarantee for driver SDK.
The discussion is about which basic compatibility requirement is needed for SPDK.
Quoted 29 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, October 14, 2021 3:08 PM
To: Harris, James R <[email protected]>; Walker, Benjamin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: Liu, Changpeng <[email protected]>; David Marchand <[email protected]>; [email protected]; Aaron Conole <[email protected]>; Zawadzki, Tomasz <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs14/10/2021 09:00, Xia, Chenbo:
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Quoted 3 lines
14/10/2021 04:21, Xia, Chenbo:
Quoted 2 lines
From: Thomas Monjalon <[email protected]>
Quoted 1 line
Yes I think we need to agree on functions to keep as-is for
compatibility.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Yes
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.So the problem here is exposing some APIs to SPDK directly? Without the
Quoted 8 lines
'
enable_driver_sdk'Quoted 1 line
option, I don't see a solution of both exposed and not-ABI. Any idea in your
mind?
No the idea is to keep using
enable_driver_sdk.
But so far, there is no compatibility guarantee for driver SDK. The discussion is about which basic compatibility requirement is needed for SPDK.
Sorry for not understanding your point quickly, but what's the difference of 'general compatibility' and 'basic compatibility'? Because in my mind, one struct or function should either be ABI-compatible or not. Could you help explain it a bit?
Thanks,
Chenbo
Quoted 2 lines
14/10/2021 10:07, Xia, Chenbo:
Quoted 29 lines
From: Thomas Monjalon <[email protected]>
Quoted 19 lines
14/10/2021 09:00, Xia, Chenbo:
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Quoted 3 lines
14/10/2021 04:21, Xia, Chenbo:
Quoted 2 lines
From: Thomas Monjalon <[email protected]>
Quoted 1 line
Yes I think we need to agree on functions to keep as-is for
compatibility.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Yes
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.So the problem here is exposing some APIs to SPDK directly? Without the
Quoted 8 lines
'
enable_driver_sdk'Quoted 1 line
option, I don't see a solution of both exposed and not-ABI. Any idea in your
mind?
No the idea is to keep using
enable_driver_sdk.
But so far, there is no compatibility guarantee for driver SDK. The discussion is about which basic compatibility requirement is needed for SPDK.
Quoted 4 lines
Sorry for not understanding your point quickly, but what's the difference of 'general compatibility' and 'basic compatibility'? Because in my mind, one struct or function should either be ABI-compatible or not. Could you help explain it a bit?
I wonder whether we could have a guarantee for a subset of structs and functions. Anyway, this is just opening the discussion to collect some inputs first. Then we'll have to check what is possible and get a techboard approval.
Quoted 45 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, October 14, 2021 4:26 PM
To: Harris, James R <[email protected]>; Walker, Benjamin <[email protected]>; Xia, Chenbo <[email protected]>
Cc: Liu, Changpeng <[email protected]>; David Marchand <[email protected]>; [email protected]; Aaron Conole <[email protected]>; Zawadzki, Tomasz <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs14/10/2021 10:07, Xia, Chenbo:
Quoted 22 lines
From: Thomas Monjalon <[email protected]>
Quoted 21 lines
14/10/2021 09:00, Xia, Chenbo:
Quoted 4 lines
From: Thomas Monjalon <[email protected]>
Quoted 3 lines
14/10/2021 04:21, Xia, Chenbo:
Quoted 2 lines
From: Thomas Monjalon <[email protected]>
Quoted 1 line
Yes I think we need to agree on functions to keep as-is for
compatibility.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Waiting for your input please.
So, do you mean currently DPDK doesn't guarantee ABI for drivers
Yes
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
but could have driver ABI in the future?
I don't think so, not general compatibility,
but we can think about a way to avoid breaking SPDK specifically, which has less requirements.So the problem here is exposing some APIs to SPDK directly? Without the
'
enable_driver_sdk'Quoted 1 line
option, I don't see a solution of both exposed and not-ABI. Any idea in
your
Quoted 5 lines
Quoted 5 lines
mind?
No the idea is to keep using
enable_driver_sdk.
But so far, there is no compatibility guarantee for driver SDK. The discussion is about which basic compatibility requirement is neededfor
Quoted 5 lines
Quoted 1 line
SPDK.
Sorry for not understanding your point quickly, but what's the difference of 'general compatibility' and 'basic compatibility'? Because in my mind, one struct or function should either be ABI-compatible or not. Could you help
Quoted 8 lines
explain
Quoted 1 line
it a bit?
I wonder whether we could have a guarantee for a subset of structs and functions.
Anyway, this is just opening the discussion to collect some inputs first. Then we'll have to check what is possible and get a techboard approval.
After going through related code in SPDK, I think we can add some new functions and keep some macros in the exposed header (i.e., rte_bus_pci.h) for SPDK to register pci driver and get needed info.
Most structs/marocs will be hided and SPDK can use the new proposed APIs and small set of macros/structs to build. In this way, the problem of SPDK building with DPDK distros and ABI issue can both be solved. APIs like struct rte_pci_device and struct rte_pci_driver can be hided to minimize pci bus ABI.
Thomas & SPDK folks, please share your opinions of above.
Thanks,
Chenbo