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 DADD6606A325 for ; Mon, 30 Nov 2026 12:29:59 +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=HvzFDIVI Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40EA440279; Mon, 30 Nov 2026 13:29:58 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTPS id 1FA9D402B2 for ; Mon, 30 Nov 2026 13:29:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796041796; 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; bh=3CH1F1FKEAbAD7wpZn1+EnvfdcxZPrCVAWSiS46r3KQ=; b=HvzFDIVIm+GEuvzUVg6/XIc1E+fKCDMbvQJ+s8TxRdgt6p0NlTmGXaG/YO0b3diYK2aD2N 1gYO52KAY3jSbsILRrmDKpzxp/0ye9Pv6+leLIAKz2bB/gyhD8CZSCjdPZNZsqidoVnY5a QFGcXlE9V91xdwvC8RbLPSA/Gme4S8E= X-MC-Rep: binary re single Received: from mx-prod-mc-03.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-97-c6dWWqErM5WX39u9Bknlhw-1; Mon, 30 Nov 2026 12:29:49 +0000 X-MC-Unique: c6dWWqErM5WX39u9Bknlhw-1 X-Mimecast-MFC-AGG-ID: c6dWWqErM5WX39u9Bknlhw_1796041788 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AF55A19539AC; Mon, 30 Nov 2026 12:29:47 +0000 (UTC) Received: from ringo.home (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7ACF9421; Mon, 30 Nov 2026 12:29:45 +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] ring: split 128-bit pair copies for unoptimized GCC Date: Mon, 30 Nov 2026 13:29:30 +0100 Message-ID: <20261130122929.246502-2-rjarry@redhat.com> X-Archived-By: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uTfeQrQpSlYSZi76k3ZvVYfQEgEEe7D1qYg-a1T-7D8_1796041788 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 when an inlined ring enqueue receives a 24-byte item. Without optimization, GCC diagnoses the 32-byte memcpy in the unreachable 128-bit copy path. The unoptimized-build warning flag does not apply to applications compiling DPDK headers, and the header-local suppression is gone. Copy the pair as two 16-byte elements instead. This avoids the false warning without suppressing diagnostics for applications. Optimized x86-64 code still uses two 16-byte loads and stores. Fixes: 812a18c167f4 ("build: disable GCC string op warnings when unoptimized") Cc: stable@dpdk.org Signed-off-by: Robin Jarry --- lib/ring/rte_ring_elem_pvt.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h index 404bf1d8d24e..37e900b70d5b 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), -- 2.56.1