Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/20999/?format=api
https://patches.dpdk.org/api/patches/20999/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1488354455-142764-3-git-send-email-david.hunt@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": "<1488354455-142764-3-git-send-email-david.hunt@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1488354455-142764-3-git-send-email-david.hunt@intel.com", "date": "2017-03-01T07:47:19", "name": "[dpdk-dev,v8,02/18] lib: create private header file", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "362a037ebf9d30ad292d0b06c0421522f04de73d", "submitter": { "id": 342, "url": "https://patches.dpdk.org/api/people/342/?format=api", "name": "Hunt, David", "email": "david.hunt@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1488354455-142764-3-git-send-email-david.hunt@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/20999/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/20999/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 A39EAD4CE;\n\tWed, 1 Mar 2017 15:47:26 +0100 (CET)", "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 7D3632BDF\n\tfor <dev@dpdk.org>; Wed, 1 Mar 2017 15:47:14 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Mar 2017 06:47:07 -0800", "from silpixa00397515.ir.intel.com (HELO\n\tsilpixa00397515.ger.corp.intel.com) ([10.237.223.14])\n\tby fmsmga001.fm.intel.com with ESMTP; 01 Mar 2017 06:47:05 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos; i=\"5.35,226,1484035200\"; d=\"scan'208\";\n\ta=\"1117076481\"", "From": "David Hunt <david.hunt@intel.com>", "To": "dev@dpdk.org", "Cc": "bruce.richardson@intel.com,\n\tDavid Hunt <david.hunt@intel.com>", "Date": "Wed, 1 Mar 2017 07:47:19 +0000", "Message-Id": "<1488354455-142764-3-git-send-email-david.hunt@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1488354455-142764-1-git-send-email-david.hunt@intel.com>", "References": "<1487647073-129064-2-git-send-email-david.hunt@intel.com>\n\t<1488354455-142764-1-git-send-email-david.hunt@intel.com>", "Subject": "[dpdk-dev] [PATCH v8 02/18] lib: create private header file", "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": "We'll be adding internal implementation definitions in here\nthat are common to both burst and legacy APIs.\n\nSigned-off-by: David Hunt <david.hunt@intel.com>\n---\n lib/librte_distributor/rte_distributor_private.h | 136 +++++++++++++++++++++++\n lib/librte_distributor/rte_distributor_v20.c | 72 +-----------\n 2 files changed, 137 insertions(+), 71 deletions(-)\n create mode 100644 lib/librte_distributor/rte_distributor_private.h", "diff": "diff --git a/lib/librte_distributor/rte_distributor_private.h b/lib/librte_distributor/rte_distributor_private.h\nnew file mode 100644\nindex 0000000..6d72f1c\n--- /dev/null\n+++ b/lib/librte_distributor/rte_distributor_private.h\n@@ -0,0 +1,136 @@\n+/*-\n+ * BSD LICENSE\n+ *\n+ * Copyright(c) 2017 Intel Corporation. All rights reserved.\n+ *\n+ * Redistribution and use in source and binary forms, with or without\n+ * modification, are permitted provided that the following conditions\n+ * are met:\n+ *\n+ * * Redistributions of source code must retain the above copyright\n+ * notice, this list of conditions and the following disclaimer.\n+ * * Redistributions in binary form must reproduce the above copyright\n+ * notice, this list of conditions and the following disclaimer in\n+ * the documentation and/or other materials provided with the\n+ * distribution.\n+ * * Neither the name of Intel Corporation nor the names of its\n+ * contributors may be used to endorse or promote products derived\n+ * from this software without specific prior written permission.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+#ifndef _RTE_DIST_PRIV_H_\n+#define _RTE_DIST_PRIV_H_\n+\n+/**\n+ * @file\n+ * RTE distributor\n+ *\n+ * The distributor is a component which is designed to pass packets\n+ * one-at-a-time to workers, with dynamic load balancing.\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#define NO_FLAGS 0\n+#define RTE_DISTRIB_PREFIX \"DT_\"\n+\n+/*\n+ * We will use the bottom four bits of pointer for flags, shifting out\n+ * the top four bits to make room (since a 64-bit pointer actually only uses\n+ * 48 bits). An arithmetic-right-shift will then appropriately restore the\n+ * original pointer value with proper sign extension into the top bits.\n+ */\n+#define RTE_DISTRIB_FLAG_BITS 4\n+#define RTE_DISTRIB_FLAGS_MASK (0x0F)\n+#define RTE_DISTRIB_NO_BUF 0 /**< empty flags: no buffer requested */\n+#define RTE_DISTRIB_GET_BUF (1) /**< worker requests a buffer, returns old */\n+#define RTE_DISTRIB_RETURN_BUF (2) /**< worker returns a buffer, no request */\n+#define RTE_DISTRIB_VALID_BUF (4) /**< set if bufptr contains ptr */\n+\n+#define RTE_DISTRIB_BACKLOG_SIZE 8\n+#define RTE_DISTRIB_BACKLOG_MASK (RTE_DISTRIB_BACKLOG_SIZE - 1)\n+\n+#define RTE_DISTRIB_MAX_RETURNS 128\n+#define RTE_DISTRIB_RETURNS_MASK (RTE_DISTRIB_MAX_RETURNS - 1)\n+\n+/**\n+ * Maximum number of workers allowed.\n+ * Be aware of increasing the limit, becaus it is limited by how we track\n+ * in-flight tags. See in_flight_bitmask and rte_distributor_process\n+ */\n+#define RTE_DISTRIB_MAX_WORKERS 64\n+\n+#define RTE_DISTRIBUTOR_NAMESIZE 32 /**< Length of name for instance */\n+\n+/**\n+ * Buffer structure used to pass the pointer data between cores. This is cache\n+ * line aligned, but to improve performance and prevent adjacent cache-line\n+ * prefetches of buffers for other workers, e.g. when worker 1's buffer is on\n+ * the next cache line to worker 0, we pad this out to three cache lines.\n+ * Only 64-bits of the memory is actually used though.\n+ */\n+union rte_distributor_buffer {\n+\tvolatile int64_t bufptr64;\n+\tchar pad[RTE_CACHE_LINE_SIZE*3];\n+} __rte_cache_aligned;\n+\n+/**\n+ * Number of packets to deal with in bursts. Needs to be 8 so as to\n+ * fit in one cache line.\n+ */\n+#define RTE_DIST_BURST_SIZE (sizeof(rte_xmm_t) / sizeof(uint16_t))\n+\n+struct rte_distributor_backlog {\n+\tunsigned int start;\n+\tunsigned int count;\n+\tint64_t pkts[RTE_DIST_BURST_SIZE] __rte_cache_aligned;\n+\tuint16_t *tags; /* will point to second cacheline of inflights */\n+} __rte_cache_aligned;\n+\n+\n+struct rte_distributor_returned_pkts {\n+\tunsigned int start;\n+\tunsigned int count;\n+\tstruct rte_mbuf *mbufs[RTE_DISTRIB_MAX_RETURNS];\n+};\n+\n+struct rte_distributor {\n+\tTAILQ_ENTRY(rte_distributor) next; /**< Next in list. */\n+\n+\tchar name[RTE_DISTRIBUTOR_NAMESIZE]; /**< Name of the ring. */\n+\tunsigned int num_workers; /**< Number of workers polling */\n+\n+\tuint32_t in_flight_tags[RTE_DISTRIB_MAX_WORKERS];\n+\t\t/**< Tracks the tag being processed per core */\n+\tuint64_t in_flight_bitmask;\n+\t\t/**< on/off bits for in-flight tags.\n+\t\t * Note that if RTE_DISTRIB_MAX_WORKERS is larger than 64 then\n+\t\t * the bitmask has to expand.\n+\t\t */\n+\n+\tstruct rte_distributor_backlog backlog[RTE_DISTRIB_MAX_WORKERS];\n+\n+\tunion rte_distributor_buffer bufs[RTE_DISTRIB_MAX_WORKERS];\n+\n+\tstruct rte_distributor_returned_pkts returns;\n+};\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif\ndiff --git a/lib/librte_distributor/rte_distributor_v20.c b/lib/librte_distributor/rte_distributor_v20.c\nindex b890947..be297ec 100644\n--- a/lib/librte_distributor/rte_distributor_v20.c\n+++ b/lib/librte_distributor/rte_distributor_v20.c\n@@ -41,77 +41,7 @@\n #include <rte_string_fns.h>\n #include <rte_eal_memconfig.h>\n #include \"rte_distributor_v20.h\"\n-\n-#define NO_FLAGS 0\n-#define RTE_DISTRIB_PREFIX \"DT_\"\n-\n-/* we will use the bottom four bits of pointer for flags, shifting out\n- * the top four bits to make room (since a 64-bit pointer actually only uses\n- * 48 bits). An arithmetic-right-shift will then appropriately restore the\n- * original pointer value with proper sign extension into the top bits. */\n-#define RTE_DISTRIB_FLAG_BITS 4\n-#define RTE_DISTRIB_FLAGS_MASK (0x0F)\n-#define RTE_DISTRIB_NO_BUF 0 /**< empty flags: no buffer requested */\n-#define RTE_DISTRIB_GET_BUF (1) /**< worker requests a buffer, returns old */\n-#define RTE_DISTRIB_RETURN_BUF (2) /**< worker returns a buffer, no request */\n-\n-#define RTE_DISTRIB_BACKLOG_SIZE 8\n-#define RTE_DISTRIB_BACKLOG_MASK (RTE_DISTRIB_BACKLOG_SIZE - 1)\n-\n-#define RTE_DISTRIB_MAX_RETURNS 128\n-#define RTE_DISTRIB_RETURNS_MASK (RTE_DISTRIB_MAX_RETURNS - 1)\n-\n-/**\n- * Maximum number of workers allowed.\n- * Be aware of increasing the limit, becaus it is limited by how we track\n- * in-flight tags. See @in_flight_bitmask and @rte_distributor_process\n- */\n-#define RTE_DISTRIB_MAX_WORKERS\t64\n-\n-/**\n- * Buffer structure used to pass the pointer data between cores. This is cache\n- * line aligned, but to improve performance and prevent adjacent cache-line\n- * prefetches of buffers for other workers, e.g. when worker 1's buffer is on\n- * the next cache line to worker 0, we pad this out to three cache lines.\n- * Only 64-bits of the memory is actually used though.\n- */\n-union rte_distributor_buffer {\n-\tvolatile int64_t bufptr64;\n-\tchar pad[RTE_CACHE_LINE_SIZE*3];\n-} __rte_cache_aligned;\n-\n-struct rte_distributor_backlog {\n-\tunsigned start;\n-\tunsigned count;\n-\tint64_t pkts[RTE_DISTRIB_BACKLOG_SIZE];\n-};\n-\n-struct rte_distributor_returned_pkts {\n-\tunsigned start;\n-\tunsigned count;\n-\tstruct rte_mbuf *mbufs[RTE_DISTRIB_MAX_RETURNS];\n-};\n-\n-struct rte_distributor {\n-\tTAILQ_ENTRY(rte_distributor) next; /**< Next in list. */\n-\n-\tchar name[RTE_DISTRIBUTOR_NAMESIZE]; /**< Name of the ring. */\n-\tunsigned num_workers; /**< Number of workers polling */\n-\n-\tuint32_t in_flight_tags[RTE_DISTRIB_MAX_WORKERS];\n-\t\t/**< Tracks the tag being processed per core */\n-\tuint64_t in_flight_bitmask;\n-\t\t/**< on/off bits for in-flight tags.\n-\t\t * Note that if RTE_DISTRIB_MAX_WORKERS is larger than 64 then\n-\t\t * the bitmask has to expand.\n-\t\t */\n-\n-\tstruct rte_distributor_backlog backlog[RTE_DISTRIB_MAX_WORKERS];\n-\n-\tunion rte_distributor_buffer bufs[RTE_DISTRIB_MAX_WORKERS];\n-\n-\tstruct rte_distributor_returned_pkts returns;\n-};\n+#include \"rte_distributor_private.h\"\n \n TAILQ_HEAD(rte_distributor_list, rte_distributor);\n \n", "prefixes": [ "dpdk-dev", "v8", "02/18" ] }{ "id": 20999, "url": "