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>
Subject: [dpdk-dev] [PATCH v2 2/3] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN
Date: Tue, 29 Dec 2020 12:09:00 -0800
Message-ID: <20201229200901.101171-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20201229200901.101171-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-29 20:09 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 ` [dpdk-dev] [PATCH 2/2] pdump: replace DEVICE_ID_SIZE with RTE_DEV_NAME_MAX_LEN Stephen Hemminger
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   ` Stephen Hemminger [this message]
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=20201229200901.101171-3-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git