From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0626D43A0D; Tue, 30 Jan 2024 13:47:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CDBE240275; Tue, 30 Jan 2024 13:47:07 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2080.outbound.protection.outlook.com [40.107.102.80]) by mails.dpdk.org (Postfix) with ESMTP id AE5894026C for ; Tue, 30 Jan 2024 13:47:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WrUm64syufZCoQtUXNso+1WWjC+LjjfUt4BaphFPMZ381zWvPIe+kH0oOIEeAo9zLxyw2z2kqHRQOPykA7f++A1eZ5/W9L8omNy/dC2nxk8pPZwnLxmdkfKlUyxp7Pnw4X3VBYpTjccHZiskayljqTU2q3C9eC5N/jCoPErTWvbDWfllIHYOKD26Mng6wgXIRnf7RgfuC3i41m2PURLdEzbQXgLiQC7LSDFclrvQZfVjGIBem8IlFtgkOVcORCz3nsJEADWnxzkdnga666FomSEYp+kF0Ud8JTEhWILEKpFliHrzEa70Vb40w7c1SS8HtI3ldnniWfVnxgrTEWSq/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=52P9xdrPQ1d+fTEUhKIbooV6Xh8a8lJhYYasTj5WjnE=; b=Mh7O3JxPYVadhtmH2OEvIGgO2Ral0Qj3NzKBl0VmZzHXAxX/nekShcmOazTEehQpVF7EhhP/sKYjyyWVgKw+JovJgy34tYSZxX3OHniwAxPC9GYb4ia7bGt76Ic/D92gwBNXPXiEtUNMFlmpnkobj5f5013MTTU71qrRBvkA6tbVrEHmFhSSulraXZ5Q2xgrfbgGPU4RuJu5wB1kBZoCEIa0xXw+cuI3TLwAKSrzvzHFwHDOoAuKWYpjVvrW1g8XN+mj/zKpSEbtSQe/9w2DW/m/K5wfkLbEakKyPADIJ05rek6e4dwSZIHtKHwjJHrN+ymLQnRFxFRa7XR/AO9G9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=52P9xdrPQ1d+fTEUhKIbooV6Xh8a8lJhYYasTj5WjnE=; b=G1wGQghFTN/DEMti2frGjWNTlDlmAGBqWoFA8rvzbhZELs9IkT2pGjzSSVqkhfVrUfjnaBJ/D3N6KeXveSb42vjFVZAR2pxGFef0tUTl5hKiG2W6xr+Z9wZnqDr/94op+k5apgPYmtA94bgN+q3xx3NpOcQvEeOLsXWHVN189Dbrxm9/tKvxOdAmza2yktIDmQ3poYMg0A0l3agwzQ8bFn1xFW6ylHNd63VvfsRg8OMYbTnatwJ3ob4bbNz8XbE1bVxpO+YVuVBGDZsuTlN9JKoviXA1WXqy/tFDWuJa9KAedlfzXjgWKaWWRpUca5t375k4E/YLQf+3XZwi2DrI2g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from IA1PR12MB6332.namprd12.prod.outlook.com (2603:10b6:208:3e2::13) by SA1PR12MB9003.namprd12.prod.outlook.com (2603:10b6:806:389::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.35; Tue, 30 Jan 2024 12:47:04 +0000 Received: from IA1PR12MB6332.namprd12.prod.outlook.com ([fe80::5610:835d:9e24:6cfd]) by IA1PR12MB6332.namprd12.prod.outlook.com ([fe80::5610:835d:9e24:6cfd%4]) with mapi id 15.20.7249.017; Tue, 30 Jan 2024 12:47:04 +0000 Date: Tue, 30 Jan 2024 14:46:59 +0200 (IST) From: "Etelson, Gregory" To: Ferruh Yigit cc: "Etelson, Gregory" , dev@dpdk.org, mkashani@nvidia.com, Ori Kam , Aman Singh , Yuying Zhang , Thomas Monjalon , Andrew Rybchenko Subject: Re: [PATCH] ethdev: add template table resize API In-Reply-To: Message-ID: <62e78a2b-4827-030e-713b-28d671b2dac3@nvidia.com> References: <20231217093205.321082-1-getelson@nvidia.com> <56337607-a330-0967-e99c-32a6f6e9f058@nvidia.com> Content-Type: text/plain; charset=US-ASCII; format=flowed X-ClientProxiedBy: LO2P265CA0374.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::26) To IA1PR12MB6332.namprd12.prod.outlook.com (2603:10b6:208:3e2::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR12MB6332:EE_|SA1PR12MB9003:EE_ X-MS-Office365-Filtering-Correlation-Id: 220b5976-7b2f-4bed-6bfc-08dc21918f86 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VlVF/o1kXyfkHBHJJG0gnZylyeW+ON12KmtnjfIjLy2YtZEdAHh4PRtjvZ7mpH0zRxUh4k21/LRtPMl0crr6sauHIgzVxxtp8odEajGOhDyvsWiqMlwh/Pam1KXftCfKIaJvpPXkIt15B+W8J6pQqF/rNT2vpeiKgEYH+Pi3d6RS+5eAaJVa65SVhWomR4RBeBEbarq64xyF9uKAo7svxUM0+yLmlLCxEQuIH3iVm9hr21GRIjjNckRtDq2f5JTZQfBuQZEBfL7XoSg8IwBZDJWlwuGJx8XDj01uOOilQaG2wK+EC1GY5OcAUMHouNPye0ds/cnSDFYXTs6xcsAJXHfDUIk4ji8IHio8X1Jl/ArOs3n7dW1xlKkqoPNgWjSJPc+rZAwVoL0qasLlCe2YJyH7GVpOOrWh5s6lt5drlWylmCWa9G3k+AhGpwy2ej1eM7UMBLMk+zukrGTnhoU2b3qPjVEAgkV3l77HBk4OTpc3TrjS5X6G+sWcexupsti4UosFlME2o9nKnEq/Y2GGJ6sQE0k+xg+tOXD6mjA3SyuyQW9byYS3+/2IY96SL5BwAjIUjiveYt9ewZhD3RDvYZ4PpceRmbfbvhHjbQTBGrN/rsyUUqHOKPJy3Ey0KEgpTNhj8mqqG+UBCI/KtHhuWOS/sX9lGEeBwHnn7D7eNog= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:IA1PR12MB6332.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(366004)(396003)(39860400002)(346002)(136003)(230273577357003)(230922051799003)(230173577357003)(186009)(1800799012)(64100799003)(451199024)(6506007)(5660300002)(86362001)(2906002)(31696002)(8676002)(8936002)(4326008)(66946007)(66476007)(66556008)(6916009)(6512007)(2616005)(316002)(54906003)(36756003)(6486002)(478600001)(6666004)(41300700001)(83380400001)(31686004)(38100700002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?osb2lNyPXutDBf+nnPh9cBjBykLofCz8VEUFokJKhVV2++hVU+eVBCYn/5eW?= =?us-ascii?Q?P69G7Lc1Gcbe9zcw2qxW5d3rBGZUlnnO8Q4Kki30nnsbjDlfeRYAwZE+7PkY?= =?us-ascii?Q?uVI2Q77ImpQi+DDnrkIhCTVib4WxoW80NdRqcVGu9CicBQFwhFlmU8zleV+V?= =?us-ascii?Q?C+kXOdIrBe+jD86F9fsZR4sHu7Un+r2uPx+22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FGTKLgHhZIfU38C8jMPp4wlWoxP2IDMJyPpnltXk/KYTb9aLkN2zoNS0?= =?us-ascii?Q?ZJu5AtPPB8lszBIpduDsu9yKU8jMSjI6IyDJlhIhhgN2n2mAHcEl3s+35Xol?= =?us-ascii?Q?UKQ6DEvXIWzt60KgX1uVBaRyiiRWEqYv0VMJ9bKdDExoe9ODl6p6yuvRiwP4?= =?us-ascii?Q?ci34ZRt0NVwldrHtZ2ICSong6XVsTUHu2XbnqJ1j+lOPkc3tqsa53XTsW/YX?= =?us-ascii?Q?0Wjam6eS7FxxJohYH+/TulTj+kV5KWAyPNZ+jqMlT8iP10okQebAVZk7eMde?= =?us-ascii?Q?vJmx/jAPlHob0Xo+EnXvPaIaq9Z1SLcvknP8epBIowAhmjbaZDHOzyGrpws3?= =?us-ascii?Q?yHVrC1bay99PvRYAL7ExL7CxCmDmaxZSxUBqQMo811AGBZRzUD2PDWnZe2W1?= =?us-ascii?Q?ssEsydShx0Q68H9cCQUVM5E/IS8ziWeb6qvS2hFgayv4uuhtuTEt7rvRNPKR?= =?us-ascii?Q?aUrdY5q7lQkCGqht6KUhatz3olg3a3T/guKogpAL9Huu3ZDEFDiJ+BAU04oz?= =?us-ascii?Q?aiWQFWxIqSzrta7sdO+1Mp4Ky+BaDuhVy2Z2+CJOkXdt?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 220b5976-7b2f-4bed-6bfc-08dc21918f86 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6332.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2024 12:47:04.2879 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uPD+/a2/lziDb64LgD8J6pOboLoI3aqfbEcx9lu22Rg+hvlc6fh2RKiTAfrv9z8fem2VnVIqKM6ZzuY1Oujzvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB9003 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello Ferruh, > > If a multi-threaded application can add new and updated old > simultaneously, this should be done via monolithic API, like: > { > lock > resize > unlock > for each flow > lock > update > unlock > } > The flow template API was designed for performance. Application that implements the flow template API expects high flows insertions, updates, and removals rates. Locks are necessary for the table resize API. During the monolithic resize, application has no control over PMD locks. Even if resize and each update operations are relatively fast, application should expect table lock collisions in rules insertions, deletions and updates for the entire resize-and-update-and-update operation. With the separate resize API, lock collisions are expected during the resize phase only. After table resize completed, all flow operations will obtain a lock without collision. Also, application does not have to update all flows at once. Updates can be executed in batches scheduled by application. Another use case: application can increase a table, offload all new flows and run updates while hardware handles network traffic according to the new flows scheme. > Perhaps questions is, is there a usecase that user does the resize but > doesn't want to update the old flows? Please see below. > >> The rte_flow_template_table_resize_complete was added for PMDs that >> cannot differentiate flows created before and after table resize. >> > > Can you please elaborate this? > > Does it mean old flows and new flows require different handling and PMD > doesn't know how to differentiate old and new flows? > If so how update() converts old flows, there must be a way for driver to > differentiate them for update() to work. > > Also if resize_complete() NOT called at all, does this mean PMD can't > handle any flows anymore as it can't differentiate old and new ones? > Table resize API do not have any effect on running flows. PMD uses the same procedure to create flows before and after table resize. All flows instantiated from the same type before and after table resize. Flow update that follows table resize manages PMD flow object location. In MLX5 PMD, flow update moves an object that references a flow from old table to a new table. After all flows were moved to a new table, PMD has no need for the old table and it can be released. Since flow update manages PMD memory only, application can ignore the update operation if it does not care about effective memory management. PMD can release the old flow table after all flows it referenced were moved to a new table only. Event that notifies PMD about empty old table can be ether internal or external. Internal event assumes PMD ability to track flows in a table. External event in form of application call is more general approach. Application must call resize_complete after it moved all flows to the new table. That call notifies PMD that it safe to release resources related to old table. If application did not update flows it must not call resize_complte. Application can create new flows after table resize regardless if it managed PMD memory with update and resize_complete calls or not.