From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 3A8B75587 for ; Wed, 19 Apr 2017 14:15:00 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id w64so78704732wma.0 for ; Wed, 19 Apr 2017 05:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BncRPKaLi/wh9nm7NDu0vB8qfAgAKI+xswmMSmVV7Os=; b=Z2XMdmM7O56F93kbxWNKvSRt1k4uM2DYUkiE3X3yo4deRvsCKwrXHnlEX6D5ddkQw6 Srhz3O8bnTRAhc4/EfdWv32GGqfUJdw9MmvLTNsTrJhoBEyv4+7A++SS7BHiAtrsBGKJ /ZuKikSHSFE8mB1ghyGpqmxOe/hJMeBjDGUjSpgDcVTQdexmfbUKMdonOldrdqqORMX9 n0Xx0uPFy/NURGwmRImnM2IOH6Nl+9SfmZ9m5IrMu/AaIbPvSqmsVXW94rUNtD5RFtd/ qea5gxyZpsO+bxhQ+DYsIVaEBOqjsBjJe2FXOqKrlP2RqCvXLtHrwNJlrLKc+xpL/eYW IncQ== 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=BncRPKaLi/wh9nm7NDu0vB8qfAgAKI+xswmMSmVV7Os=; b=O93T+ZsB/mLGBID0W1xnn85QoOSY20/lF3MXIpciXxT1fVayztD/CfrQolO1z6wibv rUoKkeQzm77wlRJMqOc/XXtHXc/xiBfhG5Uqb+WFpKRU4CSX+q+sVEARo0hA/JqHxvyD 1YBcDLxRdzCXl2by+FlalDB5C9ce5trUhFM/9ZebRadOQUADnF8+jNn2RrOdh/39GEwR h+8KbRSt9tRaW3Tj9kLH+DFr45n4BjpigPGCuxyqmg5TwH27Wm4dUFnRuyFQe7piHV/z DKPjRVGo1lpDDgc5LH0GFAkwgsLxMWcWDMFcEj5hApc+wGRB+gEuCIjoJcLOeP2b2q7N X5SA== X-Gm-Message-State: AN3rC/6wytEmSOVXWz3heDTkRPlBsoALhAm/yqQxW1GxKwiccy8DYIoA xMkDm+fqjEjZ1C9p X-Received: by 10.28.143.71 with SMTP id r68mr18387407wmd.61.1492604099888; Wed, 19 Apr 2017 05:14:59 -0700 (PDT) Received: from glumotte.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id r52sm3075665wrb.37.2017.04.19.05.14.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Apr 2017 05:14:59 -0700 (PDT) Date: Wed, 19 Apr 2017 14:15:27 +0200 From: Olivier MATZ To: Pablo de Lara Cc: thomas@monjalon.net, dev@dpdk.org Message-ID: <20170419141527.26db741e@glumotte.dev.6wind.com> In-Reply-To: <1492601044-27217-1-git-send-email-pablo.de.lara.guarch@intel.com> 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> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 12:15:00 -0000 Hi Pablo, 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 backward 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 |= type; > + rte_logs.type |= 1 << type; > else > - rte_logs.type &= ~type; > + rte_logs.type &= ~(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]; > +}; Sorry I missed it in the previous review, but what do you think of using "const char *" instead of "char[32]"?