[dpdk-dev] Fix rate computation

Message ID 20170321095440.22216-1-castets.j@gmail.com (mailing list archive)
State Not Applicable, archived
Headers

Checks

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

Commit Message

Julien Castets March 21, 2017, 9:54 a.m. UTC
  From: Julien Castets <jcastets@scaleway.com>

Signed-off-by: Julien Castets <jcastets@scaleway.com>
---
 app/pktgen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Wiles, Keith March 21, 2017, 2:48 p.m. UTC | #1
> On Mar 21, 2017, at 4:54 AM, Julien Castets <castets.j@gmail.com> wrote:
> 
> From: Julien Castets <jcastets@scaleway.com>
> 
> Signed-off-by: Julien Castets <jcastets@scaleway.com>
> ---
> app/pktgen.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/pktgen.c b/app/pktgen.c
> index e315bff..9a304c0 100644
> --- a/app/pktgen.c
> +++ b/app/pktgen.c
> @@ -110,7 +110,7 @@ pktgen_packet_rate(port_info_t *info)
> 	uint64_t cpp = (pps > 0) ? (pktgen.hz / pps) : (pktgen.hz / 4);
> 
> 	info->tx_pps    = pps;
> -	info->tx_cycles = ((cpp * info->tx_burst) / get_port_txcnt(pktgen.l2p, info->pid));
> +	info->tx_cycles = ((cpp * info->tx_burst) * get_port_txcnt(pktgen.l2p, info->pid));
> }

I have already made the change, thanks for the patch. I assumed it fixed the problem as I have not found an email confirming the fix. Thanks.

> 
> /**************************************************************************//**
> -- 
> 2.11.0
> 

Regards,
Keith
  

Patch

diff --git a/app/pktgen.c b/app/pktgen.c
index e315bff..9a304c0 100644
--- a/app/pktgen.c
+++ b/app/pktgen.c
@@ -110,7 +110,7 @@  pktgen_packet_rate(port_info_t *info)
 	uint64_t cpp = (pps > 0) ? (pktgen.hz / pps) : (pktgen.hz / 4);
 
 	info->tx_pps    = pps;
-	info->tx_cycles = ((cpp * info->tx_burst) / get_port_txcnt(pktgen.l2p, info->pid));
+	info->tx_cycles = ((cpp * info->tx_burst) * get_port_txcnt(pktgen.l2p, info->pid));
 }
 
 /**************************************************************************//**