get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 814647,
    "url": "http://patchwork.ozlabs.org/api/patches/814647/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1505651798-106642-2-git-send-email-robert.hu@linux.intel.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505651798-106642-2-git-send-email-robert.hu@linux.intel.com>",
    "list_archive_url": null,
    "date": "2017-09-17T12:36:37",
    "name": "[pktgen,script,v2,1/2] Add some helper functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "c78539cb41da6f1d9dd1802623e5b4422c12188f",
    "submitter": {
        "id": 72226,
        "url": "http://patchwork.ozlabs.org/api/people/72226/?format=api",
        "name": "Robert Hoo",
        "email": "robert.hu@linux.intel.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1505651798-106642-2-git-send-email-robert.hu@linux.intel.com/mbox/",
    "series": [
        {
            "id": 3512,
            "url": "http://patchwork.ozlabs.org/api/series/3512/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=3512",
            "date": "2017-09-17T12:36:36",
            "name": "Add a pktgen sample script of NUMA awareness",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/3512/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814647/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814647/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xw7tc2CWTz9sDB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 17 Sep 2017 22:36:56 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751407AbdIQMgt (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 17 Sep 2017 08:36:49 -0400",
            "from mga04.intel.com ([192.55.52.120]:56558 \"EHLO mga04.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1750885AbdIQMgs (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tSun, 17 Sep 2017 08:36:48 -0400",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Sep 2017 05:36:47 -0700",
            "from sqa-gate.sh.intel.com (HELO kvm-host.tsp.org)\n\t([10.239.48.212])\n\tby fmsmga004.fm.intel.com with ESMTP; 17 Sep 2017 05:36:46 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,407,1500966000\"; d=\"scan'208\";a=\"312616194\"",
        "From": "Robert Hoo <robert.hu@linux.intel.com>",
        "To": "brouer@redhat.com, davem@davemloft.net, tariqt@mellanox.com,\n\tkyle.leet@gmail.com",
        "Cc": "netdev@vger.kernel.org, robert.hu@intel.com",
        "Subject": "[pktgen script v2 1/2] Add some helper functions",
        "Date": "Sun, 17 Sep 2017 20:36:37 +0800",
        "Message-Id": "<1505651798-106642-2-git-send-email-robert.hu@linux.intel.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1505651798-106642-1-git-send-email-robert.hu@linux.intel.com>",
        "References": "<1505651798-106642-1-git-send-email-robert.hu@linux.intel.com>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Robert Hoo <robert.hu@intel.com>\n\n1. given a device, get its NUMA belongings\n2. given a device, get its queues' irq numbers.\n3. given a NUMA node, get its cpu id list.\n\nSigned-off-by: Robert Hoo <robert.hu@intel.com>\n---\n pktgen/functions.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 44 insertions(+)",
    "diff": "diff --git a/pktgen/functions.sh b/pktgen/functions.sh\nindex 205e4cd..09dfe7a 100644\n--- a/pktgen/functions.sh\n+++ b/pktgen/functions.sh\n@@ -119,3 +119,47 @@ function root_check_run_with_sudo() {\n \terr 4 \"cannot perform sudo run of $0\"\n     fi\n }\n+\n+# Exact input device's NUMA node info\n+function get_iface_node()\n+{\n+    local node=$(</sys/class/net/$1/device/numa_node)\n+    if [[ $node == -1 ]]; then\n+        echo 0\n+    else\n+        echo $node\n+    fi\n+}\n+\n+# Given an Dev/iface, get its queues' irq numbers\n+function get_iface_irqs()\n+{\n+\tlocal IFACE=$1\n+\tlocal queues=\"${IFACE}-.*TxRx\"\n+\n+\tirqs=$(grep \"$queues\" /proc/interrupts | cut -f1 -d:)\n+\t[ -z \"$irqs\" ] && irqs=$(grep $IFACE /proc/interrupts | cut -f1 -d:)\n+\t[ -z \"$irqs\" ] && irqs=$(for i in `ls -Ux /sys/class/net/$IFACE/device/msi_irqs` ;\\\n+\t    do grep \"$i:.*TxRx\" /proc/interrupts | grep -v fdir | cut -f 1 -d : ;\\\n+\t    done)\n+\t[ -z \"$irqs\" ] && err 3 \"Could not find interrupts for $IFACE\"\n+\n+\techo $irqs\n+}\n+\n+# Given a NUMA node, return cpu ids belonging to it.\n+function get_node_cpus()\n+{\n+\tlocal node=$1\n+\tlocal node_cpu_list\n+\tlocal node_cpu_range_list=`cut -f1- -d, --output-delimiter=\" \" \\\n+\t                  /sys/devices/system/node/node$node/cpulist`\n+\n+\tfor cpu_range in $node_cpu_range_list\n+\tdo\n+\t    node_cpu_list=\"$node_cpu_list \"`seq -s \" \" ${cpu_range//-/ }`\n+\tdone\n+\n+\techo $node_cpu_list\n+}\n+\n",
    "prefixes": [
        "pktgen",
        "script",
        "v2",
        "1/2"
    ]
}