Show a patch.

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

{
    "id": 41085,
    "url": "http://patches.dpdk.org/api/patches/41085/",
    "web_url": "http://patches.dpdk.org/patch/41085/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20180614083047.10812-8-adrien.mazarguil@6wind.com>",
    "date": "2018-06-14T08:35:02",
    "name": "[v2,7/7] net/mlx5: add parameter for port representors",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "44920f574a137a1d0ee9d39f2eba219f593e0305",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/41085/mbox/",
    "series": [
        {
            "id": 118,
            "url": "http://patches.dpdk.org/api/series/118/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=118",
            "date": "2018-06-14T08:34:47",
            "name": "net/mlx5: add port representor support",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/118/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41085/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41085/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<20180614083047.10812-1-adrien.mazarguil@6wind.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.11.0",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 7E8701E553;\n\tThu, 14 Jun 2018 10:35:20 +0200 (CEST)",
            "from mail-wr0-f194.google.com (mail-wr0-f194.google.com\n\t[209.85.128.194]) by dpdk.org (Postfix) with ESMTP id 934931E40F\n\tfor <dev@dpdk.org>; Thu, 14 Jun 2018 10:35:18 +0200 (CEST)",
            "by mail-wr0-f194.google.com with SMTP id e18-v6so5456246wrs.5\n\tfor <dev@dpdk.org>; Thu, 14 Jun 2018 01:35:18 -0700 (PDT)",
            "from 6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\tc11-v6sm4848506wrm.65.2018.06.14.01.35.17\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 14 Jun 2018 01:35:17 -0700 (PDT)"
        ],
        "References": "<20180525161814.13873-1-adrien.mazarguil@6wind.com>\n\t<20180614083047.10812-1-adrien.mazarguil@6wind.com>",
        "X-Google-Smtp-Source": "ADUXVKLMKtVuus7TUVpotvXjx28YSDHYBQFF+k/F2PbFyF5cxTadAmvpQMI4+GSOsB8zd9ZWa3nn0A==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to;\n\tbh=xLu3gnQ5zQUkUpZFgcgJizivfiIyQhz5ETjbX1E10og=;\n\tb=xT0PnnUepM0apcy6e5lJxukiJKSq0xPTM0Eo2xarGvRT1bMoV51mLijubBtOJwQjY6\n\tBEAynqJInAtACX2JW4WDRd7CV2nXVDzOAbqi8e3t7sBBnfQHf0g1mWyRj6P5Ph/B1GHE\n\tnVEsMu5Zh7br2pMVyAMU2UHwoEhinzuLa40TCTsn84Mw4iiX34TBigE7Bpd3GC23LcYT\n\tDP8GLqhQIjwx5xXwFcc2ItnRx2Ze/zthHbT0oVozp+5odT9kU5FjCCIKRG/4bXGF0ZL8\n\tZVkBal6QO0Na7N5sBiY9SW/PBK78QzMGsx0h73kkt1D3JAwtzQJdn3wR7+TZsMOAkXk0\n\tDZ/Q==",
        "MIME-Version": "1.0",
        "X-Received": "by 2002:adf:fb92:: with SMTP id\n\ta18-v6mr1247230wrr.278.1528965318361; \n\tThu, 14 Jun 2018 01:35:18 -0700 (PDT)",
        "Message-ID": "<20180614083047.10812-8-adrien.mazarguil@6wind.com>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to;\n\tbh=xLu3gnQ5zQUkUpZFgcgJizivfiIyQhz5ETjbX1E10og=;\n\tb=YiuMTr9VBfF4v0h97DihY+DW2lXRGtGrCctmLpB+46EMngiCKxUbOyaUMEXgP1afwb\n\tQ9VU52tey/kX2omC7Tp28cIVYzfkL+6k/MWJyIMBBFG9OMcO7ARcF2cOVpvGwyPF57VT\n\tcOgZs0yb4ZpRRswFjKP1iewj0KeLtNGAJ92+RzS5r7XP0QdGH7qE4QizuVDM7YXHeB8A\n\tzsrM/CzLHSbfAflQESdjHE9d/tQ6HwXwE0JOCdB5k3zHYJTsQdssO5lqDb9Pl4aW8JeM\n\tr0EemoUc9oCkHfwee2pnvSeR12AHPhLDYkKtOBmeMqJIlvC8fTivb7te91+koaBAkMeK\n\t4COQ==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "To": "Shahaf Shuler <shahafs@mellanox.com>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Date": "Thu, 14 Jun 2018 10:35:02 +0200",
        "X-Gm-Message-State": "APt69E2Ye2ZKBpASNvCX/VHjdzaCGCLMqnei/lWUVcFuKNCYmn3paB69\n\tULkGduZYLExeLkEMmB8tolI8O8yZ",
        "Cc": "dev@dpdk.org",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-BeenThere": "dev@dpdk.org",
        "Subject": "[dpdk-dev] [PATCH v2 7/7] net/mlx5: add parameter for port\n\trepresentors"
    },
    "content": "Prior to this patch, all port representors detected on a given device were\nprobed and Ethernet devices instantiated for each of them.\n\nThis patch adds support for the standard \"representor\" parameter, which\nimplies that port representors are not probed by default anymore, except\nfor the list provided through device arguments.\n\n(Patch based on prior work from Yuanhan Liu)\n\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n--\nv2 changes:\n\n- Added error message for when rte_eth_devargs_parse() fails.\n---\n doc/guides/nics/mlx5.rst                | 12 ++++++++++++\n doc/guides/prog_guide/poll_mode_drv.rst |  2 ++\n drivers/net/mlx5/mlx5.c                 | 29 ++++++++++++++++++++++++++++\n 3 files changed, 43 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst\nindex 79c982e29..5229e546c 100644\n--- a/doc/guides/nics/mlx5.rst\n+++ b/doc/guides/nics/mlx5.rst\n@@ -388,6 +388,18 @@ Run-time configuration\n \n   Disabled by default.\n \n+- ``representor`` parameter [list]\n+\n+  This parameter can be used to instantiate DPDK Ethernet devices from\n+  existing port (or VF) representors configured on the device.\n+\n+  It is a standard parameter whose format is described in\n+  :ref:`ethernet_device_standard_device_arguments`.\n+\n+  For instance, to probe port representors 0 through 2::\n+\n+    representor=[0-2]\n+\n Firmware configuration\n ~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst\nindex af82352a0..58d49ba0f 100644\n--- a/doc/guides/prog_guide/poll_mode_drv.rst\n+++ b/doc/guides/prog_guide/poll_mode_drv.rst\n@@ -365,6 +365,8 @@ Ethernet Device API\n \n The Ethernet device API exported by the Ethernet PMDs is described in the *DPDK API Reference*.\n \n+.. _ethernet_device_standard_device_arguments:\n+\n Ethernet Device Standard Device Arguments\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n \ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 716c9d9a5..26e61d99d 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -91,6 +91,9 @@\n /* Activate Netlink support in VF mode. */\n #define MLX5_VF_NL_EN \"vf_nl_en\"\n \n+/* Select port representors to instantiate. */\n+#define MLX5_REPRESENTOR \"representor\"\n+\n #ifndef HAVE_IBV_MLX5_MOD_MPW\n #define MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED (1 << 2)\n #define MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW (1 << 3)\n@@ -423,6 +426,9 @@ mlx5_args_check(const char *key, const char *val, void *opaque)\n \tstruct mlx5_dev_config *config = opaque;\n \tunsigned long tmp;\n \n+\t/* No-op, port representors are processed in mlx5_dev_spawn(). */\n+\tif (!strcmp(MLX5_REPRESENTOR, key))\n+\t\treturn 0;\n \terrno = 0;\n \ttmp = strtoul(val, NULL, 0);\n \tif (errno) {\n@@ -495,6 +501,7 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)\n \t\tMLX5_RX_VEC_EN,\n \t\tMLX5_L3_VXLAN_EN,\n \t\tMLX5_VF_NL_EN,\n+\t\tMLX5_REPRESENTOR,\n \t\tNULL,\n \t};\n \tstruct rte_kvargs *kvlist;\n@@ -1173,13 +1180,34 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,\n \tstruct rte_eth_dev **eth_list = NULL;\n \tstruct ibv_context *ctx;\n \tstruct ibv_device_attr_ex attr;\n+\tstruct rte_eth_devargs eth_da;\n \tvoid *tmp;\n \tunsigned int i;\n \tunsigned int j = 0;\n \tunsigned int n = 0;\n \tint ret;\n \n+\tif (dpdk_dev->devargs) {\n+\t\tret = rte_eth_devargs_parse(dpdk_dev->devargs->args, &eth_da);\n+\t\tif (ret) {\n+\t\t\trte_errno = -ret;\n+\t\t\tDRV_LOG(ERR, \"failed to process device arguments: %s\",\n+\t\t\t\tstrerror(rte_errno));\n+\t\t\tgoto error;\n+\t\t}\n+\t} else {\n+\t\tmemset(&eth_da, 0, sizeof(eth_da));\n+\t}\n next:\n+\tif (j) {\n+\t\tunsigned int k;\n+\n+\t\tfor (k = 0; k < eth_da.nb_representor_ports; ++k)\n+\t\t\tif (eth_da.representor_ports[k] == j - 1)\n+\t\t\t\tbreak;\n+\t\tif (k == eth_da.nb_representor_ports)\n+\t\t\tgoto skip;\n+\t}\n \terrno = 0;\n \tctx = mlx5_glue->open_device(ibv_dev[j]);\n \tif (!ctx) {\n@@ -1218,6 +1246,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,\n \t\t\tgoto error;\n \t\t++n;\n \t}\n+skip:\n \tif (ibv_dev[++j])\n \t\tgoto next;\n \teth_list[n] = NULL;\n",
    "prefixes": [
        "v2",
        "7/7"
    ]
}