DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Reshma Pattan <reshma.pattan@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN
Date: Sat, 26 Dec 2020 19:33:35 -0800	[thread overview]
Message-ID: <20201227033335.85145-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20201227033335.85145-1-stephen@networkplumber.org>

The device string has an existing size in rte_dev.h
use that instead of defining our own.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_pdump/rte_pdump.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c
index 3c11bd795bc1..14a392ef0340 100644
--- a/lib/librte_pdump/rte_pdump.c
+++ b/lib/librte_pdump/rte_pdump.c
@@ -12,8 +12,6 @@
 
 #include "rte_pdump.h"
 
-#define DEVICE_ID_SIZE 64
-
 RTE_LOG_REGISTER(pdump_logtype, lib.pdump, NOTICE);
 
 /* Macro for printing using RTE_LOG */
@@ -39,14 +37,14 @@ struct pdump_request {
 	uint32_t flags;
 	union pdump_data {
 		struct enable_v1 {
-			char device[DEVICE_ID_SIZE];
+			char device[RTE_DEV_NAME_MAX_LEN];
 			uint16_t queue;
 			struct rte_ring *ring;
 			struct rte_mempool *mp;
 			void *filter;
 		} en_v1;
 		struct disable_v1 {
-			char device[DEVICE_ID_SIZE];
+			char device[RTE_DEV_NAME_MAX_LEN];
 			uint16_t queue;
 			struct rte_ring *ring;
 			struct rte_mempool *mp;
@@ -485,9 +483,8 @@ rte_pdump_enable(uint16_t port, uint16_t queue, uint32_t flags,
 			struct rte_mempool *mp,
 			void *filter)
 {
-
-	int ret = 0;
-	char name[DEVICE_ID_SIZE];
+	int ret;
+	char name[RTE_DEV_NAME_MAX_LEN];
 
 	ret = pdump_validate_port(port, name);
 	if (ret < 0)
@@ -531,7 +528,7 @@ int
 rte_pdump_disable(uint16_t port, uint16_t queue, uint32_t flags)
 {
 	int ret = 0;
-	char name[DEVICE_ID_SIZE];
+	char name[RTE_DEV_NAME_MAX_LEN];
 
 	ret = pdump_validate_port(port, name);
 	if (ret < 0)
-- 
2.29.2


  parent reply	other threads:[~2020-12-27  3:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  3:33 [dpdk-dev] [PATCH 0/2] pdump: small enhancements Stephen Hemminger
2020-12-27  3:33 ` [dpdk-dev] [PATCH 1/2] pdump: use rte_pktmbuf_free bulk Stephen Hemminger
2020-12-29  5:40   ` Morten Brørup
2020-12-27  3:33 ` Stephen Hemminger [this message]
2020-12-29 20:08 ` [dpdk-dev] [PATCH v2 0/3] pdump: small enhancements Stephen Hemminger
2020-12-29 20:08   ` [dpdk-dev] [PATCH v2 1/3] pdump: use rte_pktmbuf_free bulk Stephen Hemminger
2020-12-29 20:09   ` [dpdk-dev] [PATCH v2 2/3] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN Stephen Hemminger
2020-12-29 20:09   ` [dpdk-dev] [PATCH v2 3/3] pdump: cleanup checkpatch warnings Stephen Hemminger
2021-01-19 14:25   ` [dpdk-dev] [PATCH v2 0/3] pdump: small enhancements Thomas Monjalon

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=20201227033335.85145-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.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).