X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_eal%2Flinuxapp%2Feal%2Feal_ivshmem.c;h=eea0314b5fad14274eee1ef7adb9ce287a5513b9;hb=a3f34a98b7217f4ff2a8636096984f566a4e7cab;hp=589019b15ee6bd2fb699a480a29594f008483bbe;hpb=ff909fe21f0a458384e7f456689b027733a6915b;p=dpdk.git diff --git a/lib/librte_eal/linuxapp/eal/eal_ivshmem.c b/lib/librte_eal/linuxapp/eal/eal_ivshmem.c index 589019b15e..eea0314b5f 100644 --- a/lib/librte_eal/linuxapp/eal/eal_ivshmem.c +++ b/lib/librte_eal/linuxapp/eal/eal_ivshmem.c @@ -109,8 +109,8 @@ TAILQ_HEAD(rte_ring_list, rte_tailq_entry); static int is_ivshmem_device(struct rte_pci_device * dev) { - return (dev->id.vendor_id == PCI_VENDOR_ID_IVSHMEM - && dev->id.device_id == PCI_DEVICE_ID_IVSHMEM); + return dev->id.vendor_id == PCI_VENDOR_ID_IVSHMEM + && dev->id.device_id == PCI_DEVICE_ID_IVSHMEM; } static void * @@ -254,17 +254,14 @@ adjacent(const struct rte_memzone * mz1, const struct rte_memzone * mz2) static int has_adjacent_segments(struct ivshmem_segment * ms, int len) { - int i, j, a; + int i, j; for (i = 0; i < len; i++) for (j = i + 1; j < len; j++) { - a = adjacent(&ms[i].entry.mz, &ms[j].entry.mz); - - /* check if segments are adjacent virtually and/or physically but - * not ioremap (since that would indicate that they are from - * different PCI devices and thus don't need to be concatenated. + /* we're only interested in fully adjacent segments; partially + * adjacent segments can coexist. */ - if ((a & (VIRT|PHYS)) > 0 && (a & IOREMAP) == 0) + if (adjacent(&ms[i].entry.mz, &ms[j].entry.mz) == FULL) return 1; } return 0;