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 1E36443BD7; Tue, 27 Feb 2024 23:34:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94D244026E; Tue, 27 Feb 2024 23:34:28 +0100 (CET) Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mails.dpdk.org (Postfix) with ESMTP id 25D1540150 for ; Tue, 27 Feb 2024 23:34:26 +0100 (CET) Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6e47a104c2eso3039983b3a.2 for ; Tue, 27 Feb 2024 14:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709073265; x=1709678065; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=zQQa/X5Qx8R7rNzuvfVZNg1Alpl9mmaAnAmmVHKhQ/A=; b=BeSvJHJ1OOwy/wrUWkyWafI9zS2FAhCqcwYWa6QjmW2IjdtAGYXZWyRyPwf4hbyvlb f0nhZvw4fLZYn2ZSk8GtYQiyDgnHUENnjoza0YRL7z/aLNUw33fK0RaHVfj/FdsdIULY 3cUYcI+DmBYg/r9ftnDVY7oCktUM3TrrAEXFE1uOL3htpVXXs+G0oAHeiqQQiY48R5Z2 O3Lwhvmv1loEMj7lPQjqyn8d1s486VqF0R4DDyK4KFO4bZiSVIEf4QRL5d51dAD4JP0N pqDOarUINL88Uemh5C1HhADmm95Szl8Gr4z1ztqkjs+TNqSqyWkQuzd84AKS5lqbD6lY 03sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709073265; x=1709678065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zQQa/X5Qx8R7rNzuvfVZNg1Alpl9mmaAnAmmVHKhQ/A=; b=uUMRTKDWHvLgI+VNV2myTouWILChwhDi9bxO3F8KnYQm0PXWyyakh1eLa2Cg4jrGKD 3MF7K0/9Aixy85y6EBMtZI/frlhTzCjFSG1pl10v8yDQ5StLZKaR/Jb1TrAmj3q+QRRs WcjX+WVOaY1eCdC2fK/dXF7TNWxchDxwZ+iDquz3IRHxE3SJm1cuTWH7dmIgFZ6fml/P RG4dlFAKCmi+l6ZzpPgzUTI4qPFa/bO8k3cVPlZSYVShJGblx2Ul6TZo8OBfe7BQV2p/ xD+RgMQ/SgpLnlSNKSNdf+WDmS+tun4DdSD2DOTp1iKNohXUbMcOceVale0yP4mVGVrF 4EuA== X-Gm-Message-State: AOJu0Ywj3I/RbWRZAhRfWhApd+pyg/TfKzUh1kmWjK7wulgpD9X3AfE3 VFjy0xHPi2qpOF+Q5Sg/HJSFZf0FC8SRUDT4uyoXMiXtUhyKQwq2QFNj4mHVOWk= X-Google-Smtp-Source: AGHT+IEOdVTH63Jrmj0CyQ+82FzH8zgYSGR41xItMb41fkrAPEGly1ANCpww39zvVa8JA76B97fsug== X-Received: by 2002:a05:6a20:c116:b0:1a0:fc33:17b8 with SMTP id bh22-20020a056a20c11600b001a0fc3317b8mr2703880pzb.24.1709073265423; Tue, 27 Feb 2024 14:34:25 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id s24-20020a17090ad49800b0029a34e3a197sm49215pju.44.2024.02.27.14.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 14:34:25 -0800 (PST) Date: Tue, 27 Feb 2024 14:34:22 -0800 From: Stephen Hemminger To: Mattias =?UTF-8?B?UsO2bm5ibG9t?= Cc: dev@dpdk.org, Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: Re: [PATCH v2] lib/hash: add siphash Message-ID: <20240227143422.053e1a74@hermes.local> In-Reply-To: <256907dd-f8d5-4cd4-a51d-e176ae332761@lysator.liu.se> References: <20240227174012.343004-1-stephen@networkplumber.org> <20240227191437.346593-2-stephen@networkplumber.org> <256907dd-f8d5-4cd4-a51d-e176ae332761@lysator.liu.se> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Tue, 27 Feb 2024 22:57:06 +0100 Mattias R=C3=B6nnblom wrote: > The portable and x86 version will compile to the same thing on x86. >=20 > A simpler implementation would be >=20 > static __rte_always_inline uint64_t > u8to64_le(const uint8_t *p) > { > uint64_t w; > memcpy(&w, p, sizeof(w)); > return rte_cpu_to_le(w); > } >=20 > ...which probably also compiles to the same code. >=20 > Do you want the same hash value on big and little endian, or why the=20 > conversion? I am following what other implementations do here. The reference implementa= tion does it off of little endian. And so does FreeBSD and Linux. The shift version comes from the reference version. Your right, with -O3 both get optimized away.