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 BC31543082; Wed, 16 Aug 2023 19:08:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B30940693; Wed, 16 Aug 2023 19:08:35 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by mails.dpdk.org (Postfix) with ESMTP id BA8984003C; Wed, 16 Aug 2023 19:08:30 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MGPMq9ey8iboTz+tLsdJC0TaqM5Scid4t0tB7vJXzNQHJZHpCgseTSB3LYSLjyjhOvnCqZsXwsDPuNGQaaUeN3nLNjBfs1PTvxA/K+eF4wB/cr2qPMmY9SiC2hSDTuGlf8yYBaixMdxu8cpfv/A2yQ8/hduOZGmeR3KYcNWeALf8oXnD3kBF8ou4q/wFUqQDJdenUBQqfjeT3KD3xgacyO7gnTp5WzkMGyD8w46iaGqvA2OmX1kqW/1hRkLZFE8AzuE4iwrE/RDDDAmjnqhfLQR5R5e19NxF3B+wOEiT/7U4MRtoGB+J7LETM8rqRmecJZElN43r1bwGwMojijltlg== 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=21xU1qtBZbCXzOezBEpWun7tMphIe/4qbMNoz/w5CBg=; b=SjBqKOdF9F52yT31qa6Baja5OGLylgiQFr49YdUshxuXpZ9GkUO79H53w70N7E93PgwvMeMoyd7H+vnaXLJUjUZyXn3OrjLIMajl0DR9fOALrNDOdm4QvX0F881sfMIkxWZ3zCIUp70KX37+ultYc5MgiiDwLeXlyAPq6QvGxFkIU6NzONhtoZopkN7awO3EmFB0W9ID8cios3LRx3ECZgiXdbdirblxuZDtJAuyfWp9q94QjduigCzlny8JZDI0SDGi9U0oZrKyF2hAqGM/ohYO3V/o52+TKzO+cavOM7HO8gP7BQNKjLgaWgDGvy8Y+NwAUUqIYop9c8VNIkc6Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=21xU1qtBZbCXzOezBEpWun7tMphIe/4qbMNoz/w5CBg=; b=1Nb69/VQu7iyMWQO0VhL+Un1duYGQxpCESP3G54oLh0tBsafvAk6QyMtPpjOZspvIWoMeDH8Xd7WHFaRYNs7GvurchmmntaQEdD3j9Tm6RW6xhWXwCjslUmjkR2/3PN6SLpriMi0sf6JUu36ojYtqHbgMrrlFph7pOmjlI+07u8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MW3PR12MB4490.namprd12.prod.outlook.com (2603:10b6:303:2f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.30; Wed, 16 Aug 2023 17:08:28 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::49e9:2bf6:7f06:bbbd]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::49e9:2bf6:7f06:bbbd%3]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 17:08:27 +0000 Message-ID: <2bb39705-9d3d-cc00-213f-2aeea81cdf2b@amd.com> Date: Wed, 16 Aug 2023 18:08:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , "Dumitrescu, Cristian" , "Zhang, Qi Z" , Ori Kam , Jerin Jacob Cc: "NBU-Contact-Thomas Monjalon (EXTERNAL)" , david.marchand@redhat.com, "Richardson, Bruce" , jerinj@marvell.com, techboard@dpdk.org, "Mcnamara, John" , "Zhang, Helin" , dev@dpdk.org References: <20230802173451.3151646-1-qi.z.zhang@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D87AB9@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D87ABF@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D87AC2@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D87AC4@smartserver.smartshare.dk> <98CBD80474FA8B44BF855DF32C47DC35D87B0B@smartserver.smartshare.dk> Content-Language: en-US From: Ferruh Yigit Subject: Re: [PATCH] ethdev: introduce generic flow item and action In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87B0B@smartserver.smartshare.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0042.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW3PR12MB4490:EE_ X-MS-Office365-Filtering-Correlation-Id: feeec6c9-acba-4c0f-8778-08db9e7b688d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HjjO/dMn8IQoFWGiUI1ViuacArPbl49HMYLUjrUlIzldkrcOT9jx8OeXSKTWbUCVT1kAhW/kty4yycuYEV8HBj9ksqAHq95p4ZuAdw1Hm+f9DqY2QkU3XnbTh0zhT37+LEVwwBCndH4EK5076SR3APqT1dTALnoGhuJ1KbD8zG0EaQd9z8OXg4hj9fzifgEwEAn16WoG9ZarDi+yS5JZ2Gu8ezGhNUEqhtQDcXYawZh12Dey7meeJ5ySvfmG/NaRtX1FJSpM0haY0k3O89YfIMvHOrM7LYsd6uuzWDWcdDbAWYuHrstr/cKDoQR9758KbPou6nH1kVnEMFXSF9QJebXltl0tdlbJi7FJZiHFJeQl5C2HGLLXAZyV5g4d+bYZIFVZrn9aldZ0r/fN9snUlT+dyETotMo7b/hPtUa0rDGxhlbhwahag5tI+3Vkv3+Q1frzdyW99OdjPD9LRTByVuBriCbQtLHQAuXRlJsbi3aGSryVVhAFjNqyS0mbfi4cMi0eslwZ6/xGeKYOOkx++JEC6zGHUqz5VgVujWYSyc72rdMs4CxL7vgb5ZxaWBAG03vti75yULltMi0BGZbW1z0BExhFQGjQHyBmGqiH+LLA3/LbSD5ZPCkd4thzyzXbYyEVGEaqg1XyuU745qGpZQgVF5p30YdM/N7WgfSaIuU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(54906003)(66946007)(110136005)(66476007)(66556008)(41300700001)(5660300002)(44832011)(66574015)(38100700002)(31686004)(8676002)(4326008)(8936002)(2906002)(83380400001)(26005)(478600001)(7416002)(86362001)(31696002)(6512007)(53546011)(6506007)(36756003)(6666004)(2616005)(6486002)(41533002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dkY2MVdlaElXK0pTRUJwTmlSRFJTT2MzQ3I3UGRUeHErQ2Y5UVM0OUtLRGdu?= =?utf-8?B?eXF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hjTURqN0ZMdjhWdVZzcjdo?= =?utf-8?B?NFRVM0R4cEp2WFRXQmlOeFBEb3lCY2tLTHI1d1poUnhib0VaUXFKV2duWnIv?= =?utf-8?B?MnU3d3hGUVpRMDdJZENhaDRkZVBkRTN3S3EzUnJaRmx1cUw5eFNmc0ZhcWpu?= =?utf-8?B?Y3k3emljdFVOODdSaGFFczNBZVIvVUcvbG9MbGJjSTlsZU5kS21DQVltWk41?= =?utf-8?B?Mm42eTN6ZzdqZFZBVDZWWDhQdjUrK3A2SFI1ODBtNkluVjRPem5HcWV1YWNP?= =?utf-8?Q?sEnmnlDYrTuIBOxKuej4Jwwx5?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: feeec6c9-acba-4c0f-8778-08db9e7b688d X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 17:08:27.7882 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uf4oeOjB1a54Ch7q4e2PccPgf6lRg8+oBC/F8aPCV2+fdadLgb0uyhiN6SqvdgHi X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4490 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 On 8/16/2023 3:20 PM, Morten Brørup wrote: >> From: Dumitrescu, Cristian [mailto:cristian.dumitrescu@intel.com] >> Sent: Wednesday, 16 August 2023 15.23 >> >> Hi Morten, >> >> >> >>>>> >>>>> In order to avoid conflicts between P4 and non-P4 generic flow >>>> items/actions, >>>>> the generic type should include information about how to interpret the >>>>> information, which is why I suggest making it a Vendor-Specific type, >> with >>>>> vendor-specific TLV's (managed by the vendor), like the RADIUS Vendor- >>>>> Specific attributes I compared to, instead of just an opaque blob. >>>> >>>> I like this idea, but it is not necessary to introduce a vendor-specific >> type, >>>> it could be considered a device-specific type (or port-specific in the >> context >>>> of DPDK). >>>> >>>> However, the PMD can manage a dictionary, enabling users to query about >>> the >>>> format of each generic item or action if we can expose a set of query >> APIs. >>>> >>>> But I guess we don't need vendor-id / vendor-type as RADIUS does, as we >>> have >>>> port_id here. >>> >>> If the flow item itself doesn't have a "type" field (identifying how to >> interpret >>> the blob), you might have two different NICs using each their own blob >>> format. The NIC must be able to determine if a given flow item is of a type >> it >>> can understand, before it tries to parse the blob in it. >>> >>> This is why the "struct rte_flow_item" has a "type" field. It tells the HW >> how >>> to interpret the values in a flow item. >>> >>> If we introduce a "generic" flow item type, it can only be used for multiple >>> purposes (i.e. both P4, but also other purposes than P4) if it has a "sub- >> type" >>> field. Otherwise, someone will create a "generic" flow item containing a P4 >>> program and send it to a NIC, which uses the "generic" flow item type for >>> other program types, e.g. a cBPF program. And this cBPF capable NIC has no >>> way to detect that the blob in the flow item is not a cBPF program, but a P4 >>> program. The P4 capable NIC will accept the P4 program, but will be confused >>> when sent the cBPF program understood by the first NIC. >>> >>> So I am suggesting that the "generic" flow items and actions follow an >> existing >>> and well known design patterns for how to identify the meaning of blobs: >>> Include a Vendor-ID followed by vendor-specific TLV formatted data. >>> >>> As I wrote initially, I am opposed to introducing uninterpretable blobs into >>> DPDK. Flow items/actions need to be well defined. Allowing "Vendor-Specific" >>> flow items/actions is a workaround that allows you to bypass the normal >>> standardization process. >>> >> >> I would be happy to add mechanisms to describe the user-defined flow items >> and actions in greater detail. Would you be able to provide some examples for >> your proposal for a flow item and a flow action of your choice, please? >> Thanks! >> >> One thing I would want to stress here: the flow items and flow actions are >> defined exclusively by the user (through their P4 program) without any >> knowledge or intervention from the HW vendor, so any TLVs / helper fields >> must be populated by the user as opposed to the HW vendor. > > Perhaps I have completely misunderstood this patch... > > I thought the purpose is for the user to define some generic flow items and actions, which are not in the list of DPDK standardized (and fully documented) RTE_FLOW items/actions, but are understood by a variety of programmable NICs from various HW vendors. In this case, each blob needs to be prefixed with a "type" field, so the HW can determine which of its processing engines needs to parse the blob. E.g. a NIC could have both a P4 processing engine and a BPF processing engine, so the blob needs to indicate which of the two engines to use for the provided flow item/action. > > But maybe the purpose is completely different. Is the purpose of this patch to introduce flow items and flow actions, which each make the HW perform a "callback" to the user application? In this case, only the user application (handling the "callbacks") can understand them, and thus they are completely opaque to everything else. > @Morten, I agree that this is more "opaque" than "generic" and it is open to abuse. As far as I understand, purpose is NOT to implement unsupported RTE_FLOW items/actions, if that is the case I agree with @Ori to figure out gaps and implement them. Purpose seems to provide control path for P4 pipelines. Each P4 pipeline implementation can have set of tables, used for match action for the pipeline, and these tables can be for anything, doesn't have to be standard net functions or protocols etc.. To be able to dynamically program the pipeline, someone needs the ability to program the tables, since these tables not limited to net functions it is not possible to address these tables by rte_flow patterns. Hence this opaque rte_flow pattern/action seems designed to dynamically update/control the pipeline. If above understanding is correct, I suggest using a middle ground, instead of having wide open key/value based rte_flow item, rename it to RTE_FLOW_ITEM_TYPE_P4[SOMETHING], and have "struct rte_flow_item_p4[something]" to include all relevant fields to program a P4 pipeline, like table_id/table_name, value etc.. This way new rte_flow item/action remains scoped and focused, but still flexible enough to program any type of P4 pipeline. Also we don't need to maintain a unique vendor ID etc, although what is the table name/id, what it is for and what is the relevant action is HW (even pipeline) specific, there is nothing to collide per vendor to manage. With this approach code can be portable, same application can be used on top of different HW that implements exact same P4 pipelines (assuming driver implementations are complete.)