get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8567,
    "url": "https://patches.dpdk.org/api/patches/8567/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446552059-5446-3-git-send-email-bruce.richardson@intel.com/",
    "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": "<1446552059-5446-3-git-send-email-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446552059-5446-3-git-send-email-bruce.richardson@intel.com",
    "date": "2015-11-03T12:00:57",
    "name": "[dpdk-dev,v3,2/4] ethdev: move error checking macros to header",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "ba862ca58ba183d735ee2bb820014329769ffd19",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446552059-5446-3-git-send-email-bruce.richardson@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8567/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8567/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 B88D18E91;\n\tTue,  3 Nov 2015 13:01:03 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 9A5F28E8D\n\tfor <dev@dpdk.org>; Tue,  3 Nov 2015 13:01:02 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP; 03 Nov 2015 04:01:01 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 03 Nov 2015 04:01:00 -0800",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ttA3C0xmb020569; Tue, 3 Nov 2015 12:00:59 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA3C0xKa005494;\n\tTue, 3 Nov 2015 12:00:59 GMT",
            "(from bricha3@localhost)\n\tby sivswdev01.ir.intel.com with  id tA3C0xQR005490;\n\tTue, 3 Nov 2015 12:00:59 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,238,1444719600\"; d=\"scan'208\";a=\"593143380\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  3 Nov 2015 12:00:57 +0000",
        "Message-Id": "<1446552059-5446-3-git-send-email-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446552059-5446-1-git-send-email-bruce.richardson@intel.com>",
        "References": "<1441811374-28984-1-git-send-email-bruce.richardson@intel.com>\n\t<1446552059-5446-1-git-send-email-bruce.richardson@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 2/4] ethdev: move error checking macros to\n\theader",
        "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": "Move the function ptr and port id checking macros to the header file, so\nthat they can be used in the static inline functions there. In doxygen\ncomments, mark them as for internal use only.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_ether/rte_ethdev.c | 38 ------------------------------\n lib/librte_ether/rte_ethdev.h | 54 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 54 insertions(+), 38 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 21f213f..f95c4d2 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -69,14 +69,6 @@\n #include \"rte_ether.h\"\n #include \"rte_ethdev.h\"\n \n-#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n-#define RTE_PMD_DEBUG_TRACE(fmt, args...) do {                        \\\n-\t\tRTE_LOG(ERR, PMD, \"%s: \" fmt, __func__, ## args); \\\n-\t} while (0)\n-#else\n-#define RTE_PMD_DEBUG_TRACE(fmt, args...)\n-#endif\n-\n /* Macros for checking for restricting functions to primary instance only */\n #define PROC_PRIMARY_OR_ERR_RET(retval) do { \\\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) { \\\n@@ -92,36 +84,6 @@\n \t} \\\n } while (0)\n \n-/* Macros to check for invalid function pointers in dev_ops structure */\n-#define RTE_ETH_FPTR_OR_ERR_RET(func, retval) do { \\\n-\tif ((func) == NULL) { \\\n-\t\tRTE_PMD_DEBUG_TRACE(\"Function not supported\\n\"); \\\n-\t\treturn (retval); \\\n-\t} \\\n-} while (0)\n-\n-#define RTE_ETH_FPTR_OR_RET(func) do { \\\n-\tif ((func) == NULL) { \\\n-\t\tRTE_PMD_DEBUG_TRACE(\"Function not supported\\n\"); \\\n-\t\treturn; \\\n-\t} \\\n-} while (0)\n-\n-/* Macros to check for valid port */\n-#define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do {\t\t\\\n-\tif (!rte_eth_dev_is_valid_port(port_id)) {\t\t\\\n-\t\tRTE_PMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id); \\\n-\t\treturn retval;\t\t\t\t\t\\\n-\t}\t\t\t\t\t\t\t\\\n-} while (0)\n-\n-#define RTE_ETH_VALID_PORTID_OR_RET(port_id) do {\t\t\t\\\n-\tif (!rte_eth_dev_is_valid_port(port_id)) {\t\t\\\n-\t\tRTE_PMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id); \\\n-\t\treturn;\t\t\t\t\t\t\\\n-\t}\t\t\t\t\t\t\t\\\n-} while (0)\n-\n static const char *MZ_RTE_ETH_DEV_DATA = \"rte_eth_dev_data\";\n struct rte_eth_dev rte_eth_devices[RTE_MAX_ETHPORTS];\n static struct rte_eth_dev_data *rte_eth_dev_data;\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 7cf4af8..334fc7b 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -925,6 +925,60 @@ struct rte_eth_dev_callback;\n /** @internal Structure to keep track of registered callbacks */\n TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);\n \n+/**\n+ * @internal\n+ *  Macro to print a message if in debugging mode\n+ */\n+#ifdef RTE_LIBRTE_ETHDEV_DEBUG\n+#define RTE_PMD_DEBUG_TRACE(fmt, args...) \\\n+\t\tRTE_LOG(ERR, PMD, \"%s: \" fmt, __func__, ## args)\n+#else\n+#define RTE_PMD_DEBUG_TRACE(fmt, args...)\n+#endif\n+\n+/**\n+ * @internal\n+ *  Macro to check for invalid function pointer in dev_ops structure\n+ */\n+#define RTE_ETH_FPTR_OR_ERR_RET(func, retval) do { \\\n+\tif ((func) == NULL) { \\\n+\t\tRTE_PMD_DEBUG_TRACE(\"Function not supported\\n\"); \\\n+\t\treturn retval; \\\n+\t} \\\n+} while (0)\n+/**\n+ * @internal\n+ *  Macro to check for invalid function pointer in dev_ops structure\n+ */\n+#define RTE_ETH_FPTR_OR_RET(func) do { \\\n+\tif ((func) == NULL) { \\\n+\t\tRTE_PMD_DEBUG_TRACE(\"Function not supported\\n\"); \\\n+\t\treturn; \\\n+\t} \\\n+} while (0)\n+\n+/**\n+ * @internal\n+ * Macro to check for valid port id\n+ */\n+#define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do {\t\t\\\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\t\t\\\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id); \\\n+\t\treturn retval;\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+} while (0)\n+\n+/**\n+ * @internal\n+ * Macro to check for valid port id\n+ */\n+#define RTE_ETH_VALID_PORTID_OR_RET(port_id) do {\t\t\t\\\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\t\t\\\n+\t\tRTE_PMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id); \\\n+\t\treturn;\t\t\t\t\t\t\\\n+\t}\t\t\t\t\t\t\t\\\n+} while (0)\n+\n /*\n  * Definitions of all functions exported by an Ethernet driver through the\n  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "2/4"
    ]
}