Message ID | 20240530171948.19763-1-daniel.gregory@bytedance.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B142844114; Thu, 30 May 2024 19:20:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C78A402F0; Thu, 30 May 2024 19:20:50 +0200 (CEST) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mails.dpdk.org (Postfix) with ESMTP id 3858140281 for <dev@dpdk.org>; Thu, 30 May 2024 19:20:48 +0200 (CEST) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-57a1059dc4fso1172893a12.0 for <dev@dpdk.org>; Thu, 30 May 2024 10:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1717089648; x=1717694448; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jBJTlyEN6lXiCZcJnODju/GzQxysu5Fqp2gOmCevwwY=; b=LO7lXkeGQkqd8Ht9+cox21AQh+/MrVsdfbqeUTN/J08KBkx2SvbyDy5ceOB2AklDmH nm30w5p42fjZkSw/gZKnlfHzQSCysjXRSMXgw2d0CURh4lWi/0BI7JFd8YOBj5wCbDcl jMmhCBbecH6sbdIcy/5Gu3M91MnfJdLjPc7EuFTGfM1L4ZsTfZZ+4DuFeQOA1mIWXwhL 0qlMDoWzY95COgtRbxKh3Y/1li84ytTDpI8zggrzYUMtsH1VKxWbd4R41540qDKbzFWL f3/S4VMiwthu7PK9Ip/pp39S1PgYKDp9NW0RbWSaJ5/vFRMzLNPOZJU89+Igp5Gb+Xhk YXbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717089648; x=1717694448; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jBJTlyEN6lXiCZcJnODju/GzQxysu5Fqp2gOmCevwwY=; b=w2iRRaHnW1f02JkKwS9mvt5Yv+HQ54sBjnqt5Olc8zEyNjXNbTsaLcf8LzHBn/owvc yQTySUJanOIYO9H4lzva+H8CpB9jQZ+HGBhH6TQv5gYpvaZFnmt8v06DcqMXLVRK5b0c OYh5hLI0aYvjbhEZ+mApnuMz/NXP4Nlvu6V6PQCA17AhZLsOgyAE3+hRIuXvPUefQEXz 7NHIGk7mh20idq8ZDfz7p6et3D4rL1zBqtpI9pAePicgm+vIzdYILQCpEWD1dwGLLJqN DG7TYE++oGCbqOZi3I92l3RU3wwo+iZMYuwtE8vyXBO/nQha2yySV1h7fuqPsREiq/Hj hoTg== X-Forwarded-Encrypted: i=1; AJvYcCUlCGykSk46nppV3BAJ/wv1TOA4xRaoGIrDlET4uIZ++FNrURdvsPnfkEFk0L4YQy5Dp9vINruqACyGPAo= X-Gm-Message-State: AOJu0YxooPXsJUaSlogRB7YExAqZriFYlT/JzU1CiWLcq76yx50tanBF oyEUuUSVbLSgF4cDuGJpBUmgrV5ZvsmUxErBq4GsTlsaFfkDyqIJTrE/4bjcs/A= X-Google-Smtp-Source: AGHT+IHntjtoJNjZTLu9Q4wvByUwxvAWA/IwRPYTbDSuOP0G3Vliip/jy28dBTXq0AKdW+gUrDEt1Q== X-Received: by 2002:a17:906:36db:b0:a66:a24f:145 with SMTP id a640c23a62f3a-a66a24f04e5mr121598266b.4.1717089648527; Thu, 30 May 2024 10:20:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:20:47 -0700 (PDT) From: Daniel Gregory <daniel.gregory@bytedance.com> To: Stanislaw Kardach <stanislaw.kardach@gmail.com> Cc: Bruce Richardson <bruce.richardson@intel.com>, Tyler Retzlaff <roretzla@linux.microsoft.com>, dev@dpdk.org, Liang Ma <liangma@liangbit.com>, Punit Agrawal <punit.agrawal@bytedance.com>, Daniel Gregory <daniel.gregory@bytedance.com> Subject: [PATCH 0/2] eal/riscv: implement prefetch using zicbop Date: Thu, 30 May 2024 18:19:46 +0100 Message-Id: <20240530171948.19763-1-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) 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 <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
eal/riscv: implement prefetch using zicbop
|
|
Message
Daniel Gregory
May 30, 2024, 5:19 p.m. UTC
Instructions from RISC-V's Zicbop extension can be used to implement the rte_prefetch* family of functions. On modern versions of GCC (13.1.0+) and Clang (17.0.1+), these are emitted by __builtin_prefetch() when the extension is present. In order to support older compiler versions, this patchset manually emits these instructions using inline assembly. To do this, I have added a new flag, RTE_PREFETCH_WRITE_ARCH_DEFINED, that (similarly to RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED) hides the generic implementation of rte_prefetch*_write. I am still in the process of acquiring hardware that supports this extension, so I haven't tested how this affects performance yet. Daniel Gregory (2): eal: add flag to hide generic prefetch_write eal/riscv: add support for zicbop extension config/riscv/meson.build | 6 +++ lib/eal/include/generic/rte_prefetch.h | 47 +++++++++++++-------- lib/eal/riscv/include/rte_prefetch.h | 57 ++++++++++++++++++++++++-- 3 files changed, 90 insertions(+), 20 deletions(-)
Comments
Hello, On Thu, May 30, 2024 at 7:21 PM Daniel Gregory <daniel.gregory@bytedance.com> wrote: > > Instructions from RISC-V's Zicbop extension can be used to implement the > rte_prefetch* family of functions. On modern versions of GCC (13.1.0+) > and Clang (17.0.1+), these are emitted by __builtin_prefetch() when the > extension is present. > > In order to support older compiler versions, this patchset manually > emits these instructions using inline assembly. To do this, I have added > a new flag, RTE_PREFETCH_WRITE_ARCH_DEFINED, that > (similarly to RTE_WAIT_UNTIL_EQUAL_ARCH_DEFINED) hides the generic > implementation of rte_prefetch*_write. > > I am still in the process of acquiring hardware that supports this > extension, so I haven't tested how this affects performance yet. Let's hope you get such hardware by the next release. We will need reviews too. CC: Sachin.