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 D929C45879; Tue, 27 Aug 2024 17:37:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CDA240E96; Tue, 27 Aug 2024 17:37:01 +0200 (CEST) Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mails.dpdk.org (Postfix) with ESMTP id 3BA4040E4A for ; Tue, 27 Aug 2024 17:36:59 +0200 (CEST) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a868d7f92feso717026366b.2 for ; Tue, 27 Aug 2024 08:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724773019; x=1725377819; 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=91FV7IUnLwVkgY+OGLWwWi6z4d/MA5QJ0XPfrVZ2yVA=; b=NIp4kje8MyS7OshjcXVUaVc8bVdYT+y1DQEtvP/xoyi0mKyc3gK+sYAiEVz952HVG/ 55QQREuVwOVivdSrmp6/X8QEOs6P+0vWhMNZUkJeZPbAlNc7WxDdA4bcsbDzgrASTBMe DuoYYtUNhmttXD5e69XJkDetP3doWcK1q62G4Bdn/KziHtoTveW9he5bRs5ns+T4eNkT Fz8OOAjlgmal58n1GZl5hJ67nroKAu2hvRzSFywmnTxtRmFrF02TVWvzaBWjUBWWpsPC ojF5r7+DZr/c0K/CwZMV42uiDmU8hXV6ey9891cIgbPdJX3+B0Z1TAEbP4/7scXsbGgV cJgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724773019; x=1725377819; 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=91FV7IUnLwVkgY+OGLWwWi6z4d/MA5QJ0XPfrVZ2yVA=; b=DwebSZs3s/gWlspPzgrCSc4oAmSqPwOtwKnhRuIHUJVAowbo+034EWjbrOUd47qlNG F1UCXYCHi7s1hJ/OabY/QIiGfAv0wJ7YQ+Td+SsN1o2oUg/fSBTUFcvbr9C3PnwWiOd0 HiY951Nyl6TKYIQKOS0E/JyISIvETdA9HBGOzP8HsRUUfoQYcQwVDtfr5lfBXRWBlW7+ Vod86+ng/EgZq4rswtRyXj+/kbN790saJ3zsFpIFLciHrnzpD2Se0krbBxAVDiAxo7VI XSMEI3r78Z/QLRM5Lr0p8H7nPeoJfPWL3FsOCgYsUJH/D7QAbxdkKWPwdCBetGponiSV girg== X-Gm-Message-State: AOJu0Yz4r5HSyxe9EqlVjWkYdQsjjhPzPW1qQo35IXnd1gATveIIEsYl IrCpJte7PN1/v4BB/qHPiwmU9iFWP681VGJTZyn6pKb1ANyZLGXIqGXwjist+Iw= X-Google-Smtp-Source: AGHT+IHutqGhg4uAH3v/jJOAjXFHNs+DHHtmMIZc/4EzRmQ5XrKl05vBqwhc9A73wNEA2REDGa7jDQ== X-Received: by 2002:a17:907:1c0a:b0:a86:a90f:3025 with SMTP id a640c23a62f3a-a86a90f3de8mr1039872066b.59.1724773018785; Tue, 27 Aug 2024 08:36:58 -0700 (PDT) Received: from C02FF2N1MD6T.bytedance.net ([79.173.157.19]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e592d995sm122307366b.204.2024.08.27.08.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 08:36: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 v3 8/9] hash/cuckoo: use accelerated CRC on riscv Date: Tue, 27 Aug 2024 16:36:48 +0100 Message-Id: <20240827153650.53170-4-daniel.gregory@bytedance.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20240827153650.53170-1-daniel.gregory@bytedance.com> References: <20240827153230.52880-1-daniel.gregory@bytedance.com> <20240827153650.53170-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 577b5839d3..872f88fdce 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -427,6 +427,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