From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0078.outbound.protection.outlook.com [104.47.34.78]) by dpdk.org (Postfix) with ESMTP id AB3851E2B for ; Mon, 28 Aug 2017 18:07:13 +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; bh=6U8KCdmjZAymf7co9J8bvAybbTYbmWfOi4H4lIM/HNk=; b=frPDVPJ70lH5Fu4n/QWtqorQj/0d25V+V403YhhJkP4dMENQG6Bd+uWJB3X74Ewo6WrBT/usVx9A/SEwaWV2bi9ZpSWNazd9S10/2J4be9im02l0MGLJ4zooxFBOlfBnxgoofES+h44kOrZ50zJgJa/o7vDXM5TjROMftZzAGAw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.100) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Mon, 28 Aug 2017 16:07:11 +0000 From: Pavan Nikhilesh To: harry.van.haaren@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 28 Aug 2017 21:36:45 +0530 Message-Id: <1503936405-23839-1-git-send-email-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [103.16.71.100] X-ClientProxiedBy: SG2PR0302CA0011.apcprd03.prod.outlook.com (10.170.129.21) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c105717-0c44-4595-db13-08d4ee2ed7fd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:qNmcX72OmoF03MWxrMru8LSJJTFtAE/I30Z9+pQ2d0eXNbNadnyT2mgOyD0IjMz8ekiLyIqhYhTKv2+os5ZNFcmjE9WNk7SZKOmgF6IYzzTMXnAPa2WC270POtHK0EsdFdYme3LMGwV4QmN4FkdF7OK48yy48bfX9AvwXWWgZdobnb0NGA154ocgymVhTjvZ+Hhf/RFL/LGqcC5TeQW8GSKF/iWVMN5jQZmoL5MaLPeR/+wSq2Hr88UoFEtrqETU; 25:s2Ledg7P8o83RJAR5kmBo9CD43lGtyEUz1NUhV9nrnfj9L/K9qKioIS0qqgJRyFu0quCkIO4STudnOjhlPq/IL9j9NQXAZ7KJ0y41JEd2/VvEgH22mFuVhQq+qThvs7FD1gkNhvMWxIaeTb8/Y/l2bTP7DwnYMsB1OdIM8im4Swbyz/ysaphxsuoyY40ouFF1lb0t6LGazxtnpo71wBtvIPhdwehKdaJExaLZWKE6kVqB+xudQGIaVnd6Zntj5M5BfmbaPZuliJ+KcleGL0dQQ8LYLofhZm6jGrAwAWFCCuBdKnOFITGfXkE2Gy9YJiV6XSD7hqD340ljiO08cRT/w==; 31:TwQonN8HxnvIUtuRq00oaHpM7QgMMRNlvDFfkwK36ILoNbROL+AgLFvsqQxMxmGMxn7r9hNSnleE03eonFSUiWymS+aexu7zg+LQJvoanpCkHZwXVoNG4e3LrBWHVO/yVi9hNgtGX+LBDyxeNiTffJ/yhmuWomoYD0sCvMU3az6TO/dTRPe0OGdti3kHXjnrzMHBjZi79ggPXS6Vx+moMRlNhKdYdQEiNA92gDC4y04= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:gftUTDkUvU9KbbU/Jmz+xVq2YRjAYbIodRuHkfbABjmcR3LDyn2cY/mP/YkhFGery/m7/pY73aXJ8Mi6IJfjCudfjGOM+aVxgr98r4te+2sH7Cr1yCzUoioWtip3WY6dGXOQoA9LxiCPuQmcEv+GNdsjBgM5ECqz93lsuigrQeqXNYikqPXwMzhGoSppCN6FAydS/feOk4z/g7JLJ8hA9x+dwFJ/VNccZAP1MjRryqFkTPxeRURw7GXvvOewoLJHaL/4uhzuQBrgCdpjxxX7mozgkmpGNPNawD+Notndm4I3E5RmHrNyokOO88n+ToZdME0Vs9X4a6Rt5BKlbTAiXYvymwiG1+WsFetBbn1QldF0J743DPlr3tUVsL3a7j6sPq6apmTUmRowrLBFx1VP8oycFVdc3kf9XpZA8tPoitrcvN53lJt0xVnVXdBJRR7ZbT5bu9ioi+W0rw4dG9sACSqzbEf4+R09ZDECEch3ZnvfQpVMIlwFWFdPUEC5KZ7GaNlZtjIruAmJzHvOd46ZEiYjlct+xBw3BHTct6j5NQB3/pAPFT0V35m6T0Or3W7iYqWFz7OQco21tnL4k/AeR+v9I+I4nc4FogppGGD3x9I=; 4:nyghR9IOA7mIyMrvcF0oC6xG4LBI8RHm4nrR5SU1y+AvvWCRbeUwwPVzg+G5/seB1wMVJllvm7+qF4vHKFqHp7jNqkJJ0h9ffPrz+mvO09hJH4tCP5uK7Go5ITq6wXMwQ8um9/SkcWOIHevuzLM1E6rFn76L5ChqjTlLQrBTBiEuU28nSjaNo8lcEW7wQEgteRJLUpMUiQ8bqvTYOBe0qMnFsSfoxuMbqz9m0+Qy/FvGGOCsSSq9Gm3d3fg5Wh+J X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(3002001)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0413C9F1ED X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6069001)(6009001)(199003)(189002)(8676002)(50986999)(105586002)(106356001)(101416001)(4326008)(305945005)(50466002)(33646002)(68736007)(189998001)(48376002)(5660300001)(50226002)(2351001)(72206003)(7350300001)(3846002)(6116002)(2361001)(110136004)(42186005)(47776003)(66066001)(5003940100001)(6486002)(6666003)(6506006)(478600001)(42882006)(6916009)(36756003)(25786009)(107886003)(6512007)(97736004)(81156014)(81166006)(7736002)(53936002)(2906002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3464; 23:8J11dy21qlb6v9JQmun2ZSEohd3vsakwRUBLrnjAB?= =?us-ascii?Q?P2Vkwi7Y8JatIxVwwJ03QKM64/AVP2adxx6CLoWhY5mpAlncpJqnhKBlurV6?= =?us-ascii?Q?4njqHzEtB/oJ7OrQ+W2L1FWkAZoRWSEYcirDETBbeDmTaKEb1R03Dkb4FsKv?= =?us-ascii?Q?UOqOg43vIK+xBlOnQisZr2mrTXDg05uVza7utszoG/9emJWWkTjeKskLPct+?= =?us-ascii?Q?EUcH2/JjHAJY7Wi8zhnZwBtBZgCf9zaC2FZ5mNZsy5oaQK1AdCovviIMJmkC?= =?us-ascii?Q?4WWFVZUpv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15Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 6:t4vXDRyE3V+aU/rVEKKvBZUNovLsil0OigBjnFLoTnflIKAIFM08//vK4KwnWfS/wqFrOmgJjX/UiH4k1f4vV1wrvixoRjFLjE39GHUKGv6vKh4eeX6YOfiHXiFK4xBkjcitFdX+gE660FCZHmdZavqska7lYZLbM7pMUtWC+820D0g9f/C1I8n0jw61Cz4mpVOvyLCWIb2/SdL5DIhPOXfqCbFW/V1QANF4Bzc+4Ls2X2Nz/gpUBDmE8PTN5lH1AybMsvuDFt75pZDwq5uRl2sjxtXkN8s0+Pb3q966KPZKQ/TlPI408fydo2W47DlsvBZYteBJjD5qwyaCjxTUYA==; 5:FjcmEs3yKAP654yB8wfZHbzry7AWsenOfuHNGDxxIvDFLN6JJ3XIlTZSXOQrrcLkjo9oa+y5WUUtxDTX6kNFg4QkzYWhf5pB1KVSuzoTXPdpaUX3Lu8rPlX7DbeJ1npohMI3kI1+Q+G/WMFtRQQUUQ==; 24:7ZvkWOckywtRRelmBr7InXoiPIntUrblg9Ab82f3NbXgFFgbkQeI9wlsXK2FEOP11/XDZhkCWn+cSoTSCtarmxo1evZjV5r7jDNG6qxZj6c=; 7:n68eeytgX0Sotc+7np+ZFqj5SqqLe+sYEFz++DL53GjrUyqCDup4Ge6Gs/3U7GntbP0oBFukvqCjCTMUU9fbisCxZbsXxEERrPae0BacWpeK/3FoRQtkNMqt3sdIuB3ZRToDZeUUj/Vuqu986+eLur86o6Ozq4rX4JvfJIGozqb0KfykAOvIUBV0rupszVUlPoax0gVNMwYshiiKuYFaUX9s4p477yKtLyUtIUmSyoI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 16:07:11.3688 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v2] service: add API for service count per lcore 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: Mon, 28 Aug 2017 16:07:14 -0000 This new API returns the number of services that are running on a specific service core. It allows an application to decide which service core to run a new service on. Signed-off-by: Pavan Nikhilesh --- v2 changes: - reword the commit title according to the check-git-log.sh - modify return types - add function to .map file lib/librte_eal/bsdapp/eal/rte_eal_version.map | 7 +++++++ lib/librte_eal/common/include/rte_service.h | 13 +++++++++++++ lib/librte_eal/common/rte_service.c | 13 +++++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 7 +++++++ 4 files changed, 40 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index aac6fd7..5fe8d79 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -237,3 +237,10 @@ EXPERIMENTAL { rte_service_unregister; } DPDK_17.08; + +EXPERIMENTAL { + global: + + rte_service_lcore_count_services; + +} DPDK_17.11; diff --git a/lib/librte_eal/common/include/rte_service.h b/lib/librte_eal/common/include/rte_service.h index 7c6f738..9537ae5 100644 --- a/lib/librte_eal/common/include/rte_service.h +++ b/lib/librte_eal/common/include/rte_service.h @@ -374,6 +374,19 @@ int32_t rte_service_lcore_list(uint32_t array[], uint32_t n); * @warning * @b EXPERIMENTAL: this API may change without prior notice * + * Get the numer of services running on the supplied lcore. + * + * @param Lcore Id of the service core. + * @retval >=0 Number of services registered to this core. + * @retval -EINVAL Invalid lcore provided + * @retval -ENOTSUP The provided lcore is not a service core. + */ +int32_t rte_service_lcore_count_services(uint32_t lcore); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * * Dumps any information available about the service. If service is NULL, * dumps info for all services. */ diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c index 7efb76d..616bad3 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -397,6 +397,19 @@ rte_service_lcore_list(uint32_t array[], uint32_t n) } int32_t +rte_service_lcore_count_services(uint32_t lcore) +{ + if (lcore >= RTE_MAX_LCORE) + return -EINVAL; + + struct core_state *cs = &lcore_states[lcore]; + if (!cs->is_service_core) + return -ENOTSUP; + + return __builtin_popcountll(cs->service_mask); +} + +int32_t rte_service_start_with_defaults(void) { /* create a default mapping from cores to services, then start the diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 3a8f154..e848c45 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -242,3 +242,10 @@ EXPERIMENTAL { rte_service_unregister; } DPDK_17.08; + +EXPERIMENTAL { + global: + + rte_service_lcore_count_services; + +} DPDK_17.11; -- 2.7.4