From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0083.outbound.protection.outlook.com [104.47.40.83]) by dpdk.org (Postfix) with ESMTP id 0CADE7D04 for ; Thu, 5 Oct 2017 10:08:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UpAyOok2V1BKhdAQgiMeWgTgVT7K1vGkG2q67nlwoJA=; b=oi0DrSd+KzAh7ES5b1dkADPUHMFTnR7nj8fDSzfiBV5pVVao1pZZlSwyD44O0gKJpk6MvBjl9AbBoJ6E1UI+CxUugGr+QFwPwhVlVNd+Yv2XwqyGcBFxtdlfoA93bGhOXQ6kypIVkNrpvObXlrbBxSNfuOP5EgO8t+Cvp8b065M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 5 Oct 2017 08:08:41 +0000 Date: Thu, 5 Oct 2017 13:38:21 +0530 From: Pavan Nikhilesh Bhagavatula To: "Rao, Nikhil" Cc: dev@dpdk.org Message-ID: <20171005080820.GA15021@PBHAGAVATULA-LT> References: <1506028634-22998-1-git-send-email-nikhil.rao@intel.com> <1506028634-22998-5-git-send-email-nikhil.rao@intel.com> <20171003113640.GA12943@PBHAGAVATULA-LT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR0101CA0039.INDPRD01.PROD.OUTLOOK.COM (52.134.137.25) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0ad3e08b-7548-41ce-8d84-08d50bc84ae6 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:f/z4k6IUiaZCcDC38ZdnUWcpRizuSPuH0R/hKVqe8+jgor136p784WoN5vFhlqYNX5skdZmXzvnmtf6umlsNW40sSp2v1R1Bw9CjVWJPOFre4fbI9ihPt7XEhruKyXHMjNcsxdGoqgGhE1vzxGi6w5/QhZz6a+d5RrZVklFcjqON2JU2ocaLfWUUwvAjEYZS4h/DI7nf7AiD65b+opmy5bhYSxFNoKejUoJXYOpvIQK1dApXETXWGVsWZJNSGYTh; 25:ByBfpKD9MTaY7ZcddGv8aAqnWTmK+2M3xSYykx5bnVSY/8VQAAuMAMcKfCynuLyvg/wRCySgXZY3KfW015+xh/i4xzU7wV7lHTaq4xMbtK2/ciTa95GZjUqcRthMjb9bJ2xn43qVfqepEj3UJ5jjdpF4CORxc9pPloq/LtBuKdjqsIxV+DbCrT81kDkVK0KrE8enZbzblCdfPVfwxwEC1qNJGuSqv17cpiaS9SExuTn83bdqEn+aFP/ZF7YKjXnMAkCp2Q5sVsc846eWSwlMLDbyqo4nTpQ1icuTJ/g+IX8jB+hW0c1OyzT93Yb45NgYp5YlVAlV6ToBH9lcNGHxmQ==; 31:HfN99uz8cQhOfOF1knlgYqlTGVmN3EPGrVCZyDD0q8FCK0Oljd87tXyiVHlTBE2QJXx58H/vqzAhz7bZyZLHRDOsi0sknEBGsFAI9Cz3yh0dT1EEeXPVSmR1p14wLuqanjCPYdvE+1usmS1eAQ3YSQ0ZtqysEMEXyG+hXM98DSbORQTqUfApXB6riYz/go9eT832v4EQ/9VkppCgB45QigkaPfvp5T3mnJJV1EOp5tc= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:3ieBUc3nW3sew+cX6XIaVG5HMMUQMAw9Dp2WuE6W9G6nDrJvbQ/F65Vsl7sy762yaWu8d+v3bjZ9PTpqcigrl9ny5DVlq3+4EQCcafUEMBTti1Ard3tEyOyaNdK2GqUhHpvesdy6nnj/kg2/j0vj4htFxqFLIW6KmxjBgGi0riH9d5R6xObSNeM+AiHr355XDxgEqWXodpr6BDBEuC2/J770sG1B4pgZ6wJ/I1HoTiWovGT4s2c76pmQi4QHdz6Ga3fc54c6r/i7Y1wPQLS21iS3VAx5Q0rlvFB05IQ5SWzAWb0BSZdHOXeFixDyr1sVrXmHtvGJ5yTctvDe7KGTYn6bV/I7WMT3ihH1Fxq+vbPEqtsARYe84GjZ8BMamEiRO2f7wD4GHRZz5DH7fLu2m796I2/u8FOh3lpaHnm3cf2lZARNI+OPFB33BVb2tvMYWIpjignRCG/eb9HVWWQ51Exaes9cltf4+dfulbl/8ycscaHooLYJHE2mTApMGnXPdLffZUmZJm/pfYjX0XHomifXF87hp4UOW6cjQbd1AcgH5D/RZnblYYz0fKAGO/85QLfTO+0o6c5833U0nMAFqi8dgGd8yeZ+qdfkUBiX6QI=; 4:SCrvPQaya0UNbLZM8P8MQxGLZgwk4WBXi4rAH6uRDIiRflrdiLhmFxAWePdrUpMBhUAhw7eg/dLwsbHaUGRy6t1Jzh7UCEF1XbO0oiDq2u5rSqnHYt9AOHwXcJ5nVD1nqfAbRjpMAhK10LuopjJnD4TU6BDyySSULUplF6+PogzHGH8p5xVg6+s+rB48hUAiuYbhfWZondmcMhJPmsoyOrhg9x9ArRwGpW8r/oOkDpWVG37x5h0+ccVbKqLuDgd+sAz5Fs7ECvgL2Pd/4PzXbUdOi0dlPMFif9vVY5jsb64= X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(10201501046)(3002001)(100000703101)(100105400095)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR07MB3468; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(24454002)(57704003)(377454003)(189002)(478600001)(316002)(83506001)(93886005)(50466002)(101416001)(25786009)(966005)(66066001)(33656002)(6116002)(189998001)(16586007)(54356999)(106356001)(1076002)(16526018)(72206003)(6496005)(33716001)(58126008)(76176999)(23726003)(6666003)(4326008)(53546010)(47776003)(68736007)(81166006)(8936002)(5660300001)(53936002)(81156014)(105586002)(3846002)(50986999)(2906002)(42882006)(5009440100003)(55016002)(6916009)(97736004)(2950100002)(9686003)(6306002)(7736002)(53376002)(229853002)(8676002)(6246003)(305945005)(18370500001)(21314002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; H:PBHAGAVATULA-LT; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3468; 23:blqKFlLgur/xV612270GRhlAVIRHwxw6iNYUU8ZP/?= =?us-ascii?Q?HtUm5PmluWefkQTZ/7zmA1HvBsDbg9d18yvZHR8rvG9Z255Ovd6iuwHW3Czj?= =?us-ascii?Q?ut+/GX9Me5c5nHaeQtyXJzZwcY+6JdWwHbZuvQFR1Tp/XOzZ65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GsJOM8qfZeflz+tKcgI6UymtRsY8Z1gCSeNw8cDsFMB/UrVrD9BKkoeL7rfBCVsgmrI3j28eAdmxjkSPskZZc=; 7:G/tQJ+YbXU4Lzba2DbaA2dyTI/Ts88wUVz/SX/FuT9I+fXjObWrDf2CiqsgBnhVmTcRFzdoAu42JOfg+ABaoJbO3olqmJDvMJ8HwaKduwMW3kmKGVdyjg5tLAWeymPOtBRTwlhPOvd4ZG5mMcrRgX9i35qNw5emxxGLXj9MSkM4F9/s7LshYiJng8+W0Sz9OKBPUmx5Iwq5jFZtFwLPyhscUQlxl3FKvNpDlSyogBV4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 08:08:41.0625 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3468 Subject: Re: [dpdk-dev] [PATCH v4 4/4] eventdev: Add tests for event eth Rx adapter 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: , X-List-Received-Date: Thu, 05 Oct 2017 08:08:48 -0000 On Thu, Oct 05, 2017 at 11:27:53AM +0530, Rao, Nikhil wrote: > On 10/3/2017 5:06 PM, Pavan Nikhilesh Bhagavatula wrote: > >On Fri, Sep 22, 2017 at 02:47:14AM +0530, Nikhil Rao wrote: > > > >Hi Nikhil, > > > > > >>Add unit tests for rte_event_eth_rx_adapter_xxx() APIs > >> > >>Signed-off-by: Nikhil Rao > >>--- > >> test/test/test_event_eth_rx_adapter.c | 399 ++++++++++++++++++++++++++++++++++ > >> test/test/Makefile | 1 + > >> 2 files changed, 400 insertions(+) > >> create mode 100644 test/test/test_event_eth_rx_adapter.c > >> > >>diff --git a/test/test/test_event_eth_rx_adapter.c b/test/test/test_event_eth_rx_adapter.c > >>new file mode 100644 > >>index 000000000..5d448dc27 > > > >>+ > >>+static int > >>+testsuite_setup(void) > >>+{ > >>+ int err; > >>+ err = init_ports(rte_eth_dev_count()); > >>+ TEST_ASSERT(err == 0, "Port initialization failed err %d\n", err); > >>+ > >>+ struct rte_event_dev_config config = { > >>+ .nb_event_queues = 1, > >>+ .nb_event_ports = 1, > >>+ .nb_events_limit = 4096, > >>+ .nb_event_queue_flows = 1024, > >>+ .nb_event_port_dequeue_depth = 16, > >>+ .nb_event_port_enqueue_depth = 16 > >>+ }; > >>+ > > > >Some eth devices like octeontx[1] use event device to receive packets, So in > >this special case it would require to stop the event device before configuring > >the event device as it is already started in port_init. > > > >Calling rte_event_dev_stop(0) here would satisfy such use case. > > Hi Pavan, > > port_init is starting the eth device not the event device. If eth_octeontx is the eth device It uses event_octeontx to work. So, when rte_eth_dev_start is called in port_init it invokes rte_event_dev_start internally. > > Moving init_ports to after rte_event_dev_configure should also work ? Yep, this works too. > > > > >[1] http://dpdk.org/ml/archives/dev/2017-August/073982.html > > > >>+ err = rte_event_dev_configure(0, &config); > >>+ TEST_ASSERT(err == 0, "Event device initialization failed err %d\n", > >>+ err); > >>+ > >>+ err = rte_event_eth_rx_adapter_caps_get(0, 0, &default_params.caps); > >>+ TEST_ASSERT(err == 0, "Failed to get adapter cap err %d\n", > > > > > > > >>+ > >>+static int > >>+adapter_queue_add_del(void) > >>+{ > >>+ int err; > >>+ struct rte_event ev; > >>+ uint32_t cap; > >>+ > >>+ struct rte_event_eth_rx_adapter_queue_conf queue_config; > >>+ > >>+ err = rte_event_eth_rx_adapter_caps_get(0, 0, &cap); > >>+ TEST_ASSERT(err == 0, "Expected 0 got %d", err); > >>+ > >>+ ev.queue_id = 0; > >>+ ev.sched_type = RTE_SCHED_TYPE_ATOMIC; > >>+ ev.priority = 0; > >>+ > >>+ queue_config.rx_queue_flags = 0; > >>+ if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_FLOW_ID)) { > >>+ ev.flow_id = 1; > >>+ queue_config.rx_queue_flags = > >>+ RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID; > >>+ } > >>+ queue_config.ev = ev; > >>+ queue_config.servicing_weight = 1; > >>+ > > > >As mentioned above[1] in case of HW accelerated coprocessors the eth_port has > >to be stopped before reconfiguring the eth queue to event queue remapping. > >Calling rte_eth_dev_stop(0) is required before trying to map the eth queue. > > > > Is it possible to do this internally within the queue_add call ? It is possible to handle this internally. AFAIK it is a very specific case that exists when we are using eth_octeontx and event_octeontx. So, I think this changes is not required. > > If not, the application would call rte_eth_dev_stop() if > RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT is set or do we need a separate > capability for this ? > > >>+ err = rte_event_eth_rx_adapter_queue_add(0, rte_eth_dev_count(), > >>+ -1, &queue_config); > >>+ TEST_ASSERT(err == -EINVAL, "Expected -EINVAL got %d", err); > >>+ > >>+ if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_SINGLE_EVENTQ)) { > >>+ err = rte_event_eth_rx_adapter_queue_add(0, 0, 0, > >>+ &queue_config); > >>+ TEST_ASSERT(err == 0, "Expected 0 got %d", err); > >>+ > >>+ err = rte_event_eth_rx_adapter_queue_del(0, 0, 0); > >>+ TEST_ASSERT(err == 0, "Expected 0 got %d", err); > >>+ > >>+ err = rte_event_eth_rx_adapter_queue_add(0, 0, -1, > >>+ &queue_config); > >>+ TEST_ASSERT(err == 0, "Expected 0 got %d", err); > >>+ > >>+ err = rte_event_eth_rx_adapter_queue_del(0, 0, -1); > >>+ TEST_ASSERT(err == 0, "Expected 0 got %d", err); > >>+ } else { > >>+ err = rte_event_eth_rx_adapter_queue_add(0, 0, 0, > >>+ &queue_config); > >>+ TEST_ASSERT(err == -EINVAL, "Expected EINVAL got %d", err); > >>+ > >> > > > > > >Thanks, > >Pavan > > >