get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 44977,
    "url": "http://patches.dpdk.org/api/patches/44977/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180919195549.5585-4-dg@adax.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": "<20180919195549.5585-4-dg@adax.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20180919195549.5585-4-dg@adax.com",
    "date": "2018-09-19T19:55:47",
    "name": "[v2,3/5] examples/kni: monitor and update link status continually",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "37fe448d2d9d055bdbb4e934ce3465e80785a43c",
    "submitter": {
        "id": 1040,
        "url": "http://patches.dpdk.org/api/people/1040/?format=api",
        "name": "Dan Gora",
        "email": "dg@adax.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20180919195549.5585-4-dg@adax.com/mbox/",
    "series": [
        {
            "id": 1401,
            "url": "http://patches.dpdk.org/api/series/1401/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1401",
            "date": "2018-09-19T19:55:44",
            "name": "kni: add API to set link status on kernel interface",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/1401/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44977/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44977/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 3ED7F1B136;\n\tWed, 19 Sep 2018 21:56:27 +0200 (CEST)",
            "from mail-qt0-f194.google.com (mail-qt0-f194.google.com\n\t[209.85.216.194]) by dpdk.org (Postfix) with ESMTP id 222841B133\n\tfor <dev@dpdk.org>; Wed, 19 Sep 2018 21:56:26 +0200 (CEST)",
            "by mail-qt0-f194.google.com with SMTP id l42-v6so6286236qtf.13\n\tfor <dev@dpdk.org>; Wed, 19 Sep 2018 12:56:26 -0700 (PDT)",
            "from snappy.local.lan ([187.10.145.241])\n\tby smtp.gmail.com with ESMTPSA id\n\tg184-v6sm12431369qkb.15.2018.09.19.12.56.22\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 19 Sep 2018 12:56:24 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Q8m/h6wgMrJg98G+yF7Q37xFrUbI8QZydatcW7/BTNs=;\n\tb=rk/rm33JlZTp/fwvmM7hXJ3p+wgyjq95Y/guLZv8nty7533tAuH03RISdyeRTMo8Zp\n\t6ZbeNjL95fRyAIaemdwJsV0Bk6/bH+l1tpVbLE/M7pQTm/hkrXamKO2KrcRuKOcFh2C1\n\tItZMR4S/61GNQzyd0XX6zAGOe/FlFk0qzBmnZuZ2lnYoks5tLuRnQ/tMd+qOHVHOlyBa\n\tciKFEj2ZUXB2VO8swFQ3HLyNZ5dpbWLzmoMx2yeaeeD20b5TiHaC+SxdioNPEZpPpP88\n\tSQJjhZcCNRDtiYKz8esfp9/HncC7XJ0hHgrZvSncxfwq1iy8j0Zjg5vBMqLB5ubSncn3\n\tBXgQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references:mime-version:content-transfer-encoding;\n\tbh=Q8m/h6wgMrJg98G+yF7Q37xFrUbI8QZydatcW7/BTNs=;\n\tb=p1bujB6lwsAHzIkWer3H5BQUmA+sVWpsr3J4pK/fDCCLXEeF0dfkjG7uFL+f8FRAZ4\n\tf92XnTlpToqbkfiPMu7HLMJTaLeEo7jJg+FyiwcfhBmwmKBqweSMohsDruDCpUaseJOE\n\tyVxB2A5luHQSWhfIEVxlf44EkOAKT3ErxEqh1AxBISu8uBbiXnl8I+VLKeMToxCEBdBl\n\tm9VQ5rwPGCDjBQtH4hhVkM1VTWkWZzETIzWUC/mhis9QMrxvdnsmMpOlemWQ4+FaiSYz\n\tOtSXzpA4fqSIKCb1Xm+gOROqXbm4Ue6hPARy81IBLnp6PC558fcwyKqgqQ5xMlXQ9ofW\n\t0rlw==",
        "X-Gm-Message-State": "APzg51A2eTyAI+kDJ+szVCp1tkA3AjvdLxfYqlFLJ3/vVAVR0QS0Vs0v\n\t8jKPltqrhhQ9Oeik9KydzyZM78lm",
        "X-Google-Smtp-Source": "ANB0Vdb0oZ96UV5eFJuWuATJ/Kb1cMSG6b2P/C1b7I1KOywp66WdAJEZhpmfWvnC73FxBU6bINepoQ==",
        "X-Received": "by 2002:ac8:29ef:: with SMTP id\n\t44-v6mr24961810qtt.174.1537386985156; \n\tWed, 19 Sep 2018 12:56:25 -0700 (PDT)",
        "From": "Dan Gora <dg@adax.com>",
        "To": "dev@dpdk.org",
        "Cc": "Igor Ryzhov <iryzhov@nfware.com>,\n\tStephen Hemminger <stephen@networkplumber.org>, Dan Gora <dg@adax.com>,\n\tFerruh Yigit <ferruh.yigit@intel.com>",
        "Date": "Wed, 19 Sep 2018 16:55:47 -0300",
        "Message-Id": "<20180919195549.5585-4-dg@adax.com>",
        "X-Mailer": "git-send-email 2.19.0",
        "In-Reply-To": "<20180919195549.5585-1-dg@adax.com>",
        "References": "<20180911232906.18352-1-dg@adax.com>\n\t<20180919195549.5585-1-dg@adax.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 3/5] examples/kni: monitor and update link\n\tstatus continually",
        "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": "Update KNI example to continuously monitor the Ethernet link status of\nthe physical link and update the carrier status of the corresponding\ninterfaces with rte_kni_update_link().\n\nSigned-off-by: Dan Gora <dg@adax.com>\n---\n examples/kni/Makefile |  2 ++\n examples/kni/main.c   | 82 +++++++++++++++++++++----------------------\n 2 files changed, 43 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/examples/kni/Makefile b/examples/kni/Makefile\nindex 7e19d2e2a..dd90d7d73 100644\n--- a/examples/kni/Makefile\n+++ b/examples/kni/Makefile\n@@ -20,6 +20,7 @@ static: build/$(APP)-static\n \n PC_FILE := $(shell pkg-config --path libdpdk)\n CFLAGS += -O3 $(shell pkg-config --cflags libdpdk)\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n LDFLAGS_SHARED = $(shell pkg-config --libs libdpdk)\n LDFLAGS_STATIC = -Wl,-Bstatic $(shell pkg-config --static --libs libdpdk)\n \n@@ -54,6 +55,7 @@ please change the definition of the RTE_TARGET environment variable)\n endif\n \n CFLAGS += -O3\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n CFLAGS += $(WERROR_FLAGS)\n \n include $(RTE_SDK)/mk/rte.extapp.mk\ndiff --git a/examples/kni/main.c b/examples/kni/main.c\nindex 80c401c51..8c3d3839e 100644\n--- a/examples/kni/main.c\n+++ b/examples/kni/main.c\n@@ -107,6 +107,8 @@ static uint32_t ports_mask = 0;\n /* Ports set in promiscuous mode off by default. */\n static int promiscuous_on = 0;\n \n+static int kni_running;\n+\n /* Structure type for recording kni interface specific stats */\n struct kni_interface_stats {\n \t/* number of pkts received from NIC, and sent to KNI */\n@@ -620,58 +622,45 @@ init_port(uint16_t port)\n }\n \n /* Check the link status of all ports in up to 9s, and print them finally */\n-static void\n-check_all_ports_link_status(uint32_t port_mask)\n+static void *\n+check_all_ports_link_status(void *arg)\n {\n #define CHECK_INTERVAL 100 /* 100ms */\n #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */\n \tuint16_t portid;\n-\tuint8_t count, all_ports_up, print_flag = 0;\n \tstruct rte_eth_link link;\n+\tconst char *name;\n+\tchar cmd[64];\n+\tunsigned int i;\n+\tstruct kni_port_params **p = kni_port_params_array;\n+\t(void) arg;\n+\n+\tRTE_ETH_FOREACH_DEV(portid) {\n+\t\tfor (i = 0; i < p[portid]->nb_kni; i++) {\n+\t\t\tname = rte_kni_get_name(p[portid]->kni[i]);\n+\t\t\tsnprintf(cmd, sizeof(cmd),\n+\t\t\t\t\t\"/sbin/ifconfig %s up\", name);\n+\t\t\tRTE_LOG(INFO, APP,\n+\t\t\t\t\t\"Marking interface %s 'up'\\n\", name);\n+\t\t\tif (system(cmd) == -1)\n+\t\t\t\tRTE_LOG(ERR, APP,\n+\t\t\t\t  \"Error: Failed to mark interface %s 'up'\\n\",\n+\t\t\t\t\t\tname);\n+\t\t}\n+\t}\n \n-\tprintf(\"\\nChecking link status\\n\");\n-\tfflush(stdout);\n-\tfor (count = 0; count <= MAX_CHECK_TIME; count++) {\n-\t\tall_ports_up = 1;\n+\twhile (kni_running) {\n+\t\trte_delay_ms(CHECK_INTERVAL);\n \t\tRTE_ETH_FOREACH_DEV(portid) {\n-\t\t\tif ((port_mask & (1 << portid)) == 0)\n+\t\t\tif ((ports_mask & (1 << portid)) == 0)\n \t\t\t\tcontinue;\n \t\t\tmemset(&link, 0, sizeof(link));\n \t\t\trte_eth_link_get_nowait(portid, &link);\n-\t\t\t/* print link status if flag set */\n-\t\t\tif (print_flag == 1) {\n-\t\t\t\tif (link.link_status)\n-\t\t\t\t\tprintf(\n-\t\t\t\t\t\"Port%d Link Up - speed %uMbps - %s\\n\",\n-\t\t\t\t\t\tportid, link.link_speed,\n-\t\t\t\t(link.link_duplex == ETH_LINK_FULL_DUPLEX) ?\n-\t\t\t\t\t(\"full-duplex\") : (\"half-duplex\\n\"));\n-\t\t\t\telse\n-\t\t\t\t\tprintf(\"Port %d Link Down\\n\", portid);\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\t/* clear all_ports_up flag if any link down */\n-\t\t\tif (link.link_status == ETH_LINK_DOWN) {\n-\t\t\t\tall_ports_up = 0;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t\t/* after finally printing all link status, get out */\n-\t\tif (print_flag == 1)\n-\t\t\tbreak;\n-\n-\t\tif (all_ports_up == 0) {\n-\t\t\tprintf(\".\");\n-\t\t\tfflush(stdout);\n-\t\t\trte_delay_ms(CHECK_INTERVAL);\n-\t\t}\n-\n-\t\t/* set the print_flag if all ports up or timeout */\n-\t\tif (all_ports_up == 1 || count == (MAX_CHECK_TIME - 1)) {\n-\t\t\tprint_flag = 1;\n-\t\t\tprintf(\"done\\n\");\n+\t\t\tfor (i = 0; i < p[portid]->nb_kni; i++)\n+\t\t\t\trte_kni_update_link(p[portid]->kni[i], &link);\n \t\t}\n \t}\n+\treturn NULL;\n }\n \n /* Callback for request of changing MTU */\n@@ -893,6 +882,8 @@ main(int argc, char** argv)\n \tint ret;\n \tuint16_t nb_sys_ports, port;\n \tunsigned i;\n+\tvoid *retval;\n+\tpthread_t kni_link_tid;\n \n \t/* Associate signal_hanlder function with USR signals */\n \tsignal(SIGUSR1, signal_handler);\n@@ -947,7 +938,14 @@ main(int argc, char** argv)\n \n \t\tkni_alloc(port);\n \t}\n-\tcheck_all_ports_link_status(ports_mask);\n+\n+\tkni_running = 1;\n+\tret = rte_ctrl_thread_create(&kni_link_tid,\n+\t\t\t\t     \"KNI link status check\", NULL,\n+\t\t\t\t     check_all_ports_link_status, NULL);\n+\tif (ret < 0)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\"Could not create link status thread!\\n\");\n \n \t/* Launch per-lcore function on every lcore */\n \trte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER);\n@@ -955,6 +953,8 @@ main(int argc, char** argv)\n \t\tif (rte_eal_wait_lcore(i) < 0)\n \t\t\treturn -1;\n \t}\n+\tkni_running = 0;\n+\tpthread_join(kni_link_tid, &retval);\n \n \t/* Release resources */\n \tRTE_ETH_FOREACH_DEV(port) {\n",
    "prefixes": [
        "v2",
        "3/5"
    ]
}