From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2167A034C; Wed, 22 Jun 2022 19:30:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF86340A84; Wed, 22 Jun 2022 19:30:06 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 464B14069F for ; Wed, 22 Jun 2022 19:30:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655919004; x=1687455004; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=xkGdyA4EWMs82fFCrGiaRvMWU1Kdjsbo1vspGtGxFmA=; b=DCntnAnLch/cFvwKgGEKsj8BKWhKECQCVwQhL17H7S55Dtlvdire2unV oOmkuNsBxGZGnQMMPD81znPMaDfOS1IttZvsh8AJTMxstqoJB1N30KdGy krJTLQ8a5i3IWnkJHQUX9uhEJP0dmW16yl7sJ6K7M8Wg3maS7QC+MKlnv +dzY9tcFNyLE1ZOQI9pDrTYO26ZIGpcTTUuplFLpangJMjdgyLHm82Dcb xfrnWds6gYhPQLU3OAgAPIgbSunKoGnHM9twPye9jbYXZGWxdQE51xJsN +3v3SvFTJ1UP8tDq055BN941H/5mdW2L6G41yOTSc6P0RSxoLHw+Lz1uk g==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="366805365" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="366805365" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 10:30:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="644303858" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 22 Jun 2022 10:30:00 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 10:29:56 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 10:29:56 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 22 Jun 2022 10:29:56 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 22 Jun 2022 10:29:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QcfjjDAFUfIMkBJv4G54AmNXQgnikxcesPuiSLi6afru7+6Gb34bKSOKagwZ6kjzxbhNSRiqiTG3XMkQOQsjI4u9QHl57UYVPU/2QLYxn1uvySsqXTnhPGa4BldzIrmb4zCRuZkpDAVg8UqBpbkTFCfu+RkXaS8t8TKWKRHxJZq+TkfroM6/YJfxxllQ7eXC+gL0WpnyQO8tRj62+TrT7T7Ra8EDjnZROtEzMT8iCaL/KdIdJ9yypAIxzzOXJ8W+tjS83gmyHk6KHiWQIEKs0g/YbxX/9x8h2rnPr4vjorsPhA7jlx3qeVF4MYpx32nwCHLDQBJgIKz8nCSyn2qhbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pzgeKbL1yqGtY9sRWJNpUNdUi/+qnZrjAhZ2zB4jTaU=; b=MwqBH0s140WwABjUa7wlMbKiHGwjFPu5hsnessxxTsERQTMHzNuKuFu8aSwj7BbHDChl6aXL2WJe20a0c43MTHxGqeGozrnSp4IOl6bv2TbRLyIBxQ6T2fm+kppUwV3DqZUfYhvF1sFr2LMDlBzKwF0Sp8ux5joyfDlpOKV/ajpKAHdhBePDXgCKpwjsX8RlAqr23PameKC5iHQfFg+fFDOP/x6tP/a+kFL6WLAO20hzdY1FWINaae9NaAdpMe+lDm0fqTygxbMwxph0UpZ/gyHo7C5h4ahb8wnoZcv4kn6zg6loKFnKG4d/tzKZMiQ73+qppSNG0iLVfLLaXw1rMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB3868.namprd11.prod.outlook.com (2603:10b6:5:19f::13) by MN2PR11MB3615.namprd11.prod.outlook.com (2603:10b6:208:ec::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Wed, 22 Jun 2022 17:29:49 +0000 Received: from DM6PR11MB3868.namprd11.prod.outlook.com ([fe80::3d91:62dc:c665:9083]) by DM6PR11MB3868.namprd11.prod.outlook.com ([fe80::3d91:62dc:c665:9083%6]) with mapi id 15.20.5353.022; Wed, 22 Jun 2022 17:29:49 +0000 From: "Naga Harish K, S V" To: "Kundapura, Ganapati" , "dev@dpdk.org" , "jerinj@marvell.com" , "Jayatheerthan, Jay" Subject: RE: [PATCH v8 3/7] test/eth_rx: add test case for instance get API Thread-Topic: [PATCH v8 3/7] test/eth_rx: add test case for instance get API Thread-Index: AQHYhli46bbDO9nWd0CrDpMoIuqFbq1brp0A Date: Wed, 22 Jun 2022 17:29:49 +0000 Message-ID: References: <20220622103756.421869-1-ganapati.kundapura@intel.com> <20220622165405.533042-1-ganapati.kundapura@intel.com> <20220622165405.533042-3-ganapati.kundapura@intel.com> In-Reply-To: <20220622165405.533042-3-ganapati.kundapura@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.500.17 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 416e2197-f074-4da0-dacc-08da5474cf0b x-ms-traffictypediagnostic: MN2PR11MB3615:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TrfyZDrLMybYDn7muG7or7fOYrgMHrZaHjeWuZTof9/9dY7dYtaXH5+wzWgWUsRPim4hXbQEw1gnZ78cgkc4xHIosAW2t5HZBvS1Nk1XsrM48TjR/JBByatQ+5wBjdZmLhB9H2hpUTYyy9bpITO2mbuEA4sqIgcIJcbv9C9Jn6GMSX7UktmLFqMwWsXfLOzuR7W32+rVY9AzslOTBLM1vNWqxJNTo9zEkq+/5DTePXSFbipJr4ivwNabvUn3LqEfuhmhbVY4WD7qLfwY5x8Pv4T/pv0som1k6fIqBNmHT88+kGpnj3M7EqwElIWvjpnj3Qj0e6w30lsDiDn75oan6wxW5lYy5xIX77VKgdpaFYgq8tFvA4IcEFDCtoQ9j/b1p4pheSrXUyhALpPACR1nfvHLYNhNC6JnwEm9bF7dLrre6xD45fFP0gH7i4qaZZRaEot43WBlIQhJGWMqiCjPi7e464zADr0M0jWK4jjKdqdCz/7De3Yg3Trlw+fSCxGtn/de08q0ogApDX5Tc7LuPPZY7AIhTc/JhlVQrAwxbRpX4NOGZ1Lt4Q1Ak1GhVE04sQR+CshKffPfJMyydY+EcW72VN8gkyu0Xv/BzrNmMJGc9+N2aVRns7X9alyiBePqgAGGrwe22AOTYc3Yp6458br8LCoC9Y0Mn7Yf4q5JvDtHwvp1T6KdK7DBSekOuKvmVHVciKFhEu4AUjYGgkA7BstxEf7LPi6l4bZrEWXK4768WebAxhaRNjztwDLPK/V1E+GZ1ch01foGDSxDn37mbw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3868.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(396003)(366004)(346002)(376002)(136003)(39860400002)(38100700002)(55016003)(9686003)(7696005)(53546011)(55236004)(26005)(41300700001)(110136005)(8936002)(52536014)(6506007)(5660300002)(2906002)(6636002)(33656002)(71200400001)(478600001)(186003)(64756008)(8676002)(38070700005)(83380400001)(66946007)(66446008)(82960400001)(66476007)(122000001)(86362001)(66556008)(76116006)(316002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?dfA7ewZrKfdBz3CUATxABJ8liQygSrMZRn7Gbemo4f/zyzPhzRFmpeG02xZ8?= =?us-ascii?Q?StSh5t7lpiJ/2AcAIbZkEUuAYLn03zoqVm3Fv5hKwRMf0pHPGHBRqUSiFUoC?= =?us-ascii?Q?+QHAtKGsVTzxT/yTVSXEvLxkiR7aLH+jOW3EbXVFWyaiqtBAG2CzLsmQVaKM?= =?us-ascii?Q?OVzInLNwHvzlPRLyLSM7+HTNaqYBGWxT3I/JNfQKezR9jHXCT+L+dPXgdrLo?= =?us-ascii?Q?ul31cfKujDgvMEPwmdn7OQpnN2mcMAOMPecDHCEjKb1orGj6EJh8DY4QYdqy?= =?us-ascii?Q?IiIZxIPePuMSS6DFSYLhPsbfhqsEDinhWNj4K2oVLDeBSbe4uqH78ZchiSqi?= =?us-ascii?Q?e2Gpfxt0EAuVSv+JncA07dmiNK+65vfDUJhu3/PSY7u5n3eS/mA3nnMYUoiO?= =?us-ascii?Q?vIAAlUbjHgwPCPloYSpzdf1WbNL9VlqSOBAPOR2M0FA3HKvDik8SIs2MhWqu?= =?us-ascii?Q?s9tVGHAvqe0MGGvQUkE7mhmWRVIaemM9jhkskEUw8v8kPwyHRpWaNf20K0li?= =?us-ascii?Q?WyQYZacpjDf8go6QLHhLx1TOy+irBEF+bRPnMihvqv3mnuJjGJlRZIjH65rR?= =?us-ascii?Q?YX2Pzzwsi2YBlIzngWxndO//y/tQEdTP2qPppJi+RYkMgoLEt2BYfOArgGKb?= =?us-ascii?Q?owy2UAasAVNIMyVqt4l0mC36Yd9Rl9HqG1YmLkNsDLkhYLps1FhEEeQjMWpH?= =?us-ascii?Q?FNnIuqlKlhjdVmj43+coy2JMqsXK1evAOpHhLTp+XLP40kaSLmKjzcnCcaI4?= =?us-ascii?Q?7WHenjO07Rbkq5s1bgiV5ZCjnlBrl+YPXDyvodrmtcp6YXqYHsx6LIokNCjW?= =?us-ascii?Q?sT4VY3y7ZOsjCrAXKFJNX/0BK82JuzprJrDoRYGlgrWp2dpWJHWfEyO0GGW3?= =?us-ascii?Q?4Iv9tEH1W95yIiGGWdo3YjV3096oLeZzSoqWT9v6hODg9g/fJeJmoZeHEgPa?= =?us-ascii?Q?FEa7hyZVt4AfogZPnEv32ZnxjqSILuHHpaEbekC2AyrgFjPQSK+ILXUlfDcx?= =?us-ascii?Q?6O56zfSGYM8cXPEOwBP0ohbsFbfcXF/RFixpxJBGFTSMsILQsSg/aCXMwp1M?= =?us-ascii?Q?EV5fXhA1c6ZAzx4TR13xL6vSOm5C7lmO1cgXtHEbpktRQSOz33yGoM9jbt7W?= =?us-ascii?Q?pQwRTO/8x6jfOWrLjygZTm0dcbxBBJlf4i6Lgws7eqVqowyzzThOVQa1PRRG?= =?us-ascii?Q?PdZjiWewRTx09zA3Smoz+IUpPOSpBZFeLJjC3aJM1+i7ptV2sqqqtOxRDpiA?= =?us-ascii?Q?Azx1WnOLORmxbr9uOEPkXiSYnz/8XdXCMnqg/r2L8e3NhmlSEK6JYdZQOB37?= =?us-ascii?Q?pNLGjWX5qhf2Q398rdTeP8bAwxGymX2uPdBT3MOsUJPzdsjzXR2YAHbVGflc?= =?us-ascii?Q?yThG0XkV11of+KN+4ZR2pU/wThflmQvRinRPy6h5jnj6y4lokTf6I8/t+kHL?= =?us-ascii?Q?8dzA8VNIdD6V/D3TAg3ZtN3hcc/CPQ+Nzpzj+rOHUV2897Cp2UBAzVsPk+zG?= =?us-ascii?Q?psAgEVfRS9mKDwJFyHkLRptQZ2gNMpudwJ/3xyCfwfSYW7EdB8iYKMLzS4dm?= =?us-ascii?Q?YmDk95cfjmaUoL9quPPc5Rr9LKwXM/+2HYym9yDmwYiLUraP9ZCCpo0ZlAHb?= =?us-ascii?Q?LrJKgCLchnZJT0baZFygIiyGHwNeU10bXxur2Ek80HcIfQI2mlPMozf4UXRs?= =?us-ascii?Q?qPwif/uXfhNzbo+GJ5FUcdFM2JWh7sPs3J6HZI+TiPYfOQcAPTaqbXNbDcVb?= =?us-ascii?Q?dMiuyZFMNlSqADYC78T5U3OLTmm/jiQ=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3868.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 416e2197-f074-4da0-dacc-08da5474cf0b X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2022 17:29:49.2634 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cUDJTXgSnnZDu6EooSc1hSQWEQGGyZR1wIIhF90kE2oD6pjtd9IMw6dMIWm+DS3DboplM7VD1K6PpN6pSZewIoiVjDpagouE0diHYxWEKmI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3615 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Reviewed-by: Naga Harish K S V > -----Original Message----- > From: Kundapura, Ganapati > Sent: Wednesday, June 22, 2022 10:24 PM > To: dev@dpdk.org; jerinj@marvell.com; Jayatheerthan, Jay > ; Naga Harish K, S V > > Subject: [PATCH v8 3/7] test/eth_rx: add test case for instance get API >=20 > Added test case for rte_event_eth_rx_adapter_instance_get() >=20 > Signed-off-by: Ganapati Kundapura > --- > app/test/test_event_eth_rx_adapter.c | 203 > ++++++++++++++++++++++++++++++++++- > 1 file changed, 202 insertions(+), 1 deletion(-) >=20 > diff --git a/app/test/test_event_eth_rx_adapter.c > b/app/test/test_event_eth_rx_adapter.c > index e358a70..1da7782 100644 > --- a/app/test/test_event_eth_rx_adapter.c > +++ b/app/test/test_event_eth_rx_adapter.c > @@ -39,6 +39,7 @@ test_event_eth_rx_intr_adapter_common(void) > #define TEST_INST_ID 0 > #define TEST_DEV_ID 0 > #define TEST_ETHDEV_ID 0 > +#define TEST_ETH_QUEUE_ID 0 >=20 > struct event_eth_rx_adapter_test_params { > struct rte_mempool *mp; > @@ -1001,6 +1002,202 @@ adapter_queue_conf(void) > return TEST_SUCCESS; > } >=20 > +static int > +adapter_pollq_instance_get(void) > +{ > + int err; > + uint8_t inst_id; > + uint16_t eth_dev_id; > + struct rte_eth_dev_info dev_info; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf =3D {0}; > + > + /* Case 1: Test without configuring eth */ > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 2: Test with wrong eth port */ > + eth_dev_id =3D rte_eth_dev_count_total() + 1; > + err =3D rte_event_eth_rx_adapter_instance_get(eth_dev_id, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 3: Test with wrong rx queue */ > + err =3D rte_eth_dev_info_get(TEST_ETHDEV_ID, &dev_info); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + dev_info.max_rx_queues + > 1, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 4: Test with right instance, port & rxq */ > + /* Add queue 1 to Rx adapter */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID; > + queue_conf.ev.sched_type =3D RTE_SCHED_TYPE_ATOMIC; > + queue_conf.ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL; > + queue_conf.servicing_weight =3D 1; /* poll queue */ > + > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Add queue 2 to Rx adapter */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID + 1; > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 1, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 1, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Add queue 3 to Rx adapter */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID + 2; > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 2, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 2, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Case 5: Test with right instance, port & wrong rxq */ > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 3, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Delete all queues from the Rx adapter */ > + err =3D rte_event_eth_rx_adapter_queue_del(TEST_INST_ID, > + TEST_ETHDEV_ID, > + -1); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + return TEST_SUCCESS; > +} > + > +static int > +adapter_intrq_instance_get(void) > +{ > + int err; > + uint8_t inst_id; > + uint16_t eth_dev_id; > + struct rte_eth_dev_info dev_info; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf =3D {0}; > + > + /* Case 1: Test without configuring eth */ > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 2: Test with wrong eth port */ > + eth_dev_id =3D rte_eth_dev_count_total() + 1; > + err =3D rte_event_eth_rx_adapter_instance_get(eth_dev_id, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 3: Test with wrong rx queue */ > + err =3D rte_eth_dev_info_get(TEST_ETHDEV_ID, &dev_info); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + dev_info.max_rx_queues + > 1, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Case 4: Test with right instance, port & rxq */ > + /* Intr enabled eth device can have both polled and intr queues. > + * Add polled queue 1 to Rx adapter > + */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID; > + queue_conf.ev.sched_type =3D RTE_SCHED_TYPE_ATOMIC; > + queue_conf.ev.priority =3D RTE_EVENT_DEV_PRIORITY_NORMAL; > + queue_conf.servicing_weight =3D 1; /* poll queue */ > + > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Add intr queue 2 to Rx adapter */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID + 1; > + queue_conf.servicing_weight =3D 0; /* intr queue */ > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 1, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 1, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Add intr queue 3 to Rx adapter */ > + queue_conf.ev.queue_id =3D TEST_ETH_QUEUE_ID + 2; > + queue_conf.servicing_weight =3D 0; /* intr queue */ > + err =3D rte_event_eth_rx_adapter_queue_add(TEST_INST_ID, > + TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 2, > + &queue_conf); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 2, > + &inst_id); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + TEST_ASSERT(inst_id =3D=3D TEST_INST_ID, "Expected %d got %d", > + TEST_INST_ID, err); > + > + /* Case 5: Test with right instance, port & wrong rxq */ > + err =3D rte_event_eth_rx_adapter_instance_get(TEST_ETHDEV_ID, > + TEST_ETH_QUEUE_ID + 3, > + &inst_id); > + TEST_ASSERT(err =3D=3D -EINVAL, "Expected -EINVAL got %d", err); > + > + /* Delete all queues from the Rx adapter */ > + err =3D rte_event_eth_rx_adapter_queue_del(TEST_INST_ID, > + TEST_ETHDEV_ID, > + -1); > + TEST_ASSERT(err =3D=3D 0, "Expected 0 got %d", err); > + > + return TEST_SUCCESS; > +} > + > static struct unit_test_suite event_eth_rx_tests =3D { > .suite_name =3D "rx event eth adapter test suite", > .setup =3D testsuite_setup, > @@ -1019,6 +1216,8 @@ static struct unit_test_suite event_eth_rx_tests = =3D { > adapter_queue_event_buf_test), > TEST_CASE_ST(adapter_create_with_params, adapter_free, > adapter_queue_stats_test), > + TEST_CASE_ST(adapter_create, adapter_free, > + adapter_pollq_instance_get), > TEST_CASES_END() /**< NULL terminate unit test array */ > } > }; > @@ -1029,7 +1228,9 @@ static struct unit_test_suite > event_eth_rx_intr_tests =3D { > .teardown =3D testsuite_teardown_rx_intr, > .unit_test_cases =3D { > TEST_CASE_ST(adapter_create, adapter_free, > - adapter_intr_queue_add_del), > + adapter_intr_queue_add_del), > + TEST_CASE_ST(adapter_create, adapter_free, > + adapter_intrq_instance_get), > TEST_CASES_END() /**< NULL terminate unit test array */ > } > }; > -- > 2.6.4