From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id AFC1E2C0C for ; Fri, 24 Aug 2018 13:04:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Aug 2018 04:04:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,281,1531810800"; d="scan'208";a="65703411" Received: from irsmsx154.ger.corp.intel.com ([163.33.192.96]) by fmsmga008.fm.intel.com with ESMTP; 24 Aug 2018 04:04:14 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.180]) by IRSMSX154.ger.corp.intel.com ([169.254.12.187]) with mapi id 14.03.0319.002; Fri, 24 Aug 2018 12:04:14 +0100 From: "Ananyev, Konstantin" To: Li Han CC: "dev@dpdk.org" Thread-Topic: [PATCH] [dpdk-dev] lib/librte_ip_frag:fix ip_frag_key_cmp bug Thread-Index: AQHUKglmotpNCX0GlU2Q5JbAK4xCm6TO34qA Date: Fri, 24 Aug 2018 11:04:13 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258E9FA5228@IRSMSX102.ger.corp.intel.com> References: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn> In-Reply-To: <1533175263-4642-1-git-send-email-han.li1@zte.com.cn> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2I1N2U4ZWUtNTU4YS00YzJiLWJiNDgtYmI3ZTA1M2I5ZTJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZDBOWmN6M01xdUZcL1ZNVm14SWlVMDZcL1J6QnllTm5aUlNXT25cL2c3MjlrdWlcL1RXU2xMcXZuSkJEY2l3NzlJU0wifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 24 Aug 2018 11:04:17 -0000 > -----Original Message----- > From: Li Han [mailto:han.li1@zte.com.cn] > Sent: Thursday, August 2, 2018 3:01 AM > To: Ananyev, Konstantin > Cc: dev@dpdk.org; Li Han > Subject: [PATCH] [dpdk-dev] lib/librte_ip_frag:fix ip_frag_key_cmp bug >=20 > 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. >=20 > Signed-off-by: Li Han > --- > lib/librte_ip_frag/ip_frag_common.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > 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_fra= g_tbl *tbl, > } >=20 > /* 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 =3D k1->id ^ k2->id; > for (i =3D 0; i < k1->key_len; i++) > val |=3D 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 > 1.8.3.1