diff mbox series

[2/3] examples/ip_fragmentation: remove usage of internal struct

Message ID 20190715095623.579-3-marcinx.a.zapolski@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series examples: remove usage of internal structures | expand

Checks

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

Commit Message

Marcin Zapolski July 15, 2019, 9:56 a.m. UTC
Modify ip_fragmentation example app to use rte_eth_info_get instead
of global rte_eth_devices structure.

Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
---
 examples/ip_fragmentation/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bruce Richardson July 15, 2019, 2:39 p.m. UTC | #1
On Mon, Jul 15, 2019 at 11:56:22AM +0200, Marcin Zapolski wrote:
> Modify ip_fragmentation example app to use rte_eth_info_get instead
> of global rte_eth_devices structure.
> 
> Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
> ---
>  examples/ip_fragmentation/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> index 85c0100f7..a2a14e827 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -989,7 +989,7 @@ main(int argc, char **argv)
>  			if (rte_lcore_is_enabled(lcore_id) == 0)
>  				continue;
>  
> -			if (queueid >= rte_eth_devices[portid].data->nb_tx_queues)
> +			if (queueid >= dev_info.nb_tx_queues)
>  				break;
>  
>  			socket = (int) rte_lcore_to_socket_id(lcore_id);
> -- 

LGTM.
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Bruce Richardson July 15, 2019, 2:45 p.m. UTC | #2
On Mon, Jul 15, 2019 at 03:39:56PM +0100, Bruce Richardson wrote:
> On Mon, Jul 15, 2019 at 11:56:22AM +0200, Marcin Zapolski wrote:
> > Modify ip_fragmentation example app to use rte_eth_info_get instead
> > of global rte_eth_devices structure.
> > 
> > Signed-off-by: Marcin Zapolski <marcinx.a.zapolski@intel.com>
> > ---
> >  examples/ip_fragmentation/main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> > index 85c0100f7..a2a14e827 100644
> > --- a/examples/ip_fragmentation/main.c
> > +++ b/examples/ip_fragmentation/main.c
> > @@ -989,7 +989,7 @@ main(int argc, char **argv)
> >  			if (rte_lcore_is_enabled(lcore_id) == 0)
> >  				continue;
> >  
> > -			if (queueid >= rte_eth_devices[portid].data->nb_tx_queues)
> > +			if (queueid >= dev_info.nb_tx_queues)
> >  				break;
> >  
> >  			socket = (int) rte_lcore_to_socket_id(lcore_id);
> > -- 
> 
> LGTM.
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Forgot one minor comment. Suggest reword title to be "fix use of internal
struct" and add fixes line below to commit body.

Fixes: 9758b956dcf4 ("examples/ip_fragmentation: fix Tx queues init")
diff mbox series

Patch

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 85c0100f7..a2a14e827 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -989,7 +989,7 @@  main(int argc, char **argv)
 			if (rte_lcore_is_enabled(lcore_id) == 0)
 				continue;
 
-			if (queueid >= rte_eth_devices[portid].data->nb_tx_queues)
+			if (queueid >= dev_info.nb_tx_queues)
 				break;
 
 			socket = (int) rte_lcore_to_socket_id(lcore_id);