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 45137A034C; Wed, 22 Jun 2022 20:01:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7AE640A84; Wed, 22 Jun 2022 20:01:20 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 84A934069F for ; Wed, 22 Jun 2022 20:01:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655920879; x=1687456879; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=P0i5ycRkj1wyI8YM6D2Kfkq6nE5E/9azr0XSgL6lggI=; b=awskVoBFWyEJPJoU51nBjStxB/fAjeqXxBycIAUxpOZtBpJKEhl7q0Vh Pnw8RxmyoU3uO7L0wnhhtQMsUeFMceKNMIbrwL5R3iZFTsEreZfDvm81Q giu1JAIB6m2qoHLLRrDWCEe4AH6ogPeFD8zAoMTFPyqs2TqPPJRY/julX tzKarYrJVbUQdIsMu3G7hzw0fFEmiipTEj3qGBUCk6qOsCtthljtF/o/R gG7a0qC7+tHxivBWam+SVGbNX4fs+DaLhodffmXxGD988mNHG96m+sskx cEWJ5Y5t6b0nQfG87ce7GhgwaTuS71XHjbIO+TgqmmAqb+YgJobchD2uD A==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="279261273" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="279261273" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 10:44:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="677665004" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 22 Jun 2022 10:44:31 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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:44:30 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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:44:30 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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 via Frontend Transport; Wed, 22 Jun 2022 10:44:30 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) 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:44:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWekofJIu0bVybzTN7NIE4toNHb0EKNklqarwRYF0BSNZJGVxSt9ZaQqiQh5wE5RT8URlTADNDathRtzq854g8GrShaTJAAeMF2Ue2Ui7Zn7vAWdycw/v75x/oemg3RulDRD6Y6n6gOmmY3Wu+RRGxTAMqsH+K0desGBrcRTQXP38RTcDvdurF/n75wmc7YqyGLHhbCyBSH+4U4ONN34vY5WghkkaisLQev3QdUVur1JyWeQaTBDaSxwTu8PIqgIHwxYa/N8wSNCNxvSoOhTk6ZFkSgRFU8lWI2nd6r5T65c/u8xUY4nVqnvfBN12MLQn776MSlEEGFkUibBURtHIA== 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=6JUzIlHlDVJxPQlaXMyiarwC63109NC17fsB/bF1hCU=; b=Cj9+aySwsZqBjJBUckM4FmyC1r9UhV48x4uE3YbTtyanIRlrZHwx+Qx6LheM+4l1HlAkQEhj3UhmXElhXLLA6fbuP6m68zNsWfPPG5rMvKkSrCfPJcaEbGzcn5217dqbSA0opDrsmJuGzYQDI8E+rTOliQ2dPHrabybI4PqIc5JHtEzxHBUJSJteoA2ARJ0/o2tUFSC5UZ3j585qtWxAg0JditPAGucmXvcoC15wrTV0LAEI1EQdyp/Wjv4s5JzR6uSaYB76qV4kqCI0upGFXHMkjiwH64AdiDkCABXEuLYcmI829owtjJqWTx9YuvC7l34vtI5KYMcUhwvUEIjT3w== 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 DM6PR11MB4348.namprd11.prod.outlook.com (2603:10b6:5:1db::18) by BYAPR11MB2664.namprd11.prod.outlook.com (2603:10b6:a02:c7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.20; Wed, 22 Jun 2022 17:44:28 +0000 Received: from DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::d57f:4e1a:5ec7:118]) by DM6PR11MB4348.namprd11.prod.outlook.com ([fe80::d57f:4e1a:5ec7:118%7]) with mapi id 15.20.5353.022; Wed, 22 Jun 2022 17:44:28 +0000 From: "Jayatheerthan, Jay" To: "Kundapura, Ganapati" , "dev@dpdk.org" , "jerinj@marvell.com" , "Naga Harish K, S V" Subject: RE: [PATCH v8 1/7] eventdev/eth_rx: add adapter instance get API Thread-Topic: [PATCH v8 1/7] eventdev/eth_rx: add adapter instance get API Thread-Index: AQHYhli7NjuyJ1WJoEKy4Bx3WOe7A61braZw Date: Wed, 22 Jun 2022 17:44:28 +0000 Message-ID: References: <20220622103756.421869-1-ganapati.kundapura@intel.com> <20220622165405.533042-1-ganapati.kundapura@intel.com> In-Reply-To: <20220622165405.533042-1-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: eae8b46f-b413-4498-a927-08da5476daf2 x-ms-traffictypediagnostic: BYAPR11MB2664: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: HG1N2DTAqeUC4flSdXUI9nCXGaGw5GZP6ph8i4MUbmbRF4Gs4tr0ZvvZSALDzGr4PvA+gfskM1JHHOJkW5ba7sUevYd7Q85u4sB6eoELdgNIbMl7xTyyVS1rAIDkXsYpxpV+RpufDfw+VqosFYmFzF7wItAUmLzu7Y9akheMgu9lBYPCVXXbd84NRbGGC7GwmxS6c2kTZFDHnddMJKy8tvU0XMJdo0lmco+NQRiAGhl3xNDLnHAC38aDm2LnFeiNYq+uLL546qP0SCHHcl5V7y7djkHZZJt7sBpUnab9D6cfYr11y4FaWR/wQ+HYVP7dF/I4r+XZojCT7qIE/9+N/BVGv537KNQ+pOOdpD6DwXF30fdaArhLDBnd51ZkCfv5LJuXa65LD2Wg6AtV8yyuP0sXYBhG0DedC8mJT3wcoqEKZxtuELjm75EGK/pnSq/f6jw45rS623+UAsr0f4VDcs6ZmrISUce341oErxsgiHn7sXoiiehEFe++6/HrDVBrKAKmDnNvdB28jdk1im8kIjSV6vIiQlLTQd+LMNwKaDd2na2QKIFtHSXv9QDhUAeETFihYK1es8jyP3OEinxZSduBcjKeCSbWm12Dzi+bqcNJxn2L7JXi3CyJ7aCUlZVgy0gmUu4G14tm3KoXPhwumfXFsXfkeYf1YDkyhicKU3aw6Z79xgJLs9mekxC/EHNr3r1yPONTvmP1vN0yFrjzeM6ITap5pFOk0UgyCsG3tO4LLHDdihEHaHfsi33nNC4et+Y76pA3Z/Zov++TtGP3zA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4348.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(346002)(376002)(396003)(39860400002)(136003)(366004)(5660300002)(316002)(52536014)(8936002)(2906002)(186003)(478600001)(83380400001)(33656002)(38100700002)(41300700001)(30864003)(66946007)(76116006)(71200400001)(38070700005)(86362001)(110136005)(7696005)(6506007)(8676002)(66446008)(66476007)(82960400001)(26005)(64756008)(9686003)(55016003)(122000001)(53546011)(66556008)(6636002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?K/MWnLHgQ2yLOgoQL807jr2DVUgfhjBQueRYWcBJHEOkSIUeo9UHn3/5Kw0S?= =?us-ascii?Q?mesYkNpBj9PW9UEup2HdMIljnLrVYOe0I40XQlq675CwKUzjVqZf9g0teCLp?= =?us-ascii?Q?10QfEgspALx6DUXlLPZym/g32Ldg61rVDbZakPfzHduhqf4eXsQDqVBpBDRD?= =?us-ascii?Q?2F+VV3MyJ7je2WWu/YchhwUOWEsV5TwSkc4z8Jxbrt+Fbqn2c3xKXl9+2ZUf?= =?us-ascii?Q?/iKnNQMAhm7dsEer8iSjvCd7KYyVAWvJHZ8mBX9hMSLt/EdnXBjfjpFkGGsR?= =?us-ascii?Q?rhZBsNcWZEWg8tMTUKOJ/tO19PYJ5P5ulpJQZaUwORV7L5xCzNa2JJKfKX+d?= =?us-ascii?Q?+uNipr3alHh9ji4dSowl8pz74vrCQYYx4GwWuIgc7SxEUOUKFzE1CctQyJyV?= =?us-ascii?Q?F+0cM96Pt9f1C1n3ayC0K9brEuPzph12BvgnBsTXwhJkhWPMlouJ38G3d1oj?= =?us-ascii?Q?9m5Aw8pd4U+fR5ghf19LboE8GQ3SHmjhR0DFkxGamuBuBrtCcE7w4fX73uo1?= =?us-ascii?Q?HQQK2OmNb00foXPU80DvW/6N+W1DiItDS+PkO7kgTT1kMYqzbAdgwVDhd/u3?= =?us-ascii?Q?lW5kGvr2RuHzlB4an4nw5Ts9O0lhMMvcTjfcX/8B2LPQYO8Fb7P8Q/Om5Uhn?= =?us-ascii?Q?releJBE+lyTNhHlWn0/miSf0onEq6Ijif7miAoaWjhVYKysoicKHzvcG5Bb4?= =?us-ascii?Q?ihachkntV+IfDPWQjBM0mzflazFvs9kuvkMUtHmfpzD9W1samEUwEuGEg69C?= =?us-ascii?Q?1lDP6eAwZA2W42+8JNBt5nusRAJUMxgB41E1fAFDjQID0MvQCqCp8FCY3KJ+?= =?us-ascii?Q?LEgciqA8BpyQDp6nLothlPPDTwJlgb4LPe2R5WCLcO9JdMTNI/FCHiFiY2VN?= =?us-ascii?Q?dJuCQqfPBRQ6CYaN5J/OpNnVdcmKQ7Rz0gcZtI6CoUJ0MkYkagTWezVT0jnr?= =?us-ascii?Q?0atDZNCwuc8DAzfVP8FbM/7wXPzVrSz+O58DCVfxjnmE3NI7TZJkn61+NmTo?= =?us-ascii?Q?clCoAoqlsnSt2x9OhLutgzbkao0D9BKGwjuMTLtRUDG9xlPdjv3VQ8r4fVKL?= =?us-ascii?Q?X0su4PiXCVe+DnbizU8sk09QQw2O/sDvRiWGlh8qrt+Hd81VGIPaGchono3v?= =?us-ascii?Q?G0hMaLw+YyMuJsnjfdMYmztxXT518MuRjzs5e6NRRXCUhOYWI4gsMVYdhQUG?= =?us-ascii?Q?JNfPQhA54P+6HOj3ADZwZAbJ0Nh+uF4r0Izv5xxTkJa75QaNSxHbwWIMBSJ8?= =?us-ascii?Q?cf9mtNZZQkPPK5xzn9+irhEpmrCbQ9OEfVbQ/gbjes3K2orCkGAQ3LKRrI9P?= =?us-ascii?Q?q/IGi7tNUIDs4NzLUo+aA29qeVZpdAs1yu6zItvVurCF8+Qu/6EdUca8QMxk?= =?us-ascii?Q?LPHHWFRNyFlryYO/EgoqMrqQikRRCF4jyg5RVDXvurzNVDfvTFm2Ph0FlbK8?= =?us-ascii?Q?Gn3vPdihaqJd7ZqzJKJhT7Tr9eWHxHmv2alFIUgZwa1I08i+uOrgKLn5JD18?= =?us-ascii?Q?PC5eROXk7C9YxCh9iMnjQGmTj6gVoYzYCCssxWpxeWFOds/jFWrpmD5PIWgy?= =?us-ascii?Q?Qk077i9kYs2Tjfe5+npCh/lV68nS23LW7FCO81NqyhjNxqLlIL72/VpK8qYj?= =?us-ascii?Q?VXUDzWlqkc9iVzRx0TP970erQIfUmdherLnEVT+5Oenlq3m5rkHPrQVVqVmA?= =?us-ascii?Q?LrVqhNDJUBUTj7vc9mjhnYBvCgCSn0g9gHBbyj+faBMc9zoh1Ih/YcE4uM7b?= =?us-ascii?Q?kc+LV6Lao83DFR5jojgPZNcMr9Oy5e8=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: DM6PR11MB4348.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: eae8b46f-b413-4498-a927-08da5476daf2 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2022 17:44:28.2400 (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: 5XJToMaNI4E/VrRUvJyryx4UbcL+t7GICSkxfw3xMqqNfiiRr+VAj0ayXAjrmj5B0OQFfUm5wFFMYVu/NcGLsHkfdnRy3PDCjXatSGNH+Hw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2664 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 Aside of the minor documentation fix in patch 7/7, the full patchset looks = good to me. Thanks for posting it! Please fix it and add Acked-by: Jay Jayatheerthan -Jay > -----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 1/7] eventdev/eth_rx: add adapter instance get API >=20 > Added rte_event_eth_rx_adapter_instance_get() to get > adapter instance id for specified ethernet device id and > rx queue index. >=20 > Signed-off-by: Ganapati Kundapura > --- > v8: > * Removed limits.h inclusion >=20 > v7: > * Remove allocation of instance array and storage of instnace id > * in instance array > * Use Rx adapter instance data to query instance id for specified > * eth_dev_id and rx_queue_id >=20 > v6: > * rx adapter changes removed from patch4 and moved to patch1 >=20 > v5: > * patch is split into saperate patches >=20 > v4: > * Moved instance array allocation and instance id storage > before adapter's nb_queue updation for handling the > error case properly >=20 > v3: > * Fixed checkpatch error >=20 > v2: > * Fixed build issues > * Added telemetry support for rte_event_eth_rx_adapter_instance_get > * arranged functions in alphabetical order in version.map > --- > lib/eventdev/eventdev_pmd.h | 22 +++++ > lib/eventdev/rte_event_eth_rx_adapter.c | 140 ++++++++++++++++++++++++++= +++--- > lib/eventdev/rte_event_eth_rx_adapter.h | 24 ++++++ > lib/eventdev/version.map | 1 + > 4 files changed, 177 insertions(+), 10 deletions(-) >=20 > diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h > index 6940266..c58ba05 100644 > --- a/lib/eventdev/eventdev_pmd.h > +++ b/lib/eventdev/eventdev_pmd.h > @@ -888,6 +888,26 @@ typedef int (*eventdev_eth_rx_adapter_vector_limits_= get_t)( > const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev, > struct rte_event_eth_rx_adapter_vector_limits *limits); >=20 > +/** > + * Get Rx adapter instance id for Rx queue > + * > + * @param eth_dev_id > + * Port identifier of ethernet device > + * > + * @param rx_queue_id > + * Ethernet device Rx queue index > + * > + * @param[out] rxa_inst_id > + * Pointer to Rx adapter instance identifier. > + * Contains valid Rx adapter instance id when return value is 0 > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +typedef int (*eventdev_eth_rx_adapter_instance_get_t) > + (uint16_t eth_dev_id, uint16_t rx_queue_id, uint8_t *rxa_inst_id); > + > typedef uint32_t rte_event_pmd_selftest_seqn_t; > extern int rte_event_pmd_selftest_seqn_dynfield_offset; >=20 > @@ -1321,6 +1341,8 @@ struct eventdev_ops { > eventdev_eth_rx_adapter_vector_limits_get_t > eth_rx_adapter_vector_limits_get; > /**< Get event vector limits for the Rx adapter */ > + eventdev_eth_rx_adapter_instance_get_t eth_rx_adapter_instance_get; > + /**< Get Rx adapter instance id for Rx queue */ >=20 > eventdev_timer_adapter_caps_get_t timer_adapter_caps_get; > /**< Get timer adapter capabilities */ > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_e= vent_eth_rx_adapter.c > index bf8741d..ababe13 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -1415,15 +1415,13 @@ rxa_service_func(void *args) > return 0; > } >=20 > -static int > -rte_event_eth_rx_adapter_init(void) > +static void * > +rxa_memzone_array_get(const char *name, unsigned int elt_size, int nb_el= ems) > { > - const char *name =3D RXA_ADAPTER_ARRAY; > const struct rte_memzone *mz; > unsigned int sz; >=20 > - sz =3D sizeof(*event_eth_rx_adapter) * > - RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE; > + sz =3D elt_size * nb_elems; > sz =3D RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE); >=20 > mz =3D rte_memzone_lookup(name); > @@ -1431,13 +1429,34 @@ rte_event_eth_rx_adapter_init(void) > mz =3D rte_memzone_reserve_aligned(name, sz, rte_socket_id(), 0, > RTE_CACHE_LINE_SIZE); > if (mz =3D=3D NULL) { > - RTE_EDEV_LOG_ERR("failed to reserve memzone err =3D %" > - PRId32, rte_errno); > - return -rte_errno; > + RTE_EDEV_LOG_ERR("failed to reserve memzone" > + " name =3D %s, err =3D %" > + PRId32, name, rte_errno); > + return NULL; > } > } >=20 > - event_eth_rx_adapter =3D mz->addr; > + return mz->addr; > +} > + > +static int > +rte_event_eth_rx_adapter_init(void) > +{ > + uint8_t i; > + > + if (event_eth_rx_adapter =3D=3D NULL) { > + event_eth_rx_adapter =3D > + rxa_memzone_array_get(RXA_ADAPTER_ARRAY, > + sizeof(*event_eth_rx_adapter), > + RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE); > + if (event_eth_rx_adapter =3D=3D NULL) > + return -ENOMEM; > + > + for (i =3D 0; i < RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE; i++) > + event_eth_rx_adapter[i] =3D NULL; > + > + } > + > return 0; > } >=20 > @@ -1450,6 +1469,7 @@ rxa_memzone_lookup(void) > mz =3D rte_memzone_lookup(RXA_ADAPTER_ARRAY); > if (mz =3D=3D NULL) > return -ENOMEM; > + > event_eth_rx_adapter =3D mz->addr; > } >=20 > @@ -1951,7 +1971,6 @@ rxa_sw_del(struct event_eth_rx_adapter *rx_adapter, > int intrq; > int sintrq; >=20 > - > if (rx_adapter->nb_queues =3D=3D 0) > return; >=20 > @@ -2524,6 +2543,9 @@ rte_event_eth_rx_adapter_free(uint8_t id) > { > struct event_eth_rx_adapter *rx_adapter; >=20 > + if (rxa_memzone_lookup()) > + return -ENOMEM; > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); >=20 > rx_adapter =3D rxa_id_to_adapter(id); > @@ -2561,6 +2583,9 @@ rte_event_eth_rx_adapter_queue_add(uint8_t id, > struct eth_device_info *dev_info; > struct rte_event_eth_rx_adapter_vector_limits limits; >=20 > + if (rxa_memzone_lookup()) > + return -ENOMEM; > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); >=20 > @@ -2726,6 +2751,9 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint= 16_t eth_dev_id, > uint32_t *rx_wrr =3D NULL; > int num_intr_vec; >=20 > + if (rxa_memzone_lookup()) > + return -ENOMEM; > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); >=20 > @@ -2832,6 +2860,7 @@ rte_event_eth_rx_adapter_queue_del(uint8_t id, uint= 16_t eth_dev_id, >=20 > rte_eventdev_trace_eth_rx_adapter_queue_del(id, eth_dev_id, > rx_queue_id, ret); > + > return ret; > } >=20 > @@ -3286,6 +3315,97 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id= , > return 0; > } >=20 > +static int > +rxa_is_queue_added(struct event_eth_rx_adapter *rx_adapter, > + uint16_t eth_dev_id, > + uint16_t rx_queue_id) > +{ > + struct eth_device_info *dev_info; > + struct eth_rx_queue_info *queue_info; > + > + if (!rx_adapter->eth_devices) > + return 0; > + > + dev_info =3D &rx_adapter->eth_devices[eth_dev_id]; > + if (!dev_info || !dev_info->rx_queue) > + return 0; > + > + queue_info =3D &dev_info->rx_queue[rx_queue_id]; > + > + return queue_info && queue_info->queue_enabled; > +} > + > +#define rxa_evdev(rx_adapter) (&rte_eventdevs[(rx_adapter)->eventdev_id]= ) > + > +#define rxa_dev_instance_get(rx_adapter) \ > + rxa_evdev((rx_adapter))->dev_ops->eth_rx_adapter_instance_get > + > +int > +rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id, > + uint16_t rx_queue_id, > + uint8_t *rxa_inst_id) > +{ > + uint8_t id; > + int ret =3D -EINVAL; > + uint32_t caps; > + struct event_eth_rx_adapter *rx_adapter; > + > + if (rxa_memzone_lookup()) > + return -ENOMEM; > + > + if (eth_dev_id >=3D rte_eth_dev_count_avail()) { > + RTE_EDEV_LOG_ERR("Invalid ethernet port id %u", eth_dev_id); > + return -EINVAL; > + } > + > + if (rx_queue_id >=3D rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid Rx queue %u", rx_queue_id); > + return -EINVAL; > + } > + > + if (rxa_inst_id =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("rxa_inst_id cannot be NULL"); > + return -EINVAL; > + } > + > + /* Iterate through all adapter instances */ > + for (id =3D 0; id < RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE; id++) { > + rx_adapter =3D rxa_id_to_adapter(id); > + if (!rx_adapter) > + continue; > + > + if (rxa_is_queue_added(rx_adapter, eth_dev_id, rx_queue_id)) { > + *rxa_inst_id =3D rx_adapter->id; > + ret =3D 0; > + } > + > + /* Rx adapter internally mainatains queue information > + * for both internal port and DPDK service port. > + * Eventdev PMD callback is called for future proof only and > + * overrides the above return value if defined. > + */ > + caps =3D 0; > + if (!rte_event_eth_rx_adapter_caps_get(rx_adapter->eventdev_id, > + eth_dev_id, > + &caps)) { > + if (caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) { > + ret =3D rxa_dev_instance_get(rx_adapter) ? > + rxa_dev_instance_get(rx_adapter) > + (eth_dev_id, > + rx_queue_id, > + rxa_inst_id) > + : -EINVAL; > + } > + } > + > + /* return if entry found */ > + if (ret =3D=3D 0) > + return ret; > + } > + > + return -EINVAL; > +} > + > #define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) >=20 > static int > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_e= vent_eth_rx_adapter.h > index 3608a7b..a3313c8 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -38,6 +38,7 @@ > * - rte_event_eth_rx_adapter_queue_stats_get() > * - rte_event_eth_rx_adapter_queue_stats_reset() > * - rte_event_eth_rx_adapter_event_port_get() > + * - rte_event_eth_rx_adapter_instance_get() > * > * The application creates an ethernet to event adapter using > * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_cre= ate() > @@ -704,6 +705,29 @@ __rte_experimental > int > rte_event_eth_rx_adapter_event_port_get(uint8_t id, uint8_t *event_port_= id); >=20 > +/** > + * Get RX adapter instance ID for a RX queue > + * > + * @param eth_dev_id > + * Port identifier of Ethernet device. > + * > + * @param rx_queue_id > + * Ethernet device receive queue index. > + * > + * @param[out] rxa_inst_id > + * Pointer to store RX adapter instance identifier. > + * Contains valid Rx adapter instance id when return value is 0 > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +__rte_experimental > +int > +rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id, > + uint16_t rx_queue_id, > + uint8_t *rxa_inst_id); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map > index 886e2ec..d1ecda4 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -110,6 +110,7 @@ EXPERIMENTAL { > rte_event_eth_rx_adapter_event_port_get; >=20 > # added in 22.07 > + rte_event_eth_rx_adapter_instance_get; > rte_event_port_quiesce; > rte_event_queue_attr_set; > }; > -- > 2.6.4