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 *
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;