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 B82CA45493; Tue, 18 Jun 2024 19:42:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 697AD427C3; Tue, 18 Jun 2024 19:42:07 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 6E2E3427D0 for ; Tue, 18 Jun 2024 19:42:06 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35f0aeff7a8so4721192f8f.2 for ; Tue, 18 Jun 2024 10:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1718732526; x=1719337326; 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=1PLJ7WF3NGso63QCKOY67KIl0coE65zl9MiF7ijWJA8=; b=PxJUz+P1iWWdHvfjsbf122tGE1MaOwv4ulVU5kE51dFufIvmRQAD8Yp1hH/wK8EaKK rKJQL+5zvXPIV1zefJ4ACF3vbbVVYwyrjVQRB13F8KhBPxLlsDXBYdTi+mgCR0kufUhl UZ+iVyrwHaeKOyKlpAAxz4q16CziFph5NDCa02Uq8o0r2YvppEd0VXJSLlXB/X4uS/2M KbDpzrhTJP7mMi1o136VAaXxHUnZ7MexMYxxTAahugPjPjKw2DhrGZsM2FzX6QS9/R48 j261UGkteSwcq5aOhaBU0XhcVwjQJKjb4DV/Zn1fVydOYLwf0VjmzemnL7mIXHON3LvF c+Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718732526; x=1719337326; 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=1PLJ7WF3NGso63QCKOY67KIl0coE65zl9MiF7ijWJA8=; b=YXnOwAJi2+4uw140vRwgyUKO+XgPyqAK+FoWUl7BvUgEGYji0JqsdgCutdpEqT/AQq p5GCpMjTTyxv56BrxBCn9rPe+cANDglzthdOemVPyDyJIKrqXWlcGga0gsz8v6xSWmq5 MEgMeJkkWTver4SrNoKxYXS7irBsgYEw15+0g4ydWPRbjOwUjpYgSy4LGDBjYWoQ4ei8 +1Z/MZ+zcYu0INyjQ97GHmNs09lWY5tQF/xrwMjxWSHxLb1ohB7G5moYekbZVLEVLGYg VHm+AY6SdPMm9x2IktsMbrmjCkW20ub1yilCi3jFpp79Yiyegc0cm/UzkHRMGjDDYg+c wrog== X-Gm-Message-State: AOJu0YwVxVSSGynaR9lf9xKhPejwNAR2fTqvTlnWBfQuGlGrxpsCfPjx o02+RhgiBbs3JXzEXOjqxDHFH0tdjtSL0Ebhbawtjg9rTwweu2wlwscnnNFtgO0= X-Google-Smtp-Source: AGHT+IEMDO2FxEYrPtzvPTc4KEOcnUrjUKJLYKCFVyKG/hgUtCODb0I3z9ktmg9SkPNwvLYsyJHlUA== X-Received: by 2002:a5d:4709:0:b0:361:fd04:95ed with SMTP id ffacd0b85a97d-363176ad7ebmr219816f8f.15.1718732526186; Tue, 18 Jun 2024 10:42:06 -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.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 10:42:05 -0700 (PDT) From: Daniel Gregory To: Konstantin Ananyev Cc: dev@dpdk.org, Liang Ma , Punit Agrawal , Pengcheng Wang , Chunsong Feng , Daniel Gregory Subject: [PATCH 5/5] ipfrag: use accelerated crc on riscv Date: Tue, 18 Jun 2024 18:41:33 +0100 Message-Id: <20240618174133.33457-6-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 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/ip_frag/ip_frag_internal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ip_frag/ip_frag_internal.c b/lib/ip_frag/ip_frag_internal.c index 7cbef647df..7806264078 100644 --- a/lib/ip_frag/ip_frag_internal.c +++ b/lib/ip_frag/ip_frag_internal.c @@ -45,14 +45,14 @@ ipv4_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2) p = (const uint32_t *)&key->src_dst; -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_RISCV_ZBC) v = rte_hash_crc_4byte(p[0], PRIME_VALUE); v = rte_hash_crc_4byte(p[1], v); v = rte_hash_crc_4byte(key->id, v); #else v = rte_jhash_3words(p[0], p[1], key->id, PRIME_VALUE); -#endif /* RTE_ARCH_X86 */ +#endif /* RTE_ARCH_X86 || RTE_ARCH_ARM64 || RTE_RISCV_ZBC */ *v1 = v; *v2 = (v << 7) + (v >> 14); @@ -66,7 +66,7 @@ ipv6_frag_hash(const struct ip_frag_key *key, uint32_t *v1, uint32_t *v2) p = (const uint32_t *) &key->src_dst; -#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) +#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) || defined(RTE_RISCV_ZBC) v = rte_hash_crc_4byte(p[0], PRIME_VALUE); v = rte_hash_crc_4byte(p[1], v); v = rte_hash_crc_4byte(p[2], v); -- 2.39.2