get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/107190/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 107190,
    "url": "http://patches.dpdk.org/api/patches/107190/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220209213809.1208269-7-akozyrev@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": "<20220209213809.1208269-7-akozyrev@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220209213809.1208269-7-akozyrev@nvidia.com",
    "date": "2022-02-09T21:38:05",
    "name": "[v4,06/10] app/testpmd: implement rte flow table management",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "af032ebe17c28ca99bbcc664ac0d84ee6acad35c",
    "submitter": {
        "id": 1873,
        "url": "http://patches.dpdk.org/api/people/1873/?format=api",
        "name": "Alexander Kozyrev",
        "email": "akozyrev@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220209213809.1208269-7-akozyrev@nvidia.com/mbox/",
    "series": [
        {
            "id": 21577,
            "url": "http://patches.dpdk.org/api/series/21577/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=21577",
            "date": "2022-02-09T21:37:59",
            "name": "ethdev: datapath-focused flow rules management",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/21577/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/107190/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/107190/checks/",
    "tags": {},
    "related": [],
    "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 3BBE1A0032;\n\tWed,  9 Feb 2022 22:39:26 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8CAF34115D;\n\tWed,  9 Feb 2022 22:39:00 +0100 (CET)",
            "from NAM10-MW2-obe.outbound.protection.outlook.com\n (mail-mw2nam10on2054.outbound.protection.outlook.com [40.107.94.54])\n by mails.dpdk.org (Postfix) with ESMTP id 73FDB40140\n for <dev@dpdk.org>; Wed,  9 Feb 2022 22:38:58 +0100 (CET)",
            "from CY4PR1201MB0104.namprd12.prod.outlook.com\n (2603:10b6:910:1d::16) by MWHPR12MB1422.namprd12.prod.outlook.com\n (2603:10b6:300:10::8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Wed, 9 Feb\n 2022 21:38:55 +0000",
            "from CO2PR04CA0087.namprd04.prod.outlook.com (2603:10b6:104:6::13)\n by CY4PR1201MB0104.namprd12.prod.outlook.com (2603:10b6:910:1d::16) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Wed, 9 Feb\n 2022 21:38:54 +0000",
            "from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com\n (2603:10b6:104:6:cafe::8f) by CO2PR04CA0087.outlook.office365.com\n (2603:10b6:104:6::13) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend\n Transport; Wed, 9 Feb 2022 21:38:54 +0000",
            "from mail.nvidia.com (12.22.5.236) by\n CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4975.11 via Frontend Transport; Wed, 9 Feb 2022 21:38:54 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com\n (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Wed, 9 Feb 2022 21:38:49 +0000",
            "from pegasus01.mtr.labs.mlnx (10.126.231.35) by\n rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9;\n Wed, 9 Feb 2022 13:38:46 -0800"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=aZtETHZkaSLZAEKXeEbf6+M/ez8Iq6NOSX3blOI8/VnY3FUalTQuSlFMWVp8aUFMj7MIU9kcL6ai1sTsWjOXfo10wRifIVmwe+rPDZVmJ6vOZ8nM47Dc+Nt9xtYOe1G+tGr6Wm69T+XPLYj+W+BWOgj+wsFB/cNpbb6NE22UxLZhMmGlIBYkE6gUrtpGtCcx2Ar8J234zFA6pPzG+8wmvLmZqWwzB2sYwRHMN7preQj1WKitl4gQr89Q4JBfL2eEtKfMNbZ+h7uLsSzZTm4tNmYoHFrQLTaUXqNIV+FdkOqEvJI/2p10TqZF79XSSPc84IZKXqiht8I7UlPNMXXU2Q==",
        "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=UHxnyR6gGcBJ+3B80U/HfAvZzsatCl0PZb/7luYmg/E=;\n b=JAnmrCXsOP/YIOzyiVDeSAgrqHML9e9ImcZ6ZdTy9w1CFZBzAYGPmgFJS0kG8MTwThaCiBgI2dEbLBFrOQso7ZfCOqWiDl+BqQJP5NMCFeEBJFmVimNmiIF3TkmcQ5Sv3/2YpuWbzCLpVNKk7ghtgIXLk39mxUV6+AB0REVphKvQOaAGsnLSCQn1Eculapty//DGtk5VkjAj/Uz1ETbfc8/ORB0c6a5IAVxNototJjyIRtHHoaMTyVOMaFJYPUOxKlJlyzhhXhxcFF2Hxnek5jgZ9t05R/1gborFksaGi6rbUrE707VbibBBYwM2ZTT6aNB67OKg4vNHLgbDYiCgCA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.236) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass\n (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none\n (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=UHxnyR6gGcBJ+3B80U/HfAvZzsatCl0PZb/7luYmg/E=;\n b=AjoX9KgTdA+FOynWtFunQTzmkDjCuFnxESmU48FjtkR+INIh0pNiUeTyzsrPudDVxCkBV8mxzWXyIaiCbd1HZjzNXKCw35fG1QZA9sbLgGzXTpidqMHUvzlvYPFzpHQOT57OXy4QXrELMmd4w7P1V0cJKAwwBIoTveyOk3G5x+IDODSSxfABZ0DO6UtrcS4rlYnfKSSaaWZUzg+XNbYTqvFklVdstbCqRX8T0zi2WyhL8CY2ZnPIobi8zi45+oZ/ihhY8MRdTx9sGvQwl1b5ZukkK5H+vbncKhKUaH4iJVqGU50a+5iNfmNUOZGDevCTnR5BjF80FavHn6s4rv06/A==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.236)\n smtp.mailfrom=nvidia.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=nvidia.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 12.22.5.236 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.236; helo=mail.nvidia.com;",
        "From": "Alexander Kozyrev <akozyrev@nvidia.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<orika@nvidia.com>, <thomas@monjalon.net>, <ivan.malov@oktetlabs.ru>,\n <andrew.rybchenko@oktetlabs.ru>, <ferruh.yigit@intel.com>,\n <mohammad.abdul.awal@intel.com>, <qi.z.zhang@intel.com>,\n <jerinj@marvell.com>, <ajit.khaparde@broadcom.com>,\n <bruce.richardson@intel.com>",
        "Subject": "[PATCH v4 06/10] app/testpmd: implement rte flow table management",
        "Date": "Wed, 9 Feb 2022 23:38:05 +0200",
        "Message-ID": "<20220209213809.1208269-7-akozyrev@nvidia.com>",
        "X-Mailer": "git-send-email 2.18.2",
        "In-Reply-To": "<20220209213809.1208269-1-akozyrev@nvidia.com>",
        "References": "<20220206032526.816079-1-akozyrev@nvidia.com >\n <20220209213809.1208269-1-akozyrev@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.231.35]",
        "X-ClientProxiedBy": "rnnvmail202.nvidia.com (10.129.68.7) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "c17a93c7-972e-4cc5-bb0b-08d9ec149227",
        "X-MS-TrafficTypeDiagnostic": "CY4PR1201MB0104:EE_|MWHPR12MB1422:EE_",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <CY4PR1201MB0104F3102E2DBE446A9F85B1AF2E9@CY4PR1201MB0104.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:2331;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n ZGpTUJtxQZ26S+1L10wjIbjmgAeSJ3jUx4jRbGhRaDigHHpcUlFuGIkNYSADU7LPbi7WMrl7uRSWXkyhkxC366OFAgpgnARF1+F17ZlnZHCMuvsX4kgum1YF7ndALnME0goQ/Q/ykaC4y4hfQ1PvkVEkWAzPDUCOyxlwiQOUjngufuPPu/S6KXJRgcPpj+pplGv7uju4fok55lc7XGDquaN5JeffMLBCyfR5/yPARTRmz+g4liEF6uK/fj4NM/MXf1Lrz88GKA08ndErhgNuJE1ewuPyd0M8/gnrG/OnBV8i/UxwVgNX/ZCA4qvN6EgqSHTcYsLpxr1S/jrDKfiOz2PcRHffZaa69s/0M4CHJkcVGrYxvaagSp2qSsKWbjQOS6zc1ldsGAv9Avdeg1cPHHgK/rp3W3MFevhNNVChCrkgUxvJuIHuclkEIOUOpUqMStULxabodqqloSod4xz4Mwbo2Jrh5mTN9Jyhzl1ltVNl6RxdeT3bZHwKHeLwR0DS/Wf6QyAY2CHfagbAK09hxkeRoVLAByjjxzTn1yT0C5limptEso0g3UyiSpvGK9vVNXgMmpiCqtlRYE4IcTdYmzkxtIzdRhA6fBd1tcLetUbHv9zEIB1RxgaX5lU1qeu1pDMd9fCUqZTRnok9smk7O50I1GEGJA9sLMEzfcxbmR4VaPXZdXk6cIvIjYEC0in8bW6rgtB3R5nkoVXXfgKqjg==",
        "X-Forefront-Antispam-Report": "CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(54906003)(6916009)(7416002)(81166007)(86362001)(508600001)(16526019)(36756003)(1076003)(82310400004)(2906002)(36860700001)(70586007)(70206006)(4326008)(316002)(47076005)(40460700003)(2616005)(30864003)(426003)(5660300002)(8936002)(8676002)(26005)(83380400001)(186003)(336012)(356005)(6666004)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "09 Feb 2022 21:38:54.3808 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n c17a93c7-972e-4cc5-bb0b-08d9ec149227",
        "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT048.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "MWHPR12MB1422",
        "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"
    },
    "content": "Add testpmd support for the rte_flow_table API.\nProvide the command line interface for the flow\ntable creation/destruction. Usage example:\n  testpmd> flow template_table 0 create table_id 6\n    group 9 priority 4 ingress mode 1\n    rules_number 64 pattern_template 2 actions_template 4\n  testpmd> flow template_table 0 destroy table 6\n\nSigned-off-by: Alexander Kozyrev <akozyrev@nvidia.com>\nAcked-by: Ori Kam <orika@nvidia.com>\n---\n app/test-pmd/cmdline_flow.c                 | 315 ++++++++++++++++++++\n app/test-pmd/config.c                       | 171 +++++++++++\n app/test-pmd/testpmd.h                      |  17 ++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  53 ++++\n 4 files changed, 556 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex 34bc73eea3..3e89525445 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -58,6 +58,7 @@ enum index {\n \tCOMMON_FLEX_TOKEN,\n \tCOMMON_PATTERN_TEMPLATE_ID,\n \tCOMMON_ACTIONS_TEMPLATE_ID,\n+\tCOMMON_TABLE_ID,\n \n \t/* TOP-level command. */\n \tADD,\n@@ -78,6 +79,7 @@ enum index {\n \tCONFIGURE,\n \tPATTERN_TEMPLATE,\n \tACTIONS_TEMPLATE,\n+\tTABLE,\n \tINDIRECT_ACTION,\n \tVALIDATE,\n \tCREATE,\n@@ -112,6 +114,20 @@ enum index {\n \tACTIONS_TEMPLATE_SPEC,\n \tACTIONS_TEMPLATE_MASK,\n \n+\t/* Table arguments. */\n+\tTABLE_CREATE,\n+\tTABLE_DESTROY,\n+\tTABLE_CREATE_ID,\n+\tTABLE_DESTROY_ID,\n+\tTABLE_GROUP,\n+\tTABLE_PRIORITY,\n+\tTABLE_INGRESS,\n+\tTABLE_EGRESS,\n+\tTABLE_TRANSFER,\n+\tTABLE_RULES_NUMBER,\n+\tTABLE_PATTERN_TEMPLATE,\n+\tTABLE_ACTIONS_TEMPLATE,\n+\n \t/* Tunnel arguments. */\n \tTUNNEL_CREATE,\n \tTUNNEL_CREATE_TYPE,\n@@ -885,6 +901,18 @@ struct buffer {\n \t\t\tuint32_t *template_id;\n \t\t\tuint32_t template_id_n;\n \t\t} templ_destroy; /**< Template destroy arguments. */\n+\t\tstruct {\n+\t\t\tuint32_t id;\n+\t\t\tstruct rte_flow_template_table_attr attr;\n+\t\t\tuint32_t *pat_templ_id;\n+\t\t\tuint32_t pat_templ_id_n;\n+\t\t\tuint32_t *act_templ_id;\n+\t\t\tuint32_t act_templ_id_n;\n+\t\t} table; /**< Table arguments. */\n+\t\tstruct {\n+\t\t\tuint32_t *table_id;\n+\t\t\tuint32_t table_id_n;\n+\t\t} table_destroy; /**< Template destroy arguments. */\n \t\tstruct {\n \t\t\tuint32_t *action_id;\n \t\t\tuint32_t action_id_n;\n@@ -1016,6 +1044,32 @@ static const enum index next_at_destroy_attr[] = {\n \tZERO,\n };\n \n+static const enum index next_table_subcmd[] = {\n+\tTABLE_CREATE,\n+\tTABLE_DESTROY,\n+\tZERO,\n+};\n+\n+static const enum index next_table_attr[] = {\n+\tTABLE_CREATE_ID,\n+\tTABLE_GROUP,\n+\tTABLE_PRIORITY,\n+\tTABLE_INGRESS,\n+\tTABLE_EGRESS,\n+\tTABLE_TRANSFER,\n+\tTABLE_RULES_NUMBER,\n+\tTABLE_PATTERN_TEMPLATE,\n+\tTABLE_ACTIONS_TEMPLATE,\n+\tEND,\n+\tZERO,\n+};\n+\n+static const enum index next_table_destroy_attr[] = {\n+\tTABLE_DESTROY_ID,\n+\tEND,\n+\tZERO,\n+};\n+\n static const enum index next_ia_create_attr[] = {\n \tINDIRECT_ACTION_CREATE_ID,\n \tINDIRECT_ACTION_INGRESS,\n@@ -2061,6 +2115,11 @@ static int parse_template(struct context *, const struct token *,\n static int parse_template_destroy(struct context *, const struct token *,\n \t\t\t\t  const char *, unsigned int,\n \t\t\t\t  void *, unsigned int);\n+static int parse_table(struct context *, const struct token *,\n+\t\t       const char *, unsigned int, void *, unsigned int);\n+static int parse_table_destroy(struct context *, const struct token *,\n+\t\t\t       const char *, unsigned int,\n+\t\t\t       void *, unsigned int);\n static int parse_tunnel(struct context *, const struct token *,\n \t\t\tconst char *, unsigned int,\n \t\t\tvoid *, unsigned int);\n@@ -2134,6 +2193,8 @@ static int comp_pattern_template_id(struct context *, const struct token *,\n \t\t\t\t    unsigned int, char *, unsigned int);\n static int comp_actions_template_id(struct context *, const struct token *,\n \t\t\t\t    unsigned int, char *, unsigned int);\n+static int comp_table_id(struct context *, const struct token *,\n+\t\t\t unsigned int, char *, unsigned int);\n \n /** Token definitions. */\n static const struct token token_list[] = {\n@@ -2298,6 +2359,13 @@ static const struct token token_list[] = {\n \t\t.call = parse_int,\n \t\t.comp = comp_actions_template_id,\n \t},\n+\t[COMMON_TABLE_ID] = {\n+\t\t.name = \"{table_id}\",\n+\t\t.type = \"TABLE_ID\",\n+\t\t.help = \"table id\",\n+\t\t.call = parse_int,\n+\t\t.comp = comp_table_id,\n+\t},\n \t/* Top-level command. */\n \t[FLOW] = {\n \t\t.name = \"flow\",\n@@ -2308,6 +2376,7 @@ static const struct token token_list[] = {\n \t\t\t      CONFIGURE,\n \t\t\t      PATTERN_TEMPLATE,\n \t\t\t      ACTIONS_TEMPLATE,\n+\t\t\t      TABLE,\n \t\t\t      INDIRECT_ACTION,\n \t\t\t      VALIDATE,\n \t\t\t      CREATE,\n@@ -2488,6 +2557,104 @@ static const struct token token_list[] = {\n \t\t.call = parse_template,\n \t},\n \t/* Top-level command. */\n+\t[TABLE] = {\n+\t\t.name = \"template_table\",\n+\t\t.type = \"{command} {port_id} [{arg} [...]]\",\n+\t\t.help = \"manage template tables\",\n+\t\t.next = NEXT(next_table_subcmd, NEXT_ENTRY(COMMON_PORT_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer, port)),\n+\t\t.call = parse_table,\n+\t},\n+\t/* Sub-level commands. */\n+\t[TABLE_CREATE] = {\n+\t\t.name = \"create\",\n+\t\t.help = \"create template table\",\n+\t\t.next = NEXT(next_table_attr),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_DESTROY] = {\n+\t\t.name = \"destroy\",\n+\t\t.help = \"destroy template table\",\n+\t\t.next = NEXT(NEXT_ENTRY(TABLE_DESTROY_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer, port)),\n+\t\t.call = parse_table_destroy,\n+\t},\n+\t/* Table  arguments. */\n+\t[TABLE_CREATE_ID] = {\n+\t\t.name = \"table_id\",\n+\t\t.help = \"specify table id to create\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_TABLE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer, args.table.id)),\n+\t},\n+\t[TABLE_DESTROY_ID] = {\n+\t\t.name = \"table\",\n+\t\t.help = \"specify table id to destroy\",\n+\t\t.next = NEXT(next_table_destroy_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_TABLE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY_PTR(struct buffer,\n+\t\t\t\t\t    args.table_destroy.table_id)),\n+\t\t.call = parse_table_destroy,\n+\t},\n+\t[TABLE_GROUP] = {\n+\t\t.name = \"group\",\n+\t\t.help = \"specify a group\",\n+\t\t.next = NEXT(next_table_attr, NEXT_ENTRY(COMMON_GROUP_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer,\n+\t\t\t\t\targs.table.attr.flow_attr.group)),\n+\t},\n+\t[TABLE_PRIORITY] = {\n+\t\t.name = \"priority\",\n+\t\t.help = \"specify a priority level\",\n+\t\t.next = NEXT(next_table_attr, NEXT_ENTRY(COMMON_PRIORITY_LEVEL)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer,\n+\t\t\t\t\targs.table.attr.flow_attr.priority)),\n+\t},\n+\t[TABLE_EGRESS] = {\n+\t\t.name = \"egress\",\n+\t\t.help = \"affect rule to egress\",\n+\t\t.next = NEXT(next_table_attr),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_INGRESS] = {\n+\t\t.name = \"ingress\",\n+\t\t.help = \"affect rule to ingress\",\n+\t\t.next = NEXT(next_table_attr),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_TRANSFER] = {\n+\t\t.name = \"transfer\",\n+\t\t.help = \"affect rule to transfer\",\n+\t\t.next = NEXT(next_table_attr),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_RULES_NUMBER] = {\n+\t\t.name = \"rules_number\",\n+\t\t.help = \"number of rules in table\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_UNSIGNED)),\n+\t\t.args = ARGS(ARGS_ENTRY(struct buffer,\n+\t\t\t\t\targs.table.attr.nb_flows)),\n+\t},\n+\t[TABLE_PATTERN_TEMPLATE] = {\n+\t\t.name = \"pattern_template\",\n+\t\t.help = \"specify pattern template id\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_PATTERN_TEMPLATE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY_PTR(struct buffer,\n+\t\t\t\t\t    args.table.pat_templ_id)),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_ACTIONS_TEMPLATE] = {\n+\t\t.name = \"actions_template\",\n+\t\t.help = \"specify actions template id\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_ACTIONS_TEMPLATE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY_PTR(struct buffer,\n+\t\t\t\t\t    args.table.act_templ_id)),\n+\t\t.call = parse_table,\n+\t},\n+\t/* Top-level command. */\n \t[INDIRECT_ACTION] = {\n \t\t.name = \"indirect_action\",\n \t\t.type = \"{command} {port_id} [{arg} [...]]\",\n@@ -7901,6 +8068,119 @@ parse_template_destroy(struct context *ctx, const struct token *token,\n \treturn len;\n }\n \n+/** Parse tokens for table create command. */\n+static int\n+parse_table(struct context *ctx, const struct token *token,\n+\t    const char *str, unsigned int len,\n+\t    void *buf, unsigned int size)\n+{\n+\tstruct buffer *out = buf;\n+\tuint32_t *template_id;\n+\n+\t/* Token name must match. */\n+\tif (parse_default(ctx, token, str, len, NULL, 0) < 0)\n+\t\treturn -1;\n+\t/* Nothing else to do if there is no buffer. */\n+\tif (!out)\n+\t\treturn len;\n+\tif (!out->command) {\n+\t\tif (ctx->curr != TABLE)\n+\t\t\treturn -1;\n+\t\tif (sizeof(*out) > size)\n+\t\t\treturn -1;\n+\t\tout->command = ctx->curr;\n+\t\tctx->objdata = 0;\n+\t\tctx->object = out;\n+\t\tctx->objmask = NULL;\n+\t\treturn len;\n+\t}\n+\tswitch (ctx->curr) {\n+\tcase TABLE_CREATE:\n+\t\tout->command = ctx->curr;\n+\t\tctx->objdata = 0;\n+\t\tctx->object = out;\n+\t\tctx->objmask = NULL;\n+\t\tout->args.table.id = UINT32_MAX;\n+\t\treturn len;\n+\tcase TABLE_PATTERN_TEMPLATE:\n+\t\tout->args.table.pat_templ_id =\n+\t\t\t(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),\n+\t\t\t\t\t       sizeof(double));\n+\t\ttemplate_id = out->args.table.pat_templ_id\n+\t\t\t\t+ out->args.table.pat_templ_id_n++;\n+\t\tif ((uint8_t *)template_id > (uint8_t *)out + size)\n+\t\t\treturn -1;\n+\t\tctx->objdata = 0;\n+\t\tctx->object = template_id;\n+\t\tctx->objmask = NULL;\n+\t\treturn len;\n+\tcase TABLE_ACTIONS_TEMPLATE:\n+\t\tout->args.table.act_templ_id =\n+\t\t\t(void *)RTE_ALIGN_CEIL((uintptr_t)\n+\t\t\t\t\t       (out->args.table.pat_templ_id +\n+\t\t\t\t\t\tout->args.table.pat_templ_id_n),\n+\t\t\t\t\t       sizeof(double));\n+\t\ttemplate_id = out->args.table.act_templ_id\n+\t\t\t\t+ out->args.table.act_templ_id_n++;\n+\t\tif ((uint8_t *)template_id > (uint8_t *)out + size)\n+\t\t\treturn -1;\n+\t\tctx->objdata = 0;\n+\t\tctx->object = template_id;\n+\t\tctx->objmask = NULL;\n+\t\treturn len;\n+\tcase TABLE_INGRESS:\n+\t\tout->args.table.attr.flow_attr.ingress = 1;\n+\t\treturn len;\n+\tcase TABLE_EGRESS:\n+\t\tout->args.table.attr.flow_attr.egress = 1;\n+\t\treturn len;\n+\tcase TABLE_TRANSFER:\n+\t\tout->args.table.attr.flow_attr.transfer = 1;\n+\t\treturn len;\n+\tdefault:\n+\t\treturn -1;\n+\t}\n+}\n+\n+/** Parse tokens for table destroy command. */\n+static int\n+parse_table_destroy(struct context *ctx, const struct token *token,\n+\t\t    const char *str, unsigned int len,\n+\t\t    void *buf, unsigned int size)\n+{\n+\tstruct buffer *out = buf;\n+\tuint32_t *table_id;\n+\n+\t/* Token name must match. */\n+\tif (parse_default(ctx, token, str, len, NULL, 0) < 0)\n+\t\treturn -1;\n+\t/* Nothing else to do if there is no buffer. */\n+\tif (!out)\n+\t\treturn len;\n+\tif (!out->command || out->command == TABLE) {\n+\t\tif (ctx->curr != TABLE_DESTROY)\n+\t\t\treturn -1;\n+\t\tif (sizeof(*out) > size)\n+\t\t\treturn -1;\n+\t\tout->command = ctx->curr;\n+\t\tctx->objdata = 0;\n+\t\tctx->object = out;\n+\t\tctx->objmask = NULL;\n+\t\tout->args.table_destroy.table_id =\n+\t\t\t(void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1),\n+\t\t\t\t\t       sizeof(double));\n+\t\treturn len;\n+\t}\n+\ttable_id = out->args.table_destroy.table_id\n+\t\t    + out->args.table_destroy.table_id_n++;\n+\tif ((uint8_t *)table_id > (uint8_t *)out + size)\n+\t\treturn -1;\n+\tctx->objdata = 0;\n+\tctx->object = table_id;\n+\tctx->objmask = NULL;\n+\treturn len;\n+}\n+\n static int\n parse_flex(struct context *ctx, const struct token *token,\n \t     const char *str, unsigned int len,\n@@ -8918,6 +9198,30 @@ comp_actions_template_id(struct context *ctx, const struct token *token,\n \treturn i;\n }\n \n+/** Complete available table IDs. */\n+static int\n+comp_table_id(struct context *ctx, const struct token *token,\n+\t      unsigned int ent, char *buf, unsigned int size)\n+{\n+\tunsigned int i = 0;\n+\tstruct rte_port *port;\n+\tstruct port_table *pt;\n+\n+\t(void)token;\n+\tif (port_id_is_invalid(ctx->port, DISABLED_WARN) ||\n+\t    ctx->port == (portid_t)RTE_PORT_ALL)\n+\t\treturn -1;\n+\tport = &ports[ctx->port];\n+\tfor (pt = port->table_list; pt != NULL; pt = pt->next) {\n+\t\tif (buf && i == ent)\n+\t\t\treturn snprintf(buf, size, \"%u\", pt->id);\n+\t\t++i;\n+\t}\n+\tif (buf)\n+\t\treturn -1;\n+\treturn i;\n+}\n+\n /** Internal context. */\n static struct context cmd_flow_context;\n \n@@ -9204,6 +9508,17 @@ cmd_flow_parsed(const struct buffer *in)\n \t\t\t\tin->args.templ_destroy.template_id_n,\n \t\t\t\tin->args.templ_destroy.template_id);\n \t\tbreak;\n+\tcase TABLE_CREATE:\n+\t\tport_flow_template_table_create(in->port, in->args.table.id,\n+\t\t\t&in->args.table.attr, in->args.table.pat_templ_id_n,\n+\t\t\tin->args.table.pat_templ_id, in->args.table.act_templ_id_n,\n+\t\t\tin->args.table.act_templ_id);\n+\t\tbreak;\n+\tcase TABLE_DESTROY:\n+\t\tport_flow_template_table_destroy(in->port,\n+\t\t\t\t\tin->args.table_destroy.table_id_n,\n+\t\t\t\t\tin->args.table_destroy.table_id);\n+\t\tbreak;\n \tcase INDIRECT_ACTION_CREATE:\n \t\tport_action_handle_create(\n \t\t\t\tin->port, in->args.vc.attr.group,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 2ef7c3e07a..316c16901a 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -1652,6 +1652,49 @@ template_alloc(uint32_t id, struct port_template **template,\n \treturn 0;\n }\n \n+static int\n+table_alloc(uint32_t id, struct port_table **table,\n+\t    struct port_table **list)\n+{\n+\tstruct port_table *lst = *list;\n+\tstruct port_table **ppt;\n+\tstruct port_table *pt = NULL;\n+\n+\t*table = NULL;\n+\tif (id == UINT32_MAX) {\n+\t\t/* taking first available ID */\n+\t\tif (lst) {\n+\t\t\tif (lst->id == UINT32_MAX - 1) {\n+\t\t\t\tprintf(\"Highest table ID is already\"\n+\t\t\t\t\" assigned, delete it first\\n\");\n+\t\t\t\treturn -ENOMEM;\n+\t\t\t}\n+\t\t\tid = lst->id + 1;\n+\t\t} else {\n+\t\t\tid = 0;\n+\t\t}\n+\t}\n+\tpt = calloc(1, sizeof(*pt));\n+\tif (!pt) {\n+\t\tprintf(\"Allocation of table failed\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\tppt = list;\n+\twhile (*ppt && (*ppt)->id > id)\n+\t\tppt = &(*ppt)->next;\n+\tif (*ppt && (*ppt)->id == id) {\n+\t\tprintf(\"Table #%u is already assigned,\"\n+\t\t\t\" delete it first\\n\", id);\n+\t\tfree(pt);\n+\t\treturn -EINVAL;\n+\t}\n+\tpt->next = *ppt;\n+\tpt->id = id;\n+\t*ppt = pt;\n+\t*table = pt;\n+\treturn 0;\n+}\n+\n /** Get info about flow management resources. */\n int\n port_flow_get_info(portid_t port_id)\n@@ -2281,6 +2324,134 @@ port_flow_actions_template_destroy(portid_t port_id, uint32_t n,\n \treturn ret;\n }\n \n+/** Create table */\n+int\n+port_flow_template_table_create(portid_t port_id, uint32_t id,\n+\t\tconst struct rte_flow_template_table_attr *table_attr,\n+\t\tuint32_t nb_pattern_templates, uint32_t *pattern_templates,\n+\t\tuint32_t nb_actions_templates, uint32_t *actions_templates)\n+{\n+\tstruct rte_port *port;\n+\tstruct port_table *pt;\n+\tstruct port_template *temp = NULL;\n+\tint ret;\n+\tuint32_t i;\n+\tstruct rte_flow_error error;\n+\tstruct rte_flow_pattern_template\n+\t\t\t*flow_pattern_templates[nb_pattern_templates];\n+\tstruct rte_flow_actions_template\n+\t\t\t*flow_actions_templates[nb_actions_templates];\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN) ||\n+\t    port_id == (portid_t)RTE_PORT_ALL)\n+\t\treturn -EINVAL;\n+\tport = &ports[port_id];\n+\tfor (i = 0; i < nb_pattern_templates; ++i) {\n+\t\tbool found = false;\n+\t\ttemp = port->pattern_templ_list;\n+\t\twhile (temp) {\n+\t\t\tif (pattern_templates[i] == temp->id) {\n+\t\t\t\tflow_pattern_templates[i] =\n+\t\t\t\t\ttemp->template.pattern_template;\n+\t\t\t\tfound = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\ttemp = temp->next;\n+\t\t}\n+\t\tif (!found) {\n+\t\t\tprintf(\"Pattern template #%u is invalid\\n\",\n+\t\t\t       pattern_templates[i]);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\tfor (i = 0; i < nb_actions_templates; ++i) {\n+\t\tbool found = false;\n+\t\ttemp = port->actions_templ_list;\n+\t\twhile (temp) {\n+\t\t\tif (actions_templates[i] == temp->id) {\n+\t\t\t\tflow_actions_templates[i] =\n+\t\t\t\t\ttemp->template.actions_template;\n+\t\t\t\tfound = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\ttemp = temp->next;\n+\t\t}\n+\t\tif (!found) {\n+\t\t\tprintf(\"Actions template #%u is invalid\\n\",\n+\t\t\t       actions_templates[i]);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\tret = table_alloc(id, &pt, &port->table_list);\n+\tif (ret)\n+\t\treturn ret;\n+\t/* Poisoning to make sure PMDs update it in case of error. */\n+\tmemset(&error, 0x22, sizeof(error));\n+\tpt->table = rte_flow_template_table_create(port_id, table_attr,\n+\t\t      flow_pattern_templates, nb_pattern_templates,\n+\t\t      flow_actions_templates, nb_actions_templates,\n+\t\t      &error);\n+\n+\tif (!pt->table) {\n+\t\tuint32_t destroy_id = pt->id;\n+\t\tport_flow_template_table_destroy(port_id, 1, &destroy_id);\n+\t\treturn port_flow_complain(&error);\n+\t}\n+\tpt->nb_pattern_templates = nb_pattern_templates;\n+\tpt->nb_actions_templates = nb_actions_templates;\n+\tprintf(\"Template table #%u created\\n\", pt->id);\n+\treturn 0;\n+}\n+\n+/** Destroy table */\n+int\n+port_flow_template_table_destroy(portid_t port_id,\n+\t\t\t\t uint32_t n, const uint32_t *table)\n+{\n+\tstruct rte_port *port;\n+\tstruct port_table **tmp;\n+\tuint32_t c = 0;\n+\tint ret = 0;\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN) ||\n+\t    port_id == (portid_t)RTE_PORT_ALL)\n+\t\treturn -EINVAL;\n+\tport = &ports[port_id];\n+\ttmp = &port->table_list;\n+\twhile (*tmp) {\n+\t\tuint32_t i;\n+\n+\t\tfor (i = 0; i != n; ++i) {\n+\t\t\tstruct rte_flow_error error;\n+\t\t\tstruct port_table *pt = *tmp;\n+\n+\t\t\tif (table[i] != pt->id)\n+\t\t\t\tcontinue;\n+\t\t\t/*\n+\t\t\t * Poisoning to make sure PMDs update it in case\n+\t\t\t * of error.\n+\t\t\t */\n+\t\t\tmemset(&error, 0x33, sizeof(error));\n+\n+\t\t\tif (pt->table &&\n+\t\t\t    rte_flow_template_table_destroy(port_id,\n+\t\t\t\t\t\t\t    pt->table,\n+\t\t\t\t\t\t\t    &error)) {\n+\t\t\t\tret = port_flow_complain(&error);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t*tmp = pt->next;\n+\t\t\tprintf(\"Template table #%u destroyed\\n\", pt->id);\n+\t\t\tfree(pt);\n+\t\t\tbreak;\n+\t\t}\n+\t\tif (i == n)\n+\t\t\ttmp = &(*tmp)->next;\n+\t\t++c;\n+\t}\n+\treturn ret;\n+}\n+\n /** Create flow rule. */\n int\n port_flow_create(portid_t port_id,\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex c70b1fa4e8..4c6e775bad 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -177,6 +177,16 @@ struct port_template {\n \t} template; /**< PMD opaque template object */\n };\n \n+/** Descriptor for a flow table. */\n+struct port_table {\n+\tstruct port_table *next; /**< Next table in list. */\n+\tstruct port_table *tmp; /**< Temporary linking. */\n+\tuint32_t id; /**< Table ID. */\n+\tuint32_t nb_pattern_templates; /**< Number of pattern templates. */\n+\tuint32_t nb_actions_templates; /**< Number of actions templates. */\n+\tstruct rte_flow_template_table *table; /**< PMD opaque template object */\n+};\n+\n /** Descriptor for a single flow. */\n struct port_flow {\n \tstruct port_flow *next; /**< Next flow in list. */\n@@ -259,6 +269,7 @@ struct rte_port {\n \tuint8_t                 slave_flag; /**< bonding slave port */\n \tstruct port_template    *pattern_templ_list; /**< Pattern templates. */\n \tstruct port_template    *actions_templ_list; /**< Actions templates. */\n+\tstruct port_table       *table_list; /**< Flow tables. */\n \tstruct port_flow        *flow_list; /**< Associated flows. */\n \tstruct port_indirect_action *actions_list;\n \t/**< Associated indirect actions. */\n@@ -915,6 +926,12 @@ int port_flow_actions_template_create(portid_t port_id, uint32_t id,\n \t\t\t\t      const struct rte_flow_action *masks);\n int port_flow_actions_template_destroy(portid_t port_id, uint32_t n,\n \t\t\t\t       const uint32_t *template);\n+int port_flow_template_table_create(portid_t port_id, uint32_t id,\n+\t\t   const struct rte_flow_template_table_attr *table_attr,\n+\t\t   uint32_t nb_pattern_templates, uint32_t *pattern_templates,\n+\t\t   uint32_t nb_actions_templates, uint32_t *actions_templates);\n+int port_flow_template_table_destroy(portid_t port_id,\n+\t\t\t    uint32_t n, const uint32_t *table);\n int port_flow_validate(portid_t port_id,\n \t\t       const struct rte_flow_attr *attr,\n \t\t       const struct rte_flow_item *pattern,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex acb763bdf0..16b874250c 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3362,6 +3362,19 @@ following sections.\n \n    flow actions_template {port_id} destroy actions_template {id} [...]\n \n+- Create a table::\n+\n+   flow table {port_id} create\n+       [table_id {id}]\n+       [group {group_id}] [priority {level}] [ingress] [egress] [transfer]\n+       rules_number {number}\n+       pattern_template {pattern_template_id}\n+       actions_template {actions_template_id}\n+\n+- Destroy a table::\n+\n+   flow table {port_id} destroy table {id} [...]\n+\n - Check whether a flow rule can be created::\n \n    flow validate {port_id}\n@@ -3544,6 +3557,46 @@ The usual error message is shown when an actions template cannot be destroyed::\n \n    Caught error type [...] ([...]): [...]\n \n+Creating template table\n+~~~~~~~~~~~~~~~~~~~~~~~\n+\n+``flow template_table create`` creates the specified template table.\n+It is bound to ``rte_flow_template_table_create()``::\n+\n+   flow template_table {port_id} create\n+       [table_id {id}] [group {group_id}]\n+       [priority {level}] [ingress] [egress] [transfer]\n+       rules_number {number}\n+       pattern_template {pattern_template_id}\n+       actions_template {actions_template_id}\n+\n+If successful, it will show::\n+\n+   Template table #[...] created\n+\n+Otherwise it will show an error message of the form::\n+\n+   Caught error type [...] ([...]): [...]\n+\n+Destroying flow table\n+~~~~~~~~~~~~~~~~~~~~~\n+\n+``flow template_table destroy`` destroys one or more template tables\n+from their table ID (as returned by ``flow template_table create``),\n+this command calls ``rte_flow_template_table_destroy()`` as many\n+times as necessary::\n+\n+   flow template_table {port_id} destroy table {id} [...]\n+\n+If successful, it will show::\n+\n+   Template table #[...] destroyed\n+\n+It does not report anything for table IDs that do not exist.\n+The usual error message is shown when a table cannot be destroyed::\n+\n+   Caught error type [...] ([...]): [...]\n+\n Creating a tunnel stub for offload\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \n",
    "prefixes": [
        "v4",
        "06/10"
    ]
}