get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52270,
    "url": "http://patches.dpdk.org/api/patches/52270/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1554371628-170844-3-git-send-email-orika@mellanox.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": "<1554371628-170844-3-git-send-email-orika@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1554371628-170844-3-git-send-email-orika@mellanox.com",
    "date": "2019-04-04T09:54:07",
    "name": "[v4,2/3] net/mlx5: add Direct Rules API",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a0b5f1927e0aeb2134214e7a5cb4d7b4bed1c456",
    "submitter": {
        "id": 795,
        "url": "http://patches.dpdk.org/api/people/795/?format=api",
        "name": "Ori Kam",
        "email": "orika@mellanox.com"
    },
    "delegate": {
        "id": 6624,
        "url": "http://patches.dpdk.org/api/users/6624/?format=api",
        "username": "shahafs",
        "first_name": "Shahaf",
        "last_name": "Shuler",
        "email": "shahafs@mellanox.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1554371628-170844-3-git-send-email-orika@mellanox.com/mbox/",
    "series": [
        {
            "id": 4110,
            "url": "http://patches.dpdk.org/api/series/4110/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4110",
            "date": "2019-04-04T09:54:05",
            "name": "net/mlx5: Add Direct Rule support",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/4110/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52270/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/52270/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 5A2021B120;\n\tThu,  4 Apr 2019 11:54:13 +0200 (CEST)",
            "from EUR04-HE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr70049.outbound.protection.outlook.com [40.107.7.49])\n\tby dpdk.org (Postfix) with ESMTP id 5AAA11B10C\n\tfor <dev@dpdk.org>; Thu,  4 Apr 2019 11:54:10 +0200 (CEST)",
            "from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by\n\tAM4PR05MB3282.eurprd05.prod.outlook.com (10.171.187.159) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1750.19; Thu, 4 Apr 2019 09:54:07 +0000",
            "from AM4PR05MB3425.eurprd05.prod.outlook.com\n\t([fe80::5df0:22de:97f0:3827]) by\n\tAM4PR05MB3425.eurprd05.prod.outlook.com\n\t([fe80::5df0:22de:97f0:3827%4]) with mapi id 15.20.1771.014;\n\tThu, 4 Apr 2019 09:54:07 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=IzUgarIxJJdK0noIyAbFbgknc3PfpTp8yP6k5mrjvK4=;\n\tb=doqrve5bErY6y6g/3kzRdMFFIaj8pjqxmKrXuyT+aJd5/PxybtbEhOkmervzWzO/Lp756agFrNnBzsd1LAYtGg1tJ/lhzLYF7H49WKxAASyIX9kbUuhLjoCS9F/RhLJ/vkiYih9HBz7bn8AQzCCZhqOAfn2esOTGDvqzSUlCJk4=",
        "From": "Ori Kam <orika@mellanox.com>",
        "To": "Matan Azrad <matan@mellanox.com>, Yongseok Koh <yskoh@mellanox.com>,\n\tShahaf Shuler <shahafs@mellanox.com>",
        "CC": "\"dev@dpdk.org\" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>, Slava\n\tOvsiienko <viacheslavo@mellanox.com>",
        "Thread-Topic": "[PATCH v4 2/3] net/mlx5: add Direct Rules API",
        "Thread-Index": "AQHU6sxY/0kUf/04f0Gf0SFatvgkXg==",
        "Date": "Thu, 4 Apr 2019 09:54:07 +0000",
        "Message-ID": "<1554371628-170844-3-git-send-email-orika@mellanox.com>",
        "References": "<1553790741-69362-1-git-send-email-orika@mellanox.com>\n\t<1554371628-170844-1-git-send-email-orika@mellanox.com>",
        "In-Reply-To": "<1554371628-170844-1-git-send-email-orika@mellanox.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "x-clientproxiedby": "LO2P265CA0363.GBRP265.PROD.OUTLOOK.COM\n\t(2603:10a6:600:a3::15) To AM4PR05MB3425.eurprd05.prod.outlook.com\n\t(2603:10a6:205:b::15)",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=orika@mellanox.com; ",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "x-mailer": "git-send-email 1.8.3.1",
        "x-originating-ip": "[37.142.13.130]",
        "x-ms-publictraffictype": "Email",
        "x-ms-office365-filtering-correlation-id": "11a6af96-a61c-4491-4c57-08d6b8e37a93",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020);\n\tSRVR:AM4PR05MB3282; ",
        "x-ms-traffictypediagnostic": "AM4PR05MB3282:",
        "x-microsoft-antispam-prvs": "<AM4PR05MB3282372D9B6A36F33FD6B20BDB500@AM4PR05MB3282.eurprd05.prod.outlook.com>",
        "x-forefront-prvs": "0997523C40",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(376002)(366004)(39860400002)(136003)(346002)(396003)(199004)(189003)(256004)(446003)(386003)(97736004)(102836004)(6506007)(6116002)(6436002)(8676002)(316002)(11346002)(53936002)(2906002)(81156014)(107886003)(478600001)(5660300002)(54906003)(81166006)(2616005)(53946003)(476003)(110136005)(6486002)(8936002)(6512007)(50226002)(76176011)(52116002)(14454004)(86362001)(36756003)(26005)(14444005)(486006)(71200400001)(4326008)(4720700003)(3846002)(186003)(66066001)(68736007)(25786009)(305945005)(106356001)(99286004)(6636002)(30864003)(105586002)(7736002)(71190400001)(559001)(579004);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3282;\n\tH:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; A:1; MX:1; ",
        "received-spf": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "x-ms-exchange-senderadcheck": "1",
        "x-microsoft-antispam-message-info": "zou5FQ1q8anvnfpHIbbjc5pgjVKR+TXEigIL8WnNz7RKLSlxhFGKNPqO+ZYZxtYM1ENAuEVmosqa/NGKRYHufE63ZYnY63SkC1uPCUUqSi/h6fKPk3feRnrVr2hjI2I0hFUyMmkumxFwavdN6gEcYxDDN4dVRzTTZVbnGsykkuJctTr9Oj6dSeDcyRSENUL2JdWVZKO9VkjVj72aa80tl/HUUPOYYMxsxvg+uGZzYXFqwn3rTpyW86QrGy65KtVN49aiciOdDhZULbs9xPHNTP+dh0qR+J9IH1V1XjZahmSeJtcMV8Y0Oc0Y7FrJoww3TaH1OemeEyYeS8ZhaJ4juECnHXTS9J/6DoElEEqiGkz1oscv4bS/Rr4DKXgMVGfQqMDr1xoaviIKFl8kGQvhzWGCfzKiYeYv7HPq9mPR/Oc=",
        "Content-Type": "text/plain; charset=\"iso-8859-1\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "11a6af96-a61c-4491-4c57-08d6b8e37a93",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "04 Apr 2019 09:54:07.7017\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM4PR05MB3282",
        "Subject": "[dpdk-dev] [PATCH v4 2/3] net/mlx5: add Direct Rules API",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Adds calls to the Direct Rules API inside the glue functions.\nDue to difference in parameters between the Direct Rules and Direct\nVerbs some of the glue functions API was updated.\n\nSigned-off-by: Ori Kam <orika@mellanox.com>\nAcked-by: Shahaf Shuler <shahafs@mellanox.com>\n---\n drivers/net/mlx5/Makefile       |   5 ++\n drivers/net/mlx5/mlx5.c         |  16 ++++\n drivers/net/mlx5/mlx5.h         |  15 ++++\n drivers/net/mlx5/mlx5_flow.c    |   1 +\n drivers/net/mlx5/mlx5_flow.h    |   6 +-\n drivers/net/mlx5/mlx5_flow_dv.c | 103 ++++++++++++++++++++----\n drivers/net/mlx5/mlx5_glue.c    | 170 ++++++++++++++++++++++++++++++++++------\n drivers/net/mlx5/mlx5_glue.h    |  31 +++++---\n drivers/net/mlx5/mlx5_prm.h     |  24 +++++-\n 9 files changed, 318 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile\nindex 0d20f0f..93bc869 100644\n--- a/drivers/net/mlx5/Makefile\n+++ b/drivers/net/mlx5/Makefile\n@@ -156,6 +156,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh\n \t\tfunc mlx5dv_create_flow_action_packet_reformat \\\n \t\t$(AUTOCONF_OUTPUT)\n \t$Q sh -- '$<' '$@' \\\n+\t\tHAVE_MLX5DV_DR \\\n+\t\tinfiniband/mlx5dv.h \\\n+\t\tenum MLX5DV_DR_NS_TYPE_TERMINATING \\\n+\t\t$(AUTOCONF_OUTPUT)\n+\t$Q sh -- '$<' '$@' \\\n \t\tHAVE_IBV_DEVX_OBJ \\\n \t\tinfiniband/mlx5dv.h \\\n \t\tfunc mlx5dv_devx_obj_create \\\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 4044505..65aa9cf 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1483,6 +1483,22 @@ struct mlx5_dev_spawn_data {\n \t\t\tpriv->tcf_context = NULL;\n \t\t}\n \t}\n+#ifdef HAVE_MLX5DV_DR\n+\t\tpriv->rx_ns = mlx5dv_dr_create_ns\n+\t\t\t(sh->ctx, MLX5DV_DR_NS_DOMAIN_INGRESS_BYPASS);\n+\t\tif (priv->rx_ns == NULL) {\n+\t\t\tDRV_LOG(ERR, \"mlx5dv_dr_create_ns failed\");\n+\t\t\terr = errno;\n+\t\t\tgoto error;\n+\t\t}\n+\t\tpriv->tx_ns = mlx5dv_dr_create_ns(sh->ctx,\n+\t\t\t\t\t MLX5DV_DR_NS_DOMAIN_EGRESS_BYPASS);\n+\t\tif (priv->tx_ns == NULL) {\n+\t\t\tDRV_LOG(ERR, \"mlx5dv_dr_create_ns failed\");\n+\t\t\terr = errno;\n+\t\t\tgoto error;\n+\t\t}\n+#endif\n \tTAILQ_INIT(&priv->flows);\n \tTAILQ_INIT(&priv->ctrl_flows);\n \t/* Hint libmlx5 to use PMD allocator for data plane resources */\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 784bf9b..d4963cb 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -259,6 +259,15 @@ struct mlx5_ibv_shared {\n \tstruct mlx5_ibv_shared_port port[]; /* per device port data array. */\n };\n \n+/* Table structure. */\n+struct mlx5_flow_tbl_resource {\n+\tvoid *obj; /**< Pointer to DR table object. */\n+\trte_atomic32_t refcnt; /**< Reference counter. */\n+};\n+\n+#define MLX5_MAX_TABLES 1024\n+#define MLX5_GROUP_FACTOR 1\n+\n struct mlx5_priv {\n \tLIST_ENTRY(mlx5_priv) mem_event_cb;\n \t/**< Called by memory event callback. */\n@@ -326,6 +335,12 @@ struct mlx5_priv {\n \t/* UAR same-page access control required in 32bit implementations. */\n #endif\n \tstruct mlx5_flow_tcf_context *tcf_context; /* TC flower context. */\n+\tvoid *rx_ns; /* RX Direct Rules name space handle. */\n+\tstruct mlx5_flow_tbl_resource rx_tbl[MLX5_MAX_TABLES];\n+\t/* RX Direct Rules tables. */\n+\tvoid *tx_ns; /* TX Direct Rules name space handle. */\n+\tstruct mlx5_flow_tbl_resource tx_tbl[MLX5_MAX_TABLES];\n+\t/* TX Direct Rules tables/ */\n };\n \n #define PORT_ID(priv) ((priv)->dev_data->port_id)\ndiff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c\nindex bc6a7c1..9dc492a 100644\n--- a/drivers/net/mlx5/mlx5_flow.c\n+++ b/drivers/net/mlx5/mlx5_flow.c\n@@ -2084,6 +2084,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,\n \t\tflow_size += RTE_ALIGN_CEIL(sizeof(uint16_t), sizeof(void *));\n \tflow = rte_calloc(__func__, 1, flow_size, 0);\n \tflow->drv_type = flow_get_drv_type(dev, attr);\n+\tflow->ingress = attr->ingress;\n \tassert(flow->drv_type > MLX5_FLOW_TYPE_MIN &&\n \t       flow->drv_type < MLX5_FLOW_TYPE_MAX);\n \tflow->queue = (void *)(flow + 1);\ndiff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h\nindex 4f69ae2..8ba37a0 100644\n--- a/drivers/net/mlx5/mlx5_flow.h\n+++ b/drivers/net/mlx5/mlx5_flow.h\n@@ -204,6 +204,7 @@ struct mlx5_flow_dv_matcher {\n \tuint16_t crc; /**< CRC of key. */\n \tuint16_t priority; /**< Priority of matcher. */\n \tuint8_t egress; /**< Egress matcher. */\n+\tuint32_t group; /**< The matcher group. */\n \tstruct mlx5_flow_dv_match_params mask; /**< Matcher mask. */\n };\n \n@@ -220,6 +221,7 @@ struct mlx5_flow_dv_encap_decap_resource {\n \tsize_t size;\n \tuint8_t reformat_type;\n \tuint8_t ft_type;\n+\tuint64_t flags; /**< Flags for RDMA API. */\n };\n \n /* Tag resource structure. */\n@@ -348,7 +350,7 @@ struct mlx5_flow_counter {\n /* Flow structure. */\n struct rte_flow {\n \tTAILQ_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */\n-\tenum mlx5_flow_drv_type drv_type; /**< Drvier type. */\n+\tenum mlx5_flow_drv_type drv_type; /**< Driver type. */\n \tstruct mlx5_flow_counter *counter; /**< Holds flow counter. */\n \tstruct mlx5_flow_dv_tag_resource *tag_resource;\n \t/**< pointer to the tag action. */\n@@ -360,6 +362,8 @@ struct rte_flow {\n \tuint64_t actions;\n \t/**< Bit-fields of detected actions, see MLX5_FLOW_ACTION_*. */\n \tstruct mlx5_fdir *fdir; /**< Pointer to associated FDIR if any. */\n+\tuint8_t ingress; /**< 1 if the flow is ingress. */\n+\tuint32_t group; /**< The group index. */\n };\n \n typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,\ndiff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c\nindex d9e2ac9..dd5b541 100644\n--- a/drivers/net/mlx5/mlx5_flow_dv.c\n+++ b/drivers/net/mlx5/mlx5_flow_dv.c\n@@ -809,11 +809,20 @@ struct field_modify_info modify_tcp[] = {\n {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_flow_dv_encap_decap_resource *cache_resource;\n+\tstruct rte_flow *flow = dev_flow->flow;\n+\tstruct mlx5dv_dr_ns *ns;\n+\n+\tresource->flags = flow->group ? 0 : 1;\n+\tif (flow->ingress)\n+\t\tns = priv->rx_ns;\n+\telse\n+\t\tns = priv->tx_ns;\n \n \t/* Lookup a matching resource from cache. */\n \tLIST_FOREACH(cache_resource, &priv->encaps_decaps, next) {\n \t\tif (resource->reformat_type == cache_resource->reformat_type &&\n \t\t    resource->ft_type == cache_resource->ft_type &&\n+\t\t    resource->flags == cache_resource->flags &&\n \t\t    resource->size == cache_resource->size &&\n \t\t    !memcmp((const void *)resource->buf,\n \t\t\t    (const void *)cache_resource->buf,\n@@ -835,10 +844,10 @@ struct field_modify_info modify_tcp[] = {\n \t*cache_resource = *resource;\n \tcache_resource->verbs_action =\n \t\tmlx5_glue->dv_create_flow_action_packet_reformat\n-\t\t\t(priv->sh->ctx, cache_resource->size,\n-\t\t\t (cache_resource->size ? cache_resource->buf : NULL),\n-\t\t\t cache_resource->reformat_type,\n-\t\t\t cache_resource->ft_type);\n+\t\t\t(priv->sh->ctx, cache_resource->reformat_type,\n+\t\t\t cache_resource->ft_type, ns, cache_resource->flags,\n+\t\t\t cache_resource->size,\n+\t\t\t (cache_resource->size ? cache_resource->buf : NULL));\n \tif (!cache_resource->verbs_action) {\n \t\trte_free(cache_resource);\n \t\treturn rte_flow_error_set(error, ENOMEM,\n@@ -1442,6 +1451,10 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tstruct mlx5_flow_dv_modify_hdr_resource *cache_resource;\n \n+\tstruct mlx5dv_dr_ns *ns =\n+\t\tresource->ft_type == MLX5DV_FLOW_TABLE_TYPE_NIC_TX  ?\n+\t\tpriv->tx_ns : priv->rx_ns;\n+\n \t/* Lookup a matching resource from cache. */\n \tLIST_FOREACH(cache_resource, &priv->modify_cmds, next) {\n \t\tif (resource->ft_type == cache_resource->ft_type &&\n@@ -1467,11 +1480,11 @@ struct field_modify_info modify_tcp[] = {\n \t*cache_resource = *resource;\n \tcache_resource->verbs_action =\n \t\tmlx5_glue->dv_create_flow_action_modify_header\n-\t\t\t\t\t(priv->sh->ctx,\n+\t\t\t\t\t(priv->sh->ctx, cache_resource->ft_type,\n+\t\t\t\t\t ns, 0,\n \t\t\t\t\t cache_resource->actions_num *\n \t\t\t\t\t sizeof(cache_resource->actions[0]),\n-\t\t\t\t\t (uint64_t *)cache_resource->actions,\n-\t\t\t\t\t cache_resource->ft_type);\n+\t\t\t\t\t (uint64_t *)cache_resource->actions);\n \tif (!cache_resource->verbs_action) {\n \t\trte_free(cache_resource);\n \t\treturn rte_flow_error_set(error, ENOMEM,\n@@ -1596,11 +1609,13 @@ struct field_modify_info modify_tcp[] = {\n \tstruct mlx5_priv *priv = dev->data->dev_private;\n \tuint32_t priority_max = priv->config.flow_prio - 1;\n \n+#ifdef HAVE_MLX5DV_DR\n \tif (attributes->group)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_ATTR_GROUP,\n \t\t\t\t\t  NULL,\n \t\t\t\t\t  \"groups is not supported\");\n+#endif\n \tif (attributes->priority != MLX5_FLOW_PRIO_RSVD &&\n \t    attributes->priority >= priority_max)\n \t\treturn rte_flow_error_set(error, ENOTSUP,\n@@ -2173,11 +2188,13 @@ struct field_modify_info modify_tcp[] = {\n  *   Flow pattern to translate.\n  * @param[in] inner\n  *   Item is inner pattern.\n+ * @param[in] group\n+ *   The group to insert the rule.\n  */\n static void\n flow_dv_translate_item_ipv4(void *matcher, void *key,\n \t\t\t    const struct rte_flow_item *item,\n-\t\t\t    int inner)\n+\t\t\t    int inner, uint32_t group)\n {\n \tconst struct rte_flow_item_ipv4 *ipv4_m = item->mask;\n \tconst struct rte_flow_item_ipv4 *ipv4_v = item->spec;\n@@ -2204,7 +2221,10 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t outer_headers);\n \t\theaders_v = MLX5_ADDR_OF(fte_match_param, key, outer_headers);\n \t}\n-\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0xf);\n+\tif (group == 0)\n+\t\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0xf);\n+\telse\n+\t\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0x4);\n \tMLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 4);\n \tif (!ipv4_v)\n \t\treturn;\n@@ -2246,11 +2266,13 @@ struct field_modify_info modify_tcp[] = {\n  *   Flow pattern to translate.\n  * @param[in] inner\n  *   Item is inner pattern.\n+ * @param[in] group\n+ *   The group to insert the rule.\n  */\n static void\n flow_dv_translate_item_ipv6(void *matcher, void *key,\n \t\t\t    const struct rte_flow_item *item,\n-\t\t\t    int inner)\n+\t\t\t    int inner, uint32_t group)\n {\n \tconst struct rte_flow_item_ipv6 *ipv6_m = item->mask;\n \tconst struct rte_flow_item_ipv6 *ipv6_v = item->spec;\n@@ -2287,7 +2309,10 @@ struct field_modify_info modify_tcp[] = {\n \t\t\t\t\t outer_headers);\n \t\theaders_v = MLX5_ADDR_OF(fte_match_param, key, outer_headers);\n \t}\n-\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0xf);\n+\tif (group == 0)\n+\t\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0xf);\n+\telse\n+\t\tMLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, 0x6);\n \tMLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 6);\n \tif (!ipv6_v)\n \t\treturn;\n@@ -2727,7 +2752,11 @@ struct field_modify_info modify_tcp[] = {\n \tmatch_criteria_enable |=\n \t\t(!HEADER_IS_ZERO(match_criteria, misc_parameters_2)) <<\n \t\tMLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT;\n-\n+#ifdef HAVE_MLX5DV_DR\n+\tmatch_criteria_enable |=\n+\t\t(!HEADER_IS_ZERO(match_criteria, misc_parameters_3)) <<\n+\t\tMLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT;\n+#endif\n \treturn match_criteria_enable;\n }\n \n@@ -2758,12 +2787,14 @@ struct field_modify_info modify_tcp[] = {\n \t\t.type = IBV_FLOW_ATTR_NORMAL,\n \t\t.match_mask = (void *)&matcher->mask,\n \t};\n+\tstruct mlx5_flow_tbl_resource *tbl = NULL;\n \n \t/* Lookup from cache. */\n \tLIST_FOREACH(cache_matcher, &priv->matchers, next) {\n \t\tif (matcher->crc == cache_matcher->crc &&\n \t\t    matcher->priority == cache_matcher->priority &&\n \t\t    matcher->egress == cache_matcher->egress &&\n+\t\t    matcher->group == cache_matcher->group &&\n \t\t    !memcmp((const void *)matcher->mask.buf,\n \t\t\t    (const void *)cache_matcher->mask.buf,\n \t\t\t    cache_matcher->mask.size)) {\n@@ -2778,6 +2809,27 @@ struct field_modify_info modify_tcp[] = {\n \t\t\treturn 0;\n \t\t}\n \t}\n+#ifdef HAVE_MLX5DV_DR\n+\tif (matcher->egress) {\n+\t\ttbl = &priv->tx_tbl[matcher->group];\n+\t\tif (!tbl->obj)\n+\t\t\ttbl->obj = mlx5_glue->dr_create_flow_tbl\n+\t\t\t\t(priv->tx_ns,\n+\t\t\t\t matcher->group * MLX5_GROUP_FACTOR);\n+\t} else {\n+\t\ttbl = &priv->rx_tbl[matcher->group];\n+\t\tif (!tbl->obj)\n+\t\t\ttbl->obj = mlx5_glue->dr_create_flow_tbl\n+\t\t\t\t(priv->rx_ns,\n+\t\t\t\t matcher->group * MLX5_GROUP_FACTOR);\n+\t}\n+\tif (!tbl->obj)\n+\t\treturn rte_flow_error_set(error, ENOMEM,\n+\t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\t\t  NULL, \"cannot create table\");\n+\n+\trte_atomic32_inc(&tbl->refcnt);\n+#endif\n \t/* Register new matcher. */\n \tcache_matcher = rte_calloc(__func__, 1, sizeof(*cache_matcher), 0);\n \tif (!cache_matcher)\n@@ -2791,9 +2843,16 @@ struct field_modify_info modify_tcp[] = {\n \tif (matcher->egress)\n \t\tdv_attr.flags |= IBV_FLOW_ATTR_FLAGS_EGRESS;\n \tcache_matcher->matcher_object =\n-\t\tmlx5_glue->dv_create_flow_matcher(priv->sh->ctx, &dv_attr);\n+\t\tmlx5_glue->dv_create_flow_matcher(priv->sh->ctx, &dv_attr,\n+\t\t\t\t\t\t  tbl->obj);\n \tif (!cache_matcher->matcher_object) {\n \t\trte_free(cache_matcher);\n+#ifdef HAVE_MLX5DV_DR\n+\t\tif (rte_atomic32_dec_and_test(&tbl->refcnt)) {\n+\t\t\tmlx5_glue->dr_destroy_flow_tbl(tbl->obj);\n+\t\t\ttbl->obj = NULL;\n+\t\t}\n+#endif\n \t\treturn rte_flow_error_set(error, ENOMEM,\n \t\t\t\t\t  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n \t\t\t\t\t  NULL, \"cannot create matcher\");\n@@ -2805,6 +2864,7 @@ struct field_modify_info modify_tcp[] = {\n \t\tcache_matcher->priority,\n \t\tcache_matcher->egress ? \"tx\" : \"rx\", (void *)cache_matcher,\n \t\trte_atomic32_read(&cache_matcher->refcnt));\n+\trte_atomic32_inc(&tbl->refcnt);\n \treturn 0;\n }\n \n@@ -3226,7 +3286,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n \t\t\tflow_dv_translate_item_ipv4(match_mask, match_value,\n-\t\t\t\t\t\t    items, tunnel);\n+\t\t\t\t\t\t    items, tunnel, attr->group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n \t\t\tdev_flow->dv.hash_fields |=\n \t\t\t\tmlx5_flow_hashfields_adjust\n@@ -3238,7 +3298,7 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ITEM_TYPE_IPV6:\n \t\t\tflow_dv_translate_item_ipv6(match_mask, match_value,\n-\t\t\t\t\t\t    items, tunnel);\n+\t\t\t\t\t\t    items, tunnel, attr->group);\n \t\t\tmatcher.priority = MLX5_PRIORITY_MAP_L3;\n \t\t\tdev_flow->dv.hash_fields |=\n \t\t\t\tmlx5_flow_hashfields_adjust\n@@ -3316,6 +3376,7 @@ struct field_modify_info modify_tcp[] = {\n \tmatcher.priority = mlx5_flow_adjust_priority(dev, priority,\n \t\t\t\t\t\t     matcher.priority);\n \tmatcher.egress = attr->egress;\n+\tmatcher.group = attr->group;\n \tif (flow_dv_matcher_register(dev, &matcher, dev_flow, error))\n \t\treturn -rte_errno;\n \treturn 0;\n@@ -3431,6 +3492,8 @@ struct field_modify_info modify_tcp[] = {\n \t\t\tstruct mlx5_flow *flow)\n {\n \tstruct mlx5_flow_dv_matcher *matcher = flow->dv.matcher;\n+\tstruct mlx5_priv *priv = dev->data->dev_private;\n+\tstruct mlx5_flow_tbl_resource *tbl;\n \n \tassert(matcher->matcher_object);\n \tDRV_LOG(DEBUG, \"port %u matcher %p: refcnt %d--\",\n@@ -3440,6 +3503,14 @@ struct field_modify_info modify_tcp[] = {\n \t\tclaim_zero(mlx5_glue->dv_destroy_flow_matcher\n \t\t\t   (matcher->matcher_object));\n \t\tLIST_REMOVE(matcher, next);\n+\t\tif (matcher->egress)\n+\t\t\ttbl = &priv->tx_tbl[matcher->group];\n+\t\telse\n+\t\t\ttbl = &priv->rx_tbl[matcher->group];\n+\t\tif (rte_atomic32_dec_and_test(&tbl->refcnt)) {\n+\t\t\tmlx5_glue->dr_destroy_flow_tbl(tbl->obj);\n+\t\t\ttbl->obj = NULL;\n+\t\t}\n \t\trte_free(matcher);\n \t\tDRV_LOG(DEBUG, \"port %u matcher %p: removed\",\n \t\t\tdev->data->port_id, (void *)matcher);\n@@ -3529,7 +3600,7 @@ struct field_modify_info modify_tcp[] = {\n \tLIST_FOREACH(dev_flow, &flow->dev_flows, next) {\n \t\tdv = &dev_flow->dv;\n \t\tif (dv->flow) {\n-\t\t\tclaim_zero(mlx5_glue->destroy_flow(dv->flow));\n+\t\t\tclaim_zero(mlx5_glue->dv_destroy_flow(dv->flow));\n \t\t\tdv->flow = NULL;\n \t\t}\n \t\tif (dv->hrxq) {\ndiff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c\nindex 4b5aade..b0b144c 100644\n--- a/drivers/net/mlx5/mlx5_glue.c\n+++ b/drivers/net/mlx5/mlx5_glue.c\n@@ -178,6 +178,9 @@\n mlx5_glue_destroy_flow_action(void *action)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_destroy_action(action);\n+#else\n \tstruct mlx5dv_flow_action_attr *attr = action;\n \tint res = 0;\n \tswitch (attr->type) {\n@@ -189,6 +192,7 @@\n \t}\n \tfree(action);\n \treturn res;\n+#endif\n #else\n \t(void)action;\n \treturn ENOTSUP;\n@@ -365,6 +369,53 @@\n \treturn ibv_cq_ex_to_cq(cq);\n }\n \n+static void *\n+mlx5_glue_dr_create_flow_tbl(void *ns, uint32_t level)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_ft(ns, level);\n+#else\n+\t(void)ns;\n+\t(void)level;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_destroy_flow_tbl(void *tbl)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_destroy_ft(tbl);\n+#else\n+\t(void)tbl;\n+\treturn 0;\n+#endif\n+}\n+\n+static void *\n+mlx5_glue_dr_create_ns(struct ibv_context *ctx,\n+\t\t       enum  mlx5dv_dr_ns_domain domain)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_ns(ctx, domain);\n+#else\n+\t(void)ctx;\n+\t(void)domain;\n+\treturn NULL;\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dr_destroy_ns(void *ns)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_destroy_ns(ns);\n+#else\n+\t(void)ns;\n+\treturn 0;\n+#endif\n+}\n+\n static struct ibv_cq_ex *\n mlx5_glue_dv_create_cq(struct ibv_context *context,\n \t\t       struct ibv_cq_init_attr_ex *cq_attr,\n@@ -423,26 +474,40 @@\n #endif\n }\n \n-static struct mlx5dv_flow_matcher *\n+static void *\n mlx5_glue_dv_create_flow_matcher(struct ibv_context *context,\n-\t\t\t\t struct mlx5dv_flow_matcher_attr *matcher_attr)\n+\t\t\t\t struct mlx5dv_flow_matcher_attr *matcher_attr,\n+\t\t\t\t void *tbl)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)context;\n+\treturn mlx5dv_dr_create_matcher(tbl, matcher_attr->priority,\n+\t\t\t\t       matcher_attr->match_criteria_enable,\n+\t\t\t\t       matcher_attr->match_mask);\n+#else\n+\t(void)tbl;\n \treturn mlx5dv_create_flow_matcher(context, matcher_attr);\n+#endif\n #else\n \t(void)context;\n \t(void)matcher_attr;\n+\t(void)tbl;\n \treturn NULL;\n #endif\n }\n \n-static struct ibv_flow *\n-mlx5_glue_dv_create_flow(struct mlx5dv_flow_matcher *matcher,\n-\t\t\t struct mlx5dv_flow_match_parameters *match_value,\n+static void *\n+mlx5_glue_dv_create_flow(void *matcher,\n+\t\t\t void *match_value,\n \t\t\t size_t num_actions,\n \t\t\t void *actions[])\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_rule(matcher, match_value, num_actions,\n+\t\t\t\t     (struct mlx5dv_dr_action **)actions);\n+#else\n \tstruct mlx5dv_flow_action_attr actions_attr[8];\n \n \tif (num_actions > 8)\n@@ -452,6 +517,7 @@\n \t\t\t*((struct mlx5dv_flow_action_attr *)(actions[i]));\n \treturn mlx5dv_create_flow(matcher, match_value,\n \t\t\t\t  num_actions, actions_attr);\n+#endif\n #else\n \t(void)matcher;\n \t(void)match_value;\n@@ -461,21 +527,13 @@\n #endif\n }\n \n-static int\n-mlx5_glue_dv_destroy_flow_matcher(struct mlx5dv_flow_matcher *matcher)\n-{\n-#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n-\treturn mlx5dv_destroy_flow_matcher(matcher);\n-#else\n-\t(void)matcher;\n-\treturn 0;\n-#endif\n-}\n-\n static void *\n mlx5_glue_dv_create_flow_action_counter(void *counter_obj, uint32_t offset)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_action_devx_counter(counter_obj, offset);\n+#else\n \tstruct mlx5dv_flow_action_attr *action;\n \n \t(void)offset;\n@@ -485,6 +543,7 @@\n \taction->type = MLX5DV_FLOW_ACTION_COUNTERS_DEVX;\n \taction->obj = counter_obj;\n \treturn action;\n+#endif\n #else\n \t(void)counter_obj;\n \t(void)offset;\n@@ -496,6 +555,9 @@\n mlx5_glue_dv_create_flow_action_dest_ibv_qp(void *qp)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_action_dest_ibv_qp(qp);\n+#else\n \tstruct mlx5dv_flow_action_attr *action;\n \n \taction = malloc(sizeof(*action));\n@@ -504,6 +566,7 @@\n \taction->type = MLX5DV_FLOW_ACTION_DEST_IBV_QP;\n \taction->obj = qp;\n \treturn action;\n+#endif\n #else\n \t(void)qp;\n \treturn NULL;\n@@ -513,13 +576,22 @@\n static void *\n mlx5_glue_dv_create_flow_action_modify_header\n \t\t\t\t\t(struct ibv_context *ctx,\n+\t\t\t\t\t enum mlx5dv_flow_table_type ft_type,\n+\t\t\t\t\t void *ns, uint64_t flags,\n \t\t\t\t\t size_t actions_sz,\n-\t\t\t\t\t uint64_t actions[],\n-\t\t\t\t\t enum mlx5dv_flow_table_type ft_type)\n+\t\t\t\t\t uint64_t actions[])\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)ctx;\n+\t(void)ft_type;\n+\treturn mlx5dv_dr_create_action_modify_header(ns, flags, actions_sz,\n+\t\t\t\t\t\t    actions);\n+#else\n \tstruct mlx5dv_flow_action_attr *action;\n \n+\t(void)ns;\n+\t(void)flags;\n \taction = malloc(sizeof(*action));\n \tif (!action)\n \t\treturn NULL;\n@@ -527,11 +599,14 @@\n \taction->action = mlx5dv_create_flow_action_modify_header\n \t\t(ctx, actions_sz, actions, ft_type);\n \treturn action;\n+#endif\n #else\n \t(void)ctx;\n+\t(void)ft_type;\n+\t(void)ns;\n+\t(void)flags;\n \t(void)actions_sz;\n \t(void)actions;\n-\t(void)ft_type;\n \treturn NULL;\n #endif\n }\n@@ -539,12 +614,20 @@\n static void *\n mlx5_glue_dv_create_flow_action_packet_reformat\n \t\t(struct ibv_context *ctx,\n-\t\t size_t data_sz,\n-\t\t void *data,\n \t\t enum mlx5dv_flow_action_packet_reformat_type reformat_type,\n-\t\t enum mlx5dv_flow_table_type ft_type)\n+\t\t enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns,\n+\t\t uint32_t flags, size_t data_sz, void *data)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\t(void)ctx;\n+\t(void)ft_type;\n+\treturn mlx5dv_dr_create_action_packet_reformat(ns, flags,\n+\t\t\t\t\t\t       reformat_type, data_sz,\n+\t\t\t\t\t\t       data);\n+#else\n+\t(void)ns;\n+\t(void)flags;\n \tstruct mlx5dv_flow_action_attr *action;\n \n \taction = malloc(sizeof(*action));\n@@ -554,12 +637,15 @@\n \taction->action = mlx5dv_create_flow_action_packet_reformat\n \t\t(ctx, data_sz, data, reformat_type, ft_type);\n \treturn action;\n+#endif\n #else\n \t(void)ctx;\n-\t(void)data_sz;\n-\t(void)data;\n \t(void)reformat_type;\n \t(void)ft_type;\n+\t(void)ns;\n+\t(void)flags;\n+\t(void)data_sz;\n+\t(void)data;\n \treturn NULL;\n #endif\n }\n@@ -568,6 +654,9 @@\n mlx5_glue_dv_create_flow_action_tag(uint32_t tag)\n {\n #ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_create_action_tag(tag);\n+#else\n \tstruct mlx5dv_flow_action_attr *action;\n \taction = malloc(sizeof(*action));\n \tif (!action)\n@@ -576,10 +665,36 @@\n \taction->tag_value = tag;\n \treturn action;\n #endif\n+#endif\n \t(void)tag;\n \treturn NULL;\n }\n \n+static int\n+mlx5_glue_dv_destroy_flow(void *flow_id)\n+{\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_destroy_rule(flow_id);\n+#else\n+\treturn ibv_destroy_flow(flow_id);\n+#endif\n+}\n+\n+static int\n+mlx5_glue_dv_destroy_flow_matcher(void *matcher)\n+{\n+#ifdef HAVE_IBV_FLOW_DV_SUPPORT\n+#ifdef HAVE_MLX5DV_DR\n+\treturn mlx5dv_dr_destroy_matcher(matcher);\n+#else\n+\treturn mlx5dv_destroy_flow_matcher(matcher);\n+#endif\n+#else\n+\t(void)matcher;\n+\treturn 0;\n+#endif\n+}\n+\n static struct ibv_context *\n mlx5_glue_dv_open_device(struct ibv_device *device)\n {\n@@ -718,6 +833,10 @@\n \t.get_async_event = mlx5_glue_get_async_event,\n \t.port_state_str = mlx5_glue_port_state_str,\n \t.cq_ex_to_cq = mlx5_glue_cq_ex_to_cq,\n+\t.dr_create_flow_tbl = mlx5_glue_dr_create_flow_tbl,\n+\t.dr_destroy_flow_tbl = mlx5_glue_dr_destroy_flow_tbl,\n+\t.dr_create_ns = mlx5_glue_dr_create_ns,\n+\t.dr_destroy_ns = mlx5_glue_dr_destroy_ns,\n \t.dv_create_cq = mlx5_glue_dv_create_cq,\n \t.dv_create_wq = mlx5_glue_dv_create_wq,\n \t.dv_query_device = mlx5_glue_dv_query_device,\n@@ -725,7 +844,6 @@\n \t.dv_init_obj = mlx5_glue_dv_init_obj,\n \t.dv_create_qp = mlx5_glue_dv_create_qp,\n \t.dv_create_flow_matcher = mlx5_glue_dv_create_flow_matcher,\n-\t.dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,\n \t.dv_create_flow = mlx5_glue_dv_create_flow,\n \t.dv_create_flow_action_counter =\n \t\tmlx5_glue_dv_create_flow_action_counter,\n@@ -736,6 +854,8 @@\n \t.dv_create_flow_action_packet_reformat =\n \t\tmlx5_glue_dv_create_flow_action_packet_reformat,\n \t.dv_create_flow_action_tag =  mlx5_glue_dv_create_flow_action_tag,\n+\t.dv_destroy_flow = mlx5_glue_dv_destroy_flow,\n+\t.dv_destroy_flow_matcher = mlx5_glue_dv_destroy_flow_matcher,\n \t.dv_open_device = mlx5_glue_dv_open_device,\n \t.devx_obj_create = mlx5_glue_devx_obj_create,\n \t.devx_obj_destroy = mlx5_glue_devx_obj_destroy,\ndiff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h\nindex 32487ea..eb29ffa 100644\n--- a/drivers/net/mlx5/mlx5_glue.h\n+++ b/drivers/net/mlx5/mlx5_glue.h\n@@ -63,6 +63,11 @@\n struct mlx5dv_devx_obj;\n #endif\n \n+#ifndef HAVE_MLX5DV_DR\n+struct mlx5dv_dr_ns;\n+enum  mlx5dv_dr_ns_domain { unused, };\n+#endif\n+\n /* LIB_GLUE_VERSION must be updated every time this structure is modified. */\n struct mlx5_glue {\n \tconst char *version;\n@@ -140,6 +145,11 @@ struct mlx5_glue {\n \t\t\t       struct ibv_async_event *event);\n \tconst char *(*port_state_str)(enum ibv_port_state port_state);\n \tstruct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq);\n+\tvoid *(*dr_create_flow_tbl)(void *ns, uint32_t level);\n+\tint (*dr_destroy_flow_tbl)(void *tbl);\n+\tvoid *(*dr_create_ns)(struct ibv_context *ctx,\n+\t\t\t      enum mlx5dv_dr_ns_domain domain);\n+\tint (*dr_destroy_ns)(void *ns);\n \tstruct ibv_cq_ex *(*dv_create_cq)\n \t\t(struct ibv_context *context,\n \t\t struct ibv_cq_init_attr_ex *cq_attr,\n@@ -158,23 +168,26 @@ struct mlx5_glue {\n \t\t(struct ibv_context *context,\n \t\t struct ibv_qp_init_attr_ex *qp_init_attr_ex,\n \t\t struct mlx5dv_qp_init_attr *dv_qp_init_attr);\n-\tstruct mlx5dv_flow_matcher *(*dv_create_flow_matcher)\n+\tvoid *(*dv_create_flow_matcher)\n \t\t(struct ibv_context *context,\n-\t\t struct mlx5dv_flow_matcher_attr *matcher_attr);\n-\tint (*dv_destroy_flow_matcher)(struct mlx5dv_flow_matcher *matcher);\n-\tstruct ibv_flow *(*dv_create_flow)(struct mlx5dv_flow_matcher *matcher,\n-\t\t\t  struct mlx5dv_flow_match_parameters *match_value,\n+\t\t struct mlx5dv_flow_matcher_attr *matcher_attr,\n+\t\t void *tbl);\n+\tvoid *(*dv_create_flow)(void *matcher, void *match_value,\n \t\t\t  size_t num_actions, void *actions[]);\n \tvoid *(*dv_create_flow_action_counter)(void *obj, uint32_t  offset);\n \tvoid *(*dv_create_flow_action_dest_ibv_qp)(void *qp);\n \tvoid *(*dv_create_flow_action_modify_header)\n-\t\t(struct ibv_context *ctx, size_t actions_sz, uint64_t actions[],\n-\t\t enum mlx5dv_flow_table_type ft_type);\n+\t\t(struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type,\n+\t\t void *ns, uint64_t flags, size_t actions_sz,\n+\t\t uint64_t actions[]);\n \tvoid *(*dv_create_flow_action_packet_reformat)\n-\t\t(struct ibv_context *ctx, size_t data_sz, void *data,\n+\t\t(struct ibv_context *ctx,\n \t\t enum mlx5dv_flow_action_packet_reformat_type reformat_type,\n-\t\t enum mlx5dv_flow_table_type ft_type);\n+\t\t enum mlx5dv_flow_table_type ft_type, struct mlx5dv_dr_ns *ns,\n+\t\t uint32_t flags, size_t data_sz, void *data);\n \tvoid *(*dv_create_flow_action_tag)(uint32_t tag);\n+\tint (*dv_destroy_flow)(void *flow);\n+\tint (*dv_destroy_flow_matcher)(void *matcher);\n \tstruct ibv_context *(*dv_open_device)(struct ibv_device *device);\n \tstruct mlx5dv_devx_obj *(*devx_obj_create)\n \t\t\t\t\t(struct ibv_context *ctx,\ndiff --git a/drivers/net/mlx5/mlx5_prm.h b/drivers/net/mlx5/mlx5_prm.h\nindex da1219e..b15266f 100644\n--- a/drivers/net/mlx5/mlx5_prm.h\n+++ b/drivers/net/mlx5/mlx5_prm.h\n@@ -492,20 +492,40 @@ struct mlx5_ifc_fte_match_set_misc2_bits {\n \tu8 reserved_at_1a0[0x60];\n };\n \n+struct mlx5_ifc_fte_match_set_misc3_bits {\n+\tu8 inner_tcp_seq_num[0x20];\n+\tu8 outer_tcp_seq_num[0x20];\n+\tu8 inner_tcp_ack_num[0x20];\n+\tu8 outer_tcp_ack_num[0x20];\n+\tu8 reserved_at_auto1[0x8];\n+\tu8 outer_vxlan_gpe_vni[0x18];\n+\tu8 outer_vxlan_gpe_next_protocol[0x8];\n+\tu8 outer_vxlan_gpe_flags[0x8];\n+\tu8 reserved_at_a8[0x10];\n+\tu8 icmp_header_data[0x20];\n+\tu8 icmpv6_header_data[0x20];\n+\tu8 icmp_type[0x8];\n+\tu8 icmp_code[0x8];\n+\tu8 icmpv6_type[0x8];\n+\tu8 icmpv6_code[0x8];\n+\tu8 reserved_at_1a0[0xe0];\n+};\n+\n /* Flow matcher. */\n struct mlx5_ifc_fte_match_param_bits {\n \tstruct mlx5_ifc_fte_match_set_lyr_2_4_bits outer_headers;\n \tstruct mlx5_ifc_fte_match_set_misc_bits misc_parameters;\n \tstruct mlx5_ifc_fte_match_set_lyr_2_4_bits inner_headers;\n \tstruct mlx5_ifc_fte_match_set_misc2_bits misc_parameters_2;\n-\tu8 reserved_at_800[0x800];\n+\tstruct mlx5_ifc_fte_match_set_misc3_bits misc_parameters_3;\n };\n \n enum {\n \tMLX5_MATCH_CRITERIA_ENABLE_OUTER_BIT,\n \tMLX5_MATCH_CRITERIA_ENABLE_MISC_BIT,\n \tMLX5_MATCH_CRITERIA_ENABLE_INNER_BIT,\n-\tMLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT\n+\tMLX5_MATCH_CRITERIA_ENABLE_MISC2_BIT,\n+\tMLX5_MATCH_CRITERIA_ENABLE_MISC3_BIT\n };\n \n enum {\n",
    "prefixes": [
        "v4",
        "2/3"
    ]
}