[dpdk-dev,2/5] pci: Initialize common rte driver pointer

Message ID 20170420072402.38106-3-aik@ozlabs.ru (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Alexey Kardashevskiy April 20, 2017, 7:23 a.m. UTC
  The existing code initializes a PCI driver pointer but not the common one.
As the result, ring_dma_zone_reserve() in drivers/net/bnx2x/bnx2x_rxtx.c
crashed as dev->device->driver==NULL.

This adds missing initialization.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 lib/librte_eal/common/eal_common_pci.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Anatoly Burakov April 24, 2017, 9:28 a.m. UTC | #1
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Alexey
> Kardashevskiy
> Sent: Thursday, April 20, 2017 8:24 AM
> To: dev@dpdk.org
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>; JPF@zurich.ibm.com;
> Gowrishankar Muthukrishnan <gowrishankar.m@in.ibm.com>
> Subject: [dpdk-dev] [PATCH dpdk 2/5] pci: Initialize common rte driver
> pointer
> 
> The existing code initializes a PCI driver pointer but not the common one.
> As the result, ring_dma_zone_reserve() in drivers/net/bnx2x/bnx2x_rxtx.c
> crashed as dev->device->driver==NULL.
> 
> This adds missing initialization.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

This and 3rd patch - could you please split them so that there are no unrelated patches in the patchset? I.e. a patchset for VFIO changes, a separate patch for PCI, and a patch for bnx2x driver, and then just make a note in the annotation that they are interdependent.

Thanks,
Anatoly
  

Patch

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 6f0d4d8e4..b6b41be31 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -244,6 +244,7 @@  rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,
 
 	/* reference driver structure */
 	dev->driver = dr;
+	dev->device.driver = &dr->driver;
 
 	/* call the driver probe() function */
 	ret = dr->probe(dr, dev);