From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66DC7606A32F for ; Mon, 30 Nov 2026 14:04:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Ah8hy+by Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 212FC4026E; Mon, 30 Nov 2026 15:04:42 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTPS id 5666740260 for ; Mon, 30 Nov 2026 15:04:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796047479; 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=RvYGdlqRNkGs+ESuwNzSPdxZiiwzMQ+195zvUVuGm8I=; b=Ah8hy+byqNaoPdTTRjOxfFlfXpLyRY+fZ3qi5LJkzSKdwQdjEa0tsaze9zgazEIWHkhEKz MbjyClhEl7fLSngIjZ0BJvKzqdtKUsvmeDSNS4i5Slk412v7U4aSnyU5+vN5Nu4tHwisCS en8jUOaA+WumonMnKdzTk9ApDpNLegQ= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-B7-eCrabPA--7HWaSIe--g-1; Mon, 30 Nov 2026 14:04:36 +0000 X-MC-Unique: B7-eCrabPA--7HWaSIe--g-1 X-Mimecast-MFC-AGG-ID: B7-eCrabPA--7HWaSIe--g_1796047475 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0ACD1964CF4; Mon, 30 Nov 2026 14:04:34 +0000 (UTC) Received: from ringo.home (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 92BE41801A72; Mon, 30 Nov 2026 14:04:32 +0000 (UTC) From: Robin Jarry To: dev@dpdk.org, Konstantin Ananyev , Wathsala Vithanage , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Stephen Hemminger Cc: stable@dpdk.org Subject: [PATCH dpdk v2] ring: split 128-bit pair copies for unoptimized GCC Date: Mon, 30 Nov 2026 15:04:26 +0100 Message-ID: <20261130140425.322090-2-rjarry@redhat.com> In-Reply-To: <20261130122929.246502-2-rjarry@redhat.com> References: <20261130122929.246502-2-rjarry@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: WyFvNukUaowiYwNdmYBWLzAGT5SHJ8IHYdFf-8WWDQc_1796047475 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 GCC 14 and 16 at -O0 report -Wstringop-overread for a 24-byte enqueue item, and GCC 14 reports -Wstringop-overflow for an 8-byte dequeue destination. Both warnings come from 32-byte copies in unreachable 128-bit paths of inlined ring operations. The unoptimized-build warning flag does not cover applications compiling DPDK headers, and the header-local suppression is gone. Split each pair into 16-byte copies to avoid these false warnings without suppressing diagnostics for applications. Fixes: 812a18c167f4 ("build: disable GCC string op warnings when unoptimized") Cc: stable@dpdk.org Signed-off-by: Robin Jarry --- Notes: v2: also fix the dequeue path lib/ring/rte_ring_elem_pvt.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h index 404bf1d8d24e..b3552fe5df91 100644 --- a/lib/ring/rte_ring_elem_pvt.h +++ b/lib/ring/rte_ring_elem_pvt.h @@ -98,9 +98,12 @@ __rte_ring_enqueue_elems_128(void *ring_table, const void *obj_table, const rte_int128_t *obj = (const rte_int128_t *)obj_table; if (likely(idx + n <= size)) { - for (i = 0; i < (n & ~0x1); i += 2, idx += 2) + for (i = 0; i < (n & ~0x1); i += 2, idx += 2) { memcpy((void *)(ring + idx), - (const void *)(obj + i), 32); + (const void *)(obj + i), 16); + memcpy((void *)(ring + idx + 1), + (const void *)(obj + i + 1), 16); + } switch (n & 0x1) { case 1: memcpy((void *)(ring + idx), @@ -240,8 +243,10 @@ __rte_ring_dequeue_elems_128(void *obj_table, const void *ring_table, const rte_int128_t *ring = (const rte_int128_t *)ring_table; if (likely(idx + n <= size)) { - for (i = 0; i < (n & ~0x1); i += 2, idx += 2) - memcpy((obj + i), (const void *)(ring + idx), 32); + for (i = 0; i < (n & ~0x1); i += 2, idx += 2) { + memcpy((obj + i), (const void *)(ring + idx), 16); + memcpy((obj + i + 1), (const void *)(ring + idx + 1), 16); + } switch (n & 0x1) { case 1: memcpy((obj + i), (const void *)(ring + idx), 16); -- 2.56.1