From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0077.outbound.protection.outlook.com [104.47.42.77]) by dpdk.org (Postfix) with ESMTP id 375482A62 for ; Fri, 1 Dec 2017 09:12:54 +0100 (CET) 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=tyEBMgxmzCzOPDG2zlKFwl/oY0akCbs7lyB9jO42pOA=; b=Gutfctu8Qmz04zEJNYD5Qx+9ng+bk6sE9AL+KYiQumYfZZV2J+/BrWS7c0n2o0dKcqjq7+3zEqRV/lA5BIbLJ/Dqg1BNOfg7/oVYV1Y3o+FjhBahDNaazS7Cwqth2IlRazN7frlpryDCYWWelk+vhKnAcfK1ItKD33PcWj1r1LA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin (122.167.100.251) by SN2PR07MB2528.namprd07.prod.outlook.com (2603:10b6:804:7::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Fri, 1 Dec 2017 08:12:50 +0000 Date: Fri, 1 Dec 2017 13:42:35 +0530 From: Jerin Jacob To: Thomas Monjalon Cc: dev@dpdk.org, chaozhu@linux.vnet.ibm.com Message-ID: <20171201081234.GA24936@jerin> References: <20171130214720.30098-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130214720.30098-1-thomas@monjalon.net> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [122.167.100.251] X-ClientProxiedBy: MA1PR0101CA0031.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:22::17) To SN2PR07MB2528.namprd07.prod.outlook.com (2603:10b6:804:7::6) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98575dfc-f5bd-44ba-6401-08d5389351a4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286); SRVR:SN2PR07MB2528; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 3:Ralw5CoqX+Fg4TcAp+BpLhAA5CZi+eqGiNXVIpKZXIhhvxg5zCN8cfmMpwpOAkjGBYAaE5tACCYgjN0Msa5zmelKWRYK9ZSr1kBv2EhIxgz+ojUN9aiSghEPS20dk0h1W8JpQ0GSVVRJ1Q1ekY0OgjECCpsqEvj81Y8wRFd/+fvuXiOCkxY7aWmJRSS43J5wh6EHPc1SzLqIgucm6xbyDXhaK1mRMastSZWoglcJUoX0Bj2BP5LyRd04SYO98RTY; 25:DPl2e1iQHlfhL5M7EcQH3vOgao1Et6o80+xKWFo3iwoCH/71wntyIHs3YDDhxlRw2j6uaIfIIRnjkLB9m/avM3SrUrYuBTWe1s65TXjEpRLLit49ULGOzE8I5eGXMWb/quFLAfLumUfWPlZMusHS66lfjzGuNeEbe3tOhUpZjUo11Ve/cYvIkvkfpLx0Woq1ieJwLKDvxkn62+XfsvwBnRZ6DuXMrNCzNm9c6m5z1IbrI1WJKVOiNX4hk4tshIMRkDaSqrm3L1uWHtKqTwl9FRgaS03yffKiB+ZV0PRvKUa2nP5s97O8aoicTlp7tYUB22qiYIg12CCkMex/4O31gA==; 31:TK0flqNeIr/kMq5OpJHvuzMN5cd/6XIzrA0is4fDHCpBQDfT9eJqgHoGgzi4OoWeEV6rcXS6Dg34dOfmR9GheZl9CrEpsf42s+x1aBFLhIX4T850anDy6+RWD8wXY1GXwuIBN//rQtirKsYkCw1oqiWonOQGzkBKUBclEh3w+STZID9Cj/RSQN5w2yChYY/1IJr+lrDQu4wdfI9o4LqGdEDlFfIC6uz7A3iyHmzSToA= X-MS-TrafficTypeDiagnostic: SN2PR07MB2528: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 20:HvYfSzer/JNB0lrl22DoMhxRTzc035Z4tUZOA2LNbuEeKK8a10GxW8XbERaUKKxz4IncCTZhtShVY0PMYGkn8rYr9gHnPDAyy4zHMAk8lnAZlp+JToOwf14kuKaiF8aiT9XTF+zKT0MxMq/ybtFLFTc4gLKtm6Nde438Lr1HaKAn6IfChK613okProrz5M7Rxvr0esH5dmwp+Beic5SeniN0atEJDBBnfpetjJKyLjhJbsuPemyiAg6fA6DDTAasQBEz2NdNt5YLxtOW9kKgbzVFo8ntIaFyHaD6tl/UrJFw7AjVUFXqnfWcYt/MY6ltS8nUEp9Hn6peUI288ezMGMQgN5XgXVcetpZH3dK+xZ/WrluaPHju/ikVN+4nCSddXODbCnFFtvV8XndiZ/151xPEo5FLxHGIk22HiZYMwjp93mff+t2CMdcdperSJybs3DhSqrQ2F3dr7GTJ71p6+M9QeZ3iAV9y7K3wxYNlYsFx50aJMsiAuZNOdeyxrMqNrp2Drr/HyiAJx5D7eesW4a7Eb7Ar0ITlrOFqVQrfZxu5K8frutZEAaMLTM/fYxLWFVAkIsiqwdBrNjl/9OIic+dwaTjKWcG+CKYlefHV7Yg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(89211679590171)(104084551191319); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3231022)(3002001)(93006095)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:SN2PR07MB2528; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN2PR07MB2528; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2528; 4:uAzlkKvr/TeY3QZw/0qgoknxdwta2KTIlG2cvm5dAKq2elqW7IoA5FDfrWY7dKmU3j25uV9laqoawNKJOsiMhqRs9Wx4GEhRYyNBeAIEXLzI9qUNIbAKM6XZR8nE2a21QdvwnBUVrRpS39rdWH2iupjevDJag2NyMkW851gNwmGQRShJiuC1dH25GpbxYxZAGiKiqHhEVM55U8dQ7rIpV3s0ROFbWm4P81COb+L0xWEnTbxEEE61l4mSBTQgrborVUHgHZT28VwxYmv1EPtdyUiFYSnfY4yRwNnzI91paH7qmCbY8+i3/6kdq2YSAGZXNuXzpuvw5G+2rNBMD+jkLwL3cxjMByVFW/MAf55gVlc= X-Forefront-PRVS: 05087F0C24 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(366004)(199003)(189002)(13464003)(11905935001)(6496006)(6246003)(106356001)(105586002)(53936002)(54356011)(58126008)(16586007)(316002)(81166006)(45080400002)(478600001)(81156014)(4326008)(8676002)(6306002)(83506002)(101416001)(7736002)(2906002)(66066001)(42882006)(6916009)(6666003)(2950100002)(33656002)(76176011)(50466002)(52116002)(16526018)(97736004)(9686003)(68736007)(5660300001)(1076002)(8936002)(55016002)(25786009)(6116002)(3846002)(229853002)(53546010)(305945005)(23726003)(966005)(72206003)(47776003)(33716001)(189998001)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2528; H:jerin; 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; SN2PR07MB2528; 23:A5sIQrqq4NmgFee3R+bro7Eir2aWB0bxWhtWVWpnG?= =?us-ascii?Q?5LciR4rfXAsjNkSWJ+fBi6cSZdScgSN2SeXXCM2o1r8jndZEDtaus8c2Z67z?= =?us-ascii?Q?vpSgmOTp337kZmqzzpyIUozGxfmYDizE+u8tFu97AndY2E674zgJVZWgjjXV?= =?us-ascii?Q?0w250oRiAkK5BQpUmkYTs4aKRRnbGdo9bTsgzkMOKv2zUyEfjIgQvQ3gK7ey?= =?us-ascii?Q?6/T0PG4jSXApjd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PLM=; 7:9jp69R2RloQm4g/CJTUvd52AV810gBdypDuA5TfT+EFLIMzj308Yf9JS8nfpME/ILCaWAGmR95BuFX/MfvmvBUIl2KSzEAs5optrhBYV4IC4fsqpGUS5/wEaRurlpiyoAz8mQVZCNRERZfQnTR0zssv27SUsmHwoYkN9IlwXVkmzkGzdpRNdwBwukx2mV5U08HcwJILhUYH0sTRWLVwCfj1rPNNCn0IOEmu5FB2GKjFFv+LtueKnl+WIPb4hW4mz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2017 08:12:50.9493 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98575dfc-f5bd-44ba-6401-08d5389351a4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2528 Subject: Re: [dpdk-dev] [PATCH] eal/x86: get hypervisor name 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, 01 Dec 2017 08:12:54 -0000 -----Original Message----- > Date: Thu, 30 Nov 2017 22:47:20 +0100 > From: Thomas Monjalon > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] eal/x86: get hypervisor name > X-Mailer: git-send-email 2.15.0 > > The CPUID instruction is catched by hypervisor which can return > a flag indicating one is running, and its name. > > Suggested-by: Stephen Hemminger > Signed-off-by: Thomas Monjalon > --- > warning: to be tested > --- > lib/librte_eal/common/arch/arm/rte_cpuflags.c | 6 +++++ > lib/librte_eal/common/arch/ppc_64/rte_cpuflags.c | 6 +++++ > lib/librte_eal/common/arch/x86/rte_cpuflags.c | 30 ++++++++++++++++++++++ > .../common/include/arch/x86/rte_cpuflags.h | 1 + > .../common/include/generic/rte_cpuflags.h | 14 ++++++++++ > lib/librte_eal/rte_eal_version.map | 9 ++++++- > 6 files changed, 65 insertions(+), 1 deletion(-) > RTE_CPUFLAG_FPU, /**< FPU */ > diff --git a/lib/librte_eal/common/include/generic/rte_cpuflags.h b/lib/librte_eal/common/include/generic/rte_cpuflags.h > index c1c5551fc..3832fb851 100644 > --- a/lib/librte_eal/common/include/generic/rte_cpuflags.h > +++ b/lib/librte_eal/common/include/generic/rte_cpuflags.h > @@ -93,4 +93,18 @@ rte_cpu_check_supported(void); > int > rte_cpu_is_supported(void); > > +enum rte_hypervisor { > + RTE_HYPERVISOR_NONE, > + RTE_HYPERVISOR_KVM, > + RTE_HYPERVISOR_HYPERV, > + RTE_HYPERVISOR_VMWARE, > + RTE_HYPERVISOR_UNKNOWN > +}; > + > +/** > + * Get the type of hypervisor it is running on. > + */ > +enum rte_hypervisor > +rte_hypervisor_get_name(void); Cc: chaozhu@linux.vnet.ibm.com IMO, cpu_flag area is the not the correct abstraction to get the hypervisor name. It is x86 specific. I think, correct usage will be to call hypervisor specific APIs like KVM_GET_API_VERSION https://lwn.net/Articles/658511/ BTW, What is the need for an DPDK application to know the hypervisor name? What action an DPDK application should take based on hypervisor name? if is not interest of data plane application why it needs to be abstracted in DPDK?