get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 75910,
    "url": "http://patches.dpdk.org/api/patches/75910/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200825093116.26538-13-ophirmu@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": "<20200825093116.26538-13-ophirmu@nvidia.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200825093116.26538-13-ophirmu@nvidia.com",
    "date": "2020-08-25T09:31:15",
    "name": "[v2,12/13] net/mlx5: separate VLAN strip modification",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "4d159e37eee481017b49bbf701aebf0abdc7c420",
    "submitter": {
        "id": 1908,
        "url": "http://patches.dpdk.org/api/people/1908/?format=api",
        "name": "Ophir Munk",
        "email": "ophirmu@nvidia.com"
    },
    "delegate": {
        "id": 3268,
        "url": "http://patches.dpdk.org/api/users/3268/?format=api",
        "username": "rasland",
        "first_name": "Raslan",
        "last_name": "Darawsheh",
        "email": "rasland@nvidia.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200825093116.26538-13-ophirmu@nvidia.com/mbox/",
    "series": [
        {
            "id": 11773,
            "url": "http://patches.dpdk.org/api/series/11773/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11773",
            "date": "2020-08-25T09:31:06",
            "name": "mlx5 PMD multi OS support - part #4",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/11773/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/75910/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/75910/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 357FFA04B1;\n\tTue, 25 Aug 2020 11:33:32 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 886851C217;\n\tTue, 25 Aug 2020 11:31:46 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id D16201C1BA\n for <dev@dpdk.org>; Tue, 25 Aug 2020 11:31:29 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n ophirmu@nvidia.com) with SMTP; 25 Aug 2020 12:31:25 +0300",
            "from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07P9VPN2030009;\n Tue, 25 Aug 2020 12:31:25 +0300"
        ],
        "From": "Ophir Munk <ophirmu@nvidia.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ophir Munk <ophirmu@mellanox.com>",
        "Date": "Tue, 25 Aug 2020 09:31:15 +0000",
        "Message-Id": "<20200825093116.26538-13-ophirmu@nvidia.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20200825093116.26538-1-ophirmu@nvidia.com>",
        "References": "<20200820145028.4090-1-ophirmu@nvidia.com>\n <20200825093116.26538-1-ophirmu@nvidia.com>",
        "Subject": "[dpdk-dev] [PATCH v2 12/13] net/mlx5: separate VLAN strip\n\tmodification",
        "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 <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Ophir Munk <ophirmu@mellanox.com>\n\nWhen updating a queue vlan stripping offload - either the WQ is modified\nin Verbs or the RQ is modified in DevX.  Add a vlan stripping modify\ncallback to 'struct mlx5_obj_ops' and assign it with the specific Verbs\nand DevX implementations: 'rxq_obj_modify_wq_vlan_strip' and\n'rxq_obj_modify_rq_vlan_strip' respectively.\n\nSigned-off-by: Ophir Munk <ophirmu@mellanox.com>\nAcked-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/net/mlx5/linux/mlx5_verbs.c | 28 ++++++++++++++++++++++\n drivers/net/mlx5/mlx5.h             |  6 +++++\n drivers/net/mlx5/mlx5_devx.c        | 48 +++++++++++++++++++++++++++++++++++++\n drivers/net/mlx5/mlx5_devx.h        | 12 ++++++++++\n drivers/net/mlx5/mlx5_vlan.c        | 27 ++++-----------------\n 5 files changed, 98 insertions(+), 23 deletions(-)\n create mode 100644 drivers/net/mlx5/mlx5_devx.c\n create mode 100644 drivers/net/mlx5/mlx5_devx.h",
    "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c\nindex d41b0fe..6271f0f 100644\n--- a/drivers/net/mlx5/linux/mlx5_verbs.c\n+++ b/drivers/net/mlx5/linux/mlx5_verbs.c\n@@ -19,6 +19,7 @@\n #include <mlx5_glue.h>\n #include <mlx5_common.h>\n #include <mlx5_common_mr.h>\n+#include <mlx5_rxtx.h>\n #include <mlx5_verbs.h>\n /**\n  * Register mr. Given protection domain pointer, pointer to addr and length\n@@ -61,3 +62,30 @@ const struct mlx5_verbs_ops mlx5_verbs_ops = {\n \t.reg_mr = mlx5_reg_mr,\n \t.dereg_mr = mlx5_dereg_mr,\n };\n+\n+/**\n+ * Modify Rx WQ vlan stripping offload\n+ *\n+ * @param rxq_obj\n+ *   Rx queue object.\n+ *\n+ * @return 0 on success, non-0 otherwise\n+ */\n+static int\n+mlx5_rxq_obj_modify_wq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)\n+{\n+\tuint16_t vlan_offloads =\n+\t\t(on ? IBV_WQ_FLAGS_CVLAN_STRIPPING : 0) |\n+\t\t0;\n+\tstruct ibv_wq_attr mod;\n+\tmod = (struct ibv_wq_attr){\n+\t\t.attr_mask = IBV_WQ_ATTR_FLAGS,\n+\t\t.flags_mask = IBV_WQ_FLAGS_CVLAN_STRIPPING,\n+\t\t.flags = vlan_offloads,\n+\t};\n+\treturn mlx5_glue->modify_wq(rxq_obj->wq, &mod);\n+}\n+\n+struct mlx5_obj_ops ibv_obj_ops = {\n+\t.rxq_obj_modify_vlan_strip = mlx5_rxq_obj_modify_wq_vlan_strip,\n+};\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 34d7a15..431f861 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -676,6 +676,11 @@ TAILQ_HEAD(mlx5_flow_meters, mlx5_flow_meter);\n #define MLX5_PROC_PRIV(port_id) \\\n \t((struct mlx5_proc_priv *)rte_eth_devices[port_id].process_private)\n \n+/* HW objects operations structure. */\n+struct mlx5_obj_ops {\n+\tint (*rxq_obj_modify_vlan_strip)(struct mlx5_rxq_obj *rxq_obj, int on);\n+};\n+\n struct mlx5_priv {\n \tstruct rte_eth_dev_data *dev_data;  /* Pointer to device data. */\n \tstruct mlx5_dev_ctx_shared *sh; /* Shared device context. */\n@@ -719,6 +724,7 @@ struct mlx5_priv {\n \tvoid *rss_desc; /* Intermediate rss description resources. */\n \tint flow_idx; /* Intermediate device flow index. */\n \tint flow_nested_idx; /* Intermediate device flow index, nested. */\n+\tstruct mlx5_obj_ops *obj_ops; /* HW objects operations. */\n \tLIST_HEAD(rxq, mlx5_rxq_ctrl) rxqsctrl; /* DPDK Rx queues. */\n \tLIST_HEAD(rxqobj, mlx5_rxq_obj) rxqsobj; /* Verbs/DevX Rx queues. */\n \tuint32_t hrxqs; /* Verbs Hash Rx queues. */\ndiff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c\nnew file mode 100644\nindex 0000000..7340412\n--- /dev/null\n+++ b/drivers/net/mlx5/mlx5_devx.c\n@@ -0,0 +1,48 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include <stddef.h>\n+#include <errno.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <sys/queue.h>\n+\n+#include <rte_malloc.h>\n+#include <rte_common.h>\n+#include <rte_eal_paging.h>\n+\n+#include <mlx5_glue.h>\n+#include <mlx5_devx_cmds.h>\n+#include <mlx5_malloc.h>\n+\n+#include \"mlx5.h\"\n+#include \"mlx5_common_os.h\"\n+#include \"mlx5_rxtx.h\"\n+#include \"mlx5_utils.h\"\n+#include \"mlx5_devx.h\"\n+\n+/**\n+ * Modify RQ vlan stripping offload\n+ *\n+ * @param rxq_obj\n+ *   Rx queue object.\n+ *\n+ * @return 0 on success, non-0 otherwise\n+ */\n+static int\n+mlx5_rxq_obj_modify_rq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)\n+{\n+\tstruct mlx5_devx_modify_rq_attr rq_attr;\n+\n+\tmemset(&rq_attr, 0, sizeof(rq_attr));\n+\trq_attr.rq_state = MLX5_RQC_STATE_RDY;\n+\trq_attr.state = MLX5_RQC_STATE_RDY;\n+\trq_attr.vsd = (on ? 0 : 1);\n+\trq_attr.modify_bitmask = MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD;\n+\treturn mlx5_devx_cmd_modify_rq(rxq_obj->rq, &rq_attr);\n+}\n+\n+struct mlx5_obj_ops devx_obj_ops = {\n+\t.rxq_obj_modify_vlan_strip = mlx5_rxq_obj_modify_rq_vlan_strip,\n+};\ndiff --git a/drivers/net/mlx5/mlx5_devx.h b/drivers/net/mlx5/mlx5_devx.h\nnew file mode 100644\nindex 0000000..844985c\n--- /dev/null\n+++ b/drivers/net/mlx5/mlx5_devx.h\n@@ -0,0 +1,12 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#ifndef RTE_PMD_MLX5_DEVX_H_\n+#define RTE_PMD_MLX5_DEVX_H_\n+\n+#include \"mlx5.h\"\n+\n+extern struct mlx5_obj_ops devx_obj_ops;\n+\n+#endif /* RTE_PMD_MLX5_DEVX_H_ */\ndiff --git a/drivers/net/mlx5/mlx5_vlan.c b/drivers/net/mlx5/mlx5_vlan.c\nindex 89983a4..ea89599 100644\n--- a/drivers/net/mlx5/mlx5_vlan.c\n+++ b/drivers/net/mlx5/mlx5_vlan.c\n@@ -22,6 +22,7 @@\n #include \"mlx5_autoconf.h\"\n #include \"mlx5_rxtx.h\"\n #include \"mlx5_utils.h\"\n+#include \"mlx5_devx.h\"\n \n /**\n  * DPDK callback to configure a VLAN filter.\n@@ -97,10 +98,6 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)\n \tstruct mlx5_rxq_data *rxq = (*priv->rxqs)[queue];\n \tstruct mlx5_rxq_ctrl *rxq_ctrl =\n \t\tcontainer_of(rxq, struct mlx5_rxq_ctrl, rxq);\n-\tstruct ibv_wq_attr mod;\n-\tuint16_t vlan_offloads =\n-\t\t(on ? IBV_WQ_FLAGS_CVLAN_STRIPPING : 0) |\n-\t\t0;\n \tint ret = 0;\n \n \t/* Validate hw support */\n@@ -115,30 +112,14 @@ mlx5_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue, int on)\n \t\t\tdev->data->port_id, queue);\n \t\treturn;\n \t}\n-\tDRV_LOG(DEBUG, \"port %u set VLAN offloads 0x%x for port %uqueue %d\",\n-\t\tdev->data->port_id, vlan_offloads, rxq->port_id, queue);\n+\tDRV_LOG(DEBUG, \"port %u set VLAN stripping offloads %d for port %uqueue %d\",\n+\t\tdev->data->port_id, on, rxq->port_id, queue);\n \tif (!rxq_ctrl->obj) {\n \t\t/* Update related bits in RX queue. */\n \t\trxq->vlan_strip = !!on;\n \t\treturn;\n \t}\n-\tif (rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_IBV) {\n-\t\tmod = (struct ibv_wq_attr){\n-\t\t\t.attr_mask = IBV_WQ_ATTR_FLAGS,\n-\t\t\t.flags_mask = IBV_WQ_FLAGS_CVLAN_STRIPPING,\n-\t\t\t.flags = vlan_offloads,\n-\t\t};\n-\t\tret = mlx5_glue->modify_wq(rxq_ctrl->obj->wq, &mod);\n-\t} else if (rxq_ctrl->obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_RQ) {\n-\t\tstruct mlx5_devx_modify_rq_attr rq_attr;\n-\n-\t\tmemset(&rq_attr, 0, sizeof(rq_attr));\n-\t\trq_attr.rq_state = MLX5_RQC_STATE_RDY;\n-\t\trq_attr.state = MLX5_RQC_STATE_RDY;\n-\t\trq_attr.vsd = (on ? 0 : 1);\n-\t\trq_attr.modify_bitmask = MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD;\n-\t\tret = mlx5_devx_cmd_modify_rq(rxq_ctrl->obj->rq, &rq_attr);\n-\t}\n+\tret = priv->obj_ops->rxq_obj_modify_vlan_strip(rxq_ctrl->obj, on);\n \tif (ret) {\n \t\tDRV_LOG(ERR, \"port %u failed to modify object %d stripping \"\n \t\t\t\"mode: %s\", dev->data->port_id,\n",
    "prefixes": [
        "v2",
        "12/13"
    ]
}