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 168C6A00C5; Wed, 2 Feb 2022 13:39:42 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9648A40689; Wed, 2 Feb 2022 13:39:41 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 1D19640688 for ; Wed, 2 Feb 2022 13:39:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IZveJk9S94OyngF0Bcd7IwPnwKblkGimVyaXcQBWXu7AqWDMZYq4djvkYcOgNjmudJVq8bMVTI9pwLHkWEaJOit0Taal+53jqtUkKKHgB2TUKaDk2NKrMcXD4gLp6T9BBPtUsTJlGs/VLyQw2eBLXU2pSjeJvXreQwjSbV56XYqOhaj70vrlZzqWlytQvmGohdUigYUDCiuxrNYw0Kx4CzXhYX1H/77NtzfLQV3a4r0UNzo5WvXd29Wl/tQ7QQS+UjZr8djNgSw51WtWjGaaxS8fZUQDys6QBPhafywVzg5FtcvDnuO0wKyEkYF7WdrM0bkb0y1M23HJd0cktK007A== 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=iXx+z/d/wfmWhE+gqOwIoS1e2d96fDjEwJbcuQ6Qrlw=; b=WS0SbcfChIZMuocAf8roULYj3c4g7sZPAUROjG8VF0tcEYWw0FV3uHE+5jYQxmYkRarNnMv5i7JYHW837pmSpqw0zS1X/3OFctL+HhowO/AymPdVAealhlQwoSqxuwKhxuz1/YBDhOy2aZYe+7QO9TI60JenNytmc2MTHvpXYuHpDiIoPElYjYFsXwiqNMfWDyOApW1BeYVEAzs00hhYYJrrEG5//ssOrNXSFB3X06DlmQkk3NI3kBeUKABmEY8e0VFp3AUSQWMjO9qotDELf2SX9ow32e0+rzRCsL6i3lovcvtjzNYb8hcokdqLIytG3ADPOm8OYURIz8ev+eURHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=iXx+z/d/wfmWhE+gqOwIoS1e2d96fDjEwJbcuQ6Qrlw=; b=QZOrZDgmkmzpVCwErKxKuwqiBIPqQ8NmANwrNIAJ+fmOW900jpKn59WLPwVBZaR8rvKR3j7QoCN7azBXEf82Nmoufi4hyBQmpThZRIOMwXNyNNEaQqzg+7YKK32A/kuWdWp1NQWwMQF2kg1SnalgMb/03lZg0+gDO0CBxsvjBoDMgl8UowdmCRG0pVNrQe+JsOYN66rRmjvbKdg7RdLHdcNJJPtudYhSTdAqInflQfLaH1MiSmOIS1cjA5FjrSnKQcBH1T52qxUH9Yr26ah69/A5vGKBUlJtiaxKnVDkqYJ9NpuLv8dZAC33ou39Ne/lF4akXYTlB2WBZcJUD+LVJQ== Received: from DM6PR12MB3595.namprd12.prod.outlook.com (2603:10b6:5:118::29) by DM5PR1201MB0042.namprd12.prod.outlook.com (2603:10b6:4:50::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Wed, 2 Feb 2022 12:39:38 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com (2603:10b6:302:13::22) by DM6PR12MB3595.namprd12.prod.outlook.com (2603:10b6:5:118::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.19; Wed, 2 Feb 2022 12:39:37 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::1869:1984:7899:8cbb]) by MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::1869:1984:7899:8cbb%4]) with mapi id 15.20.4930.022; Wed, 2 Feb 2022 12:39:37 +0000 From: Ori Kam To: Ivan Malov CC: Alexander Kozyrev , Ajit Khaparde , dpdk-dev , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Andrew Rybchenko , Ferruh Yigit , "mohammad.abdul.awal@intel.com" , Qi Zhang , Jerin Jacob Subject: RE: [PATCH v2 03/10] ethdev: bring in async queue-based flow rules Thread-Topic: [PATCH v2 03/10] ethdev: bring in async queue-based flow rules Thread-Index: AQHYEX6Om1uLjSZF1UGgrQkfZJQ24Kx0wTQAgADoCYCAAcUMAIAGcQ+AgAEZdcCAAGngAIAA2qgA Date: Wed, 2 Feb 2022 12:39:37 +0000 Message-ID: References: <2fb135e6-f492-bb8-1554-4df1f089fc79@oktetlabs.ru> <4155d771-c4cd-2acf-cee-bfe1dbaaf935@oktetlabs.ru> In-Reply-To: <4155d771-c4cd-2acf-cee-bfe1dbaaf935@oktetlabs.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a50163a1-da7f-4a6c-61f3-08d9e6491318 x-ms-traffictypediagnostic: DM6PR12MB3595:EE_|DM5PR1201MB0042:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uG41VcyMEuGzVF1xotjO/BSOXiiua639TPpSbGGlB8C6aDAPQ+4gi5k4okdnek5qdarc0YbcvxReAiprKvqD+JlGvt8AfiX66Mb4679kRd9tXdtoQlr0HoHyT2H1oo0kWLH0oUR5zUMugeNG0hY54s+xmboEROMO1uPH1kgARE2Iy1X7sMZfK+2cdivkuLhaWKIT/q7foWKU3ylgvKCKkwarWRHLMcLovARGbGLVoFl+br2cWiO26U+V9x0XpTdAAkvOJMHM54CPquyFirDWKFZvWLzBojI3WCtW/Twrs5nDJ5Q0S8belMsp0+fDBpNtc2NnSQzdaYqTsrUFPhUNH6gjVnSQ1QX2qgxdhoQwiNBQWzn+JLWyUQ4XpyJqzNFYDhy9i/2eNCNggDQkEW9/uQGu/QhGIgwjGCFQUjayGSdI5RBY2OpPe0pvsWSTCxod27Q1JMTEwoQigWPncfO51wLa1OMh4Yt76iPupIG+lrXM1PUjPe9tQPJHcAgK9mz9Mk0Ig7uFlBIUdue1LC/jalbf2UBoNYvuieW6KeY0ynu/Mx2fpHL+MTaHaN0azUeivClGXCCOKL5cd1o9HYhtrsntGmY0PHSIs0RUBqnP+nKYpBJUulVNXhmWG7+KjPzjk9htsOdud98DXN84QDHd2EqsZfOQC68CtC0dr+tXW22KNKuxyHnuDO+EzVdPk0/JA5dhcVvWMjFh7T9CSULXUw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB3595.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(26005)(7696005)(6506007)(38070700005)(186003)(38100700002)(66946007)(66446008)(316002)(53546011)(76116006)(30864003)(508600001)(66476007)(64756008)(66556008)(52536014)(8676002)(5660300002)(6916009)(71200400001)(33656002)(8936002)(83380400001)(2906002)(55016003)(86362001)(9686003)(54906003)(122000001)(4326008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OlOnBCWM2FEOgpdtGU8c7y0fskudGlUeL38gYbcvDyjAt5sh3cLxOZF4BpgI?= =?us-ascii?Q?foxnl8OjgEoacCuzZ6CBUes/uACWCQG+DsdFdQO4YytCYC+Q67Y0JZ/792hh?= =?us-ascii?Q?CgBBprXI07NzrmEi5ef6R/LCHACoTanacs6NBZNg/FGYD8+iAXEpjSOZ3hBT?= =?us-ascii?Q?vh0MI7jRpGfrUBGFjituojv4yJgtggbKnAsmf6EjmWCWQkQ+UYOgR39v6PLZ?= =?us-ascii?Q?BZJu+u/czbwlwoXWNbKXvgGT/8PlBx92IRGQiYZad5mQTTrs7kZo9UH/JluH?= =?us-ascii?Q?+A5yLAzRt2bGOQ4GvLh3rZUnBkwPqWsLKu7/ai8SbblA9TRVWA7mjcgBcwz1?= =?us-ascii?Q?LN6Sc5jV6mvVYCeIqXb9yItwBFC0kj28jromLOJd2duLNfRRwL5UWgL0O3sI?= =?us-ascii?Q?b5FlYQ891DNHoB5MCnLSsdvQJn1Yd99+SYQKiezSdnpp1k9PGhYjpjx3DiLo?= =?us-ascii?Q?IQSr6xGnLRlIVaxKpeIq8MaTpCosr2X4g99ZL8gmMI7PGklgBu7fCiKlKNj8?= =?us-ascii?Q?n5LRZVaIU3EnvUCBEM+kH8gjRO1cww+opZYU4bH+vPz1P9JGYD2a0HTu+mds?= =?us-ascii?Q?XGmOZYekNMiJFCxLf6jBEkRV+MJLcGvcAVt0jZsUGhSQzzeVR4h9s7DPi0vt?= =?us-ascii?Q?WkfWVvkszT1oBK1VDAYDUDWEJxZnNTlsL5/xTCpLwhMkUcA5OlIOuXuBX0gt?= =?us-ascii?Q?E1Pi00r6hj2MHx9V6hp7zjfTXzzvLANDhS61tKH7H5NTXIByJuRhx72dwU1z?= =?us-ascii?Q?fYy+proSUBVvVXgZcCa4a6gHQ2pxJihEyTdjwQp2lMFJtD0uOxNr3185ruSt?= =?us-ascii?Q?1zgpDaxyy0JcWo/ADQwtAiaHDh6wFmVYDEMFnTtq+xe9uW+VW7uEo67jMW6r?= =?us-ascii?Q?phiL7a6tJHEXA+dcvrSIftshXJ3a5yfXPcuO9QoGT8WGDVU2bIlbT91NHMNy?= =?us-ascii?Q?Dbjq+aJ6GIIUT2VeaWwL9gNLtoBIzfLM+QJuaNPMSMsLI9Z9WkEwWHjI2nh3?= =?us-ascii?Q?8QDosLXGxvfm3AVKS73FW/YNNYc0Btjmdw1gcqj94Wv/i0MuG2DR7QOai9py?= =?us-ascii?Q?f0fI5PpTQz7JWqeQcByF6Ij14Wrv3KtrfZCuDXJVwaQdvmx8b0WyO3MycKpd?= =?us-ascii?Q?AKrkILlpDSFr2vecGccAnRtwoAOCCicDgqyc2L3qmghiEwjBjdX3pyKfLawd?= =?us-ascii?Q?eSmP9NDJk6q5ZNp16x3n2+MWDP2l98SwSJNlhjH/OFY/G2etSpxV8UhsTb5K?= =?us-ascii?Q?1IHlT+FDOhE6fS+/BEXONLB9gLscSufP/73X3fN2t4oqh9kZp8TOZlfq2DwW?= =?us-ascii?Q?A2U4A2xXmFbvhfoTIv9YIGC/bIG4QNjcCgTxY6LJIR5iWX/1M2ydUSN8Qqfr?= =?us-ascii?Q?QqGbFepoP0Gj9YnllFLXj+l75a15BVh3r9MA9A2J0xWmo4XfGsTnnb8AMzie?= =?us-ascii?Q?MTf6K1Tzdnla/TtnAdY3G77gz/6/TIIKCGc2lwwukuGzdtpxRgaweUYWWIGF?= =?us-ascii?Q?7cyHSe5eNk2cdTgMARSRxxoHZTJfz6rQfwka0KiYIt0mCZ2yjT8N29YwgxAG?= =?us-ascii?Q?baJrSewzx7ySEQoMeQk8aJuyEQSaGdyJXmHrD3vYe0obfBIChDFl4AswY/Rm?= =?us-ascii?Q?U9WtgROczDsR6uNU4/nVUw0=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB4666.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a50163a1-da7f-4a6c-61f3-08d9e6491318 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Feb 2022 12:39:37.6064 (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: zFn2qe7DPM488Gni+ez/PuJF0o20ytHmtxOxovRkWcwZENvB7guURUFuy/mFxl9kk6Hd+azBEgyHMi/4eARDeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0042 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 Hi Ivan, > -----Original Message----- > From: Ivan Malov > Sent: Wednesday, February 2, 2022 1:24 AM > Subject: RE: [PATCH v2 03/10] ethdev: bring in async queue-based flow rul= es >=20 > Hi Ori, Alexander, >=20 > On Tue, 1 Feb 2022, Ori Kam wrote: >=20 > > Hi > > > >> -----Original Message----- > >> From: Ivan Malov > >> Sent: Tuesday, February 1, 2022 2:18 AM > >> Subject: RE: [PATCH v2 03/10] ethdev: bring in async queue-based flow = rules > >> > >> Hi all, > >> > >> On Thu, 27 Jan 2022, Alexander Kozyrev wrote: > >> > >>> On Wednesday, January 26, 2022 13:54 Ajit Khaparde wrote: > >>>> > >>>> On Tue, Jan 25, 2022 at 9:03 PM Alexander Kozyrev > >>>> wrote: > >>>>> > >>>>> On Monday, January 24, 2022 19:00 Ivan Malov > >>>> wrote: > >>>>>> This series is very helpful as it draws attention to > >>>>>> the problem of making flow API efficient. That said, > >>>>>> there is much room for improvement, especially in > >>>>>> what comes to keeping things clear and concise. > >>>>>> > >>>>>> In example, the following APIs > >>>>>> > >>>>>> - rte_flow_q_flow_create() > >>>>>> - rte_flow_q_flow_destroy() > >>>>>> - rte_flow_q_action_handle_create() > >>>>>> - rte_flow_q_action_handle_destroy() > >>>>>> - rte_flow_q_action_handle_update() > >>>>>> > >>>>>> should probably be transformed into a unified one > >>>>>> > >>>>>> int > >>>>>> rte_flow_q_submit_task(uint16_t port_id, > >>>>>> uint32_t queue_id= , > >>>>>> const struct rte_flow_q_ops_attr *q_ops_at= tr, > >>>>>> enum rte_flow_q_task_type task_typ= e, > >>>>>> const void *task_dat= a, > >>>>>> rte_flow_q_task_cookie_t cookie, > >>>>>> struct rte_flow_error *error); > >>>>>> > >>>>>> with a handful of corresponding enum defines and data structures > >>>>>> for these 5 operations. > >>>>> We were thinking about the unified function for all queue operation= s. > >> > >> Good. > >> > >>>>> But it has too many drawbacks in our opinion: > >> > >> Is that so? > >> > >>>>> 1. Different operation return different results and unneeded parame= ters. > >>>>> q_flow_create gives a flow handle, q_action_handle returns indirect= action > >>>> handle. > >>>>> destroy functions return the status. All these cases needs to be ha= ndled > >>>> differently. > >> > >> Yes, all of these are to be handled differently, but this does not mea= n > >> that one cannot think of a unified handle format. The application can > >> remember which cookie corresponds to which operation type after all. > >> > > > > I agree with with Alexander, merging all of those functions to one will= result in > > extra parameters which will be unsued. >=20 > It is not clear which parameters are going to be unused in which cases. > Task type? Always used. Task data? Always used. Cookie? Presumably, > always used. But, as I said, you can either change the name to > your liking or prefer a task data-internal parameter to pass > task handles back to the caller instead of the "cookie". >=20 Example for unsused parameter will be the returned handle to the flow. > > Basic programing apporch is that functions should do one thing, > > it is easier to document / use / test and will run faster. >=20 > By the sound of it, we are starting to run into disagreement in what come= s > to being "easier to document". A unified API by its very definition shoul= d > be easier to document, extend and maintain. >=20 > However, I see your point. This design spares no expense to make > the code super-fast. I have no strong opinion on whether it is > good to abandon other basic programming points like keeping > things generic / unified and extensible, which are as > important as the point of having simpler functions. >=20 > Perhaps caring about performance indeed prevails here. > And maybe I should quit being that sceptical. >=20 >From my view point performance is everything in this case since any slow down will mean that application packet processing will take more time. > > > >>>>> Also, the unified function is bloated with various parameters not n= eeded > >>>> for all operations. > >> > >> That is far-fetched. > >> > > Just thinking about extra parameter to return the handle only in case > > of create flow. >=20 > One can make the task data argument "in-out" and keep the handle field > over there, union-style. And no handle for tasks which do not need one. >=20 I had bad experience with this approach in the RegEx. I got number of comments why did we merged the in/out to the same structure. I perefer to keep it sperated. > > > > Also in future I guess we will want to add modify rule and indirect act= ions > > I assume that in both case dedicated functions will be much better > > for example for the indirect use the same names we are using now > > only adding q in the name and extra queue parameter. > > > >> Non-unified set of APIs is also bloated. Takes long to read. Many > >> duplicating comments. When one has added a new API for a different > >> type of task, they will have to duplicate many lines one more time. > >> > >> In the case of unified API, one has to add a new enum type (one line), > >> specific (and thus concise) description for it, and the corresponding > >> structure for the task data. That's it. The rest is up to the PMDs. > >> > >> Also, it should be possible to make the task data IN-OUT, to return > >> its task-specific handle (to address your above concern). > >> > >>>>> Both of these point results in hard to understand API and messy > >>>> documentation with > >>>>> various structures on how to use it in every particular case. > >> > > > > I disagree with you I think that having unused and misleading parameter= s > > is much more messy from user view point. >=20 > Yes, but currently it is not clear which parameters > one deems unused or misleading and in which cases. >=20 > > > >> The documentation for the method is always the same. Precise and conci= se. > >> The task data structures will have their own descriptions, yes. But th= at > >> does not make the documentation messy. Or am I missing something? > >> > >>>>> 2. Performance consideration. > >>>>> We aimed the new API with the insertion/deletion rate in mind. > >> > >> Good. > >> > >>>>> Adding if conditions to distinguish between requested operation wil= l cause > >>>> some degradation. > >> > >> Some degradation.. - how serious would it be? What's for the "if" > >> conditions, well, I believe the compiler is smart enough to deal > >> with them efficiently. After all, the suggested approach is > >> a fixed set of operation (task) types. One can have a > >> static array of task-specific methods in the PMD. > >> And only one condition to check the value bounds. > >> > > yes from our testing just an if will result in degradation. > > Even just the indirect ref to the PMD function results in degradation. > > I guess if you try to add an if in the datapath (rx_burst/tx_burst) you= will > > Need to explain the reason. >=20 > I see your point. But, in my understanding, this new design, first of all= , > does not belong in *traffic* path (albeit it is meant for *fast path*, > in general), so it is not quite correct to compare it with Rx burst > functionality. Secondly, the idea is to make things non-blocking > and avoid tedious parsing (hence all the templates and tables), > and that goal is achieved in any case. So, removing *all* "if" > checks at any cost might not be that reasonable. >=20 >From my point of view it is part of the traffic path. think about this way, all application needs to do is get the first packet and offload the rule. after the offload the application should not see packets from this flow. This means that any delay in insetion will mean 2 things, One that packet processing will take more time for the application which Will result in lower connections per second. Second more packets will arrive to the application from the same flow. for example UDP traffic, until the rule is in the HW more packets of this r= ule will be routed to the application. So as fast as we insert the rules fewer = packets will arrive to the application. > BTW, keeping things robust is another basic programming point... > Fully agree with that, that is why I think simple functions are much more r= obust. =20 > > > >>>>> It is preferred to have separate small functions that do one job an= d make it > >>>> efficient. > >> > >> A noble idea. > >> > > Noble idea is good so lets do it small functions. >=20 > Well, I have no strong objections. You can try and see how it goes. >=20 +1 > > > >>>> Interfaces are still the same. > >> > >> That is the major point of confusion. The application developer has to > >> be super-careful to tell the queue version of "flow_create" from the > >> regular one. The two set of APIs are indeed counterparts, and that's > >> might be ambiguous. Whilst in the unified approach, readers will > >> understand that this new API is just a task-submitter for > >> the asynchronous type of operation. > >> > >>> Glad I made it clearer. Ivan, what do you think about these considera= tions? > >> > >> Well, I'm not pushing anyone to abandon the existing approach and swit= ch > >> to the unified API design. But the above points might not be that > >> difficult to address. This deserves more discussions. > >> > >> Any other opinions? > >> > > I vote for the suggested API lets try and see. >=20 > Agreed. Sometimes it pays to try and see the results. > This API has experimental status anyway... >=20 Thanks, +1 > > > >>> > >>>>> > >>>>>> By the way, shouldn't this variety of operation types cover such > >>>>>> from the tunnel offload model? Getting PMD's opaque "tunnel > >>>>>> match" items and "tunnel set" actions - things like that. > >>>>> Don't quite get the idea. Could you please elaborate more on this? > >> > >> rte_flow_tunnel_decap_set(), rte_flow_tunnel_action_decap_release(); > >> rte_flow_tunnel_match(), rte_flow_tunnel_item_release(). > >> > >>>>> > >>>>>> Also, I suggest that the attribute "drain" > >>>>>> be replaced by "postpone" (invert the meaning). > >>>>>> rte_flow_q_drain() should then be renamed to > >>>>>> rte_flow_q_push_postponed(). > >>>>>> > >>>>>> The rationale behind my suggestion is that "drain" tricks readers = into > >>>>>> thinking that the enqueued operations are going to be completely > >>>> purged, > >>>>>> whilst the true intention of the API is to "push" them to the hard= ware. > >>>>> I don't have a strong opinion on this naming, if you think "postpon= e" is > >>>> better. > >>>>> Or we can name it as "doorbell" to signal a NIC about some work to = be > >>>> done > >>>>> and "rte_flow_q_doorbell" to do this explicitly after a few operati= ons. > >>>>> > >> > >> By the sound of it, "push" is just a shorter term for "doorbell". > >> > > > > > > I don't think the name should be doorbell, since it may not just be doo= rbell > > for example PMD may organize the rules in a better way. > > > >>>>>> rte_flow_q_dequeue() also needs to be revisited. The name suggests > >>>> that > >>>>>> some "tasks" be cancelled, whereas in reality this API implies "po= ll" > >>>>>> semantics. So why not name it "rte_flow_q_poll"? > >>>>> The polling implies an active busy-waiting of the result. Which is = not the > >>>> case here. > >> > >> That is far-fetched. Polling implies some periodic invocations, > >> that is correct. But it's up to the application whether to > >> make this a tight loop or not. Or am I missing something? > >> > > I like the dequeue since it also tells the developer that this is how h= e > > remove rules from the queue. >=20 > Look. The major point here is that, according to the description, > task completions may be reordered. Hence, technically, this is > not a queue, not a ring, but rather a "postponed task list". > That being said, I believe that the term "queue" (like "q" > in the API names) can be retained - it's fine to call a > completion list a "queue". But in what comes to the > other ring-specific terms like "dequeue", I would > go for some other alternatives like "poll". >=20 > Please correct me if I've got that wrong. >=20 Maybe in future we will wish to add that the queue can be ordered also depending on other vendors caps.=20 > > > >>>>> What we do is only getting results for already processed operations= , hence > >>>> "dequeue" as opposite to "queue". > >>>>> What do you think? Or we can have push for drain and pull for deque= ue as > >>>> an alternative. > >> > >> Pull is not that informative. The commonly-used term is "poll". > >> But let's hear some other opinions. Maybe someone has their > >> way with naming. > >> > >>>>> > >>>>>> I believe this function should return an array of completions, jus= t > >>>>>> like it does in the current version, but provide a "cookie" (can b= e > >>>>>> represented by a uintptr_t value) for each completion entry. > >>>>>> > >>>>>> The rationale behind choosing "cookie" over "user_data" is clarity= . > >>>>>> Term "user_data" sounds like "flow action conf" or "counter data", > >>>>>> whilst in reality it likely stands for something normally called > >>>>>> a cookie. Please correct me if I've got that wrong. > >>>>> I haven't heard about cookies in context not related to web browsin= g. > >>>>> I think that user data is more than a simple cookie, it can contain > >>>>> anything that application wants to associate with this flow rule, i= .e. > >>>>> connection ID, timestamp, anything. It is more general term here. > >> > >> OK. Seems like I overestimated clarity of the term "cookie". > >> > >>>>> > >>>>>> Well, the short of it: submit_task(), push_postponed() and poll(). > >>>>>> Having a unified "submit_task()" API should allow to reduce the > >>>>>> amount of comment duplication. > >>>>> I'm afraid it won't reduce the amount of comments needed anyway. > >> > >> It will reduce the amount of generic (now just repeating) comments. > >> That's it. Task-specific comments will stay, and that is fine. > >> > > Like above API should be as direct as possible. >=20 > OK. Your point is very clear. I do not object. > But maybe more opinions exist regarding that. >=20 > > > >>>>> Instead of 5 descriptions of purpose-specific function we will end = up with > >>>>> a huge blob of text trying to explain how to use a single function = with > >>>>> 5 different input structures and 3 different output types. That is = really > >>>> messy. > >> > >> Is that so? It shouldn't be like that. It should say about enqueuing a > >> task, whilst task-specific comments belong in the corresponding enum > >> or structure definitions. Definitely not a single huge comment. > >> > >>>>> > >>>>>> In what comes to RST commentary, please consider a bullet-formatte= d > >>>>>> description for improved readability: > >>>>>> > >>>>>> - Flow rule management is done via special flow management queues > >>>>>> - The queue operations are asynchronous and not thread-safe > >>>>>> - The operations can thus be invoked by the app's datapath > >>>>>> - The queue count is configured at initialisation stage > >>>>>> - Available operation types: submit_task, push_postponed and poll > >>>>>> - Polling provides completions for submitted tasks > >>>>>> - The completions can be reordered withing a queue > >>>>>> - Polling must be done on time to avoid overflows > >>>>> Agree, it does seem nicer and cleaner, will adopt this style in v3. > >> > >> Very well. > >> > >>>>> > >>>>>> Please note that the above review notes are just a quick primer, > >>>>>> nothing more. I may be mistaken with regard to some aspects. > >>>>>> > >>>>>> I humbly request that we agree on the API sketch and naming > >>>>>> before going to the next review cycle. > >>>>>> > >>>>>> Thank you. > >>>>> Thanks for your suggestions, let's see if we can find a common roun= d here. > >>> > >> > >> Alright. > >> > >> -- > >> Ivan M > > > > Best, > > Ori > > Ori