[dpdk-stable] patch 'net/af_xdp: fix pointer storage size' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Nov 17 12:13:58 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/19/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/4fe71cc7c8eefecced26044eacc335519cb252de

Thanks.

Luca Boccassi

---
>From 4fe71cc7c8eefecced26044eacc335519cb252de Mon Sep 17 00:00:00 2001
From: Ferruh Yigit <ferruh.yigit at intel.com>
Date: Mon, 9 Nov 2020 13:30:05 +0000
Subject: [PATCH] net/af_xdp: fix pointer storage size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 470b5c23adf2f4ec5aaece93c711048d84cd3eab ]

'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")

Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Tested-by: Ciara Loftus <ciara.loftus at intel.com>
---
 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 6fab9aab78..e0089212bd 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -744,13 +744,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.27.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-11-17 11:13:14.000012945 +0000
+++ 0024-net-af_xdp-fix-pointer-storage-size.patch	2020-11-17 11:13:12.921116609 +0000
@@ -1 +1 @@
-From 470b5c23adf2f4ec5aaece93c711048d84cd3eab Mon Sep 17 00:00:00 2001
+From 4fe71cc7c8eefecced26044eacc335519cb252de Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 470b5c23adf2f4ec5aaece93c711048d84cd3eab ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -34 +35 @@
-index 4076ff797c..2c7892bd7e 100644
+index 6fab9aab78..e0089212bd 100644
@@ -37 +38 @@
-@@ -910,13 +910,13 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused,
+@@ -744,13 +744,13 @@ eth_link_update(struct rte_eth_dev *dev __rte_unused,


More information about the stable mailing list