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 82FE6A034C; Wed, 22 Jun 2022 19:30:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8BF14281C; Wed, 22 Jun 2022 19:30:12 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 2664C427F8 for ; Wed, 22 Jun 2022 19:30:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655919010; x=1687455010; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=ZMVbH/CTBpCG11JU/WGfveYCkmAPLCzF07mcF0RxY50=; b=YblRzvHpy4vD0xAf3J6reVCyB6v4uppTV+xFHUWExDFxtvvDktcdyfea viDlfzEr7aqNT39z86wY3CtVeUGvBQHnDfJBGmBVWCyzbNDgZYknGdxKb 27dXsYpoE+Uq/f0k/dd++Hxxe58Ows9b+blKrQfOgEUVhI2EY0vjERX3+ YUBhEJW0qcLKWYjKpMttNQ1n52ppXXv60aVd6wOhwet7CgHtAGFthFK20 g/tsjNq9baiTYUHEJYA/xCbZD7gs9kJrnJJ2agbFTr/DU7yGxo8gxMxtq upjz+ubLvvidpfifcokMV1j57x3DKx5oF1jqiK5LzHR08uJskE6QkPw0m w==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="280529626" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="280529626" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 10:30:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="588280372" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga002.jf.intel.com with ESMTP; 22 Jun 2022 10:30:08 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) 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:30:08 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX610.amr.corp.intel.com (10.22.229.23) 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:30:07 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) 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:30:07 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) 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; Wed, 22 Jun 2022 10:30:07 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jEfHVkj33HH4TKcFqUlpD6QKgYaegFbJXaWkZKcMH+diOuXyRMfx99g6/37Be6qSERmn7Bii6i3o4B87L7y9Pje+LyxBIstJMwzLkbBTkgIykNNqjl9vHA5Ud618Vc/wPlcu5luUtGkOg7Gbkz7mP9ljb7GTFH1JF9+BJrmpnlk20AFmUKDWV4AQOOrNTP8sp9HlJ1qctI0CxCoWtwZp/errZMLc47Wu2hbkjbVOCaQT0iJr6azmgQAVC9rPBXXDVQT3m95ddvvnQBOnh+QGmIlkMk0llHwgDdoUEB6axSyT7BXY4IwmLbI6m53wu46ym2Aon/K7N5zHMn8vY/m9gw== 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=VokGn8wCYbY1uYGajNfuJ5Fyx0CstpdWOvQ7Rj6oosQ=; b=hghaSw4PmMPeTr36o6wvUGZXCFo3Vq6LQAGNxks5q2umaMHRvScpkTVK3sTWH0iKntDIWaQHM+Ryq0VGkTRNyBQwBs3HHSeacNddHY8OZDEbjlIMVvtEl2EKr1a3Imks9Wm/wJPCP/AdFF1G/p7DgwS0xzNKFwHTFrGvm70lmuP1B1FwtTku22o7QiUtJQTa/Tn/E7aTvHkTutxgECGrnHtCVgDMmI1V4HZT14UnN7sRNyN1JQaEfMDlSbra+Pmt5vz4dunme/5WztzeNMMkuQ2bNHJn5fUYjEt2cfpNq8HhXO6H6QXwrhNAUbvt1Y3TSUcdaKaO8vJWX3PrXYF/rQ== 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:30:05 +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:30:04 +0000 From: "Naga Harish K, S V" To: "Kundapura, Ganapati" , "dev@dpdk.org" , "jerinj@marvell.com" , "Jayatheerthan, Jay" Subject: RE: [PATCH v8 4/7] eventdev/eth_tx: add instance get API Thread-Topic: [PATCH v8 4/7] eventdev/eth_tx: add instance get API Thread-Index: AQHYhli4U3fkbMwKoU+OSZwswqTkv61brq6g Date: Wed, 22 Jun 2022 17:30:04 +0000 Message-ID: References: <20220622103756.421869-1-ganapati.kundapura@intel.com> <20220622165405.533042-1-ganapati.kundapura@intel.com> <20220622165405.533042-4-ganapati.kundapura@intel.com> In-Reply-To: <20220622165405.533042-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: 0bba2e96-7153-48a3-e4db-08da5474d85b 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: EKemXkhJMqlj0PbywUhNmBQxweNdpR8q2p5gZNw+BpNTIqGi20AbTRFaXa2tlQi4HJk7eCbMqVu5w4oA2fh9yJwcorH5lh9rt+miGJRKGusqTZEg5iz5Xt6Ztqiw0kt4Ad9w8W8Es7azsYS3qKynNxUjQYl7rgWBXYWEuVx7yTMqWVRj3d4uvdrB3jl21jMOuJKbVMeEz7Ga7CVdALQz9CC4pGSLolNUAM9d9eevC8NjcIwJs4tkZlPULUg22LADzPrBp75DBuYqfGGqHnuVC2T1NU+qNMCYcViuNwBhZw8hrzrAELqqctw8GMgC9c5QKuEstDFkr/p1HQujnxPBcdfeOU8gqpI4cIuPBl6lT2Q+q6RBKjkutDzjEXuAx5CsndbT8K9qywpSUOpBGhgjEryVcQAh7dzE8XunFsiEc0jiRzgnFq/B7RkvN9MSWthrMJl55NrS3u4aFGg7HJ4i8xSPjdEaha/eZoIksRKm6KPJXvzsbeYf/P8xzssQvXzKzcm4qyksxsXjXaY13x/Q1z2eQmJcQcnOVti8v2K+6CbpvZMLl7CYH/eQiYk229N2h4NgDbnkbznCTwmg/z3xguxB1GsprDZichSlJTd+FGjfAhx42XE35liFrYwWDgm0maKsZ8IQAP/JVCj+M9plg45DyGpJ1RbRJaRLVQjJVp/Wkw0apkPXGXr3gRpV3z72vbOmUVrlh8jxV9NnfwjPMGnygROL5chq7xmPGccDUI05EL1Kg5dmHSy6hw0+WF5HkpxVhQq3hsfxBH2UE4eStA== 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?j9KKvf8DPSYp0j6/myWyrnh07F03l4mlrt7zJWmj5J4tjOABtoWqdPKuFgPQ?= =?us-ascii?Q?TumKZEbU4ioJb4bK6UBo/CDBF9E+62hNfLv/gNIZT8nsHNmHLNY5+OcY9nOR?= =?us-ascii?Q?e7L349GBACRzUTYTokpSO2cQL/fZRyQaj3hjxfQMzFljtea7wgyUZK0YzEku?= =?us-ascii?Q?X3TLPe0BnOSOuOAa9VOGqOQDVX3f598gNcaMYk5PWBrFZxBXzkIzGeF/oBXp?= =?us-ascii?Q?W4pWLDAOFhldJPWwGIvWGOi8A4cEjLFeb09QXMnp4iy60bs2VK60OpPXMGJL?= =?us-ascii?Q?aWvus7X8dM08dNDvjYxTntr3R/VIAI7SjiTg8GJrj/o3LXipvhxtuuRQtIUJ?= =?us-ascii?Q?S+h2PcZ38N+hk6FNl2VylQsnmwcGdjtUtFHuv5p7O0vvUGKq6rFKhjexFB/H?= =?us-ascii?Q?8XhfFpEJaoSf1ZFBFYgQv9f4pOigsPG7SBQvY+nZRdc+dESdv/6gZj1K07NX?= =?us-ascii?Q?/Uo9Q0aCDH/uaUCRuFGXUHgfvELZTSsxiV0OtLnpU5S4hOPUjPV5B9kwYxZx?= =?us-ascii?Q?MBHidp4+XvUXZAsfc+7t+eRfRrSyjj0PeBzUP2dmZ3tZTtaDCQ7e9BcdpT4G?= =?us-ascii?Q?PgymTJ286ryxHKliM4LgrQ8KBDpnq7cUADBSR9leqlS7wya0YtLm3qOiLteD?= =?us-ascii?Q?cl2DtW4lXyAotluIqRkBRuGyCHpRDRwCh0BjHECWC74R678W6Ds9WlQWFwor?= =?us-ascii?Q?rwoXil3uLadM501PL3kT/xXO2+6NicyMCQeIfWZK2PjocAGHBH7vHgNrvLrY?= =?us-ascii?Q?WesJ3yFiB8JwpXm/mL1M0WLP+HN9Usxm4bCpVChak78jDR8QMdM6t8u4LuZd?= =?us-ascii?Q?XW3w0zY80sBd015jNNVA+vlsOtZsJ5lIzT22rk/SvRq4XkZUioGHQNvIwtrP?= =?us-ascii?Q?p5HEGxeooXo1QyUDFCPCAASke6Kt4Q7STbcQhwc2rdy0agAIlNwQ/e4v91e8?= =?us-ascii?Q?+/NluAC8fedTcm610GLPv9AuKG2gaaCbsW9I134ALRQt7bG0Ve1G17usq5Qt?= =?us-ascii?Q?spvtuDHjs+Abxq3a929TtBuh6PLYoPdFWl+V3b6JVx/Xh253hWkpfx9dsc9d?= =?us-ascii?Q?rhvF0JvA52ivBvWPzw82OjyDsVtToWRmunndXjun78X2MJyYandVl2uu4Eaz?= =?us-ascii?Q?xm3ZR/DKFHQt2gRjFUMuVYt9pBlYtOFTNxNbU+pUYE6etx6tZcLVoXJ47Wo5?= =?us-ascii?Q?nkkdwJvIDxSX/FLqjRACyag/BfaiRqDCfhucCYEnXtn5lHnbVkU5agERsPv8?= =?us-ascii?Q?Sms+P0tSTGxgYpts6Pw4X7wlIw+TevtPk5yH4EExa2vD+KlBxrRXkHx/JmZB?= =?us-ascii?Q?ahwoYd/kU3xxpKJX4kYaebspxm/E3WbNG3RQKU47tgLfAMU49lOJ+ghc727i?= =?us-ascii?Q?JD9x9VBhXPUhUn0lxkrqnqakW7UyXzArnBKFnr/GmCfwaTvbhaG+Ui45V5QF?= =?us-ascii?Q?jNsmMycg1qhyTNAaTgSOhfdOKqRzUMdRdT3BWfcUOqXLswxzCknpsgPOIpDa?= =?us-ascii?Q?7JFzo7vrLoNekTttKiIdGLo8f06rUhDvhQVtGKZGd982ACFYUp1RP+HFwKmv?= =?us-ascii?Q?305+PPw5V4yv+V1KNLy1mHESFWuQuFI+c9fhi8Ygc6R9ZGJFPK4zfbIkKPmx?= =?us-ascii?Q?ozlpk1JzhWsA0QdB7q1oQ4MmiiWnpuyZFgSgqKhY/XETUc4rwkUd6Bfcg43p?= =?us-ascii?Q?LEgDJKb2z5+huStg80BxYY6qofhu+q37Z1qsRnH7i809u6y7n3xFWJv9Uvow?= =?us-ascii?Q?r3iX1Q+ZJZHtQVTOnYqLAIHlA0KjO2k=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: 0bba2e96-7153-48a3-e4db-08da5474d85b X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2022 17:30:04.8874 (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: zWe4wX8qBWCkTw3bDqdTzB+bhqz2e5Av8afoSSpsTHuubSCa4fcqSpz7A/Vo6NV8IIlPSSirrPoat82L6s1fC0fAlniDa3xntszCPGo2qK8= 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 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 > --- > lib/eventdev/eventdev_pmd.h | 23 +++++++ > lib/eventdev/rte_event_eth_tx_adapter.c | 102 > +++++++++++++++++++++++++++++++- > lib/eventdev/rte_event_eth_tx_adapter.h | 24 ++++++++ > lib/eventdev/version.map | 1 + > 4 files changed, 148 insertions(+), 2 deletions(-) >=20 > diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h > index c58ba05..f514a37 100644 > --- a/lib/eventdev/eventdev_pmd.h > +++ b/lib/eventdev/eventdev_pmd.h > @@ -1274,6 +1274,27 @@ typedef int > (*eventdev_eth_tx_adapter_stats_get_t)( > typedef int (*eventdev_eth_tx_adapter_stats_reset_t)(uint8_t id, > const struct rte_eventdev *dev); >=20 > +/** > + * Get TX adapter instance id for TX queue > + * > + * @param eth_dev_id > + * Port identifier of Ethernet device > + * > + * @param tx_queue_id > + * Ethernet device TX queue index > + * > + * @param[out] txa_inst_id > + * Pointer to TX adapter instance identifier > + * Contains valid Tx adapter instance id when return value is 0 > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +typedef int (*eventdev_eth_tx_adapter_instance_get_t) > + (uint16_t eth_dev_id, uint16_t tx_queue_id, uint8_t *txa_inst_id); > + > + > /** Event device operations function pointer table */ struct eventdev_o= ps { > eventdev_info_get_t dev_infos_get; /**< Get device info. */ > @@ -1386,6 +1407,8 @@ struct eventdev_ops { > /**< Get eth Tx adapter statistics */ > eventdev_eth_tx_adapter_stats_reset_t > eth_tx_adapter_stats_reset; > /**< Reset eth Tx adapter statistics */ > + eventdev_eth_tx_adapter_instance_get_t > eth_tx_adapter_instance_get; > + /**< Get Tx adapter instance id for Tx queue */ >=20 > eventdev_selftest dev_selftest; > /**< Start eventdev Selftest */ > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c > b/lib/eventdev/rte_event_eth_tx_adapter.c > index c700fb7..44a60cc 100644 > --- a/lib/eventdev/rte_event_eth_tx_adapter.c > +++ b/lib/eventdev/rte_event_eth_tx_adapter.c > @@ -18,6 +18,9 @@ > #define TXA_INVALID_DEV_ID INT32_C(-1) > #define TXA_INVALID_SERVICE_ID INT64_C(-1) >=20 > +#define TXA_ADAPTER_ARRAY "txa_adapter_array" > +#define TXA_SERVICE_DATA_ARRAY "txa_service_data_array" > + > #define txa_evdev(id) (&rte_eventdevs[txa_dev_id_array[(id)]]) >=20 > #define txa_dev_caps_get(id) txa_evdev((id))->dev_ops- > >eth_tx_adapter_caps_get > @@ -41,6 +44,9 @@ >=20 > #define txa_dev_stats_get(t) txa_evdev(t)->dev_ops- > >eth_tx_adapter_stats_get >=20 > +#define txa_dev_instance_get(id) \ > + txa_evdev(id)->dev_ops- > >eth_tx_adapter_instance_get > + > #define RTE_EVENT_ETH_TX_ADAPTER_ID_VALID_OR_ERR_RET(id, retval) \ > do { \ > if (!txa_valid_id(id)) { \ > @@ -194,12 +200,34 @@ txa_memzone_array_get(const char *name, > unsigned int elt_size, int nb_elems) } >=20 > static int > +txa_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; > + } > + > + 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) > @@ -222,12 +250,18 @@ static int > txa_service_data_init(void) > { > if (txa_service_data_array =3D=3D NULL) { > + int i; > + > txa_service_data_array =3D > - > txa_memzone_array_get("txa_service_data_array", > + > txa_memzone_array_get(TXA_SERVICE_DATA_ARRAY, > sizeof(*txa_service_data_array), >=20 > RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE); > if (txa_service_data_array =3D=3D NULL) > return -ENOMEM; > + > + /* Reset the txa service pointers */ > + for (i =3D 0; i < > RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE; i++) > + txa_service_data_array[i] =3D NULL; > } >=20 > return 0; > @@ -1218,3 +1252,67 @@ 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 id; > + int ret =3D -EINVAL; > + uint32_t caps; > + struct txa_service_data *txa; > + > + if (txa_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; > + } > + > + /* Iterate through all Tx adapter instances */ > + for (id =3D 0; id < RTE_EVENT_ETH_TX_ADAPTER_MAX_INSTANCE; > id++) { > + txa =3D txa_service_id_to_data(id); > + if (!txa) > + continue; > + > + caps =3D 0; > + if (rte_event_eth_tx_adapter_caps_get(txa->eventdev_id, > + eth_dev_id, > + &caps)) > + continue; > + > + if (caps & > RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT) { > + ret =3D txa_dev_instance_get(id) ? > + > txa_dev_instance_get(id)(eth_dev_id, > + tx_queue_id, > + txa_inst_id) > + : -EINVAL; > + if (ret =3D=3D 0) > + return ret; > + } else { > + struct rte_eth_dev *eth_dev; > + > + eth_dev =3D &rte_eth_devices[eth_dev_id]; > + > + if (txa_service_is_queue_added(txa, eth_dev, > + tx_queue_id)) { > + *txa_inst_id =3D txa->id; > + return 0; > + } > + } > + } > + > + return -EINVAL; > +} > diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h > b/lib/eventdev/rte_event_eth_tx_adapter.h > index 3908c2d..9432b74 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,29 @@ 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 TX adapter instance identifier > + * Contains valid Tx adapter instance id when return value is 0 > + * > + * @return > + * - 0: Success > + * - <0: Error code on failure > + */ > +__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 > d1ecda4..dd9255c 100644 > --- a/lib/eventdev/version.map > +++ b/lib/eventdev/version.map > @@ -111,6 +111,7 @@ EXPERIMENTAL { >=20 > # added in 22.07 > rte_event_eth_rx_adapter_instance_get; > + rte_event_eth_tx_adapter_instance_get; > rte_event_port_quiesce; > rte_event_queue_attr_set; > }; > -- > 2.6.4