From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2E0AD45946; Mon, 9 Sep 2024 08:51:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03D9E402BE; Mon, 9 Sep 2024 08:51:02 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id CFC68402A8 for ; Mon, 9 Sep 2024 08:50:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725864659; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8PGT1voJSVKC7EsyOBfE16mIYQk46mgGF9WKQCQMtwo=; b=MWW6a4Ug8U9MDV4RwIv2lZRrfrznBUhvDwQg3BezwxqHy/LqAup5z0Bo4rG49Ptu5W0GQG g15LCp+YwuLefwiNvi7Njp6XkEuF0s7HGekgCIvrFprgecC9wlOh/NbfW2zLR8A4yJ6Cb1 E7xza0fm0QVYopRYInJDgemIqDis0ts= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-104-DbRaBPlkP4Oe1TeKInqNkg-1; Mon, 09 Sep 2024 02:50:58 -0400 X-MC-Unique: DbRaBPlkP4Oe1TeKInqNkg-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2f753de91b8so23406931fa.1 for ; Sun, 08 Sep 2024 23:50:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725864657; x=1726469457; h=content-transfer-encoding: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=8PGT1voJSVKC7EsyOBfE16mIYQk46mgGF9WKQCQMtwo=; b=iD3/rov+cGHHEbOW36+V2gCKJZPiNmIjZxSDcTbYyLmjYRMr212Q75uaKoIyHNkzge I7DxcH/6cnoCl7YJlO2OC5Ir0IS4VJEQ0gajB5Y4JgeoJ/sHe4bKjBYwrMtVSZSsO3KA 8avkiXDo1hxnKVtRaK5/0iUygnyjC008qMfulGf6m1scaMhn3ncjvp0I9BKYSJPiXa5d HrPAvYd2/XxVRPS0cq8ADD9PuADQ58mjmKRPtxZknGYBs85NWX9WRgtRC5x8JSzq9yuY X5Y4L+Qryljz8mohdgTHeMBPhKyxfo4syS/rKtzo88+DNmxm42pEtKZvPLMshJkG3e+d MPYw== X-Gm-Message-State: AOJu0Yw//0TKuHgdzYNweIVkz+tbx8W0U5BUaGvdXkRdQvQywO0TF5Lj vx97lCWUnJCXl8WmI6guUNVzRooaiaY5/GQ9zE+LcnV2Y/+D7H8xnnlLBrs6DZ30Hm9mC4ZBKt/ Ox+nX9Iep8h63qxMvG0XFKI7Ht4kRcoZXEAICOika3MPxs4Q7naJwIo8Bcwau5YvNfM1ZPjBmFH Nyj9s5imKJUtoL1KhJxCsjKUSCdR4p X-Received: by 2002:a05:6512:3c96:b0:52c:8abe:51fb with SMTP id 2adb3069b0e04-536587a4134mr7218431e87.10.1725864656572; Sun, 08 Sep 2024 23:50:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJwBaQz2ETL9l1h02CeDQW8Zhjk+yZw198IJ9Kitfq2qujOpASi+EnQXb7ceBCUn9TPddOcth/wADrkH9kmBE= X-Received: by 2002:a05:6512:3c96:b0:52c:8abe:51fb with SMTP id 2adb3069b0e04-536587a4134mr7218413e87.10.1725864655990; Sun, 08 Sep 2024 23:50:55 -0700 (PDT) MIME-Version: 1.0 References: <20240907145433.1479091-1-david.marchand@redhat.com> <20240907145433.1479091-8-david.marchand@redhat.com> <063301db0280$1acf6330$506e2990$@trustnetic.com> In-Reply-To: <063301db0280$1acf6330$506e2990$@trustnetic.com> From: David Marchand Date: Mon, 9 Sep 2024 08:50:44 +0200 Message-ID: Subject: Re: [PATCH 07/11] net/txgbe: move wrapper to base driver To: Jiawen Wu Cc: dev@dpdk.org, Jian Wang X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Sep 9, 2024 at 8:18=E2=80=AFAM Jiawen Wu = wrote: > > On Sat, Sep 7, 2024 10:54 PM, David Marchand wrote: > > BP_LOG() is only used in the base driver. > > > > Signed-off-by: David Marchand > > --- > > drivers/net/txgbe/base/txgbe_osdep.h | 8 ++++++++ > > drivers/net/txgbe/txgbe_logs.h | 7 ------- > > 2 files changed, 8 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/txgbe/base/txgbe_osdep.h b/drivers/net/txgbe/b= ase/txgbe_osdep.h > > index 62d16a6abb..91c8abf12e 100644 > > --- a/drivers/net/txgbe/base/txgbe_osdep.h > > +++ b/drivers/net/txgbe/base/txgbe_osdep.h > > @@ -28,6 +28,14 @@ > > #define TMZ_VADDR(mz) ((mz)->addr) > > #define TDEV_NAME(eth_dev) ((eth_dev)->device->name) > > > > +extern int txgbe_logtype_bp; > > +#define RTE_LOGTYPE_TXGBE_BP txgbe_logtype_bp > > +#define BP_LOG(fmt, ...) \ > > + RTE_LOG(DEBUG, TXGBE_BP, \ > > + "[%"PRIu64".%"PRIu64"]%s(%d): " fmt, \ > > + usec_stamp() / 1000000, usec_stamp() % 1000000, \ > > + __func__, __LINE__, ## __VA_ARGS__) > > + > > #define ASSERT(x) do { \ > > if (!(x)) \ > > PMD_DRV_LOG(ERR, "TXGBE: %d", x); \ > > diff --git a/drivers/net/txgbe/txgbe_logs.h b/drivers/net/txgbe/txgbe_l= ogs.h > > index 74f49ab9ef..b5a5a9233f 100644 > > --- a/drivers/net/txgbe/txgbe_logs.h > > +++ b/drivers/net/txgbe/txgbe_logs.h > > @@ -51,11 +51,4 @@ extern int txgbe_logtype_tx_free; > > #define DEBUGOUT(fmt, args...) PMD_DRV_LOG(DEBUG, fmt, ##args) > > #define PMD_INIT_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>") > > > > -extern int txgbe_logtype_bp; > > -#define BP_LOG(fmt, args...) \ > > - rte_log(RTE_LOG_DEBUG, txgbe_logtype_bp, \ > > - "[%"PRIu64".%"PRIu64"]%s(%d): " fmt, \ > > - usec_stamp() / 1000000, usec_stamp() % 1000000, \ > > - __func__, __LINE__, ##args) > > - > > #endif /* _TXGBE_LOGS_H_ */ > > -- > > 2.46.0 > > > > Hi, > > Does this have to change? It looks a little weird. Can you be more specific about the part that you don't like? There is a change in behavior, I agree: messages would now be prefixed with the logtype, here TXGBE_BP. I can revert this part if you prefer. As for moving the macro, in all other drivers in DPDK, the osdep.h header provides helpers for the base driver code, so it is the right location. --=20 David Marchand