DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] vfio: do not use memcmp() to compare PCI address
@ 2017-03-31 15:56 Andrew Rybchenko
  2017-03-31 16:09 ` Sergio Gonzalez Monroy
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2017-03-31 15:56 UTC (permalink / raw)
  To: dev; +Cc: Anatoly Burakov, stable

PCI address structure has padding which may have garbage.

Fixes: 2f4adfad0a69 ("vfio: add multiprocess support")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
It is a real bug which I've hit during multi-process debugging.

 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
index 5f478c5..7d8b9fb 100644
--- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
+++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
@@ -355,7 +355,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 	} else {
 		/* if we're in a secondary process, just find our tailq entry */
 		TAILQ_FOREACH(vfio_res, vfio_res_list, next) {
-			if (memcmp(&vfio_res->pci_addr, &dev->addr, sizeof(dev->addr)))
+			if (rte_eal_compare_pci_addr(&vfio_res->pci_addr,
+						     &dev->addr))
 				continue;
 			break;
 		}
-- 
2.9.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-31 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-31 15:56 [dpdk-dev] [PATCH] vfio: do not use memcmp() to compare PCI address Andrew Rybchenko
2017-03-31 16:09 ` Sergio Gonzalez Monroy
2017-03-31 16:18   ` Andrew Rybchenko
2017-03-31 16:24     ` Sergio Gonzalez Monroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).