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 EF9E445AAF; Fri, 4 Oct 2024 16:57:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE92741157; Fri, 4 Oct 2024 16:57:34 +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 43DB1410FC for ; Fri, 4 Oct 2024 16:57:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728053852; 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=Xu1KeAzTXz/URC77eAorwR4lSte+3L01PeGnJ3/U8O8=; b=OnKXu/qilJ+2FUmr8RJPxWR7+hKON2dx42xa5MqAVdW6fjwhVl7AmtrhfCVNjgd6qMa2Bl x/GWPnN3P+iCSm2avo9/s8n4spf0dqEpa1gyhD3kneu0SfKq4s5JV6+sacWdAyhhOdXtfX jxrWgMu6jQKS8uJpc7MJxxMhoR8c3/Q= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-530-TZOev_BNPhWChD7PGaYu9Q-1; Fri, 04 Oct 2024 10:57:30 -0400 X-MC-Unique: TZOev_BNPhWChD7PGaYu9Q-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2fad1771626so20145231fa.2 for ; Fri, 04 Oct 2024 07:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728053849; x=1728658649; 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=Xu1KeAzTXz/URC77eAorwR4lSte+3L01PeGnJ3/U8O8=; b=aRjJDQ20O0sxnfaRq0tQL+CfumsFbo0jVMZ+HbsGhAaCTKtnFiQvnNBG6d8kmYzgtw FycGNdBtVKIU2t/jgW0Dt6ATGyzEY3gSdtmbEDQk9G7w7PsRpBHjsNsl5goEsy/AIOWe 4MDqbIO7uZ5N3n1qotQH1E60maJBUTpIWAWUYu9taxkNcAc7QrpuXPa6Igg+orHu923V mve3H/YFISQlWiY0VdExEmg9Yt5QyLlsPaZ0z8phGPgdWcjXr5DmU+8cIvGj9Y4Z5RKc /iWJtS0E4dy9S+ySSZcJ0i7s0uXhDNq3uCU35p9WdPbAfNnaP5+w9jYhPc10ujN7vz1v 32hw== X-Gm-Message-State: AOJu0Yx0wan2dm0Q5ombWr0EyUGGzQheHW2XHwqT2bAlVbWeQoFjalJs DZizVzY+VMIfmi1aK7wkj3PlQxgHielvlCO+kwSSCLUJu8qV+M1J9lGO9PYUt+nZKvqmJnXQqGp CqfnzkRwHoX5P4OcH3ejw9XsHNv59uwLnDpoHrTtvIetWTzaTdE/P4bv8QpKjzDZEesFKBFS4lA JjplvBcejhauuNAMWzNeE5dRcFAz// X-Received: by 2002:a05:651c:a0b:b0:2f3:eeab:7f17 with SMTP id 38308e7fff4ca-2faf3da5956mr16811571fa.41.1728053848586; Fri, 04 Oct 2024 07:57:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHoUZh/OjvDtBVGn0yuOhJqv24aqiwJLrnnMwiZJ09wXDA2NMW6IXiXcUx8QEV48BjmZqxMU4Od0J/L/aKU0dI= X-Received: by 2002:a05:651c:a0b:b0:2f3:eeab:7f17 with SMTP id 38308e7fff4ca-2faf3da5956mr16811341fa.41.1728053848079; Fri, 04 Oct 2024 07:57:28 -0700 (PDT) MIME-Version: 1.0 References: <20240927204742.546164-1-stephen@networkplumber.org> <20241002183918.161656-1-stephen@networkplumber.org> In-Reply-To: From: David Marchand Date: Fri, 4 Oct 2024 16:57:16 +0200 Message-ID: Subject: Re: [PATCH v7 00/16] Fix allocation bugs and prevent future ones To: Stephen Hemminger Cc: dev@dpdk.org 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 Fri, Oct 4, 2024 at 4:28=E2=80=AFPM David Marchand wrote: > > On Wed, Oct 2, 2024 at 8:39=E2=80=AFPM Stephen Hemminger > wrote: > > > > Recent versions of GCC have some additional function attributes that ca= n > > 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 > > It seems v7 lost the last patch that was introducing and using the > annotations in rte_malloc. > Was there an issue with this patch, or is it just a series submission iss= ue? Btw, reading gcc documentation, it seems the check is only enabled with -fanalyzer. Can we add this in the CI? If we can't enable all of -fanalyzer checks, maybe go with a subset of it, like -Wanalyzer-allocation-size -Wanalyzer-mismatching-deallocation ? --=20 David Marchand