Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/51330/?format=api
https://patches.dpdk.org/api/patches/51330/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190319071256.26302-3-xiaolong.ye@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": "<20190319071256.26302-3-xiaolong.ye@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190319071256.26302-3-xiaolong.ye@intel.com", "date": "2019-03-19T07:12:52", "name": "[v2,2/6] lib/mbuf: introduce helper to create mempool with flags", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0e7b5da7fda303066308fd9d53d0220036bb94be", "submitter": { "id": 1120, "url": "https://patches.dpdk.org/api/people/1120/?format=api", "name": "Xiaolong Ye", "email": "xiaolong.ye@intel.com" }, "delegate": { "id": 319, "url": "https://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190319071256.26302-3-xiaolong.ye@intel.com/mbox/", "series": [ { "id": 3796, "url": "https://patches.dpdk.org/api/series/3796/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=3796", "date": "2019-03-19T07:12:50", "name": "Introduce AF_XDP PMD", "version": 2, "mbox": "https://patches.dpdk.org/series/3796/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/51330/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/51330/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 89D264C93;\n\tTue, 19 Mar 2019 08:17:02 +0100 (CET)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 9643811A4\n\tfor <dev@dpdk.org>; Tue, 19 Mar 2019 08:16:56 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Mar 2019 00:16:56 -0700", "from yexl-server.sh.intel.com ([10.67.110.206])\n\tby fmsmga005.fm.intel.com with ESMTP; 19 Mar 2019 00:16:55 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.58,496,1544515200\"; d=\"scan'208\";a=\"329889944\"", "From": "Xiaolong Ye <xiaolong.ye@intel.com>", "To": "dev@dpdk.org", "Cc": "Qi Zhang <qi.z.zhang@intel.com>,\n\tKarlsson Magnus <magnus.karlsson@intel.com>,\n\tTopel Bjorn <bjorn.topel@intel.com>, Xiaolong Ye <xiaolong.ye@intel.com>", "Date": "Tue, 19 Mar 2019 15:12:52 +0800", "Message-Id": "<20190319071256.26302-3-xiaolong.ye@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190319071256.26302-1-xiaolong.ye@intel.com>", "References": "<20190301080947.91086-1-xiaolong.ye@intel.com>\n\t<20190319071256.26302-1-xiaolong.ye@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 2/6] lib/mbuf: introduce helper to create\n\tmempool with flags", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/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 allows applications to create mbuf mempool with specific flags\nsuch as MEMPOOL_F_NO_SPREAD if they want fixed size memory objects.\n\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nSigned-off-by: Xiaolong Ye <xiaolong.ye@intel.com>\n---\n lib/librte_mbuf/rte_mbuf.c | 29 +++++++++++++++++++-----\n lib/librte_mbuf/rte_mbuf.h | 45 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 69 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c\nindex 21f6f7404..c1db9e298 100644\n--- a/lib/librte_mbuf/rte_mbuf.c\n+++ b/lib/librte_mbuf/rte_mbuf.c\n@@ -106,11 +106,10 @@ rte_pktmbuf_init(struct rte_mempool *mp,\n \tm->next = NULL;\n }\n \n-/* Helper to create a mbuf pool with given mempool ops name*/\n-struct rte_mempool *\n-rte_pktmbuf_pool_create_by_ops(const char *name, unsigned int n,\n+static struct rte_mempool *\n+rte_pktmbuf_pool_create_by_ops_with_flags(const char *name, unsigned int n,\n \tunsigned int cache_size, uint16_t priv_size, uint16_t data_room_size,\n-\tint socket_id, const char *ops_name)\n+\tunsigned int flags, int socket_id, const char *ops_name)\n {\n \tstruct rte_mempool *mp;\n \tstruct rte_pktmbuf_pool_private mbp_priv;\n@@ -130,7 +129,7 @@ rte_pktmbuf_pool_create_by_ops(const char *name, unsigned int n,\n \tmbp_priv.mbuf_priv_size = priv_size;\n \n \tmp = rte_mempool_create_empty(name, n, elt_size, cache_size,\n-\t\t sizeof(struct rte_pktmbuf_pool_private), socket_id, 0);\n+\t\t sizeof(struct rte_pktmbuf_pool_private), socket_id, flags);\n \tif (mp == NULL)\n \t\treturn NULL;\n \n@@ -157,6 +156,16 @@ rte_pktmbuf_pool_create_by_ops(const char *name, unsigned int n,\n \treturn mp;\n }\n \n+/* Helper to create a mbuf pool with given mempool ops name*/\n+struct rte_mempool *\n+rte_pktmbuf_pool_create_by_ops(const char *name, unsigned int n,\n+\tunsigned int cache_size, uint16_t priv_size, uint16_t data_room_size,\n+\tint socket_id, const char *ops_name)\n+{\n+\treturn rte_pktmbuf_pool_create_by_ops_with_flags(name, n, cache_size,\n+\t\t\t priv_size, data_room_size, 0, socket_id, ops_name);\n+}\n+\n /* helper to create a mbuf pool */\n struct rte_mempool *\n rte_pktmbuf_pool_create(const char *name, unsigned int n,\n@@ -167,6 +176,16 @@ rte_pktmbuf_pool_create(const char *name, unsigned int n,\n \t\t\tdata_room_size, socket_id, NULL);\n }\n \n+/* helper to create a mbuf pool with flags (e.g. NO_SPREAD) */\n+struct rte_mempool * __rte_experimental\n+rte_pktmbuf_pool_create_with_flags(const char *name, unsigned int n,\n+\tunsigned int cache_size, uint16_t priv_size, uint16_t data_room_size,\n+\tunsigned int flags, int socket_id)\n+{\n+\treturn rte_pktmbuf_pool_create_by_ops_with_flags(name, n, cache_size,\n+\t\t\tpriv_size, data_room_size, flags, socket_id, NULL);\n+}\n+\n /* do some sanity checks on a mbuf: panic if it fails */\n void\n rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex d961ccaf6..105ead6de 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -1266,6 +1266,51 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,\n \tunsigned cache_size, uint16_t priv_size, uint16_t data_room_size,\n \tint socket_id);\n \n+/**\n+ * Create a mbuf pool with flags.\n+ *\n+ * This function creates and initializes a packet mbuf pool. It is\n+ * a wrapper to rte_mempool functions.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: This API may change without prior notice.\n+ *\n+ * @param name\n+ * The name of the mbuf pool.\n+ * @param n\n+ * The number of elements in the mbuf pool. The optimum size (in terms\n+ * of memory usage) for a mempool is when n is a power of two minus one:\n+ * n = (2^q - 1).\n+ * @param cache_size\n+ * Size of the per-core object cache. See rte_mempool_create() for\n+ * details.\n+ * @param priv_size\n+ * Size of application private are between the rte_mbuf structure\n+ * and the data buffer. This value must be aligned to RTE_MBUF_PRIV_ALIGN.\n+ * @param data_room_size\n+ * Size of data buffer in each mbuf, including RTE_PKTMBUF_HEADROOM.\n+ * @param flags\n+ * Flags controlling the behavior of the mempool. See\n+ * rte_mempool_create() for details.\n+ * @param socket_id\n+ * The socket identifier where the memory should be allocated. The\n+ * value can be *SOCKET_ID_ANY* if there is no NUMA constraint for the\n+ * reserved zone.\n+ * @return\n+ * The pointer to the new allocated mempool, on success. NULL on error\n+ * with rte_errno set appropriately. Possible rte_errno values include:\n+ * - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure\n+ * - E_RTE_SECONDARY - function was called from a secondary process instance\n+ * - EINVAL - cache size provided is too large, or priv_size is not aligned.\n+ * - ENOSPC - the maximum number of memzones has already been allocated\n+ * - EEXIST - a memzone with the same name already exists\n+ * - ENOMEM - no appropriate memory area found in which to create memzone\n+ */\n+struct rte_mempool * __rte_experimental\n+rte_pktmbuf_pool_create_with_flags(const char *name, unsigned int n,\n+\tunsigned int cache_size, uint16_t priv_size, uint16_t data_room_size,\n+\tunsigned int flags, int socket_id);\n+\n /**\n * Create a mbuf pool with a given mempool ops name\n *\n", "prefixes": [ "v2", "2/6" ] }{ "id": 51330, "url": "