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 887D445614; Fri, 12 Jul 2024 17:47:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26C3142F43; Fri, 12 Jul 2024 17:47:04 +0200 (CEST) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mails.dpdk.org (Postfix) with ESMTP id 2E32942F02 for ; Fri, 12 Jul 2024 17:46:59 +0200 (CEST) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-427a0efdb9bso4498605e9.0 for ; Fri, 12 Jul 2024 08:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1720799219; x=1721404019; 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=4IAyGMCluAPNmaHWsuXWUhh/Sfwf4z9ge/pqJ2HChtM=; b=VaHXf6pyoWE3xpBrlRJoB03DPfqT5WUairvAY9kF+gwPheKg9tzKIO2o+IoDdByo8j fy0njedCZ97VsbDJvrLwwR2wlYmyVJO5GqY2q2qD2/H/e1MbLaxmp8ILHvy3jez4TZwQ DQsOZgTkHw2lMRuMGfmO4XjPSi/itMcpScYihKqyieHniVfPTVUxnf2Rg0TjoWdjiis8 +UswVE+TFX4SCrKrtjM9oz0GhCqwizzoYplD7NcRp+vJZ/C12SFocM7MgLsmrlIKxVt2 4I55U7/UGCjpO3QBSvqVPixrcPk8JxZ0PBqHkxIAsZRlxnp0OfNS8rbB5b+4ROGoaR0b sPzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720799219; x=1721404019; 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=4IAyGMCluAPNmaHWsuXWUhh/Sfwf4z9ge/pqJ2HChtM=; b=ubO32zWS2TIObLHK7c5NFdnhqhtIXOVyoHvMd01VpdqVVJQuHakxJXJ2o1n0aNqz2T 3MvXrYGwfY8y5Qi/tbGcRS1AkcDU5FNTOBXbP2nMs036YcxEDZRT3sppfKc47G+9CRXK Ut5sD0qmLgtvU6eNgUV5wCAqR2I1Z3i3VsZ6HIXh2wXl6YKCmJuQzL5/Dw1GAT17WO9O GsZBf9zR0xXqwWuoUxlqBbdsLsSaXtLU7x9ROR1lBRfrJB0ErycetlLRQJTGF+Zqh3+F ogOIt5NAof+LlFFlnD/nGM3VXnqzG5bH3ohMV1skzQ/ii6qc1mJs06S33RfrFB2M4B5O 2hnQ== X-Gm-Message-State: AOJu0Yz8AEIRjZCY1A7GWKkKm6bmH0RHVe4TKzX8XgI+KfHylzIoQdXD gPlIWTN4feinbo9ZXHePgFUFaOyDT/QSLr/x6uEg3ivqg4+CWQ7WOqifVawEsUM= X-Google-Smtp-Source: AGHT+IGX9xdBzAyKmCWWMt4fsdQJ0Pjabi071kyqP7Ol71Q1qrsajtrFuoeYK+5xXvRf3c9KZDVo4A== X-Received: by 2002:a05:6000:1887:b0:367:89fc:bc11 with SMTP id ffacd0b85a97d-367cea4625emr11215299f8f.10.1720799218905; Fri, 12 Jul 2024 08:46:58 -0700 (PDT) Received: from C02FF2N1MD6T.bytedance.net (ec2-3-9-240-80.eu-west-2.compute.amazonaws.com. [3.9.240.80]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-367cde7e023sm10468615f8f.13.2024.07.12.08.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 08:46:58 -0700 (PDT) From: Daniel Gregory To: Stanislaw Kardach , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Cc: dev@dpdk.org, Punit Agrawal , Liang Ma , Pengcheng Wang , Chunsong Feng , Daniel Gregory Subject: [PATCH v2 8/9] hash/cuckoo: use accelerated crc on riscv Date: Fri, 12 Jul 2024 16:46:44 +0100 Message-Id: <20240712154645.80622-9-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240712154645.80622-1-daniel.gregory@bytedance.com> References: <20240618174133.33457-1-daniel.gregory@bytedance.com> <20240712154645.80622-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 When the RISC-V Zbc (carryless multiplication) extension is present, an implementation of CRC hashing using hardware instructions is available. Use it rather than jhash. Signed-off-by: Daniel Gregory --- lib/hash/rte_cuckoo_hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index d87aa52b5b..8bdb1ff69d 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -409,6 +409,9 @@ rte_hash_create(const struct rte_hash_parameters *params) #elif defined(RTE_ARCH_ARM64) if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) default_hash_func = (rte_hash_function)rte_hash_crc; +#elif defined(RTE_ARCH_RISCV) + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_RISCV_EXT_ZBC)) + default_hash_func = (rte_hash_function)rte_hash_crc; #endif /* Setup hash context */ strlcpy(h->name, params->name, sizeof(h->name)); -- 2.39.2