test suite reviews and discussions
 help / color / mirror / Atom feed
* [V1] framework/*: Remove Dot1BR related code
@ 2022-03-07  7:58 Jun Dong
  2022-03-11  3:17 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Jun Dong @ 2022-03-07  7:58 UTC (permalink / raw)
  To: dts; +Cc: lijuan.tu, qingx.sun, junx.dong

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* RE: [V1] framework/*: Remove Dot1BR related code
  2022-03-07  7:58 [V1] framework/*: Remove Dot1BR related code Jun Dong
@ 2022-03-11  3:17 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2022-03-11  3:17 UTC (permalink / raw)
  To: Dong, JunX, dts; +Cc: Sun, QingX

> -----Original Message-----
> From: Dong, JunX <junx.dong@intel.com>
> Sent: 2022年3月7日 15:58
> To: dts@dpdk.org
> Cc: Tu, Lijuan <lijuan.tu@intel.com>; Sun, QingX <qingx.sun@intel.com>; Dong,
> JunX <junx.dong@intel.com>
> Subject: [V1] framework/*: Remove Dot1BR related code
> 
> Signed-off-by: Jun Dong <junx.dong@intel.com>

This change is align with dpdk cf47acc0f(ethdev: remove L2 tunnel offload control API)
Reviewed-by: Lijuan Tu <lijuan.tu@intel.com>

Applied with commit message changed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-11  3:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07  7:58 [V1] framework/*: Remove Dot1BR related code Jun Dong
2022-03-11  3:17 ` Tu, Lijuan

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).