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 0C46E41CEE; Mon, 20 Feb 2023 19:51:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0379430CD; Mon, 20 Feb 2023 19:51:16 +0100 (CET) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mails.dpdk.org (Postfix) with ESMTP id 28159430C6 for ; Mon, 20 Feb 2023 19:51:15 +0100 (CET) Received: by mail-ed1-f50.google.com with SMTP id eg37so4472552edb.12 for ; Mon, 20 Feb 2023 10:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vtH2KZrU0XLJI88WoFDtORJGLjxedV+FjmwoWmi6XyE=; b=fJzQmq1LH2kRtodevdV5bcfIwtiysqWOhfgQDdEkgZDGh7UkI2ykwLs9Flomi1r5q7 Ds0LUOCjjIfUSZArugNuFQmgt/Ne7YwsUpdQt4i7OK1V0YC4+J/SeTCgy1XKJ9381Ner oRv3G/hA4pnQXqy1dzVEOk3Qo4OU3jsWpkWLZXu82W+2WJexIVmhMlmh7hemuVLeiPT0 pWN+ByLmEYHfEDQNFdYS3sfWq4om0YHqczRmq/ittBj3uQxhVGrHjLAuJYacxJH/Sv6E 3pWI0SS5RVeSz0lB1wO6eWI0ohm2TNaRNnXIKeZw5e1UKpIytN83kCbP7GcGLt61mkf+ 5kFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vtH2KZrU0XLJI88WoFDtORJGLjxedV+FjmwoWmi6XyE=; b=47gtjcXp9/h9ghyFsrKFtQODOk4hD5TGRatQKe44b/i6ExXDu/J0jVFr937uby4unw 2lQkC6IKF5kdWXRn4F4Kcs+rKflsShmsNTvShpCnmYRLnTKIxYgLGyVepHNB/1/8dhfL HKOFAD4LakOAL/9fouwr5WiMBzv5ZpaD0/OwI4s4z1pJ67rUgzjnzeNV6krMqd7ovHo8 8Nuyc2nhCtf1iNmehP/rf5FbR+P9wJN5E4sonk+sXj8pt03669L7g5KuZon+z/KhDvoG VFl6Njp01SSDlDgxQQpsDMjtn6AT+Ov734gZVXXKrI4/2TRaceo90ivWiMVsvomr3gmV XRRg== X-Gm-Message-State: AO0yUKWy6B9QcbvTBhiCt0J698zkXBYyshc098GM3Ijd3hp4K1xTCvTh BNCrYu/ne0aJLx9i9NudFoyfxg3R7kP10ijunX4= X-Google-Smtp-Source: AK7set/olqI7gpuovgijbLCBKiY6YrVJp6iEV4uwgGqjXhGxrj2QDT85WxjRY8DAUIfLs4Ek4Mew+Uf5Hb78a+pm1Mg= X-Received: by 2002:a50:f619:0:b0:4ac:b74b:a6a3 with SMTP id c25-20020a50f619000000b004acb74ba6a3mr595316edn.0.1676919074660; Mon, 20 Feb 2023 10:51:14 -0800 (PST) MIME-Version: 1.0 References: <20230215105442.3878441-1-qobilidop@gmail.com> <3296424.9LS3J3VOpE@thomas> <16442264.0ZKypZ73Fx@thomas> In-Reply-To: From: Bili Dong Date: Mon, 20 Feb 2023 10:50:38 -0800 Message-ID: Subject: Re: [PATCH v3] hash: add XOR32 hash function To: "Dumitrescu, Cristian" Cc: "Richardson, Bruce" , "Gobriel, Sameh" , Thomas Monjalon , "dev@dpdk.org" , "Wang, Yipeng1" Content-Type: multipart/alternative; boundary="000000000000c3263905f52625bf" 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 --000000000000c3263905f52625bf Content-Type: text/plain; charset="UTF-8" I think the endianness conversions are necessary, otherwise, the hash function return value will be host endianness dependent. For example, what should rte_hash_xor32(/*data*/ &{0x00, 0x01, 0x02, 0x03}, /*data_len*/ 4, /*init_val*/ 0x0) return? With the current implementation, it returns 0x00010203 consistently. If we remove the endianness conversions, it will return 0x00010203 on big-endian hosts and 0x03020100 on little-endian hosts. Please correct me but I don't think that's the expected behavior. On Mon, Feb 20, 2023 at 10:19 AM Dumitrescu, Cristian < cristian.dumitrescu@intel.com> wrote: > Hi Bili, > > > > Would it be possible to also remove the endianness conversion from this > hash function? What would be the impact if the rte_cpu_to_be() functions > are removed? > > > > Thanks, > > Cristian > > --000000000000c3263905f52625bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I think the endianness conversions=C2=A0are necessary, oth= erwise, the hash function return value will be host endianness dependent.
For example, what should=C2=A0rte_hash_xor32(/*data*/ &am= p;{0x00, 0x01, 0x02, 0x03}, /*data_len*/ 4, /*init_val*/ 0x0) return? With = the current implementation, it returns 0x00010203 consistently. If we remov= e the endianness conversions, it will return 0x00010203 on big-endian hosts= and 0x03020100 on little-endian hosts. Please correct=C2=A0me but I don= 9;t think that's the expected behavior.

On Mon, Feb 20, 2023 at 10= :19 AM Dumitrescu, Cristian <cristian.dumitrescu@intel.com> wrote:

Hi Bili,

=C2=A0

Would it be possible to also remove the endianness c= onversion from this hash function? What would be the impact if the rte_cpu_= to_be() functions are removed?

=C2=A0

Thanks,

Cristian

--000000000000c3263905f52625bf--