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 3973445B08; Thu, 10 Oct 2024 18:58:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0310B402A3; Thu, 10 Oct 2024 18:58:32 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 554BE40144 for ; Thu, 10 Oct 2024 18:58:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728579509; 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=Vq1Q4+JUQ4DCU75kcPIvWT8R/cZfYT3B00NOOp03+qM=; b=XT38ATGd3OI6lPwdvNmAuU+Zc3wjDcXPpJHKB/ggIfllnNqMHpMboG6o3Rps4REAGdEs5L YmEL0YVzvwuxShXZAAg/iIk26yk5G5y93NrY2F77s9iTlJ2t03LzJ+45qbdyVOuA8X+kDC oC68xrFu6eyofRj4HXhy8gbrbPKGnDM= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-657-KQJBFRLZP4CSOwkLLSO0cA-1; Thu, 10 Oct 2024 12:58:26 -0400 X-MC-Unique: KQJBFRLZP4CSOwkLLSO0cA-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-5398dde92f4so1053633e87.3 for ; Thu, 10 Oct 2024 09:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728579505; x=1729184305; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vq1Q4+JUQ4DCU75kcPIvWT8R/cZfYT3B00NOOp03+qM=; b=PewWGechl6O+XUJt+d+10xwZXFprrvsz9u7DSp2dJ1k4q0i1BEb/Q8eR8JJ76X3yzz s35fhk2kAVbSB2Pp292MpQ+12BloZkZa92AvvFgcYomn8JogJR/g4R3i7z22mxgvOcaQ djM9KkqVqGwMky2U1zVHNiymJ0l7vjOoJ6em32KkTnOOQhhY/IH0gSAOoOmjMnwGQ/u0 +a3pILbeQXQ1ZIhHmUq52bpcYQN1P8Lq9mC5qe7WRibz9SV9VMAz1SoBwAddK8VvRrBL tmf/LSxBq7h3Km/CIMNrKRt0pQUaZdZJBDLDUtcx/v5joWhclVKQXAQJhRXl0c9iCuFK zwKA== X-Gm-Message-State: AOJu0Ywxle7K9Xk/NcNxijBrToLaZ5sgMtmlcsCpiAsqTZ/nyMLSlIGW UaboCs/RuDMm7r91Z2tslpjl6E8Gzy0EaU0mKgXGXsKgnh2q/WRPfhMeMxXIz44dkhUNj/Pd/9H jm2OxD9w+m9CtFAscGdf53/jx6Hb5EkpGB8uwnm8Ms7g5DUyEfYPxNkQi7MhXfUoeR/+cEFmQTW svI5IyeS3tYhXqiL4= X-Received: by 2002:a05:6512:1192:b0:52c:dc6f:75a3 with SMTP id 2adb3069b0e04-539d49fb5ebmr123642e87.40.1728579505038; Thu, 10 Oct 2024 09:58:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKmmNTKbDCXD+BpDgA3U9qO3aZ9F/0JSFalE94wrQEBabD2YyeflvfHCOF/jZ0GuZlNq5ercYp1N/+OLKEIR0= X-Received: by 2002:a05:6512:1192:b0:52c:dc6f:75a3 with SMTP id 2adb3069b0e04-539d49fb5ebmr123623e87.40.1728579504596; Thu, 10 Oct 2024 09:58:24 -0700 (PDT) MIME-Version: 1.0 References: <20240927204742.546164-1-stephen@networkplumber.org> <20241008164842.139045-1-stephen@networkplumber.org> In-Reply-To: <20241008164842.139045-1-stephen@networkplumber.org> From: David Marchand Date: Thu, 10 Oct 2024 18:58:13 +0200 Message-ID: Subject: Re: [PATCH v9 00/17] Use malloc function attribute to uncover bugs To: Stephen Hemminger Cc: dev@dpdk.org, Konstantin Ananyev , Wathsala Wathawana Vithanage , =?UTF-8?Q?Morten_Br=C3=B8rup?= , Tyler Retzlaff , "Burakov, Anatoly" , Chengwen Feng , Thomas Monjalon X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Tue, Oct 8, 2024 at 6:49=E2=80=AFPM Stephen Hemminger wrote: > > Recent versions of GCC have some additional function attributes that can > help with DPDK performance and stability. > > The alloc_align attribute tells the compiler what the alignment > of the allocation will be, and the optimizer can use this to produce > better code (especially memcpy and structure copies). > > The malloc attribute tells compiler that object is not overlapping > and potentially aliasing. It also as an additional variant in GCC 11 > or later that allows for detecting all sorts of common errors like > calling free() on memory allocated with rte_malloc(). > > In order to use the malloc attribute the free function prototype > needs to be moved before the allocator/create function prototype > so that the malloc attribute can refer to it. > > This uncovered at least 16 pre-existing bugs in DPDK, these > should go to stable. This patch set is structured with: > - fix any new warnings that were discovered > - add macros for enable the macros > - enable the attributes > > The same attributes could be added to lots more functions in DPDK, > but this patch set focuses on the key ones, and where problems > exist in current code base. Series applied. Thanks Stephen. --=20 David Marchand