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 80677A0C45 for ; Thu, 10 Jun 2021 14:19:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61E22410D8; Thu, 10 Jun 2021 14:19:27 +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 69411410D8 for ; Thu, 10 Jun 2021 14:19:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623327565; 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=RCXvwzsEblYyjRJCZLZ/sFzKFu6l8OwVZofbgL7lH9PT9a+AGsEE2nii4jc0o1Zxf45qli 1NzFMkQtG6zvTAlvg/qV30UlZjPvQ3lzqQ1+nTRfuOd/3q74MBTP7HITSeD4+omgZ3KAQ9 64CpJZdJv78xJPhJmbgGUu9ZESSQnWs= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-7WU0EhnKPuS8dGPqVQ-wJw-1; Thu, 10 Jun 2021 08:19:22 -0400 X-MC-Unique: 7WU0EhnKPuS8dGPqVQ-wJw-1 Received: by mail-wr1-f69.google.com with SMTP id g14-20020a5d698e0000b0290117735bd4d3so802243wru.13 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=MFvUxNmi/Jza5LfztwTNHL04iPnSz3ZFDA6GR+rVzwcdQsRFJ5egbTl+HnM8f37nGB k/aY6oiRJ/5Ruz1e5ZrKoYmwCm/hWGYj+yCPbZwmjgsGE0uQNWsghNPsvuFPwvAbw5P3 AJH2ZP9wJtIJqFVF7c+TUWCDnw17JjkGvKwst1tnMEVYZn9SwWhJoC1RsQoTkj/aTJxK RBEdHCCY5sS/jMXjs3NQfJDHO5yoXzMXWk+lZZDZYIjGXTTTTSJPz+KBVHOHKrf0XKIa vhIm39YRcGMSTRURCpfNf4ZL0owu22LJXrqkW3PnHSDJPO2vwkQLN6X7UX75eAFg1Adq aUjw== X-Gm-Message-State: AOAM533iIR0yXds2t1+YbHOl7GgfPLEnBRlWvkpzuj2ZlsDVmdYqKoOc eXosgb9rm0qrWzg8Oc+K/MUk6EVRUF/m/+rj664ixwc4/KqGmXz/WCwSfLl2E1HHp8bpI3ktPyG z4Q7faXA= X-Received: by 2002:a5d:698e:: with SMTP id g14mr5100102wru.212.1623327561259; 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-stable] [PATCH] malloc: fix size annotation for NUMA-aware realloc X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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" 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