DPDK patches and discussions
 help / color / mirror / Atom feed
From: Martin Spinler <spinler@cesnet.cz>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Cc: Rastislav Cernay <cernay@netcope.com>
Subject: Re: [RFT] net/nfb: use dynamic logtype
Date: Thu, 07 Dec 2023 11:37:52 +0100	[thread overview]
Message-ID: <6e4607a0765c6ac5d199e49a88b44a896750b59b.camel@cesnet.cz> (raw)
In-Reply-To: <20231206175326.116375-1-stephen@networkplumber.org>

Thanks for patch! There are some issues.

On Wed, 2023-12-06 at 09:51 -0800, Stephen Hemminger wrote:
> 
> diff --git a/drivers/net/nfb/nfb_log.h b/drivers/net/nfb/nfb_log.h
> new file mode 100644
> index 000000000000..fac66a38d4b3
> --- /dev/null
> +++ b/drivers/net/nfb/nfb_log.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#ifndef _NFB_STATS_H_
> +#define _NFB_STATS_H_

use the _NFB_LOG_H_ guards

> +
> +extern int nfb_logtype;
> +
> +#define NFB_LOG(level, fmt, args...) \
> +	rte_log(RTE_LOG_ ## level, nfb_logtype, "%s(): " fmt "\n", \
> +		__func__, ## args)
> +
> +#endif /* _NFB_STATS_H_ */

use the _NFB_LOG_H_ guard

> diff --git a/drivers/net/nfb/nfb_rx.c b/drivers/net/nfb/nfb_rx.c
> index 8a9b232305f2..e39592d04737 100644
> --- a/drivers/net/nfb/nfb_rx.c
> +++ b/drivers/net/nfb/nfb_rx.c
>  
> @@ -19,7 +20,7 @@ nfb_eth_rx_queue_start(struct rte_eth_dev *dev, uint16_t rxq_id)
>  	int ret;
>  
>  	if (rxq->queue == NULL) {
> -		RTE_LOG(ERR, PMD, "RX NDP queue is NULL!\n");
> +		NFP_LOG(ERR, "RX NDP queue is NULL");

typo, should be NFB_LOG instead of NFP_LOG

>  		return -EINVAL;
>  	}
>  
>  

Also, the nfb_rx.h and nfb_tx.h files use the macro NFB_LOG inside,
please add '#include "nfb_log.h"' into them (then the include in
nfb_rx.c will be duplicate). Otherwise, all .c sources, which include
main nfb.h, don't compile.

With these changes, the driver works.

Thank you!
Martin

  reply	other threads:[~2023-12-07 10:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 17:51 Stephen Hemminger
2023-12-07 10:37 ` Martin Spinler [this message]
2023-12-07 17:32   ` Stephen Hemminger
2023-12-07 18:56 ` [PATCH 0/3] net/nfb: driver cleanups Stephen Hemminger
2023-12-07 18:56   ` [PATCH 1/3] net/nfb: remove unused device args Stephen Hemminger
2023-12-07 18:56   ` [PATCH 2/3] net/nfb: make device path local to init function Stephen Hemminger
2023-12-07 18:56   ` [PATCH 3/3] net/nfb: use dynamic logtype Stephen Hemminger
2023-12-12  8:49     ` Martin Spinler
2024-01-12 12:16   ` [PATCH 0/3] net/nfb: driver cleanups Ferruh Yigit
2024-01-12 13:50     ` Martin Spinler
2024-02-08  1:02       ` Ferruh Yigit
2024-02-08 12:01   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e4607a0765c6ac5d199e49a88b44a896750b59b.camel@cesnet.cz \
    --to=spinler@cesnet.cz \
    --cc=cernay@netcope.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).