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 F333BA0C45; Thu, 10 Jun 2021 14:19:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 799774067C; Thu, 10 Jun 2021 14:19:25 +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 2CEE34003C for ; Thu, 10 Jun 2021 14:19:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623327563; 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: in-reply-to:in-reply-to:references:references; bh=HemKpSNjqdaDPfTdZDO4wvgHmIA0tA+V9IR8WcJtves=; b=Ys3mZ66cIVTzjgyZxlERVKsNRLFswBZGCiwicyNy+xLLO0NDtS50FzGbMUHgW57LuEaAo6 jVAK+FMDcEL469m0M8e4jpWymzuxbNPc4441TYIsbDuyEwYyhgIfBkckCTx8DHKOpjsb6x I0/wRTGPDCK/OJVVpnKqRZtwMn6VUik= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-ILeHde8gPxKU2vtA9XmWXA-1; Thu, 10 Jun 2021 08:19:22 -0400 X-MC-Unique: ILeHde8gPxKU2vtA9XmWXA-1 Received: by mail-wm1-f69.google.com with SMTP id f22-20020a1c6a160000b029018f49a7efb7so3786799wmc.1 for ; Thu, 10 Jun 2021 05:19:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HemKpSNjqdaDPfTdZDO4wvgHmIA0tA+V9IR8WcJtves=; b=hifqDNEynvcgZixczX/kDSkeKWdiqBBzpuRXuLu9SsE9o2ut6TMiNo1MTj0egq1wnz 2ZWw2bP2XHrYQDKEaMgGEsIoAO3KnMcQju8wWWyAe7LIHEMs78YQEiK0spnkQ149Xugv RvO5s8X67zugQORdq/Brm7BNn0NRn2rvBrk5tQsCS7z7s2cG0OnnEIfLkC1sNO/nxvxD kEJVxCu6FtjXeyh0BOtW0oTPoavDztdrDNKWfk5T3zb0/tqSQWOz7a3b4L6cVjs6RkZt jEYmDvb1m1EpiQ8oM+TMqtL3RnH/LpL5eoz/aKZ2GNzGlrbB/hXRmp9+AhHuY4URkD4O 0fuQ== X-Gm-Message-State: AOAM532AF2l8Nh4CEsoDJfCW3hWFDXSlum/BpcgH1dotQO8Fw102UVNW omAUAHrvNt9tZcU87YIYz9XEXsVH49yLGbeDOI6zCMR25aqIEof2HZJQK/C95yf5KgzrjuqBIRE IgCw= X-Received: by 2002:a5d:698e:: with SMTP id g14mr5100104wru.212.1623327561260; Thu, 10 Jun 2021 05:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0YXl5a9S9XvXbyhG+YUouZwENQyPM+yK3VQEvW6JjL/J/YDHYfjncuqSpQVOa7U+FqFzeMg== X-Received: by 2002:a5d:698e:: with SMTP id g14mr5100043wru.212.1623327560696; Thu, 10 Jun 2021 05:19:20 -0700 (PDT) Received: from [192.168.1.205] (219-230-83-45.ftth.cust.kwaoo.net. [45.83.230.219]) by smtp.gmail.com with ESMTPSA id s5sm1473161wrn.38.2021.06.10.05.19.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 05:19:20 -0700 (PDT) To: David Marchand , dev@dpdk.org Cc: maxime.coquelin@redhat.com, stable@dpdk.org, Anatoly Burakov , Stephen Hemminger References: <20210610120922.24128-1-david.marchand@redhat.com> From: Maxime Coquelin Message-ID: <91147e98-1492-a0b6-8a26-863545e62ca1@redhat.com> Date: Thu, 10 Jun 2021 14:19:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210610120922.24128-1-david.marchand@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mcoqueli@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [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" On 6/10/21 2:09 PM, David Marchand wrote: > __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 > Tested-by: Maxime Coquelin Thanks! Maxime