patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Shani Peretz <shperetz@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>, Remy Horton <remy.horton@intel.com>
Subject: Re: [PATCH] examples/ethtool: fix buffer size for pkt pool name
Date: Wed, 3 Dec 2025 07:20:17 -0800	[thread overview]
Message-ID: <20251203072017.27a079d9@phoenix.local> (raw)
In-Reply-To: <20251203110157.51471-1-shperetz@nvidia.com>

On Wed, 3 Dec 2025 13:01:57 +0200
Shani Peretz <shperetz@nvidia.com> wrote:

> Increase str_name buffer size from 16 to 32 bytes to fit the provided
> format. The previous size was insufficient as the format
> string "pkt_pool%i" can produce up to 19 bytes (8 for "pkt_pool",
> up to 10 for integer value, and 1 for null terminator).
> 
> Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shani Peretz <shperetz@nvidia.com>
> ---
>  examples/ethtool/ethtool-app/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
> index 1f011a9321..06605b4202 100644
> --- a/examples/ethtool/ethtool-app/main.c
> +++ b/examples/ethtool/ethtool-app/main.c
> @@ -92,7 +92,7 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
>  	int size_pktpool;
>  	struct rte_eth_conf cfg_port;
>  	struct rte_eth_dev_info dev_info;
> -	char str_name[16];
> +	char str_name[32];

Don't use hard coded constant, instead use RTE_MEMPOOL_NAMESIZE which is
not 32, but 32 - 4 + 1 = 29


      reply	other threads:[~2025-12-03 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 11:01 Shani Peretz
2025-12-03 15:20 ` Stephen Hemminger [this message]

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=20251203072017.27a079d9@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=remy.horton@intel.com \
    --cc=shperetz@nvidia.com \
    --cc=stable@dpdk.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).