Show a patch.

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

{
    "id": 349,
    "url": "https://patches.dpdk.org/api/patches/349/",
    "web_url": "https://patches.dpdk.org/patch/349/",
    "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": "<1410441347-22840-3-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-09-11T13:15:36",
    "name": "[dpdk-dev,v2,02/13] mbuf: reorder fields by time of use",
    "commit_ref": "",
    "pull_url": "",
    "state": "accepted",
    "archived": true,
    "hash": "c153939c1d3a33b19b37d9c9991525a8948630d7",
    "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/349/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/349/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/349/checks/",
    "tags": {},
    "headers": {
        "Delivered-To": "patchwork@dpdk.org",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Original-To": "patchwork@dpdk.org",
        "Date": "Thu, 11 Sep 2014 14:15:36 +0100",
        "In-Reply-To": "<1410441347-22840-1-git-send-email-bruce.richardson@intel.com>",
        "Precedence": "list",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<1409759378-10113-1-git-send-email-bruce.richardson@intel.com>\r\n\t<1410441347-22840-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\r\n\tby dpdk.org (Postfix) with ESMTP id D2723B3BB;\r\n\tThu, 11 Sep 2014 15:11:33 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\r\n\tby dpdk.org (Postfix) with ESMTP id 9CF6EB3AF\r\n\tfor <dev@dpdk.org>; Thu, 11 Sep 2014 15:11:31 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\r\n\tby fmsmga102.fm.intel.com with ESMTP; 11 Sep 2014 06:16:44 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\r\n\tby fmsmga002.fm.intel.com with ESMTP; 11 Sep 2014 06:15:49 -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\ts8BDFmZD002138; Thu, 11 Sep 2014 14:15:48 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\r\n\tby sivswdev02.ir.intel.com with ESMTP id s8BDFmNX023612;\r\n\tThu, 11 Sep 2014 14:15:48 +0100",
            "(from bricha3@localhost)\r\n\tby sivswdev02.ir.intel.com with  id s8BDFmi8023608;\r\n\tThu, 11 Sep 2014 14:15:48 +0100"
        ],
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-ExtLoop1": "1",
        "Message-Id": "<1410441347-22840-3-git-send-email-bruce.richardson@intel.com>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v2 02/13] mbuf: reorder fields by time of use",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\r\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,505,1406617200\"; d=\"scan'208\";a=\"598051351\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "*  Reorder the fields in the mbuf so that we have fields that are used\ntogether side-by-side in the structure. This means that we have a\ncontiguous block of 8-bytes in the mbuf which are used to reset an mbuf\nof descriptor rearm, and a block of 16-bytes of data (excluding flags)\nwhich are set on RX from the received packet descriptor.\n* Use dummy fields as appropriate to ensure alignment or to reserve gaps\nfor later field additions.\n* Place most items which are not used by fast-path RX separately at the end\nof the structure so they can later be moved to a separate cache line.\n[The l2/l3 length fields are not moved at this stage as doing so will\ncause overflow to the next cache line].\n\nUpdated in V2:\n* Updated the KNI buffer structure to match that of new mbuf\n* Cleaned up commit message typos.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n .../linuxapp/eal/include/exec-env/rte_kni_common.h | 12 ++++++-----\n lib/librte_mbuf/rte_mbuf.h                         | 25 ++++++++++++----------\n 2 files changed, 21 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\r\nindex 07908ac..f2b502c 100644\r\n--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\r\n+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h\r\n@@ -108,15 +108,17 @@ struct rte_kni_fifo {\r\n  * Padding is necessary to assure the offsets of these fields\r\n  */\r\n struct rte_kni_mbuf {\r\n-\tvoid *pool;\r\n \tvoid *buf_addr;\r\n-\tchar pad0[16];\r\n-\tvoid *next;\r\n+\tchar pad0[10];\r\n \tuint16_t data_off;      /**< Start address of data in segment buffer. */\r\n+\tchar pad1[4];\r\n+\tuint16_t ol_flags;      /**< Offload features. */\r\n+\tchar pad2[8];\r\n \tuint16_t data_len;      /**< Amount of data in segment buffer. */\r\n \tuint32_t pkt_len;       /**< Total pkt len: sum of all segment data_len. */\r\n-\tchar pad2[4];\r\n-\tuint16_t ol_flags;      /**< Offload features. */\r\n+\tchar pad3[8];\r\n+\tvoid *pool;\r\n+\tvoid *next;\r\n } __attribute__((__aligned__(64)));\r\n \r\n /*\r\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\r\nindex 71080e5..413a5a1 100644\r\n--- a/lib/librte_mbuf/rte_mbuf.h\r\n+++ b/lib/librte_mbuf/rte_mbuf.h\r\n@@ -115,16 +115,12 @@ extern \"C\" {\r\n  * The generic rte_mbuf, containing a packet mbuf.\r\n  */\r\n struct rte_mbuf {\r\n-\tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\r\n \tvoid *buf_addr;           /**< Virtual address of segment buffer. */\r\n \tphys_addr_t buf_physaddr; /**< Physical address of segment buffer. */\r\n-\tuint16_t buf_len;         /**< Length of segment buffer. */\r\n \r\n-\t/* valid for any segment */\r\n-\tstruct rte_mbuf *next;    /**< Next segment of scattered packet. */\r\n+\t/* next 8 bytes are initialised on RX descriptor rearm */\r\n+\tuint16_t buf_len;         /**< Length of segment buffer. */\r\n \tuint16_t data_off;\r\n-\tuint16_t data_len;        /**< Amount of data in segment buffer. */\r\n-\tuint32_t pkt_len;         /**< Total pkt len: sum of all segments. */\r\n \r\n #ifdef RTE_MBUF_REFCNT\r\n \t/**\r\n@@ -142,14 +138,17 @@ struct rte_mbuf {\r\n #else\r\n \tuint16_t refcnt_reserved;     /**< Do not use this field */\r\n #endif\r\n-\tuint16_t reserved;            /**< Unused field. Required for padding */\r\n-\tuint16_t ol_flags;            /**< Offload features. */\r\n-\r\n-\t/* these fields are valid for first segment only */\r\n \tuint8_t nb_segs;        /**< Number of segments. */\r\n \tuint8_t port;           /**< Input port. */\r\n \r\n-\t/* offload features, valid for first segment only */\r\n+\tuint16_t ol_flags;      /**< Offload features. */\r\n+\tuint16_t reserved0;     /**< Unused field. Required for padding */\r\n+\tuint32_t reserved1;     /**< Unused field. Required for padding */\r\n+\r\n+\t/* remaining bytes are set on RX when pulling packet from descriptor */\r\n+\tuint16_t reserved2;     /**< Unused field. Required for padding */\r\n+\tuint16_t data_len;      /**< Amount of data in segment buffer. */\r\n+\tuint32_t pkt_len;       /**< Total pkt len: sum of all segments. */\r\n \tunion {\r\n \t\tuint16_t l2_l3_len; /**< combined l2/l3 lengths as single var */\r\n \t\tstruct {\r\n@@ -167,6 +166,10 @@ struct rte_mbuf {\r\n \t\tuint32_t sched;     /**< Hierarchical scheduler */\r\n \t} hash;                 /**< hash information */\r\n \r\n+\t/* fields only used in slow path or on TX */\r\n+\tstruct rte_mempool *pool; /**< Pool from which mbuf was allocated. */\r\n+\tstruct rte_mbuf *next;    /**< Next segment of scattered packet. */\r\n+\r\n \tunion {\r\n \t\tuint8_t metadata[0];\r\n \t\tuint16_t metadata16[0];\r\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "02/13"
    ]
}