From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0086.outbound.protection.outlook.com [104.47.34.86]) by dpdk.org (Postfix) with ESMTP id 253531B481 for ; Sun, 17 Jun 2018 16:32:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mwoo5dAvR6Uk1pxf1DFmlCort2j3D8kQUnrSj/13x1U=; b=kXYizg2a7RRruUaUkJa7+LCXgVXkANuFDBhC9r9jkH0X1dwEGVXF1crIBLa640YJjK2KtdRFEUJjveaIgCL9OriK4FaoIv7/b13Qmtbfos/8pxnfvLBwwx0hdyVlqTio+82FWz8t6hTw9kNSabVij3mLMQPpxICFb/6ZqaoRaJA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (171.61.94.72) by SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.17; Sun, 17 Jun 2018 14:32:06 +0000 Date: Sun, 17 Jun 2018 20:01:51 +0530 From: Jerin Jacob To: Pavan Nikhilesh Cc: dev@dpdk.org Message-ID: <20180617143150.GB27164@jerin> References: <20180615034524.28623-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180615034524.28623-1-pbhagavatula@caviumnetworks.com> User-Agent: Mutt/1.10.0 (2018-05-17) X-Originating-IP: [171.61.94.72] X-ClientProxiedBy: MA1PR01CA0100.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::16) To SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42cd9449-51bc-404d-31c5-08d5d45f1aae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 3:Y4YIhsx7Z+Y6Bq60TYO6arYBFC59F77VCyLw9m96327zsDfsbtbzNMgoLDttNQoksyMd8nQzCkmc70/2HYhi5+PTRNp1nKzij8sGwMJXe4y+8u00ITcnISeXM1U3niost/FcydA5N1MNaxMZ0Zfhcgrz59VGbQv2OYI8YGb3fV05U1TR+iwOXUWOsqwG9XQM/bWM+gR2jhpE/FM52ktwiUiyosPRwGQKy/CFv3RXc713J2Y8+rnyzPMJ22Sp6jBe; 25:e2SPkB8uXUUoS+Bp5qeYsqO29Kdy33ziSIMyOtquxCkdu+jymFiFv1OHptM9eEtwd5nnjyLwO1DM/DhK8F12vaY/0RBmD2X2ockNWm011lw587Tv+Y4jjXrX6UheRtCNADEySB/vkNe+sj4OkAUnnJcK9O1lG5ZV9Bctjd5I29RW3AliuWANWrI49YBvVe9fy4W6u8OTq+70JYoGwUKDLjwzhwZ3AmWXuv6L9HtWGZLWMv9rmGrkrpMnFvPWxmBK1sYAs1VyCAlsM7bDM2TnI0yzoWQRL37UdOEG3qafJigJgbMlkhJ366GuCTSxe/k1SqM1X1U7nPxz1wLefx/2nw==; 31:zntpQyrmXqZONuZIaoEHiRbFEMaG3syO+hKg0xTJZ1MO5TXp5RTrnKdxU0kFI5T8Y6Sp6eUMNG6Iu0SOTSyZhF8bmQ/52kBZOiw/aaXKt1IPSAqFhgfe17AVYbZdLR2Xh/6npynhwCgRduXCroMJejx2THAddfI+v7SXjHtU7dvL7wtb6lL5nJ5/GbvmQrVh4kBAZ4lt1CwG47asevvF1GDzYb9MIaqbXslcKp9gIb4= X-MS-TrafficTypeDiagnostic: SN2PR07MB2526: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 20:buoLuDSqOh2fQ/DHJerUqqhfPYWwikKjAtuGHb8k9ANzNvxb13z6vdW6y7TSOFkgKKBYdkbLUbiMpHObzZkOrk1noWOq6oXIIxdFBTsG7Ltg5CII+wLx1mV2zbxnuVN4abi/oouXJeXXr+gjuPL5VAV2mrTwIxzTwOxTBbvjQdtradA4Bn0lBzF730mIEoYPPbMBg42x01+2xSsWztOwpoY/gcvvxwAu3QGeBldQTE/N32883uHaQjnSNP5ji7+TsJP8KJHvpMiD95SpwoD0OQk3XCODAAO6YgjKT0Lwc3z48l8Qf5TqC3m/0Eq7opH/feDYGcVbwRxadq0pPMgRtSon56YX56DRg7WVSQEa/PQucfM15JKa9nvuusM+9ETf61UqPkUMgycbyhDveOuZ+NfyBiAzjWiSkEkjwM2RvoqcvlWQzGohDREz4pWULSwuSq3f9TkbUbUsv7Rnc5c5E0YkxHL8/M9i3cXE3HK2B9JOMeNqBG64W849fK4YkdeH8LFNuG19T7QtjiyUuQ3HUlccoLzlKMaNfylzT8ez0XLLWda/iaHZxFYKeMZhU/SUlAGl3bZp9kff4YSXN62k50KWV6IhgTQPhUp+o4j1wiI=; 4:5vRL38ThQ+zjikF4AROgM171eIKoebNhar15niS80fhaZ/W7X/rmF7DMWBflYQGuKCsgxE97Pp8SrhIu13J6d0fBhMzq7OY2GuOS7hjpwCSB3uvlUY9yO9so5QrEnZWcX7ewiawxhORigw/nYIEhaKVImsnGQj+CQ0ZKZ0lWs15PsTQLAIXNT+0kdvHIIHs6pB9DfOvH00UFuDavmErOqsTb0EhS5RHfIh0stZJp2kAXriuky1II1VQHZStaa8N9BuL7dbH3aeNU7Hqa3iiysg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:SN2PR07MB2526; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2526; X-Forefront-PRVS: 07063A0A30 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(396003)(39850400004)(39380400002)(346002)(13464003)(199004)(189003)(97736004)(3846002)(33896004)(6496006)(55016002)(59450400001)(23726003)(47776003)(16526019)(52116002)(76176011)(8936002)(386003)(6116002)(9686003)(81156014)(16586007)(106356001)(316002)(81166006)(66066001)(1076002)(229853002)(8676002)(4326008)(68736007)(58126008)(26005)(2906002)(305945005)(486006)(446003)(44832011)(6636002)(33716001)(7736002)(11346002)(42882007)(50466002)(478600001)(5890100001)(72206003)(5660300001)(15650500001)(6246003)(6666003)(105586002)(476003)(25786009)(53936002)(6862004)(33656002)(956004)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2526; H:jerin; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR07MB2526; 23:/9UCXCHOrzTryiGSFkyGfg8FT0obKbB4PtsJ2Zo+6?= =?us-ascii?Q?4e7Ymyr1dOlKFx1ao3CbKB8laBPeUs3ry3uDLhrK5oZ9ccCDOmprGdtA0lQO?= =?us-ascii?Q?oDSO9bXqoaTtxxCJ34sbvUtngT/KUOYeAdrTv94Ea0CSCynJdVojhF9N43KV?= =?us-ascii?Q?Qj/drhMjSlxnQYqSBM+PSv4r/iSh2mUF+2U3iUgkhPuUcAvQO14lULFymkR0?= =?us-ascii?Q?fax+jR4cf2eOoecwVExDZVryVc0+2zi5rDCutyqWu7x4B+l0UZ5OucvV/G5u?= =?us-ascii?Q?PtHH3G6C2o1kHezg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lg7UiWZaFQ+3+MRFVnX8kkcgXqE7vCSiDzYQ6hzkaXYRNAQYzp6A3bi5n+QDqtc+FkzMAiaOnW0wLZgQ+nHqJ1zjvGclcRsAub2wdR3JyN7oTq2LZIECZxIaBvXEN5OKx8LWrIFYIWsgFU2jzaqZFb+zVWmTHD92Y=; 24:lcV6+/hyEAXH78P7z5CkN2o4sw5sntP1dmO9TmTAsMtQTII77afKiUJTCVK5au2U9XmwOjU3dh3IvE/djAaW+BrVa0CP0RyajIUI8q6j9/o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 7:a7SXkecs656xk6Yn8d1FoHrt3qEWh4ng1AaIVjPH1m1vnzAIO7zcKDKytrecXQ8tkfQDEAm1DH4TBUIktDV5DdNKJK7ViqPOG/SEWNAbX/obGDh6oAZujrFDyJSOgU+nMAw8AlaFQxmRr3W/r9zxRp/QeZo7wt1M45npyYCRJUwQTNjLCKSJFTGmYZzJV6CXANBDTk8lbXg2s0xjQj/XrfcGLu+RAHZplE+ZVOn0iLf4gXkm4Y2tJMIwCWuS8/c4 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2018 14:32:06.4597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42cd9449-51bc-404d-31c5-08d5d45f1aae X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2526 Subject: Re: [dpdk-dev] [PATCH] eventdev: update get id from name to include PCI devices X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2018 14:32:09 -0000 -----Original Message----- > Date: Fri, 15 Jun 2018 09:15:24 +0530 > From: Pavan Nikhilesh > To: jerin.jacob@caviumnetworks.com > Cc: dev@dpdk.org, Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH] eventdev: update get id from name to include > PCI devices > X-Mailer: git-send-email 2.17.1 > > Currently, rte_event_dev_get_dev_id works only for virtual devices(vdev) > update the function to include devices probed through pci. > > Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob > --- > lib/librte_eventdev/rte_eventdev.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index 7ca9fd145..801810edd 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -57,16 +57,21 @@ int > rte_event_dev_get_dev_id(const char *name) > { > int i; > + uint8_t cmp; > > if (!name) > return -EINVAL; > > - for (i = 0; i < rte_eventdev_globals->nb_devs; i++) > - if ((strcmp(rte_event_devices[i].data->name, name) > - == 0) && > - (rte_event_devices[i].attached == > - RTE_EVENTDEV_ATTACHED)) > + for (i = 0; i < rte_eventdev_globals->nb_devs; i++) { > + cmp = (strncmp(rte_event_devices[i].data->name, name, > + RTE_EVENTDEV_NAME_MAX_LEN) == 0) || > + (rte_event_devices[i].dev ? (strncmp( > + rte_event_devices[i].dev->driver->name, name, > + RTE_EVENTDEV_NAME_MAX_LEN) == 0) : 0); > + if (cmp && (rte_event_devices[i].attached == > + RTE_EVENTDEV_ATTACHED)) > return i; > + } > return -ENODEV; > } > > -- > 2.17.1 >