From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from proxy.6wind.com (host.76.145.23.62.rev.coltfrance.com [62.23.145.76]) by dpdk.org (Postfix) with ESMTP id E3DE5968 for ; Thu, 7 Sep 2017 14:20:48 +0200 (CEST) Received: from glumotte.dev.6wind.com (unknown [10.16.0.195]) by proxy.6wind.com (Postfix) with ESMTP id B482ECD5D9; Thu, 7 Sep 2017 14:17:06 +0200 (CEST) From: Olivier Matz To: dev@dpdk.org Cc: venki497@gmail.com, bruce.richardson@intel.com Date: Thu, 7 Sep 2017 14:20:33 +0200 Message-Id: <20170907122033.17983-2-olivier.matz@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170907122033.17983-1-olivier.matz@6wind.com> References: <20170907122033.17983-1-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 2/2] test/ring: do not mask result of enqueue or dequeue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Sep 2017 12:20:49 -0000 The define RTE_RING_SZ_MASK is the maximum size supported by the rte_ring. The size is checked at ring creation. There is no reason today to mask the result of rte_ring_sp_enqueue_burst() or rte_ring_sc_dequeue_burst() with this value. The flag RTE_RING_QUOT_EXCEED was previously included in the returned value but it was removed in commit 77dd3064270c ("ring: remove watermark support"). Signed-off-by: Olivier Matz --- test/test/test_ring.c | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/test/test/test_ring.c b/test/test/test_ring.c index d664b04b7..87771ed16 100644 --- a/test/test/test_ring.c +++ b/test/test/test_ring.c @@ -375,37 +375,37 @@ test_ring_burst_basic(void) printf("enqueue 1 obj\n"); ret = rte_ring_sp_enqueue_burst(r, cur_src, 1, NULL); cur_src += 1; - if ((ret & RTE_RING_SZ_MASK) != 1) + if (ret != 1) goto fail; printf("enqueue 2 objs\n"); ret = rte_ring_sp_enqueue_burst(r, cur_src, 2, NULL); cur_src += 2; - if ((ret & RTE_RING_SZ_MASK) != 2) + if (ret != 2) goto fail; printf("enqueue MAX_BULK objs\n"); ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL); cur_src += MAX_BULK; - if ((ret & RTE_RING_SZ_MASK) != MAX_BULK) + if (ret != MAX_BULK) goto fail; printf("dequeue 1 obj\n"); ret = rte_ring_sc_dequeue_burst(r, cur_dst, 1, NULL); cur_dst += 1; - if ((ret & RTE_RING_SZ_MASK) != 1) + if (ret != 1) goto fail; printf("dequeue 2 objs\n"); ret = rte_ring_sc_dequeue_burst(r, cur_dst, 2, NULL); cur_dst += 2; - if ((ret & RTE_RING_SZ_MASK) != 2) + if (ret != 2) goto fail; printf("dequeue MAX_BULK objs\n"); ret = rte_ring_sc_dequeue_burst(r, cur_dst, MAX_BULK, NULL); cur_dst += MAX_BULK; - if ((ret & RTE_RING_SZ_MASK) != MAX_BULK) + if (ret != MAX_BULK) goto fail; /* check data */ @@ -423,7 +423,7 @@ test_ring_burst_basic(void) for (i = 0; i< (RING_SIZE/MAX_BULK - 1); i++) { ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL); cur_src += MAX_BULK; - if ((ret & RTE_RING_SZ_MASK) != MAX_BULK) { + if (ret != MAX_BULK) { goto fail; } } @@ -431,14 +431,14 @@ test_ring_burst_basic(void) printf("Enqueue 2 objects, free entries = MAX_BULK - 2 \n"); ret = rte_ring_sp_enqueue_burst(r, cur_src, 2, NULL); cur_src += 2; - if ((ret & RTE_RING_SZ_MASK) != 2) + if (ret != 2) goto fail; printf("Enqueue the remaining entries = MAX_BULK - 2 \n"); /* Always one free entry left */ ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL); cur_src += MAX_BULK - 3; - if ((ret & RTE_RING_SZ_MASK) != MAX_BULK - 3) + if (ret != MAX_BULK - 3) goto fail; printf("Test if ring is full \n"); @@ -447,26 +447,26 @@ test_ring_burst_basic(void) printf("Test enqueue for a full entry \n"); ret = rte_ring_sp_enqueue_burst(r, cur_src, MAX_BULK, NULL); - if ((ret & RTE_RING_SZ_MASK) != 0) + if (ret != 0) goto fail; printf("Test dequeue without enough objects \n"); for (i = 0; i