Skip to contentSkip to conversation

app/pdump: fix port id storage size

PATCH In review Marko Kovacevic 3 participants 9 messages Nov 13, 2018 – Nov 18, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")
---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/pdump/main.c +3 -3
index d96556e..baabd04 100644
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)
 			goto free_kvlist;
-		pt->port = (uint8_t) v.val;
+		pt->port = (uint16_t) v.val;
 		pt->dump_by_type = PORT_ID;
 	} else if (cnt2 == 1) {
 		ret = rte_kvargs_process(kvlist, PDUMP_PCI_ARG,
@@ -435,7 +435,7 @@ disable_pdump(struct pdump_tuples *pt)
 }
 
 static inline void
-pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
+pdump_rxtx(struct rte_ring *ring, uint16_t vdev_id, struct pdump_stats *stats)
 {
 	/* write input packets of port to vdev for pdump */
 	struct rte_mbuf *rxtx_bufs[BURST_SIZE];
@@ -462,7 +462,7 @@ pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
 }
 
 static void
-free_ring_data(struct rte_ring *ring, uint8_t vdev_id,
+free_ring_data(struct rte_ring *ring, uint16_t vdev_id,
 		struct pdump_stats *stats)
 {
 	while (rte_ring_count(ring))
Signature · 1 line
2.9.5
#1 lore raw

PATCH 1/1 app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")
---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/pdump/main.c +3 -3
index d96556e..baabd04 100644
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)
 			goto free_kvlist;
-		pt->port = (uint8_t) v.val;
+		pt->port = (uint16_t) v.val;
 		pt->dump_by_type = PORT_ID;
 	} else if (cnt2 == 1) {
 		ret = rte_kvargs_process(kvlist, PDUMP_PCI_ARG,
@@ -435,7 +435,7 @@ disable_pdump(struct pdump_tuples *pt)
 }
 
 static inline void
-pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
+pdump_rxtx(struct rte_ring *ring, uint16_t vdev_id, struct pdump_stats *stats)
 {
 	/* write input packets of port to vdev for pdump */
 	struct rte_mbuf *rxtx_bufs[BURST_SIZE];
@@ -462,7 +462,7 @@ pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
 }
 
 static void
-free_ring_data(struct rte_ring *ring, uint8_t vdev_id,
+free_ring_data(struct rte_ring *ring, uint16_t vdev_id,
 		struct pdump_stats *stats)
 {
 	while (rte_ring_count(ring))
Signature · 1 line
2.9.5
#2 lore raw

PATCH v2 1/1 app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")

--
v2:
Added cc to stable

---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/pdump/main.c +3 -3
index d96556e..baabd04 100644
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)
 			goto free_kvlist;
-		pt->port = (uint8_t) v.val;
+		pt->port = (uint16_t) v.val;
 		pt->dump_by_type = PORT_ID;
 	} else if (cnt2 == 1) {
 		ret = rte_kvargs_process(kvlist, PDUMP_PCI_ARG,
@@ -435,7 +435,7 @@ disable_pdump(struct pdump_tuples *pt)
 }
 
 static inline void
-pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
+pdump_rxtx(struct rte_ring *ring, uint16_t vdev_id, struct pdump_stats *stats)
 {
 	/* write input packets of port to vdev for pdump */
 	struct rte_mbuf *rxtx_bufs[BURST_SIZE];
@@ -462,7 +462,7 @@ pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
 }
 
 static void
-free_ring_data(struct rte_ring *ring, uint8_t vdev_id,
+free_ring_data(struct rte_ring *ring, uint16_t vdev_id,
 		struct pdump_stats *stats)
 {
 	while (rte_ring_count(ring))
Signature · 1 line
2.9.5
#3 lore raw

PATCH v3 1/1 app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")

--
v2:
Added cc to stable
v3:
Changed two more values to uint16_t (Reshma)

---
 app/pdump/main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
app/pdump/main.c +5 -5
index d96556e..9e86bf6 100644
@@ -119,8 +119,8 @@ struct pdump_tuples {
 
 	/* params for packet dumping */
 	enum pdump_by dump_by_type;
-	int rx_vdev_id;
-	int tx_vdev_id;
+	uint16_t rx_vdev_id;
+	uint16_t tx_vdev_id;
 	enum pcap_stream rx_vdev_stream_type;
 	enum pcap_stream tx_vdev_stream_type;
 	bool single_pdump_dev;
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)
 			goto free_kvlist;
-		pt->port = (uint8_t) v.val;
+		pt->port = (uint16_t) v.val;
 		pt->dump_by_type = PORT_ID;
 	} else if (cnt2 == 1) {
 		ret = rte_kvargs_process(kvlist, PDUMP_PCI_ARG,
@@ -435,7 +435,7 @@ disable_pdump(struct pdump_tuples *pt)
 }
 
 static inline void
-pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
+pdump_rxtx(struct rte_ring *ring, uint16_t vdev_id, struct pdump_stats *stats)
 {
 	/* write input packets of port to vdev for pdump */
 	struct rte_mbuf *rxtx_bufs[BURST_SIZE];
@@ -462,7 +462,7 @@ pdump_rxtx(struct rte_ring *ring, uint8_t vdev_id, struct pdump_stats *stats)
 }
 
 static void
-free_ring_data(struct rte_ring *ring, uint8_t vdev_id,
+free_ring_data(struct rte_ring *ring, uint16_t vdev_id,
 		struct pdump_stats *stats)
 {
 	while (rte_ring_count(ring))
Signature · 1 line
2.9.5
Acked-by on v3 1/1
#4 lore raw
Quoted 11 lines

-----Original Message-----
From: Kovacevic, Marko
Sent: Wednesday, November 14, 2018 8:57 AM
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; Pattan, Reshma <[email protected]>; Kovacevic, Marko <[email protected]>; Yang, Zhiyong <[email protected]>; [email protected]
Subject: [PATCH v3] app/pdump: fix port id storage size

Quoted 8 lines

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")
#6 lore raw
In reply to Marko Kovacevic
Quoted 27 lines

-----Original Message-----
From: Kovacevic, Marko
Sent: Tuesday, November 13, 2018 2:27 PM
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; Pattan, Reshma <[email protected]>; Kovacevic, Marko <[email protected]>; Yang, Zhiyong <[email protected]>
Subject: [PATCH] app/pdump: fix port id storage size

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")
---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/pdump/main.c index d96556e..baabd04 renamed from app/pdump/main.c +0 -0

100644

app/pdump/main.c parse_pdump(const char *optarg) · line 267

Quoted 2 lines
app/pdump/main.c +0 -0
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)

Can you also int type to unit16_t for below two.

        int rx_vdev_id;
        int tx_vdev_id;

Thanks,
Reshma

#7 lore raw
Quoted 22 lines
Quoted 17 lines

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")
---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
app/pdump/main.c index renamed from app/pdump/main.c +0 -0

d96556e..baabd04
100644

app/pdump/main.c parse_pdump(const char *optarg) · line 267

Quoted 2 lines
app/pdump/main.c +0 -0
@@ -266,7 +266,7 @@ parse_pdump(const char *optarg)
 				&parse_uint_value, &v);
 		if (ret < 0)

Can you also int type to unit16_t for below two.

Quoted 5 lines
        int rx_vdev_id;
        int tx_vdev_id;

Thanks,
Reshma

Sure Reshma will do it right now.

Marko K.

#8 lore raw
Quoted 17 lines

-----Original Message-----
From: Kovacevic, Marko
Sent: Wednesday, November 14, 2018 8:39 AM
To: Pattan, Reshma <[email protected]>; [email protected]
Cc: Yigit, Ferruh <[email protected]>; Yang, Zhiyong <[email protected]>
Subject: RE: [PATCH] app/pdump: fix port id storage size

Quoted 7 lines
Quoted 7 lines

port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes f8244c6399d9 ("ethdev: increase port id range")