From patchwork Wed Aug 8 18:32:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 955287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iOT3wngB"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41m76z3qRpz9s3Z for ; Thu, 9 Aug 2018 09:35:55 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 73EE6E32; Wed, 8 Aug 2018 23:34:12 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 0026EDD7 for ; Wed, 8 Aug 2018 23:34:09 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9AF987BF for ; Wed, 8 Aug 2018 23:34:09 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id k21-v6so1879174pff.11 for ; Wed, 08 Aug 2018 16:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=W4aM3a2ojqcVst4Yk0qkmp27sWH5zG+xc4S4yGpTivc=; b=iOT3wngB3IaPHSbPR/fojOg5Xh2yNgoBe3RSqQU8YM8tibYmRQim0PLqztgt0Iwfcg iFntkAcw0+Yc8pHPLzjJ2w/toaxK1Mjd5v7NLvidszoUzKARzEf5jOphWN0yHJg6nJJt GPXLpVorLFjCFNBByjlt7TtScLU3jyJbxDXvM614y+6uxWr82N5Yky0qV1BbTf4GWo24 NeTbRgPzc6q5xPOoHg9aRYZSv8bxElJ0kIqAYMqsqOuNOt0TP/Dkc3zZsLEtIuCWnz97 l2WusXlwUOxx8rocgoOx4j59FjZEtgM5rOTwbiOyRkJrBtHgpLvbhEIZiBXKUHRwjk50 7gpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W4aM3a2ojqcVst4Yk0qkmp27sWH5zG+xc4S4yGpTivc=; b=XbtojZfqCMW/x7WGKoaFHcqdd6iySQ3zh9ZVT0pvPUHH594dflDMm1Bajf2eJqnHcj Uz2JBWom7RVjkN2H2ivpWRjaB3CzX61elf0OL1wbKQo86gZu/EGW5mJQ9AHnmpDPxR6D HiY2/j0xJ8wU7QEoYzQjDS9Odudg86silgAr2+bQGgzt9NbVjyHtx+Vc1FIAOA5Q2Tjz OR4dzlZejtISLic3qxWmoXwSeauQV4IcZatcqXhe77PGu4Mwd7XxmB/nV7HV8sXyvNzB i0hVCJG+czBOzYqPtISQ7WkBPnBcFYPnoJ+ISHMdAJzzeOwjJitsCGGXtMsScn78Jj8e cexw== X-Gm-Message-State: AOUpUlHXpzgTEiWWPyeGEzo1UMqBN11qGhNVOtghTZ+N1y1yYBb3Y/mo YcTgJVkLKmB7xRypCaLhoKdHInd+ X-Google-Smtp-Source: AA+uWPyq/NPuKhtfeRsGTnqo7qiaqlo5hTBe5UgrpnMWE+RENzJNLeztlnhT+sibw9kHV8YGXHYprw== X-Received: by 2002:a62:5cc1:: with SMTP id q184-v6mr4994793pfb.241.1533771249063; Wed, 08 Aug 2018 16:34:09 -0700 (PDT) Received: from yfsovs.eng.vmware.com ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id u42-v6sm7045616pgn.1.2018.08.08.16.34.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Aug 2018 16:34:08 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Wed, 8 Aug 2018 11:32:48 -0700 Message-Id: <1533753171-11730-5-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533753171-11730-1-git-send-email-pkusunyifeng@gmail.com> References: <1533753171-11730-1-git-send-email-pkusunyifeng@gmail.com> X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 5/8] system-traffic.at: Add erspan v1 tunnel test that doesn't depend on upstream gre module X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Introduce a new test that doesn't setup native erspan v1 tunnels but sends simulated raw packets. This test is supposed to only run for kernel version from 4.4.x to 4.15.x. Signed-off-by: Yifeng Sun Acked-by: William Tu --- tests/system-traffic.at | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index dca2bc8..44669f8 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -622,6 +622,54 @@ AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > 172.31.1.1: GRE OVS_TRAFFIC_VSWITCHD_STOP AT_CLEANUP +AT_SETUP([datapath - ping over erspan v1 tunnel by simulated packets]) +OVS_CHECK_KERNEL(4, 4, 15) + +OVS_TRAFFIC_VSWITCHD_START() +AT_CHECK([ovs-vsctl -- set bridge br0 other-config:hwaddr=\"f2:ff:00:00:00:01\"]) +ADD_BR([br-underlay], [set bridge br-underlay other-config:hwaddr=\"f2:ff:00:00:00:02\"]) + +AT_CHECK([ovs-ofctl add-flow br0 "actions=normal"]) +AT_CHECK([ovs-ofctl add-flow br-underlay "actions=normal"]) + +ADD_NAMESPACES(at_ns0) + +dnl Set up underlay link from host into the namespace using veth pair. +ADD_VETH(p0, at_ns0, br-underlay, "172.31.1.1/24", f2:ff:00:00:00:03) +AT_CHECK([ip addr add dev br-underlay "172.31.1.100/24"]) +AT_CHECK([ip link set dev br-underlay up]) + +dnl Set up tunnel endpoints on OVS outside the namespace and emulate a native +dnl linux device inside the namespace. +ADD_OVS_TUNNEL([erspan], [br0], [at_erspan0], [172.31.1.1], [10.1.1.100/24], [options:key=1 options:erspan_ver=1 options:erspan_idx=7]) + +ip netns exec at_ns0 tcpdump -U -i p0 -w p0.pcap & +sleep 1 + +dnl First, check the underlay +NS_CHECK_EXEC([at_ns0], [ping -q -c 3 -i 0.3 -w 2 172.31.1.100 | FORMAT_PING], [0], [dnl +3 packets transmitted, 3 received, 0% packet loss, time 0ms +]) + +dnl Okay, now send out an arp request from 10.1.1.1 for 10.1.1.100 in erspan. +ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet=f2ff00000002f2ff0000000308004500004e151d4000402fcac0ac1f0101ac1f0164100088be000000061000000100000007fffffffffffff2ff0000000408060001080006040001f2ff000000040a0101010000000000000a010164 actions=normal" + +sleep 1 +dnl 0002 is arp reply, followed by mac address of 10.1.1.100. +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "f2ff 0000 0001 0806" 2>&1 1>/dev/null]) +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "0800 0604 0002 f2ff 0000 0001 0a01" 2>&1 1>/dev/null]) + +dnl Okay, now check the overlay with raw icmp packets. +AT_FAIL_IF([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > 172.31.1.1: GREv0, .* length 1258" 2>&1 1>/dev/null]) + +ovs-ofctl -O OpenFlow13 packet-out br-underlay "in_port=1 packet=f2ff00000002f2ff0000000308004500008e70cb4000402f6ed2ac1f0101ac1f0164100088be000000051000000100000007f2ff00000001f2ff0000000408004500005c4a3340004001da070a0101010a010164080084f238fb0001f36a6b5b0000000021870e0000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f actions=normal" + +sleep 1 +AT_CHECK([tcpdump -xx -r p0.pcap 2>&1 | egrep "IP 172.31.1.100 > 172.31.1.1: GREv0, .* length 122" 2>&1 1>/dev/null]) + +OVS_TRAFFIC_VSWITCHD_STOP +AT_CLEANUP + AT_SETUP([datapath - clone action]) OVS_TRAFFIC_VSWITCHD_START()