From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BE5CCA0519; Fri, 3 Jul 2020 15:56:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BB141DBD1; Fri, 3 Jul 2020 15:56:07 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 3323E1DBCC for ; Fri, 3 Jul 2020 15:56:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593784564; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0dM3Gh0d2MOWiUej8d5L4gJtpv0u6RLZGqdyTlbpWVQ=; b=O3vAUpyK189pWoruUNNIqem1LbFzt4ExtyCD2G114lsji06rNNmNwi0IfJ/j7rRTgOdBKO T7ByY++0TBU+bHgUli4RLGZKFtHgrPCHM6eH+ht4RGfdpihdFIrs18epNiut4ro+11OcSE rYkNm51qelcL+HF4vuWjqx4jbCtP7DA= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-6k4msg0ZMj2s-9lFOS1r5Q-1; Fri, 03 Jul 2020 09:56:00 -0400 X-MC-Unique: 6k4msg0ZMj2s-9lFOS1r5Q-1 Received: by mail-ua1-f70.google.com with SMTP id x45so9290392uad.20 for ; Fri, 03 Jul 2020 06:56:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0dM3Gh0d2MOWiUej8d5L4gJtpv0u6RLZGqdyTlbpWVQ=; b=ZXMaebB85JyRbj9VUaNGwhDiFzGkkZahLzmXzhKoVqBNg1X8s71yUDWcFFNztpxYDa QMKFnif4f9Do967nzQAjzoQPB1cyx3VQmiJkI0MOscoNi/Y+1hqRiEFobeBhKjzSR9/Z ZbPMXrjx0kHDrYa8F6s/74iuEYvdYtdEPdYxN38h8sbBP6y9bMyQw/hdr0PQ5IbIk9fx rYNu4eWAEP1Y/s4LyJbZmknAmtdyaahKyHjK+huNjqyaY+IEl9JGj+TWwxXhxF0Udons o2zWMJ6jLNQZLQ9vYlX97X2j9K0PY7ur9qyq+q5LsH1COhICRTiJspJdYF3g0TPbj72h NJZQ== X-Gm-Message-State: AOAM530sXi/wLzRBgixbM1Nx8JzK76AXoBLJ2fZzomQ2uBXj/Q2ABrfk 5tyfGVY4DPeY+PBjLnPXNDClwBOOyhkEQlk/nhgdtClCiOn11jfgcLx5TZdAnS3E16ptgEXywqd /KwhxS6P531H+Wz4iJEg= X-Received: by 2002:a1f:6084:: with SMTP id u126mr25817263vkb.56.1593784560312; Fri, 03 Jul 2020 06:56:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMOzO5P7KaT8emMjL+nBKn7bEsU/UaIc7/2yZdzzZ0+4dpuCL9RJZf4gDIvMXy1ztbb0ANV6ZFjnueGhjPnUI= X-Received: by 2002:a1f:6084:: with SMTP id u126mr25817240vkb.56.1593784559951; Fri, 03 Jul 2020 06:55:59 -0700 (PDT) MIME-Version: 1.0 References: <20200701104428.4149689-1-jerinj@marvell.com> <20200701123347.51144-1-jerinj@marvell.com> In-Reply-To: <20200701123347.51144-1-jerinj@marvell.com> From: David Marchand Date: Fri, 3 Jul 2020 15:55:48 +0200 Message-ID: To: Jerin Jacob Kollanukkaran Cc: dev , Thomas Monjalon , Olivier Matz , sachin.saxena@oss.nxp.com, adamx.dybkowski@intel.com Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v5 00/13] rte_log registration usage improvement 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jul 1, 2020 at 2:34 PM wrote: > > From: Jerin Jacob > > This patch series improves the rte_log registration code snippet by > avoiding duplication of the code around registration by > introducing RTE_LOG_REGISTER macro. > > Drivers not adapted to new macro > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > I have converted all existing rte_log_register() to new macro, except > the following (as it has different usage style) > 1) drivers/common/mlx5/mlx5_common.c > 2) drivers/net/e1000/e1000_logs.c > 3) drivers/net/sfc/sfc_ethdev.c > > Example usage of new macro > ~~~~~~~~~~~~~~~~~~~~~~~~~~ > -/** > - * @internal > - */ > -int otx2_logtype_base; > -/** > - * @internal > - */ > -int otx2_logtype_mbox; > -/** > - * @internal > - */ > -int otx2_logtype_npa; > -/** > - * @internal > - */ > -int otx2_logtype_nix; > -/** > - * @internal > - */ > -int otx2_logtype_npc; > -/** > - * @internal > - */ > -int otx2_logtype_tm; > -/** > - * @internal > - */ > -int otx2_logtype_sso; > -/** > - * @internal > - */ > -int otx2_logtype_tim; > -/** > - * @internal > - */ > -int otx2_logtype_dpi; > -/** > - * @internal > - */ > -int otx2_logtype_ep; > - > -RTE_INIT(otx2_log_init); > -static void > -otx2_log_init(void) > -{ > - otx2_logtype_base = rte_log_register("pmd.octeontx2.base"); > - if (otx2_logtype_base >= 0) > - rte_log_set_level(otx2_logtype_base, RTE_LOG_NOTICE); > - > - otx2_logtype_mbox = rte_log_register("pmd.octeontx2.mbox"); > - if (otx2_logtype_mbox >= 0) > - rte_log_set_level(otx2_logtype_mbox, RTE_LOG_NOTICE); > - > - otx2_logtype_npa = rte_log_register("pmd.mempool.octeontx2"); > - if (otx2_logtype_npa >= 0) > - rte_log_set_level(otx2_logtype_npa, RTE_LOG_NOTICE); > - > - otx2_logtype_nix = rte_log_register("pmd.net.octeontx2"); > - if (otx2_logtype_nix >= 0) > - rte_log_set_level(otx2_logtype_nix, RTE_LOG_NOTICE); > - > - otx2_logtype_npc = rte_log_register("pmd.net.octeontx2.flow"); > - if (otx2_logtype_npc >= 0) > - rte_log_set_level(otx2_logtype_npc, RTE_LOG_NOTICE); > - > - otx2_logtype_tm = rte_log_register("pmd.net.octeontx2.tm"); > - if (otx2_logtype_tm >= 0) > - rte_log_set_level(otx2_logtype_tm, RTE_LOG_NOTICE); > - > - otx2_logtype_sso = rte_log_register("pmd.event.octeontx2"); > - if (otx2_logtype_sso >= 0) > - rte_log_set_level(otx2_logtype_sso, RTE_LOG_NOTICE); > - > - otx2_logtype_tim = > rte_log_register("pmd.event.octeontx2.timer"); > - if (otx2_logtype_tim >= 0) > - rte_log_set_level(otx2_logtype_tim, RTE_LOG_NOTICE); > - > - otx2_logtype_dpi = rte_log_register("pmd.raw.octeontx2.dpi"); > - if (otx2_logtype_dpi >= 0) > - rte_log_set_level(otx2_logtype_dpi, RTE_LOG_NOTICE); > - > - otx2_logtype_ep = rte_log_register("pmd.raw.octeontx2.ep"); > - if (otx2_logtype_ep >= 0) > - rte_log_set_level(otx2_logtype_ep, RTE_LOG_NOTICE); > - > -} > +RTE_LOG_REGISTER(otx2_logtype_base, pmd.octeontx2.base, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_mbox, pmd.octeontx2.mbox, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_npa, pmd.mempool.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_nix, pmd.net.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_npc, pmd.net.octeontx2.flow, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_tm, pmd.net.octeontx2.tm, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_sso, pmd.event.octeontx2, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_tim, pmd.event.octeontx2.timer, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_dpi, pmd.raw.octeontx2.dpi, NOTICE); > +RTE_LOG_REGISTER(otx2_logtype_ep, pmd.raw.octeontx2.ep, NOTICE); Squashed as a single commit since the conversion patches do not give more insight than the first change. Removed unnecessary some double empty lines or at the end of files. And applied. Note: I spotted some left behind logtype declarations for mlx5_vdpa_logtype, rte_graph_logtype, librawdev_logtype and stack_logtype. Could you send a followup patch if there are unneeded? Thanks for the cleanup. -- David Marchand