Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/18897/?format=api
https://patches.dpdk.org/api/patches/18897/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1483607556-21460-2-git-send-email-tomaszx.kulasek@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": "<1483607556-21460-2-git-send-email-tomaszx.kulasek@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1483607556-21460-2-git-send-email-tomaszx.kulasek@intel.com", "date": "2017-01-05T09:12:32", "name": "[dpdk-dev,v3,1/5] rte_mbuf: add rte_pktmbuf_linearize", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6bc800634e478489508fb09ae0a178b91fd23d93", "submitter": { "id": 155, "url": "https://patches.dpdk.org/api/people/155/?format=api", "name": "Tomasz Kulasek", "email": "tomaszx.kulasek@intel.com" }, "delegate": { "id": 22, "url": "https://patches.dpdk.org/api/users/22/?format=api", "username": "pdelarag", "first_name": "Pablo", "last_name": "de Lara Guarch", "email": "pablo.de.lara.guarch@intel.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1483607556-21460-2-git-send-email-tomaszx.kulasek@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/18897/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/18897/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 57886F60C;\n\tThu, 5 Jan 2017 10:13:08 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 8D0382B91\n\tfor <dev@dpdk.org>; Thu, 5 Jan 2017 10:12:48 +0100 (CET)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 05 Jan 2017 01:12:49 -0800", "from unknown (HELO Sent) ([10.103.102.79])\n\tby orsmga002.jf.intel.com with SMTP; 05 Jan 2017 01:12:46 -0800", "by Sent (sSMTP sendmail emulation); Thu, 05 Jan 2017 10:12:45 +0100" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.33,320,1477983600\"; d=\"scan'208\";a=\"26446092\"", "From": "Tomasz Kulasek <tomaszx.kulasek@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 5 Jan 2017 10:12:32 +0100", "Message-Id": "<1483607556-21460-2-git-send-email-tomaszx.kulasek@intel.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1483607556-21460-1-git-send-email-tomaszx.kulasek@intel.com>", "References": "<1483031543-21196-1-git-send-email-tomaszx.kulasek@intel.com>\n\t<1483607556-21460-1-git-send-email-tomaszx.kulasek@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 1/5] rte_mbuf: add rte_pktmbuf_linearize", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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 patch adds function rte_pktmbuf_linearize to let crypto PMD coalesce\nchained mbuf before crypto operation and extend their capabilities to\nsupport segmented mbufs when device cannot handle them natively.\n\nSigned-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>\n---\n lib/librte_mbuf/rte_mbuf.h | 56 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 56 insertions(+)", "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex ead7c6e..b11a31d 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -1647,6 +1647,62 @@ static inline int rte_pktmbuf_chain(struct rte_mbuf *head, struct rte_mbuf *tail\n }\n \n /**\n+ * Linearize data in mbuf.\n+ *\n+ * This function coalesce mbuf merging data in the first segment, unchaining\n+ * rest, and then frees them.\n+ *\n+ * All operations are done in-place, so the structure of incoming mbuf\n+ * is changed.\n+ *\n+ * @param mbuf\n+ * mbuf to linearize\n+ * @return\n+ * - 0, on success\n+ * - -1, on error\n+ */\n+static inline int\n+rte_pktmbuf_linearize(struct rte_mbuf *mbuf)\n+{\n+\tint l, n;\n+\tstruct rte_mbuf *m;\n+\tstruct rte_mbuf *m_next;\n+\tchar *buffer;\n+\n+\tif (rte_pktmbuf_is_contiguous(mbuf))\n+\t\treturn 0;\n+\n+\t/* Extend first segment to the total packet length\n+\t */\n+\tn = rte_pktmbuf_pkt_len(mbuf) - rte_pktmbuf_data_len(mbuf);\n+\n+\tif (unlikely(n > rte_pktmbuf_tailroom(mbuf)))\n+\t\treturn -1;\n+\n+\tbuffer = rte_pktmbuf_mtod_offset(mbuf, char *, mbuf->data_len);\n+\tmbuf->data_len = (uint16_t)(mbuf->pkt_len);\n+\n+\t/* Append data from next segments to the first one\n+\t */\n+\tm = mbuf->next;\n+\twhile (m != NULL) {\n+\t\tm_next = m->next;\n+\n+\t\tl = rte_pktmbuf_data_len(m);\n+\t\trte_memcpy(buffer, rte_pktmbuf_mtod(m, char *), l);\n+\t\tbuffer += l;\n+\n+\t\trte_pktmbuf_free_seg(m);\n+\t\tm = m_next;\n+\t}\n+\n+\tmbuf->next = NULL;\n+\tmbuf->nb_segs = 1;\n+\n+\treturn 0;\n+}\n+\n+/**\n * Dump an mbuf structure to a file.\n *\n * Dump all fields for the given packet mbuf and all its associated\n", "prefixes": [ "dpdk-dev", "v3", "1/5" ] }{ "id": 18897, "url": "