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 7981343C40; Sat, 2 Mar 2024 17:35:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0D32C4025C; Sat, 2 Mar 2024 17:35:14 +0100 (CET) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by mails.dpdk.org (Postfix) with ESMTP id 53DF0400D5 for ; Sat, 2 Mar 2024 17:35:12 +0100 (CET) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7c7c984699fso128352939f.1 for ; Sat, 02 Mar 2024 08:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709397311; x=1710002111; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=hpBHeJfxutanTOum5qtwO/G+ZOu0ogl7gopIeR06Qig=; b=1rHg2z1F+Kl2alIsMBFVy8bbQ1ZOmYgYuM8ytIexcb17Wc3HdBrPseP+I8Vld236Fp RmuMLKbjIohH1LFKsz8GiGnuL2vVCsENaGcMJBjhykJ+kVPaJFy8zJi8F3zRwIdbVTCf 5/NI2/TqO6O/m17ChBdkt0L2Re8GW6NGiLnmv7qu3sBlLo13X7YD4jHsqt8ISKG2y575 u+CHVl/jKaVDzY8Cu51uBbr6/dkZsNTAxngePWXH9WW6IJWFXbBantwX0eIlWkwPQv5b X87dMMosoP7EzpzOk5lhqxmgU3Jzqsrx1bbd42Xlt3TlGpDgRc373MnCyXDEV1W4Qa+u J0dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709397311; x=1710002111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hpBHeJfxutanTOum5qtwO/G+ZOu0ogl7gopIeR06Qig=; b=AC4Yuz0F5LjbybTSATs/2scaPapr0gL0zPLsBPwFqtu4gUmXB/WQQe0dmmGo3vu2sm 7kVtlFtJC0Qjy2O1qNRQDowAXPZigOdTzp71p6qapqo7py/N7kQuCCG1r92M1o+iUTGx Itc8g/0YNWINqTHlaLRvJQRPu4dQRo8jJJh0RWc/LrOTjWKH8yABhA3ojOUcxzN4kMmP 0dDrHlicYQfDNVzEzKi0pclxHGp9q/ez5IQruJlIY73NvlL4B1LhmUDMOnBUuAlBR0L6 VFBX+6ulj1bN3rYLX8xxbNphbF+5tVR7KOtkNYCwrZh2/mIcO3YmSCxi+vGya4edDsll puOQ== X-Gm-Message-State: AOJu0YwGqPPLvAZm2CoPyjMalwPIYtEmBnyaRK277fe2Vd/TvFuIG9AH gBe0SLLbX687QjkL4pi3XvpCpdH4yuTYdWk/M3A/k8uxUR5WvzsMx2XHnu6gFDY= X-Google-Smtp-Source: AGHT+IGXa+tj5s5GqWqh1CsJ1HJ4ldPTi2gEPubLWu5Z3dALh5KX+YS6CqqXk/cpFgwIO6BLKN9yfQ== X-Received: by 2002:a05:6e02:1985:b0:365:b3b9:5135 with SMTP id g5-20020a056e02198500b00365b3b95135mr6414220ilf.7.1709397311372; Sat, 02 Mar 2024 08:35:11 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id c2-20020a63d502000000b005ce998b9391sm4773112pgg.67.2024.03.02.08.35.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 08:35:11 -0800 (PST) Date: Sat, 2 Mar 2024 08:35:09 -0800 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org Subject: Re: [PATCH v2 00/71] replace use of fixed size rte_mempcy Message-ID: <20240302083509.1f7e9e05@hermes.local> In-Reply-To: References: <20240229225936.483472-1-stephen@networkplumber.org> <20240301171707.95242-1-stephen@networkplumber.org> <91b581bb-e181-4eac-879c-afd20b7bd6c4@lysator.liu.se> MIME-Version: 1.0 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 Sat, 2 Mar 2024 13:01:51 +0100 Mattias R=C3=B6nnblom wrote: > I ran some DSW benchmarks, and if you add >=20 > diff --git a/lib/eal/x86/include/rte_memcpy.h=20 > b/lib/eal/x86/include/rte_memcpy.h > index 72a92290e0..64cd82d78d 100644 > --- a/lib/eal/x86/include/rte_memcpy.h > +++ b/lib/eal/x86/include/rte_memcpy.h > @@ -862,6 +862,11 @@ rte_memcpy_aligned(void *dst, const void *src,=20 > size_t n) > static __rte_always_inline void * > rte_memcpy(void *dst, const void *src, size_t n) > { > + if (__builtin_constant_p(n) && n <=3D 32) { > + memcpy(dst, src, n); > + return dst; > + } > + The default GCC inline threshold is 64 bytes (ie cache line size) and that makes sense. Since using __builtin_constant_p could do: if (__builtin_constant_p(p) && n < RTE_CACHE_LINE_SIZE) return __builtin_memcpy(dst, src, n);