Show a cover letter.

GET /api/covers/102449/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 102449,
    "url": "http://patches.dpdk.org/api/covers/102449/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/cover/20211020151457.17577-1-viacheslavo@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20211020151457.17577-1-viacheslavo@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211020151457.17577-1-viacheslavo@nvidia.com",
    "date": "2021-10-20T15:14:53",
    "name": "[v8,0/4] ethdev: introduce configurable flexible item",
    "submitter": {
        "id": 1926,
        "url": "http://patches.dpdk.org/api/people/1926/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/cover/20211020151457.17577-1-viacheslavo@nvidia.com/mbox/",
    "series": [
        {
            "id": 19846,
            "url": "http://patches.dpdk.org/api/series/19846/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19846",
            "date": "2021-10-20T15:14:53",
            "name": "ethdev: introduce configurable flexible item",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/19846/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/covers/102449/comments/",
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id B288FA0C43;\n\tWed, 20 Oct 2021 17:15:42 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7980D41196;\n\tWed, 20 Oct 2021 17:15:42 +0200 (CEST)",
            "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2085.outbound.protection.outlook.com [40.107.220.85])\n by mails.dpdk.org (Postfix) with ESMTP id 8A6FB40142\n for <dev@dpdk.org>; Wed, 20 Oct 2021 17:15:40 +0200 (CEST)",
            "from BN0PR04CA0036.namprd04.prod.outlook.com (2603:10b6:408:e8::11)\n by BYAPR12MB2966.namprd12.prod.outlook.com (2603:10b6:a03:df::27)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Wed, 20 Oct\n 2021 15:15:36 +0000",
            "from BN8NAM11FT013.eop-nam11.prod.protection.outlook.com\n (2603:10b6:408:e8:cafe::60) by BN0PR04CA0036.outlook.office365.com\n (2603:10b6:408:e8::11) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend\n Transport; Wed, 20 Oct 2021 15:15:36 +0000",
            "from mail.nvidia.com (216.228.112.34) by\n BN8NAM11FT013.mail.protection.outlook.com (10.13.176.182) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4628.16 via Frontend Transport; Wed, 20 Oct 2021 15:15:35 +0000",
            "from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 20 Oct\n 2021 15:15:19 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=fNlYPUJ0fUMCt+GlhrlGaaWgdZm6U03nPhD8OTagdFmJtGo5O6g+5TPMQ2OfAu/FXM8K58E1fNtjkH0A83FnFsn5+IyQYdytkEhv00bQTrJCFjxQz8VPzg7UVtQD6aZ0nQD5ca4GGicFWoT3q60t9pF3tDiJeK85S7xld37KtLXdmCZHCa7U1XYhzTWZ4m3PhZVK6MiVkbfG4T8zGEAJtZRpHAefZJHvqaWUdcF6gm2FZkJDCzGeThN6EVjOKGV6S49fkEGatnzkWu7eYIJJDMoTNmRQuw5by5AhqtqWieQRijUgIZi60THeDAYLvYt2gtig6MAvWtF8EfPuIJIXhw==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n 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;\n bh=7oicqsJHKJ5jV8IcCS8zk11OFGfxNTGNQQLf1eETkE4=;\n b=ZDkL2THvWbveBYzCbtmmsNP+boFllcH1JG9MzPyxGj0GV0kdvJVorGhuluBwPpa6eilxTBvGCP/yc+m/dIi+Qaaz64JA5ZjJp2mwj8yX94vmHE/mJUgbgxO7TQH3TJI9DgbOT6ike0O3cLNG6+cKeagHJTRR73JZ+Pnzb0W0pKeilvR27NkBoNFlNI58Mjpc2IZw9NBcdAaN+rbI931F4Ysmi3UBXzH4LJQQVdKTknCMXMAfDokVu31W5TvXdBwjEYoGHSqli0OwQIeFcEL6L4wC3208YJZEtHU0pZ+taG/yIg0cBIZK+V9nYzUES2rSMOP6NSJYt5L3YU1eGwbTyg==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=quarantine pct=100) action=none\n header.from=nvidia.com; dkim=none (message not signed); arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=7oicqsJHKJ5jV8IcCS8zk11OFGfxNTGNQQLf1eETkE4=;\n b=UPri6v1KVzfrMm287pF8bqMaMSm28h6ds7K3CF3BjY1l+RjjjDpPObHyordbKK2HfQcq4v+FX6JXLZg8MNHSNKx9NGDDP8PNY0/LQVCF41Qsp2hikkn4bmtpoIpdH0L5MwNIBL4PzcWpRAuhFREqMH5hNnUwb6YfYJa8+kbZAVvWirhUa5Fdq5FyJbZB1V/sxV/8Q91a+IHgUUXoKlkQvIJi5endL21S48XV+49Hq4fr3VMIxkhQCIevRlssiPiG8Q3QdSj8bm3hYnlpxGmt4JnjoIy8BNEZeSx4n/ZLgNuO1O8B/A+uyUUCSpp/e4jlFabE6X/wiT4E1Hqtf4xebA==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed)\n header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;",
        "From": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<rasland@nvidia.com>, <matan@nvidia.com>, <shahafs@nvidia.com>,\n <orika@nvidia.com>, <getelson@nvidia.com>, <thomas@monjalon.net>",
        "Date": "Wed, 20 Oct 2021 18:14:53 +0300",
        "Message-ID": "<20211020151457.17577-1-viacheslavo@nvidia.com>",
        "X-Mailer": "git-send-email 2.18.1",
        "In-Reply-To": "<20210922180418.20663-1-viacheslavo@nvidia.com>",
        "References": "<20210922180418.20663-1-viacheslavo@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[172.20.187.6]",
        "X-ClientProxiedBy": "HQMAIL107.nvidia.com (172.20.187.13) To\n HQMAIL107.nvidia.com (172.20.187.13)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "792cd866-c0af-4307-3cac-08d993dc77a6",
        "X-MS-TrafficTypeDiagnostic": "BYAPR12MB2966:",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BYAPR12MB2966D5825180601685C15E4CDFBE9@BYAPR12MB2966.namprd12.prod.outlook.com>",
        "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": "\n dVOaes/xSertdo1jFdkczoPOdY2GNhTmZr0ukCGpMDYEKnxpqVL15nsuq/XgLG2keZ14evlgfyKb9wO86CW5yekgH0Xi8iQD5MyGMZSwexUZP9EpWU7G+bKbB9ROBXRY2r7qeSJSL+KnndQNBABV6RjTCSqcwPqt0ygEWWECKVhawJ7I6XA+2+HDb8aM7Cw1C0u7qn2CFtOokIvPgZ2tp3n+EadKxB2grXqWymVFC13PaBjazlXKLo6e7pEAuZM4DBVvYCAYP7GBAlb2U//QSJ8+AQkUHv4ZRV0gg3dt1MMku6bWUUKrdPp53WCeui3QANgH12CLf1t+YWZzU6y44/s04VinnF/dp7FfC8NC1N7wFqS6aOefboXUl+M1+sBtEr95odedrQgS3hVe/N5CgB89N5UQ/7e2n28I819g1lYWs59eJ01EujAmb8EmKIiqUtKnRs9LcFKA8R3sqkBprJokM0MJGKGtT4Cme+veTiUW+A/qew5rO4MNGoxr2UFuc5lTrPxR8DmMqijcyo/qyqSBS0OAuFCJh3gew+tq/U8zVrbR5CSg+zdktYE8pc6fpuGL2NbYRfuLOjYetmwFrHt5kVaTcquw76SiOkrT3sX3V6ou2WxAW+j8AG6wIW1TwU3h+RSdfRBjZZtx/KRmatsNbqxj7Fw4tidsPmT/v3wxg+aKTSleUcUDy+aFeAHqg/hpppuKH7p8gJajJE4K4qNclJD1dNRucc8HM+dwx++/CY4cTxvOVdJCC5zgPAnfUGX9TfY7Wcg5ENUBojE44mb9Mrw7YMaW3NVPNmF1iXgHNU9pBVz0/L4t0ksM5gMSnGMvQy5w/RbaqegYeCqdeA==",
        "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(36840700001)(46966006)(70206006)(6666004)(966005)(356005)(2616005)(7636003)(508600001)(55016002)(4326008)(70586007)(47076005)(8676002)(83380400001)(5660300002)(336012)(186003)(16526019)(8936002)(6286002)(6916009)(7696005)(426003)(26005)(2906002)(36756003)(54906003)(30864003)(36906005)(1076003)(316002)(36860700001)(86362001)(82310400003);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "20 Oct 2021 15:15:35.6808 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 792cd866-c0af-4307-3cac-08d993dc77a6",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BN8NAM11FT013.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "BYAPR12MB2966",
        "Subject": "[dpdk-dev] [PATCH v8 0/4] ethdev: introduce configurable flexible\n item",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "1. Introduction and Retrospective\n\nNowadays the networks are evolving fast and wide, the network\nstructures are getting more and more complicated, the new\napplication areas are emerging. To address these challenges\nthe new network protocols are continuously being developed,\nconsidered by technical communities, adopted by industry and,\neventually implemented in hardware and software. The DPDK\nframework follows the common trends and if we bother\nto glance at the RTE Flow API header we see the multiple\nnew items were introduced during the last years since\nthe initial release.\n\nThe new protocol adoption and implementation process is\nnot straightforward and takes time, the new protocol passes\ndevelopment, consideration, adoption, and implementation\nphases. The industry tries to mitigate and address the\nforthcoming network protocols, for example, many hardware\nvendors are implementing flexible and configurable network\nprotocol parsers. As DPDK developers, could we anticipate\nthe near future in the same fashion and introduce the similar\nflexibility in RTE Flow API?\n\nLet's check what we already have merged in our project, and\nwe see the nice raw item (rte_flow_item_raw). At the first\nglance, it looks superior and we can try to implement a flow\nmatching on the header of some relatively new tunnel protocol,\nsay on the GENEVE header with variable length options. And,\nunder further consideration, we run into the raw item\nlimitations:\n\n- only fixed size network header can be represented\n- the entire network header pattern of fixed format\n  (header field offsets are fixed) must be provided\n- the search for patterns is not robust (the wrong matches\n  might be triggered), and actually is not supported\n  by existing PMDs\n- no explicitly specified relations with preceding\n  and following items\n- no tunnel hint support\n\nAs the result, implementing the support for tunnel protocols\nlike aforementioned GENEVE with variable extra protocol option\nwith flow raw item becomes very complicated and would require\nmultiple flows and multiple raw items chained in the same\nflow (by the way, there is no support found for chained raw\nitems in implemented drivers).\n\nThis RFC introduces the dedicated flex item (rte_flow_item_flex)\nto handle matches with existing and new network protocol headers\nin a unified fashion.\n\n2. Flex Item Life Cycle\n\nLet's assume there are the requirements to support the new\nnetwork protocol with RTE Flows. What is given within protocol\nspecification:\n\n  - header format\n  - header length, (can be variable, depending on options)\n  - potential presence of extra options following or included\n    in the header the header\n  - the relations with preceding protocols. For example,\n    the GENEVE follows UDP, eCPRI can follow either UDP\n    or L2 header\n  - the relations with following protocols. For example,\n    the next layer after tunnel header can be L2 or L3\n  - whether the new protocol is a tunnel and the header\n    is a splitting point between outer and inner layers\n\nThe supposed way to operate with flex item:\n\n  - application defines the header structures according to\n    protocol specification\n\n  - application calls rte_flow_flex_item_create() with desired\n    configuration according to the protocol specification, it\n    creates the flex item object over specified ethernet device\n    and prepares PMD and underlying hardware to handle flex\n    item. On item creation call PMD backing the specified\n    ethernet device returns the opaque handle identifying\n    the object has been created\n\n  - application uses the rte_flow_item_flex with obtained handle\n    in the flows, the values/masks to match with fields in the\n    header are specified in the flex item per flow as for regular\n    items (except that pattern buffer combines all fields)\n\n  - flows with flex items match with packets in a regular fashion,\n    the values and masks for the new protocol header match are\n    taken from the flex items in the flows\n\n  - application destroys flows with flex items\n\n  - application calls rte_flow_flex_item_release() as part of\n    ethernet device API and destroys the flex item object in\n    PMD and releases the engaged hardware resources\n\n3. Flex Item Structure\n\nThe flex item structure is intended to be used as part of the flow\npattern like regular RTE flow items and provides the mask and\nvalue to match with fields of the protocol item was configured\nfor.\n\n  struct rte_flow_item_flex {\n    void *handle;\n    uint32_t length;\n    const uint8_t* pattern;\n  };\n\nThe handle is some opaque object maintained on per device basis\nby underlying driver.\n\nThe protocol header fields are considered as bit fields, all\noffsets and widths are expressed in bits. The pattern is the\nbuffer containing the bit concatenation of all the fields\npresented at item configuration time, in the same order and\nsame amount. If byte boundary alignment is needed an application\ncan use a dummy type field, this is just some kind of gap filler.\n\nThe length field specifies the pattern buffer length in bytes\nand is needed to allow rte_flow_copy() operations. The approach\nof multiple pattern pointers and lengths (per field) was\nconsidered and found clumsy - it seems to be much suitable for\nthe application to maintain the single structure within the\nsingle pattern buffer.\n\n4. Flex Item Configuration\n\nThe flex item configuration consists of the following parts:\n\n  - header field descriptors:\n    - next header\n    - next protocol\n    - sample to match\n  - input link descriptors\n  - output link descriptors\n\nThe field descriptors tell the driver and hardware what data should\nbe extracted from the packet and then control the packet handling\nin the flow engine. Besides this, sample fields can be presented\nto match with patterns in the flows. Each field is a bit pattern.\nIt has width, offset from the header beginning, mode of offset\ncalculation, and offset related parameters.\n\nThe next header field is special, no data are actually taken\nfrom the packet, but its offset is used as a pointer to the next\nheader in the packet, in other words the next header offset\nspecifies the size of the header being parsed by flex item.\n\nThere is one more special field - next protocol, it specifies\nwhere the next protocol identifier is contained and packet data\nsampled from this field will be used to determine the next\nprotocol header type to continue packet parsing. The next\nprotocol field is like eth_type field in MAC2, or proto field\nin IPv4/v6 headers.\n\nThe sample fields are used to represent the data be sampled\nfrom the packet and then matched with established flows.\n\nThere are several methods supposed to calculate field offset\nin runtime depending on configuration and packet content:\n\n  - FIELD_MODE_FIXED - fixed offset. The bit offset from\n    header beginning is permanent and defined by field_base\n    configuration parameter.\n\n  - FIELD_MODE_OFFSET - the field bit offset is extracted\n    from other header field (indirect offset field). The\n    resulting field offset to match is calculated from as:\n\n  field_base + (*offset_base & offset_mask) << offset_shift\n\n    This mode is useful to sample some extra options following\n    the main header with field containing main header length.\n    Also, this mode can be used to calculate offset to the\n    next protocol header, for example - IPv4 header contains\n    the 4-bit field with IPv4 header length expressed in dwords.\n    One more example - this mode would allow us to skip GENEVE\n    header variable length options.\n\n  - FIELD_MODE_BITMASK - the field bit offset is extracted\n    from other header field (indirect offset field), the latter\n    is considered as bitmask containing some number of one bits,\n    the resulting field offset to match is calculated as:\n\n  field_base + bitcount(*offset_base & offset_mask) << offset_shift\n\n    This mode would be useful to skip the GTP header and its\n    extra options with specified flags.\n\n  - FIELD_MODE_DUMMY - dummy field, optionally used for byte\n    boundary alignment in pattern. Pattern mask and data are\n    ignored in the match. All configuration parameters besides\n    field size and offset are ignored.\n\n  Note:  \"*\" - means the indirect field offset is calculated\n  and actual data are extracted from the packet by this\n  offset (like data are fetched by pointer *p from memory).\n\nThe offset mode list can be extended by vendors according to\nhardware supported options.\n\nThe input link configuration section tells the driver after\nwhat protocols and at what conditions the flex item can follow.\nInput link specified the preceding header pattern, for example\nfor GENEVE it can be UDP item specifying match on destination\nport with value 6081. The flex item can follow multiple header\ntypes and multiple input links should be specified. At flow\ncreation time the item with one of the input link types should\nprecede the flex item and driver will select the correct flex\nitem settings, depending on the actual flow pattern.\n\nThe output link configuration section tells the driver how\nto continue packet parsing after the flex item protocol.\nIf multiple protocols can follow the flex item header the\nflex item should contain the field with the next protocol\nidentifier and the parsing will be continued depending\non the data contained in this field in the actual packet.\n\nThe flex item fields can participate in RSS hash calculation,\nthe dedicated flag is present in the field description to specify\nwhat fields should be provided for hashing.\n\n5. Flex Item Chaining\n\nIf there are multiple protocols supposed to be supported with\nflex items in chained fashion - two or more flex items within\nthe same flow and these ones might be neighbors in the pattern,\nit means the flex items are mutual referencing.  In this case,\nthe item that occurred first should be created with empty\noutput link list or with the list including existing items,\nand then the second flex item should be created referencing\nthe first flex item as input arc, drivers should adjust\nthe item confgiuration.\n\nAlso, the hardware resources used by flex items to handle\nthe packet can be limited. If there are multiple flex items\nthat are supposed to be used within the same flow it would\nbe nice to provide some hint for the driver that these two\nor more flex items are intended for simultaneous usage.\nThe fields of items should be assigned with hint indices\nand these indices from two or more flex items supposed\nto be provided within the same flow should be the same\nas well. In other words, the field hint index specifies\nthe group of fields that can be matched simultaneously\nwithin a single flow. If hint indices are specified,\nthe driver will try to engage not overlapping hardware\nresources and provide independent handling of the field\ngroups with unique indices. If the hint index is zero\nthe driver assigns resources on its own.\n\n6. Example of New Protocol Handling\n\nLet's suppose we have the requirements to handle the new tunnel\nprotocol that follows UDP header with destination port 0xFADE\nand is followed by MAC header. Let the new protocol header format\nbe like this:\n\n  struct new_protocol_header {\n    rte_be32 header_length; /* length in dwords, including options */\n    rte_be32 specific0;     /* some protocol data, no intention */\n    rte_be32 specific1;     /* to match in flows on these fields */\n    rte_be32 crucial;       /* data of interest, match is needed */\n    rte_be32 options[0];    /* optional protocol data, variable length */\n  };\n\nThe supposed flex item configuration:\n\n  struct rte_flow_item_flex_field field0 = {\n    .field_mode = FIELD_MODE_DUMMY,  /* Affects match pattern only */\n    .field_size = 96,                /* three dwords from the beginning */\n  };\n  struct rte_flow_item_flex_field field1 = {\n    .field_mode = FIELD_MODE_FIXED,\n    .field_size = 32,       /* Field size is one dword */\n    .field_base = 96,       /* Skip three dwords from the beginning */\n  };\n  struct rte_flow_item_udp spec0 = {\n    .hdr = {\n      .dst_port = RTE_BE16(0xFADE),\n    }\n  };\n  struct rte_flow_item_udp mask0 = {\n    .hdr = {\n      .dst_port = RTE_BE16(0xFFFF),\n    }\n  };\n  struct rte_flow_item_flex_link link0 = {\n    .item = {\n       .type = RTE_FLOW_ITEM_TYPE_UDP,\n       .spec = &spec0,\n       .mask = &mask0,\n  };\n\n  struct rte_flow_item_flex_conf conf = {\n    .next_header = {\n      .tunnel = FLEX_TUNNEL_MODE_SINGLE,\n      .field_mode = FIELD_MODE_OFFSET,\n      .field_base = 0,\n      .offset_base = 0,\n      .offset_mask = 0xFFFFFFFF,\n      .offset_shift = 2\t   /* Expressed in dwords, shift left by 2 */\n    },\n    .sample = {\n       &field0,\n       &field1,\n    },\n    .nb_samples = 2,\n    .input_link[0] = &link0,\n    .nb_inputs = 1\n  };\n\nLet's suppose we have created the flex item successfully, and PMD\nreturned the handle 0x123456789A. We can use the following item\npattern to match the crucial field in the packet with value 0x00112233:\n\n  struct new_protocol_header spec_pattern =\n  {\n    .crucial = RTE_BE32(0x00112233),\n  };\n  struct new_protocol_header mask_pattern =\n  {\n    .crucial = RTE_BE32(0xFFFFFFFF),\n  };\n  struct rte_flow_item_flex spec_flex = {\n    .handle = 0x123456789A\n    .length = sizeiof(struct new_protocol_header),\n    .pattern = &spec_pattern,\n  };\n  struct rte_flow_item_flex mask_flex = {\n    .length = sizeof(struct new_protocol_header),\n    .pattern = &mask_pattern,\n  };\n  struct rte_flow_item item_to_match = {\n    .type = RTE_FLOW_ITEM_TYPE_FLEX,\n    .spec = &spec_flex,\n    .mask = &mask_flex,\n  };\n\n7. Notes:\n\n - v7:  http://patches.dpdk.org/project/dpdk/patch/20211020150621.16517-2-viacheslavo@nvidia.com/\n - v6:  http://patches.dpdk.org/project/dpdk/cover/20211018180252.14106-1-viacheslavo@nvidia.com/\n - v5:  http://patches.dpdk.org/project/dpdk/patch/20211012125433.31647-2-viacheslavo@nvidia.com/\n - v4:  http://patches.dpdk.org/project/dpdk/patch/20211012113235.24975-2-viacheslavo@nvidia.com/ \n - v3:  http://patches.dpdk.org/project/dpdk/cover/20211011181528.517-1-viacheslavo@nvidia.com/\n - v2:  http://patches.dpdk.org/project/dpdk/patch/20211001193415.23288-2-viacheslavo@nvidia.com/\n - v1:  http://patches.dpdk.org/project/dpdk/patch/20210922180418.20663-2-viacheslavo@nvidia.com/\n - RFC: http://patches.dpdk.org/project/dpdk/patch/20210806085624.16497-1-viacheslavo@nvidia.com/\n\n - v7 -> v8:\n   - fixed the first commit Author (was ocasionally altered due to resplit)\n\n - v6 -> v7:\n   - series resplitted and patches reorderered, code is the same\n   - documentation fixes\n\n - v5 -> v6:\n   - flex item command moved to dedicated file cmd_flex_item.c\n\n - v4 -> v5:\n   - comments addressed\n   - testpmd compilation issue fixed\n\n - v3 -> v4:\n   - comments addressed\n   - testpmd compilation issues fixed\n   - typos fixed\n\n - v2 -> v3:\n   - comments addressed\n   - flex item update removed as not supported\n   - RSS over flex item fields removed as not supported and non-complete\n     API\n   - tunnel mode configuration refactored\n   - testpmd updated\n   - documentation updated\n   - PMD patches are removed temporarily (updating WIP, be presented in rc2)\n\n - v1 -> v2:\n   - testpmd CLI to handle flex item is provided\n   - draft PMD code is introduced\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>\n\nGregory Etelson (3):\n  ethdev: support flow elements with variable length\n  app/testpmd: add dedicated flow command parsing routine\n  app/testpmd: add flex item CLI commands\n\nViacheslav Ovsiienko (1):\n  ethdev: introduce configurable flexible item\n\n app/test-pmd/cmd_flex_item.c                | 548 ++++++++++++++++++++\n app/test-pmd/cmdline.c                      |   2 +\n app/test-pmd/cmdline_flow.c                 | 247 ++++++++-\n app/test-pmd/meson.build                    |   6 +\n app/test-pmd/testpmd.c                      |   2 +-\n app/test-pmd/testpmd.h                      |  35 ++\n doc/guides/prog_guide/rte_flow.rst          |  25 +\n doc/guides/rel_notes/release_21_11.rst      |   7 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 119 +++++\n lib/ethdev/rte_flow.c                       | 121 ++++-\n lib/ethdev/rte_flow.h                       | 225 ++++++++\n lib/ethdev/rte_flow_driver.h                |   8 +\n lib/ethdev/version.map                      |   2 +\n 13 files changed, 1332 insertions(+), 15 deletions(-)\n create mode 100644 app/test-pmd/cmd_flex_item.c"
}