From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19231A0C45; Thu, 10 Jun 2021 14:09:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0156E4067C; Thu, 10 Jun 2021 14:09:44 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CE2D84003C for ; Thu, 10 Jun 2021 14:09:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623326981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lnA//0faLrLITVL4hALqaqIWmq5/nw4l1VXxKzbce2k=; b=an/6P263MePSmWmxVxWA2CACzQr1paDHDLkj6wg6Imf+lZibWaw1OOE2Ew/U2xlGnV3r55 pjptSSMHsQS0CUSw56dU78GzESqU/hTz/QiixL7QmbUoodTIi3skS7uuLooiIojERKuxgS e8oa3eNjM6dsYJdHJQLxHGkq1FQ2zK0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-450-vV8030QhOKO_uCxsyXJ50Q-1; Thu, 10 Jun 2021 08:09:38 -0400 X-MC-Unique: vV8030QhOKO_uCxsyXJ50Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5892C8015F8; Thu, 10 Jun 2021 12:09:37 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5202810016F8; Thu, 10 Jun 2021 12:09:32 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: maxime.coquelin@redhat.com, stable@dpdk.org, Anatoly Burakov , Stephen Hemminger Date: Thu, 10 Jun 2021 14:09:22 +0200 Message-Id: <20210610120922.24128-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-dev] [PATCH] malloc: fix size annotation for NUMA-aware realloc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" __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") Cc: stable@dpdk.org Signed-off-by: David Marchand --- lib/eal/include/rte_malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/include/rte_malloc.h b/lib/eal/include/rte_malloc.h index 3af64f8761..895bb6e849 100644 --- a/lib/eal/include/rte_malloc.h +++ b/lib/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.23.0