From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81C0EA051C; Fri, 17 Jan 2020 18:12:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C3B6C34EF; Fri, 17 Jan 2020 18:12:48 +0100 (CET) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by dpdk.org (Postfix) with ESMTP id 7BA572C08 for ; Fri, 17 Jan 2020 18:12:47 +0100 (CET) Received: by mail-wm1-f68.google.com with SMTP id d139so9940067wmd.0 for ; Fri, 17 Jan 2020 09:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O3bo4WsKdQ28wjuwwLt6TbRH3rcTlukWcpw0DxQsi5s=; b=FqUrY7D7omylG/QfpJTf1kd3znNPodzxj1YM/ADxctpDvZmjXG9LzriHkzPAJENbC9 FH1qwSwy0tVYmCqOwGWIfXawmntaydxqPbhz9h93BP3iu0pQA7Ey6P2ACpikns8cVHLV aE4s7D9pMyg0NG6J5oU9AszhRMch5ssbyRTdKN9jHlL15sSKq6WgEWN6rdbaspoE3Vb4 2N/Tedl+GCVdqA59cuj9OiyW/NYyI1z2lRFh4HyYQSHUdIp4RC52VueHy+x/tnVEnqCz guwBHvBWPDvQICgc5JXGLXBIfJyMgNj5E1ifwflZ4oNvpUNlr9NhcxOKxZT6vTMRBt3n 06Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O3bo4WsKdQ28wjuwwLt6TbRH3rcTlukWcpw0DxQsi5s=; b=LeXrMuSjN47LbggaHAzzYQGgeiJA2ihs+kVaXJbkcAIogYRkiifMzU7VqZsyK3NJSx iCXUeyCR453EjB4UOd7mIfASKM7HAiPuv5T5ddZoyv6ZRAsbeYhEF6BdnFcWI9tB0vBS hKlv/SgE5MxKfz+L1ZnW12ckRW66eiSRuM4P1WA6GAVGCYvyTeZMGV/cnYeFW3xZolWc Z7bvV78I5O9iNJW8fJdsOyM3v3Af3ElA20n9IAxl3WrXFvPcnH581crS9SSMRe59TI5k aXpvEoP0LHMU26xAC4NrABQ+DOri4KClnA3WX/KsBKD5U16yaU30sbMMunWnmOLLhiDz ZiSg== X-Gm-Message-State: APjAAAWR1zMha0TRP1tQf+HpGKpsbNG7hpz0VElUcUl/XC2M1J/2Z1Ub RnTxloooAuf5MPcKrOvj+lF6TQ== X-Google-Smtp-Source: APXvYqxIikvZMh/Qe2T6/Q/w/b9rpqennBRjuQroy6vOSti5kBq1eGpaCu48glYTi7s1nIWg0/2kzA== X-Received: by 2002:a7b:cc09:: with SMTP id f9mr5765972wmh.71.1579281167156; Fri, 17 Jan 2020 09:12:47 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id h66sm11520181wme.41.2020.01.17.09.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 09:12:46 -0800 (PST) Date: Fri, 17 Jan 2020 18:12:45 +0100 From: Olivier Matz To: Honnappa Nagarahalli Cc: sthemmin@microsoft.com, jerinj@marvell.com, bruce.richardson@intel.com, david.marchand@redhat.com, pbhagavatula@marvell.com, konstantin.ananyev@intel.com, yipeng1.wang@intel.com, dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com, gavin.hu@arm.com, nd@arm.com Message-ID: <20200117171245.GA22738@platinum> References: <20190906190510.11146-1-honnappa.nagarahalli@arm.com> <20200116052511.8557-1-honnappa.nagarahalli@arm.com> <20200116052511.8557-5-honnappa.nagarahalli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200116052511.8557-5-honnappa.nagarahalli@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v9 4/6] test/ring: modify perf test cases to use rte_ring_xxx_elem APIs 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jan 15, 2020 at 11:25:09PM -0600, Honnappa Nagarahalli wrote: > Adjust the performance test cases to test rte_ring_xxx_elem APIs. > > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Gavin Hu > --- > app/test/test_ring_perf.c | 454 +++++++++++++++++++++++--------------- > 1 file changed, 273 insertions(+), 181 deletions(-) > > diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c > index 6c2aca483..8d1217951 100644 > --- a/app/test/test_ring_perf.c > +++ b/app/test/test_ring_perf.c [...] > -static int > -test_ring_perf(void) > +/* Run all tests for a given element size */ > +static __rte_always_inline int > +test_ring_perf_esize(const int esize) > { > struct lcore_pair cores; > struct rte_ring *r = NULL; > > - r = rte_ring_create(RING_NAME, RING_SIZE, rte_socket_id(), 0); > + /* > + * Performance test for legacy/_elem APIs > + * SP-SC/MP-MC, single > + */ > + r = test_ring_create(RING_NAME, esize, RING_SIZE, rte_socket_id(), 0); > if (r == NULL) > return -1; > > - printf("### Testing single element and burst enq/deq ###\n"); > - test_single_enqueue_dequeue(r); > - test_burst_enqueue_dequeue(r); > + printf("\n### Testing single element enq/deq ###\n"); > + if (test_single_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_SPSC | TEST_RING_ELEM_SINGLE) < 0) > + return -1; the ring is not freed on error (same below) > + if (test_single_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_MPMC | TEST_RING_ELEM_SINGLE) < 0) > + return -1; > + > + printf("\n### Testing burst enq/deq ###\n"); > + if (test_burst_bulk_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_SPSC | TEST_RING_ELEM_BURST) < 0) > + return -1; > + if (test_burst_bulk_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_MPMC | TEST_RING_ELEM_BURST) < 0) > + return -1; > > - printf("\n### Testing empty dequeue ###\n"); > - test_empty_dequeue(r); > + printf("\n### Testing bulk enq/deq ###\n"); > + if (test_burst_bulk_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_SPSC | TEST_RING_ELEM_BULK) < 0) > + return -1; > + if (test_burst_bulk_enqueue_dequeue(r, esize, > + TEST_RING_THREAD_MPMC | TEST_RING_ELEM_BULK) < 0) > + return -1; > > - printf("\n### Testing using a single lcore ###\n"); > - test_bulk_enqueue_dequeue(r); > + printf("\n### Testing empty bulk deq ###\n"); > + test_empty_dequeue(r, esize, > + TEST_RING_THREAD_SPSC | TEST_RING_ELEM_BULK); > + test_empty_dequeue(r, esize, > + TEST_RING_THREAD_MPMC | TEST_RING_ELEM_BULK); > > if (get_two_hyperthreads(&cores) == 0) { > printf("\n### Testing using two hyperthreads ###\n"); > - run_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk); > + if (run_on_core_pair(&cores, r, esize) < 0) > + return -1; > } > if (get_two_cores(&cores) == 0) { > printf("\n### Testing using two physical cores ###\n"); > - run_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk); > + if (run_on_core_pair(&cores, r, esize) < 0) > + return -1; > } > if (get_two_sockets(&cores) == 0) { > printf("\n### Testing using two NUMA nodes ###\n"); > - run_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk); > + if (run_on_core_pair(&cores, r, esize) < 0) > + return -1; > } > > printf("\n### Testing using all slave nodes ###\n"); > - run_on_all_cores(r); > + if (run_on_all_cores(r, esize) < 0) > + return -1; > > rte_ring_free(r); > + > + return 0; > +}