From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id A4A02F04 for ; Tue, 19 Sep 2017 12:08:00 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id m127so3389785wmm.0 for ; Tue, 19 Sep 2017 03:08:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=NjtlZfdjNxuN+pbvaNQwYTCpCsjJEhPm9fKjW18bVts=; b=joFG00gjlNWMxxDqW6ySi3zPUjCs0D9sjTdC61hel+qRGqH7cPlXfIrFwQgeU8bpHN j8Hy3KPJPivDz/KUCP0eItCGzO+H6IqHJm5FHYxuMsMyzt6X5gR4oVVa1SoFCuf3okDA cAlrsC1HilGFXvE6RWMGCnf0ngsifDhcAsO/TmTpNHBC4IZuYJDpWnwRDbz0HmHA0Hu4 VWw8+rvV2wKmSNT7G+zl2AZXrzplQVwjmlZ0a0XQYro+AU6yf1ytVxqL76zilfQfJpw7 /Ykz6oHJB43KulserGg/HG8vjrvHtZkPMpmV8MXmSA2gyv8yGzm9+OBkRsU2VjOFkniO vFMA== X-Gm-Message-State: AHPjjUhD6nLTWDc7Q72oW13gi+cyZyGpluhHhImJbLOT6dLymyUyorKf eudoHHlD2Cy+cbE/o/OZqKU= X-Google-Smtp-Source: AOwi7QDikJufiDFCgqsWNjVZT5PKoGab8Uhig5ePD2kL04C1X7AWXSEpU+j67dezf5o8DYTyRwiL8w== X-Received: by 10.80.161.69 with SMTP id 63mr1202030edj.283.1505815677330; Tue, 19 Sep 2017 03:07:57 -0700 (PDT) Received: from localhost ([213.251.34.151]) by smtp.gmail.com with ESMTPSA id j90sm4835479edb.23.2017.09.19.03.07.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Sep 2017 03:07:56 -0700 (PDT) Message-ID: <1505815675.19272.19.camel@debian.org> From: Luca Boccassi To: Chas Williams <3chas3@gmail.com>, dev@dpdk.org Cc: bruce.richardson@intel.com, pablo.de.lara.guarch@intel.com, Chas Williams Date: Tue, 19 Sep 2017 11:07:55 +0100 In-Reply-To: <20170918194740.23057-1-3chas3@gmail.com> References: <20170918194740.23057-1-3chas3@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] hash: document rte_jhash() boundary behavior X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Sep 2017 10:08:00 -0000 On Mon, 2017-09-18 at 15:47 -0400, Chas Williams wrote: > From: Chas Williams >=20 > Due to the uint32_t accesses in the hash computation, keys that > aren't > aligned to a uint32_t boundary or multiples of uint32_t in length, > may > see accesses beyond the end of the key.=C2=A0=C2=A0This may cross a page > boundary. >=20 > Signed-off-by: Chas Williams > --- > =C2=A0lib/librte_hash/rte_jhash.h | 5 ++++- > =C2=A01 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_hash/rte_jhash.h > b/lib/librte_hash/rte_jhash.h > index 207478c..3eca138 100644 > --- a/lib/librte_hash/rte_jhash.h > +++ b/lib/librte_hash/rte_jhash.h > @@ -290,7 +290,10 @@ rte_jhash_32b_2hashes(const uint32_t *k, > uint32_t length, uint32_t *pc, uint32_t > =C2=A0/** > =C2=A0 * The most generic version, hashes an arbitrary sequence > =C2=A0 * of bytes.=C2=A0=C2=A0No alignment or length assumptions are made= about > - * the input key. > + * the input key.=C2=A0=C2=A0For keys not aligned to four byte boundarie= s > + * or a multiple of four bytes in length, the memory region > + * just after may be read (but not used in the computation). > + * This may cross a page boundary. > =C2=A0 * > =C2=A0 * @param key > =C2=A0 *=C2=A0=C2=A0=C2=A0Key to calculate hash of. Acked-by: Luca Boccassi --=20 Kind regards, Luca Boccassi