[dpdk-stable] patch 'malloc: fix size annotation for NUMA-aware realloc' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:03:59 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/21. 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/73b4b37a14f5150906477b115a94e7de2e26a346

Thanks.

Luca Boccassi

---
>From 73b4b37a14f5150906477b115a94e7de2e26a346 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 10 Jun 2021 14:09:22 +0200
Subject: [PATCH] malloc: fix size annotation for NUMA-aware realloc

[ upstream commit 2ca92f54410400af76a1f0bc3bfecc8077e282aa ]

__rte_alloc_size is mapped to compiler alloc_size attribute.

Quoting gcc documentation:
"""
alloc_size
    The alloc_size attribute is used to tell the compiler that the
    function return value points to memory, where the size is given by
    one or two of the functions parameters. GCC uses this information
    to improve the correctness of __builtin_object_size.

    The function parameter(s) denoting the allocated size are specified
    by one or two integer arguments supplied to the attribute.
    The allocated size is either the value of the single function
    argument specified or the product of the two function arguments
    specified. Argument numbering starts at one.
"""

In rte_realloc_socket case, only 'size' matters.

Note: this has been spotted by Maxime trying to use rte_realloc_socket
and compiling with gcc 11.

Fixes: 17b347dab769 ("malloc: add alloc_size attribute to functions")

Signed-off-by: David Marchand <david.marchand at redhat.com>
Tested-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 lib/librte_eal/include/rte_malloc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/include/rte_malloc.h b/lib/librte_eal/include/rte_malloc.h
index 3af64f8761..895bb6e849 100644
--- a/lib/librte_eal/include/rte_malloc.h
+++ b/lib/librte_eal/include/rte_malloc.h
@@ -160,7 +160,7 @@ rte_realloc(void *ptr, size_t size, unsigned int align)
 __rte_experimental
 void *
 rte_realloc_socket(void *ptr, size_t size, unsigned int align, int socket)
-	__rte_alloc_size(2, 3);
+	__rte_alloc_size(2);
 
 /**
  * This function allocates memory from the huge-page area of memory. The memory
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:37.109252062 +0100
+++ 0004-malloc-fix-size-annotation-for-NUMA-aware-realloc.patch	2021-07-12 13:41:36.154115611 +0100
@@ -1 +1 @@
-From 2ca92f54410400af76a1f0bc3bfecc8077e282aa Mon Sep 17 00:00:00 2001
+From 73b4b37a14f5150906477b115a94e7de2e26a346 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 2ca92f54410400af76a1f0bc3bfecc8077e282aa ]
+
@@ -29 +30,0 @@
-Cc: stable at dpdk.org
@@ -34 +35 @@
- lib/eal/include/rte_malloc.h | 2 +-
+ lib/librte_eal/include/rte_malloc.h | 2 +-
@@ -37 +38 @@
-diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h
+diff --git a/lib/librte_eal/include/rte_malloc.h b/lib/librte_eal/include/rte_malloc.h
@@ -39,2 +40,2 @@
---- a/lib/eal/include/rte_malloc.h
-+++ b/lib/eal/include/rte_malloc.h
+--- a/lib/librte_eal/include/rte_malloc.h
++++ b/lib/librte_eal/include/rte_malloc.h


More information about the stable mailing list