From: Jun Dong <junx.dong@intel.com>
To: dts@dpdk.org
Cc: lijuan.tu@intel.com, qingx.sun@intel.com, junx.dong@intel.com
Subject: [V1] framework/*: Remove Dot1BR related code
Date: Mon, 7 Mar 2022 15:58:01 +0800 [thread overview]
Message-ID: <20220307075801.5592-1-junx.dong@intel.com> (raw)
Signed-off-by: Jun Dong <junx.dong@intel.com>
---
framework/packet.py | 32 +----------------------------
framework/tester.py | 4 ----
tests/TestSuite_generic_flow_api.py | 8 +-------
3 files changed, 2 insertions(+), 42 deletions(-)
diff --git a/framework/packet.py b/framework/packet.py
index 787cfaee..99dc7159 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -56,7 +56,6 @@ from scapy.packet import Raw
from scapy.sendrecv import sendp
from scapy.utils import hexstr, rdpcap, wrpcap
-from dep.scapy_modules.Dot1BR import Dot1BR
from .utils import convert_int2ip, convert_ip2int, get_module_path
@@ -69,13 +68,8 @@ TMP_PATH = DTS_PATH[:-1] + '/output/tmp/pcap/' if exec_file.endswith('.pyc') els
if not os.path.exists(TMP_PATH):
os.system('mkdir -p %s' % TMP_PATH)
-# copy dep/Dot1BR to scapy
-_contrib_module_path = get_module_path('scapy.contrib')
-shutil.copy(DTS_PATH + '/dep/scapy_modules/Dot1BR.py', _contrib_module_path)
-
scapy_modules_required = {'scapy.contrib.gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'],
'scapy.contrib.lldp': ['LLDPDU', 'LLDPDUManagementAddress'],
- 'scapy.contrib.Dot1BR': ['Dot1BR'],
'scapy.contrib.pfcp': ['PFCP'],
'scapy.contrib.nsh': ['NSH'],
'scapy.contrib.igmp': ['IGMP'],
@@ -101,7 +95,7 @@ def get_scapy_module_impcmd():
PACKETGEN = "scapy"
LayersTypes = {
- "L2": ['ether', 'vlan', 'etag', '1588', 'arp', 'lldp', 'mpls', 'nsh'],
+ "L2": ['ether', 'vlan', '1588', 'arp', 'lldp', 'mpls', 'nsh'],
# ipv4_ext_unknown, ipv6_ext_unknown
"L3": ['ipv4', 'ipv4ihl', 'ipv6', 'ipv4_ext', 'ipv6_ext', 'ipv6_ext2', 'ipv6_frag'],
"L4": ['tcp', 'udp', 'frag', 'sctp', 'icmp', 'nofrag'],
@@ -142,7 +136,6 @@ class scapy(object):
SCAPY_LAYERS = {
'ether': Ether(dst="ff:ff:ff:ff:ff:ff"),
'vlan': Dot1Q(),
- 'etag': Dot1BR(),
'1588': Ether(type=0x88f7),
'arp': ARP(),
'ipv4': IP(),
@@ -234,24 +227,6 @@ class scapy(object):
value = int(str(self.pkts[p_index][Dot1Q].vlan))
return value
- def etag(self, pkt_layer, ECIDbase=0, prio=0, type=None):
- if pkt_layer.name != "802.1BR":
- return
- pkt_layer.ECIDbase = int(ECIDbase)
- pkt_layer.prio = prio
- if type is not None:
- pkt_layer.type = type
-
- def strip_etag(self, element, p_index=0):
- value = None
-
- if self.pkts[p_index].haslayer('Dot1BR') == 0:
- return None
-
- if element == 'ECIDbase':
- value = int(str(self.pkts[p_index][Dot1BR].ECIDbase))
- return value
-
def strip_layer2(self, element, p_index=0):
value = None
layer = self.pkts[p_index].getlayer(0)
@@ -416,7 +391,6 @@ class Packet(object):
'TCP': {'layers': ['ether', 'ipv4', 'tcp', 'raw'], 'cfgload': True},
'UDP': {'layers': ['ether', 'ipv4', 'udp', 'raw'], 'cfgload': True},
'VLAN_UDP': {'layers': ['ether', 'vlan', 'ipv4', 'udp', 'raw'], 'cfgload': True},
- 'ETAG_UDP': {'layers': ['ether', 'etag', 'ipv4', 'udp', 'raw'], 'cfgload': True},
'SCTP': {'layers': ['ether', 'ipv4', 'sctp', 'raw'], 'cfgload': True},
'IPv6_TCP': {'layers': ['ether', 'ipv6', 'tcp', 'raw'], 'cfgload': True},
'IPv6_UDP': {'layers': ['ether', 'ipv6', 'udp', 'raw'], 'cfgload': True},
@@ -812,7 +786,6 @@ class Packet(object):
name2type = {
'MAC': 'ether',
'VLAN': 'vlan',
- 'ETAG': 'etag',
'IP': 'ipv4',
'IPv4-TUNNEL': 'inner_ipv4',
'IPihl': 'ipv4ihl',
@@ -936,9 +909,6 @@ class Packet(object):
def strip_element_vlan(self, element, p_index=0):
return self.pktgen.strip_vlan(element, p_index)
- def strip_element_etag(self, element, p_index=0):
- return self.pktgen.strip_etag(element, p_index)
-
def strip_element_layer4(self, element, p_index=0):
return self.pktgen.strip_layer4(element, p_index)
diff --git a/framework/tester.py b/framework/tester.py
index ff3ecb61..43a6a595 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -113,10 +113,6 @@ class Tester(Crb):
scapy_module_path = session.session.send_expect("os.path.dirname(sys.modules['scapy'].__file__)", '>>>')
contrib_module_path = scapy_module_path.replace("'", "") + '/contrib'
- # copy scapy module to tester
- scapy_dep_module_path = lib_path + 'Dot1BR.py'
- session.copy_file_to(src=scapy_dep_module_path, dst=contrib_module_path)
-
# import scapy moudle to scapy APP
out = session.session.send_expect(get_scapy_module_impcmd(), '>>> ')
if 'ImportError' in out:
diff --git a/tests/TestSuite_generic_flow_api.py b/tests/TestSuite_generic_flow_api.py
index 80dae50d..f46799eb 100644
--- a/tests/TestSuite_generic_flow_api.py
+++ b/tests/TestSuite_generic_flow_api.py
@@ -407,7 +407,7 @@ class TestGeneric_flow_api(TestCase):
cmd_fmt = "flow %(create)s 0 ingress pattern %(flow)s / end actions %(action)s end"
# Record the elements of the rule, ready for the configuration
# of packets inconsistent to the rule.
- extrapacket = {'vlan': '', 'etag': '', 'ipv4': '', 'ipv6': '', 'sip': '', 'dip': '', 'proto': '', 'tos': '',
+ extrapacket = {'vlan': '', 'for ': '', 'ipv4': '', 'ipv6': '', 'sip': '', 'dip': '', 'proto': '', 'tos': '',
'ttl': '', 'tcp': '', 'udp': '', 'sctp': '', 'sport': '', 'dport': '', 'vni': '', 'tni': '',
'ineth': '', 'invlan': ''}
# Define the packet string, which is consistent to the flow rule.
@@ -420,12 +420,6 @@ class TestGeneric_flow_api(TestCase):
if 'fuzzy' in flows:
thresh = self.generate_random_int(1, 15)
flow_str = "fuzzy thresh is %d " % thresh
- # L2 tunnel
- elif 'etag' in flows:
- ecid = self.generate_random_int(4096, 8191)
- flow_str = "e_tag grp_ecid_b is %s " % hex(ecid)
- pkt += "/Dot1BR(GRP=0x1, ECIDbase=%s)" % hex(ecid - 4096)
- extrapacket['etag'] = hex(ecid - 4096)
else:
flow_str = "eth "
# Configure the flow and packet and extrapacket string
--
2.33.1.windows.1
next reply other threads:[~2022-03-07 7:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 7:58 Jun Dong [this message]
2022-03-11 3:17 ` 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=20220307075801.5592-1-junx.dong@intel.com \
--to=junx.dong@intel.com \
--cc=dts@dpdk.org \
--cc=lijuan.tu@intel.com \
--cc=qingx.sun@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).