test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Liu, Yong" <yong.liu@intel.com>
To: "xu,gang" <gangx.xu@intel.com>, dts@dpdk.org
Subject: Re: [dts] [PATCH V1] add send a specified number of packages function
Date: Wed, 14 Dec 2016 15:58:12 +0800	[thread overview]
Message-ID: <5850FB94.60701@intel.com> (raw)
In-Reply-To: <1479870662-10369-1-git-send-email-gangx.xu@intel.com>

Applied, sorry for miss the mail.

On 11/23/2016 11:11 AM, xu,gang wrote:
> Signed-off-by: xu,gang <gangx.xu@intel.com>
> ---
>   framework/packet.py | 14 +++++++-------
>   1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/framework/packet.py b/framework/packet.py
> index 05a3d1f..f19a638 100755
> --- a/framework/packet.py
> +++ b/framework/packet.py
> @@ -327,12 +327,12 @@ class scapy(object):
>           except:
>               pass
>   
> -    def send_pcap_pkt(self, crb=None, file='', intf=''):
> +    def send_pcap_pkt(self, crb=None, file='', intf='', count=1):
>           if intf == '' or file == '' or crb is None:
>               print "Invalid option for send packet by scapy"
>               return
>   
> -        content = 'pkts=rdpcap(\"%s\");sendp(pkts, iface=\"%s\");exit()' % (file, intf)
> +        content = 'pkts=rdpcap(\"%s\");sendp(pkts, iface=\"%s\", count=\"%s\" );exit()' % (file, intf, count)
>           cmd_file = '/tmp/scapy_%s.cmd' % intf
>   
>           crb.create_file(content, cmd_file)
> @@ -341,12 +341,12 @@ class scapy(object):
>       def print_summary(self):
>           print "Send out pkt %s" % self.pkt.summary()
>   
> -    def send_pkt(self, intf=''):
> +    def send_pkt(self, intf='', count=1):
>           self.print_summary()
>           if intf != '':
>               # fix fortville can't receive packets with 00:00:00:00:00:00
>               self.pkt.getlayer(0).src = get_if_hwaddr(intf)
> -            sendp(self.pkt, iface=intf)
> +            sendp(self.pkt, iface=intf, count=count)
>   
>   
>   class Packet(object):
> @@ -443,7 +443,7 @@ class Packet(object):
>               raw_confs['payload'] = payload
>               self.config_layer('raw', raw_confs)
>   
> -    def send_pkt(self, crb=None, tx_port='', auto_cfg=True):
> +    def send_pkt(self, crb=None, tx_port='', auto_cfg=True, count=1):
>           if tx_port == '':
>               print "Invalid Tx interface"
>               return
> @@ -459,9 +459,9 @@ class Packet(object):
>               crb.session.copy_file_to(self.uni_name)
>               pcap_file = self.uni_name.split('/')[2]
>               self.pktgen.send_pcap_pkt(
> -                crb=crb, file=pcap_file, intf=self.tx_port)
> +                crb=crb, file=pcap_file, intf=self.tx_port, count=count)
>           else:
> -            self.pktgen.send_pkt(intf=self.tx_port)
> +            self.pktgen.send_pkt(intf=self.tx_port, count=count)
>   
>       def check_layer_config(self, layer, config):
>           """

      reply	other threads:[~2016-12-14  8:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  3:11 xu,gang
2016-12-14  7:58 ` Liu, Yong [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=5850FB94.60701@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    --cc=gangx.xu@intel.com \
    /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).