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 6438645AEE; Wed, 9 Oct 2024 08:11:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4650440612; Wed, 9 Oct 2024 08:11:25 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2057.outbound.protection.outlook.com [40.107.20.57]) by mails.dpdk.org (Postfix) with ESMTP id 06AB2402BC for ; Wed, 9 Oct 2024 08:11:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iePjQUloU0QYXrqGX9cQP2UYMyAfX8TEGpXV/GROJjX3/ykL6l3g0ssDN1+MWIlEOIWBJDdpza0M7J4Kxf1vstHWW9xUmgKNRW4F5A6su/2RTeC74hxmB1EodLxk00gF8KFqnVV9GJiIeCDHsmHzdzSPh5iJOLY9JBTtt523bsFozqjjLHSsE+Y8QItKYEkrUFCf4+RMejN79MMm7jUFSN+KG81G60Bl012EB2r/pCBtBKfItYU8V1jKwmv1dSjsG1yQt5lzl3pD7QMMHR25o14p2eLdDpRKLdzc3zL7l83ne6QRVgz2a4zr7XqgnAXRBfvS1VrgObH5z/JMT3PGHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=bvPf8NOUwGGjIhaMJY94NXudhTm4TpjY++V9HXHpC8I=; b=tKbzqdq/h2FC3pQa9EiceNVvDt63Nza9QisfCDpT3wlvwW2e4nGo1yGWyqfhLtrOMmATrpL2dXGDeAacCWY781dMWaMr3wSAvqfznDr7EjLSO90YCi3M94TOpWfNkzDI3+k99QAWgzxDCGCqytrLIwkm1Q9ldyA65Ifi6tkhi2REkKlQnb6sFG3gJ7XQfyubd/p+oGSQ1FbToKsjhfz/IMifu2gT2MssyiQeLMRu59f82bmYkdiYn61lIPzWF4vzLidEDq/h2a1TFnw4l+emxNkmKm3iEtxcnyTQJIK7qF3jP4HdxAGGj3FK7AYgEE8styH4tIXlfaMUgy6KWeQ0Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bvPf8NOUwGGjIhaMJY94NXudhTm4TpjY++V9HXHpC8I=; b=KYM+AWWQujyJ86XZrdVoKJskIwXcVLKSVbUakHMqmWhhZ2nILt4WpT3MuopNUhaoULn4D2dcIaLMlnHyUuA7OxqGLsJ75lay18OHUC5pUtq8FZUZpeXn21daOx4M8D9oM4pzTwAsiO6CrRLQdjpW7fkyMV3JU/mYM/dBfzTXSXyOpQaus8qrSaKh1JO/iDC+Z3UT3EaLjidDVkTqDtAN7SOI2gtClDLZXl761yiZ2rcMFLSr3LZzXRkqg6xRutNKUDAx4zNcCPwUEa/BWi4FkxgCNFLcDwZg3pm4wcvfPjHd/rnxwwmAOwDEm7/6N9gstKoZGJB3oitItrjtMrHPvQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by PA4PR04MB8015.eurprd04.prod.outlook.com (2603:10a6:102:c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Wed, 9 Oct 2024 06:11:21 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.8026.020; Wed, 9 Oct 2024 06:11:21 +0000 Message-ID: <0b8cfb33-b0d4-4a6f-45b2-b634b7292461@oss.nxp.com> Date: Wed, 9 Oct 2024 11:41:15 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH v2] rawdev: add API to get device from index To: Akhil Goyal , dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, hemant.agrawal@nxp.com, jerinj@marvell.com References: <20240907193311.1342310-2-gakhil@marvell.com> <20241008074000.3745855-1-gakhil@marvell.com> Content-Language: en-US From: Hemant Agrawal In-Reply-To: <20241008074000.3745855-1-gakhil@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0171.apcprd01.prod.exchangelabs.com (2603:1096:4:28::27) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|PA4PR04MB8015:EE_ X-MS-Office365-Filtering-Correlation-Id: 2543b194-ac99-4bc6-6175-08dce8293225 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?TXpSaXVJNG53ckZxQjVWTDc5Qm1uM0lTZnArbFFhVTcrdzY0ZTJ6U1VYUnVt?= =?utf-8?B?Qy9iTUQySllrZWpZTjdJN3lWNnJDVjVvcWVaQ3dvcllIR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WJiRHZhRTMxWUlocmFRRjZMcEhyd1ZXWTF5?= =?utf-8?B?RFBNYjh1Nm1tbk43VVJrNExGQmhFT2dhcTJlWW00djVYR0laSHdzaERRQk51?= =?utf-8?B?clNKd0pTU0hQMDVXRVFPbFJvM2srcUFTZFZyMmdEQlF4WGEwRnJYLzdGSTA5?= =?utf-8?B?ZWdBTldMclUzK0FzUlBTWnVpSk9ucVByTzhPV0hua2dQRFpIVFMyNnhxWi9Y?= =?utf-8?B?TkxNV3p1K2VPTWJqSXhIQjJEZ3RSS1YvanVOcXhZYnI2SFZJcCtDVTVsSys0?= =?utf-8?B?OTk2a0JkcDNYaGN0SzFJNHVIZlRtYzdMdS83TUhkWHZ3WFdyNkRLQlFrY1Zl?= =?utf-8?B?QUU4T3BuVG16WWZxdWlGNERQVFpYOVFjeGJvUm9EdmVRQ1I3VSt5UzJaK3Zx?= =?utf-8?B?bkx4cGlJQjQrUXBsUVlVc0dpUlNlTG5yRUU4d3AvajJMNXdYSFFlbkhUOTMz?= =?utf-8?B?Vk5XL0FuMll2dVdSSXVSWVVGOTl2YjQ1aTIxUVAwUVRrdTlqL2pWY1lSSDJQ?= =?utf-8?B?bkZpWk1YUHNrQis4Um12N3BmYjB2ZTNCVHBoanlrMUJod3FQOFcrd2VIY3VB?= =?utf-8?B?V2JhWnBMNWJnbndSSXJvejVVazR6K3YxRWlJc0tLaW5xdFRTcGV3d0pqSHRE?= =?utf-8?B?YWpVWUdGWnQ4b0phb3lCajJBZDIvZEFjbnJqU1huM2FheVA0SElSYnh4ZkRa?= =?utf-8?B?VmoxbGt1WWswcUo4UW9UM3dWTUhZdmowczNPcTZxWElORmZ4b1lNc3lnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-A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?utf-8?B?enNmc2Q1eDhVV1BnU243UkxKSmNOMy9PQUw5am1BQTFFQVlnZHZ5SkpNVjls?= =?utf-8?B?NzZ2dGVGUXJjaW90ZkplaTNBZ3hBdFY1UVp2T0VjZzRBL2hoeVd6ZERUMncz?= =?utf-8?B?ZUJiZjMwYWhSc0Y4UHBsSWU3M3NUUHZVc2tyZ09lclB0YmhHNk5vRkt4VnNJ?= =?utf-8?B?K3UxQnZqZUxwSXhta0ZjMmgzTzNWQVlZL25XMWlzUjl0Q1k2VW1Hd0JXUzVB?= =?utf-8?B?REZBcUlQY2JOUmRLT3RrY1YrNVgzV2RUZFJqRlh5aHZXS2JpYURVZis4eEwv?= =?utf-8?B?MTZzL2ZMamphOFBzZ3RHWkNRUFgzVTdYbDJxY1MrNVgyZlZxcmFpY1FscHlJ?= =?utf-8?B?UCtHMkpZYktyWFlJVFJsOE8zVE4yUHljU3RnSXpKNGl6T0ozekhLN0NmeDlp?= =?utf-8?B?UUE9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2543b194-ac99-4bc6-6175-08dce8293225 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2024 06:11:21.6139 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oiL2yBf4aBizsxPwoAkCeNwEK27BlEepgK9ltkBTa7PslA607if0HU1dr1Q6io6VtM/IQhn+BFsyl4JYRINSPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB8015 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:  Hemant Agrawal On 08-10-2024 13:10, Akhil Goyal wrote: > Added an internal API for PMDs to get raw device pointer > from a device id. > > Signed-off-by: Akhil Goyal > --- > - resend patch for main branch separated from rvu_lf raw driver > https://patches.dpdk.org/project/dpdk/list/?series=32949 > > lib/rawdev/rte_rawdev_pmd.h | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/lib/rawdev/rte_rawdev_pmd.h b/lib/rawdev/rte_rawdev_pmd.h > index 22b406444d..8339122348 100644 > --- a/lib/rawdev/rte_rawdev_pmd.h > +++ b/lib/rawdev/rte_rawdev_pmd.h > @@ -102,6 +102,30 @@ rte_rawdev_pmd_get_named_dev(const char *name) > return NULL; > } > > +/** > + * Get the rte_rawdev structure device pointer for given device ID. > + * > + * @param dev_id > + * raw device index. > + * > + * @return > + * - The rte_rawdev structure pointer for the given device ID. > + */ > +static inline struct rte_rawdev * > +rte_rawdev_pmd_get_dev(uint8_t dev_id) > +{ > + struct rte_rawdev *dev; > + > + if (dev_id >= RTE_RAWDEV_MAX_DEVS) > + return NULL; > + > + dev = &rte_rawdevs[dev_id]; > + if (dev->attached == RTE_RAWDEV_ATTACHED) > + return dev; > + > + return NULL; > +} > + > /** > * Validate if the raw device index is a valid attached raw device. > *