Show a patch.

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

{
    "id": 305,
    "url": "https://patches.dpdk.org/api/patches/305/",
    "web_url": "https://patches.dpdk.org/patch/305/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1409759378-10113-6-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-09-03T15:49:30",
    "name": "[dpdk-dev,05/13] mbuf: introduce a flag to indicate a control mbuf",
    "commit_ref": "",
    "pull_url": "",
    "state": "superseded",
    "archived": true,
    "hash": "8875de0b6431469723ddbf7a06022a0e0f077552",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/305/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/305/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/305/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Date": "Wed,  3 Sep 2014 16:49:30 +0100",
        "In-Reply-To": "<1409759378-10113-1-git-send-email-bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<1409759378-10113-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "To": "dev@dpdk.org",
        "Received": [
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\r\n\tby dpdk.org (Postfix) with ESMTP id 033FE5941\r\n\tfor <dev@dpdk.org>; Wed,  3 Sep 2014 17:45:39 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\r\n\tby fmsmga102.fm.intel.com with ESMTP; 03 Sep 2014 08:49:41 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby fmsmga002.fm.intel.com with ESMTP; 03 Sep 2014 08:49:40 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\r\n\t[10.237.217.46])\r\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\r\n\ts83FndBi025422; Wed, 3 Sep 2014 16:49:39 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s83FndAE010448;\r\n\tWed, 3 Sep 2014 16:49:39 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s83Fndak010444;\r\n\tWed, 3 Sep 2014 16:49:39 +0100"
        ],
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "Precedence": "list",
        "X-ExtLoop1": "1",
        "Message-Id": "<1409759378-10113-6-git-send-email-bruce.richardson@intel.com>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 05/13] mbuf: introduce a flag to indicate a\r\n\tcontrol mbuf",
        "X-List-Received-Date": "Wed, 03 Sep 2014 15:45:40 -0000",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Return-Path": "<bricha3@ecsmtp.ir.intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,458,1406617200\"; d=\"scan'208\";a=\"593984534\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "Since the flags field is now 64-bits, we can allow one bit to be used to\nindicate a control i.e. non-packet mbuf. Dedicate the high bit (bit 63)\nfor this purpose and add in a utility macro to test if a given mbuf has\nthe bit set or not.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_mbuf/rte_mbuf.c |  2 ++\n lib/librte_mbuf/rte_mbuf.h | 19 +++++++++++++++++++\n 2 files changed, 21 insertions(+)",
    "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\r\nindex 9dfcac3..52e7574 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.c\r\n+++ b/lib/librte_mbuf/rte_mbuf.c\r\n@@ -69,7 +69,9 @@ rte_ctrlmbuf_init(struct rte_mempool *mp,\r\n \t\tvoid *_m,\r\n \t\t__attribute__((unused)) unsigned i)\r\n {\r\n+\tstruct rte_mbuf *m = _m;\r\n \trte_pktmbuf_init(mp, opaque_arg, _m, i);\r\n+\tm->ol_flags |= CTRL_MBUF_FLAG;\r\n }\r\n \r\n /*\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex 6af5b2f..7b0b4f2 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -91,6 +91,7 @@ extern \"C\" {\r\n #define PKT_TX_IPV4_CSUM     0x1000 /**< Alias of PKT_TX_IP_CKSUM. */\r\n #define PKT_TX_IPV4          PKT_RX_IPV4_HDR /**< IPv4 with no IP checksum offload. */\r\n #define PKT_TX_IPV6          PKT_RX_IPV6_HDR /**< IPv6 packet */\r\n+\r\n /*\r\n  * Bit 14~13 used for L4 packet type with checksum enabled.\r\n  *     00: Reserved\r\n@@ -106,6 +107,9 @@ extern \"C\" {\r\n /* Bit 15 */\r\n #define PKT_TX_IEEE1588_TMST 0x8000 /**< TX IEEE1588 packet to timestamp. */\r\n \r\n+/* Use final bit of flags to indicate a control mbuf */\r\n+#define CTRL_MBUF_FLAG       (1ULL << 63)\r\n+\r\n /**\r\n  * Bit Mask to indicate what bits required for building TX context\r\n  */\r\n@@ -466,6 +470,21 @@ void rte_ctrlmbuf_init(struct rte_mempool *mp, void *opaque_arg,\r\n  */\r\n #define rte_ctrlmbuf_len(m) rte_pktmbuf_data_len(m)\r\n \r\n+/**\r\n+ * Tests if an mbuf is a control mbuf\r\n+ *\r\n+ * @param m\r\n+ *   The mbuf.to be tested\r\n+ * @return\r\n+ *   - True (1) if the mbuf is a control mbuf\r\n+ *   - False(0) otherwise\r\n+ */\r\n+static inline int\r\n+rte_is_ctrlmbuf(struct rte_mbuf *m)\r\n+{\r\n+\treturn (!!(m->ol_flags & CTRL_MBUF_FLAG));\r\n+}\r\n+\r\n /* Operations on pkt mbuf */\r\n \r\n /**\r\n",
    "prefixes": [
        "dpdk-dev",
        "05/13"
    ]
}