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 61D1945B61; Thu, 17 Oct 2024 21:44:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE6AC40265; Thu, 17 Oct 2024 21:44:48 +0200 (CEST) Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) by mails.dpdk.org (Postfix) with ESMTP id C1C5B4025F for ; Thu, 17 Oct 2024 21:44:47 +0200 (CEST) Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 35443114019F; Thu, 17 Oct 2024 15:44:47 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Thu, 17 Oct 2024 15:44:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1729194287; x=1729280687; bh=pj3MsyDLaO1qoIymgOiE1+RlxKsCuqDTcdSgb/08Qos=; b= fnIWrpBwWXfImOMTxpebXIcRZG0Zy8DGzgA1l/OA9k6n4/CWdXPe9DUgMNtBKTYe K1tJg3B4u52zPyOl9AC6L1FwFuFJMnFD7FtDrp/GYphZKnEslcIDnK9GICQwk5wb zQcEUx6YmPfgunnxR9OP+IRRkW9aaKibxPTFph4mvHeMR6rkhDTRvSY74Hm77okU 3g9kQ6T3J1xcbgCAdIn3r6tneBcwDy6Bd5hlMfPn6j/mdJJRPQCJnB3vS5E4sDe1 kOYyvKIWADn9qFpSYYKm6BuvnnSbPVjbpPj4ThFwa5tghPsgFVcTqlrzbnVZOUh7 7JjqMP7Vsnj6dlV5LzjoyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1729194287; x= 1729280687; bh=pj3MsyDLaO1qoIymgOiE1+RlxKsCuqDTcdSgb/08Qos=; b=l yEhvf6yO/OeFwC2kn7hJ9xWprVtC92rM430Vmod681+Zaj1u8HqTxI2AbtuNXlpu h8MkrjSwYpiXRFHKsj8pRw2XhKWH7I+S/0vP51dvR08E1K7Cim8RP4wWm2a5mHkn TtICZ3SL16gwWEIngj8sJmn/nIZO/bdjiCWI+zm8WdCRGjdGZFxiACX2l3cSDkYq YDP05ZG0qT3jy6XBM5qlzhq0txXh8T+Sb6HQzhPdvvPHKb630/2a4C74PQWY/stM JAnA22lIqbBJ3roe+QzzjBdNzdHYr1vXkiuqeD8+OeYZ8A4VEZiqPltsgAzFdhdO o5xn/R7F8vAd7uQCRTydQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehuddgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtqhertddttdej necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepgedttdeljeejgeffkeekkedtjeev tdehvedtkeeivdeuuedvieduvdelveejueejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthdp nhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhhjrg hrrhihsehrvgguhhgrthdrtghomhdprhgtphhtthhopeguvghvseguphgukhdrohhrghdp rhgtphhtthhopehsthgvphhhvghnsehnvghtfihorhhkphhluhhmsggvrhdrohhrgh X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Oct 2024 15:44:46 -0400 (EDT) From: Thomas Monjalon To: Robin Jarry Cc: dev@dpdk.org, Stephen Hemminger Subject: Re: [PATCH dpdk v2] mbuf: fix strict aliasing error in allocator Date: Thu, 17 Oct 2024 21:44:44 +0200 Message-ID: <30405816.43St1lv6Oq@thomas> In-Reply-To: <20240925084741.60852bd6@fedora> References: <20240925140021.46320-2-rjarry@redhat.com> <20240925154053.80861-2-rjarry@redhat.com> <20240925084741.60852bd6@fedora> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 25/09/2024 17:47, Stephen Hemminger: > On Wed, 25 Sep 2024 11:40:54 -0400 > Robin Jarry wrote: >=20 > > From: Robin Jarry > > To: dev@dpdk.org > > Subject: [PATCH dpdk v2] mbuf: fix strict aliasing error in allocator > > Date: Wed, 25 Sep 2024 11:40:54 -0400 > >=20 > > When building an application with -fstrict-aliasing -Wstrict-aliasing= =3D2, > > we get errors triggered by rte_mbuf_raw_alloc() which is called inline > > from rte_pktmbuf_alloc(). > >=20 > > ../dpdk/lib/mbuf/rte_mbuf.h: In function =E2=80=98rte_mbuf_raw_alloc= =E2=80=99: > > ../dpdk/lib/mbuf/rte_mbuf.h:600:42: error: dereferencing type-punned > > pointer might break strict-aliasing rules [-Werror=3Dstrict-aliasing] > > 600 | if (rte_mempool_get(mp, (void **)&m) < 0) > > | ^~ > >=20 > > Avoid incorrect casting by using an inline union variable. > >=20 > > Signed-off-by: Robin Jarry >=20 > Thanks, union is safer than cast. >=20 > Reviewed-by: Stephen Hemminger Applied, thanks.