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 EF31045614; Fri, 12 Jul 2024 17:47:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B664D42F0B; Fri, 12 Jul 2024 17:47:01 +0200 (CEST) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 0C97242ED4 for ; Fri, 12 Jul 2024 17:46:57 +0200 (CEST) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4266ed6c691so13450445e9.3 for ; Fri, 12 Jul 2024 08:46:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1720799216; x=1721404016; 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=ig7oQUmfGMoiMiqzEQ35/Y/AcIPG6+oyApdSU3REj1Q=; b=lkVd7UOPQfwHtJjy+yKDN0Q/49iuOjbp2Rl2YoasbG9lWjR+kWs9M2F5dbtkm9sYNR W6dJNxDOJfdl38KQtnVAyGbjX1XyuYIB28GxoWvVLmCmwuIgqBOvGuCHRJQYSOVjz7wh WvKFDqmK6lk9CUkty/PTTPNd1e39aFr/dKmxL/hl7x4/kC9Pl0pXYsXtJlmnDhjQ+Ile QlZdDRI1HTse0gC1xXGqTHYmoLRjlwbnmeOundzUcJIRGN0Lyc0wX1izFduOfbChTyGJ IrpTUiE+tgIE+4B3YHGfXgg6u/I+sqTsS+OFvAoccsvSX66gaxMtHa1fr5zhjSe7h8NF y+1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720799216; x=1721404016; 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=ig7oQUmfGMoiMiqzEQ35/Y/AcIPG6+oyApdSU3REj1Q=; b=n4OJ5NwbE5p/3seAYahQ2YTxY+YtljYlwO3AjNtNsqbuzApTqjYam0lAWtL2S5D33T 5Xo3cK9TlKUJwvQXEQi/rkf8w2f7QrvHqbmKERpzwJ3GKOsWMn3p7TLK0UBIEzUE/IuL 2wOzrks8uSSQTIJMz9LvWM4JvIGtfj6Ixi2LdGDTbZmUkISE4Gi8WESRFIYVHp0l/9I5 DF4kE66K6zM9W88U9FqmhX0ol6fXPrWToBgUW38WqWSs1GsXZpqxwXJp7YQ+RhQzhEZb JLfsPw4BGzecgSARNQ8e77oON9esGC4qSU9i0etXmTc4AjuAr24O3SLCuWXHkXaHv59E RULw== X-Gm-Message-State: AOJu0YyF6YDX1rDpAT+C7jH8rLjLyGTP+wN2luDr6Tz+55DOU17ymsgh 2vKbyLg756E05dcL5M5kfrVeY88vOBa8zVWZXhP72B0C5Fg9GEwtvP8vqGcIoGE= X-Google-Smtp-Source: AGHT+IEvKVeZVFHNu0zWxgsjgh9c1g4PaDEA+SJA+iqUfBmueNbuyI+Z6LsxTEi9PcR0X4VfR5gO0A== X-Received: by 2002:a5d:64ea:0:b0:367:8f98:c506 with SMTP id ffacd0b85a97d-367cea4679bmr9471900f8f.4.1720799216620; Fri, 12 Jul 2024 08:46:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jul 2024 08:46:56 -0700 (PDT) From: Daniel Gregory To: Stanislaw Kardach , Konstantin Ananyev Cc: dev@dpdk.org, Punit Agrawal , Liang Ma , Pengcheng Wang , Chunsong Feng , Daniel Gregory Subject: [PATCH v2 6/9] ipfrag: use accelerated crc on riscv Date: Fri, 12 Jul 2024 16:46:42 +0100 Message-Id: <20240712154645.80622-7-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/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..19a28c447b 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_FEATURE_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_FEATURE_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_FEATURE_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