From: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
To: dts@dpdk.org
Cc: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
Subject: [dts] [PATCH V1] tests/rss_to_rte_flow:modify send_packet
Date: Sun, 19 Jan 2020 17:34:10 +0800 [thread overview]
Message-ID: <1579426450-226940-1-git-send-email-xiaoxiaox.zeng@intel.com> (raw)
Signed-off-by: Zeng Xiaoxiao <xiaoxiaox.zeng@intel.com>
---
| 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--git a/tests/TestSuite_rss_to_rte_flow.py b/tests/TestSuite_rss_to_rte_flow.py
index d062dd5..593d694 100644
--- a/tests/TestSuite_rss_to_rte_flow.py
+++ b/tests/TestSuite_rss_to_rte_flow.py
@@ -38,6 +38,7 @@ Test moving RSS to rte_flow.
import time
import re
+import packet
from test_case import TestCase
from pmd_output import PmdOutput
@@ -115,18 +116,18 @@ class TestRSS_to_Rteflow(TestCase):
"""
Sends packets.
"""
- self.tester.scapy_foreground()
- time.sleep(2)
+ pkt_list = []
for i in range(128):
if ptype == "ipv4-udp":
- packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)], iface="%s")' % (
- self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22, itf)
+ scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")/UDP(dport=%d, sport=%d)' % (
+ self.pf_mac, self.tester_mac, i + 1, i + 2, i + 21, i + 22)
elif ptype == "ipv4-other":
- packet = r'sendp([Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")], iface="%s")' % (
- self.pf_mac, self.tester_mac, i + 1, i + 2, itf)
- self.tester.scapy_append(packet)
- self.tester.scapy_execute()
- time.sleep(2)
+ scapy_pkt = 'Ether(dst="%s", src="%s")/IP(src="192.168.0.%d", dst="192.168.0.%d")' % (self.pf_mac, self.tester_mac, i + 1, i + 2)
+ pkt_list.append(scapy_pkt)
+
+ pkt = packet.Packet()
+ pkt.update_pkt(pkt_list)
+ pkt.send_pkt(self.tester, tx_port=itf)
def check_packet_queue(self, queue, out):
"""
--
1.8.3.1
next reply other threads:[~2020-01-19 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-19 9:34 Zeng Xiaoxiao [this message]
2020-01-20 5:45 ` Tu, Lijuan
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=1579426450-226940-1-git-send-email-xiaoxiaox.zeng@intel.com \
--to=xiaoxiaox.zeng@intel.com \
--cc=dts@dpdk.org \
/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).