ethernet: check destination mac for L3 in ethernet-input node 56/40756/4 master
authorSteven Luong <sluong@cisco.com>
Fri, 19 Apr 2024 16:49:20 +0000 (09:49 -0700)
committerDamjan Marion <dmarion@0xa5.net>
Wed, 8 May 2024 09:42:23 +0000 (09:42 +0000)
When the NIC does not support mac filter, we rely on ethernet-input
node to do the destination mac check, ie, when the interface is in L3,
the mac address for the packet must be the mac address of the
interface where the packet arrives. This works fine in ethernet-input
node when all packets in the frame might have different interfaces, ie,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is not set in the frame. However,
when all packets are having the same interface,
ETH_INPUT_FRAME_F_SINGLE_SW_IF_ID is set, ethernet-input node goes
through the optimized routine eth_input_single_int -> eth_input_process_frame.
That is where dmac check has a bug when all packets in the frame are
either, ip4, ip6, or mpls without vlan tags. Because without vlan tags,
the code handles all packets in fast path and ignores dmac check.
With vlan tags, the code goes to slow path where dmac check is handled
properly.

The fix is to check if we have a bad dmac in the fast path and force the
code to go to slow path which will handle dmac check properly.

Also do a wholesale correction on all the testcases which do not use
the proper dmac when sending L3 packets.

Type: fix

Change-Id: I73153a805cecdc24c4eefcc781676de04737ae2c
Signed-off-by: Steven Luong <sluong@cisco.com>
20 files changed:
src/vnet/ethernet/node.c
test/test_abf.py
test/test_flowprobe.py
test/test_gso.py
test/test_gtpu.py
test/test_ip6.py
test/test_ip6_nd_mirror_proxy.py
test/test_ipip.py
test/test_l3xc.py
test/test_linux_cp.py
test/test_map.py
test/test_map_br.py
test/test_mpls.py
test/test_nat44_ed_output.py
test/test_neighbor.py
test/test_pcap.py
test/test_reassembly.py
test/test_srv6_mobile.py
test/test_trace_filter.py
test/test_vxlan.py

index e2558ee..03cbdde 100644 (file)
@@ -982,8 +982,31 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
              else
                {
                  for (int j = 0; j < 16; j++)
              else
                {
                  for (int j = 0; j < 16; j++)
-                   if (next[j] == 0)
-                     slowpath_indices[n_slowpath++] = i + j;
+                   {
+                     if (next[j] == 0)
+                       slowpath_indices[n_slowpath++] = i + j;
+                     else if (dmac_check && main_is_l3 && dmacs_bad[i + j])
+                       {
+                         next[j] = 0;
+                         slowpath_indices[n_slowpath++] = i + j;
+                       }
+                   }
+               }
+           }
+         else
+           {
+             if (dmac_check && main_is_l3)
+               {
+                 u8x16 dmac_bad = u8x16_load_unaligned (&dmacs_bad[i]);
+                 if (!u8x16_is_all_zero (dmac_bad))
+                   {
+                     for (int j = 0; j < 16; j++)
+                       if (dmacs_bad[i + j])
+                         {
+                           next[j] = 0;
+                           slowpath_indices[n_slowpath++] = i + j;
+                         }
+                   }
                }
            }
 
                }
            }
 
@@ -994,7 +1017,12 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
          continue;
        }
 #endif
          continue;
        }
 #endif
-      if (main_is_l3 && etype[0] == et_ip4)
+      if (dmac_check && main_is_l3 && dmacs_bad[i])
+       {
+         next[0] = 0;
+         slowpath_indices[n_slowpath++] = i;
+       }
+      else if (main_is_l3 && etype[0] == et_ip4)
        next[0] = next_ip4;
       else if (main_is_l3 && etype[0] == et_ip6)
        next[0] = next_ip6;
        next[0] = next_ip4;
       else if (main_is_l3 && etype[0] == et_ip6)
        next[0] = next_ip6;
@@ -1052,7 +1080,7 @@ eth_input_process_frame (vlib_main_t * vm, vlib_node_runtime_t * node,
            }
          else
            {
            }
          else
            {
-             /* untagged packet with not well known etyertype */
+             /* untagged packet with not well known ethertype */
              if (last_unknown_etype != etype)
                {
                  last_unknown_etype = etype;
              if (last_unknown_etype != etype)
                {
                  last_unknown_etype = etype;
index 3baec9f..ec329a0 100644 (file)
@@ -391,7 +391,7 @@ class TestAbf(VppTestCase):
         # a packet matching the deny rule
         #
         p_deny = (
         # a packet matching the deny rule
         #
         p_deny = (
-            Ether(src=self.pg0.remote_mac, dst=self.pg3.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IP(src=self.pg0.remote_ip4, dst=self.pg3.remote_ip4)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
             / IP(src=self.pg0.remote_ip4, dst=self.pg3.remote_ip4)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
@@ -402,7 +402,7 @@ class TestAbf(VppTestCase):
         # a packet matching the permit rule
         #
         p_permit = (
         # a packet matching the permit rule
         #
         p_permit = (
-            Ether(src=self.pg0.remote_mac, dst=self.pg2.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IP(src=self.pg0.remote_ip4, dst=self.pg2.remote_ip4)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
             / IP(src=self.pg0.remote_ip4, dst=self.pg2.remote_ip4)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
@@ -454,7 +454,7 @@ class TestAbf(VppTestCase):
         # a packet matching the deny rule
         #
         p_deny = (
         # a packet matching the deny rule
         #
         p_deny = (
-            Ether(src=self.pg0.remote_mac, dst=self.pg3.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg3.remote_ip6)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg3.remote_ip6)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
@@ -465,7 +465,7 @@ class TestAbf(VppTestCase):
         # a packet matching the permit rule
         #
         p_permit = (
         # a packet matching the permit rule
         #
         p_permit = (
-            Ether(src=self.pg0.remote_mac, dst=self.pg2.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg2.remote_ip6)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg2.remote_ip6)
             / UDP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 100)
index ac0433a..8e3fecf 100644 (file)
@@ -559,7 +559,7 @@ class Flowprobe(MethodHolder):
         # make a tcp packet
         self.pkts = [
             (
         # make a tcp packet
         self.pkts = [
             (
-                Ether(src=self.pg3.remote_mac, dst=self.pg4.local_mac)
+                Ether(src=self.pg3.remote_mac, dst=self.pg3.local_mac)
                 / IP(src=self.pg3.remote_ip4, dst=self.pg4.remote_ip4)
                 / TCP(sport=1234, dport=4321)
                 / Raw(b"\xa5" * 50)
                 / IP(src=self.pg3.remote_ip4, dst=self.pg4.remote_ip4)
                 / TCP(sport=1234, dport=4321)
                 / Raw(b"\xa5" * 50)
index 1db83be..3d9ce5f 100644 (file)
@@ -405,7 +405,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv4 - VXLAN
         #
         p45 = (
         # IPv4/IPv4 - VXLAN
         #
         p45 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -424,7 +424,7 @@ class TestGSO(VppTestCase):
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
-            self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+            self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
             self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
             self.assertEqual(inner[IP].dst, "172.16.3.3")
             self.assert_ip_checksum_valid(inner)
             self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
             self.assertEqual(inner[IP].dst, "172.16.3.3")
             self.assert_ip_checksum_valid(inner)
@@ -438,7 +438,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv6 - VXLAN
         #
         p65 = (
         # IPv4/IPv6 - VXLAN
         #
         p65 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -457,7 +457,7 @@ class TestGSO(VppTestCase):
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IP].len - 20 - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
-            self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+            self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
             self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
             self.assertEqual(inner[IPv6].dst, "fd01:3::3")
             self.assert_tcp_checksum_valid(inner)
             self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
             self.assertEqual(inner[IPv6].dst, "fd01:3::3")
             self.assert_tcp_checksum_valid(inner)
@@ -483,7 +483,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv4 - VXLAN
         #
         p46 = (
         # IPv6/IPv4 - VXLAN
         #
         p46 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.3.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -501,7 +501,7 @@ class TestGSO(VppTestCase):
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
-            self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+            self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
             self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
             self.assertEqual(inner[IP].dst, "172.16.3.3")
             self.assert_ip_checksum_valid(inner)
             self.assertEqual(inner[IP].src, self.pg2.remote_ip4)
             self.assertEqual(inner[IP].dst, "172.16.3.3")
             self.assert_ip_checksum_valid(inner)
@@ -515,7 +515,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv6 - VXLAN
         #
         p66 = (
         # IPv6/IPv6 - VXLAN
         #
         p66 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:3::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -533,7 +533,7 @@ class TestGSO(VppTestCase):
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
             inner = rx[VXLAN].payload
             self.assertEqual(rx[IPv6].plen - 8 - 8, len(inner))
             self.assertEqual(inner[Ether].src, self.pg2.remote_mac)
-            self.assertEqual(inner[Ether].dst, "02:fe:60:1e:a2:79")
+            self.assertEqual(inner[Ether].dst, self.pg2.local_mac)
             self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
             self.assertEqual(inner[IPv6].dst, "fd01:3::3")
             self.assert_tcp_checksum_valid(inner)
             self.assertEqual(inner[IPv6].src, self.pg2.remote_ip6)
             self.assertEqual(inner[IPv6].dst, "fd01:3::3")
             self.assert_tcp_checksum_valid(inner)
@@ -590,7 +590,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv4 - IPIP
         #
         p47 = (
         # IPv4/IPv4 - IPIP
         #
         p47 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -633,7 +633,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv6 - IPIP
         #
         p67 = (
         # IPv4/IPv6 - IPIP
         #
         p67 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -731,7 +731,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv4 - IPIP
         #
         p48 = (
         # IPv6/IPv4 - IPIP
         #
         p48 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -774,7 +774,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv6 - IPIP
         #
         p68 = (
         # IPv6/IPv6 - IPIP
         #
         p68 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -842,7 +842,7 @@ class TestGSO(VppTestCase):
         self.ip4_via_gre4_tunnel.add_vpp_config()
 
         pgre4 = (
         self.ip4_via_gre4_tunnel.add_vpp_config()
 
         pgre4 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -952,7 +952,7 @@ class TestGSO(VppTestCase):
         # Create IPv6 packet
         #
         pgre6 = (
         # Create IPv6 packet
         #
         pgre6 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -1078,7 +1078,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv4 - IPSEC
         #
         ipsec44 = (
         # IPv4/IPv4 - IPSEC
         #
         ipsec44 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -1116,7 +1116,7 @@ class TestGSO(VppTestCase):
         # IPv4/IPv6 - IPSEC
         #
         ipsec46 = (
         # IPv4/IPv6 - IPSEC
         #
         ipsec46 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -1213,7 +1213,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv4 - IPSEC
         #
         ipsec64 = (
         # IPv6/IPv4 - IPSEC
         #
         ipsec64 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IP(src=self.pg2.remote_ip4, dst="172.16.10.3", flags="DF")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
@@ -1252,7 +1252,7 @@ class TestGSO(VppTestCase):
         # IPv6/IPv6 - IPSEC
         #
         ipsec66 = (
         # IPv6/IPv6 - IPSEC
         #
         ipsec66 = (
-            Ether(src=self.pg2.remote_mac, dst="02:fe:60:1e:a2:79")
+            Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
             / IPv6(src=self.pg2.remote_ip6, dst="fd01:10::3")
             / TCP(sport=1234, dport=1234)
             / Raw(b"\xa5" * 65200)
index fd97205..5fe4f36 100644 (file)
@@ -36,7 +36,7 @@ class TestGtpuUDP(VppTestCase):
 
     def _check_udp_port_ip4(self, enabled=True):
         pkt = (
 
     def _check_udp_port_ip4(self, enabled=True):
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4)
             / UDP(sport=self.dport, dport=self.dport, chksum=0)
         )
             / IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4)
             / UDP(sport=self.dport, dport=self.dport, chksum=0)
         )
@@ -55,7 +55,7 @@ class TestGtpuUDP(VppTestCase):
 
     def _check_udp_port_ip6(self, enabled=True):
         pkt = (
 
     def _check_udp_port_ip6(self, enabled=True):
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / UDP(sport=self.dport, dport=self.dport, chksum=0)
         )
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / UDP(sport=self.dport, dport=self.dport, chksum=0)
         )
index a1cd943..84b060a 100644 (file)
@@ -3409,9 +3409,11 @@ class TestIP6LinkLocal(VppTestCase):
         # Use the specific link-local API on pg1
         #
         VppIp6LinkLocalAddress(self, self.pg1, ll1).add_vpp_config()
         # Use the specific link-local API on pg1
         #
         VppIp6LinkLocalAddress(self, self.pg1, ll1).add_vpp_config()
+        p_echo_request_1.dst = self.pg1.local_mac
         self.send_and_expect(self.pg1, [p_echo_request_1], self.pg1)
 
         VppIp6LinkLocalAddress(self, self.pg1, ll3).add_vpp_config()
         self.send_and_expect(self.pg1, [p_echo_request_1], self.pg1)
 
         VppIp6LinkLocalAddress(self, self.pg1, ll3).add_vpp_config()
+        p_echo_request_3.dst = self.pg1.local_mac
         self.send_and_expect(self.pg1, [p_echo_request_3], self.pg1)
 
     def test_ip6_ll_p2p(self):
         self.send_and_expect(self.pg1, [p_echo_request_3], self.pg1)
 
     def test_ip6_ll_p2p(self):
index 6520992..10dc77e 100644 (file)
@@ -161,7 +161,7 @@ class TestNDPROXY(VppTestCase):
         redirect.add_vpp_config()
 
         echo_reply = (
         redirect.add_vpp_config()
 
         echo_reply = (
-            Ether(dst=self.pg0.remote_mac, src=self.pg0.local_mac)
+            Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac)
             / IPv6(dst=self.pg0.local_ip6, src=self.pg0.remote_ip6)
             / ICMPv6EchoReply(seq=1, id=id)
         )
             / IPv6(dst=self.pg0.local_ip6, src=self.pg0.remote_ip6)
             / ICMPv6EchoReply(seq=1, id=id)
         )
index 2817d5a..9574c2c 100644 (file)
@@ -677,7 +677,7 @@ class TestIPIP(VppTestCase):
                 / Raw(b"0x44" * 100)
             )
             tx_e = [
                 / Raw(b"0x44" * 100)
             )
             tx_e = [
-                (Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac) / inner)
+                (Ether(dst=self.pg2.local_mac, src=self.pg0.remote_mac) / inner)
                 for x in range(63)
             ]
 
                 for x in range(63)
             ]
 
@@ -1454,7 +1454,7 @@ class TestIPIPMPLS(VppTestCase):
         # Tunnel Decap
         #
         p4 = (
         # Tunnel Decap
         #
         p4 = (
-            self.p_ether
+            Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
             / IP(src=self.pg1.remote_ip4, dst=self.pg1.local_ip4)
             / MPLS(label=44, ttl=4)
             / IP(src="1.1.1.1", dst="2.2.2.2")
             / IP(src=self.pg1.remote_ip4, dst=self.pg1.local_ip4)
             / MPLS(label=44, ttl=4)
             / IP(src="1.1.1.1", dst="2.2.2.2")
@@ -1468,7 +1468,7 @@ class TestIPIPMPLS(VppTestCase):
             self.assertEqual(rx[IP].dst, "2.2.2.2")
 
         p6 = (
             self.assertEqual(rx[IP].dst, "2.2.2.2")
 
         p6 = (
-            self.p_ether
+            Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
             / IPv6(src=self.pg1.remote_ip6, dst=self.pg1.local_ip6)
             / MPLS(label=66, ttl=4)
             / IPv6(src="1::1", dst="2::2")
             / IPv6(src=self.pg1.remote_ip6, dst=self.pg1.local_ip6)
             / MPLS(label=66, ttl=4)
             / IPv6(src="1::1", dst="2::2")
index 351c599..69267b3 100644 (file)
@@ -126,7 +126,7 @@ class TestL3xc(VppTestCase):
         p_2 = []
         for ii in range(NUM_PKTS):
             p_2.append(
         p_2 = []
         for ii in range(NUM_PKTS):
             p_2.append(
-                Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
+                Ether(src=self.pg2.remote_mac, dst=self.pg2.local_mac)
                 / IP(src="1.1.1.1", dst="1.1.1.2")
                 / UDP(sport=1000 + ii, dport=1234)
                 / Raw(b"\xa5" * 100)
                 / IP(src="1.1.1.1", dst="1.1.1.2")
                 / UDP(sport=1000 + ii, dport=1234)
                 / Raw(b"\xa5" * 100)
index a9ff242..95a9f1a 100644 (file)
@@ -126,7 +126,7 @@ class TestLinuxCP(VppTestCase):
         for phy, host in zip(phys, hosts):
             for j in range(N_HOSTS):
                 p = (
         for phy, host in zip(phys, hosts):
             for j in range(N_HOSTS):
                 p = (
-                    Ether(src=phy.local_mac, dst=phy.remote_hosts[j].mac)
+                    Ether(src=phy.local_mac, dst=host.local_mac)
                     / IP(src=phy.local_ip4, dst=phy.remote_hosts[j].ip4)
                     / UDP(sport=1234, dport=1234)
                     / Raw()
                     / IP(src=phy.local_ip4, dst=phy.remote_hosts[j].ip4)
                     / UDP(sport=1234, dport=1234)
                     / Raw()
index 565f7da..c65c5df 100644 (file)
@@ -494,7 +494,7 @@ class TestMAP(VppTestCase):
         #
         # Send a v4 packet that will be encapped.
         #
         #
         # Send a v4 packet that will be encapped.
         #
-        p_ether = Ether(dst=self.pg0.local_mac, src=self.pg0.remote_mac)
+        p_ether = Ether(dst=self.pg1.local_mac, src=self.pg1.remote_mac)
         p_ip4 = IP(src=self.pg0.remote_ip4, dst="192.168.1.1")
         p_tcp = TCP(sport=20000, dport=30000, flags="S", options=[("MSS", 1455)])
         p4 = p_ether / p_ip4 / p_tcp
         p_ip4 = IP(src=self.pg0.remote_ip4, dst="192.168.1.1")
         p_tcp = TCP(sport=20000, dport=30000, flags="S", options=[("MSS", 1455)])
         p4 = p_ether / p_ip4 / p_tcp
index 0de0e31..a2c00d8 100644 (file)
@@ -280,7 +280,7 @@ class TestMAPBR(VppTestCase):
     def test_map_t_echo_request_ip4_to_ip6(self):
         """MAP-T echo request IPv4 -> IPv6"""
 
     def test_map_t_echo_request_ip4_to_ip6(self):
         """MAP-T echo request IPv4 -> IPv6"""
 
-        eth = Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+        eth = Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
         ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
         icmp = ICMP(type="echo-request", id=self.ipv6_udp_or_tcp_map_port)
         payload = "H" * 10
         ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
         icmp = ICMP(type="echo-request", id=self.ipv6_udp_or_tcp_map_port)
         payload = "H" * 10
@@ -306,7 +306,7 @@ class TestMAPBR(VppTestCase):
     def test_map_t_echo_reply_ip4_to_ip6(self):
         """MAP-T echo reply IPv4 -> IPv6"""
 
     def test_map_t_echo_reply_ip4_to_ip6(self):
         """MAP-T echo reply IPv4 -> IPv6"""
 
-        eth = Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+        eth = Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
         ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
         icmp = ICMP(type="echo-reply", id=self.ipv6_udp_or_tcp_map_port)
         payload = "H" * 10
         ip = IP(src=self.pg0.remote_ip4, dst=self.ipv4_map_address)
         icmp = ICMP(type="echo-reply", id=self.ipv6_udp_or_tcp_map_port)
         payload = "H" * 10
index 9c07251..0e747ec 100644 (file)
@@ -2018,7 +2018,7 @@ class TestMPLS(VppTestCase):
         binding.add_vpp_config()
 
         tx = (
         binding.add_vpp_config()
 
         tx = (
-            Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / MPLS(label=44, ttl=64)
             / IP(src=self.pg0.remote_ip4, dst=self.pg0.remote_ip4)
             / UDP(sport=1234, dport=1234)
             / MPLS(label=44, ttl=64)
             / IP(src=self.pg0.remote_ip4, dst=self.pg0.remote_ip4)
             / UDP(sport=1234, dport=1234)
index ad1c561..dbf1dc4 100644 (file)
@@ -216,7 +216,7 @@ class TestNAT44EDOutput(VppTestCase):
         # send FIN+ACK packet in->out - will cause session to be wiped
         # but won't create a new session
         p = (
         # send FIN+ACK packet in->out - will cause session to be wiped
         # but won't create a new session
         p = (
-            Ether(src=pg0.remote_mac, dst=pg0.local_mac)
+            Ether(src=pg1.remote_mac, dst=pg1.local_mac)
             / IP(src=local_host, dst=remote_host)
             / TCP(sport=local_sport, dport=remote_dport, flags="FA", seq=300, ack=101)
         )
             / IP(src=local_host, dst=remote_host)
             / TCP(sport=local_sport, dport=remote_dport, flags="FA", seq=300, ack=101)
         )
index 6fcf13f..d11d4ab 100644 (file)
@@ -2176,6 +2176,7 @@ class ARPTestCase(VppTestCase):
             table_id=1,
         ).add_vpp_config()
 
             table_id=1,
         ).add_vpp_config()
 
+        p2.dst = self.pg3.local_mac
         rxs = self.send_and_expect(self.pg3, [p2], self.pg1)
         for rx in rxs:
             self.verify_arp_req(rx, self.pg1.local_mac, "10.0.1.2", "10.0.1.128")
         rxs = self.send_and_expect(self.pg3, [p2], self.pg1)
         for rx in rxs:
             self.verify_arp_req(rx, self.pg1.local_mac, "10.0.1.2", "10.0.1.128")
index ae3a298..72d215c 100644 (file)
@@ -135,7 +135,7 @@ class TestPcap(VppTestCase):
         self.vapi.cli("classify filter pcap del mask l3 ip4 src")
 
         pkt = (
         self.vapi.cli("classify filter pcap del mask l3 ip4 src")
 
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             # wrong destination address
             / IP(src=self.pg0.local_ip4, dst=self.pg0.local_ip4, ttl=2)
             / UDP(sport=1234, dport=2345)
             # wrong destination address
             / IP(src=self.pg0.local_ip4, dst=self.pg0.local_ip4, ttl=2)
             / UDP(sport=1234, dport=2345)
index 6b6745f..98c50f9 100644 (file)
@@ -1647,7 +1647,7 @@ class TestIPv6Reassembly(VppTestCase):
     def test_atomic_fragment(self):
         """IPv6 atomic fragment"""
         pkt = (
     def test_atomic_fragment(self):
         """IPv6 atomic fragment"""
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6, nh=44, plen=65535)
             / IPv6ExtHdrFragment(
                 offset=8191, m=1, res1=0xFF, res2=0xFF, nh=255, id=0xFFFF
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6, nh=44, plen=65535)
             / IPv6ExtHdrFragment(
                 offset=8191, m=1, res1=0xFF, res2=0xFF, nh=255, id=0xFFFF
@@ -1669,7 +1669,7 @@ class TestIPv6Reassembly(VppTestCase):
         self.send_and_assert_no_replies(self.pg0, [pkt])
 
         pkt = (
         self.send_and_assert_no_replies(self.pg0, [pkt])
 
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6)
             / ICMPv6EchoRequest()
         )
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.remote_ip6)
             / ICMPv6EchoRequest()
         )
@@ -1678,7 +1678,7 @@ class TestIPv6Reassembly(VppTestCase):
     def test_one_fragment(self):
         """whole packet in one fragment processed independently"""
         pkt = (
     def test_one_fragment(self):
         """whole packet in one fragment processed independently"""
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
@@ -1690,7 +1690,7 @@ class TestIPv6Reassembly(VppTestCase):
 
         # send an atomic fragment with same id - should be reassembled
         pkt = (
 
         # send an atomic fragment with same id - should be reassembled
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
@@ -1705,7 +1705,7 @@ class TestIPv6Reassembly(VppTestCase):
     def test_bunch_of_fragments(self):
         """valid fragments followed by rogue fragments and atomic fragment"""
         pkt = (
     def test_bunch_of_fragments(self):
         """valid fragments followed by rogue fragments and atomic fragment"""
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
@@ -1723,7 +1723,7 @@ class TestIPv6Reassembly(VppTestCase):
         self.send_and_assert_no_replies(self.pg0, inc_frag * 604)
 
         pkt = (
         self.send_and_assert_no_replies(self.pg0, inc_frag * 604)
 
         pkt = (
-            Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
+            Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac)
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
             / IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
@@ -1738,7 +1738,7 @@ class TestIPv6Reassembly(VppTestCase):
         )
         self.vapi.ip_local_reass_enable_disable(enable_ip6=True)
         pkt = (
         )
         self.vapi.ip_local_reass_enable_disable(enable_ip6=True)
         pkt = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.src_if.local_ip6)
             / ICMPv6EchoRequest(id=1234)
             / Raw("X" * 1600)
             / IPv6(src=self.src_if.remote_ip6, dst=self.src_if.local_ip6)
             / ICMPv6EchoRequest(id=1234)
             / Raw("X" * 1600)
@@ -2184,7 +2184,7 @@ class TestIPv6SVReassembly(VppTestCase):
     def test_one_fragment(self):
         """whole packet in one fragment processed independently"""
         pkt = (
     def test_one_fragment(self):
         """whole packet in one fragment processed independently"""
         pkt = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
@@ -2196,7 +2196,7 @@ class TestIPv6SVReassembly(VppTestCase):
 
         # send an atomic fragment with same id - should be reassembled
         pkt = (
 
         # send an atomic fragment with same id - should be reassembled
         pkt = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
@@ -2209,7 +2209,7 @@ class TestIPv6SVReassembly(VppTestCase):
     def test_bunch_of_fragments(self):
         """valid fragments followed by rogue fragments and atomic fragment"""
         pkt = (
     def test_bunch_of_fragments(self):
         """valid fragments followed by rogue fragments and atomic fragment"""
         pkt = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / ICMPv6EchoRequest()
             / Raw("X" * 1600)
@@ -2218,7 +2218,7 @@ class TestIPv6SVReassembly(VppTestCase):
         rx = self.send_and_expect(self.src_if, frags, self.dst_if)
 
         rogue = (
         rx = self.send_and_expect(self.src_if, frags, self.dst_if)
 
         rogue = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1, nh=58, offset=608)
             / Raw("X" * 308)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1, nh=58, offset=608)
             / Raw("X" * 308)
@@ -2227,7 +2227,7 @@ class TestIPv6SVReassembly(VppTestCase):
         self.send_and_expect(self.src_if, rogue * 604, self.dst_if)
 
         pkt = (
         self.send_and_expect(self.src_if, rogue * 604, self.dst_if)
 
         pkt = (
-            Ether(src=self.src_if.local_mac, dst=self.src_if.remote_mac)
+            Ether(src=self.src_if.remote_mac, dst=self.src_if.local_mac)
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
             / IPv6(src=self.src_if.remote_ip6, dst=self.dst_if.remote_ip6)
             / IPv6ExtHdrFragment(id=1)
             / ICMPv6EchoRequest()
index 9d39f19..314dfc1 100644 (file)
@@ -60,7 +60,7 @@ class TestSRv6EndMGTP4E(VppTestCase):
         pkts = list()
         for d, s in inner:
             pkt = (
         pkts = list()
         for d, s in inner:
             pkt = (
-                Ether()
+                Ether(dst=self.pg0.local_mac)
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / IPv6ExtHdrSegmentRouting()
                 / IPv6(dst=d, src=s)
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / IPv6ExtHdrSegmentRouting()
                 / IPv6(dst=d, src=s)
@@ -149,7 +149,7 @@ class TestSRv6TMGTP4D(VppTestCase):
         pkts = list()
         for d, s in inner:
             pkt = (
         pkts = list()
         for d, s in inner:
             pkt = (
-                Ether()
+                Ether(dst=self.pg0.local_mac)
                 / IP(dst=str(ip4_dst), src=str(ip4_src))
                 / UDP(sport=2152, dport=2152)
                 / GTP_U_Header(gtp_type="g_pdu", teid=200)
                 / IP(dst=str(ip4_dst), src=str(ip4_src))
                 / UDP(sport=2152, dport=2152)
                 / GTP_U_Header(gtp_type="g_pdu", teid=200)
@@ -254,7 +254,7 @@ class TestSRv6EndMGTP6E(VppTestCase):
         pkts = list()
         for d, s in inner:
             pkt = (
         pkts = list()
         for d, s in inner:
             pkt = (
-                Ether()
+                Ether(dst=self.pg0.local_mac)
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / IPv6ExtHdrSegmentRouting(
                     segleft=1, lastentry=0, tag=0, addresses=["a1::1"]
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / IPv6ExtHdrSegmentRouting(
                     segleft=1, lastentry=0, tag=0, addresses=["a1::1"]
@@ -344,7 +344,7 @@ class TestSRv6EndMGTP6D(VppTestCase):
         pkts = list()
         for d, s in inner:
             pkt = (
         pkts = list()
         for d, s in inner:
             pkt = (
-                Ether()
+                Ether(dst=self.pg0.local_mac)
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / UDP(sport=2152, dport=2152)
                 / GTP_U_Header(gtp_type="g_pdu", teid=200)
                 / IPv6(dst=str(ip6_dst), src=str(ip6_src))
                 / UDP(sport=2152, dport=2152)
                 / GTP_U_Header(gtp_type="g_pdu", teid=200)
index 58494cd..c188631 100644 (file)
@@ -386,7 +386,7 @@ class TestTraceFilterInner(TemplateTraceFilter):
 
     def __gen_encrypt_pkt(self, scapy_sa, pkt):
         return Ether(
 
     def __gen_encrypt_pkt(self, scapy_sa, pkt):
         return Ether(
-            src=self.pg0.local_mac, dst=self.pg0.remote_mac
+            src=self.pg0.remote_mac, dst=self.pg0.local_mac
         ) / scapy_sa.encrypt(pkt)
 
     def test_encrypted_encap(self):
         ) / scapy_sa.encrypt(pkt)
 
     def test_encrypted_encap(self):
index 6128d10..284e135 100644 (file)
@@ -580,6 +580,7 @@ class TestVxlanL2Mode(VppTestCase):
 
         # Send packets
         NUM_PKTS = 128
 
         # Send packets
         NUM_PKTS = 128
+        p.dst = self.pg1.local_mac
         rx = self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg0)
         self.assertEqual(NUM_PKTS, len(rx))
 
         rx = self.send_and_expect(self.pg1, p * NUM_PKTS, self.pg0)
         self.assertEqual(NUM_PKTS, len(rx))