From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E415F45493;
	Tue, 18 Jun 2024 19:41:56 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 56ED2410E3;
	Tue, 18 Jun 2024 19:41:55 +0200 (CEST)
Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com
 [209.85.128.53]) by mails.dpdk.org (Postfix) with ESMTP id CDB0A402CB
 for <dev@dpdk.org>; Tue, 18 Jun 2024 19:41:54 +0200 (CEST)
Received: by mail-wm1-f53.google.com with SMTP id
 5b1f17b1804b1-42172ab4b60so50596955e9.0
 for <dev@dpdk.org>; Tue, 18 Jun 2024 10:41:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bytedance.com; s=google; t=1718732514; x=1719337314; 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=/rr544IiwFCVF4Rvrud2KNy3YUHH24rcSU7lz9NHRKo=;
 b=chvNs52AQw1Hjn8iZylgG3xCW7gsXAYJ/mdm0F/CxrjWFi4Nr7ZUnplYU4imj+VOaa
 qq8KP2Mvd475Nyt3GFNUgQe3ZGaflM3fo//oFp/xpixrgrCNFereYzYKpeG3C5Y3Bng0
 N9/wqKBrHBJfTxtJor8C9/WqMuKCgOuLWBBIXtdcrobczK0VU9Dy2SxZnaWvlUF8j/v2
 4HMVsp5BqSDsKb0vWRgGBeH2o4q/6Hrbvo4bXh4B2NolEPfn2nEPl0N2ZQGWZ1IwsZYL
 5cGp0bz7HSFHEGWhNYaCBrbNqzkmAyjj8mBDHXjVngT2vAA8cQ5/ls9sPskJGKK5VZGY
 IBGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1718732514; x=1719337314;
 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=/rr544IiwFCVF4Rvrud2KNy3YUHH24rcSU7lz9NHRKo=;
 b=Uu/dRu2lH4nKXJlLmD2RBCx+7261dt7KUaHj65IYi7O8JD0NBDNksrBoY/4tOcAobM
 yjehS/pZeqa0kNpItgVd8FtVi7qb9tkK5wiU/xw5tSE2TWYfI/vDHVWHpqEBlO9OIyGX
 Q9NpjHb5bo6pNjTKLhoUXbn1JujP70xXz2NrKz7JbLFJpZRrKQhfbJTkzvc1i2YhpQ3E
 NLYWoU/W+wfp+CvoJhUF2vDcAlPah+qhORvkajoar5GKYy7u3XHg6fgB4jHeTsmdHZVR
 ttZbb6evqkwtOFsAOw6+u3qnyWudF6juvftt9GcI4sqTOAP3r7/vDwllaA6zlzxG4RsJ
 AlpA==
X-Gm-Message-State: AOJu0Yx5doRNmN8Ub8AN1qqxl9rNoQMMZvqmMEV0Q+L3xYep1aUH68oh
 f9dk1wSYD0wmtgNAoona0GzfG67796d+lqfGg4V8r+8UhyxGy9QLtDrtMtOKQS4=
X-Google-Smtp-Source: AGHT+IGpweOEKAcoyIQRZG60V7JntFO6Pat0g1TEVoD/iQ8fIo6cVCNc1WPNboUFTa6w8MlXUrvyuQ==
X-Received: by 2002:a05:600c:4907:b0:422:5c5d:1b92 with SMTP id
 5b1f17b1804b1-4247507a17bmr1447085e9.3.1718732514519; 
 Tue, 18 Jun 2024 10:41:54 -0700 (PDT)
Received: from C02FF2N1MD6T.bytedance.net ([79.173.157.19])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3609d95bc02sm3211334f8f.18.2024.06.18.10.41.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 18 Jun 2024 10:41:54 -0700 (PDT)
From: Daniel Gregory <daniel.gregory@bytedance.com>
To: Stanislaw Kardach <stanislaw.kardach@gmail.com>,
 Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Liang Ma <liangma@liangbit.com>,
 Punit Agrawal <punit.agrawal@bytedance.com>,
 Pengcheng Wang <wangpengcheng.pp@bytedance.com>,
 Chunsong Feng <fengchunsong@bytedance.com>,
 Daniel Gregory <daniel.gregory@bytedance.com>
Subject: [PATCH 1/5] config/riscv: add flag for using Zbc extension
Date: Tue, 18 Jun 2024 18:41:29 +0100
Message-Id: <20240618174133.33457-2-daniel.gregory@bytedance.com>
X-Mailer: git-send-email 2.39.3 (Apple Git-146)
In-Reply-To: <20240618174133.33457-1-daniel.gregory@bytedance.com>
References: <20240618174133.33457-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 <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

The RISC-V Zbc extension adds carry-less multiply instructions we can
use to implement more efficient CRC hashing algorithms.

Signed-off-by: Daniel Gregory <daniel.gregory@bytedance.com>
---
 config/riscv/meson.build | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/config/riscv/meson.build b/config/riscv/meson.build
index 07d7d9da23..4bda4089bd 100644
--- a/config/riscv/meson.build
+++ b/config/riscv/meson.build
@@ -26,6 +26,13 @@ flags_common = [
     # read from /proc/device-tree/cpus/timebase-frequency. This property is
     # guaranteed on Linux, as riscv time_init() requires it.
     ['RTE_RISCV_TIME_FREQ', 0],
+
+    # Use RISC-V Carry-less multiplication extension (Zbc) for hardware
+    # implementations of CRC-32C (lib/hash/rte_crc_riscv64.h), CRC-32 and CRC-16
+    # (lib/net/net_crc_zbc.c). Requires intrinsics available in GCC 14.1.0+ and
+    # Clang 18.1.0+
+    # Make sure to add '_zbc' to your target's -march below
+    ['RTE_RISCV_ZBC', false],
 ]
 
 ## SoC-specific options.
-- 
2.39.2