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>
#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)*/
#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))
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;
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);