From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DFDDC41CFC;
	Tue, 21 Feb 2023 11:41:19 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D03AE431C0;
	Tue, 21 Feb 2023 11:41:19 +0100 (CET)
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by mails.dpdk.org (Postfix) with ESMTP id B6986431C2
 for <dev@dpdk.org>; Tue, 21 Feb 2023 11:41:18 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1676976078;
 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=4w8HmLiEhgUcq4ZjNudcQ2zOlhJUEwlDZd6/xcRasM8=;
 b=KUx+OpB1IfGbVWZ0n6NcEdLSzGiU5lgzj4fouc0OakekF+IEDV2bHbz7u0dm0eaFlbTgxO
 tycq3Gjij4XzMTcHJaOs7mzq7NJhzJW3GqYN3sRUFGrHKXs2d/XQMV1+YDWnqGcQ9bc5EH
 aOIJk1P7rdqie1ZYoAY8XJin4soUvHs=
Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com
 [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id
 us-mta-615-qhP0MJbUNcSJEEO5UzfCtA-1; Tue, 21 Feb 2023 05:41:14 -0500
X-MC-Unique: qhP0MJbUNcSJEEO5UzfCtA-1
Received: by mail-pl1-f198.google.com with SMTP id
 j10-20020a170902da8a00b00188cd4769bcso1811097plx.0
 for <dev@dpdk.org>; Tue, 21 Feb 2023 02:41:14 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=4w8HmLiEhgUcq4ZjNudcQ2zOlhJUEwlDZd6/xcRasM8=;
 b=falloHXgcjaQbAQrDxwY0daxO+U1Gi/NYqAI2S1huZQddr1dIqVX6vfBukN7nKQY0W
 jfi+nz1N4NcXZXbw0k/8Yf/db5FHPO+CyMGwszNwmJKXljeSSEjvUaCgJ2CcYQiyVWOb
 l13GMbu0UvVY8skyLH+bpDz8Zf8bYQVOU4XfztB2mv/BSGnzl2sQNQxPMXXZp8PMcoUj
 xe1+mO4Ah9Jb+sijeb+j15nTo3X060sWoErA3Q7PJw0NVHfERxk2fy11nU5zsE0Peuh+
 g1buhAMBE3rFPUQGcgjt9CflXEpe9PvmpP5NG7gfE1RllGH/mAzSdIIkJWq+pxTQYzv9
 QQ2A==
X-Gm-Message-State: AO0yUKWFWlq3Dfa6GkxrkEV6Uy1IXphdfYp9tkTHHlGGLOrY28gLB6zz
 iFF2ha+OM9j9/JomY0aEVV5XZWD7WoAQm3nrZnw/4JSMbSHHF0YcpJu3Db1qbTRcpOvvgGYZVnd
 n9uf73ldYiwssFj7K7bg=
X-Received: by 2002:a17:90b:3912:b0:233:f53f:95eb with SMTP id
 ob18-20020a17090b391200b00233f53f95ebmr1390105pjb.51.1676976073669; 
 Tue, 21 Feb 2023 02:41:13 -0800 (PST)
X-Google-Smtp-Source: AK7set9sEx7r8a9DaH8zmi87UtkK9IE4RxA1ONw4TTxB79M9FcRwT01IPmgG+tsCK1z9+hSQW0VrT4EOiBwvXo/xOtQ=
X-Received: by 2002:a17:90b:3912:b0:233:f53f:95eb with SMTP id
 ob18-20020a17090b391200b00233f53f95ebmr1390103pjb.51.1676976073347; Tue, 21
 Feb 2023 02:41:13 -0800 (PST)
MIME-Version: 1.0
References: <20230208044825.1682620-1-stephen@networkplumber.org>
 <20230220185001.50714-1-stephen@networkplumber.org>
 <20230220185001.50714-2-stephen@networkplumber.org>
In-Reply-To: <20230220185001.50714-2-stephen@networkplumber.org>
From: David Marchand <david.marchand@redhat.com>
Date: Tue, 21 Feb 2023 11:41:02 +0100
Message-ID: <CAJFAV8xNr0TnV36OcVekXyxivWxxkgn-zBy7BLrB1aU8H9K8kg@mail.gmail.com>
Subject: Re: [PATCH v6 1/5] ip_frag: use a dynamic logtype
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

On Mon, Feb 20, 2023 at 7:50 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> DPDK libraries should not be reusing RTE_LOGTYPE_USER1 in
> lieu of doing proper logtype registration.
>
> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
> Fixes: 416707812c03 ("ip_frag: refactor reassembly code into a proper library")
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/ip_frag/ip_frag_common.h     | 5 ++++-
>  lib/ip_frag/rte_ip_frag_common.c | 2 ++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h
> index 9c0dbdeb6eb9..95f1689d476d 100644
> --- a/lib/ip_frag/ip_frag_common.h
> +++ b/lib/ip_frag/ip_frag_common.h
> @@ -8,9 +8,12 @@
>  #include "rte_ip_frag.h"
>  #include "ip_reassembly.h"
>
> +extern int ipfrag_logtype;
> +#define RTE_LOGTYPE_IPFRAG     ipfrag_logtype
> +
>  /* logging macros. */
>  #ifdef RTE_LIBRTE_IP_FRAG_DEBUG
> -#define        IP_FRAG_LOG(lvl, fmt, args...)  RTE_LOG(lvl, USER1, fmt, ##args)
> +#define        IP_FRAG_LOG(lvl, fmt, args...)  RTE_LOG(lvl, IPFRAG, fmt, ##args)
>  #else
>  #define        IP_FRAG_LOG(lvl, fmt, args...)  do {} while(0)
>  #endif /* IP_FRAG_DEBUG */
> diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c
> index c1de2e81b6d0..e4af8d23ad10 100644
> --- a/lib/ip_frag/rte_ip_frag_common.c
> +++ b/lib/ip_frag/rte_ip_frag_common.c
> @@ -7,6 +7,8 @@
>
>  #include <rte_log.h>
>
> +RTE_LOG_REGISTER_DEFAULT(ipfrag_logtype, INFO);
> +
>  #include "ip_frag_common.h"
>
>  #define        IP_FRAG_HASH_FNUM       2

There are still some parts using USER1 in this library:

lib/ip_frag/rte_ip_frag_common.c:               RTE_LOG(ERR, USER1,
"%s: invalid input parameter\n", __func__);
lib/ip_frag/rte_ip_frag_common.c:               RTE_LOG(ERR, USER1,
lib/ip_frag/rte_ip_frag_common.c:       RTE_LOG(INFO, USER1, "%s:
allocated of %zu bytes at socket %d\n",

-- 
David Marchand