DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Gagandeep Singh <g.singh@nxp.com>
Cc: dev@dpdk.org, gakhil@marvell.com, david.marchand@redhat.com,
	Jun Yang <jun.yang@nxp.com>
Subject: Re: [PATCH] crypto/dpaa2_sec: rework debug code
Date: Mon, 7 Oct 2024 08:25:19 -0700	[thread overview]
Message-ID: <20241007082519.0d59a74a@hermes.local> (raw)
In-Reply-To: <20241007084354.852733-1-g.singh@nxp.com>

On Mon,  7 Oct 2024 14:13:54 +0530
Gagandeep Singh <g.singh@nxp.com> wrote:

> +#if (RTE_LOG_DEBUG <= RTE_LOG_DP_LEVEL)
> +	offset = sprintf(debug_str,
> +		"CIPHER SG: fdaddr =%" PRIx64 ", from %s pool ",
>  		DPAA2_GET_FD_ADDR(fd),
> -		DPAA2_GET_FD_BPID(fd),
> -		rte_dpaa2_bpid_info[bpid].meta_data_size,
> -		DPAA2_GET_FD_OFFSET(fd),
> -		DPAA2_GET_FD_LEN(fd));
> +		bpid < MAX_BPID ? "SW" : "BMAN");
> +	if (bpid < MAX_BPID) {
> +		offset += sprintf(&debug_str[offset],
> +			"bpid = %d ", bpid);
> +	}
> +	offset += sprintf(&debug_str[offset],
> +		"private size = %d ",
> +		mbuf->pool->private_data_size);
> +	offset += sprintf(&debug_str[offset],
> +		"off =%d, len =%d",
> +		DPAA2_GET_FD_OFFSET(fd), DPAA2_GET_FD_LEN(fd));
> +	DPAA2_SEC_DP_DEBUG("%s", debug_str);
> +#else
> +	RTE_SET_USED(bpid);
> +#endif
> +

Since this code is repeated, and not in hot path why not make it
a function, then the #ifdef mess would be less as well

  parent reply	other threads:[~2024-10-07 15:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07  8:43 Gagandeep Singh
2024-10-07  8:48 ` David Marchand
2024-10-07 15:25 ` Stephen Hemminger [this message]
2024-10-09  5:07 ` [v2] " Gagandeep Singh
2024-10-09 21:01   ` [EXTERNAL] " Akhil Goyal
2024-10-10  5:52     ` Gagandeep Singh
2024-10-10  6:03   ` [v3] " Gagandeep Singh
2024-10-10  7:06     ` David Marchand
  -- strict thread matches above, loose matches on Subject: below --
2024-10-07  8:40 [PATCH] " Gagandeep Singh

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=20241007082519.0d59a74a@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=gakhil@marvell.com \
    --cc=jun.yang@nxp.com \
    /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).