From: Bruce Richardson <bruce.richardson@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: <dev@dpdk.org>, <stable@dpdk.org>,
Nicolas Chautru <nicolas.chautru@intel.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Hemant Agrawal <hemant.agrawal@nxp.com>
Subject: Re: [PATCH 3/3] bbdev: wrong fix for MinGW 13
Date: Tue, 19 Aug 2025 14:51:25 +0100 [thread overview]
Message-ID: <aKSBXajOemwaIf-C@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20250813152829.457463-4-thomas@monjalon.net>
On Wed, Aug 13, 2025 at 05:25:25PM +0200, Thomas Monjalon wrote:
> After an upgrade to MinGW version 13, compilation breaks:
>
> In function 'rte_bbdev_queue_ops_dump':
> lib/bbdev/rte_bbdev.c:1269:63: error:
> '%s' directive argument is null [-Werror=format-overflow=]
> fprintf(f, " Enqueue Status Counters %s %" PRIu64 "\n",
>
> The enqueue status string may be null if the index is too high,
> because RTE_BBDEV_ENQ_STATUS_SIZE_MAX is defined to include
> padding for future enum insertion.
> This padding case must be checked
> to avoid printing a dump of a non-existing status.
>
> Fixes: 353e3639d458 ("bbdev: add queue debug dump")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> lib/bbdev/rte_bbdev.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
> index e0f8c8eb0d..d662a2b364 100644
> --- a/lib/bbdev/rte_bbdev.c
> +++ b/lib/bbdev/rte_bbdev.c
> @@ -1248,6 +1248,7 @@ rte_bbdev_queue_ops_dump(uint16_t dev_id, uint16_t queue_id, FILE *f)
> struct rte_bbdev_queue_data *q_data;
> struct rte_bbdev_stats *stats;
> uint16_t i;
> + const char *status_str;
Minor nit, but I'd suggest defining this inside the for loop at first use.
> struct rte_bbdev *dev = get_dev(dev_id);
>
> VALID_DEV_OR_RET_ERR(dev, dev_id);
> @@ -1264,11 +1265,15 @@ rte_bbdev_queue_ops_dump(uint16_t dev_id, uint16_t queue_id, FILE *f)
> dev->data->name, queue_id);
> fprintf(f, " Last Enqueue Status %s\n",
> rte_bbdev_enqueue_status_str(q_data->enqueue_status));
> - for (i = 0; i < RTE_BBDEV_ENQ_STATUS_SIZE_MAX; i++)
> + for (i = 0; i < RTE_BBDEV_ENQ_STATUS_SIZE_MAX; i++) {
> + status_str = rte_bbdev_enqueue_status_str(i);
> + if (status_str == NULL)
> + continue;
> if (q_data->queue_stats.enqueue_status_count[i] > 0)
> fprintf(f, " Enqueue Status Counters %s %" PRIu64 "\n",
> - rte_bbdev_enqueue_status_str(i),
> + status_str,
> q_data->queue_stats.enqueue_status_count[i]);
> + }
> stats = &dev->data->queues[queue_id].queue_stats;
>
> fprintf(f, " Enqueue Count %" PRIu64 " Warning %" PRIu64 " Error %" PRIu64 "\n",
> --
> 2.47.1
>
next prev parent reply other threads:[~2025-08-19 13:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 15:25 [PATCH 0/3] fix build with " Thomas Monjalon
2025-08-13 15:25 ` [PATCH 1/3] bus/pci: " Thomas Monjalon
2025-08-13 15:25 ` [PATCH 2/3] net/mlx5: " Thomas Monjalon
2025-08-14 9:50 ` Dariusz Sosnowski
2025-08-13 15:25 ` [PATCH 3/3] bbdev: wrong fix for " Thomas Monjalon
2025-08-19 13:51 ` Bruce Richardson [this message]
2025-08-15 15:22 ` [PATCH 0/3] fix build with " Patrick Robb
2025-08-19 13:54 ` Bruce Richardson
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=aKSBXajOemwaIf-C@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=maxime.coquelin@redhat.com \
--cc=nicolas.chautru@intel.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/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).