get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28376,
    "url": "http://patches.dpdk.org/api/patches/28376/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/37eb55eea3810bebde392d934e7366efaeb0f0a8.1504614801.git.adrien.mazarguil@6wind.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": "<37eb55eea3810bebde392d934e7366efaeb0f0a8.1504614801.git.adrien.mazarguil@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/37eb55eea3810bebde392d934e7366efaeb0f0a8.1504614801.git.adrien.mazarguil@6wind.com",
    "date": "2017-09-05T12:56:38",
    "name": "[dpdk-dev,v1,2/3] net/mlx4: fix rescheduled link status check",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fd75e462ceb72c1c6009d34d07c51b9d295e8fea",
    "submitter": {
        "id": 165,
        "url": "http://patches.dpdk.org/api/people/165/?format=api",
        "name": "Adrien Mazarguil",
        "email": "adrien.mazarguil@6wind.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/37eb55eea3810bebde392d934e7366efaeb0f0a8.1504614801.git.adrien.mazarguil@6wind.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/28376/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/28376/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id E357437A0;\n\tTue,  5 Sep 2017 14:57:00 +0200 (CEST)",
            "from mail-wm0-f54.google.com (mail-wm0-f54.google.com\n\t[74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 36C23378E\n\tfor <dev@dpdk.org>; Tue,  5 Sep 2017 14:56:58 +0200 (CEST)",
            "by mail-wm0-f54.google.com with SMTP id u26so18958024wma.0\n\tfor <dev@dpdk.org>; Tue, 05 Sep 2017 05:56:58 -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\tb53sm579089wrd.40.2017.09.05.05.56.56\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 05 Sep 2017 05:56:56 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=c2VkEKS2e/Iaf5n575dkqmL9JOy6/I6f3QdINGvYtA8=;\n\tb=n7/LX5fnuBZABgZcNCM08021OxykFiala4zzNdefskFRu4sYz+gCk5GP0BZcLDrKte\n\tpxFSUIX3X1ry5qG/DyZfaPlsuNg1MwfGPMsI9R7xG6I+DV0BikV8eURWX87KZ0KtHLGa\n\tK/VyC5fd28aHrnvsjlEWcff0e5GJ9bRIaEPI0X+vmtHqNZ0kPW41sxsm2fNESW0SH4i4\n\tcNcNbAKY+6Pc55pq3VnyfVfD95KwLHtAWE2wGOCpt6tOJcW1KdP1jqE00hkiuFQpBTHy\n\tf7O/pXMzNzEiCFVwuU+joLJb7CbDlXm+dw2MD7D2zMSKOyCkiDourisSF3JYTJC/SByO\n\tZGPQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=c2VkEKS2e/Iaf5n575dkqmL9JOy6/I6f3QdINGvYtA8=;\n\tb=TOWh08Pg4QFUepQ/XtAn98WMRgrZAMhaauhrdFuxIM04lvhPVnER7pI8HeQyaBHscw\n\t8gmnim3UZADqs8zf0N3fpZVlkg3DuEr0MMShQS49CFwNFWHJOJzf6YDyeAnp83jiAvNn\n\tw7fwFIlJH6xAsoJlPoO+psMQNohxzAmKyjWKdwAkdlZBi6dbG3BLdVe9B3T2kymPUd45\n\t8N6C5W1Choaev70aElGLqODpOVMPuahOurbtNgcejO/+5tXFkFcRC51n2WigE632jsFW\n\tClZQCsM/cJIP6+uRfdyOyF8+sEgLRHwi5AAvSEdBQOrDGpD9ISpBoTF2Fuy8qtbsp0ld\n\tOhSg==",
        "X-Gm-Message-State": "AHPjjUiz65ziVC+6UnX+sKdiYad9+g/iUGajH8hFeYPq3LarN4bmfJYV\n\tjfIIbDkZfI67YS7h",
        "X-Google-Smtp-Source": "ADKCNb59yYu6qn+cFDJko+DTYzkeCC9WGD/yy/qos7002gY3KQDuHZdgmMsylFI1vXqT2KeHBqnBYg==",
        "X-Received": "by 10.28.227.68 with SMTP id a65mr2439134wmh.88.1504616217892;\n\tTue, 05 Sep 2017 05:56:57 -0700 (PDT)",
        "From": "Adrien Mazarguil <adrien.mazarguil@6wind.com>",
        "To": "Gaetan Rivet <gaetan.rivet@6wind.com>, Matan Azrad <matan@mellanox.com>",
        "Cc": "dev@dpdk.org,\n\tstable@dpdk.org",
        "Date": "Tue,  5 Sep 2017 14:56:38 +0200",
        "Message-Id": "<37eb55eea3810bebde392d934e7366efaeb0f0a8.1504614801.git.adrien.mazarguil@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<cover.1504614801.git.adrien.mazarguil@6wind.com>",
        "References": "<cover.1504614801.git.adrien.mazarguil@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v1 2/3] net/mlx4: fix rescheduled link status\n\tcheck",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Link status is sometimes inconsistent during a LSC event. When it occurs,\nthe PMD refrains from immediately notifying the application; instead, an\nalarm is scheduled to check link status later and notify the application\nonce it has settled.\n\nThe problem is that subsequent link status checks are only performed if\nadditional LSC events occur in the meantime, which is not always the case.\n\nWorse, since support for removal events was added, rescheduled link status\nchecks may consume them as well without notifying the application. With the\nright timing, a link loss occurring just before a device removal event may\nhide it from the application.\n\nFixes: 6dd7b7056d7f (\"net/mlx4: support device removal event\")\nFixes: 2d449f7c52de (\"net/mlx4: fix assertion failure on link update\")\nCc: stable@dpdk.org\nCc: Gaetan Rivet <gaetan.rivet@6wind.com>\n\nReported-by: Matan Azrad <matan@mellanox.com>\nSigned-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n---\n drivers/net/mlx4/mlx4_intr.c | 71 +++++++++++++++++++++++++--------------\n 1 file changed, 46 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/mlx4/mlx4_intr.c b/drivers/net/mlx4/mlx4_intr.c\nindex d7f1098..e1e6c05 100644\n--- a/drivers/net/mlx4/mlx4_intr.c\n+++ b/drivers/net/mlx4/mlx4_intr.c\n@@ -59,7 +59,7 @@\n #include \"mlx4_rxtx.h\"\n #include \"mlx4_utils.h\"\n \n-static void mlx4_link_status_alarm(struct priv *priv);\n+static int mlx4_link_status_check(struct priv *priv);\n \n /**\n  * Clean up Rx interrupts handler.\n@@ -149,8 +149,6 @@ static int\n mlx4_collect_interrupt_events(struct priv *priv, uint32_t *events)\n {\n \tstruct ibv_async_event event;\n-\tint port_change = 0;\n-\tstruct rte_eth_link *link = &priv->dev->data->dev_link;\n \tconst struct rte_intr_conf *const intr_conf =\n \t\t&priv->dev->data->dev_conf.intr_conf;\n \tint ret = 0;\n@@ -163,9 +161,9 @@ mlx4_collect_interrupt_events(struct priv *priv, uint32_t *events)\n \t\tswitch (event.event_type) {\n \t\tcase IBV_EVENT_PORT_ACTIVE:\n \t\tcase IBV_EVENT_PORT_ERR:\n-\t\t\tif (!intr_conf->lsc)\n+\t\t\tif (!intr_conf->lsc || mlx4_link_status_check(priv))\n \t\t\t\tbreak;\n-\t\t\tport_change = 1;\n+\t\t\t*events |= (1 << RTE_ETH_EVENT_INTR_LSC);\n \t\t\tret++;\n \t\t\tbreak;\n \t\tcase IBV_EVENT_DEVICE_FATAL:\n@@ -180,47 +178,70 @@ mlx4_collect_interrupt_events(struct priv *priv, uint32_t *events)\n \t\t}\n \t\tibv_ack_async_event(&event);\n \t}\n-\tif (!port_change)\n-\t\treturn ret;\n-\tmlx4_link_update(priv->dev, 0);\n-\tif (((link->link_speed == 0) && link->link_status) ||\n-\t    ((link->link_speed != 0) && !link->link_status)) {\n-\t\tif (!priv->intr_alarm) {\n-\t\t\t/* Inconsistent status, check again later. */\n-\t\t\tpriv->intr_alarm = 1;\n-\t\t\trte_eal_alarm_set(MLX4_INTR_ALARM_TIMEOUT,\n-\t\t\t\t\t  (void (*)(void *))\n-\t\t\t\t\t  mlx4_link_status_alarm,\n-\t\t\t\t\t  priv);\n-\t\t}\n-\t} else {\n-\t\t*events |= (1 << RTE_ETH_EVENT_INTR_LSC);\n-\t}\n \treturn ret;\n }\n \n /**\n  * Process scheduled link status check.\n  *\n+ * If LSC interrupts are requested, process related callback.\n+ *\n  * @param priv\n  *   Pointer to private structure.\n  */\n static void\n mlx4_link_status_alarm(struct priv *priv)\n {\n-\tuint32_t events;\n-\tint ret;\n+\tconst struct rte_intr_conf *const intr_conf =\n+\t\t&priv->dev->data->dev_conf.intr_conf;\n \n \tassert(priv->intr_alarm == 1);\n \tpriv->intr_alarm = 0;\n-\tret = mlx4_collect_interrupt_events(priv, &events);\n-\tif (ret > 0 && events & (1 << RTE_ETH_EVENT_INTR_LSC))\n+\tif (intr_conf->lsc && !mlx4_link_status_check(priv))\n \t\t_rte_eth_dev_callback_process(priv->dev,\n \t\t\t\t\t      RTE_ETH_EVENT_INTR_LSC,\n \t\t\t\t\t      NULL, NULL);\n }\n \n /**\n+ * Check link status.\n+ *\n+ * In case of inconsistency, another check is scheduled.\n+ *\n+ * @param priv\n+ *   Pointer to private structure.\n+ *\n+ * @return\n+ *   0 on success (link status is consistent), negative errno value\n+ *   otherwise and rte_errno is set.\n+ */\n+static int\n+mlx4_link_status_check(struct priv *priv)\n+{\n+\tstruct rte_eth_link *link = &priv->dev->data->dev_link;\n+\tint ret = mlx4_link_update(priv->dev, 0);\n+\n+\tif (ret)\n+\t\treturn ret;\n+\tif ((!link->link_speed && link->link_status) ||\n+\t    (link->link_speed && !link->link_status)) {\n+\t\tif (!priv->intr_alarm) {\n+\t\t\t/* Inconsistent status, check again later. */\n+\t\t\tret = rte_eal_alarm_set(MLX4_INTR_ALARM_TIMEOUT,\n+\t\t\t\t\t\t(void (*)(void *))\n+\t\t\t\t\t\tmlx4_link_status_alarm,\n+\t\t\t\t\t\tpriv);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\t\t\tpriv->intr_alarm = 1;\n+\t\t}\n+\t\trte_errno = EINPROGRESS;\n+\t\treturn -rte_errno;\n+\t}\n+\treturn 0;\n+}\n+\n+/**\n  * Handle interrupts from the NIC.\n  *\n  * @param priv\n",
    "prefixes": [
        "dpdk-dev",
        "v1",
        "2/3"
    ]
}