DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Gregory Etelson <getelson@nvidia.com>,
	dev@dpdk.org, stephen@networkplumber.org
Cc: mkashani@nvidia.com, rasland@nvidia.com,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Shani Peretz <shperetz@nvidia.com>
Subject: Re: [PATCH v3] app/testpmd: fix devargs format in port attach
Date: Wed, 5 Nov 2025 14:56:23 +0000	[thread overview]
Message-ID: <1da58d87-a6f5-4929-a20e-7eb1f238e14a@redhat.com> (raw)
In-Reply-To: <20251031061816.333400-1-getelson@nvidia.com>

On 31/10/2025 06:18, Gregory Etelson wrote:
> The port attach procedure discarded PCI port devargs provided
> by application.
> The patch restores PCI port devargs.
> 

There is a bugzilla for this issue, so it can be added to the commit

Bugzilla ID: 1815
> Fixes: 12c2405989f6 ("app/testpmd: canonicalize short PCI name format")
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> ---
> v2: add buf_size parameter to convert_pci_address_format()
> v3: use snprintf()
> ---
>  app/test-pmd/testpmd.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 2360da3a48..b10f6baee2 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3417,6 +3417,7 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
>  {
>  	struct rte_devargs da;
>  	struct rte_pci_addr pci_addr;
> +	size_t pci_len;
>  
>  	if (rte_devargs_parse(&da, identifier) != 0)
>  		return NULL;
> @@ -3431,6 +3432,8 @@ convert_pci_address_format(const char *identifier, char *pci_buffer, size_t buf_
>  		return NULL;
>  
>  	rte_pci_device_name(&pci_addr, pci_buffer, buf_size);
> +	pci_len = strlen(pci_buffer);
> +	snprintf(pci_buffer + pci_len, buf_size - pci_len, ",%s", da.args);
>  	return pci_buffer;
>  }
>  
> @@ -3439,8 +3442,8 @@ attach_port(char *identifier)
>  {
>  	portid_t pi;
>  	struct rte_dev_iterator iterator;
> -	char *long_identifier;
> -	char long_format[PCI_PRI_STR_SIZE];
> +	char *long_format, *long_identifier;
> +	size_t long_format_size;
>  
>  	printf("Attaching a new port...\n");
>  
> @@ -3448,9 +3451,15 @@ attach_port(char *identifier)
>  		fprintf(stderr, "Invalid parameters are specified\n");
>  		return;
>  	}
> +	long_format_size = strlen(identifier) + PCI_PRI_STR_SIZE;
> +	long_format = alloca(long_format_size);
> +	if (long_format == NULL) {
> +		TESTPMD_LOG(ERR, "Failed to attach port %s - allocation failure\n", identifier);
> +		return;
> +	}
>  
>  	/* For PCI device convert to canonical format */
> -	long_identifier = convert_pci_address_format(identifier, long_format, sizeof(long_format));
> +	long_identifier = convert_pci_address_format(identifier, long_format, long_format_size);
>  	if (long_identifier != NULL)
>  		identifier = long_identifier;
>  


      reply	other threads:[~2025-11-05 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  9:20 [PATCH] " Gregory Etelson
2025-10-30 15:53 ` Stephen Hemminger
2025-10-30 17:17 ` [PATCH v2] " Gregory Etelson
2025-10-30 17:47   ` Stephen Hemminger
2025-10-31  6:18 ` [PATCH v3] " Gregory Etelson
2025-11-05 14:56   ` Kevin Traynor [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=1da58d87-a6f5-4929-a20e-7eb1f238e14a@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=getelson@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shperetz@nvidia.com \
    --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).