From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 975E0A052A for ; Mon, 9 Nov 2020 14:30:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 607305F18; Mon, 9 Nov 2020 14:30:14 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 5DB4E5AA7; Mon, 9 Nov 2020 14:30:10 +0100 (CET) IronPort-SDR: bhcs1918VEB18gEF6aK+CXEhrDBeYmNXs/cwxxh5lgyVR99Yrs/sv5GZLfYjkdJsJMYP7CBvrG jz1SM5je91fg== X-IronPort-AV: E=McAfee;i="6000,8403,9799"; a="157582457" X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="157582457" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2020 05:30:09 -0800 IronPort-SDR: 35QNGowU8EiRRjkoRs/AZhzOxjBQacPWHLW9lRx3GfXEKyuxS2kjxfcidLz6/4uvS3dfYzuDUQ 5UiAq/v5Gtsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,463,1596524400"; d="scan'208";a="530736518" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga005.fm.intel.com with ESMTP; 09 Nov 2020 05:30:07 -0800 From: Ferruh Yigit To: Ciara Loftus , Qi Zhang , Kevin Laatz , Xiaolong Ye Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Mon, 9 Nov 2020 13:30:05 +0000 Message-Id: <20201109133005.67035-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/af_xdp: do not use fixed size storage for pointer X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 'uint64_t' is used to hold the pointer, for 32-bits build this assumption is wrong and giving following build error: rte_eth_af_xdp.c: In function ‘xdp_umem_configure’: rte_eth_af_xdp.c:970:15: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 970 | base_addr = (void *)get_base_addr(mb_pool, &align); | ^ Replacing the 'uint64_t' return type of the 'get_base_addr()' to the 'uintptr_t'. Although not sure if the overall logic supports the 32-bits, using 'uintptr_t' should be safe both for 64/32 bits. Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Hi Ciara, I am not sure if 32-bit is supported for the af_xdp, but even not does this change make sense for the 64-bits? --- drivers/net/af_xdp/rte_eth_af_xdp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 4076ff797c..2c7892bd7e 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -910,13 +910,13 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused, } #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) -static inline uint64_t get_base_addr(struct rte_mempool *mp, uint64_t *align) +static inline uintptr_t get_base_addr(struct rte_mempool *mp, uint64_t *align) { struct rte_mempool_memhdr *memhdr; - uint64_t memhdr_addr, aligned_addr; + uintptr_t memhdr_addr, aligned_addr; memhdr = STAILQ_FIRST(&mp->mem_list); - memhdr_addr = (uint64_t)memhdr->addr; + memhdr_addr = (uintptr_t)memhdr->addr; aligned_addr = memhdr_addr & ~(getpagesize() - 1); *align = memhdr_addr - aligned_addr; -- 2.26.2