From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 198844CE4 for ; Sun, 28 Oct 2018 11:18:54 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 7E52D21EA7; Sun, 28 Oct 2018 06:18:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 28 Oct 2018 06:18:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=GbU3aJfXj9YnkyVgwQNov8aDgAdyzjQ6nr9qnkuuBuo=; b=C+Uglu2bUipP rh2AHEZfzT6ZD4zT65Bwk+jzmbQZr7P+b3vVyBHR8b7WpYr4xHPhwDtKGAs/CqK0 JXM1ec5l+oMOKZNPyjmGaRm5tDU8B/9aXOZdq6wOUseNjSiIJj92IWbi9su+SPR3 Z7xn+r1nXk16v03VUd2sTfcaqvU8EyE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=GbU3aJfXj9YnkyVgwQNov8aDgAdyzjQ6nr9qnkuuB uo=; b=oSvlXaBv7K3CD7z8Oan1wPop0qPNcz6qVR2XwuAosKcJLkp6gm/obkt4l 9rX/LN36sG0U10mu8/Sfrv6uBqxt/iACfy8qEyWCfmyJvI78en+r9YGS/zksuBst 1Rh9wuZNLU0Pib/VHacn86NkYAE4hAUUv5K5g+AHHrcsY4j9BALxYaLqKCjfATXa N9L83b9i0570kjjauwUfByz7Q9Y+hwUcDgU78BZUfBHTc9xkYmQ+qlSvawTcg0xS x0lbQVrWXlLjobFvYjZeh+u7aMKZTPAMeYoGBJEnmzRNTR/cyyEN0CosJgWm0foP y5A3DswNwqq8XoHIz6cBv4GexqyZw== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id D67DFE482E; Sun, 28 Oct 2018 06:18:51 -0400 (EDT) From: Thomas Monjalon To: "Ananyev, Konstantin" , Li Han Cc: dev@dpdk.org Date: Sun, 28 Oct 2018 11:18:57 +0100 Message-ID: <2051333.TVBHe8Qoag@xps> In-Reply-To: <2601191342CEEE43887BDE71AB977258E9FA5228@IRSMSX102.ger.corp.intel.com> References: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn> <2601191342CEEE43887BDE71AB977258E9FA5228@IRSMSX102.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] lib/librte_ip_frag:fix ip_frag_key_cmp bug 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: Sun, 28 Oct 2018 10:18:54 -0000 24/08/2018 13:04, Ananyev, Konstantin: > From: Li Han [mailto:han.li1@zte.com.cn] > > > > in struct ip_frag_key,src_dst[] type is uint64_t. > > but "val" which to store the calc restult ,type is uint32_t. > > we may lost high 32 bit key. and function return value is int, > > but it won't return < 0. > > > > Signed-off-by: Li Han > > --- > > lib/librte_ip_frag/ip_frag_common.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/librte_ip_frag/ip_frag_common.h b/lib/librte_ip_frag/ip_frag_common.h > > index 197acf8..ca69680 100644 > > --- a/lib/librte_ip_frag/ip_frag_common.h > > +++ b/lib/librte_ip_frag/ip_frag_common.h > > @@ -69,10 +69,10 @@ struct ip_frag_pkt * ip_frag_lookup(struct rte_ip_frag_tbl *tbl, > > } > > > > /* compare two keys */ > > -static inline int > > +static inline uint64_t > > ip_frag_key_cmp(const struct ip_frag_key * k1, const struct ip_frag_key * k2) > > { > > - uint32_t i, val; > > + uint64_t i, val; > > val = k1->id ^ k2->id; > > for (i = 0; i < k1->key_len; i++) > > val |= k1->src_dst[i] ^ k2->src_dst[i]; > > -- > > As a nit - no point to make *i* 64-bit. > Apart from that: > Acked-by: Konstantin Ananyev Applied with suggested change, thanks