enic: fix bsd namespace conflict
authorCunming Liang <cunming.liang@intel.com>
Tue, 17 Feb 2015 02:08:08 +0000 (10:08 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 24 Feb 2015 19:21:50 +0000 (20:21 +0100)
Some macros already been defined by freebsd 'sys/param.h'.

Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_pmd_enic/enic.h
lib/librte_pmd_enic/enic_compat.h
lib/librte_pmd_enic/vnic/vnic_dev.c

index c43417c..57b9c80 100644 (file)
@@ -66,9 +66,9 @@
 #define ENIC_CALC_IP_CKSUM      1
 #define ENIC_CALC_TCP_UDP_CKSUM 2
 #define ENIC_MAX_MTU            9000
-#define PAGE_SIZE               4096
+#define ENIC_PAGE_SIZE          4096
 #define PAGE_ROUND_UP(x) \
-       ((((unsigned long)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)))
+       ((((unsigned long)(x)) + ENIC_PAGE_SIZE-1) & (~(ENIC_PAGE_SIZE-1)))
 
 #define ENICPMD_VFIO_PATH          "/dev/vfio/vfio"
 /*#define ENIC_DESC_COUNT_MAKE_ODD (x) do{if ((~(x)) & 1) { (x)--; } }while(0)*/
index 67c092d..0670c1e 100644 (file)
@@ -68,7 +68,7 @@
 #define pr_warn(y, args...) dev_warning(0, y, ##args)
 #define BUG() pr_err("BUG at %s:%d", __func__, __LINE__)
 
-#define ALIGN(x, a)              __ALIGN_MASK(x, (typeof(x))(a)-1)
+#define VNIC_ALIGN(x, a)         __ALIGN_MASK(x, (typeof(x))(a)-1)
 #define __ALIGN_MASK(x, mask)    (((x)+(mask))&~(mask))
 #define udelay usleep
 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
index 6407994..38b7f25 100644 (file)
@@ -242,9 +242,9 @@ unsigned int vnic_dev_desc_ring_size(struct vnic_dev_ring *ring,
        if (desc_count == 0)
                desc_count = 4096;
 
-       ring->desc_count = ALIGN(desc_count, count_align);
+       ring->desc_count = VNIC_ALIGN(desc_count, count_align);
 
-       ring->desc_size = ALIGN(desc_size, desc_align);
+       ring->desc_size = VNIC_ALIGN(desc_size, desc_align);
 
        ring->size = ring->desc_count * ring->desc_size;
        ring->size_unaligned = ring->size + ring->base_align;
@@ -294,7 +294,7 @@ int vnic_dev_alloc_desc_ring(__attribute__((unused)) struct vnic_dev *vdev,
 
        ring->base_addr_unaligned = (dma_addr_t)rz->phys_addr;
 
-       ring->base_addr = ALIGN(ring->base_addr_unaligned,
+       ring->base_addr = VNIC_ALIGN(ring->base_addr_unaligned,
                ring->base_align);
        ring->descs = (u8 *)ring->descs_unaligned +
            (ring->base_addr - ring->base_addr_unaligned);