get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15547,
    "url": "http://patches.dpdk.org/api/patches/15547/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/C281A17C31CFD745B242416D0E96EC63AB81F629@ONWVEXCHMB04.ciena.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": "<C281A17C31CFD745B242416D0E96EC63AB81F629@ONWVEXCHMB04.ciena.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/C281A17C31CFD745B242416D0E96EC63AB81F629@ONWVEXCHMB04.ciena.com",
    "date": "2016-08-30T13:12:44",
    "name": "[dpdk-dev,v1] dpdk-devbind.py: Virtio interface issue.",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "31db88521adbab4d8f7c15d1dbfdd84ba7d44ed7",
    "submitter": {
        "id": 552,
        "url": "http://patches.dpdk.org/api/people/552/?format=api",
        "name": "Mussar, Gary",
        "email": "gmussar@ciena.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/C281A17C31CFD745B242416D0E96EC63AB81F629@ONWVEXCHMB04.ciena.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/15547/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/15547/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 769E52BF1;\n\tTue, 30 Aug 2016 15:12:56 +0200 (CEST)",
            "from mx0a-00103a01.pphosted.com (mx0b-00103a01.pphosted.com\n\t[67.231.152.227]) by dpdk.org (Postfix) with ESMTP id 0EF9D2956\n\tfor <dev@dpdk.org>; Tue, 30 Aug 2016 15:12:54 +0200 (CEST)",
            "from pps.filterd (m0002317.ppops.net [127.0.0.1])\n\tby mx0b-00103a01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id\n\tu7UDBUjq022640; Tue, 30 Aug 2016 09:12:54 -0400",
            "from vawvcgsie2k1301.ciena.com (lin1-118-36-35.ciena.com\n\t[63.118.36.35])\n\tby mx0b-00103a01.pphosted.com with ESMTP id 25373eree5-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tTue, 30 Aug 2016 09:12:53 -0400",
            "from VAWVE2K13MBX01.ciena.com (10.4.156.87) by\n\tVAWVCGSIE2K1301.ciena.com (10.4.62.15) with Microsoft SMTP Server\n\t(TLS) id 15.0.1104.5; Tue, 30 Aug 2016 09:12:53 -0400",
            "from ONWVEXCHHT02.ciena.com (10.128.6.17) by\n\tVAWVE2K13MBX01.ciena.com (10.4.156.87) with Microsoft SMTP Server\n\t(TLS) id 15.0.1104.5; Tue, 30 Aug 2016 09:12:46 -0400",
            "from ONWVEXCHMB04.ciena.com ([::1]) by ONWVEXCHHT02.ciena.com\n\t([::1]) with mapi; Tue, 30 Aug 2016 09:12:46 -0400"
        ],
        "From": "\"Mussar, Gary\" <gmussar@ciena.com>",
        "To": "\"Dey, Souvik\" <sodey@sonusnet.com>, Stephen Hemminger\n\t<stephen@networkplumber.org>",
        "CC": "\"nhorman@tuxdriver.com\" <nhorman@tuxdriver.com>, \"dev@dpdk.org\"\n\t<dev@dpdk.org>",
        "Date": "Tue, 30 Aug 2016 09:12:44 -0400",
        "Thread-Topic": "[dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.",
        "Thread-Index": "AQHR/ngJrYBSlPHhJUWN6RhK2Yt0WKBbZ3YAgACM9VCABBxAUIAAiEwAgADnIXA=",
        "Message-ID": "<C281A17C31CFD745B242416D0E96EC63AB81F629@ONWVEXCHMB04.ciena.com>",
        "References": "<20160825022546.96468-1-sodey@sonusnet.com>\n\t<20160826085500.5691e07d@xeon-e3>\n\t<BN6PR03MB2740E7E9FFD9EC7D093A3442DAEF0@BN6PR03MB2740.namprd03.prod.outlook.com>\n\t<C281A17C31CFD745B242416D0E96EC63AB81F535@ONWVEXCHMB04.ciena.com>\n\t<BN6PR03MB27402670D815D01FE58D3E38DAE10@BN6PR03MB2740.namprd03.prod.outlook.com>",
        "In-Reply-To": "<BN6PR03MB27402670D815D01FE58D3E38DAE10@BN6PR03MB2740.namprd03.prod.outlook.com>",
        "Accept-Language": "en-US",
        "Content-Language": "en-US",
        "X-MS-Has-Attach": "",
        "X-MS-TNEF-Correlator": "",
        "acceptlanguage": "en-US",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "quoted-printable",
        "MIME-Version": "1.0",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2016-08-30_06:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0\n\tpriorityscore=1501 suspectscore=0\n\tmalwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015\n\timpostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam\n\tadjust=0\n\treason=mlx scancount=1 engine=8.0.1-1604210000\n\tdefinitions=main-1608300129",
        "Subject": "Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "-----Original Message-----\nFrom: Dey, Souvik [mailto:sodey@sonusnet.com] \nSent: Monday, August 29, 2016 7:17 PM\nTo: Mussar, Gary; Stephen Hemminger\nCc: nhorman@tuxdriver.com; dev@dpdk.org\nSubject: RE: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.\n\nHi,\n\nI already followed the 100% python way and submitted the v3 of this patch. http://dpdk.org/dev/patchwork/patch/15378/\nHow will your patch be different in solving the issue. There will always be multiple ways to solving things right.\n\nGM> When I first tackled this problem I used Popen() and got the exact same feedback about using 100% python. The version I posted yesterday satisfied the internal reviewers. \n\n\nV3 of my submitted patch:\n\n-------------------------------------------\n\nGary\n\n-----Original Message-----\nFrom: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Dey, Souvik\nSent: Friday, August 26, 2016 8:21 PM\nTo: Stephen Hemminger\nCc: nhorman@tuxdriver.com; dev@dpdk.org\nSubject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.\n\nHi ,\n\tI have already updated it and have re submitted the patch v3. Can you please check that http://dpdk.org/dev/patchwork/patch/15378/\n--\nRegards,\nSouvik\n\n-----Original Message-----\nFrom: Stephen Hemminger [mailto:stephen@networkplumber.org]\nSent: Friday, August 26, 2016 11:55 AM\nTo: Dey, Souvik <sodey@sonusnet.com>\nCc: nhorman@tuxdriver.com; dev@dpdk.org\nSubject: Re: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.\n\nOn Wed, 24 Aug 2016 22:25:46 -0400\nsouvikdey33 <sodey@sonusnet.com> wrote:\n\n> +    #The path for virtio devices are different. Get the correct path.\n> +\tvirtio = \"/sys/bus/pci/devices/%s/\" % dev_id\n> +    cmd = \" ls %s | grep 'virt' \" %virtio\n> +    virtio = commands.getoutput(cmd)\n> +    virtio_sys_path = \"/sys/bus/pci/devices/%s/%s/net/\" %\n> +(dev_id,virtio)\n>      if exists(sys_path):\n>          device[\"Interface\"] = \",\".join(os.listdir(sys_path))\n\nThere should be a way to do this in python without going out to shell.\nThis would be safer and more secure.\n\nThe code already uses os.listdir() (which is the python library version of ls) in later section. Why not use that here to check for virtio bus.",
    "diff": "diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py index b69ca2a..c0b46ee 100755\n--- a/tools/dpdk-devbind.py\n+++ b/tools/dpdk-devbind.py\n@@ -36,6 +36,7 @@  import sys\n import os\n import getopt\n import subprocess\n+\n from os.path import exists, abspath, dirname, basename\n \n # The PCI base class for NETWORK devices @@ -222,8 +223,19 @@  def get_pci_device_details(dev_id):\n         device[name] = value\n     # check for a unix interface name\n     sys_path = \"/sys/bus/pci/devices/%s/net/\" % dev_id\n+    # the path for virtio devices are different, so get the correct path\n+    virtio = \"/sys/bus/pci/devices/%s/\" % dev_id\n+    ls = subprocess.Popen(['ls', virtio], stdout=subprocess.PIPE)\n+    grep = subprocess.Popen('grep virt'.split(), stdin=ls.stdout,\n+                            stdout=subprocess.PIPE)\n+    ls.stdout.close()\n+    virtio = grep.communicate()[0].rstrip()\n+    ls.wait()\n+    virtio_sys_path = \"/sys/bus/pci/devices/%s/%s/net/\" % (dev_id, \n+ virtio)\n     if exists(sys_path):\n         device[\"Interface\"] = \",\".join(os.listdir(sys_path))\n+    elif exists(virtio_sys_path):\n+        device[\"Interface\"] = \",\".join(os.listdir(virtio_sys_path))\n     else:\n         device[\"Interface\"] = \"\"\n     # check if a port is used for ssh connection\n\n\n-----Original Message-----\nFrom: Mussar, Gary [mailto:gmussar@ciena.com]\nSent: Monday, August 29, 2016 11:10 AM\nTo: Dey, Souvik <sodey@sonusnet.com>; Stephen Hemminger <stephen@networkplumber.org>\nCc: nhorman@tuxdriver.com; dev@dpdk.org\nSubject: RE: [dpdk-dev] [PATCH v1] dpdk-devbind.py: Virtio interface issue.\n\nWe did this slightly differently. This is 100% python and is a bit more general. We search for the first \"net\" directory under the specific device directory.\n\n-------------------------------------------\n--- tools/dpdk-devbind.py       2016-08-29 11:02:35.594202888 -0400\n+++ ../dpdk/tools/dpdk-devbind.py 2016-08-29 11:00:34.897677233 -0400\n@@ -221,11 +221,11 @@\n         name = name.strip(\":\") + \"_str\"\n         device[name] = value\n     # check for a unix interface name\n-    sys_path = \"/sys/bus/pci/devices/%s/net/\" % dev_id\n-    if exists(sys_path):\n-        device[\"Interface\"] = \",\".join(os.listdir(sys_path))\n-    else:\n-        device[\"Interface\"] = \"\"\n+    device[\"Interface\"] = \"\"\n+    for base, dirs, files in os.walk(\"/sys/bus/pci/devices/%s/\" % dev_id):\n+        if \"net\" in dirs:\n+            device[\"Interface\"] = \",\".join(os.listdir(os.path.join(base,\"net\")))\n+            break\n     # check if a port is used for ssh connection\n     device[\"Ssh_if\"] = False\n     device[\"Active\"] = \"\"\n",
    "prefixes": [
        "dpdk-dev",
        "v1"
    ]
}