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 220D2A0557; Fri, 10 Jun 2022 06:13:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1B4A40689; Fri, 10 Jun 2022 06:13:04 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 907BF40221 for ; Fri, 10 Jun 2022 06:13:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654834383; x=1686370383; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=86fDBimxfgd8zMo1cGPT+KhySjMhLpTV/Ugn0iLCFro=; b=E04kcpl+ZyC85i3xXvRYMREE+NM/JfrExvfM+MGrPoNk4z6b0MWwtPH8 oaOrJFoKXrRIe/B7vZOPYwYPiFirigNK03fBPz4Bx7pF0/lYHMTxvd2TY ZCpyp70OR9TXp3Vr3DaFT6z1T9mma8zxsMCx9dSvX85Tg7HLP7q2ukfy8 OIqsDBK1oip4X09BTbd4EvBlhDDqU/8rE5JZOybo8SOc7DpfG26szxE/g klx4YP3lY25I2bYM8DEm6bxxgmDQXpUb/jrC/y1uvvOcY/gGCkvhMhE0y CppVm2+JpgN1YKQwxoDP7qYA3JjALpCH/IMsn8qjel7wG/ke2vAQoOkRa A==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="363833639" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="363833639" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 21:13:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="671654663" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by FMSMGA003.fm.intel.com with ESMTP; 09 Jun 2022 21:13:01 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 9 Jun 2022 21:13:00 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Thu, 9 Jun 2022 21:13:00 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Thu, 9 Jun 2022 21:12:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LOuUcXPjp3ia0iWsj1+Oh6J5OyG2M+hYUkNFswJF7cSUDhmDRVvjEFujTiHbNj/F3lpsdr0n32GVXF84CJM2Ge9D7fhX8dtSpLWLQapfW9u9Cf/9WnuzN3uS/8sn/+nEbw+d2YstGsmruAkMicxiWIwd01VN4TeIAgqdsxYGSKavt8/gE51ckZ2cfD8Bvp/PG1/MWqOoKyozussoUPfSldIYnnHiuANvJ0YDRYNF1XIwHFucrqgIVkOQR/MwdUwqp5gauJzPXO3epyaDUCzlBIDK3sj/1tlCxc31O9B4Y9vLmoAnAtuz1nbROl2Bs2UjO2aiT2Nfuv6cFbAJCKB6/Q== 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=sxXtsPIY0wjl26BRj7j6bl1+k6bgOtDeuofOK5YwhHA=; b=nzDM/t0/lk0TFP1HeX7GNVrJl8kdsmBfsR3wLL0M24FOPh5yOppIJ9LO28sc4/YN4qJNur170p5E7aDauyQJ1hlp3CCmlX3DBgGpQoLlKaLMK+ZOw8zKIAmp+RQNXwNHv54ZL6Z25O87K3yW8MlapYv5MNkin37Nr+BeRIoMP7xYz/Ea8W+MNrkjeEl34XV+BG9ly+GgvPYC0LvSUOMVGP3qNEJFF7z5eA4QHTSEzCvJ+rM1EOiVJ2tm/EsYFs8503Ei1Eg/8/KKnS5zVEX7Pep9jC6UwAaDPhEI9BElLZkwgp+A+9gN93e3tV/Kw8+etuhjMXwMWsBJ293kX/nirQ== 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 BY5PR11MB4370.namprd11.prod.outlook.com (2603:10b6:a03:1c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 04:12:58 +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.5332.013; Fri, 10 Jun 2022 04:12:57 +0000 From: "Naga Harish K, S V" To: "Kundapura, Ganapati" , "jerinjacobk@gmail.com" , "dev@dpdk.org" , "Jayatheerthan, Jay" Subject: RE: [PATCH v6 1/7] eventdev/eth_rx: add adapter instance get API Thread-Topic: [PATCH v6 1/7] eventdev/eth_rx: add adapter instance get API Thread-Index: AQHYezFGvM1yjXFH40qlujRIjDUclK1ICe9A Date: Fri, 10 Jun 2022 04:12:57 +0000 Message-ID: References: <20220608111644.3939628-1-ganapati.kundapura@intel.com> <20220608121400.3954603-1-ganapati.kundapura@intel.com> In-Reply-To: <20220608121400.3954603-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: 3b32e310-83c0-42bb-a827-08da4a978009 x-ms-traffictypediagnostic: BY5PR11MB4370: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: K/2zvIgBR1nsPplFbU/1/Yp7JAmerV19Be7Bc5Q6BXFO36mBwQCrcuuWOLycPCygvQoyiHN7gUjor7SMNTeWLD1h/RVZZbfnJmcnsxxv4htwKx4zx5KyZ/WdyZUBNHDJ02Ip0cbiRXRgtTeSM6bTqeT4x10wfuhCBkw1FP3uxgFhYg2k6hFXXU2nCpdf2DAFj8gJqY19kr2i2qa4QNyQO9pa/jugbwMQ9riroeNtpuXxhk8f7pKx1cN8WnTPVK3+dWUA3lgyFqVmhm5K990Ew5+EXa4ir0mn6sz5fN8T+g5SXP3FuJyIocIdqs2kn2t26zd0jNzNEXnaG5JalZeB/sVzxIex/07FTCR0OX1KZgslGqDH9uIcPxTijj1/hAvs0vizhr2XHrOf20fMeZcyjT/4P5Hp9b9czjbkNaK4sVjOXDq0sEbnaVfp2R2JPTX2mcAUZIExd6czhLQked65fMKRYqjhaNHOGoHX5pTH7apJmVCQQeZvlFeHV97sCXvzWffVhSADJ5+RlLKnPLBkMhAv7X63ELSl7Ow1dEe7PLiyqrb3JHfDfr6VfaX6V1ZVpbMC3IVuSQuYV64L96HpcS9EMXNnFIHwvrEdxQcw/B10jsa1tQ08mELQRMZpqp14Pf+4edNj9WkBvn8jcsUWa6skCXcliSXLDxaas1HUifXmslzIntdcUkFRAnp8dd7dJfWoSBo3AjHJhomhboa2WA== 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:(13230001)(366004)(186003)(52536014)(508600001)(110136005)(38100700002)(6636002)(8936002)(66556008)(66476007)(64756008)(66946007)(55016003)(30864003)(5660300002)(2906002)(76116006)(316002)(83380400001)(71200400001)(38070700005)(33656002)(26005)(122000001)(7696005)(9686003)(53546011)(86362001)(82960400001)(6506007)(8676002)(66446008); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?iNQq/4LXYCLJB/NCzVmxp8c/dCU3JqHQz+yhQb6JKCng6VTVjTECLCS1NDwM?= =?us-ascii?Q?lGpUHF8Ss8H3LXCagqPCEv4om8rsVSkrh3AwxYrw0yDzeVpGGbp15hIsa+Io?= =?us-ascii?Q?yOr31YBPppwb8npbbcfqEVusmee5iFq0/hpDHsOmKgySDtxKUAeWmGCxxHHa?= =?us-ascii?Q?CLIMjFbv21iJm9rfblv8eK1irRRBa/pccl9mdgDq2kBJTyG+bScDyfvrMHu1?= =?us-ascii?Q?a3jX8RiuB35g2OuDAYy3ilVLKDxPj5azeklD9XB6NxULaXPMbltKrenkJwOF?= =?us-ascii?Q?/DgyoTRMjDYhTelVbkEWvzpolFi9/fr7S+sisXmZnqfLgMqssa9UH13mhIy0?= =?us-ascii?Q?es3IfatE18CreL6nGkfmDpU5mPw44u2GlfWSSbp6mdTP9xuZGIJhhAjTgChx?= =?us-ascii?Q?meNm+WKS6y8s7Zxo3V8+yc9pVyePv++bfDPQDf/hh39d/b5J5rz3AThkbxnU?= =?us-ascii?Q?XAWTbysY0HC/qt3o/LSH0FjSAzQfNXQ8D1VnLOwuN12GA44yvT3DiNhTpvyt?= =?us-ascii?Q?LtcaLvwzY/966QUqdgyJaexVKJrGncqhTkSldhO47zBx3Nf6ETMh9wbfMYgb?= =?us-ascii?Q?nHCky64ZNZbOt9wY9To3RNxXbesY6YY7MGZPVFudWytPaJUHmsl4LSPa/7Ay?= =?us-ascii?Q?TXStr/52nR4rtJcfXC/6gU1Ey3/Vid3FqqbMaFamuHep41+Sc1vt3LBwB2HS?= =?us-ascii?Q?gKqF+NfI7vD3YdBmzVjqB1BO2gN3XR+UJkPjs0vnqMKhFYklzQqWicdZTbXW?= =?us-ascii?Q?FJs4jzj0Yr/tOtNt9I4W/OGCLvtJG0i1t/TD4gC/fWrlh+107Z4ciOelX2AT?= =?us-ascii?Q?QxkhcgciWdZ6TDwrdrVlv9OJcnzQ3isw5VHOE09FJU9xtAdy2Mzsv7VsOXFK?= =?us-ascii?Q?p1xqyK2NDhzqOTcHc1EepYWEJxD0aCxlmCGLTiau9Z0oS8AHKHeqlE7ygNrg?= =?us-ascii?Q?SYI83Rr24ivM5t7K3yya/R0dMzfO0wmkdJKVpmYUE05Bu02GTrS/YkQy/Yyi?= =?us-ascii?Q?6sqGbCqbwzirmuPDG8nj8b9BLcrF7lDTgHWefBKTxhlXJmpGnFEXwIpvWkNt?= =?us-ascii?Q?51+iyBlf/G19j9Obb1U7uxJAT7D33OZvEi8XduJGBb/Mfvy5hu3l6YkyqSlH?= =?us-ascii?Q?bqYjfi/wrkqX4x8xKEwGRrUTvnsCfpq20G+ufFvBPm4HNzhmNYrjmFHjV65D?= =?us-ascii?Q?gjbWZHOlqkoyhLnTNKJ30j1acYrzJz8HiYAfxOx2pE+hskH+XrRS0NYS+Pr9?= =?us-ascii?Q?Zv8ACxZuIQ1UfeJRTetI3qf0E+1G2nRiQ98bSDN7IMJC/0Azp0k3wTyDrabc?= =?us-ascii?Q?a3hQuIz8oGd04y3M+GUh1kP2WOtFmks7f0g07c9g//d0g72OJYEKM1/ERbPj?= =?us-ascii?Q?JDFjAHrsBuuLatPxMjkaGzbfuYE5fF1u6PpSu7UxEfEW3Xk56aARPo9lNN8Y?= =?us-ascii?Q?oxB9FVroQU5pGCwElK3kEe84t5Ha9DIHVtXQxBspHNyjY/vfs+vMQyfEWD7J?= =?us-ascii?Q?2SDLpMQPElcaLUJ6vcMIPHDYBZ0nhgU43pUQuuesx/Ucef75rcCj+i19xO91?= =?us-ascii?Q?fjLzarPxNDT2zQXfCxkhf6ELjNDBm1PcdBWqEpLgAP03CKR6pyCvr7NudyR6?= =?us-ascii?Q?ww5YdkdiMurj7zBKi3Of9Vcgo+KgSRjUFpSzJO3aeIVQIckmvmqEwP89huET?= =?us-ascii?Q?3DaQ54DQk8cAep4ieOMzidt20C3LsQFaJSIPTcRmIjWPXJwDLD8jcIgchsP3?= =?us-ascii?Q?78awTIYRwagpAzCZeMXY2oUzY16EA8k=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: 3b32e310-83c0-42bb-a827-08da4a978009 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2022 04:12:57.4667 (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: TUbd1hqjQ6DRksDN2cXBclUuuUKyo5Oc0qV6Ee5iklM0HZJhn/gRK1kKkqI+GQFPLtU+bsOpzkg8eyg0dOrzP1x+z6k81H/N2PmuAfeT27k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4370 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 > -----Original Message----- > From: Kundapura, Ganapati > Sent: Wednesday, June 8, 2022 5:44 PM > To: jerinjacobk@gmail.com; dev@dpdk.org; Jayatheerthan, Jay > > Cc: Naga Harish K, S V > Subject: [PATCH v6 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 > --- > 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/rte_event_eth_rx_adapter.c > b/lib/eventdev/rte_event_eth_rx_adapter.c > index bf8741d..d1b4874 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -6,6 +6,7 @@ > #include > #endif > #include > +#include >=20 > #include > #include > @@ -42,7 +43,10 @@ > /* Sentinel value to detect initialized file handle */ > #define INIT_FD -1 >=20 > -#define RXA_ADAPTER_ARRAY "rte_event_eth_rx_adapter_array" > +#define RX_ADAPTER_DATA_ARRAY "rx_adapter_data_array" > +#define RX_ADAPTER_INSTANCE_ARRAY "rx_adapter_instance_array" > + > +#define INVALID_INSTANCE_ID UINT8_MAX >=20 > /* > * Used to store port and queue ID of interrupting Rx queue @@ -251,7 > +255,12 @@ struct eth_rx_queue_info { > struct rte_event_eth_rx_adapter_stats *stats; }; >=20 > +struct event_eth_rxa_inst_info { > + uint8_t rxa_inst_id; > +}; > + > static struct event_eth_rx_adapter **event_eth_rx_adapter; > +static struct event_eth_rxa_inst_info **event_eth_rxa_inst_info; >=20 > /* Enable dynamic timestamp field in mbuf */ static uint64_t > event_eth_rx_timestamp_dynflag; @@ -1415,15 +1424,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 +1438,46 @@ 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(RX_ADAPTER_DATA_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; > + > + } > + > + if (event_eth_rxa_inst_info =3D=3D NULL) { > + event_eth_rxa_inst_info =3D > + > rxa_memzone_array_get(RX_ADAPTER_INSTANCE_ARRAY, > + sizeof(*event_eth_rxa_inst_info), > + RTE_MAX_ETHPORTS); > + if (event_eth_rxa_inst_info =3D=3D NULL) > + return -ENOMEM; > + > + for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) > + event_eth_rxa_inst_info[i] =3D NULL; > + } > + > return 0; > } >=20 > @@ -1447,12 +1487,21 @@ rxa_memzone_lookup(void) > const struct rte_memzone *mz; >=20 > if (event_eth_rx_adapter =3D=3D NULL) { > - mz =3D rte_memzone_lookup(RXA_ADAPTER_ARRAY); > + mz =3D rte_memzone_lookup(RX_ADAPTER_DATA_ARRAY); > if (mz =3D=3D NULL) > return -ENOMEM; > + > event_eth_rx_adapter =3D mz->addr; > } >=20 > + if (event_eth_rxa_inst_info =3D=3D NULL) { > + mz =3D > rte_memzone_lookup(RX_ADAPTER_INSTANCE_ARRAY); > + if (mz =3D=3D NULL) > + return -ENOMEM; > + > + event_eth_rxa_inst_info =3D mz->addr; > + } > + > return 0; > } >=20 > @@ -1950,6 +1999,7 @@ rxa_sw_del(struct event_eth_rx_adapter > *rx_adapter, > int pollq; > int intrq; > int sintrq; > + uint16_t eth_dev_id =3D dev_info->dev->data->port_id; >=20 >=20 > if (rx_adapter->nb_queues =3D=3D 0) > @@ -1993,6 +2043,11 @@ rxa_sw_del(struct event_eth_rx_adapter > *rx_adapter, > dev_info->rx_queue[rx_queue_id].event_buf =3D NULL; > dev_info->rx_queue[rx_queue_id].stats =3D NULL; > } > + > + /* unset rxa_inst_id for rx_queue_id */ > + if (event_eth_rxa_inst_info[eth_dev_id]) > + > event_eth_rxa_inst_info[eth_dev_id][rx_queue_id].rxa_inst_id =3D > + > INVALID_INSTANCE_ID; > } >=20 > static int > @@ -2085,6 +2140,33 @@ rxa_add_queue(struct event_eth_rx_adapter > *rx_adapter, > } > } >=20 > + /* Allocate storage to store rxa_inst_id for rxq */ > + if (event_eth_rxa_inst_info[eth_dev_id] =3D=3D NULL) { > + uint16_t n, i; > + struct event_eth_rxa_inst_info *i_info; > + > + n =3D rte_eth_devices[eth_dev_id].data->nb_rx_queues; > + > + i_info =3D rte_zmalloc_socket("event_eth_rxa_inst_info", > + n * sizeof(struct event_eth_rxa_inst_info), > + 0, > + rx_adapter->socket_id); > + if (i_info =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("Failed to allocate storage for " > + "event_eth_rxa_inst_info"); > + return -ENOMEM; > + } > + > + for (i =3D 0; i < n; i++) > + i_info[i].rxa_inst_id =3D INVALID_INSTANCE_ID; > + > + event_eth_rxa_inst_info[eth_dev_id] =3D i_info; > + } > + > + /* store rxa id for rx_queue_id in event_eth_rxa_inst_info */ > + event_eth_rxa_inst_info[eth_dev_id][rx_queue_id].rxa_inst_id =3D > + rx_adapter- > >id; > + > if (!rx_adapter->use_queue_event_buf) > return 0; >=20 > @@ -2523,6 +2605,10 @@ int > rte_event_eth_rx_adapter_free(uint8_t id) { > struct event_eth_rx_adapter *rx_adapter; > + uint16_t eth_dev_id; > + > + if (rxa_memzone_lookup()) > + return -ENOMEM; >=20 > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, - > EINVAL); >=20 > @@ -2544,6 +2630,13 @@ rte_event_eth_rx_adapter_free(uint8_t id) > rte_free(rx_adapter); > event_eth_rx_adapter[id] =3D NULL; >=20 > + for (eth_dev_id =3D 0; eth_dev_id < RTE_MAX_ETHPORTS; > eth_dev_id++) { > + if (event_eth_rxa_inst_info[eth_dev_id]) { if the queues of same eth_device are distributed among multiple adapter ins= tances, there is a problem here. the eth_device array may need to be freed only when none of the queues are = assigned to any adapter instance. each entry of the eth_dev and queue entry need to be checked here and skip = the freeing of eth_device level array=20 if there is any valid entry found. > + rte_free(event_eth_rxa_inst_info[eth_dev_id]); > + event_eth_rxa_inst_info[eth_dev_id] =3D NULL; > + } > + } > + > rte_eventdev_trace_eth_rx_adapter_free(id); > return 0; > } > @@ -2561,6 +2654,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 +2822,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 +2931,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 +3386,49 @@ > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > return 0; > } >=20 > +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 inst_id; > + > + 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; > + } > + > + if (event_eth_rxa_inst_info[eth_dev_id] =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("No valid rxa instance for eth_dev_id > %u", > + eth_dev_id); > + return -EINVAL; > + } > + > + inst_id =3D > event_eth_rxa_inst_info[eth_dev_id][rx_queue_id].rxa_inst_id; > + if (inst_id =3D=3D INVALID_INSTANCE_ID) { > + RTE_EDEV_LOG_ERR("Invalid rxa instance for eth_dev_id > %u, " > + "rx_queue_id %u", eth_dev_id, > rx_queue_id); > + return -EINVAL; > + } > + > + *rxa_inst_id =3D inst_id; > + > + return 0; > +} > + > #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..45140a6 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,28 @@ > __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. > + * > + * @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..f1818a2 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -102,6 +102,7 @@ EXPERIMENTAL { >=20 > # added in 21.11 > rte_event_eth_rx_adapter_create_with_params; > + rte_event_eth_rx_adapter_instance_get; > rte_event_eth_rx_adapter_queue_conf_get; > rte_event_eth_rx_adapter_queue_stats_get; > rte_event_eth_rx_adapter_queue_stats_reset; > -- > 2.6.4