[v3] app/pdump: fix port id storage size

Message ID 20181114085645.27565-1-marko.kovacevic@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v3] app/pdump: fix port id storage size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Kovacevic, Marko Nov. 14, 2018, 8:56 a.m. UTC
  port_id size should be uint16_t,
fix where it is defined as uint8_t

Fixes: f8244c6399d9 ("ethdev: increase port id range")
Cc: zhiyong.yang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

--
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(-)
  

Comments

Pattan, Reshma Nov. 14, 2018, 10:28 a.m. UTC | #1
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Wednesday, November 14, 2018 8:57 AM
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Pattan, Reshma
> <reshma.pattan@intel.com>; Kovacevic, Marko <marko.kovacevic@intel.com>;
> Yang, Zhiyong <zhiyong.yang@intel.com>; stable@dpdk.org
> Subject: [PATCH v3] 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")
> Cc: zhiyong.yang@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

Acked-by: Reshma Pattan <reshma.pattan@intel.com>
  
Thomas Monjalon Nov. 18, 2018, 8:42 p.m. UTC | #2
14/11/2018 11:28, Pattan, Reshma:
> From: Kovacevic, Marko
> > 
> > port_id size should be uint16_t,
> > fix where it is defined as uint8_t
> > 
> > Fixes: f8244c6399d9 ("ethdev: increase port id range")
> > Cc: zhiyong.yang@intel.com
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> 
> Acked-by: Reshma Pattan <reshma.pattan@intel.com>

Applied, thanks
  

Patch

diff --git a/app/pdump/main.c b/app/pdump/main.c
index d96556e..9e86bf6 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -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))