* [dts] [PATCH V2] filter lldp when sniff packet on tester
@ 2017-02-23 2:40 xu,huilong
2017-02-23 7:06 ` Liu, Yong
0 siblings, 1 reply; 3+ messages in thread
From: xu,huilong @ 2017-02-23 2:40 UTC (permalink / raw)
To: dts; +Cc: xu,huilong
in new dpdk.org code, fortville nic will auto send lldp packet when the nic setup
so should filter lldp packet when sniff packet on tester
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
tests/TestSuite_checksum_offload.py | 2 +-
tests/TestSuite_nvgre.py | 2 +-
tests/TestSuite_vxlan.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_checksum_offload.py b/tests/TestSuite_checksum_offload.py
index 7989c14..1f01d47 100644
--- a/tests/TestSuite_checksum_offload.py
+++ b/tests/TestSuite_checksum_offload.py
@@ -105,7 +105,7 @@ class TestChecksumOffload(TestCase):
self.tester.send_expect("exit()", "#")
self.tester.scapy_background()
- self.tester.scapy_append('p = sniff(filter="ether src %s", iface="%s", count=%d)' % (sniff_src, rx_interface, len(packets_sent)))
+ self.tester.scapy_append('p = sniff(filter="ether[12] != 0x88 or ether[13] != 0xcc", iface="%s", count=%d)' % (rx_interface, len(packets_sent)))
self.tester.scapy_append('nr_packets=len(p)')
self.tester.scapy_append('reslist = [p[i].sprintf("%IP.chksum%;%TCP.chksum%;%UDP.chksum%;%SCTP.chksum%") for i in range(nr_packets)]')
self.tester.scapy_append('import string')
diff --git a/tests/TestSuite_nvgre.py b/tests/TestSuite_nvgre.py
index 015aa9f..f6161e0 100644
--- a/tests/TestSuite_nvgre.py
+++ b/tests/TestSuite_nvgre.py
@@ -575,7 +575,7 @@ class TestNvgre(TestCase):
self.tester.send_expect("rm -rf %s" % config.capture_file, "# ")
# save the capture packet into pcap format
self.tester.scapy_background()
- self.tester.scapy_append('p=sniff(iface="%s",count=1,timeout=5)' % self.tester_rx_iface)
+ self.tester.scapy_append('p=sniff(filter="ether[12] != 0x88 or ether[13 != 0xcc]",iface="%s",count=1,timeout=5)' % self.tester_rx_iface)
self.tester.scapy_append('wrpcap(\"%s\", p)' % config.capture_file)
self.tester.scapy_foreground()
diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py
index 5fef9d9..6aa1164 100644
--- a/tests/TestSuite_vxlan.py
+++ b/tests/TestSuite_vxlan.py
@@ -446,7 +446,7 @@ class TestVxlan(TestCase, IxiaPacketGenerator):
# save the capture packet into pcap format
self.tester.scapy_background()
self.tester.scapy_append(
- 'p=sniff(iface="%s",count=1,timeout=5)' % self.recv_iface)
+ 'p=sniff(filter="ether[12] != 0x88 or ether[13] != 0xcc",iface="%s",count=1,timeout=5)' % self.recv_iface)
self.tester.scapy_append(
'wrpcap(\"%s\", p)' % config.capture_file)
self.tester.scapy_foreground()
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V2] filter lldp when sniff packet on tester
2017-02-23 2:40 [dts] [PATCH V2] filter lldp when sniff packet on tester xu,huilong
@ 2017-02-23 7:06 ` Liu, Yong
2017-02-28 1:39 ` Xu, HuilongX
0 siblings, 1 reply; 3+ messages in thread
From: Liu, Yong @ 2017-02-23 7:06 UTC (permalink / raw)
To: Xu, HuilongX, dts; +Cc: Xu, HuilongX
Huilong,
Please try sniff_packets in packet module. LLDP filter has been implemented in this function.
Thanks,
Marvin
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong
> Sent: Thursday, February 23, 2017 10:41 AM
> To: dts@dpdk.org
> Cc: Xu, HuilongX <huilongx.xu@intel.com>
> Subject: [dts] [PATCH V2] filter lldp when sniff packet on tester
>
> in new dpdk.org code, fortville nic will auto send lldp packet when the
> nic setup
> so should filter lldp packet when sniff packet on tester
>
> Signed-off-by: xu,huilong <huilongx.xu@intel.com>
> ---
> tests/TestSuite_checksum_offload.py | 2 +-
> tests/TestSuite_nvgre.py | 2 +-
> tests/TestSuite_vxlan.py | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/TestSuite_checksum_offload.py
> b/tests/TestSuite_checksum_offload.py
> index 7989c14..1f01d47 100644
> --- a/tests/TestSuite_checksum_offload.py
> +++ b/tests/TestSuite_checksum_offload.py
> @@ -105,7 +105,7 @@ class TestChecksumOffload(TestCase):
> self.tester.send_expect("exit()", "#")
>
> self.tester.scapy_background()
> - self.tester.scapy_append('p = sniff(filter="ether src %s",
> iface="%s", count=%d)' % (sniff_src, rx_interface, len(packets_sent)))
> + self.tester.scapy_append('p = sniff(filter="ether[12] != 0x88 or
> ether[13] != 0xcc", iface="%s", count=%d)' % (rx_interface,
> len(packets_sent)))
> self.tester.scapy_append('nr_packets=len(p)')
> self.tester.scapy_append('reslist =
> [p[i].sprintf("%IP.chksum%;%TCP.chksum%;%UDP.chksum%;%SCTP.chksum%") for i
> in range(nr_packets)]')
> self.tester.scapy_append('import string')
> diff --git a/tests/TestSuite_nvgre.py b/tests/TestSuite_nvgre.py
> index 015aa9f..f6161e0 100644
> --- a/tests/TestSuite_nvgre.py
> +++ b/tests/TestSuite_nvgre.py
> @@ -575,7 +575,7 @@ class TestNvgre(TestCase):
> self.tester.send_expect("rm -rf %s" % config.capture_file, "# ")
> # save the capture packet into pcap format
> self.tester.scapy_background()
> - self.tester.scapy_append('p=sniff(iface="%s",count=1,timeout=5)' %
> self.tester_rx_iface)
> + self.tester.scapy_append('p=sniff(filter="ether[12] != 0x88 or
> ether[13 != 0xcc]",iface="%s",count=1,timeout=5)' % self.tester_rx_iface)
> self.tester.scapy_append('wrpcap(\"%s\", p)' %
> config.capture_file)
> self.tester.scapy_foreground()
>
> diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py
> index 5fef9d9..6aa1164 100644
> --- a/tests/TestSuite_vxlan.py
> +++ b/tests/TestSuite_vxlan.py
> @@ -446,7 +446,7 @@ class TestVxlan(TestCase, IxiaPacketGenerator):
> # save the capture packet into pcap format
> self.tester.scapy_background()
> self.tester.scapy_append(
> - 'p=sniff(iface="%s",count=1,timeout=5)' % self.recv_iface)
> + 'p=sniff(filter="ether[12] != 0x88 or ether[13] !=
> 0xcc",iface="%s",count=1,timeout=5)' % self.recv_iface)
> self.tester.scapy_append(
> 'wrpcap(\"%s\", p)' % config.capture_file)
> self.tester.scapy_foreground()
> --
> 1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dts] [PATCH V2] filter lldp when sniff packet on tester
2017-02-23 7:06 ` Liu, Yong
@ 2017-02-28 1:39 ` Xu, HuilongX
0 siblings, 0 replies; 3+ messages in thread
From: Xu, HuilongX @ 2017-02-28 1:39 UTC (permalink / raw)
To: Liu, Yong, dts
Hi yong,
If we use sniff_packets for capture packet , we must update test case, because tcpdump capture packet style different sniff by scapy. I think we only add filter rule in checksum offload case for fileter lldp packet.
Thanks a lot
> -----Original Message-----
> From: Liu, Yong
> Sent: Thursday, February 23, 2017 3:07 PM
> To: Xu, HuilongX; dts@dpdk.org
> Cc: Xu, HuilongX
> Subject: RE: [dts] [PATCH V2] filter lldp when sniff packet on tester
>
> Huilong,
> Please try sniff_packets in packet module. LLDP filter has been implemented
> in this function.
>
> Thanks,
> Marvin
>
> > -----Original Message-----
> > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong
> > Sent: Thursday, February 23, 2017 10:41 AM
> > To: dts@dpdk.org
> > Cc: Xu, HuilongX <huilongx.xu@intel.com>
> > Subject: [dts] [PATCH V2] filter lldp when sniff packet on tester
> >
> > in new dpdk.org code, fortville nic will auto send lldp packet when
> > the nic setup so should filter lldp packet when sniff packet on tester
> >
> > Signed-off-by: xu,huilong <huilongx.xu@intel.com>
> > ---
> > tests/TestSuite_checksum_offload.py | 2 +-
> > tests/TestSuite_nvgre.py | 2 +-
> > tests/TestSuite_vxlan.py | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/TestSuite_checksum_offload.py
> > b/tests/TestSuite_checksum_offload.py
> > index 7989c14..1f01d47 100644
> > --- a/tests/TestSuite_checksum_offload.py
> > +++ b/tests/TestSuite_checksum_offload.py
> > @@ -105,7 +105,7 @@ class TestChecksumOffload(TestCase):
> > self.tester.send_expect("exit()", "#")
> >
> > self.tester.scapy_background()
> > - self.tester.scapy_append('p = sniff(filter="ether src %s",
> > iface="%s", count=%d)' % (sniff_src, rx_interface, len(packets_sent)))
> > + self.tester.scapy_append('p = sniff(filter="ether[12] != 0x88
> > + or
> > ether[13] != 0xcc", iface="%s", count=%d)' % (rx_interface,
> > len(packets_sent)))
> > self.tester.scapy_append('nr_packets=len(p)')
> > self.tester.scapy_append('reslist =
> >
> [p[i].sprintf("%IP.chksum%;%TCP.chksum%;%UDP.chksum%;%SCTP.chksum
> %")
> > for i in range(nr_packets)]')
> > self.tester.scapy_append('import string') diff --git
> > a/tests/TestSuite_nvgre.py b/tests/TestSuite_nvgre.py index
> > 015aa9f..f6161e0 100644
> > --- a/tests/TestSuite_nvgre.py
> > +++ b/tests/TestSuite_nvgre.py
> > @@ -575,7 +575,7 @@ class TestNvgre(TestCase):
> > self.tester.send_expect("rm -rf %s" % config.capture_file, "# ")
> > # save the capture packet into pcap format
> > self.tester.scapy_background()
> > - self.tester.scapy_append('p=sniff(iface="%s",count=1,timeout=5)' %
> > self.tester_rx_iface)
> > + self.tester.scapy_append('p=sniff(filter="ether[12] != 0x88
> > + or
> > ether[13 != 0xcc]",iface="%s",count=1,timeout=5)' % self.tester_rx_iface)
> > self.tester.scapy_append('wrpcap(\"%s\", p)' %
> > config.capture_file)
> > self.tester.scapy_foreground()
> >
> > diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py index
> > 5fef9d9..6aa1164 100644
> > --- a/tests/TestSuite_vxlan.py
> > +++ b/tests/TestSuite_vxlan.py
> > @@ -446,7 +446,7 @@ class TestVxlan(TestCase, IxiaPacketGenerator):
> > # save the capture packet into pcap format
> > self.tester.scapy_background()
> > self.tester.scapy_append(
> > - 'p=sniff(iface="%s",count=1,timeout=5)' % self.recv_iface)
> > + 'p=sniff(filter="ether[12] != 0x88 or ether[13] !=
> > 0xcc",iface="%s",count=1,timeout=5)' % self.recv_iface)
> > self.tester.scapy_append(
> > 'wrpcap(\"%s\", p)' % config.capture_file)
> > self.tester.scapy_foreground()
> > --
> > 1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-28 1:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-23 2:40 [dts] [PATCH V2] filter lldp when sniff packet on tester xu,huilong
2017-02-23 7:06 ` Liu, Yong
2017-02-28 1:39 ` Xu, HuilongX
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).