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 303C044114; Thu, 30 May 2024 19:20:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA42A40EE4; Thu, 30 May 2024 19:20:51 +0200 (CEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mails.dpdk.org (Postfix) with ESMTP id A9CC840281 for ; Thu, 30 May 2024 19:20:49 +0200 (CEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a621cb07d8fso120124266b.2 for ; Thu, 30 May 2024 10:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1717089649; x=1717694449; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ROuxMZwF3T1Vam6m/sO5KHEzM4OuwwgcJxok7g2SzIo=; b=Z52Ff+1tZYHdvo3aCIYrqPgrsnmATRbjXn8wryWwGKHD2e6oT4kD3O/ojqccvU3o7p T3FSmMQxt2bo089UDXnj5/farM0XuovrfY+zqgBBueY+o2RzwQnlVoa+Nrg9lnOWp0by JnwdiLSnsqbfuecf4ejxyj316wc8Bxm14AyjP8c3hFkKmjZ7YONnh6qQtyKYe/G11oAj BKDY7x30dUrmQMWeRlDZSiYMQGhxn+lKdXNCmXyXqug4C0UAf4cAkAaCIVh/vctY5rfK /7wtYG5VNbgPPqDdplTPJXSvgdjNWWnFrrP1S8mmKJlis1eixEiCaZ3Q/O+/4oQG44Ga IUXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717089649; x=1717694449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ROuxMZwF3T1Vam6m/sO5KHEzM4OuwwgcJxok7g2SzIo=; b=eTDRxg4lblkk3glPyghrnt0b8f4hT8q6MWwmZeQH75VKLlst8LanLj4tQcdB9idPxO HTN5peDhD0obSNe7GNizFFWBAcTc5K3K6aAVIrGZyxYzYob2YlAiMj46RQqDkjdUt4gL v5UgwW6tQCHXXP7IngW+wk/qhYNSNInjACTUaNN5UkkLnPBJ9R7AYI6hIk0p8d+5/6bi nNWs2yQiRatl22T8j6hqLY94d+Maz3oFUeuRZvhNG9l12rSmR1rQvVd4ANDxZOJIppEG +qh40bVF6tcKKD9pVHLxCE8PUvv1zJchee/JFh28s6jKva17TW5wq77KMqxKPcJuxoUa N1OQ== X-Forwarded-Encrypted: i=1; AJvYcCU+Jbm3NtyFXxQDy0TKBaeQ0eWPjfgHc1LnODS7545C0wZXRK59VlRrBy2spuHiGGilAp8gr2KH0RJ2kkA= X-Gm-Message-State: AOJu0Yzyy9d/sqqcz7dGKa+qq/60ha0hZvY2cWBviZYz95JRzw9m3x/E +COVuMICiWploR0G+FSGC7x2RK8lKupGgWy3MLu202zvYq17Ms5gDgzXnNNQAtbF7ICH14NhjMt ZY7I= X-Google-Smtp-Source: AGHT+IEwoNqZqSeOPQpcS1lAY462AmiqHp3M5E2X98ypAfjS5+jkOvKkb+u3F8xxmaTscwuSt4N6Kw== X-Received: by 2002:a17:906:5ad4:b0:a58:a0b8:2a64 with SMTP id a640c23a62f3a-a65e8d22f5emr188163966b.5.1717089649357; Thu, 30 May 2024 10:20:49 -0700 (PDT) Received: from C02FF2N1MD6T.bytedance.net ([93.115.195.2]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a644f347fd4sm197141366b.212.2024.05.30.10.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:20:48 -0700 (PDT) From: Daniel Gregory To: Stanislaw Kardach Cc: Bruce Richardson , Tyler Retzlaff , dev@dpdk.org, Liang Ma , Punit Agrawal , Daniel Gregory Subject: [PATCH 1/2] eal: add flag to hide generic prefetch_write Date: Thu, 30 May 2024 18:19:47 +0100 Message-Id: <20240530171948.19763-2-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240530171948.19763-1-daniel.gregory@bytedance.com> References: <20240530171948.19763-1-daniel.gregory@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This allows for the definition of architecture-specific implementations of the rte_prefetch*_write collection of functions by defining RTE_PREFETCH_WRITE_ARCH_DEFINED. Signed-off-by: Daniel Gregory --- lib/eal/include/generic/rte_prefetch.h | 47 +++++++++++++++++--------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/lib/eal/include/generic/rte_prefetch.h b/lib/eal/include/generic/rte_prefetch.h index f9fab5e359..5558376cba 100644 --- a/lib/eal/include/generic/rte_prefetch.h +++ b/lib/eal/include/generic/rte_prefetch.h @@ -65,14 +65,7 @@ static inline void rte_prefetch_non_temporal(const volatile void *p); */ __rte_experimental static inline void -rte_prefetch0_write(const void *p) -{ - /* 1 indicates intention to write, 3 sets target cache level to L1. See - * GCC docs where these integer constants are described in more detail: - * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - */ - __builtin_prefetch(p, 1, 3); -} +rte_prefetch0_write(const void *p); /** * @warning @@ -86,14 +79,7 @@ rte_prefetch0_write(const void *p) */ __rte_experimental static inline void -rte_prefetch1_write(const void *p) -{ - /* 1 indicates intention to write, 2 sets target cache level to L2. See - * GCC docs where these integer constants are described in more detail: - * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html - */ - __builtin_prefetch(p, 1, 2); -} +rte_prefetch1_write(const void *p); /** * @warning @@ -105,6 +91,33 @@ rte_prefetch1_write(const void *p) * * @param p Address to prefetch */ +__rte_experimental +static inline void +rte_prefetch2_write(const void *p); + +#ifndef RTE_PREFETCH_WRITE_ARCH_DEFINED +__rte_experimental +static inline void +rte_prefetch0_write(const void *p) +{ + /* 1 indicates intention to write, 3 sets target cache level to L1. See + * GCC docs where these integer constants are described in more detail: + * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html + */ + __builtin_prefetch(p, 1, 3); +} + +__rte_experimental +static inline void +rte_prefetch1_write(const void *p) +{ + /* 1 indicates intention to write, 2 sets target cache level to L2. See + * GCC docs where these integer constants are described in more detail: + * https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html + */ + __builtin_prefetch(p, 1, 2); +} + __rte_experimental static inline void rte_prefetch2_write(const void *p) @@ -116,6 +129,8 @@ rte_prefetch2_write(const void *p) __builtin_prefetch(p, 1, 1); } +#endif /* RTE_PREFETCH_WRITE_ARCH_DEFINED */ + /** * @warning * @b EXPERIMENTAL: this API may change, or be removed, without prior notice -- 2.39.2