get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105995,
    "url": "http://patchwork.dpdk.org/api/patches/105995/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220118050802.3915187-7-akozyrev@nvidia.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20220118050802.3915187-7-akozyrev@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220118050802.3915187-7-akozyrev@nvidia.com",
    "date": "2022-01-18T05:07:58",
    "name": "[06/10] app/testpmd: implement rte flow table",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2f35f4413cdd53c9e71ff417b5b2ab68f0a605f4",
    "submitter": {
        "id": 1873,
        "url": "http://patchwork.dpdk.org/api/people/1873/?format=api",
        "name": "Alexander Kozyrev",
        "email": "akozyrev@nvidia.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220118050802.3915187-7-akozyrev@nvidia.com/mbox/",
    "series": [
        {
            "id": 21222,
            "url": "http://patchwork.dpdk.org/api/series/21222/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=21222",
            "date": "2022-01-18T05:02:11",
            "name": "ethdev: datapath-focused flow rules management",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/21222/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/105995/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/105995/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 CFDA4A00C3;\n\tTue, 18 Jan 2022 06:09:13 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BCD3B426E1;\n\tTue, 18 Jan 2022 06:09:13 +0100 (CET)",
            "from NAM11-CO1-obe.outbound.protection.outlook.com\n (mail-co1nam11on2061.outbound.protection.outlook.com [40.107.220.61])\n by mails.dpdk.org (Postfix) with ESMTP id 450524067E\n for <dev@dpdk.org>; Tue, 18 Jan 2022 06:09:12 +0100 (CET)",
            "from BN8PR12MB2916.namprd12.prod.outlook.com (2603:10b6:408:6a::27)\n by CY4PR12MB1861.namprd12.prod.outlook.com (2603:10b6:903:11e::23)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Tue, 18 Jan\n 2022 05:09:09 +0000",
            "from DM5PR16CA0004.namprd16.prod.outlook.com (2603:10b6:3:c0::14) by\n BN8PR12MB2916.namprd12.prod.outlook.com (2603:10b6:408:6a::27) with\n Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.4888.12; Tue, 18 Jan 2022 05:09:08 +0000",
            "from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com\n (2603:10b6:3:c0:cafe::fb) by DM5PR16CA0004.outlook.office365.com\n (2603:10b6:3:c0::14) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9 via Frontend\n Transport; Tue, 18 Jan 2022 05:09:08 +0000",
            "from mail.nvidia.com (12.22.5.234) by\n DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4888.9 via Frontend Transport; Tue, 18 Jan 2022 05:09:07 +0000",
            "from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com\n (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Tue, 18 Jan 2022 05:09:07 +0000",
            "from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com\n (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Mon, 17 Jan 2022\n 21:09:04 -0800"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=c1ckEGggfUQC4iHw7kz+cyuaFapBh+V2Accx8wxPwMlBrwu3SLSBq7CDvT38nLj4HYaCh9Ss06sWk5ysi4Dw1wxRjnhEjyHXk+VqLk9hkdKCbkomFCxEEm/4dOaLAmCpxqY35Oik3Vax+juqle2evzGlvCSSw7IO39ekLTC/PEiSSt6NbZIItJDvkssuLxxMU99aOxyA0ZaLIqNp7+EORnHoAFXY95Cgshtb1p9frYQRVAxLLw71j62qZOgPHmo0+Xu0fwjQKNzSHQpbO1NM4PjdmUL33+VyCsqWYU0DhWztcrcJ44F/s+KhP87VMwyCy7kG4aCascMmOF1c2ET9aA==",
        "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=HEJFW/CJbrHu63nLaTb4wpYNYP1ZTksevilSaOQxkb4=;\n b=f2frxfHX53Py/OG1V9L31cukvaDvbpDU70nJGNSlpzwgjjfj1/ZftT/GKn/m3j/P15Ksy5Zq6pEeg0JCfJ1XmrJH9H7Nx9FxEjof4FWXwIgbFcbTmLBxgbJrkDXOLfWchAYE3VcWSWAVnvXVTaPENkObcVdOVgkmakxpFZ9jE+habR8khstin8Q/DTxEG/c66eMUNT5jhQQUpwZu3XBPUz/H0+Hfx5G7cmaqOFy1hAq87tJUaNrRnJMGapnI7ENWCFJHDurcDmxc+JjgsnexFnUm7qkKjDfp7oczsJTI3cXsqgvM9yyLYWBxmZliBSadDKIEZLYUyQxjvGoOhknGMA==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 12.22.5.234) 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=HEJFW/CJbrHu63nLaTb4wpYNYP1ZTksevilSaOQxkb4=;\n b=IEOqGYSreJAKam5tqiNLenXVB9OlzohV1X3r5CgeTgfnJEkDqP6GMbJCCv0kr57pnEJnf3AL+xvySoZ/qoR8Trz3XVQZrKdCmimIwoS5MNaWG6pD2WL5xU7/OEt5y41QbK1LQW/vaddU8hacGtubfLZzclhWTVOmkzecAqID+JsJqIH7XYOUFYjOoX/FVNSBNYbCcnLccj74bNO0++pzRdOQu685XOZyLKHBHgD2wj2t+G64JhoBDjnuL/4w0ORU9+A125oclNT/lMk2Pr54EB9X9d6AC46f71pr/YUTNlDFsN5EXv6JqtCMAyrUhAUXEVTIpci2oN+nEaE2AGc39A==",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 12.22.5.234)\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.234 as permitted sender) receiver=protection.outlook.com;\n client-ip=12.22.5.234; 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>",
        "Subject": "[PATCH 06/10] app/testpmd: implement rte flow table",
        "Date": "Tue, 18 Jan 2022 07:07:58 +0200",
        "Message-ID": "<20220118050802.3915187-7-akozyrev@nvidia.com>",
        "X-Mailer": "git-send-email 2.18.2",
        "In-Reply-To": "<20220118050802.3915187-6-akozyrev@nvidia.com>",
        "References": "<20220118050802.3915187-6-akozyrev@nvidia.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.126.230.35]",
        "X-ClientProxiedBy": "HQMAIL107.nvidia.com (172.20.187.13) To\n rnnvmail201.nvidia.com (10.129.68.8)",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "3f5c1fc3-5d78-460d-47d7-08d9da40a7ec",
        "X-MS-TrafficTypeDiagnostic": "BN8PR12MB2916:EE_|CY4PR12MB1861:EE_",
        "X-LD-Processed": "43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "\n <BN8PR12MB2916CB828A8F5A476DCF58ADAF589@BN8PR12MB2916.namprd12.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:6430;",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n TO12FQJLsOxDALW8d33gL8tiEtB3+x2QCM/et/pRIoIThC0tmTu8OPgNNG4bv2EmkbUmSounCI0FBFu83sT+ox+aq3FKTXZNg9QmGFtEL3kinCJmhIkAY3eEfFTEoJ0QOrDeaONAQE/OxuWyi7u7cbm2nM2Enyh9YFI++1acnQ1tomZY4aqPLG1YEBHR1hX60ma9WK96kV3acudqYOgsWhffDfElb71qu4YsnWsWr1Abf2fQy3XsuY8zTOL42AVidMS18vw66WXZqA71JLGyQ8r17kD9jNngIWe6PL2zUJKxYohpiuBzxQw5Nxk1gBg8O+ehpFuoAInk8umJdeVCQF3AueLDwcBrJqMZK24FK9cBHtN39gy2kwUd+9Yg2a8ImV+cCubaYHF+ey3MNg8/w3gMCM/DXDpYKED5j7SIx5ocKq8tbFWFbkkmVxxpIOcAIYMsRT5OjdHW6sXrogA+4o3ZsWLMr06NoeO/aHKKUyKrej84RIAMdr64GxyGsgMrSD4SVVwkf5qY5ZaHbwAzTlUY+iWLREgpETRjsmGNQgASJfa2m/Z65KHPpiRHtDf+r4rqckvaqW2DjgnbIYL/ZlB7lkZVkpqQm5HL3iHFmreFKAICpDPKXBtgfCGOUQNn2wY6Kk28VEs5amwEivRoxEVhFIpHC6l5M07MliwOp93oQAYiC4EzcEG4ITL6V5c8LipMSlS5OC50oTzooH60I0exgipalQyWgudYW/C4WHZnO15TM0pUtDTUNlAojXE53HBpRsqWwY3q8vP7kOj7moqQSZ7A5EIoigb6O7N74Kk=",
        "X-Forefront-Antispam-Report": "CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE;\n SFS:(4636009)(40470700002)(46966006)(36840700001)(82310400004)(426003)(6666004)(86362001)(356005)(83380400001)(1076003)(5660300002)(55016003)(8676002)(8936002)(316002)(2616005)(81166007)(7696005)(30864003)(70586007)(508600001)(40460700001)(2906002)(6286002)(36756003)(36860700001)(47076005)(26005)(4326008)(6916009)(186003)(54906003)(70206006)(336012)(16526019)(36900700001);\n DIR:OUT; SFP:1101;",
        "X-OriginatorOrg": "Nvidia.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Jan 2022 05:09:07.7646 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 3f5c1fc3-5d78-460d-47d7-08d9da40a7ec",
        "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.234];\n Helo=[mail.nvidia.com]",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n DM6NAM11FT024.eop-nam11.prod.protection.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR12MB1861",
        "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 table 0 create table_id 6\n    group 9 priority 4 ingress mode 1\n    rules_number 64 item_template 2 action_template 4\n  testpmd> flow table 0 destroy table 6\n\nSigned-off-by: Alexander Kozyrev <akozyrev@nvidia.com>\n---\n app/test-pmd/cmdline_flow.c                 | 315 ++++++++++++++++++++\n app/test-pmd/config.c                       | 168 +++++++++++\n app/test-pmd/testpmd.h                      |  15 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  53 ++++\n 4 files changed, 551 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex fb27a97855..4dc2a2aaeb 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_ITEM_TEMPLATE_ID,\n \tCOMMON_ACTION_TEMPLATE_ID,\n+\tCOMMON_TABLE_ID,\n \n \t/* TOP-level command. */\n \tADD,\n@@ -77,6 +78,7 @@ enum index {\n \tCONFIGURE,\n \tITEM_TEMPLATE,\n \tACTION_TEMPLATE,\n+\tTABLE,\n \tINDIRECT_ACTION,\n \tVALIDATE,\n \tCREATE,\n@@ -111,6 +113,20 @@ enum index {\n \tACTION_TEMPLATE_SPEC,\n \tACTION_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_ITEM_TEMPLATE,\n+\tTABLE_ACTION_TEMPLATE,\n+\n \t/* Tunnel arguments. */\n \tTUNNEL_CREATE,\n \tTUNNEL_CREATE_TYPE,\n@@ -882,6 +898,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_table_attr attr;\n+\t\t\tuint32_t *item_id;\n+\t\t\tuint32_t item_id_n;\n+\t\t\tuint32_t *action_id;\n+\t\t\tuint32_t action_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@@ -1013,6 +1041,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_ITEM_TEMPLATE,\n+\tTABLE_ACTION_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@@ -2057,6 +2111,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@@ -2130,6 +2189,8 @@ static int comp_item_template_id(struct context *, const struct token *,\n \t\t\t\t unsigned int, char *, unsigned int);\n static int comp_action_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@@ -2294,6 +2355,13 @@ static const struct token token_list[] = {\n \t\t.call = parse_int,\n \t\t.comp = comp_action_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@@ -2303,6 +2371,7 @@ static const struct token token_list[] = {\n \t\t\t     (CONFIGURE,\n \t\t\t      ITEM_TEMPLATE,\n \t\t\t      ACTION_TEMPLATE,\n+\t\t\t      TABLE,\n \t\t\t      INDIRECT_ACTION,\n \t\t\t      VALIDATE,\n \t\t\t      CREATE,\n@@ -2474,6 +2543,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 = \"table\",\n+\t\t.type = \"{command} {port_id} [{arg} [...]]\",\n+\t\t.help = \"manage 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 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 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_ITEM_TEMPLATE] = {\n+\t\t.name = \"item_template\",\n+\t\t.help = \"specify item template id\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_ITEM_TEMPLATE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY_PTR(struct buffer,\n+\t\t\t\t\t    args.table.item_id)),\n+\t\t.call = parse_table,\n+\t},\n+\t[TABLE_ACTION_TEMPLATE] = {\n+\t\t.name = \"action_template\",\n+\t\t.help = \"specify action template id\",\n+\t\t.next = NEXT(next_table_attr,\n+\t\t\t     NEXT_ENTRY(COMMON_ACTION_TEMPLATE_ID)),\n+\t\t.args = ARGS(ARGS_ENTRY_PTR(struct buffer,\n+\t\t\t\t\t    args.table.action_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@@ -7874,6 +8041,119 @@ parse_template_destroy(struct context *ctx, const struct token *token,\n \treturn len;\n }\n \n+/** Parse tokens for indirect action commands. */\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_ITEM_TEMPLATE:\n+\t\tout->args.table.item_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.item_id\n+\t\t\t\t+ out->args.table.item_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_ACTION_TEMPLATE:\n+\t\tout->args.table.action_id =\n+\t\t\t(void *)RTE_ALIGN_CEIL((uintptr_t)\n+\t\t\t\t\t       (out->args.table.item_id +\n+\t\t\t\t\t\tout->args.table.item_id_n),\n+\t\t\t\t\t       sizeof(double));\n+\t\ttemplate_id = out->args.table.action_id\n+\t\t\t\t+ out->args.table.action_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 indirect action 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@@ -8889,6 +9169,30 @@ comp_action_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@@ -9170,6 +9474,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_table_create(in->port, in->args.table.id,\n+\t\t\t&in->args.table.attr, in->args.table.item_id_n,\n+\t\t\tin->args.table.item_id, in->args.table.action_id_n,\n+\t\t\tin->args.table.action_id);\n+\t\tbreak;\n+\tcase TABLE_DESTROY:\n+\t\tport_flow_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 80678d851f..07582fa552 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -1638,6 +1638,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 /** Configure flow management resources. */\n int\n port_flow_configure(portid_t port_id,\n@@ -2243,6 +2286,131 @@ port_flow_action_template_destroy(portid_t port_id, uint32_t n,\n \treturn ret;\n }\n \n+/** Create table */\n+int\n+port_flow_table_create(portid_t port_id, uint32_t id,\n+\t\t       const struct rte_flow_table_attr *table_attr,\n+\t\t       uint32_t nb_item_templates, uint32_t *item_templates,\n+\t\t       uint32_t nb_action_templates, uint32_t *action_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_item_template\n+\t\t\t*flow_item_templates[nb_item_templates];\n+\tstruct rte_flow_action_template\n+\t\t\t*flow_action_templates[nb_action_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_item_templates; ++i) {\n+\t\tbool found = false;\n+\t\ttemp = port->item_templ_list;\n+\t\twhile (temp) {\n+\t\t\tif (item_templates[i] == temp->id) {\n+\t\t\t\tflow_item_templates[i] = temp->template.itempl;\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(\"Item template #%u is invalid\\n\",\n+\t\t\t       item_templates[i]);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\tfor (i = 0; i < nb_action_templates; ++i) {\n+\t\tbool found = false;\n+\t\ttemp = port->action_templ_list;\n+\t\twhile (temp) {\n+\t\t\tif (action_templates[i] == temp->id) {\n+\t\t\t\tflow_action_templates[i] =\n+\t\t\t\t\ttemp->template.atempl;\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(\"Action template #%u is invalid\\n\",\n+\t\t\t       action_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_table_create(port_id, table_attr,\n+\t\t      flow_item_templates, nb_item_templates,\n+\t\t      flow_action_templates, nb_action_templates,\n+\t\t      &error);\n+\n+\tif (!pt->table) {\n+\t\tuint32_t destroy_id = pt->id;\n+\t\tport_flow_table_destroy(port_id, 1, &destroy_id);\n+\t\treturn port_flow_complain(&error);\n+\t}\n+\tprintf(\"Table #%u created\\n\", pt->id);\n+\treturn 0;\n+}\n+\n+/** Destroy table */\n+int\n+port_flow_table_destroy(portid_t port_id,\n+\t\t\tuint32_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_table_destroy(port_id,\n+\t\t\t\t\t\t   pt->table,\n+\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(\"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 4befa6d7a4..b8655b9987 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -177,6 +177,14 @@ 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+\tstruct rte_flow_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 +267,7 @@ struct rte_port {\n \tuint8_t                 slave_flag; /**< bonding slave port */\n \tstruct port_template    *item_templ_list; /**< Item templates. */\n \tstruct port_template    *action_templ_list; /**< Action 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@@ -912,6 +921,12 @@ int port_flow_action_template_create(portid_t port_id, uint32_t id,\n \t\t\t\t     const struct rte_flow_action *masks);\n int port_flow_action_template_destroy(portid_t port_id, uint32_t n,\n \t\t\t\t      const uint32_t *template);\n+int port_flow_table_create(portid_t port_id, uint32_t id,\n+\t\t   const struct rte_flow_table_attr *table_attr,\n+\t\t   uint32_t nb_item_templates, uint32_t *item_templates,\n+\t\t   uint32_t nb_action_templates, uint32_t *action_templates);\n+int port_flow_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 d23cfa6572..f8a87564be 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -3335,6 +3335,19 @@ following sections.\n \n    flow action_template {port_id} destroy action_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+       item_template {item_template_id}\n+       action_template {action_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@@ -3495,6 +3508,46 @@ The usual error message is shown when an item template cannot be destroyed::\n \n    Caught error type [...] ([...]): [...]\n \n+Creating flow table\n+~~~~~~~~~~~~~~~~~~~\n+\n+``flow table create`` creates the specified flow table.\n+It is bound to ``rte_flow_table_create()``::\n+\n+   flow table {port_id} create\n+       [table_id {id}] [group {group_id}]\n+\t   [priority {level}] [ingress] [egress] [transfer]\n+       rules_number {number}\n+       item_template {item_template_id}\n+       action_template {action_template_id}\n+\n+If successful, it will show::\n+\n+   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 table destroy`` destroys one or more flow tables\n+from their table ID (as returned by ``flow table create``),\n+this command calls ``rte_flow_table_destroy()`` as many\n+times as necessary::\n+\n+   flow table {port_id} destroy table {id} [...]\n+\n+If successful, it will show::\n+\n+   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": [
        "06/10"
    ]
}