From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3FF67ADA2 for ; Fri, 13 Feb 2015 02:39:02 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 12 Feb 2015 17:39:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,568,1418112000"; d="scan'208";a="685084600" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 12 Feb 2015 17:38:57 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t1D1cs4L005755; Fri, 13 Feb 2015 09:38:54 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t1D1cp2f001692; Fri, 13 Feb 2015 09:38:53 +0800 Received: (from cliang18@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t1D1cp3G001688; Fri, 13 Feb 2015 09:38:51 +0800 From: Cunming Liang To: dev@dpdk.org Date: Fri, 13 Feb 2015 09:38:13 +0800 Message-Id: <1423791501-1555-12-git-send-email-cunming.liang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1423791501-1555-1-git-send-email-cunming.liang@intel.com> References: <1423728996-3004-1-git-send-email-cunming.liang@intel.com> <1423791501-1555-1-git-send-email-cunming.liang@intel.com> Subject: [dpdk-dev] [PATCH v6 11/19] enic: fix re-define freebsd compile complain X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 01:39:02 -0000 Some macro already been defined by freebsd 'sys/param.h'. Signed-off-by: Cunming Liang --- v5 changes: rename the redefined MACRO instead of undefine them lib/librte_pmd_enic/enic.h | 4 ++-- lib/librte_pmd_enic/enic_compat.h | 2 +- lib/librte_pmd_enic/vnic/vnic_dev.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_pmd_enic/enic.h b/lib/librte_pmd_enic/enic.h index c43417c..57b9c80 100644 --- a/lib/librte_pmd_enic/enic.h +++ b/lib/librte_pmd_enic/enic.h @@ -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)*/ diff --git a/lib/librte_pmd_enic/enic_compat.h b/lib/librte_pmd_enic/enic_compat.h index b1af838..40c9b44 100644 --- a/lib/librte_pmd_enic/enic_compat.h +++ b/lib/librte_pmd_enic/enic_compat.h @@ -67,7 +67,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)) diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c index 6407994..38b7f25 100644 --- a/lib/librte_pmd_enic/vnic/vnic_dev.c +++ b/lib/librte_pmd_enic/vnic/vnic_dev.c @@ -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); -- 1.8.1.4