get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 21531,
    "url": "http://patches.dpdk.org/api/patches/21531/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20170307113217.11077-5-bruce.richardson@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20170307113217.11077-5-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170307113217.11077-5-bruce.richardson@intel.com",
    "date": "2017-03-07T11:32:07",
    "name": "[dpdk-dev,v2,04/14] ring: remove debug setting",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "110b995edc33fbb19cf6e410cb1e0b03ac52df01",
    "submitter": {
        "id": 20,
        "url": "http://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20170307113217.11077-5-bruce.richardson@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/21531/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/21531/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 3F354591E;\n\tTue,  7 Mar 2017 12:33:19 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 2BD665589\n\tfor <dev@dpdk.org>; Tue,  7 Mar 2017 12:33:15 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Mar 2017 03:33:15 -0800",
            "from sivswdev01.ir.intel.com ([10.237.217.45])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Mar 2017 03:33:13 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.35,258,1484035200\"; d=\"scan'208\";a=\"831864253\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "olivier.matz@6wind.com",
        "Cc": "jerin.jacob@caviumnetworks.com, dev@dpdk.org,\n\tBruce Richardson <bruce.richardson@intel.com>",
        "Date": "Tue,  7 Mar 2017 11:32:07 +0000",
        "Message-Id": "<20170307113217.11077-5-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20170307113217.11077-1-bruce.richardson@intel.com>",
        "References": "<20170223172407.27664-1-bruce.richardson@intel.com>\n\t<20170307113217.11077-1-bruce.richardson@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 04/14] ring: remove debug setting",
        "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": "The debug option only provided statistics to the user, most of\nwhich could be tracked by the application itself. Remove this as a\ncompile time option, and feature, simplifying the code.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n config/common_base                     |   1 -\n doc/guides/prog_guide/ring_lib.rst     |   7 -\n doc/guides/rel_notes/release_17_05.rst |   1 +\n lib/librte_ring/rte_ring.c             |  41 ----\n lib/librte_ring/rte_ring.h             |  97 +-------\n test/test/test_ring.c                  | 410 ---------------------------------\n 6 files changed, 13 insertions(+), 544 deletions(-)",
    "diff": "diff --git a/config/common_base b/config/common_base\nindex 099ffda..b3d8272 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -447,7 +447,6 @@ CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y\n # Compile librte_ring\n #\n CONFIG_RTE_LIBRTE_RING=y\n-CONFIG_RTE_LIBRTE_RING_DEBUG=n\n CONFIG_RTE_RING_PAUSE_REP_COUNT=0\n \n #\ndiff --git a/doc/guides/prog_guide/ring_lib.rst b/doc/guides/prog_guide/ring_lib.rst\nindex 9f69753..d4ab502 100644\n--- a/doc/guides/prog_guide/ring_lib.rst\n+++ b/doc/guides/prog_guide/ring_lib.rst\n@@ -110,13 +110,6 @@ Once an enqueue operation reaches the high water mark, the producer is notified,\n \n This mechanism can be used, for example, to exert a back pressure on I/O to inform the LAN to PAUSE.\n \n-Debug\n-~~~~~\n-\n-When debug is enabled (CONFIG_RTE_LIBRTE_RING_DEBUG is set),\n-the library stores some per-ring statistic counters about the number of enqueues/dequeues.\n-These statistics are per-core to avoid concurrent accesses or atomic operations.\n-\n Use Cases\n ---------\n \ndiff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst\nindex ea45e0c..e0ebd71 100644\n--- a/doc/guides/rel_notes/release_17_05.rst\n+++ b/doc/guides/rel_notes/release_17_05.rst\n@@ -116,6 +116,7 @@ API Changes\n   have been made to it:\n \n   * removed the build-time setting ``CONFIG_RTE_RING_SPLIT_PROD_CONS``\n+  * removed the build-time setting ``CONFIG_RTE_LIBRTE_RING_DEBUG``\n \n ABI Changes\n -----------\ndiff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c\nindex 80fc356..90ee63f 100644\n--- a/lib/librte_ring/rte_ring.c\n+++ b/lib/librte_ring/rte_ring.c\n@@ -131,12 +131,6 @@ rte_ring_init(struct rte_ring *r, const char *name, unsigned count,\n \t\t\t  RTE_CACHE_LINE_MASK) != 0);\n \tRTE_BUILD_BUG_ON((offsetof(struct rte_ring, prod) &\n \t\t\t  RTE_CACHE_LINE_MASK) != 0);\n-#ifdef RTE_LIBRTE_RING_DEBUG\n-\tRTE_BUILD_BUG_ON((sizeof(struct rte_ring_debug_stats) &\n-\t\t\t  RTE_CACHE_LINE_MASK) != 0);\n-\tRTE_BUILD_BUG_ON((offsetof(struct rte_ring, stats) &\n-\t\t\t  RTE_CACHE_LINE_MASK) != 0);\n-#endif\n \n \t/* init the ring structure */\n \tmemset(r, 0, sizeof(*r));\n@@ -284,11 +278,6 @@ rte_ring_set_water_mark(struct rte_ring *r, unsigned count)\n void\n rte_ring_dump(FILE *f, const struct rte_ring *r)\n {\n-#ifdef RTE_LIBRTE_RING_DEBUG\n-\tstruct rte_ring_debug_stats sum;\n-\tunsigned lcore_id;\n-#endif\n-\n \tfprintf(f, \"ring <%s>@%p\\n\", r->name, r);\n \tfprintf(f, \"  flags=%x\\n\", r->flags);\n \tfprintf(f, \"  size=%\"PRIu32\"\\n\", r->size);\n@@ -302,36 +291,6 @@ rte_ring_dump(FILE *f, const struct rte_ring *r)\n \t\tfprintf(f, \"  watermark=0\\n\");\n \telse\n \t\tfprintf(f, \"  watermark=%\"PRIu32\"\\n\", r->watermark);\n-\n-\t/* sum and dump statistics */\n-#ifdef RTE_LIBRTE_RING_DEBUG\n-\tmemset(&sum, 0, sizeof(sum));\n-\tfor (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {\n-\t\tsum.enq_success_bulk += r->stats[lcore_id].enq_success_bulk;\n-\t\tsum.enq_success_objs += r->stats[lcore_id].enq_success_objs;\n-\t\tsum.enq_quota_bulk += r->stats[lcore_id].enq_quota_bulk;\n-\t\tsum.enq_quota_objs += r->stats[lcore_id].enq_quota_objs;\n-\t\tsum.enq_fail_bulk += r->stats[lcore_id].enq_fail_bulk;\n-\t\tsum.enq_fail_objs += r->stats[lcore_id].enq_fail_objs;\n-\t\tsum.deq_success_bulk += r->stats[lcore_id].deq_success_bulk;\n-\t\tsum.deq_success_objs += r->stats[lcore_id].deq_success_objs;\n-\t\tsum.deq_fail_bulk += r->stats[lcore_id].deq_fail_bulk;\n-\t\tsum.deq_fail_objs += r->stats[lcore_id].deq_fail_objs;\n-\t}\n-\tfprintf(f, \"  size=%\"PRIu32\"\\n\", r->size);\n-\tfprintf(f, \"  enq_success_bulk=%\"PRIu64\"\\n\", sum.enq_success_bulk);\n-\tfprintf(f, \"  enq_success_objs=%\"PRIu64\"\\n\", sum.enq_success_objs);\n-\tfprintf(f, \"  enq_quota_bulk=%\"PRIu64\"\\n\", sum.enq_quota_bulk);\n-\tfprintf(f, \"  enq_quota_objs=%\"PRIu64\"\\n\", sum.enq_quota_objs);\n-\tfprintf(f, \"  enq_fail_bulk=%\"PRIu64\"\\n\", sum.enq_fail_bulk);\n-\tfprintf(f, \"  enq_fail_objs=%\"PRIu64\"\\n\", sum.enq_fail_objs);\n-\tfprintf(f, \"  deq_success_bulk=%\"PRIu64\"\\n\", sum.deq_success_bulk);\n-\tfprintf(f, \"  deq_success_objs=%\"PRIu64\"\\n\", sum.deq_success_objs);\n-\tfprintf(f, \"  deq_fail_bulk=%\"PRIu64\"\\n\", sum.deq_fail_bulk);\n-\tfprintf(f, \"  deq_fail_objs=%\"PRIu64\"\\n\", sum.deq_fail_objs);\n-#else\n-\tfprintf(f, \"  no statistics available\\n\");\n-#endif\n }\n \n /* dump the status of all rings on the console */\ndiff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h\nindex 61c0982..af7b7d4 100644\n--- a/lib/librte_ring/rte_ring.h\n+++ b/lib/librte_ring/rte_ring.h\n@@ -109,24 +109,6 @@ enum rte_ring_queue_behavior {\n \tRTE_RING_QUEUE_VARIABLE   /* Enq/Deq as many items as possible from ring */\n };\n \n-#ifdef RTE_LIBRTE_RING_DEBUG\n-/**\n- * A structure that stores the ring statistics (per-lcore).\n- */\n-struct rte_ring_debug_stats {\n-\tuint64_t enq_success_bulk; /**< Successful enqueues number. */\n-\tuint64_t enq_success_objs; /**< Objects successfully enqueued. */\n-\tuint64_t enq_quota_bulk;   /**< Successful enqueues above watermark. */\n-\tuint64_t enq_quota_objs;   /**< Objects enqueued above watermark. */\n-\tuint64_t enq_fail_bulk;    /**< Failed enqueues number. */\n-\tuint64_t enq_fail_objs;    /**< Objects that failed to be enqueued. */\n-\tuint64_t deq_success_bulk; /**< Successful dequeues number. */\n-\tuint64_t deq_success_objs; /**< Objects successfully dequeued. */\n-\tuint64_t deq_fail_bulk;    /**< Failed dequeues number. */\n-\tuint64_t deq_fail_objs;    /**< Objects that failed to be dequeued. */\n-} __rte_cache_aligned;\n-#endif\n-\n #define RTE_RING_MZ_PREFIX \"RG_\"\n /**< The maximum length of a ring name. */\n #define RTE_RING_NAMESIZE (RTE_MEMZONE_NAMESIZE - \\\n@@ -187,10 +169,6 @@ struct rte_ring {\n \t/** Ring consumer status. */\n \tstruct rte_ring_headtail cons __rte_aligned(CONS_ALIGN);\n \n-#ifdef RTE_LIBRTE_RING_DEBUG\n-\tstruct rte_ring_debug_stats stats[RTE_MAX_LCORE];\n-#endif\n-\n \tvoid *ring[] __rte_cache_aligned;   /**< Memory space of ring starts here.\n \t                                     * not volatile so need to be careful\n \t                                     * about compiler re-ordering */\n@@ -202,27 +180,6 @@ struct rte_ring {\n #define RTE_RING_SZ_MASK  (unsigned)(0x0fffffff) /**< Ring size mask */\n \n /**\n- * @internal When debug is enabled, store ring statistics.\n- * @param r\n- *   A pointer to the ring.\n- * @param name\n- *   The name of the statistics field to increment in the ring.\n- * @param n\n- *   The number to add to the object-oriented statistics.\n- */\n-#ifdef RTE_LIBRTE_RING_DEBUG\n-#define __RING_STAT_ADD(r, name, n) do {                        \\\n-\t\tunsigned __lcore_id = rte_lcore_id();           \\\n-\t\tif (__lcore_id < RTE_MAX_LCORE) {               \\\n-\t\t\tr->stats[__lcore_id].name##_objs += n;  \\\n-\t\t\tr->stats[__lcore_id].name##_bulk += 1;  \\\n-\t\t}                                               \\\n-\t} while(0)\n-#else\n-#define __RING_STAT_ADD(r, name, n) do {} while(0)\n-#endif\n-\n-/**\n  * Calculate the memory size needed for a ring\n  *\n  * This function returns the number of bytes needed for a ring, given\n@@ -463,17 +420,12 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n \n \t\t/* check that we have enough room in ring */\n \t\tif (unlikely(n > free_entries)) {\n-\t\t\tif (behavior == RTE_RING_QUEUE_FIXED) {\n-\t\t\t\t__RING_STAT_ADD(r, enq_fail, n);\n+\t\t\tif (behavior == RTE_RING_QUEUE_FIXED)\n \t\t\t\treturn -ENOBUFS;\n-\t\t\t}\n \t\t\telse {\n \t\t\t\t/* No free entry available */\n-\t\t\t\tif (unlikely(free_entries == 0)) {\n-\t\t\t\t\t__RING_STAT_ADD(r, enq_fail, n);\n+\t\t\t\tif (unlikely(free_entries == 0))\n \t\t\t\t\treturn 0;\n-\t\t\t\t}\n-\n \t\t\t\tn = free_entries;\n \t\t\t}\n \t\t}\n@@ -488,15 +440,11 @@ __rte_ring_mp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n \trte_smp_wmb();\n \n \t/* if we exceed the watermark */\n-\tif (unlikely(((mask + 1) - free_entries + n) > r->watermark)) {\n+\tif (unlikely(((mask + 1) - free_entries + n) > r->watermark))\n \t\tret = (behavior == RTE_RING_QUEUE_FIXED) ? -EDQUOT :\n \t\t\t\t(int)(n | RTE_RING_QUOT_EXCEED);\n-\t\t__RING_STAT_ADD(r, enq_quota, n);\n-\t}\n-\telse {\n+\telse\n \t\tret = (behavior == RTE_RING_QUEUE_FIXED) ? 0 : n;\n-\t\t__RING_STAT_ADD(r, enq_success, n);\n-\t}\n \n \t/*\n \t * If there are other enqueues in progress that preceded us,\n@@ -560,17 +508,12 @@ __rte_ring_sp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n \n \t/* check that we have enough room in ring */\n \tif (unlikely(n > free_entries)) {\n-\t\tif (behavior == RTE_RING_QUEUE_FIXED) {\n-\t\t\t__RING_STAT_ADD(r, enq_fail, n);\n+\t\tif (behavior == RTE_RING_QUEUE_FIXED)\n \t\t\treturn -ENOBUFS;\n-\t\t}\n \t\telse {\n \t\t\t/* No free entry available */\n-\t\t\tif (unlikely(free_entries == 0)) {\n-\t\t\t\t__RING_STAT_ADD(r, enq_fail, n);\n+\t\t\tif (unlikely(free_entries == 0))\n \t\t\t\treturn 0;\n-\t\t\t}\n-\n \t\t\tn = free_entries;\n \t\t}\n \t}\n@@ -583,15 +526,11 @@ __rte_ring_sp_do_enqueue(struct rte_ring *r, void * const *obj_table,\n \trte_smp_wmb();\n \n \t/* if we exceed the watermark */\n-\tif (unlikely(((mask + 1) - free_entries + n) > r->watermark)) {\n+\tif (unlikely(((mask + 1) - free_entries + n) > r->watermark))\n \t\tret = (behavior == RTE_RING_QUEUE_FIXED) ? -EDQUOT :\n \t\t\t(int)(n | RTE_RING_QUOT_EXCEED);\n-\t\t__RING_STAT_ADD(r, enq_quota, n);\n-\t}\n-\telse {\n+\telse\n \t\tret = (behavior == RTE_RING_QUEUE_FIXED) ? 0 : n;\n-\t\t__RING_STAT_ADD(r, enq_success, n);\n-\t}\n \n \tr->prod.tail = prod_next;\n \treturn ret;\n@@ -655,16 +594,11 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table,\n \n \t\t/* Set the actual entries for dequeue */\n \t\tif (n > entries) {\n-\t\t\tif (behavior == RTE_RING_QUEUE_FIXED) {\n-\t\t\t\t__RING_STAT_ADD(r, deq_fail, n);\n+\t\t\tif (behavior == RTE_RING_QUEUE_FIXED)\n \t\t\t\treturn -ENOENT;\n-\t\t\t}\n \t\t\telse {\n-\t\t\t\tif (unlikely(entries == 0)){\n-\t\t\t\t\t__RING_STAT_ADD(r, deq_fail, n);\n+\t\t\t\tif (unlikely(entries == 0))\n \t\t\t\t\treturn 0;\n-\t\t\t\t}\n-\n \t\t\t\tn = entries;\n \t\t\t}\n \t\t}\n@@ -694,7 +628,6 @@ __rte_ring_mc_do_dequeue(struct rte_ring *r, void **obj_table,\n \t\t\tsched_yield();\n \t\t}\n \t}\n-\t__RING_STAT_ADD(r, deq_success, n);\n \tr->cons.tail = cons_next;\n \n \treturn behavior == RTE_RING_QUEUE_FIXED ? 0 : n;\n@@ -741,16 +674,11 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,\n \tentries = prod_tail - cons_head;\n \n \tif (n > entries) {\n-\t\tif (behavior == RTE_RING_QUEUE_FIXED) {\n-\t\t\t__RING_STAT_ADD(r, deq_fail, n);\n+\t\tif (behavior == RTE_RING_QUEUE_FIXED)\n \t\t\treturn -ENOENT;\n-\t\t}\n \t\telse {\n-\t\t\tif (unlikely(entries == 0)){\n-\t\t\t\t__RING_STAT_ADD(r, deq_fail, n);\n+\t\t\tif (unlikely(entries == 0))\n \t\t\t\treturn 0;\n-\t\t\t}\n-\n \t\t\tn = entries;\n \t\t}\n \t}\n@@ -762,7 +690,6 @@ __rte_ring_sc_do_dequeue(struct rte_ring *r, void **obj_table,\n \tDEQUEUE_PTRS();\n \trte_smp_rmb();\n \n-\t__RING_STAT_ADD(r, deq_success, n);\n \tr->cons.tail = cons_next;\n \treturn behavior == RTE_RING_QUEUE_FIXED ? 0 : n;\n }\ndiff --git a/test/test/test_ring.c b/test/test/test_ring.c\nindex 5f09097..3891f5d 100644\n--- a/test/test/test_ring.c\n+++ b/test/test/test_ring.c\n@@ -763,412 +763,6 @@ test_ring_burst_basic(void)\n \treturn -1;\n }\n \n-static int\n-test_ring_stats(void)\n-{\n-\n-#ifndef RTE_LIBRTE_RING_DEBUG\n-\tprintf(\"Enable RTE_LIBRTE_RING_DEBUG to test ring stats.\\n\");\n-\treturn 0;\n-#else\n-\tvoid **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst = NULL;\n-\tint ret;\n-\tunsigned i;\n-\tunsigned num_items            = 0;\n-\tunsigned failed_enqueue_ops   = 0;\n-\tunsigned failed_enqueue_items = 0;\n-\tunsigned failed_dequeue_ops   = 0;\n-\tunsigned failed_dequeue_items = 0;\n-\tunsigned last_enqueue_ops     = 0;\n-\tunsigned last_enqueue_items   = 0;\n-\tunsigned last_quota_ops       = 0;\n-\tunsigned last_quota_items     = 0;\n-\tunsigned lcore_id = rte_lcore_id();\n-\tstruct rte_ring_debug_stats *ring_stats = &r->stats[lcore_id];\n-\n-\tprintf(\"Test the ring stats.\\n\");\n-\n-\t/* Reset the watermark in case it was set in another test. */\n-\trte_ring_set_water_mark(r, 0);\n-\n-\t/* Reset the ring stats. */\n-\tmemset(&r->stats[lcore_id], 0, sizeof(r->stats[lcore_id]));\n-\n-\t/* Allocate some dummy object pointers. */\n-\tsrc = malloc(RING_SIZE*2*sizeof(void *));\n-\tif (src == NULL)\n-\t\tgoto fail;\n-\n-\tfor (i = 0; i < RING_SIZE*2 ; i++) {\n-\t\tsrc[i] = (void *)(unsigned long)i;\n-\t}\n-\n-\t/* Allocate some memory for copied objects. */\n-\tdst = malloc(RING_SIZE*2*sizeof(void *));\n-\tif (dst == NULL)\n-\t\tgoto fail;\n-\n-\tmemset(dst, 0, RING_SIZE*2*sizeof(void *));\n-\n-\t/* Set the head and tail pointers. */\n-\tcur_src = src;\n-\tcur_dst = dst;\n-\n-\t/* Do Enqueue tests. */\n-\tprintf(\"Test the dequeue stats.\\n\");\n-\n-\t/* Fill the ring up to RING_SIZE -1. */\n-\tprintf(\"Fill the ring.\\n\");\n-\tfor (i = 0; i< (RING_SIZE/MAX_BULK); i++) {\n-\t\trte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK);\n-\t\tcur_src += MAX_BULK;\n-\t}\n-\n-\t/* Adjust for final enqueue = MAX_BULK -1. */\n-\tcur_src--;\n-\n-\tprintf(\"Verify that the ring is full.\\n\");\n-\tif (rte_ring_full(r) != 1)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Verify the enqueue success stats.\\n\");\n-\t/* Stats should match above enqueue operations to fill the ring. */\n-\tif (ring_stats->enq_success_bulk != (RING_SIZE/MAX_BULK))\n-\t\tgoto fail;\n-\n-\t/* Current max objects is RING_SIZE -1. */\n-\tif (ring_stats->enq_success_objs != RING_SIZE -1)\n-\t\tgoto fail;\n-\n-\t/* Shouldn't have any failures yet. */\n-\tif (ring_stats->enq_fail_bulk != 0)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs != 0)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for SP burst enqueue to a full ring.\\n\");\n-\tnum_items = 2;\n-\tret = rte_ring_sp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != 0)\n-\t\tgoto fail;\n-\n-\tfailed_enqueue_ops   += 1;\n-\tfailed_enqueue_items += num_items;\n-\n-\t/* The enqueue should have failed. */\n-\tif (ring_stats->enq_fail_bulk != failed_enqueue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs != failed_enqueue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for SP bulk enqueue to a full ring.\\n\");\n-\tnum_items = 4;\n-\tret = rte_ring_sp_enqueue_bulk(r, cur_src, num_items);\n-\tif (ret != -ENOBUFS)\n-\t\tgoto fail;\n-\n-\tfailed_enqueue_ops   += 1;\n-\tfailed_enqueue_items += num_items;\n-\n-\t/* The enqueue should have failed. */\n-\tif (ring_stats->enq_fail_bulk != failed_enqueue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs != failed_enqueue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for MP burst enqueue to a full ring.\\n\");\n-\tnum_items = 8;\n-\tret = rte_ring_mp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != 0)\n-\t\tgoto fail;\n-\n-\tfailed_enqueue_ops   += 1;\n-\tfailed_enqueue_items += num_items;\n-\n-\t/* The enqueue should have failed. */\n-\tif (ring_stats->enq_fail_bulk != failed_enqueue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs != failed_enqueue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for MP bulk enqueue to a full ring.\\n\");\n-\tnum_items = 16;\n-\tret = rte_ring_mp_enqueue_bulk(r, cur_src, num_items);\n-\tif (ret != -ENOBUFS)\n-\t\tgoto fail;\n-\n-\tfailed_enqueue_ops   += 1;\n-\tfailed_enqueue_items += num_items;\n-\n-\t/* The enqueue should have failed. */\n-\tif (ring_stats->enq_fail_bulk != failed_enqueue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs != failed_enqueue_items)\n-\t\tgoto fail;\n-\n-\n-\t/* Do Dequeue tests. */\n-\tprintf(\"Test the dequeue stats.\\n\");\n-\n-\tprintf(\"Empty the ring.\\n\");\n-\tfor (i = 0; i<RING_SIZE/MAX_BULK; i++) {\n-\t\trte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);\n-\t\tcur_dst += MAX_BULK;\n-\t}\n-\n-\t/* There was only RING_SIZE -1 objects to dequeue. */\n-\tcur_dst++;\n-\n-\tprintf(\"Verify ring is empty.\\n\");\n-\tif (1 != rte_ring_empty(r))\n-\t\tgoto fail;\n-\n-\tprintf(\"Verify the dequeue success stats.\\n\");\n-\t/* Stats should match above dequeue operations. */\n-\tif (ring_stats->deq_success_bulk != (RING_SIZE/MAX_BULK))\n-\t\tgoto fail;\n-\n-\t/* Objects dequeued is RING_SIZE -1. */\n-\tif (ring_stats->deq_success_objs != RING_SIZE -1)\n-\t\tgoto fail;\n-\n-\t/* Shouldn't have any dequeue failure stats yet. */\n-\tif (ring_stats->deq_fail_bulk != 0)\n-\t\tgoto fail;\n-\n-\tprintf(\"Test stats for SC burst dequeue with an empty ring.\\n\");\n-\tnum_items = 2;\n-\tret = rte_ring_sc_dequeue_burst(r, cur_dst, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != 0)\n-\t\tgoto fail;\n-\n-\tfailed_dequeue_ops   += 1;\n-\tfailed_dequeue_items += num_items;\n-\n-\t/* The dequeue should have failed. */\n-\tif (ring_stats->deq_fail_bulk != failed_dequeue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->deq_fail_objs != failed_dequeue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for SC bulk dequeue with an empty ring.\\n\");\n-\tnum_items = 4;\n-\tret = rte_ring_sc_dequeue_bulk(r, cur_dst, num_items);\n-\tif (ret != -ENOENT)\n-\t\tgoto fail;\n-\n-\tfailed_dequeue_ops   += 1;\n-\tfailed_dequeue_items += num_items;\n-\n-\t/* The dequeue should have failed. */\n-\tif (ring_stats->deq_fail_bulk != failed_dequeue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->deq_fail_objs != failed_dequeue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for MC burst dequeue with an empty ring.\\n\");\n-\tnum_items = 8;\n-\tret = rte_ring_mc_dequeue_burst(r, cur_dst, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != 0)\n-\t\tgoto fail;\n-\tfailed_dequeue_ops   += 1;\n-\tfailed_dequeue_items += num_items;\n-\n-\t/* The dequeue should have failed. */\n-\tif (ring_stats->deq_fail_bulk != failed_dequeue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->deq_fail_objs != failed_dequeue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test stats for MC bulk dequeue with an empty ring.\\n\");\n-\tnum_items = 16;\n-\tret = rte_ring_mc_dequeue_bulk(r, cur_dst, num_items);\n-\tif (ret != -ENOENT)\n-\t\tgoto fail;\n-\n-\tfailed_dequeue_ops   += 1;\n-\tfailed_dequeue_items += num_items;\n-\n-\t/* The dequeue should have failed. */\n-\tif (ring_stats->deq_fail_bulk != failed_dequeue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->deq_fail_objs != failed_dequeue_items)\n-\t\tgoto fail;\n-\n-\n-\tprintf(\"Test total enqueue/dequeue stats.\\n\");\n-\t/* At this point the enqueue and dequeue stats should be the same. */\n-\tif (ring_stats->enq_success_bulk != ring_stats->deq_success_bulk)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_success_objs != ring_stats->deq_success_objs)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_bulk    != ring_stats->deq_fail_bulk)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_fail_objs    != ring_stats->deq_fail_objs)\n-\t\tgoto fail;\n-\n-\n-\t/* Watermark Tests. */\n-\tprintf(\"Test the watermark/quota stats.\\n\");\n-\n-\tprintf(\"Verify the initial watermark stats.\\n\");\n-\t/* Watermark stats should be 0 since there is no watermark. */\n-\tif (ring_stats->enq_quota_bulk != 0)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != 0)\n-\t\tgoto fail;\n-\n-\t/* Set a watermark. */\n-\trte_ring_set_water_mark(r, 16);\n-\n-\t/* Reset pointers. */\n-\tcur_src = src;\n-\tcur_dst = dst;\n-\n-\tlast_enqueue_ops   = ring_stats->enq_success_bulk;\n-\tlast_enqueue_items = ring_stats->enq_success_objs;\n-\n-\n-\tprintf(\"Test stats for SP burst enqueue below watermark.\\n\");\n-\tnum_items = 8;\n-\tret = rte_ring_sp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != num_items)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should still be 0. */\n-\tif (ring_stats->enq_quota_bulk != 0)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != 0)\n-\t\tgoto fail;\n-\n-\t/* Success stats should have increased. */\n-\tif (ring_stats->enq_success_bulk != last_enqueue_ops + 1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_success_objs != last_enqueue_items + num_items)\n-\t\tgoto fail;\n-\n-\tlast_enqueue_ops   = ring_stats->enq_success_bulk;\n-\tlast_enqueue_items = ring_stats->enq_success_objs;\n-\n-\n-\tprintf(\"Test stats for SP burst enqueue at watermark.\\n\");\n-\tnum_items = 8;\n-\tret = rte_ring_sp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != num_items)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should have changed. */\n-\tif (ring_stats->enq_quota_bulk != 1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != num_items)\n-\t\tgoto fail;\n-\n-\tlast_quota_ops   = ring_stats->enq_quota_bulk;\n-\tlast_quota_items = ring_stats->enq_quota_objs;\n-\n-\n-\tprintf(\"Test stats for SP burst enqueue above watermark.\\n\");\n-\tnum_items = 1;\n-\tret = rte_ring_sp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != num_items)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should have changed. */\n-\tif (ring_stats->enq_quota_bulk != last_quota_ops +1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != last_quota_items + num_items)\n-\t\tgoto fail;\n-\n-\tlast_quota_ops   = ring_stats->enq_quota_bulk;\n-\tlast_quota_items = ring_stats->enq_quota_objs;\n-\n-\n-\tprintf(\"Test stats for MP burst enqueue above watermark.\\n\");\n-\tnum_items = 2;\n-\tret = rte_ring_mp_enqueue_burst(r, cur_src, num_items);\n-\tif ((ret & RTE_RING_SZ_MASK) != num_items)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should have changed. */\n-\tif (ring_stats->enq_quota_bulk != last_quota_ops +1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != last_quota_items + num_items)\n-\t\tgoto fail;\n-\n-\tlast_quota_ops   = ring_stats->enq_quota_bulk;\n-\tlast_quota_items = ring_stats->enq_quota_objs;\n-\n-\n-\tprintf(\"Test stats for SP bulk enqueue above watermark.\\n\");\n-\tnum_items = 4;\n-\tret = rte_ring_sp_enqueue_bulk(r, cur_src, num_items);\n-\tif (ret != -EDQUOT)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should have changed. */\n-\tif (ring_stats->enq_quota_bulk != last_quota_ops +1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != last_quota_items + num_items)\n-\t\tgoto fail;\n-\n-\tlast_quota_ops   = ring_stats->enq_quota_bulk;\n-\tlast_quota_items = ring_stats->enq_quota_objs;\n-\n-\n-\tprintf(\"Test stats for MP bulk enqueue above watermark.\\n\");\n-\tnum_items = 8;\n-\tret = rte_ring_mp_enqueue_bulk(r, cur_src, num_items);\n-\tif (ret != -EDQUOT)\n-\t\tgoto fail;\n-\n-\t/* Watermark stats should have changed. */\n-\tif (ring_stats->enq_quota_bulk != last_quota_ops +1)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_quota_objs != last_quota_items + num_items)\n-\t\tgoto fail;\n-\n-\tprintf(\"Test watermark success stats.\\n\");\n-\t/* Success stats should be same as last non-watermarked enqueue. */\n-\tif (ring_stats->enq_success_bulk != last_enqueue_ops)\n-\t\tgoto fail;\n-\tif (ring_stats->enq_success_objs != last_enqueue_items)\n-\t\tgoto fail;\n-\n-\n-\t/* Cleanup. */\n-\n-\t/* Empty the ring. */\n-\tfor (i = 0; i<RING_SIZE/MAX_BULK; i++) {\n-\t\trte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK);\n-\t\tcur_dst += MAX_BULK;\n-\t}\n-\n-\t/* Reset the watermark. */\n-\trte_ring_set_water_mark(r, 0);\n-\n-\t/* Reset the ring stats. */\n-\tmemset(&r->stats[lcore_id], 0, sizeof(r->stats[lcore_id]));\n-\n-\t/* Free memory before test completed */\n-\tfree(src);\n-\tfree(dst);\n-\treturn 0;\n-\n-fail:\n-\tfree(src);\n-\tfree(dst);\n-\treturn -1;\n-#endif\n-}\n-\n /*\n  * it will always fail to create ring with a wrong ring size number in this function\n  */\n@@ -1335,10 +929,6 @@ test_ring(void)\n \tif (test_ring_basic() < 0)\n \t\treturn -1;\n \n-\t/* ring stats */\n-\tif (test_ring_stats() < 0)\n-\t\treturn -1;\n-\n \t/* basic operations */\n \tif (test_live_watermark_change() < 0)\n \t\treturn -1;\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "04/14"
    ]
}