From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C06F8532E for ; Wed, 19 Apr 2017 13:13:44 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 04:12:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,221,1488873600"; d="scan'208";a="250963069" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga004.fm.intel.com with ESMTP; 19 Apr 2017 04:12:07 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 12:12:07 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.239]) by irsmsx112.ger.corp.intel.com ([169.254.1.61]) with mapi id 14.03.0319.002; Wed, 19 Apr 2017 12:12:07 +0100 From: "De Lara Guarch, Pablo" To: Olivier MATZ CC: "thomas.monjalon@6wind.com" , "stephen@networkplumber.org" , "dev@dpdk.org" Thread-Topic: [PATCH v3] eal: redefine logtype values Thread-Index: AQHStFvntE9yBSihtkONtX0li5NoTqHK2vIAgAG3L9A= Date: Wed, 19 Apr 2017 11:12:06 +0000 Message-ID: References: <1492011332-5846-1-git-send-email-pablo.de.lara.guarch@intel.com> <1492090967-51332-1-git-send-email-pablo.de.lara.guarch@intel.com> <20170418115740.00d3b39f@glumotte.dev.6wind.com> In-Reply-To: <20170418115740.00d3b39f@glumotte.dev.6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTc4ZDQ5ODItMmMxZi00Yzk2LWE2NjYtNWVmNTY2NThmZDcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Im1VTUVQVk5jdlc3NGE2ZlNXZllCbEhxUUFPSFhZT2FKUlk2eGRJdVAyMmc9In0= 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 v3] 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 11:13:45 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Tuesday, April 18, 2017 10:58 AM > To: De Lara Guarch, Pablo > Cc: thomas.monjalon@6wind.com; stephen@networkplumber.org; > dev@dpdk.org > Subject: Re: [PATCH v3] eal: redefine logtype values >=20 > Hi Pablo, >=20 > On Thu, 13 Apr 2017 14:42:47 +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 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 | 37 +++---------- > > lib/librte_eal/common/include/rte_log.h | 94 > +++++++++++++++++++++++---------- > > 2 files changed, 73 insertions(+), 58 deletions(-) >=20 > [...] >=20 >=20 > > @@ -111,6 +111,42 @@ extern struct rte_logs rte_logs; > > #define RTE_LOG_INFO 7U /**< Informational. */ > > #define RTE_LOG_DEBUG 8U /**< Debug-level messages. */ > > > > +struct logtype { > > + uint32_t log_id; > > + char logtype[32]; > > +}; > > + > > +static const struct logtype logtype_strings[] =3D { > > + {RTE_LOGTYPE_EAL, "eal"}, > > + {RTE_LOGTYPE_MALLOC, "malloc"}, > > + {RTE_LOGTYPE_RING, "ring"}, > > + {RTE_LOGTYPE_MEMPOOL, "mempool"}, > > + {RTE_LOGTYPE_TIMER, "timer"}, > > + {RTE_LOGTYPE_PMD, "pmd"}, > > + {RTE_LOGTYPE_HASH, "hash"}, > > + {RTE_LOGTYPE_LPM, "lpm"}, > > + {RTE_LOGTYPE_KNI, "kni"}, > > + {RTE_LOGTYPE_ACL, "acl"}, > > + {RTE_LOGTYPE_POWER, "power"}, > > + {RTE_LOGTYPE_METER, "meter"}, > > + {RTE_LOGTYPE_SCHED, "sched"}, > > + {RTE_LOGTYPE_PORT, "port"}, > > + {RTE_LOGTYPE_TABLE, "table"}, > > + {RTE_LOGTYPE_PIPELINE, "pipeline"}, > > + {RTE_LOGTYPE_MBUF, "mbuf"}, > > + {RTE_LOGTYPE_CRYPTODEV, "cryptodev"}, > > + {RTE_LOGTYPE_EFD, "efd"}, > > + {RTE_LOGTYPE_EVENTDEV, "eventdev"}, > > + {RTE_LOGTYPE_USER1, "user1"}, > > + {RTE_LOGTYPE_USER2, "user2"}, > > + {RTE_LOGTYPE_USER3, "user3"}, > > + {RTE_LOGTYPE_USER4, "user4"}, > > + {RTE_LOGTYPE_USER5, "user5"}, > > + {RTE_LOGTYPE_USER6, "user6"}, > > + {RTE_LOGTYPE_USER7, "user7"}, > > + {RTE_LOGTYPE_USER8, "user8"} > > +}; > > + > > /** > > * Change the stream that will be used by the logging system. > > * >=20 > Could it go in eal_common_log.c instead? I think we don't need it in > the header file, and it would avoid to pollute the global namespace. >=20 > Apart from that, I tested the patch and it works. Thanks! Sure, good idea. Will send a v4 shortly. >=20 > I wonder if we can now remove the use or USERx logs in apps. > It still has to work for compat, but it would be better to register > a new logtype instead. I have a patch to do that in testpmd, I'll > send it today. Not sure it should go in the release or not. Yes, I think we need to start moving the apps to use the new logs (and the = libraries, right?). Probably a bit late to do it in this release, I think it can wait until the= next one. Pablo >=20 > Regards, > Olivier