From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0044.outbound.protection.outlook.com [104.47.41.44]) by dpdk.org (Postfix) with ESMTP id BD9691B338 for ; Tue, 3 Oct 2017 13:37:32 +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=1RMCWYnDdyEJ//QiI72lE2G4JeobmKl+924iNi+eYAA=; b=e1kh8emSTPyX+kiG8rYk9SFuNlMTvH0PbaXaWFpiIvNd6ImJgd2iqSVIU4DWRbjh9GkogjFrZ26hHt6YAPnALAuFFWgQWrOM3hjDY0sF0MtDGrn+DUJ6fmtxIG8cbHoOW7K0JIQwN/u5Sl7VQ5mvut/pKT7sbW+O9/gcByzVDu0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from PBHAGAVATULA-LT (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 3 Oct 2017 11:37:30 +0000 Date: Tue, 3 Oct 2017 17:06:41 +0530 From: Pavan Nikhilesh Bhagavatula To: Nikhil Rao Cc: dev@dpdk.org Message-ID: <20171003113640.GA12943@PBHAGAVATULA-LT> References: <1506028634-22998-1-git-send-email-nikhil.rao@intel.com> <1506028634-22998-5-git-send-email-nikhil.rao@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506028634-22998-5-git-send-email-nikhil.rao@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BMXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.174.214.152) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79aa5969-9287-4d8f-6da9-08d50a53226d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:AXpFCR8dl0HHDhpk4s9axyt6dQgqfRQlpCm6gDxaa+i3ke+249AShAgzoWy5RaGYwpco5WoGCAh3J2QiKAnmoSyBUsabTltUQVCNid7d8Kz4FHGeMtjk6WYX79x7+8L2BbAsrb7osc2Wp5U/d4ds4NUI6Vizm4IepwSWKFbC6LG5UEb/KKKWyJsida9crbdQCPqFCyR/y9QnkiTe0hdqnp6wxb/inkGTgDxyRGOz9gsTsTjmNAVKq0jADjNw1mSe; 25:k+hPOnn6pksPp/BrTLqgZl7AcAJ+MXpz+4JXPXznIrrCCOzKcjeTrzQOJZiabf6kjw/WdMeb9BkHzdEorTkhWglwz0BTB/t5HFvZbiJJWtpoy/xt9iLQUIswA3gZjcf4Abcr5tmOUjYPMlVTGHjB7p1RwbwnX92C4JRp9iFgyv1JOGWHaZPg7HW+M31774zK6wvtqDk1+Y3S63lUtZVMR2QAILZU6g4peRek0W2W1ljW3F+ZAyeKVuetu1s3s7lDb71IY+KBCVbBc87EMLG0ajNQsZfPkW0tQeukW2GyGZu0uQPIAbW7LyRcMsbfVdD0kFtSEt4OC2ZXGejH+rSVLg==; 31:1r5yU/1kQY0mT17tLr/qrvuoR0gEZLW8y7JYETHE/8slQhNKvJkkJv8uYQY+e8Pf3yy4CzxsLq4ZylKlab9VV3GChZUSAPJnXbTfID8VDWIy6WCqPZe0oLId+4LDXTaxJN71yls4MAgRl7OMou8X9uTaDnEY4b2Wl0rDd7ss61wGEL55zie/racKxqrwkvfrt/KMW4+IZyx85OyhP2r+Ei2ZfwiacPtDud4/+7ko7NI= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:zkM4f/0ZU1hmlAVNnk+vD3AZkfwT1EcFolQJ2vdGmsYCCdmf5ByJVAqEFF418S2wk/CosmnZpO1tLAe/RePgMgAQl64NjBYNhHkqI2zJnY+F4Z1Gm3Sy13naDedf+Dep89jvieJbUIXDrqlysD53SnKyJHpy5Sc9AJiYUiEKPbIdCn3niUpuXiBejYIBXz1H4xMRXnXGl6mUcVZxhjAg32016AKIick97AcclfzLwYyULeEMiS4vooUkUYbSz6xf79RQzHSKAMGzddpyhlE22qMCi3oAszMLKVFzEfHNuNgEeob0l7oF2v0CtVFhSUMdhbQb5XSpWJiFMaeoqmR+OK7Ow/Y4TMCWxK6ijP+x4bRnZ4B+u38rIu3i/+FntS7gEtYsv4Wr7lQlmAM3TC3E4WDMiFHDmyPE//RCnSchSdHHZqBu1ds49WdPu7DZypO6BHoK5wYATTgzQV0BoIaTh/nsUHJRMKCg+mA9yrdGHdw+V9nlaJ6UHBwi3oZhjJwkxbhaIJHf79y+LHGAsPa4KLRDdJW3bc8XGe8f2PqpaaI3HZm0L0uBXr+Gd9vP6wHoeeJYA94wQRZbKmzT2lg5vdTOVLdnlBwN/FZNqN2bYws=; 4:/A2XDOOgiRWL0+Y1fDqC7E7A8drEbVbk/6pRJiYosf3EAXJjulbC4tmCX8Gjgi5Z6mwRlBPKBGL7noBVxmqRfOr2oCxO2jrlaj4SucXWmFVAUmarKF6Pp1Xj+L9bdUNo5mo9jXNuFbRLzu8h1c48u7h8QA8IduajXMtcG6y5hLmi9fZlNttC2M3OWwNQv71VWpQdRDKabV1vwk2z08L0R274i/7Sppbly+YtaRMgSxxbC5bFwvmCgkNGpQNr/w3fmLRCP/OYgLimzjBa4hsOpMsnZ9fvGHfIsstFrJy5i/w= 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)(3002001)(93006095)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 044968D9E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(24454002)(189002)(199003)(50466002)(55016002)(6496005)(101416001)(47776003)(8936002)(2950100002)(42882006)(6916009)(305945005)(53376002)(9686003)(7736002)(6246003)(83506001)(229853002)(68736007)(53936002)(6306002)(2906002)(81166006)(8676002)(33656002)(189998001)(81156014)(23726003)(6666003)(1076002)(4326008)(966005)(16586007)(5009440100003)(97736004)(54356999)(25786009)(3846002)(5660300001)(6116002)(33716001)(16526017)(316002)(72206003)(478600001)(50986999)(105586002)(76176999)(106356001)(66066001)(58126008)(18370500001)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:PBHAGAVATULA-LT; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR07MB3464; 23:UfOGJ4cP8Dd8mkZUPNGgRnhPuKW6ocXLNMPbCX1w6?= =?us-ascii?Q?LZXS77LQvC0Oejd9hhih0p89cjrkP0u+KA/ZqP8JMA/QBS2Jc+BkaiuI6wOX?= =?us-ascii?Q?LtbnMMcx/tOMJe0x0LyQ50wBzUs7jNUZHUkcSr9qdJRp23Mdd4rwTnBGbaPH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wlpGRWO25RWLr3DronsXMX0wL4kBijWaFJIxCAbFXgj/TgP4b5mOef1xQBSrTmZJdOCrW4BWlePqmK4Z1bkncwT0K1wvrybPbeYfV9ruB/6ZYrqsTICnPbIkP8k0D4aInbdOgQxK/nZdRbUwJaZhf5uZETc2gv2Axp+CVvaK4dShkzAk21H8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2017 11:37:30.8171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 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: Tue, 03 Oct 2017 11:37:33 -0000 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. [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. > + 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