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 3B070A052B for ; Wed, 29 Jul 2020 15:59:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F30CF04; Wed, 29 Jul 2020 15:59:51 +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 D8864F04 for ; Wed, 29 Jul 2020 15:59:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596031189; 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=FBXd/mIdl/A9slbqZXsPEh9lYqeu4Jv+izHRykibrV7EDWFVglQHbXnwI2XcS16HVMwRC7 a0Z4pCqTlJk8VTXFcTE3d8WaEdYwisDFUPIO/520H0BHbbGISHyuyyySpd4iv/MP0oucey vwFomJBTX+ji00Hu0IzImxsC8WMCxY0= 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-192-D028EFz6OZmhl0Fe_grYxQ-1; Wed, 29 Jul 2020 09:59:47 -0400 X-MC-Unique: D028EFz6OZmhl0Fe_grYxQ-1 Received: by mail-vk1-f200.google.com with SMTP id t66so6243857vkf.6 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=qh1Ahm8RzgFvW52kvJru2Ry8qR8iDIJF2cYc0zW+uN0w7WZLZb8iTnXNkbW9uWgSQu QnbCkhqwxhI68fmwZ7VcZ5vq3RN1PSg/sH5tn2oKhvJIDg+vKh5qMk0Eg1obd3ymZy9z ypRDMlKBnR6pvGRC301rZiBtXKoqiFwpu1rHYVvkVtJkRglSGEw+HbtOhzWwzT8odC2E 0EGcpB3D9KBXUgDfeH2mAenrzOdATee5guXcOOxgp1i8DGtwBoGABPsFYcF0xATZEdu2 L1LQB+2B1vUTNyd/1HasKarfUS8FA07wZWyJxEG6GQknlbboDIN7yNimPc50t6tQKRjR 62nQ== X-Gm-Message-State: AOAM532cwLS3JHvj/VAYTzv4db+rLtdsoPcPGNYaZnjtB/SYGTn5eac6 0A06WOUH81HPh5TtHzcpyFgdYIINkjDSu9V4Ab2Ac7htZzlCrTaZkaUFKGbMazseUOI1LdOyiJA jkVNHth8/Yi8aae9g72N/Gww= X-Received: by 2002:a9f:2b8d:: with SMTP id y13mr23560615uai.126.1596031187117; 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-stable] [dpdk-dev] [PATCH v4] lib/table: fix cache alignment issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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