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 7B8F745879; Tue, 27 Aug 2024 17:37:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E42D740E44; Tue, 27 Aug 2024 17:36:58 +0200 (CEST) Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mails.dpdk.org (Postfix) with ESMTP id ADB5C4027A for ; Tue, 27 Aug 2024 17:36:55 +0200 (CEST) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a8692bbec79so723951666b.3 for ; Tue, 27 Aug 2024 08:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1724773015; x=1725377815; 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=fJv+3Kj0uPEOP5y0Y2ocVEgkO4TaIirtv2XHnKhsppJrEQ5G7J90byuPG7MQ2BKK+L GcXp+puxM6Ey4i6DeUL52reX65nQVmXtDYAWPJGo7bM4Jx1tju16b1/zy4an4TKz7FT8 0QOhsxU+VfsaJQ6/vIxNfEhEPU0OLHtxELMxW+58LN4YlbdlYvt2nvZOTynL9fXZEkEC uUOSqtksNpWwrYD8HQ7OX8Z4yW1vWHzrzu2xXDm3Pt2iNtTak8QOUYtpS1WF/bzWYe2+ mIKRMMaLBenAlK8HOgFeKMcDlWGP4R8sgU+hTr/ZFRMOjjuVHcxGJZ9xrtuqV8PYHsRi icMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724773015; x=1725377815; 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=Ek5zUbWtzjdZDexMfMtW/25vuCZVviac6PFWhjyg9BvtWqp/MvR6yh7ggnF3YI+EXF 2lH290TnGlzsZZ1Rby2ZZ5TB8RmupUbxUwfA6rWXNMPGN3nnaBMe5Ey9wBmaVP8H2bmq EVe7jSaiOy0fBqdToM52xqRSbujesWywZ5ZlXl/nBC5dYbXcnC36wDMcsZxAqJIcp17J VhVV/Z6CINqiB66GQZyH30cdYNNJEEKW7LopWFvKpcCtzsrIUyKJn/GPv5LmYGDBC4fM pzxj7G2dcWusPoXrVO0FbwymDo/ay0Ah8xCAXGARsSD4J/nkg+F7+8J6C6rSUl7a9hKr Wjyw== X-Gm-Message-State: AOJu0YwfKWnhEcamNK1fo037fGHdKUII+iRCPje4Rd2RNSow1iF9HoRx Dq5BhMq+QT00sPcthvWtrSJnsDO3Lr8f/xsfz+TCUK6YRqOR5O1BLwtd8uLgin0= X-Google-Smtp-Source: AGHT+IE4b4J4p00JiOSrHMvB8C1mHntP3XLmtF5qv+Tr29QFCLphj0mNutNN09m/jme3z3iosQQMhw== X-Received: by 2002:a17:907:2dac:b0:a86:b32f:eee6 with SMTP id a640c23a62f3a-a86e3c1d2b5mr208155866b.54.1724773015169; Tue, 27 Aug 2024 08:36:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 08:36:54 -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 v3 6/9] ipfrag: use accelerated CRC on riscv Date: Tue, 27 Aug 2024 16:36:46 +0100 Message-Id: <20240827153650.53170-2-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/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