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 EB733A0557; Fri, 10 Jun 2022 06:14:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D620240689; Fri, 10 Jun 2022 06:14:29 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 4D2AE40221 for ; Fri, 10 Jun 2022 06:14:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654834467; x=1686370467; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=E8PeukJXCUBzKjiVKHO/FPg9/zD/tnJ67WDfSnfbKqg=; b=LrO3J1BhgO5470bmSSq/YwDUYydbVszhvU7qFw1wxAh3IitccUL79hG2 PiYh3E+lorNS8GDq4636I+IXSxgJRrgNJ8nyyTVsZ6DKbNdhqCAvgGX/e xsXwphsd7rkW1ihU3JK7ZtkBg0GS/aT1rLTsCbQWK5ybDE2URi+vdZXGy OYzIXunEbGiWZVOr6sAAXtanhHYL/AEFAXxSFVU2P+QznWk+qEb6yDhQ1 DTAmXGNaCL0JhVqhdD6UparOk5WzGNJSwu4nUISV7n3V+NbDE/wr8VVPw Z8dUjHp17rO2v+H2Z82nBoKhkEyhnpOtJgWMe62rrQTmP3uB501k66Gpg g==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="363834025" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="363834025" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 21:14:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="684330777" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga002.fm.intel.com with ESMTP; 09 Jun 2022 21:14:26 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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; Thu, 9 Jun 2022 21:14:26 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) 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.2308.27 via Frontend Transport; Thu, 9 Jun 2022 21:14:26 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by edgegateway.intel.com (192.55.55.70) 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:14:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GS5dgk3cwwkCXgaGPXc8+K9VAI+oJT9+O01ji1coLEspl4j23FBO7PpvzrWHoUuF1kblmHYX+6jrENYGXzlnxNAutIbvW6Cg7gweUI9c39uaJB51E3ptPwG/gDDdYy+MT/azXNLA0ABEMw74An0fCPhBGCyPMU3kdB3VtXx5qvbijUQLOYy6qq11sKKWplhJhm2Jh1u5Bj6jCsXJQR+11Nongl5GbxaDGQynseJa/ILYo+QcqEtAByyQlAOv11BQ2fPc/dAOUtBhiNSBNoz5hufrJwtTqegyqQVTblZJH1pzDS60AYdktEwpYiLMorLz6QYHm3omWgs5eT8P4SaWcg== 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=jpCXKR9NMeyFTYkmfepR3uN9mY4e3BdtsrYcHzadr0c=; b=bXm1KG0T5en0D/GxEahzOnoXLFuYmTnAySuGYw6YeAaJDGBYI6mdBGE3ef1alMXz9+R5hed2BSpGUH52zaYtdtzb2/julRn1r00CyDb2skCy02TBB7t3ks9Yxsbp+i3z0Cp9uuVp8NdRPeYAxTrXKsX+Y1GMG+83f3wKFHajU4P42jFY6tytUQXgNol9jv2kX0J/zIwOp62Gdz+AWu0ENd6prP8zLAmX8/1+E2mqDShkLQrTMh4xzzdT/eYbIGxMrwt71sSHYyojbiWn2GgyNXmgMs3THCQUw8uBJKiTvZDPeVxm6/RfWa+Vm8fGS+QRSXgywz6AAAgIr336s+GItg== 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:14:20 +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:14:20 +0000 From: "Naga Harish K, S V" To: "Kundapura, Ganapati" , "jerinjacobk@gmail.com" , "dev@dpdk.org" , "Jayatheerthan, Jay" Subject: RE: [PATCH v6 4/7] eventdev/eth_tx: add instance get API Thread-Topic: [PATCH v6 4/7] eventdev/eth_tx: add instance get API Thread-Index: AQHYezFHcEFAi5BkTkKI42oNHGQfA61ICmYQ Date: Fri, 10 Jun 2022 04:14:19 +0000 Message-ID: References: <20220608111644.3939628-1-ganapati.kundapura@intel.com> <20220608121400.3954603-1-ganapati.kundapura@intel.com> <20220608121400.3954603-4-ganapati.kundapura@intel.com> In-Reply-To: <20220608121400.3954603-4-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: 41c3c4d3-a1ed-447c-4709-08da4a97b141 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: eZs/TnmhDTk9l1zKRhx8uUUK6NRDbcw6ggSv/01vivjPNP9x8vM6c0Nc5aGHQoD95x4oL7c0s5GawlBZiHgnBh3AdRJsGldQ6riQqw+1DmCY80KOzGPPOMLS1oMOQMTz7J+QEDw46GatZhd0g+E0uev9l3QxLpI9UPhuV9q0/TyfJLKR2zu9zlsnPoQIKzccqb5rHQxuITRA7vq/9Pij0H0/rlCc7X9XkhD/W1jc9Kt+n1PKzunD7TWBqte3JBvTsSTgNgxdR7hE8gfRzbWwmWWKs/ebLxQeK/CsttDv8r8nS1z7hRJYQYV+5vJmXwbwqi8Hd6jTKQUKesepE2btGNeaHpa5gKvKYhj2xRCj2Am7ptBBzbKm4Ir2Gz5JIDxv73/gkLZhTL3geishOXxyLWYMpXvD0g03HQApHP1QKjYm9iS2s1uC5zOGg+07HUtfq62Ee1ZAFpvRKPtdLbfBRMWLWpWQx1tnnhq+/kUqcxPmb/wmgdg3UCYHgrCM/bWZKLYzjUFSn/6KYuW+i0m5aK9OIrIon5E+mm+I+UUMV7El3+9FuJ3Ddts9/L1w2AH3G4zem5yya+laz9RsuE5yYwJgPt1wXz0HbxVaei4juH63t+2QopxrbL+7ztH9os925yrwTX13wrPbiaPjpURfCQ+GQAc7YMR8eQKXWpw+63133P5XhWsJfRzjRWa71oIijaDahXEXZPXEXgHXTV/k9A== 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)(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?U1PI9PYJdh02Z+YW6MnQFyvETb2ey6xjdP1QqHb3CNDk/EEbxme3WMNDNtQQ?= =?us-ascii?Q?iT0rbd3pO3RKEyAkHYzPlG4AOQjir/kyB2CDHLkfAzuPEHtznhluvHQ5/lY0?= =?us-ascii?Q?Bey5SGOuW++6Ggl4+Bq9+lwx8m0gRgjHzqVlJtPC1O5znlBPqT3l6LtHMldN?= =?us-ascii?Q?iokRs0KlmloZB79KaNC4a+W2cCeF+aiXbzKu0p4/c8TNJh/u/l8TW4JqW8g2?= =?us-ascii?Q?tWgtL7z8WC0t4kuF+sduFDF4vK39ntGOonsaEnmiWXYcRuhdHEoQVKIZEZzw?= =?us-ascii?Q?Ou1l5Ti2+q1lFLxWHMjweLqhOd3IW6b/OsMW6a5XoUTpoy68AkxldJVlO5oc?= =?us-ascii?Q?CO4n9D80Cvxzy27oo9grUKiYjXw5i43HnQP1JrXWdVbDYT54MaeNpnaWijdW?= =?us-ascii?Q?HQ1y8CgJxbLIh3ma/lJYERDIBRc7/Wzm+FjN8MoPWDoMeNYVMm5PT+xbEItf?= =?us-ascii?Q?awLHquS1NATVoMxnLbc1U9h8vcQIJvzr29PZLAK4V5VXyWf53JFm83nMaVAd?= =?us-ascii?Q?pZ7nE5K5qgayFxudrfjgQV9qYv8uPViEhbxtm8ncP50jZz+aTtObkkSVXTrE?= =?us-ascii?Q?3kXdF3Yn7LjkEGLZ1sd8NhEcItvY6E4H/5aAbWGzwv8lokVDYqdQH4/pADxQ?= =?us-ascii?Q?jzRkuYbHxf9flWtF1pYDS7uAHkuKudYQctDMaMnQVd4McEUIvzUV5upgUqTy?= =?us-ascii?Q?aexgQThIy1CwDC+txte1HLLU+R7ukvDeegU1aH3stQNehSf8ibR2D5cDhEMj?= =?us-ascii?Q?ZgDTmAzNg3D1L9S/cNs/c+BcvuSeIJTRr0x+1ABLsYqscTc67IE/peuKiPpk?= =?us-ascii?Q?Q0IsvftAdCqCyFHIrGDaghupB5ktXMNcN1xQy9ZhcELpP9fvmdihVR/ooZvo?= =?us-ascii?Q?z7yWATDepk0MuvMkwIEvocC4M7dUkV/gYnEMNnHHXj1spB+Jecjk9utQYUKt?= =?us-ascii?Q?tuWYZRpgasSzB39oNu0gAvCqcsDAGnS3t/c79iAwJoY9bbC87kBg5TVtX2A3?= =?us-ascii?Q?yzKGTtUFyGjypScs5VlR4UwHU5UAeLVIoyKRlvJjbFEJVBEAfwItg9QhoGXk?= =?us-ascii?Q?6t4IBjUVwV7bkgQPpiPVHlKIB8tZiE1G8k33wbb6MvbJANqPO9M5EbtMdOPM?= =?us-ascii?Q?9/psTPKRooLY3pbiPyt9VKyH2KnDas4GqVhoR06DMSDoxRUtOVrCyvtkol1l?= =?us-ascii?Q?mcofvjEyCvApxx53I2c2Ik0yEpdtVEHYGyHLdLa1qjDAbUXP+Jmibb4l9k3g?= =?us-ascii?Q?O1YIrX3gsznklOXV/i3uVymSQtZ8k18/Kn9eQZQUKUr1/imrwXYVVKOByUOh?= =?us-ascii?Q?wmpJWuB7Fsl2aj/yrn4OakXw8misw+LdntOOmmlYYfE/i2w4QbTGclLlcgMx?= =?us-ascii?Q?ZJcshUqNfyIeZbMtXK/IVe1YJy83xHpHUcKvhV/OYiDTdDUJcvaOzlr/KDEb?= =?us-ascii?Q?0JBVIW3cyg3Z5GrfI3bPbADAuJWeZA6oh7ur+oR93jiBpHJS1Y4/CJszE3A6?= =?us-ascii?Q?rdU1YWOgFbjkR2W6wsffS0FoOqg345OM3bMa3jo6hyW2IcNyxA/3CIuVDFXK?= =?us-ascii?Q?OKLdbcCwo5Ujkw6lW6xrkhw47vOfpJ1gBbrvZsa3jw3fwLK0cWkO/ftJvOTJ?= =?us-ascii?Q?FuEab2aw8M4/WZV+Ox9oGLqweg8Y5nk0JT1/xYhNzu63g4com/PgEgdb3HRi?= =?us-ascii?Q?ORaiQEv37rP3cppkRijfE61e5L9NV6BAGm5KKUHgxcvwVke9+e3P/3m+tix7?= =?us-ascii?Q?S5pQl5y6UeVErsw1eUPY4Y2eBcMMYP4=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: 41c3c4d3-a1ed-447c-4709-08da4a97b141 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2022 04:14:20.0552 (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: hp5MQ5IDNiTRSL/UPs/+gmjcnExHw5OuOAOY8peDwEcRaRGpsUqA5GszSKz/sf4gyfihbpjI02zRYYFL18bD8gn3cId0lxGlWtWh+lbpVX8= 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 4/7] eventdev/eth_tx: add instance get API >=20 > Added rte_event_eth_tx_adapter_instance_get() to get the adapter > instance id for specified ethernet device id and tx queue index. >=20 > Signed-off-by: Ganapati Kundapura >=20 > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c > b/lib/eventdev/rte_event_eth_tx_adapter.c > index 1b304f0..d9de6e5 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > @@ -1,6 +1,8 @@ > /* SPDX-License-Identifier: BSD-3-Clause > * Copyright(c) 2018 Intel Corporation. > */ > +#include > + > #include > #include > #include > @@ -17,6 +19,11 @@ > #define TXA_MAX_NB_TX 128 > #define TXA_INVALID_DEV_ID INT32_C(-1) > #define TXA_INVALID_SERVICE_ID INT64_C(-1) > +#define INVALID_INSTANCE_ID UINT8_MAX > + > +#define TXA_ADAPTER_ARRAY "txa_adapter_array" > +#define TXA_SERVICE_DATA_ARRAY "txa_service_data_array" > +#define TXA_ADAPTER_INSTANCE_ARRAY "txa_adapter_instance_array" >=20 > #define txa_evdev(id) (&rte_eventdevs[txa_dev_id_array[(id)]]) >=20 > @@ -140,6 +147,10 @@ struct txa_service_ethdev { > void *queues; > }; >=20 > +struct event_eth_txa_inst_info { > + uint8_t txa_inst_id; > +}; > + > /* Array of adapter instances, initialized with event device id > * when adapter is created > */ > @@ -148,6 +159,9 @@ static int *txa_dev_id_array; > /* Array of pointers to service implementation data */ static struct > txa_service_data **txa_service_data_array; >=20 > +/* array of adapter instances to store tx queue specific instance */ > +static struct event_eth_txa_inst_info **event_eth_txa_inst_info; > + > static int32_t txa_service_func(void *args); static int > txa_service_adapter_create_ext(uint8_t id, > struct rte_eventdev *dev, > @@ -194,12 +208,42 @@ txa_memzone_array_get(const char *name, > unsigned int elt_size, int nb_elems) } >=20 > static int > +txa_memzone_lookup(void) > +{ > + const struct rte_memzone *mz; > + > + if (txa_dev_id_array =3D=3D NULL) { > + mz =3D rte_memzone_lookup(TXA_ADAPTER_ARRAY); > + if (mz =3D=3D NULL) > + return -ENOMEM; > + txa_dev_id_array =3D mz->addr; > + } > + > + if (txa_service_data_array =3D=3D NULL) { > + mz =3D rte_memzone_lookup(TXA_SERVICE_DATA_ARRAY); > + if (mz =3D=3D NULL) > + return -ENOMEM; > + txa_service_data_array =3D mz->addr; > + } > + > + if (event_eth_txa_inst_info =3D=3D NULL) { > + mz =3D > rte_memzone_lookup(TXA_ADAPTER_INSTANCE_ARRAY); > + if (mz =3D=3D NULL) > + return -ENOMEM; > + event_eth_txa_inst_info =3D mz->addr; > + } > + > + return 0; > +} > + > + > +static int > txa_dev_id_array_init(void) > { > if (txa_dev_id_array =3D=3D NULL) { > int i; >=20 > - txa_dev_id_array =3D > txa_memzone_array_get("txa_adapter_array", > + txa_dev_id_array =3D > txa_memzone_array_get(TXA_ADAPTER_ARRAY, > sizeof(int), >=20 > RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE); > if (txa_dev_id_array =3D=3D NULL) > @@ -221,15 +265,30 @@ txa_init(void) > static int > txa_service_data_init(void) > { > + uint8_t i; > + > if (txa_service_data_array =3D=3D NULL) { > txa_service_data_array =3D > - > txa_memzone_array_get("txa_service_data_array", > + > txa_memzone_array_get(TXA_SERVICE_DATA_ARRAY, > sizeof(int), >=20 > RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE); > if (txa_service_data_array =3D=3D NULL) > return -ENOMEM; > } >=20 > + if (event_eth_txa_inst_info =3D=3D NULL) { > + event_eth_txa_inst_info =3D > + > txa_memzone_array_get(TXA_ADAPTER_INSTANCE_ARRAY, > + sizeof(*event_eth_txa_inst_info), > + RTE_MAX_ETHPORTS); > + if (event_eth_txa_inst_info =3D=3D NULL) > + return -ENOMEM; > + } > + > + /* Reset the txa instance pointers */ > + for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) > + event_eth_txa_inst_info[i] =3D NULL; > + > return 0; > } >=20 > @@ -763,6 +822,7 @@ txa_service_queue_add(uint8_t id, > struct rte_eth_dev_tx_buffer *tb; > struct txa_retry *txa_retry; > int ret =3D 0; > + uint16_t eth_dev_id =3D eth_dev->data->port_id; >=20 > txa =3D txa_service_id_to_data(id); >=20 > @@ -831,6 +891,31 @@ txa_service_queue_add(uint8_t id, > rte_eth_tx_buffer_set_err_callback(tb, > txa_service_buffer_retry, txa_retry); >=20 > + /* Allocate storage to store txa_inst_id for txq */ > + if (event_eth_txa_inst_info[eth_dev_id] =3D=3D NULL) { > + uint16_t n, i; > + struct event_eth_txa_inst_info *i_info; > + > + n =3D eth_dev->data->nb_tx_queues; > + > + i_info =3D rte_zmalloc_socket("event_eth_txa_inst_info", > + n * sizeof(event_eth_txa_inst_info), > + 0, > + txa->socket_id); > + if (i_info =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("Failed to allocate storage for " > + "event_eth_txa_inst_info"); > + goto err_unlock; > + } > + > + for (i =3D 0; i < n; i++) > + i_info[i].txa_inst_id =3D INVALID_INSTANCE_ID; > + > + event_eth_txa_inst_info[eth_dev_id] =3D i_info; > + } > + > + event_eth_txa_inst_info[eth_dev_id][tx_queue_id].txa_inst_id =3D > id; > + > tqi->tx_buf =3D tb; > tqi->added =3D 1; > tdi->nb_queues++; > @@ -902,6 +987,12 @@ txa_service_queue_del(uint8_t id, > txa->nb_queues--; > txa->txa_ethdev[port_id].nb_queues--; >=20 > + /* unset txa_inst_id for tx_queue_id */ > + if (event_eth_txa_inst_info[port_id]) > + event_eth_txa_inst_info[port_id][tx_queue_id].txa_inst_id > =3D > + > INVALID_INSTANCE_ID; > + > + > txa_service_queue_array_free(txa, port_id); > return 0; > } > @@ -1056,6 +1147,10 @@ int > rte_event_eth_tx_adapter_free(uint8_t id) { > int ret; > + uint16_t eth_dev_id; > + > + if (txa_memzone_lookup()) > + return -ENOMEM; >=20 > TXA_CHECK_OR_ERR_RET(id); >=20 > @@ -1067,6 +1162,13 @@ rte_event_eth_tx_adapter_free(uint8_t id) > ret =3D txa_service_adapter_free(id); > txa_dev_id_array[id] =3D TXA_INVALID_DEV_ID; >=20 > + for (eth_dev_id =3D 0; eth_dev_id < RTE_MAX_ETHPORTS; > eth_dev_id++) { > + if (event_eth_txa_inst_info[eth_dev_id]) { Same as for rx_adapter 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_txa_inst_info[eth_dev_id]); > + event_eth_txa_inst_info[eth_dev_id] =3D NULL; > + } > + } > + > rte_eventdev_trace_eth_tx_adapter_free(id, ret); > return ret; > } > @@ -1080,6 +1182,9 @@ rte_event_eth_tx_adapter_queue_add(uint8_t id, > int ret; > uint32_t caps; >=20 > + if (txa_memzone_lookup()) > + return -ENOMEM; > + > RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); > TXA_CHECK_OR_ERR_RET(id); >=20 > @@ -1113,6 +1218,9 @@ rte_event_eth_tx_adapter_queue_del(uint8_t id, > int ret; > uint32_t caps; >=20 > + if (txa_memzone_lookup()) > + return -ENOMEM; > + > RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); > TXA_CHECK_OR_ERR_RET(id); >=20 > @@ -1218,3 +1326,46 @@ rte_event_eth_tx_adapter_stop(uint8_t id) > rte_eventdev_trace_eth_tx_adapter_stop(id, ret); > return ret; > } > + > +int > +rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id, > + uint16_t tx_queue_id, > + uint8_t *txa_inst_id) > +{ > + uint8_t inst_id; > + > + if (txa_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 (tx_queue_id >=3D rte_eth_devices[eth_dev_id].data- > >nb_tx_queues) { > + RTE_EDEV_LOG_ERR("Invalid tx queue id %u", tx_queue_id); > + return -EINVAL; > + } > + > + if (txa_inst_id =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("txa_instance_id cannot be NULL"); > + return -EINVAL; > + } > + > + if (event_eth_txa_inst_info[eth_dev_id] =3D=3D NULL) { > + RTE_EDEV_LOG_ERR("No valid txa instance for eth_dev_id > %d", > + eth_dev_id); > + return -EINVAL; > + } > + > + inst_id =3D > event_eth_txa_inst_info[eth_dev_id][tx_queue_id].txa_inst_id; > + if (inst_id =3D=3D INVALID_INSTANCE_ID) { > + RTE_EDEV_LOG_ERR("Invalid txa instance for eth_dev_id > %u, " > + "tx_queue_id %u", eth_dev_id, > tx_queue_id); > + return -EINVAL; > + } > + > + *txa_inst_id =3D inst_id; > + > + return 0; > +} > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h > b/lib/eventdev/rte_event_eth_tx_adapter.h > index 3908c2d..20d28a7 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.h > +++ b/lib/eventdev/rte_event_eth_tx_adapter.h > @@ -34,6 +34,7 @@ > * - rte_event_eth_tx_adapter_enqueue() > * - rte_event_eth_tx_adapter_event_port_get() > * - rte_event_eth_tx_adapter_service_id_get() > + * - rte_event_eth_tx_adapter_instance_get() > * > * The application creates the adapter using > * rte_event_eth_tx_adapter_create() or > rte_event_eth_tx_adapter_create_ext(). > @@ -423,6 +424,24 @@ rte_event_eth_tx_adapter_stats_reset(uint8_t id); > int rte_event_eth_tx_adapter_service_id_get(uint8_t id, uint32_t > *service_id); >=20 > +/** > + * Get TX adapter instance id for TX queue > + * > + * @param eth_dev_id > + * Port identifier of Ethernet device. > + * > + * @param tx_queue_id > + * Etherdev device TX queue index. > + * > + * @param[out] txa_inst_id > + * Pointer to store TX adapter instance identifier. > + */ > +__rte_experimental > +int > +rte_event_eth_tx_adapter_instance_get(uint16_t eth_dev_id, > + uint16_t tx_queue_id, > + uint8_t *txa_inst_id); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/eventdev/version.map b/lib/eventdev/version.map index > f1818a2..1c99d52 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -106,6 +106,7 @@ EXPERIMENTAL { > rte_event_eth_rx_adapter_queue_conf_get; > rte_event_eth_rx_adapter_queue_stats_get; > rte_event_eth_rx_adapter_queue_stats_reset; > + rte_event_eth_tx_adapter_instance_get; >=20 > # added in 22.03 > rte_event_eth_rx_adapter_event_port_get; > -- > 2.6.4