From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0068.outbound.protection.outlook.com [104.47.32.68]) by dpdk.org (Postfix) with ESMTP id B4E0E5593 for ; Fri, 1 Dec 2017 10:17:26 +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=Yx9e7lPxRx+L8uXYCd+CPvLLq42fKZzmayrtCLJ5i7Q=; b=kkTqrlcVMi9MsZySSnECxLl95wjxzOU2c0r5reENl9cFtOmX0nUWtX1sDjafBb7wErML1+TGencP1yuQGzo9+tHA+h8SCdgFh8bk2Dwry1c4IdYIA8nQAnTSaDkqKl7qxE3doWinTiN7VtkY5o+lLHdeO/ruW+xMBMdc7oPmikY= Received: from jerin (122.167.100.251) by CO2PR07MB2518.namprd07.prod.outlook.com (10.166.200.152) 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 09:17:22 +0000 Date: Fri, 1 Dec 2017 14:47:06 +0530 From: Jerin Jacob To: Thomas Monjalon Cc: dev@dpdk.org, chaozhu@linux.vnet.ibm.com Message-ID: <20171201091705.GA29030@jerin> References: <20171130214720.30098-1-thomas@monjalon.net> <20171201081234.GA24936@jerin> <9012196.L72nSLPZ2J@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9012196.L72nSLPZ2J@xps> User-Agent: Mutt/1.9.1 (2017-09-22) X-Originating-IP: [122.167.100.251] X-ClientProxiedBy: MA1PR0101CA0054.INDPRD01.PROD.OUTLOOK.COM (52.134.136.16) To CO2PR07MB2518.namprd07.prod.outlook.com (10.166.200.152) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9933d6f7-4ad6-4a4f-670e-08d5389c5580 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603286); SRVR:CO2PR07MB2518; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 3:1IIy5cDZfxOC6LpgktXXpcuJY8UnLnSvkQzDs7xFtv+y0bMlLP9dcLfJuA6VeFXLBX+PklUbu6HKVrodN32g+T5FKln2AuBbHUkS30t9Pv3jtK7fwr63954clcKRUDZc2uQZ+l34NJwI2GH1LvCnLADABB+vgu8C/Bf3M138G1l7vLa4bQW6ZkHhYupR1KozCfo91RreackzBen00O1a6hE0auTyfmBkX/iTtPdHKe6tPwteAmWk083eyqvYQtND; 25:wGL4+6C4mym1s7WS/q4UAhdaHqALxY+gbFEyzxwRdedRwATq9Cr2vObmhHKy859Mp+5CTPTKLm7PjqhfZ0HQAf098Q8hlF70JC/asLhaI1tpsTCdPz4gMrrtpzp62610LF7B0ChBG465x2Vmsch+twGZHTsCeALHaXysVM7tnYGzbUXsE7xv1EZfR7tBkbZk8fiQ1+wRVpnSIHT2+7yCNjbaEiZXenThjMWjKVsCWr0O7RpHzg+0kIhOdBGva4EFeryC8nIk45L08Ub2cAaN1RQBRkJlg8OORA7H0G4wtzpRHL2KkYWJ74hQdqO7BhSts1RyzH14NybrOm5+6rBhkQ==; 31:9p6tnFUF4CDCg3pE09g7QxR1RSSylRo1vFgzfOsU4VwDC+JiuaiDlCts32P9+oKJL4PMoVONBpt6VTXiWPcCWnizZsrWkuAjVUza17M2Ww2jGQfu+64eaAvFp8hin0BiF8jEpvqKK3e8o+6/OUR496r2+ulpkP1cD+UCEoQjghDMXnWUCBWftq5Waqi2jaWLcG2S5kVQ6an4WNqmshAsghWtGo9dyObEc6p4Xz7w7mE= X-MS-TrafficTypeDiagnostic: CO2PR07MB2518: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 20:DQ7I6Ms7nxZy39IIz+mBx+iUfPHq3ZD/kie+j5umwFw+SnyTKp9xQipeM/mhiWJDNM5SB8mklM/tXlVnfPON9oHc2dqhreUBX/63fW/UJ75K88enjwQRcd2tQjpenZBnAd4LQRNYSkcFY4d/XS2lnsyLMI+4eYz0q5yGKC6k9xjwtDuVu5A5VxbqJW0CjDeL6xSgSOxb44jUAYHLwRyzxYkiNdfimfjw49kyg+QuKc1NSgc0ida/zOItlxgpKsi4fL3udMi3DiaLk3dp5jB1ieEOI3NUJDJ5lDgUg97c0bV7GNBC1jhm2SvsLNaYCaPhAV8LOCreeA6MsQvvojKbINb2AIGGlMfUHyJMkV2m/sLlCCOfDES9AoWYoPAn8J/0Y3+W1zNiMRpDVFjwuEe+3Plic9Zw2mhgxUlAHrlPk0awd7ntkEahMC2FsEOLcg0ML0WVsOd3UmLdQMxLViWax9Oh2My9lEHxxdRLXmkvD9JoRhZmkKnm5W2yTR3a/m+hFcdsrpxlkzgkXBLLcYjiDo0Lb466BeBbVp2jce8ATw5Y+q3m9pw/WwvbfNkZWgVvZuBeyxhWOFSHAs87ldRhsc7TsqBb7iiA+yk2nf2cpCM= 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)(3231022)(93006095)(10201501046)(3002001)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123560025)(6072148)(201708071742011); SRVR:CO2PR07MB2518; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CO2PR07MB2518; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2518; 4:V1XeWX5UnANEYWf7uwAFzpmTb16fNSSvChqr4ahfKUUeHAUBtJ6DIL1rES9sA9oj3+4iTwySikH228zNhZN9vZFaNS2wlBogs1FXc8NiNHBhemtOTSsYzBxbKFxS8NDgNZZ2bNCa4oGOQ9uD5xRHlTBc4Vwm7Q1irqwzISrULoiemeCj24tuspxOhtB+Pv7xEvneRftG5XOz4s6WLWY87+D1ZcZc1XaoYWLR+aSEwJ7p7YQxxlPuEv8j7JWegmdJyh6+4d3z5vEwPyRgJtFl7GZYnytlLfIHcqr68uX5N+E+qsLBDA4Ci/sLBne0KQA47sjnn3CyQFIuoNCRnrrr+JwkTCIe+kulQ3bJvVsGL60= X-Forefront-PRVS: 05087F0C24 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(366004)(346002)(376002)(13464003)(189002)(11905935001)(199003)(33716001)(68736007)(72206003)(45080400002)(966005)(8936002)(2906002)(55016002)(189998001)(229853002)(53936002)(478600001)(101416001)(6246003)(4326008)(5660300001)(9686003)(2950100002)(6916009)(6306002)(6666003)(42882006)(47776003)(66066001)(50466002)(105586002)(106356001)(33656002)(16586007)(6496006)(58126008)(16526018)(83506002)(23726003)(97736004)(76176011)(52116002)(316002)(54356011)(53546010)(6116002)(1076002)(25786009)(3846002)(81166006)(8676002)(305945005)(7736002)(81156014)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR07MB2518; H:jerin; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CO2PR07MB2518; 23:WRcxmBw1f1m3IOsLIAfWBQVjKzJf9+lNWOvP5t5JY?= =?us-ascii?Q?3iTPnwbwx9ZMMGm7HO4JedGXVy2WcdJ5SrY/d8gLR60AnzHXvOvKXr1Vv3Hd?= =?us-ascii?Q?WN7QnDCi/CpqPL2hrHYGmCHPcgb0Aqolu3WA4myNLw/ur48CDzCQuKEmZIIE?= =?us-ascii?Q?f7icEgzSDHrFwra+I2PnRA53guyhkcS7AndrtIfIVKs+igb/X0xAC+eegmby?= =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JD+a3KOi1BqSn0di7vo0=; 7:u7Iazm0hg1ePftWUjdf5CYGIulYwaX5tNYxBmzz9T5EUkxrnG32cMDJAr3VCM+8jU5FE/b3f1UGRekoktaFApZtXDW2wgqMSorIEUq5v7HP3wEBtjRGUprFEEuqw+TBqUGei5vtHXN3q4rCf0vTlzJ417iI8UwTKu1YRgAlowV4U8YQ/QgwC+7hQmRN7WbsS8P7suFVE7el7OWXTzwrsDmMdJzI0H8oyij1z2SWRvwvyV7605FL95Arwwjsf65hf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2017 09:17:22.9887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9933d6f7-4ad6-4a4f-670e-08d5389c5580 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2518 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 09:17:27 -0000 -----Original Message----- > Date: Fri, 01 Dec 2017 09:52:26 +0100 > From: Thomas Monjalon > To: Jerin Jacob > Cc: dev@dpdk.org, chaozhu@linux.vnet.ibm.com > Subject: Re: [dpdk-dev] [PATCH] eal/x86: get hypervisor name > > 01/12/2017 09:12, Jerin Jacob: > > -----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/ > > I think it is quite logical because the CPU is virtualized by the hypervisor. > It is similar to get the CPU model, but for a different ring level. At least on non x86, it is not exposed as CPU flags. IMO, *hypervisor*.h file makes more sense rather than rte_cpuflags.h. > > > 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? > > I see two usages for now. > We can automate the use of the specific VMware TSC (it is an option currently). In my view this use case needed by the DPDK "implementation" not the "application". So internal API makes more sense to me. > We can adapt the device management policy on Hyper-V without waiting a device scan. I am not sure about this? Looks like a candidate for library implementation not for the "application"