app/pdump: fix port id storage size

Message ID 20181113142655.28535-1-marko.kovacevic@intel.com (mailing list archive)
State Superseded, archived
Headers
Series app/pdump: fix port id storage size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Kovacevic, Marko Nov. 13, 2018, 2:26 p.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

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
 app/pdump/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Pattan, Reshma Nov. 13, 2018, 5:09 p.m. UTC | #1
> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Tuesday, November 13, 2018 2:27 PM
> 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>
> 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")
> Cc: zhiyong.yang@intel.com
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> ---
>  app/pdump/main.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/pdump/main.c b/app/pdump/main.c index d96556e..baabd04
> 100644
> --- a/app/pdump/main.c
> +++ b/app/pdump/main.c
> @@ -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
  
Kovacevic, Marko Nov. 14, 2018, 8:39 a.m. UTC | #2
> > 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
> >
> > Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> > ---
> >  app/pdump/main.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/app/pdump/main.c b/app/pdump/main.c index
> > d96556e..baabd04
> > 100644
> > --- a/app/pdump/main.c
> > +++ b/app/pdump/main.c
> > @@ -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

Sure Reshma will do it right now.

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


Acked-by: Reshma Pattan  <reshma.pattan@intel.com>
  

Patch

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