From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B45FA052B; Wed, 29 Jul 2020 15:59:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 732121BFD6; Wed, 29 Jul 2020 15:59:53 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 247014C98 for ; Wed, 29 Jul 2020 15:59:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596031191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9ZpKHXRVOT/bTMYTY4RDXvzpJ9qTr+FwqJjUPLrxB7o=; b=cx3ujjcb/XLdWm1PWqwaGQvZeWxO2r76q0sf72Q+qf5xdRkL57MiBmwgUoIKQvLLWApJtY DnkN7y0sjZML5V2RxljiQniMqxHzNdiTeFPty5RO9xPUHjphsIBfv5hOEKdfF0twBL86m/ FiICRx/gzQTlMyY7jDwa3P7P5EnFLTU= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-156-CGTzSCHNM4SZHMhMyYQlBw-1; Wed, 29 Jul 2020 09:59:47 -0400 X-MC-Unique: CGTzSCHNM4SZHMhMyYQlBw-1 Received: by mail-vk1-f200.google.com with SMTP id k185so1351476vke.10 for ; Wed, 29 Jul 2020 06:59:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ZpKHXRVOT/bTMYTY4RDXvzpJ9qTr+FwqJjUPLrxB7o=; b=tk/bQG4FPFX7QcboERE93IJYEsKmmsQIlelSRIhx6OLc5tNadEh6JdOOiyEsU130Tw 9Uyc73bEtoHqNnZHbxihU92H0NGg3ZtIgiispHwTxXMkh4azafovZ4FcYm7havhhr1Sr yfBFAYZhUaWp10CEVnRvkocrrCZ5HtLXt18U7tm977igdN3q+VkDAPNTnL0ZbpgfzR9d iPTiApl8B3mhaaOf8mUvM2ioa5JaXN8dhSweuJlclEbeNEYaIheFI5bkjjZbF53U7jxH kLqEG6chNEbSNrD2dzuxiBkytzYgHxGsOTqqucmP/2XV/2y9lQB7uv0Dy7czJZ+Rq/wp ZI9w== X-Gm-Message-State: AOAM53112FdvrGOdADj3V/cnj+XOKr6wFKch5sW4rgCNdPSEaR8+NSI0 q19XwTzKu2V56aL34+A2g4CDvVzY/HVvtCcVRNGyShFOSRgDJcSx4fkUJcZi+XGWw/EMNe1KIFf L4dvWNnd5FCAlthKuvYY= X-Received: by 2002:a9f:2b8d:: with SMTP id y13mr23560620uai.126.1596031187121; Wed, 29 Jul 2020 06:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUg4MHYEqZnU9Hg5S8kNTw0fFj1urcqRDAmRixXQMSQ+C5cQLqRKNquz8xSpxiFGYXk3hxNUjkfpI+KK1lod0= X-Received: by 2002:a9f:2b8d:: with SMTP id y13mr23560601uai.126.1596031186840; Wed, 29 Jul 2020 06:59:46 -0700 (PDT) MIME-Version: 1.0 References: <20200616162705.83575-1-ting.xu@intel.com> <20200722021628.17194-1-ting.xu@intel.com> In-Reply-To: From: David Marchand Date: Wed, 29 Jul 2020 15:59:35 +0200 Message-ID: To: "Dumitrescu, Cristian" Cc: "Xu, Ting" , dev , dpdk stable , Kevin Traynor , Luca Boccassi X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v4] lib/table: fix cache alignment issue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jul 29, 2020 at 3:54 PM Dumitrescu, Cristian wrote: > > -----Original Message----- > > From: David Marchand > > Sent: Wednesday, July 29, 2020 2:28 PM > > To: Dumitrescu, Cristian > > Cc: Xu, Ting ; dev ; dpdk stable > > ; Kevin Traynor ; Luca Boccassi > > > > Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v4] lib/table: fix cache > > alignment issue > > > > On Wed, Jul 29, 2020 at 3:14 PM Dumitrescu, Cristian > > wrote: > > > > Please correct me if I am wrong, but it simply means this part of the > > > > table library never worked for 32-bit. > > > > It seems more adding 32-bit support rather than a fix and then I > > > > wonder if it has its place in rc3. > > > > > > > > > > Functionally. the code works, but performance is affected. > > > > > > The only thing that prevents the code from working is the check in the > > table create function that checks the size of the above structure is 64 bytes, > > which caught this issue. > > > > Yes, and that's my point. > > It was not working. > > It was not tested. > > > > > > Not sure when this code was last tested on 32-bit systems, I'll let the validation folks comment on this, but I cannot rule out a change in compiler behavior either. > > This is a low complexity and low impact change, hence low risk IMO. Risk is to be evaluated when there is a need. I got pinged on this, like it was the end of the times. Then I find something that is not worth looking at, hence I am a bit irritated. And please, for the 2nd time, can you look at my comment below? > > > > > diff --git a/lib/librte_table/rte_table_hash_key16.c > > > > b/lib/librte_table/rte_table_hash_key16.c > > > > > index 2cca1c924..c4384b114 100644 > > > > > --- a/lib/librte_table/rte_table_hash_key16.c > > > > > +++ b/lib/librte_table/rte_table_hash_key16.c > > > > > @@ -33,6 +33,7 @@ > > > > > > > > > > #endif > > > > > > > > > > +#ifdef RTE_ARCH_64 > > > > > struct rte_bucket_4_16 { > > > > > /* Cache line 0 */ > > > > > uint64_t signature[4 + 1]; > > > > > @@ -46,6 +47,22 @@ struct rte_bucket_4_16 { > > > > > /* Cache line 2 */ > > > > > uint8_t data[0]; > > > > > }; > > > > > +#else > > > > > +struct rte_bucket_4_16 { > > > > > + /* Cache line 0 */ > > > > > + uint64_t signature[4 + 1]; > > > > > + uint64_t lru_list; > > > > > + struct rte_bucket_4_16 *next; > > > > > + uint32_t pad; > > > > > + uint64_t next_valid; > > > > > + > > > > > + /* Cache line 1 */ > > > > > + uint64_t key[4][2]; > > > > > + > > > > > + /* Cache line 2 */ > > > > > + uint8_t data[0]; > > > > > +}; > > > > > +#endif > > > > > > > > The change could simply be: > > > > > > > > @@ -38,6 +38,9 @@ struct rte_bucket_4_16 { > > > > uint64_t signature[4 + 1]; > > > > uint64_t lru_list; > > > > struct rte_bucket_4_16 *next; > > > > +#ifndef RTE_ARCH_64 > > > > + uint32_t pad; > > > > +#endif > > > > uint64_t next_valid; > > > > > > > > /* Cache line 1 */ > > > > > > > > It avoids duplicating the whole structure definition (we could miss > > > > updating one side of the #ifdef later). > > > > Idem for the other "8" and "32" structures. > > > > > > What about this comment? What about this comment? -- David Marchand