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 6C3B3A0548; Thu, 11 Aug 2022 15:28:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03B33427F2; Thu, 11 Aug 2022 15:28:13 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 81D36410FC for ; Thu, 11 Aug 2022 15:28:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660224491; x=1691760491; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=R5XP3wfnUNzHbs7iUCSpO0qGkdJr9VMWWk9CvQ6dHXE=; b=GjttQVJ47FMy3VUYUzN95v898IHAnn9BrcM0Vcx+bu4kZACxD3PJTo/C QaR+zd3A5sJDRFvhKGO8Ow+vNIMgr8r5RHTrT1SvvWPstnh+Hm+HZdRD2 Bo2XehsYRM8DyB0WAxifRVwHSN9sP7xbyJPEIjH3DuQQnFvUxsIw4MsKC fiDChRL4CseYtOUb2bl/wTtDcwvWr/gnsWWRXUHA3jVBa6W0ibX2E4X+1 +40Y7s4eRp32LlU1r0AZ0AhmYQs51Zu9xlQ+23JPI2i9jkKfVt4gq41F/ BJXF1YWKPhdy18iwMQigWXlYLcE+3NsFMN/9NuTsuHZGwwhfntyrzsO5b A==; X-IronPort-AV: E=McAfee;i="6400,9594,10435"; a="355346819" X-IronPort-AV: E=Sophos;i="5.93,228,1654585200"; d="scan'208";a="355346819" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2022 06:28:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,228,1654585200"; d="scan'208";a="673692491" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 11 Aug 2022 06:28:10 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 11 Aug 2022 06:28:10 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 11 Aug 2022 06:28:09 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28 via Frontend Transport; Thu, 11 Aug 2022 06:28:09 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) 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.2375.28; Thu, 11 Aug 2022 06:28:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ub7VMS41kYcszIJ+NfYo1O/Zx25QNvFHnwLxdqR9NTh58KBGGbjhFVRDIGLfoVpEjoTPBW2ugUZYaowEsZIFl5JRyoDWjRiKjlxq4qq3aiZVNh+a/mUPy/iMYTkurggb76N9PxzuHNWTx62VIQhiQ5pP7Z9SqR/eV2B4YXTRhF4wot+IUXxhIEgzzTrVjoOhtsGxXqpYkO3lk11nzG9MF5GFyfPRd2w2RHKwKhTUp4/M3ZyXcPdj4tuRFFR36goPhm7HF1Cobk/U28CQOZTk9KNVe67tr4Q+V1nbpWWsoAtUJYOFbgGvrsuuUVurE23576LAcHvq+3BUnTaxDcxNlQ== 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=txWw9/Lf1nTDf23t/cKIHZzPnuQlnBy/5yUSrOLuQZ8=; b=oRwVMmh2Kob2GhQt/Yqig0qub8cbE/eW9/JHTzLCayd6SljCuFGWEwMr3PTvUEVmHPSnT4TE+x/bShmkkGUYNAlDsG5I/6/cJINYx3SB/2OJNvbp3Czg2zYH95uofh8d1wb9gcIbRfgZ+qDgGAAJDfjQp/091bMWoNfFNQc2lNKJ4mMnOzvZ0oz4z7RSam28mKqCxByISz+150FJaShEs7C7opD2TQchbvP09KJK/aHptL4xnuceqXzm1SPsr+THx6ejpyckQfPVTcJBLX4ygruMJopoEcf7I/mSSPx9P1CAuam12XAutudH0cqk8w0mQP5rTCW5eLGNU/CYX7vLYQ== 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 MW4PR11MB5911.namprd11.prod.outlook.com (2603:10b6:303:16b::16) by DM5PR11MB2058.namprd11.prod.outlook.com (2603:10b6:3:12::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Thu, 11 Aug 2022 13:28:01 +0000 Received: from MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::ad31:cc19:2f56:a1b8]) by MW4PR11MB5911.namprd11.prod.outlook.com ([fe80::ad31:cc19:2f56:a1b8%4]) with mapi id 15.20.5504.020; Thu, 11 Aug 2022 13:28:01 +0000 From: "Kundapura, Ganapati" To: "Kundapura, Ganapati" , "jerinj@marvell.com" , "Jayatheerthan, Jay" , "Naga Harish K, S V" , "dev@dpdk.org" Subject: RE: [PATCH v11 1/7] eventdev/eth_rx: add adapter instance get API Thread-Topic: [PATCH v11 1/7] eventdev/eth_rx: add adapter instance get API Thread-Index: AQHYm0lKyhcRX96sckeb/KOmPHEima2p1WhA Date: Thu, 11 Aug 2022 13:28:01 +0000 Message-ID: References: <20220623093036.708448-1-ganapati.kundapura@intel.com> <20220719082538.274845-1-ganapati.kundapura@intel.com> In-Reply-To: <20220719082538.274845-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: f27015c1-1614-4da7-664f-08da7b9d506e x-ms-traffictypediagnostic: DM5PR11MB2058:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uWDhKXHslqnAG008CNf260DLzwKUtmX7dxk5moCArjUP96mJlM6T9QtA0HM6uRLg73jgWWgsdfXHBOoLGFEF7dIawH65VBW3vSgL9qnV/NlcQ3Zw0QftY97QNLMO+z6C9fR/AgUlabY4tfOAhOiycoQyw1C29VBhW0x4AXE2p0gPRWegjSlr2gaPFBN5kXQaHPvVBZcFAVcjPhkDvWJVweM8EyZzvkNPS8pxhexcPLvlgj8qf/JkSW6YQ/tmnkBjxRQ8hGdgb9JL0AirZE/pkEvjAXw+aETAI6g7ZKbFtIfXC+Hr6ulToMaU4uppBkIl6ciCzEAtG5zpYS3VBH1uQZwmwDxDK/mk9ibbjdCkjajeMautby9U21ng+u8orNdhS82M0AXGE1soI7X0y50M8NgviqrEPSHuddLrHwwtoMjgKjgeMhI9ZtFdqKkEUUTIv7qCInMsLYYMF9omRP3MSRS1UqmHwoF0a3eNd8M1i3qeMkumqNFnnRyL5YwB4Q7huV8bxHY1A3SsA53QcIzTTppWmu/uUxMdI38mkDTKbMnbHp+qY3o3jqvx0FX9eJCiFTXCUWKrvyS8jYrCgtj0HC6sYygODy4rtNwQPMhPXgPQYbxIIsvnkvuDaV6GGOxaQiKC336ilComFb+j3ShNuULguVLjiPShUF6R/Pu+O1VSMo3Sr3aRKDvIsrqVtlFLnQkBprKZ3bowecvPjVjKQkMgaXkGJapdoBnFqSQhlpfRxkupbV2x6A8yyvk7wWMFKOGGxjuVQTHNelL9gHId3rduUUYJkuODRO4mSMatMD/9OpmappHTY1/3BjeAOPmz x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5911.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(136003)(396003)(366004)(39860400002)(346002)(376002)(33656002)(38100700002)(122000001)(82960400001)(26005)(55236004)(9686003)(6506007)(7696005)(83380400001)(53546011)(38070700005)(186003)(86362001)(110136005)(316002)(71200400001)(41300700001)(478600001)(66946007)(66556008)(66476007)(8676002)(5660300002)(66446008)(64756008)(76116006)(8936002)(52536014)(30864003)(2906002)(55016003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?LXM5d9P53hk5qHwZQr0pPtXirpsZXX7oVWdqbrs6RT2ReL6nUWbOPOF2yrtS?= =?us-ascii?Q?kb0+nt6c37o971Oo0LRZ+V5fI0/WuYAL+KtU0DCEm7pcm29Vy7cyGG1TtIIn?= =?us-ascii?Q?OejyEP72FSj1i8oLuooPLu4lrRRtv1o0RRxh1t7GOYIXT3MoYILMzTrJcU1K?= =?us-ascii?Q?NIqVF4g3Bufiq2q+2VKAvkQw2KG5GJ4GRvd9ZlXsfPZOWHSl4NatPAqexeGL?= =?us-ascii?Q?1wQz9BJC2YCATSjcoBl/fK2i7AbXNV4QCURY8mj9BGGA7BzsfjM7jm560AVk?= =?us-ascii?Q?0zbNtGh/+DevxRje3ZGe3sxfawd0ol8NXfC7DuKxfkhkUf2ctv9Z2f0BJouK?= =?us-ascii?Q?2m+bXoaCyRtt63r6PRG13Nwn/MF2JhacscYt5Jtu2AzMHXQnBzmi2aWfgmWe?= =?us-ascii?Q?2aXyfdKGwguNHkIZnOSQmRO35JgBjTPzIWDlh/pe5CxJ0IIuRT1vJByMHtjS?= =?us-ascii?Q?gJvt6vyIpuSRCnidyFpKEKBv7oNsCr6SKOxGcQqh63md25xf7bHQTj9Z7ocE?= =?us-ascii?Q?JYsvOoMkPpZDfvFV0BqtsUi6JblymZ1kkDbmWzUd8knE/rpCyI2mMMWSYHQS?= =?us-ascii?Q?rOMC8O2s2CoxrdNOZUVZpzLbgWSys4Ai6F6SP1btzdQcxFxXZV+8sCDjs+Js?= =?us-ascii?Q?5LdUWlYYNPSyAIubZmv9F+0ZwZ5qXT05kJYZuVw2cJP8C3G+oJxU8tovyOdO?= =?us-ascii?Q?l3g8iB+GFj7DFOqz1BPuAquOpfwdSI2+5sPiXK31rwjrldrdnvbWvqk3ckKr?= =?us-ascii?Q?CS03CORnAM1reA07YIuCEZWhJshH4qjXyvNFgT7aUvAsCNOkSTJGRyr34nVe?= =?us-ascii?Q?Cqx87yyv9AyhaCmANn6oOvaBOcADPY1f0h38RakMeldIIk5Lc2rBolo5p6IX?= =?us-ascii?Q?aZ2f5BeFyiT73k8pqw1qcpUsNZX1i5wuhDkDGXvd08Y+fv5ktg7SpvaisvtZ?= =?us-ascii?Q?ER1MnUSgkRgRJFDLDxzRAuWA7ABofBFi0VrDqa85OQyt9va+rgJicnxJTb1b?= =?us-ascii?Q?WzNy6ZpOErhJHsAZBkRiI6sQqmDOSnqvPalXMGr1HwwX+XDOmi0dzIu111CE?= =?us-ascii?Q?mQXbsajP3QWXTGSg7LTi79DXjGN05a1HCDn5WIaUleQf37FVTFNzTmOq/gtv?= =?us-ascii?Q?a65bBaruUfRXnTi+i8YD/HT+H/hlE6qATZKVZb/W6+r6eD5oXUVRqJcb9W/k?= =?us-ascii?Q?h41iQwdUE5FqfLnq/I2fldAqKux1sYi55ptYD0+c/GAlJx9GOCeNc1Q/Eju2?= =?us-ascii?Q?mnnw637/QPKvdcgwZAxaD2y/B7zu0XmYvNsykrHouf+zUXZcXi3J9kEw+1+e?= =?us-ascii?Q?YBdH7+uPZbRjJ87H7Jxcs/ebHnwwj+n+pC750UnC63+PQ2Jn6dvr4slKUdRb?= =?us-ascii?Q?/WNSg8y+D2Zy1i3QtOClMjI1drhNimnPKZw9vfv8hNpKnZUq/khPV2OSS7BL?= =?us-ascii?Q?xTrM4c3NNaWQ58RulMOwuNvdVXm/7FlHAUUg7QBYsVlBezmPXF49EmZ5tJz1?= =?us-ascii?Q?dEKc6ebmI8NJwlGrjISFTpJWTY1P4RgcXecffiiL55PN3jZ9Sadz8D4LSV7n?= =?us-ascii?Q?PV5D38muzxEp8znr3zqTSCXA1yY9/srtnH8Ql8lUdVGeRETqnDN6bgAS2uz9?= =?us-ascii?Q?SQ=3D=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: MW4PR11MB5911.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f27015c1-1614-4da7-664f-08da7b9d506e X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2022 13:28:01.5215 (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: vCmye8UBxYjUuwJRrwrjkAeN2xFr8rIhbl5i43IIu5e7jwlIkHdLHpA/+5ljb2Gmtvjf8mzqjLWjoCO1ko1KaqvOTNrd6u2kvMNQEVtAxDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR11MB2058 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 Hi Jerin, Could you please review this? Thanks, Ganapati > -----Original Message----- > From: Ganapati Kundapura > Sent: 19 July 2022 13:56 > To: jerinj@marvell.com; Jayatheerthan, Jay ; > Naga Harish K, S V ; dev@dpdk.org > Subject: [PATCH v11 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 >=20 > Reviewed-by: Naga Harish K S V > Acked-by: Jay Jayatheerthan > --- > v11: > * added instance_get under 22.11 in version.map >=20 > v10: > * Add Review and Ack to series >=20 > v9: > * Corrected rte_event_eth_tx_adapter_instanceget to > * rte_event_eth_tx_adapter_instance_get in > event_ethernet_tx_adapter.rst >=20 > 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 >=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_event_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_elems) > { > - 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, > uint16_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, > uint16_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_event_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_create() @@ -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..da07a23 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -112,6 +112,9 @@ EXPERIMENTAL { > # added in 22.07 > rte_event_port_quiesce; > rte_event_queue_attr_set; > + > + # added in 22.11 > + rte_event_eth_rx_adapter_instance_get; > }; >=20 > INTERNAL { > -- > 2.6.4