get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2175,
    "url": "https://patches.dpdk.org/api/patches/2175/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20141227151300.7b62f5bf@urahara/",
    "project": {
        "id": 1,
        "url": "https://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": "<20141227151300.7b62f5bf@urahara>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20141227151300.7b62f5bf@urahara",
    "date": "2014-12-27T23:13:00",
    "name": "[dpdk-dev,RFC] resolve conflict between net/ethernet.h and rte_ethdev.h",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "b5a302db17bc89c0e2094f803b849cbc17fcba86",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20141227151300.7b62f5bf@urahara/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/2175/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/2175/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 A711856AB;\n\tSun, 28 Dec 2014 00:13:15 +0100 (CET)",
            "from mail-pd0-f176.google.com (mail-pd0-f176.google.com\n\t[209.85.192.176]) by dpdk.org (Postfix) with ESMTP id 188A62EDA\n\tfor <dev@dpdk.org>; Sun, 28 Dec 2014 00:13:13 +0100 (CET)",
            "by mail-pd0-f176.google.com with SMTP id r10so14912318pdi.21\n\tfor <dev@dpdk.org>; Sat, 27 Dec 2014 15:13:11 -0800 (PST)",
            "from urahara (static-50-53-82-155.bvtn.or.frontiernet.net.\n\t[50.53.82.155]) by mx.google.com with ESMTPSA id\n\tmw3sm7265562pdb.70.2014.12.27.15.13.08 for <dev@dpdk.org>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSat, 27 Dec 2014 15:13:09 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:date:from:to:subject:message-id:mime-version\n\t:content-type:content-transfer-encoding;\n\tbh=LBr/IM8pIGyjCSosBw3caX71yMuqiUqLNs+LRISrXME=;\n\tb=ST9UB/Dvwb0VzT1MagQE0edX0MMC8nlAEFvduiY/36hlxIkbL/bfPGkeS6gOjxijY1\n\tqyIHqF1x7fIshNbxp5wmPk71JLRD1pq6iFlK2XHGau69eDlp1DjSFDVVh1KKXatD6r10\n\tVhfcSTFuqtte6GPjvzBsags0qnu4yEmMlrhEfiUQ0IwIsd4+FFt4tTi2eblBfaMef4KN\n\tXjaWliElZ3Azn5bM653/Xiht6/eMBGrTAlIaJb0/p8bEKHVeBOJzAkZYRd6tfvrXlMtz\n\tkvG/CG/tA+lMbM+kKR3s5ZOYx6jID/9NKWOX3oc3u3mReb1yBtFDdPreBwKViT0tTthe\n\teWDw==",
        "X-Gm-Message-State": "ALoCoQkOa1mT2SVfUHYKCHyP1BiVMZGSkS16VvBpmQ8kO36/rQ6vVMBhKd//mSTuMfOuY3AThniL",
        "X-Received": "by 10.70.55.163 with SMTP id t3mr78707860pdp.8.1419721990111;\n\tSat, 27 Dec 2014 15:13:10 -0800 (PST)",
        "Date": "Sat, 27 Dec 2014 15:13:00 -0800",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Message-ID": "<20141227151300.7b62f5bf@urahara>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "7bit",
        "Subject": "[dpdk-dev] [RFC] resolve conflict between net/ethernet.h and\n\trte_ethdev.h",
        "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": "This is a patch to address the conflict between <net/ethernet.h>\nand the definitions in <rte_ethdev.h>. It has two side effects\nworth discussion:\n  1. It forces inclusion of net/ethernet.h\n  2. It has definition to deal with the differing structure elements\n     in the two versions of struct ether_addr.\n\nBy doing this ether_ntoa and related functions can be used without\nmessing with prototypes.\n\nAlternative is more complex #ifdef magic like linux/libc-compat.h",
    "diff": "--- a/lib/librte_ether/rte_ether.h\n+++ b/lib/librte_ether/rte_ether.h\n@@ -46,17 +46,11 @@\n \n #include <stdint.h>\n #include <stdio.h>\n+#include <net/ethernet.h>\n \n #include <rte_memcpy.h>\n #include <rte_random.h>\n \n-#define ETHER_ADDR_LEN  6 /**< Length of Ethernet address. */\n-#define ETHER_TYPE_LEN  2 /**< Length of Ethernet type field. */\n-#define ETHER_CRC_LEN   4 /**< Length of Ethernet CRC. */\n-#define ETHER_HDR_LEN   \\\n-\t(ETHER_ADDR_LEN * 2 + ETHER_TYPE_LEN) /**< Length of Ethernet header. */\n-#define ETHER_MIN_LEN   64    /**< Minimum frame len, including CRC. */\n-#define ETHER_MAX_LEN   1518  /**< Maximum frame len, including CRC. */\n #define ETHER_MTU       \\\n \t(ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN) /**< Ethernet MTU. */\n \n@@ -69,25 +63,12 @@\n #define ETHER_MAX_VLAN_ID  4095 /**< Maximum VLAN ID. */\n \n #define ETHER_MIN_MTU 68 /**< Minimum MTU for IPv4 packets, see RFC 791. */\n-\n-/**\n- * Ethernet address:\n- * A universally administered address is uniquely assigned to a device by its\n- * manufacturer. The first three octets (in transmission order) contain the\n- * Organizationally Unique Identifier (OUI). The following three (MAC-48 and\n- * EUI-48) octets are assigned by that organization with the only constraint\n- * of uniqueness.\n- * A locally administered address is assigned to a device by a network\n- * administrator and does not contain OUIs.\n- * See http://standards.ieee.org/regauth/groupmac/tutorial.html\n- */\n-struct ether_addr {\n-\tuint8_t addr_bytes[ETHER_ADDR_LEN]; /**< Address bytes in transmission order */\n-} __attribute__((__packed__));\n-\n #define ETHER_LOCAL_ADMIN_ADDR 0x02 /**< Locally assigned Eth. address. */\n #define ETHER_GROUP_ADDR       0x01 /**< Multicast or broadcast Eth. address. */\n \n+/* Deprecated definition to allow for compatiablity with net/ethernet.h */\n+#define addr_bytes\tether_addr_octet\n+\n /**\n  * Check if two Ethernet addresses are the same.\n  *\n@@ -107,7 +88,7 @@\n {\n \tint i;\n \tfor (i = 0; i < ETHER_ADDR_LEN; i++)\n-\t\tif (ea1->addr_bytes[i] != ea2->addr_bytes[i])\n+\t\tif (ea1->ether_addr_octet[i] != ea2->ether_addr_octet[i])\n \t\t\treturn 0;\n \treturn 1;\n }\n@@ -126,7 +107,7 @@\n {\n \tint i;\n \tfor (i = 0; i < ETHER_ADDR_LEN; i++)\n-\t\tif (ea->addr_bytes[i] != 0x00)\n+\t\tif (ea->ether_addr_octet[i] != 0x00)\n \t\t\treturn 0;\n \treturn 1;\n }\n@@ -143,7 +124,7 @@\n  */\n static inline int is_unicast_ether_addr(const struct ether_addr *ea)\n {\n-\treturn ((ea->addr_bytes[0] & ETHER_GROUP_ADDR) == 0);\n+\treturn ((ea->ether_addr_octet[0] & ETHER_GROUP_ADDR) == 0);\n }\n \n /**\n@@ -158,7 +139,7 @@\n  */\n static inline int is_multicast_ether_addr(const struct ether_addr *ea)\n {\n-\treturn (ea->addr_bytes[0] & ETHER_GROUP_ADDR);\n+\treturn (ea->ether_addr_octet[0] & ETHER_GROUP_ADDR);\n }\n \n /**\n@@ -191,7 +172,7 @@\n  */\n static inline int is_universal_ether_addr(const struct ether_addr *ea)\n {\n-\treturn ((ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) == 0);\n+\treturn ((ea->ether_addr_octet[0] & ETHER_LOCAL_ADMIN_ADDR) == 0);\n }\n \n /**\n@@ -206,7 +187,7 @@\n  */\n static inline int is_local_admin_ether_addr(const struct ether_addr *ea)\n {\n-\treturn ((ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) != 0);\n+\treturn ((ea->ether_addr_octet[0] & ETHER_LOCAL_ADMIN_ADDR) != 0);\n }\n \n /**\n@@ -253,8 +234,8 @@\n \t\t\t\t   struct ether_addr *ea_to)\n {\n #ifdef __INTEL_COMPILER\n-\tuint16_t *from_words = (uint16_t *)(ea_from->addr_bytes);\n-\tuint16_t *to_words   = (uint16_t *)(ea_to->addr_bytes);\n+\tuint16_t *from_words = (uint16_t *)(ea_from->ether_addr_octet);\n+\tuint16_t *to_words   = (uint16_t *)(ea_to->ether_addr_octet);\n \n \tto_words[0] = from_words[0];\n \tto_words[1] = from_words[1];\n@@ -283,12 +264,12 @@\n \t\t  const struct ether_addr *eth_addr)\n {\n \tsnprintf(buf, size, \"%02X:%02X:%02X:%02X:%02X:%02X\",\n-\t\t eth_addr->addr_bytes[0],\n-\t\t eth_addr->addr_bytes[1],\n-\t\t eth_addr->addr_bytes[2],\n-\t\t eth_addr->addr_bytes[3],\n-\t\t eth_addr->addr_bytes[4],\n-\t\t eth_addr->addr_bytes[5]);\n+\t\t eth_addr->ether_addr_octet[0],\n+\t\t eth_addr->ether_addr_octet[1],\n+\t\t eth_addr->ether_addr_octet[2],\n+\t\t eth_addr->ether_addr_octet[3],\n+\t\t eth_addr->ether_addr_octet[4],\n+\t\t eth_addr->ether_addr_octet[5]);\n }\n \n /**\n",
    "prefixes": [
        "dpdk-dev",
        "RFC"
    ]
}