DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Wiles, Keith" <keith.wiles@intel.com>
To: inaki.murillo <inaki.murilloa@ehu.eus>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] Rate as a decimal number
Date: Thu, 21 Apr 2016 16:59:52 +0000	[thread overview]
Message-ID: <8317DF57-0862-421F-822F-BCC60A21D0AF@intel.com> (raw)
In-Reply-To: <1461252824-21992-1-git-send-email-inaki.murilloa@ehu.eus>

>Currently Pktgen does not accept a decimal number for the rate. This patch makes possible to set a decimal number as a rate.
>
>Signed-off-by: Iñaki Murillo Arroyo <inaki.murilloa@ehu.eus>
>---
> app/cmd-functions.c    |   71 +-
> app/cmd-functions.h    |   38 +
> app/lpktgenlib.c       |    2 +-
> app/pktgen-cmds.c      |   10 +-
> app/pktgen-cmds.c.orig | 2622 ++++++++++++++++++++++++++++++++++++++++++++++++
> app/pktgen-cmds.h      |    2 +-
> app/pktgen-port-cfg.h  |    2 +-
> app/pktgen.c           |    2 +-
> 8 files changed, 2737 insertions(+), 12 deletions(-)
> create mode 100644 app/pktgen-cmds.c.orig
>
>diff --git a/app/cmd-functions.c b/app/cmd-functions.c
>index b2fda7c..a009907 100644
>--- a/app/cmd-functions.c
>+++ b/app/cmd-functions.c
>@@ -1805,7 +1805,7 @@ struct cmd_set_result {
> 	cmdline_fixed_string_t set;
> 	cmdline_portlist_t portlist;
> 	cmdline_fixed_string_t what;
>-	uint32_t value;
>+	float value;
> };
> 



Looks like you checked in the pktgen-cmds.c.orig file and it shows up here are the complete file. Can you remove it and resend the patch again with Pktgen in the subject and called v2 version.

Thanks

>		rate = 1;
>diff --git a/app/pktgen-cmds.c.orig b/app/pktgen-cmds.c.orig
>new file mode 100644
>index 0000000..83ba230
>--- /dev/null
>+++ b/app/pktgen-cmds.c.orig
>@@ -0,0 +1,2622 @@
>+/*-
>+ * Copyright (c) <2010>, Intel Corporation
>+ * All rights reserved.
>+ *
>+ * Redistribution and use in source and binary forms, with or without
>+ * modification, are permitted provided that the following conditions
>+ * are met:
>+ *
>+ * - Redistributions of source code must retain the above copyright
>+ *   notice, this list of conditions and the following disclaimer.
>+ *
>+ * - Redistributions in binary form must reproduce the above copyright
>+ *   notice, this list of conditions and the following disclaimer in
>+ *   the documentation and/or other materials provided with the
>+ *   distribution.
>+ *
>+ * - Neither the name of Intel Corporation nor the names of its
>+ *   contributors may be used to endorse or promote products derived
>+ *   from this software without specific prior written permission.
>+ *
>+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
>+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
>+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
>+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
>+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
>+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
>+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
>+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
>+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
>+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
>+ * OF THE POSSIBILITY OF SUCH DAMAGE.
>+ */


>
>diff --git a/app/pktgen-cmds.h b/app/pktgen-cmds.h
>index 683abc3..1c50e59 100644
>--- a/app/pktgen-cmds.h
>+++ b/app/pktgen-cmds.h
>@@ -135,7 +135,7 @@ extern void pktgen_set_pkt_size(port_info_t *info, uint32_t size);
> extern void pktgen_set_port_value(port_info_t *info,
>                                   char type,
>                                   uint32_t portValue);
>-extern void pktgen_set_tx_rate(port_info_t *info, uint32_t rate);
>+extern void pktgen_set_tx_rate(port_info_t *info, float rate);
> extern void pktgen_set_ipaddr(port_info_t *info, char type,
>                               cmdline_ipaddr_t *ip);
> extern void pktgen_set_dst_mac(port_info_t *info, cmdline_etheraddr_t *mac);
>diff --git a/app/pktgen-port-cfg.h b/app/pktgen-port-cfg.h
>index bd5876c..a20286d 100644
>--- a/app/pktgen-port-cfg.h
>+++ b/app/pktgen-port-cfg.h
>@@ -193,7 +193,7 @@ typedef struct port_info_s {
> 	uint16_t pid;		/**< Port ID value */
> 	uint16_t tx_burst;	/**< Number of TX burst packets */
> 	uint8_t pad0;
>-	uint8_t tx_rate;		/**< Percentage rate for tx packets */
>+	float tx_rate;		/**< Percentage rate for tx packets */
> 	rte_atomic32_t port_flags;	/**< Special send flags for ARP and other */
> 
> 	rte_atomic64_t transmit_count;	/**< Packets to transmit loaded into current_tx_count */
>diff --git a/app/pktgen.c b/app/pktgen.c
>index a0705ab..a64e0ca 100644
>--- a/app/pktgen.c
>+++ b/app/pktgen.c
>@@ -143,7 +143,7 @@ pktgen_packet_rate(port_info_t *info)
> 	info->tx_pps    = pps;
> 	info->tx_cycles = ((cpp * info->tx_burst) /
> 	                       wr_get_port_txcnt(pktgen.l2p, info->pid));
>-	info->tx_cycles -= ff[info->tx_rate / 10];
>+	info->tx_cycles -= ff[(int)info->tx_rate / 10];
> }
> 
> /**************************************************************************//**
>-- 
>1.9.1
>
>


Regards,
Keith





      reply	other threads:[~2016-04-21 16:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21 15:33 inaki.murillo
2016-04-21 16:59 ` Wiles, Keith [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8317DF57-0862-421F-822F-BCC60A21D0AF@intel.com \
    --to=keith.wiles@intel.com \
    --cc=dev@dpdk.org \
    --cc=inaki.murilloa@ehu.eus \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).