From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0057.outbound.protection.outlook.com [104.47.34.57]) by dpdk.org (Postfix) with ESMTP id 5BCA81D8CE for ; Fri, 15 Jun 2018 05:46:06 +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=OqHKMkX/V1ZtLiM0W/QPf8nG8BrUv6ij0LMA6U3B1oc=; b=cHRomzJ+CrUTYEhNtxpVP2tGOZJbTCY5VaDESpe+siQM70KfEY2K1bLw5RV4C6Bnl9ZGPawNK5GwrFwlxQz4KDW82bn77Wdu7rlYAohvGGgHQABT4RJpN5s/1bINGqiAUUwjmzbPaYmVXwt5whMQsFh83F7irsStiFhNfFAKUs0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3462.namprd07.prod.outlook.com (2603:10b6:910:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Fri, 15 Jun 2018 03:46:03 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 15 Jun 2018 09:15:24 +0530 Message-Id: <20180615034524.28623-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR0101CA0014.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:21::24) To CY4PR07MB3462.namprd07.prod.outlook.com (2603:10b6:910:75::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 794d0974-10a5-44d0-4226-08d5d2728533 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 3:mi3CQl47N7jKpmHPHPPwhq8Reso6puf2Qxmre0qsimlYoody41ALYYTS6eAXo78rT2vX6NJakzMTMkoYegmPLfKBL88RsjNrPYKNn9/GEQ9Wqu83D0/+ocQshpqPRoSdS5D/Fi+rdN9Beoh4WIanZ3OIvlXjqjR02Blutmle6V6g0j8ViMw2ZnklkFc9pSq9ss3hkaRgNTDJzihAhS4YCVJZFHvbKQdczbiKRKSux3oDtMQyeWm12YdJduv3qvzx; 25:IJw8alXtfvnraBzr4+q4C6c0plYv5D78F/nANkCmisoYF1sNY+o13f0QkkrmaLhJOCOpR4R8tdlZHadPVpqNeTxNshTRFrOwN7kZ2+HbtzmzKsHwlVp0Syz9T9OcAuRZwOktW7QhI/hpjVs3drDXLEIwfKg/8nlLGrG7Bpqh+mUg+lqihtgjVDOnKlOgna82utRzMOumNsAqJM5z+lJ+2z8cJ7ADFcspg6gn/ir+mWSvo5QOzNdCcVj5CxRzvFrt06jSfnVRDgBJ5TdtNq/L7JHdI0D0N91o9fsrk9a715yWo3qk/4PIaL+TMlANA41F0gkpcZ3HMvyWsXepf0c0xA==; 31:itcCXKUeX7geDAJ3pQ7/4rq/fICFeDcoyiAfF2FpQMpewUeaxbWdvoMnJhqp6XFt3WskvISlzs/FrD7prTueHF6xmsvZAgrxJLUqXz1NsvduNyHUA1VUqzVvYSinWtEZD2WMHvZBYWWU31YZx8069fijp8BjT8rpukzXUFkFt/YgOHiuoY1jANhhrRcdnUjNUGNZ58MakD26qAtVZFkqAFZdeGyl/0rvYP6m6fo8k9Y= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:y4kOAX/3b7HIIzW8gu7IpP+hfJ87rloEnYddMj402BbnAIBV1Fw97Vb2GotHXhkY4ROv/KY0PFakflqQt3sNe59qRO/mz2rI4JYfOYtPMRmVTbmkmAl7hdOyInSCCTx926qmJzGgsr0d5cnZb1TZq/5JFn2UUxSrutigVZegywqeZcSWz3Nwx4XaTX2pA8wfmY8NGB++PuWkuPF9evoIW/6A55eWL0kKTvifO21yj3TA0/l3v2gemRZZOJrAi+jpBdZ6VpzGw/56Ximba+vgemiW4DCiegajJ6CQ8PIWuFNXB14625ZV6OZSBcVAbndBCY/+CJSzr6Wt4D2yCschh8kLWhs+4VTRepnFFJEiy8B0Rtm24AAGLm4aFAbVmHOxa8uGk9SRGOTcl5mOcp035eg0460DFd2MZMSIgGbOJOMWMz8Fzavyly4wIy4MmAl0O9uDTKy/QvjaXUuuOMbAMMxAkxOdePKTBt/n6m5FwvaOBBweRH8mhSwpg6ks6figmeatRQU8W4I2/1hc+l8mVr9oWTVHntb6Odj6RkP5733kUVwSHEx5WF8LSi0L8qC9zeYIRiqRoaAGr5smxWTjmhXfMLTe837kZ6bdFI89KsA=; 4:9G67Zg9Ahlc+hRG+nVE3vKT2dk38ZdKpCM7gB8qmxeHQ1XKB8ytRCLjjPP9uo7/xWcUxWsMbmAaPKdyXNEFTO3CFwuQBrBtjZigc3KDQGath3ZSQ21/66asmhx5Z/CsHSFJcV4rcpSPkPc40+2KAldG0yolZZk18JjSRdr6rhigwD5MmMbYGGkF0p2TWufAL9oZJhmm2wNAXnv3O2Z6dMDksi0mBTEq1ai1/PeHvzjBEZANjQ4qj+onf4gdO59sKLSyE/Pa0LOqCxKSU8BV9ow== 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)(3231254)(944501410)(52105095)(3002001)(93006095)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB3462; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3462; X-Forefront-PRVS: 0704670F76 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(39860400002)(346002)(39380400002)(376002)(366004)(396003)(189003)(199004)(8676002)(42882007)(7736002)(2906002)(6512007)(97736004)(37006003)(81156014)(81166006)(1857600001)(316002)(305945005)(16586007)(25786009)(1076002)(26005)(5660300001)(16526019)(6116002)(3846002)(2361001)(48376002)(6666003)(50466002)(6636002)(6506007)(386003)(72206003)(478600001)(50226002)(34206002)(5890100001)(486006)(4326008)(36756003)(476003)(59450400001)(107886003)(5009440100003)(105586002)(68736007)(15650500001)(8936002)(66066001)(47776003)(106356001)(956004)(51416003)(52116002)(6486002)(2616005)(53936002)(2351001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3462; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3462; 23:hwL0EQn4yBPGqyCYvtDE97TaRPQg745tU5O6uk8mj?= =?us-ascii?Q?ec522yCCPgRwXGGnmsJoiw4TbiEX+BPaaJIvHWMa7IbjaqIvT/bQNuzq01aP?= =?us-ascii?Q?pikSn7HUTT+DIezB0RTNYJnJuTZqCfUUC17u/reO1+6ggrcpHun+OGZNEWMv?= =?us-ascii?Q?2hY35fy0hacY6rdj1JZslT4bpjTvGW4LqFwQgHylelnnMdYPDvJJQkw5jhni?= =?us-ascii?Q?ik7w7uehIg4/zn95qXrrOuFzZpTSSoY7bN9pdQggdIU6pPN9VmjR+rYWMdYG?= =?us-ascii?Q?z32JhcOQhywi+DUZ1hWBB/Bz/NznXXWZifPu6v/msnK1qFvr43DlIW6f2Ntm?= =?us-asc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K6AVUI/1qFJSIkUV9ckre6nqIpai7AIN3IIntSKcSRYpnKqcUENgUY3+gNmb2N6lhRRg9M2bSqzSHc3W/Vk=; 24:H5xwCJ8ggWoU2mcI0g95YTtYmxWpHmr58h+CUTRQPY1ZFg9vjRhtnTBkTWVovHwFokS+iMZO0zpqUXRoZOj0+/GcvMkKqruoKzQpmk4edoY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 7:h9IcahMeeRlNdvBlf+Qba2v039BRNvg+EuTBbsUOEhAEjlGvBo1FTN94TaLL6vcbSeU7lpDGD0MoEjKzfxKzo7M0L1OMsvD1ApTPSf1volO5opd9aM9BkMNzLUolmKWQr/paYL8Z3/HFTQ83alvjQNwy9qO2+RQWQsQEyMrDjU8wNLyPil19H3ANZ7Eo8qlsYks+RG3MWls9CpnVo5F1kyjZNkFJBPbhdK6DgiXy1ak3EXx6BFt1jjIpsMM8BGjp X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2018 03:46:03.0783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 794d0974-10a5-44d0-4226-08d5d2728533 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3462 Subject: [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: Fri, 15 Jun 2018 03:46:07 -0000 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 --- 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