From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by dpdk.org (Postfix) with ESMTP id 6C0141B749 for ; Fri, 13 Oct 2017 17:13:09 +0200 (CEST) Received: by mail-pf0-f169.google.com with SMTP id d28so10667265pfe.2 for ; Fri, 13 Oct 2017 08:13:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qV/qS6/pd+ErWpzS27iYzVR+LL1+2BjXaiR5Xd2GPQc=; b=IFNrsBic9NDSQ4/KiP3XimwsH+YAlv31vC5TgUxRBe1bjO2Lb46VKb6ms443Urv8Ps NAaL0x+/okqX/82QUhP4Jpnw+5GkpGSZKdayVTrQUrxCeTCUti/f2xfgjaSJbVVDup1U KRorrnFM5CcVDcZqJLLL+ON8c1DvOzSM9pnw66YSaWu0tveyoFGvWtqZ62M+gUwBVNZL OnCPBOe9QeVg3D0/LKgp0SPww/t0VTEU+n0lrdBtR+5e8M87xRvy/Oeb9DkT6CwYNMBg A+aJB/vjJWZZyHbWBCPShqEUZvo4Yc1BUFttMuH3NbqXaZBiH+7cwXCpbF2kMGAM/Bwz liow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qV/qS6/pd+ErWpzS27iYzVR+LL1+2BjXaiR5Xd2GPQc=; b=RI94mlAcH4sZKDEOEY6N7WlKxju1PB9E/ZZzJ8Zgc8u9ZF6ycl3kac83ka/HJRVLEj XkRlmYutK8Cd+gpi+J6hwtRBYs/9ktr6doRGMrsRz/0liNfMNqiKmAGHcuzd+w/bXRFa UU2XA30sWZGkD2SMYgrZ0TIJyl+S9i+K5tNg3IaX9QlSS5TgfIEnmMzoIuVpTwJXmrPS oYaG8tIX1ABYiHzXJM2GGfsl918Ga2YmVCvBf2wj3KPYBL7Coa25SLovh2Fm+GeKT+LN kl9fytnCn2cF1nHlPZF8p/KKmxZSN/u2aq+lFEERUvUz0CoMEWgFkQTRcbI5I9bmOG1j JLcg== X-Gm-Message-State: AMCzsaVansn4A5Kh+1RzYgKzharh4AWc9qstaAAl3TLUftzNiyAJMKkn fcvvvPgCJTraRXYIDdRTcG2Reg== X-Google-Smtp-Source: AOwi7QBHiL3otot4Ph2IdGNSym6OMooPX6xUheoSIBpp8/lC7sg0sZ084a0/OnFdKTNmZFzLj0btBQ== X-Received: by 10.98.40.74 with SMTP id o71mr1682699pfo.326.1507907588635; Fri, 13 Oct 2017 08:13:08 -0700 (PDT) Received: from xeon-e3 (76-14-207-240.or.wavecable.com. [76.14.207.240]) by smtp.gmail.com with ESMTPSA id a19sm3080032pfh.30.2017.10.13.08.13.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2017 08:13:08 -0700 (PDT) Date: Fri, 13 Oct 2017 08:13:06 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: gowrishankar.m@linux.vnet.ibm.com, jerin.jacob@caviumnetworks.com, jianbo.liu@linaro.org, sergio.gonzalez.monroy@intel.com, bruce.richardson@intel.com, dev@dpdk.org Message-ID: <20171013081306.15b4a494@xeon-e3> In-Reply-To: <1683017.mmorKbpdtt@xps> References: <20171013000247.4158-5-thomas@monjalon.net> <20171012204724.120d7b25@xeon-e3> <1683017.mmorKbpdtt@xps> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 4/4] eal/x86: implement arch-specific TSC freq query 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, 13 Oct 2017 15:13:09 -0000 On Fri, 13 Oct 2017 09:30:43 +0200 Thomas Monjalon wrote: > 13/10/2017 05:47, Stephen Hemminger: > > On Fri, 13 Oct 2017 02:02:47 +0200 > > Thomas Monjalon wrote: > > > > > +static uint32_t > > > +check_model_wsm_nhm(uint8_t model) > > > +{ > > > + switch (model) { > > > + /* Westmere */ > > > + case 0x25: > > > + case 0x2C: > > > + case 0x2F: > > > + /* Nehalem */ > > > + case 0x1E: > > > + case 0x1F: > > > + case 0x1A: > > > + case 0x2E: > > > + return 1; > > > + } > > > + > > > + return 0; > > > +} > > > > How about a table rather than switch? > > Also bool rather than int? > > It is a matter of taste :) > I plan to push it as is. It can be changed later if desired. Also using #define's rather than magic constants would help.