DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: report error on name truncation
Date: Tue, 8 Jan 2019 06:06:29 +0000	[thread overview]
Message-ID: <DM6PR18MB242751AA8C04D377AF4AE2FEAF8A0@DM6PR18MB2427.namprd18.prod.outlook.com> (raw)
In-Reply-To: <a43c46bf-af7d-649a-8b19-d703e1f1dd9f@solarflare.com>

Sure. Format change was unintentional and happened during internal merge, I’ll fix that and remove function name and send V2.

--
Thanks
Nithin

From: Andrew Rybchenko <arybchenko@solarflare.com>
Sent: Monday, January 7, 2019 8:17 PM
To: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com>; Andrew Rybchenko <arybchenko@solarflare.com>
Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: report error on name truncation

External Email
________________________________
On 1/7/19 5:40 PM, Nithin Kumar Dabilpuram wrote:

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com><mailto:ndabilpuram@marvell.com>

---

 lib/librte_ethdev/rte_ethdev.c | 12 ++++++++++--

 1 file changed, 10 insertions(+), 2 deletions(-)



diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c

index 9d5107d..bd45445 100644

--- a/lib/librte_ethdev/rte_ethdev.c

+++ b/lib/librte_ethdev/rte_ethdev.c

@@ -3588,9 +3588,17 @@ rte_eth_dma_zone_reserve(const struct rte_eth_dev *dev, const char *ring_name,

 {

        char z_name[RTE_MEMZONE_NAMESIZE];

        const struct rte_memzone *mz;

+       int rc;



-       snprintf(z_name, sizeof(z_name), "eth_p%d_q%d_%s",

-                dev->data->port_id, queue_id, ring_name);

+       rc = snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",

+                     dev->device->driver->name, ring_name,

+                     dev->data->port_id, queue_id);

+

+       if (rc >= RTE_MEMZONE_NAMESIZE) {

+               RTE_LOG(ERR, EAL, "%s(): truncated name\n", __func__);

+               rte_errno = ENAMETOOLONG;

+               return NULL;

+       }



        mz = rte_memzone_lookup(z_name);

        if (mz)

It is good to report an error in the case of name truncation, but the patch
does more. It changes format of the memzone name, adds the driver name
in it (what is bad since testpmd has commands to find the memzone by name
and read descriptors (hack, but sometimes very useful)).
Also I'm not sure about function name in the log message. Other places
do not have it.

  parent reply	other threads:[~2019-01-08  6:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 14:40 [dpdk-dev] " Nithin Kumar Dabilpuram
2019-01-07 14:47 ` Andrew Rybchenko
2019-01-07 15:53   ` Stephen Hemminger
2019-01-07 16:17     ` Andrew Rybchenko
2019-01-08  6:06   ` Nithin Kumar Dabilpuram [this message]
2019-01-07 14:50 ` Thomas Monjalon
2019-01-08  5:32   ` [dpdk-dev] [EXT] " Nithin Kumar Dabilpuram
2019-01-13 15:38 ` [dpdk-dev] [PATCH v2] " Nithin Kumar Dabilpuram
2019-01-13 19:28   ` Wiles, Keith
2019-01-13 20:02     ` Thomas Monjalon
2019-01-13 20:19       ` Wiles, Keith
2019-01-13 21:21         ` Thomas Monjalon
2019-01-14  7:32           ` Andrew Rybchenko
2019-01-14 14:30   ` Thomas Monjalon
2019-01-17 14:13 ` [dpdk-dev] [PATCH v3] " Nithin Kumar Dabilpuram
2019-01-17 15:38   ` Thomas Monjalon
2019-01-17 17:07     ` 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=DM6PR18MB242751AA8C04D377AF4AE2FEAF8A0@DM6PR18MB2427.namprd18.prod.outlook.com \
    --to=ndabilpuram@marvell.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --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).