From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0043.outbound.protection.outlook.com [104.47.42.43]) by dpdk.org (Postfix) with ESMTP id A286C12001 for ; Thu, 11 Jan 2018 14:52:12 +0100 (CET) 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; bh=ZLXpR8qnz8jSS0Sajdb5gPxxoPJQlawi8LgOL5UHUes=; b=WWoua4ZdzmI1K3c/u8eeMMYRbUy/mF8auCiMIxizWfGHXr3EG+sZEG0GiCZ/Ucm16U5NQg3K7ULmn3gzOLg7FCFDi/qbMYKgwQO6NdQZzgufKrmWnEqs6Hwv8tfk/V415YqGm/Fm5JiDhURLSBETawDOO6X19ESY0KskYzfBoEc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT (111.93.218.67) by DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 11 Jan 2018 13:52:08 +0000 Date: Thu, 11 Jan 2018 19:22:02 +0530 From: Pavan Nikhilesh To: "Van Haaren, Harry" , "jerin.jacob@caviumnetworks.com" , "santosh.shukla@caviumnetworks.com" , "Eads, Gage" , "hemant.agrawal@nxp.com" , "nipun.gupta@nxp.com" , "Ma, Liang J" Cc: dev@dpdk.org Message-ID: <20180111135201.ufj3hqh6frncvjpx@Pavan-LT> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-1-pbhagavatula@caviumnetworks.com> <20180110145144.28403-9-pbhagavatula@caviumnetworks.com> <20180110201710.3uolm2hwzwcowoif@Pavan-LT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SN4PR0501CA0029.namprd05.prod.outlook.com (10.167.112.42) To DM5PR07MB3465.namprd07.prod.outlook.com (10.164.153.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d92fa3b8-bf82-44ec-90c4-08d558fa837e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020066)(4652020)(5600026)(4604075)(4534096)(4602075)(4627193)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3465; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3465; 3:onCeu/7Q/s9Cl3bAGA303y8EB8Ca/vNXds8LkYzbXHFdwq02Jf7KXf7pOltXh8hwyPecNcuDNH0HqqCXl7q5P8i1wdsvTgvXmeRpMyB+/b2Pyz63PD+vIlTPyD0uYFqsgGedjxN2DdxfsjkrPscUbyLSOrhk4S7hsVV1cIDIUN798WqESfA2Sp9rhliCq0TNW2mvN7B8vTRaOPv09QhfJDPt3Ai0YkFjSxu0ZxDMM/Ddge5+aZWzBf8TXfWHjh9G; 25:Ka54wb3IvInBkkdorTlLtLDXIMuOYjJ+NFbUxeGLYDnuKruqHN0q6hPBprstOABtAOwK4+60e0rrqtyryHeNY8NrsoZmCk2wLjt3qBaImv3GzIGGA1W3TUsyD6ko0G+eTzujAYX2uzR/T6ELHu6AKEwVifRDU0Az7Gr3Y6j0lenoHNnwziKxCeZvYHpTZUbWrjlFo0iqOOU5l7cIXuiXiBFNP4soii34TPGg0SCmuczZkNk+tthTxdug3R944q+ZJjZhAFgkqU813sTj8keXolgobnQAjgoqD0j+N4PYF+Tna22EyqVldLo9Uu24RgqNZvHcr6Up0DXY4xNgUtP6zg==; 31:cC65PaDf4RC7VAqAHnkYjH4g+TBPJSVliqUOtJxkmOM/yPhXw7Ubv4zPhyoE7mfPXHtym1qAu++q/UuI5Bl9e80Uxr3gpqgbcPK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2suiXD/Q0fUCqCrvseB5n3SYhvGLQIx0qWk5fb12BYiaXKi38DmV8fn8b0kZPTRzGfTI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(944501134)(10201501046)(93006095)(6041268)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3465; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3465; X-Forefront-PRVS: 0549E6FD50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(376002)(39850400004)(396003)(366004)(24454002)(189003)(199004)(6666003)(76176011)(9686003)(8676002)(53936002)(81156014)(6496006)(316002)(16586007)(59450400001)(16526018)(81166006)(386003)(105586002)(33896004)(2950100002)(1076002)(93886005)(110136005)(229853002)(55016002)(106356001)(50466002)(47776003)(66066001)(4326008)(58126008)(52116002)(6246003)(2501003)(3846002)(42882006)(5660300001)(68736007)(83506002)(97736004)(23726003)(6116002)(8656006)(8936002)(2201001)(478600001)(33716001)(2906002)(72206003)(305945005)(7736002)(5009440100003)(25786009)(107986001)(921003)(42262002)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3465; H:Pavan-LT; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3465; 23:deaBtcqWjOeIw1qNDN0ICTW4xmY96Jji+gpEuTiuW?= =?us-ascii?Q?50NGE8XW0+Zl9cU5KCcDOFauLa4SABFUvFOJhjfTJjjHpqo/RH5Hpbfb/KI2?= =?us-ascii?Q?RfjTVQAHFXmXZU86BtPIILSGb3U0vvpfnIlcg4455yeEo+PWUY1AyCtUGMgx?= =?us-ascii?Q?jWusnR93lsz+ZJKB8VDNezKNovr53fAolHakh4ElYK5o7K88G8KqB7I29NVV?= =?us-ascii?Q?KYcLvu5i5zdLnRSinXlnZPV4h2/XTC9glbzYviJlS1F3ozsrxBNc28hLhZ3q?= =?us-ascii?Q?88V+R/hkLJSsDdY+UmZTbZ3dNx1CVZeg4rufSFN4x/f90QoUBnQdaPC37yC1?= =?us-ascii?Q?IKkxX7/Fz236ECDnQ7U4F849YrGNLZkpJq+IRmw5BcTinygTuPJUCGyUtYk+?= =?us-ascii?Q?EFl++plFs9O4GDjCup1RK5l3ZDWDBmj7mshC06o78241RYi8OgXqiWZUcitq?= =?us-ascii?Q?85j7c/OxKDK+YeXUJVtUhN94WkeTKjXtEG59DnDz+yny7MYmgF1iBbHqokxh?= =?us-ascii?Q?rB4KifEXWeFRYONrg62pqOJWiffrqc74r/HiYy8+VB2vAe4GqFFQN23jE+77?= =?us-ascii?Q?z3jIYOm4eaFYrVhUuz97PQ4fNjqgRdyBDAydSyz1dm0vUzC+aJAb+7KjSxfE?= =?us-ascii?Q?WbBHGdupqIzMIsQgHVDKWAkUI2q01O3gkHAh12o8pieQedY92regTXcF64G2?= =?us-ascii?Q?sq8t7YVOsCGszFkgYrKvYjWnM0oG8/7XkTOV3HtnCODlHXVAv/LExqNI5bIP?= =?us-ascii?Q?HvQaD60dEpEjaXBR7BdDqwiffKNhznVCqT+O1suTeloNBPlWOcgPjH8c6ZpF?= =?us-ascii?Q?ngAbPUHSYkq5Crrj4b5odELWyGHoeVltf7pQdqHGtvEZrauBWz5+zZHU2/lL?= =?us-ascii?Q?RmQsviMQGNS9GVDpdwUrGmcLhgP+vq/VcrHR/4FG91g2c9OvVbgE07jAwHMh?= =?us-ascii?Q?Iay2X5m76mTcl9Ol1uTBUMlAt/vYibHuGL4n7uxBdeWG4rjoEkdYY4+W5Jok?= =?us-ascii?Q?U3pC4pM3Sp8oBIuaxL0b1oxel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Ua+PTH8=; 24:79h5sbbHvwF6eUSLeSD8yi73VMwRVUboPVLkH+W2Da2s9EK+8gENO32VhJKQWNbtGYboDb4IzncJIn7Zgl3WSf3ePmIcjWqJcsGZn6vlbUI=; 7:K4sQnyVGpGNVCw8w9CPfXWZOjBr/jPCVhlSgMh4BeXotZw+jq6VzHZwO1doEYE5P5e1Q7sY0UKlS+WxDqvMIjoTseEuIjKNsh2vQtSYbanB1o9bIUCWhpFKe9sIpctEEjzamIKJ8o4foZN/mW3tvVhQdvsRX/uwUsYcMlvR4nm/T4VJZTKMjYtP+AN8p37051LapnCAWqi6RSBOl2ryAwBmDD33ZV8yS2JnS4Y4RY3PVBm8d1un6nEk97zHHw/Da SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2018 13:52:08.6002 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d92fa3b8-bf82-44ec-90c4-08d558fa837e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3465 Subject: Re: [dpdk-dev] [PATCH v3 09/12] app/eventdev: add pipeline queue worker functions 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: Thu, 11 Jan 2018 13:52:13 -0000 On Thu, Jan 11, 2018 at 12:17:38PM +0000, Van Haaren, Harry wrote: > > > > > Thinking a little more about this, also in light of patch 11/12 of this > > series. > > > > > > The code here has a "safe" and "unsafe" version of TX. This involves > > adding a spinlock inside the code, which is being locked/unlocked before > > doing the actual TX action. > > > > > > I don't understand why this is necessary? DPDK's general stance on locking > > for data-path is DPDK functions do not provide locks, and that application > > level must implement thread-synchronization if it is required. > > > > > > In this case, the app/eventdev can be considered an App, but I don't like > > the idea of providing a sample application and code that duplicates core > > functionality with safe/unsafe versions.. > > > > > > > Some PMD's (net/octeontx) have capability to do multi-thread safe Tx where > > no > > thread-synchronization is required. This is exposed via the offload flag > > 'DEV_TX_OFFLOAD_MT_LOCKFREE'. > > Yes understood. > > > > So, the _safe Tx functions are selected based on the above offload > > capability > > and when the capability is absent _unsafe Tx functions are selected i.e. > > synchronized Tx via spin locks based on the Egress port id. > > > This part changes the current behavior of the sample app. > > Currently there is a (SINGLE_LINK | ATOMIC) stage at the end of the pipeline, which performs this "many-to-one" action, allowing a single core to dequeue all TX traffic, and perform the TX operation in a lock-free manner. > > Changing this to a locking mechanism is going to hurt performance on platforms that do not support TX_OFFLOAD_MT_LOCKFREE. > > In my opinion, the correct fix is to alter the overall pipeline, and always use lockless TX. Examples below; > > NO TX_OFFLOAD_MT_LOCKFREE: > > Eth RX adapter -> stage 1 -> stage 2...(N-1) -> stage N -> stage TX (Atomic | SINGLE_LINK) -> eth TX Agreed, when we detect that tx is not lockfree the workers would just forward the events to (Atomic | SINGLE_LINK) event queue which would be dequeued by a service(mt_unsafe) and Tx them lockfree. > > > WITH TX_OFFLOAD_MT_LOCKFREE: > > Eth RX adapter -> stage 1 -> stage 2...(N-1) -> stage N -> eth TX MT Capable The current lockfree pipeline would remain the same. > > > By configuring the pipeline based on MT_OFFLOAD_LOCKFREE capability flag, and adding the SINGLE_LINK at the end if required, we can support both models without resorting to locked TX functions. > > I think this will lead to a cleaner and more performant solution. > Thoughts? Pavan. >