get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 59704,
    "url": "http://patches.dpdk.org/api/patches/59704/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1569398015-6027-8-git-send-email-viacheslavo@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": "<1569398015-6027-8-git-send-email-viacheslavo@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1569398015-6027-8-git-send-email-viacheslavo@mellanox.com",
    "date": "2019-09-25T07:53:30",
    "name": "[07/12] net/mlx5: query vport index match mode and parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2660c6929a60017475d0e8a4d0f47168d9b598b6",
    "submitter": {
        "id": 1102,
        "url": "http://patches.dpdk.org/api/people/1102/?format=api",
        "name": "Slava Ovsiienko",
        "email": "viacheslavo@mellanox.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/1569398015-6027-8-git-send-email-viacheslavo@mellanox.com/mbox/",
    "series": [
        {
            "id": 6519,
            "url": "http://patches.dpdk.org/api/series/6519/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6519",
            "date": "2019-09-25T07:53:23",
            "name": "net/mlx5: add bonding configuration support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/6519/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/59704/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/59704/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 9EA051BE82;\n\tWed, 25 Sep 2019 09:54:12 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 9C9914C99\n\tfor <dev@dpdk.org>; Wed, 25 Sep 2019 09:54:04 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 25 Sep 2019 10:54:03 +0300",
            "from pegasus12.mtr.labs.mlnx (pegasus12.mtr.labs.mlnx\n\t[10.210.17.40])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x8P7s3Ci030321;\n\tWed, 25 Sep 2019 10:54:03 +0300",
            "from pegasus12.mtr.labs.mlnx (localhost [127.0.0.1])\n\tby pegasus12.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id\n\tx8P7s3qq006869; Wed, 25 Sep 2019 07:54:03 GMT",
            "(from viacheslavo@localhost)\n\tby pegasus12.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id x8P7s33K006868; \n\tWed, 25 Sep 2019 07:54:03 GMT"
        ],
        "X-Authentication-Warning": "pegasus12.mtr.labs.mlnx: viacheslavo set sender to\n\tviacheslavo@mellanox.com using -f",
        "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>",
        "To": "dev@dpdk.org",
        "Cc": "matan@mellanox.com, rasland@mellanox.com",
        "Date": "Wed, 25 Sep 2019 07:53:30 +0000",
        "Message-Id": "<1569398015-6027-8-git-send-email-viacheslavo@mellanox.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1569398015-6027-1-git-send-email-viacheslavo@mellanox.com>",
        "References": "<1569398015-6027-1-git-send-email-viacheslavo@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH 07/12] net/mlx5: query vport index match mode and\n\tparameters",
        "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": "There new kernel/rdma_core [1] supports matching on metadata\nregister instead of vport field to provide operations over\nVF LAG bonding configurations. The patch retrieves parameters\nand information about the way is engaged to match vport on E-Switch.\n\n[1] http://patchwork.ozlabs.org/cover/1122170/\n    \"Mellanox, mlx5 vport metadata matching\"\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++--\n drivers/net/mlx5/mlx5.h |  2 ++\n 2 files changed, 56 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 25d1530..1b2f86f 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -1563,6 +1563,9 @@ struct mlx5_dev_spawn_data {\n \tint own_domain_id = 0;\n \tuint16_t port_id;\n \tunsigned int i;\n+#ifdef HAVE_MLX5DV_DR_DEVX_PORT\n+\tstruct mlx5dv_devx_port devx_port;\n+#endif\n \n \t/* Determine if this port representor is supposed to be spawned. */\n \tif (switch_info->representor && dpdk_dev->devargs) {\n@@ -1783,8 +1786,56 @@ struct mlx5_dev_spawn_data {\n \tpriv->representor = !!switch_info->representor;\n \tpriv->master = !!switch_info->master;\n \tpriv->domain_id = RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID;\n+\tpriv->vport_meta_tag = 0;\n+\tpriv->vport_meta_mask = 0;\n+#ifdef HAVE_MLX5DV_DR_DEVX_PORT\n \t/*\n-\t * Currently we support single E-Switch per PF configurations\n+\t * The DevX port query API is implemented. E-Switch may use\n+\t * either vport or reg_c[0] metadata register to match on\n+\t * vport index. The engaged part of metadata register is\n+\t * defined by mask.\n+\t */\n+\tdevx_port.comp_mask = MLX5DV_DEVX_PORT_VPORT |\n+\t\t\t      MLX5DV_DEVX_PORT_MATCH_REG_C_0;\n+\terr = mlx5dv_query_devx_port(sh->ctx, spawn->ibv_port, &devx_port);\n+\tif (err) {\n+\t\tDRV_LOG(WARNING, \"can't query devx port %d on device %s\\n\",\n+\t\t\tspawn->ibv_port, spawn->ibv_dev->name);\n+\t\tdevx_port.comp_mask = 0;\n+\t}\n+\tif (devx_port.comp_mask & MLX5DV_DEVX_PORT_MATCH_REG_C_0) {\n+\t\tpriv->vport_meta_tag = devx_port.reg_c_0.value;\n+\t\tpriv->vport_meta_mask = devx_port.reg_c_0.mask;\n+\t\tif (!priv->vport_meta_mask) {\n+\t\t\tDRV_LOG(ERR, \"vport zero mask for port %d\"\n+\t\t\t\t     \" on bonding device %s\\n\",\n+\t\t\t\t     spawn->ibv_port, spawn->ibv_dev->name);\n+\t\t\terr = ENOTSUP;\n+\t\t\tgoto error;\n+\t\t}\n+\t\tif (priv->vport_meta_tag & ~priv->vport_meta_mask) {\n+\t\t\tDRV_LOG(ERR, \"invalid vport tag for port %d\"\n+\t\t\t\t     \" on bonding device %s\\n\",\n+\t\t\t\t     spawn->ibv_port, spawn->ibv_dev->name);\n+\t\t\terr = ENOTSUP;\n+\t\t\tgoto error;\n+\t\t}\n+\t} else if (devx_port.comp_mask & MLX5DV_DEVX_PORT_VPORT) {\n+\t\tpriv->vport_id = devx_port.vport_num;\n+\t} else if (spawn->pf_bond >= 0) {\n+\t\tDRV_LOG(ERR, \"can't deduce vport index for port %d\"\n+\t\t\t     \" on bonding device %s\\n\",\n+\t\t\t     spawn->ibv_port, spawn->ibv_dev->name);\n+\t\terr = ENOTSUP;\n+\t\tgoto error;\n+\t} else {\n+\t\t/* Suppose vport index in compatible way. */\n+\t\tpriv->vport_id = switch_info->representor ?\n+\t\t\t\t switch_info->port_name + 1 : -1;\n+\t}\n+#else\n+\t/*\n+\t * Kernel/rdma_core support single E-Switch per PF configurations\n \t * only and vport_id field contains the vport index for\n \t * associated VF, which is deduced from representor port name.\n \t * For example, let's have the IB device port 10, it has\n@@ -1796,7 +1847,8 @@ struct mlx5_dev_spawn_data {\n \t */\n \tpriv->vport_id = switch_info->representor ?\n \t\t\t switch_info->port_name + 1 : -1;\n-\t/* representor_id field keeps the unmodified port/VF index. */\n+#endif\n+\t/* representor_id field keeps the unmodified VF index. */\n \tpriv->representor_id = switch_info->representor ?\n \t\t\t       switch_info->port_name : -1;\n \t/*\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 9a3fd36..631876d 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -620,6 +620,8 @@ struct mlx5_priv {\n \tunsigned int counter_fallback:1; /* Use counter fallback management. */\n \tuint16_t domain_id; /* Switch domain identifier. */\n \tuint16_t vport_id; /* Associated VF vport index (if any). */\n+\tuint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */\n+\tuint32_t vport_meta_mask; /* Used for vport index field match mask. */\n \tint32_t representor_id; /* Port representor identifier. */\n \tunsigned int if_index; /* Associated kernel network device index. */\n \t/* RX/TX queues. */\n",
    "prefixes": [
        "07/12"
    ]
}