From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id A31BE58FA for ; Wed, 19 Apr 2017 15:46:35 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 06:46:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,221,1488873600"; d="scan'208";a="76261701" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga002.jf.intel.com with ESMTP; 19 Apr 2017 06:46:33 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Wed, 19 Apr 2017 14:46:32 +0100 From: "De Lara Guarch, Pablo" To: Olivier MATZ CC: "thomas@monjalon.net" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4] eal: redefine logtype values Thread-Index: AQHSuP99H5cOFUFtv0OTMoOmQ/GWFqHMin+AgAAoeZA= Date: Wed, 19 Apr 2017 13:46:31 +0000 Message-ID: References: <1492090967-51332-1-git-send-email-pablo.de.lara.guarch@intel.com> <1492601044-27217-1-git-send-email-pablo.de.lara.guarch@intel.com> <20170419141527.26db741e@glumotte.dev.6wind.com> In-Reply-To: <20170419141527.26db741e@glumotte.dev.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTY3MmIwZjYtODQyNC00ZWQyLWEwNzgtMDhjODA3NGZkNjdjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlpuR0xBXC9SbTZsaXFcLzRnYnloUkVoNkY2QXZEcGhRM1duNDhHQmVRWWlGUT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] eal: redefine logtype values 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: Wed, 19 Apr 2017 13:46:36 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier MATZ > Sent: Wednesday, April 19, 2017 1:15 PM > To: De Lara Guarch, Pablo > Cc: thomas@monjalon.net; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4] eal: redefine logtype values >=20 > Hi Pablo, >=20 > On Wed, 19 Apr 2017 12:24:04 +0100, Pablo de Lara > wrote: > > After the changes in commit c1b5fa94a46f > > ("eal: support dynamic log types"), logtype is not treated as a > > bitmask, but a decimal value. Therefore, values have to be > > converted. > > > > Fixes: c1b5fa94a46f ("eal: support dynamic log types") > > > > Signed-off-by: Pablo de Lara > > --- > > > > Changes in v4: > > - Moved log type strings to eal_common_log.c > > > > Changes in v3: > > - Created array of structures containing logtype id and string > > - Added left shift to convert new decimal values to bitmask for backwar= d > compatibility > > > > Changes in v2: > > - Used new RTE_LOGTYPE values in rte_log_init() > > > > lib/librte_eal/common/eal_common_log.c | 73 > ++++++++++++++++++++------------- > > lib/librte_eal/common/include/rte_log.h | 58 +++++++++++++------------= - > > 2 files changed, 73 insertions(+), 58 deletions(-) > > > > diff --git a/lib/librte_eal/common/eal_common_log.c > b/lib/librte_eal/common/eal_common_log.c > > index dd4d30c..fd76612 100644 > > --- a/lib/librte_eal/common/eal_common_log.c > > +++ b/lib/librte_eal/common/eal_common_log.c > > @@ -118,9 +118,9 @@ rte_set_log_type(uint32_t type, int enable) > > { > > if (type < RTE_LOGTYPE_FIRST_EXT_ID) { > > if (enable) > > - rte_logs.type |=3D type; > > + rte_logs.type |=3D 1 << type; > > else > > - rte_logs.type &=3D ~type; > > + rte_logs.type &=3D ~(1 << type); > > } > > > > if (enable) > > @@ -240,42 +240,57 @@ rte_log_register(const char *name) > > return ret; > > } > > > > +struct logtype { > > + uint32_t log_id; > > + char logtype[32]; > > +}; >=20 > Sorry I missed it in the previous review, but what do you think of > using "const char *" instead of "char[32]"? Right, I thought I needed to reserve the memory in the structure definition= , but sure, that works too :) v5 on the way...