From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730077.outbound.protection.outlook.com [40.107.73.77]) by dpdk.org (Postfix) with ESMTP id 6964E5F38 for ; Fri, 14 Sep 2018 04:46:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9y14Eq37yKfKIZdg27vBZ1xjAarqA30hZ5tevJ751E0=; b=lABZcK/seMyyfC2hkeiSktuYyakdulcNleK2qMxb38opxyoc6VcS3PUFw2SKKLuCyO6HTcZqhuvgQzqDLcji7YdYr16WgK9tGb4dZ2zKbXBrkttFVmtecIwBTLHCIsS21KfnSHlLPVqLj75fD+B7L52E7rPNd/G9T/o1uggfMR0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (122.178.212.30) by DM6PR07MB5004.namprd07.prod.outlook.com (2603:10b6:5:25::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Fri, 14 Sep 2018 02:46:03 +0000 Date: Fri, 14 Sep 2018 08:15:47 +0530 From: Jerin Jacob To: Honnappa Nagarahalli Cc: Ola Liljedahl , "Kokkilagadda, Kiran" , "Gavin Hu (Arm Technology China)" , Ferruh Yigit , "Jacob, Jerin" , "dev@dpdk.org" , nd , Steve Capper , "Phil Yang (Arm Technology China)" Message-ID: <20180914024546.GA1997@jerin> References: <7C80C637-DF76-423E-92AA-868EA06EF2C3@arm.com> <20180829082814.GA15610@jerin> <9CD1E941-1C51-4942-B0C8-30F6177124A5@arm.com> <20180829085730.GA2563@jerin> <20180913175124.GA11207@jerin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Originating-IP: [122.178.212.30] X-ClientProxiedBy: SG2PR06CA0182.apcprd06.prod.outlook.com (2603:1096:4:1::14) To DM6PR07MB5004.namprd07.prod.outlook.com (2603:10b6:5:25::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5eaed579-1900-4adc-27f1-08d619ec3882 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB5004; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5004; 3:JRv2A6W0wBnBWkTqEOVg2xpsVE9nRh6zfHRblZvxamRzPkVYuF/Wx0U4HIrvPAi+1riZmYVMx97wjfFoqU9HfVr5muvwI/uq/Uq6OUlFSkBpCpGBo38kYFqMbHOcVsqksxV7fLJs2WBdncMfTWhtyS6xQBOzYZ/5GlmUQWFY1wI09LwxfmRaREUCot1OLyGqo57Es37XMwGdvdzfveEJJ4XrVe+y9wyS9yl+Yci5G7k2YFspDQbYlM6mqKNohGMg; 25:rjvNm/YHre2FygH9umICM8eerjRaGpnNG7ZXZNIOobAq7a23MSZ50R6LTx/tlkjQC4WYmYqCSK0H7W8r8qH+ALXZzip0TUmnZT9DHYUzF1HyMc9KWhFqSDKIXeLzDxcNcdq/U/XuXjVuAdU8ZilsT7bta9igrjZ4YBPg8Um93wbI3MqkOfWVvMBkpKMNNu80l6485/r264uYU3X+IjGRHxqfI3yXq0dPGBGhY/v2y5OeOLd/KO4q5FT8iJGS6rN/jMywk2ftkH3fJa2na6mPm9dLDGrKEEIbDnkBqiVlX9CMhD8q8NnRLN05BtCeHE3X1oZ7KYClC8/yKeAEMqgDOQ==; 31:yVr2waTjHeIeBrx0CV20IXic/Hsmaz+oi2BlMaM1oMRrOYkhMD+AeGWmwA8KukRKt57rDqPh2DDlwgOrP1l8079l26JEnwO8JKwFyfjpcp82iKBdWLNVzsPnkiprNNM1RUguARo3JOZeS4hBBbr+BYi0NHuNrFBw0S5zgu9JNcoyJ2oD06qwQEfkZh14sPaG2OnKhZYbgJL690TY1QsJ8xclexCHT5KaHEHdWZ42tbw= X-MS-TrafficTypeDiagnostic: DM6PR07MB5004: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5004; 20:YXTKfC+E7dr8eAZ/a9AaXsQ+fZLXtbTQ4JgqSACiBqzNNV86ewf/Q0sfSC84yOsbQognQo+ATrQMmILk/9IW/O3ccFSzyrjYpXHRhz8JMwB+2qrQEFNUr+zVm9UU4wq7090/lgjIHTlggIp4gcL5FSey0qwjSZdtS393KbJbZfLQqOKfTCJ+4kMPVZMcSLn+KLw56U4nSlLfoGdWGYsEQLy2Hl4/1dZ4QB9JVKa2VhrKKjv6REZzHs6wehrKFSXIqr/XqzbKfe11vk/3aAP1h/a4v2aqz6wlSNzwRseNbJof8/GqR2T4nNVs2ZrQSpf9HMb922MoPmcrFbpfaJWxchtg3D8GKMRkYIIt13uUtL20Nf1hQwxbX1zyHoFmT/BcwP9NI12owv8fISSdvnB7f7G6rwh+jy1041Xo3ezas3EZgC4ppCx/VJ5nCvq+y3P0I2KHdbmWgYBL4g6xUpNuTd3037zqUWCHzzRjvkE8Ap0io4+cOIrc7PyFclOl6aL9G5f8Xlr8L62I0axZGh70PmTZzTfe/unGSseoUFU4Qtxc9BJbHXAyhm8CkacYGZ3r9mBbaTI9LC//8z8uvSp3fQCcKrfzOb7EfNvZPorYQ0k= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(103651359005742)(228905959029699); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231311)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699050); SRVR:DM6PR07MB5004; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB5004; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB5004; 4:lSUUxU3GLhUN/t0WG73nCY+EyZhuW62kezmOlUi8VZ1Sw1i3ZDtYUAik0otDSIaeRIhHZOD+14kWPcnD513QupvPv6ER4Z/TjZy9sLPTT+L5RCN1x++ZXg3tvYx6AVMgIAyzkXWtHHxULxC+yKd2mvsnbEMJPFdcwaWuUZwPIeAtVLuw9qXxgSSdcVlCLtB7JgujEnPOzoCHXgE/bU/UN7mmV5XQh4HkFg+UM027TdFL1ctap7dJdlVklD7Rktrp+TUK77rI5T4/HPfcC/JRwbUC99CPyI83c43nVe9dqHSjtLxuCL9iCkn4lirTf0jqJO8MszoQ3TgLLMwMKtBIg8DbtBBS19orJxvm0erHKLQnA+5R/9xz7zuAADy4Rfs0 X-Forefront-PRVS: 07954CC105 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(39860400002)(136003)(366004)(346002)(13464003)(199004)(189003)(40434004)(26005)(16526019)(53936002)(186003)(386003)(53546011)(9686003)(6306002)(55016002)(956004)(44832011)(11346002)(446003)(476003)(486006)(6246003)(81166006)(8676002)(305945005)(72206003)(2870700001)(81156014)(45080400002)(316002)(966005)(7736002)(54906003)(93886005)(478600001)(6116002)(3846002)(8936002)(97736004)(58126008)(1076002)(6916009)(25786009)(229853002)(2906002)(68736007)(6666003)(52116002)(23676004)(2486003)(52146003)(76176011)(5024004)(33896004)(14444005)(33716001)(4326008)(6496006)(45954006)(105586002)(42882007)(50466002)(19627235002)(47776003)(5660300001)(33656002)(106356001)(66066001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB5004; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender h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mcJKiiVeE9JgnDz41226IZ+GPhwHRK+MNcK+urrUoWDIbg4mRhD5evNp8/j4iK+v1xL1xc7/3iwnP7VQrv7Ey5ci8ed4GQW63jddUysI6jbpGDjTkmDlIv9qTco8wAF7faU0n2saBsNT994Mpwg1xC6Hg1WAeyub9cp8dk6edERrHcCeL849I0xm7zvC6MPtmGoCpCxKm042RhrR0PZBBBdCVFv4aLIh7/y9qBTKah2gzfPV75vxos0NH3fmlgHKlBLebZq59oksejPFnyWsY9j5Ti50qvr62rr4o9F4WzaKJ5hfJEbHE7uHLsSqU06kJ6iVhFfuxFiBA==; 5:saGrZ4nAB2MJx7JAahSfloXmUijNHdu8+lV9Y+JdYK4+UTEd/JP9p9zs3DHAIWXGWiuxGqcEkt0q3R0QPbc2igl0sMLIrkn1UwYufIb3hPlUmi1YIECgLsrBwoFItKqf7Nj8/HUrFsdWR+a+Mp+SEfBW8PWPtRDHYTh9aCl0Ne0=; 7:V/vs6p+q+0JZi8v5MZMyBpaImIjYQxnDYp9n+ElG3nR3M0VJcQdbXKbh3hsL8BlA6cKlEKvhZVRisLXe12+kN4qV/iMc3yCWkOgcqj0ClHuR+ZF1yIneW+bE/XGlYyELyjduRiJR7C6Bma+eGX0mjE5v5aGon3keftH97ZRmwCvlIHolkcP9rSncQD0Fe5zUoH+l4/d4it70ABMNMbU0kHhWQXioiJ6zJErLBge4c0eHrPqYSE+iunab8Hb17Tei SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 02:46:03.4898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5eaed579-1900-4adc-27f1-08d619ec3882 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5004 Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization 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, 14 Sep 2018 02:46:10 -0000 -----Original Message----- > Date: Thu, 13 Sep 2018 23:45:31 +0000 > From: Honnappa Nagarahalli > To: Jerin Jacob > CC: Ola Liljedahl , "Kokkilagadda, Kiran" > , "Gavin Hu (Arm Technology China)" > , Ferruh Yigit , "Jacob, Jerin" > , "dev@dpdk.org" , nd > , Steve Capper , "Phil Yang (Arm > Technology China)" > Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > synchronization > > External Email > > -----Original Message----- > > Date: Thu, 13 Sep 2018 17:40:53 +0000 > > From: Honnappa Nagarahalli > > To: Jerin Jacob , Ola Liljedahl > > > > CC: "Kokkilagadda, Kiran" , "Gavin Hu > > (Arm Technology China)" , Ferruh Yigit > > , "Jacob, Jerin" > > , "dev@dpdk.org" , > > nd , Steve Capper , "Phil Yang (Arm > > Technology China)" > > Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > > synchronization > > > > > > Hi Jerin, > > Is there any reason for having 'RTE_RING_USE_C11_MEM_MODEL', which is specific to rte_ring? I do not see a need for choosing only some algorithms to work with C11 model. I suggest that we change this to 'RTE_USE_C11_MEM_MODEL' so that it can apply to all libraries/algorithms. > > > Yes. Makes sense to me to keep only single config option. > > rte_ring has 2 sets of algorithms for Arm architecture, one with C11 memory model and the other with barriers. Going forward (for ex: for KNI), I think we should support C11 memory model only and skip the barriers. IMO, Both should be supported and set N as in the config/common_base. Based on architecture or micro architecture the performance can vary. So keeping both options and allowing to override to arch/micro arch specific config file makes sense to me.(like existing model, as smp_* ops are compiler NOP for x86) > Also, do you see any issues in making C11 memory model default for Arm architecture? It is already set default Y to arm64. see config/common_armv8a_linuxapp. And it is possible for micro architecture to override, see config/defconfig_arm64-thunderx-linuxapp-gcc > > > > > Thank you, > > Honnappa > > > > -----Original Message----- > > From: Jerin Jacob > > Sent: Wednesday, August 29, 2018 3:58 AM > > To: Ola Liljedahl > > Cc: Kokkilagadda, Kiran ; Honnappa > > Nagarahalli ; Gavin Hu > > ; Ferruh Yigit ; Jacob, > > Jerin ; dev@dpdk.org; nd > > ; Steve Capper > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > > synchronization > > > > -----Original Message----- > > > Date: Wed, 29 Aug 2018 08:47:56 +0000 > > > From: Ola Liljedahl > > > To: Jerin Jacob > > > CC: "Kokkilagadda, Kiran" , Honnappa > > > Nagarahalli , Gavin Hu > > > , Ferruh Yigit , "Jacob, Jerin" > > > , "dev@dpdk.org" > > > , nd , Steve Capper > > > > > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > > > synchronization > > > user-agent: Microsoft-MacOutlook/10.10.0.180812 > > > > > > > > > There was a mention of rte_ring which is a different data structure. But perhaps I misunderstood why this was mentioned and the idea was only to use the C11 memory model as is also used in rte_ring nowadays. > > > > > > But why would we have different code for x86 and for other architectures (ARM, Power)? If we use the C11 memory model (and e.g. GCC __atomic builtins), the code generated for x86 will be the same. __atomic_load(__ATOMIC_ACQUIRE) and __atomic_store(__ATOMIC_RELEASE) should translate to plain loads and stores on x86? > > > > # One reason was __atomic builtins primitives were implemented in gcc 4.7 and x86 would like to support < gcc 4.7 and ICC compiler. > > # The theme was no change in the existing code for x86.I am not sure about the code generation for x86 with __atomic builtins, I let x86 maintainers to comments on this. > > > > > > > > > > -- Ola > > > > > > On 29/08/2018, 10:28, "Jerin Jacob" wrote: > > > > > > -----Original Message----- > > > > Date: Wed, 29 Aug 2018 07:34:34 +0000 > > > > From: Ola Liljedahl > > > > To: "Kokkilagadda, Kiran" , Honnappa > > > > Nagarahalli , Gavin Hu , > > > > Ferruh Yigit , "Jacob, Jerin" > > > > > > > > CC: "dev@dpdk.org" , nd , Steve Capper > > > > > > > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > > > > synchronization > > > > user-agent: Microsoft-MacOutlook/10.10.0.180812 > > > > > > > > Is the rte_kni kernel/user binary interface subject to backwards compatibility requirements? Or can we change it for a new DPDK release? > > > > > > What would be the change in interface? Is it removing the volatile for > > > C11 case, Then you can use anonymous union OR #define to keep the size > > > and offset of the element intact. > > > > > > struct rte_kni_fifo { > > > #ifndef RTE_C11... > > > volatile unsigned write; /**< Next position to be written*/ > > > volatile unsigned read; /**< Next position to be read */ > > > #else > > > unsigned write; /**< Next position to be written*/ > > > unsigned read; /**< Next position to be read */ > > > #endif > > > unsigned len; /**< Circular buffer length */ > > > unsigned elem_size; /**< Pointer size - for 32/64 bitOS */ > > > void *volatile buffer[]; /**< The buffer contains mbuf > > > pointers */ > > > }; > > > > > > Anonymous union example: > > > https://git.dpdk.org/dpdk/tree/lib/librte_mbuf/rte_mbuf.h#n461 > > > > > > You can check the ABI breakage by devtools/validate-abi.sh > > > > > > > > > > > -- Ola > > > > > > > > From: "Kokkilagadda, Kiran" > > > > Date: Wednesday, 29 August 2018 at 07:50 > > > > To: Honnappa Nagarahalli , Gavin Hu , Ferruh Yigit , "Jacob, Jerin" > > > > Cc: "dev@dpdk.org" , nd , Ola Liljedahl , Steve Capper > > > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization > > > > > > > > > > > > Agreed. Please go a head and make the changes. You need to make same change in kernel side also. And please use c11 ring (see rte_ring) mechanism so that it won't impact other platforms like intel. We need this change just for arm and ppc. > > > > > > > > ________________________________ > > > > From: Honnappa Nagarahalli > > > > Sent: Wednesday, August 29, 2018 10:29 AM > > > > To: Gavin Hu; Kokkilagadda, Kiran; Ferruh Yigit; Jacob, Jerin > > > > Cc: dev@dpdk.org; nd; Ola Liljedahl; Steve Capper > > > > Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization > > > > > > > > > > > > External Email > > > > > > > > I agree with Gavin here. Store to fifo->write and fifo->read can get hoisted resulting in accessing invalid buffer array entries or over writing of the buffer array entries. > > > > > > > > IMO, we should solve this using c11 atomics. This will also help remove the use of ‘volatile’ from ‘rte_kni_fifo’ structure. > > > > > > > > > > > > > > > > If you want us to put together a patch with this idea, please let us know. > > > > > > > > > > > > > > > > Thank you, > > > > > > > > Honnappa > > > > > > > > > > > > > > > > From: Gavin Hu > > > > Sent: Tuesday, August 28, 2018 2:31 PM > > > > To: Kokkilagadda, Kiran ; Ferruh Yigit ; Jacob, Jerin > > > > Cc: dev@dpdk.org; Honnappa Nagarahalli ; nd ; Ola Liljedahl ; Steve Capper > > > > Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization > > > > > > > > > > > > > > > > Assuming reader and writer may execute on different CPU's, this become standard multithreaded programming. > > > > > > > > We are concerned about that update the reader pointer too early(weak ordering may reorder it before reading from the slots), that means the slots are released and may immediately overwritten by the writer then you get “too new” data and get lost of the old data. > > > > > > > > > > > > > > > > From: Kokkilagadda, Kiran > > > > > Sent: Tuesday, August 28, 2018 6:44 PM > > > > To: Gavin Hu >; Ferruh Yigit >; Jacob, Jerin > > > > > Cc: dev@dpdk.org; Honnappa Nagarahalli > > > > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization > > > > > > > > > > > > > > > > In this instance there won't be any problem, as until the value of fifo->write changes, this loop won't get executed. As of now we didn't see any issue with it and for performance reasons, we don't want to keep read barrier. > > > > > > > > > > > > > > > > > > > > > > > > ________________________________ > > > > > > > > From: Gavin Hu > > > > > Sent: Monday, August 27, 2018 9:10 PM > > > > To: Ferruh Yigit; Kokkilagadda, Kiran; Jacob, Jerin > > > > Cc: dev@dpdk.org; Honnappa Nagarahalli > > > > Subject: RE: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer synchronization > > > > > > > > > > > > > > > > External Email > > > > > > > > This fix is not complete, kni_fifo_get requires a read fence also, otherwise it probably gets stale data on a weak ordering platform. > > > > > > > > > -----Original Message----- > > > > > From: dev > On Behalf Of Ferruh Yigit > > > > > Sent: Monday, August 27, 2018 10:08 PM > > > > > To: Kiran Kumar >; > > > > > jerin.jacob@caviumnetworks.com > > > > > Cc: dev@dpdk.org > > > > > Subject: Re: [dpdk-dev] [PATCH v2] kni: fix kni Rx fifo producer > > > > > synchronization > > > > > > > > > > On 8/16/2018 10:55 AM, Kiran Kumar wrote: > > > > > > With existing code in kni_fifo_put, rx_q values are not being updated > > > > > > before updating fifo_write. While reading rx_q in kni_net_rx_normal, > > > > > > This is causing the sync issue on other core. So adding a write > > > > > > barrier to make sure the values being synced before updating fifo_write. > > > > > > > > > > > > Fixes: 3fc5ca2f6352 ("kni: initial import") > > > > > > > > > > > > Signed-off-by: Kiran Kumar > > > > > > > Acked-by: Jerin Jacob > > > > > > > > > > > Acked-by: Ferruh Yigit > > > > > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. > > > > > >