From patchwork Wed Feb 27 11:41:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anju Thomas X-Patchwork-Id: 1048849 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=ericsson.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="LReN0cfP"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ericsson.com header.i=@ericsson.com header.b="CKZozrKJ"; 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 448Yw53HPnz9s4Y for ; Wed, 27 Feb 2019 22:52:52 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 631F78C31; Wed, 27 Feb 2019 11:52:48 +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 0BC4E8888 for ; Wed, 27 Feb 2019 11:41:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2E9D671C for ; Wed, 27 Feb 2019 11:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1551267715; x=1553859715; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5WfycUXKsqse6erEiy0fS6iBVCWW2a3y9AwKzJ/9aNU=; b=LReN0cfPgkplCefzAew0zL1YjXdQduRUD0a7iVH4W76LPMTZGQqF8DLHM8qjVwYC PY4QraQdt6EgReQh2VlLGF0qc5YjXiAWmJwyFTSRXNHEvb10r15PEPZ3Ge7c792I ssopzclE4II+9+HvrUPl6VMb5qK7aEj6GEXW2OCOd+Y=; X-AuditID: c1b4fb2d-2198b9e00000062f-d6-5c76778309b7 Received: from ESESSMB505.ericsson.se (Unknown_Domain [153.88.183.123]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 76.48.01583.387767C5; Wed, 27 Feb 2019 12:41:55 +0100 (CET) Received: from ESESSMB502.ericsson.se (153.88.183.163) by ESESSMB505.ericsson.se (153.88.183.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 27 Feb 2019 12:41:53 +0100 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB502.ericsson.se (153.88.183.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3 via Frontend Transport; Wed, 27 Feb 2019 12:41:53 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5WfycUXKsqse6erEiy0fS6iBVCWW2a3y9AwKzJ/9aNU=; b=CKZozrKJKIhZC2RE/AjEBe4WL3UNoZC4RUIHP2jYDWeupTIWDxpWEapDimgLHZGnYtarfOSk5od2S5RkPCwOjWSSYM+aGOJDq4Rbu7yZ2UFg6bSUa+gK4h4JNRc8BkPWS5yOqLG+041+Y3DUpDdaSx6ulK7fLgJu9Wyiml+he38= Received: from HE1PR07MB4363.eurprd07.prod.outlook.com (20.176.167.24) by HE1PR07MB4187.eurprd07.prod.outlook.com (20.176.166.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1665.12; Wed, 27 Feb 2019 11:41:52 +0000 Received: from HE1PR07MB4363.eurprd07.prod.outlook.com ([fe80::294c:1f99:18f8:8bd5]) by HE1PR07MB4363.eurprd07.prod.outlook.com ([fe80::294c:1f99:18f8:8bd5%5]) with mapi id 15.20.1665.012; Wed, 27 Feb 2019 11:41:52 +0000 From: Anju Thomas To: "dev@openvswitch.org" Thread-Topic: [PATCH] Fix crash due to multiple tnl push action Thread-Index: AQHUzpFuLghYLuZ030OwJYOexIgxNw== Date: Wed, 27 Feb 2019 11:41:52 +0000 Message-ID: <1551296607-9259-1-git-send-email-anju.thomas@ericsson.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [125.16.213.150] x-mailer: git-send-email 1.9.1 x-clientproxiedby: PN1PR0101CA0002.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::12) To HE1PR07MB4363.eurprd07.prod.outlook.com (2603:10a6:7:a0::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anju.thomas@ericsson.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5c31b373-137d-47f0-6809-08d69ca890e0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(7193020); SRVR:HE1PR07MB4187; x-ms-traffictypediagnostic: HE1PR07MB4187: x-microsoft-exchange-diagnostics: =?utf-8?q?1=3BHE1PR07MB4187=3B23=3AHaqM?= =?utf-8?q?RJljewGqPVecJXyQQligpEp3UArMshGZAMicBhRpKldf3+gP6HnYa/JP?= =?utf-8?q?A9Pa2FtdMDv83P4HMrbcBndPb4AUdg7Lb2PJaLGXJYgKlvpbxXHsjwBm?= =?utf-8?q?qRQDXUNN34m5A2adEVuYoAR0tfmm1g8R/4u1/gdEYEGXkL7S0xxd20ZM?= =?utf-8?q?SQ5mR6luQ1zJsb5NBTRmM2hue9NYlme8HFcak1uiOLSqNohZbh9uOeAq?= =?utf-8?q?yWzLX1eHgspr6+1grx4Ll863cBsb3+JfheWtCswa/Jmg4fa2aJXTSsSB?= =?utf-8?q?a6gzpaU4kSEFIb07fhmgq+fgaVHKcdQAJ4iMywHHgoUjeS3dYTZQCT02?= =?utf-8?q?H1yE3Ei7zY2AGM/wiggttPOIf6FityjwnZpboRyT8+6t/4GAIFTAeZOH?= =?utf-8?q?7VUTEO8cP+vjAOQIuOiOQxqGcqwC6tUNATU4gWBj4HDz9YmYBKeM/Qpk?= =?utf-8?q?ddhJzBkkogUvKscWKJe1ZNpcnMwXrtc7u5YMJqBgH0pFCfyxP4Vu0i7c?= =?utf-8?q?sbWvBfcVF/b8R5rZN4rATXZmEI1Cwt+XfMbG5tYEHOXDpEBGGkCQ9/fc?= =?utf-8?q?wSgLDaAxPrOGrkoYgm/fB1/Of1Ol9YrhSauZhwLmOSNu/Qn+2J/0hew4?= =?utf-8?q?WGyytYBNpaBVo5k61NKiNIjplBwoQ1Qeu5MmtESEdZ+YSpAFbyDm/DFt?= =?utf-8?q?hyL75ii52BKglew84FQA/h5le7BaVG65u8rsMQ8JHScynCuVv4rXvWjn?= =?utf-8?q?vAe5oX6U2PlmaesomjA/Xdh9TyPh4sovwpeO7xG6ti/DiMJlxZX0m5lf?= =?utf-8?q?a4Hyc6RzmxKAPeYQZ04gYOFIOuanCpPSAzFm+IoCckfrmyyrLsVjwVQg?= =?utf-8?q?oz+KMYbVpueWpq78b8Tkq7fHhK5M7ePDdL5QBCe0K+XZ0cbbteG7AmIj?= =?utf-8?q?BbTeWZCGHc1T2cXqDz85Tu4xd7yJKhDbjewZHvhU3ZNzH5L0uD+3itVw?= =?utf-8?q?G3zFgXFyChJHscjNNkWK8Nbjc9fHxBJXULfSYbNQ0ELYvkhokzNqFay7?= =?utf-8?q?fAjcoSzDEgW+nv0zPOnDe6P77Ipq78GevwQ4LLaFM8J0xjqHdZEHBn8K?= =?utf-8?q?mj7kl1QHrd7EiFv7EZNlF1MSQCsYHWSoXEakB+zNyz97nTlnoqcX1Xle?= =?utf-8?q?74HM4A3qFHo3ygw5kIMYYgarcSaCJRX+BDPylC8XbrCCzN740DZaEozG?= =?utf-8?q?4uRZJc9qHPtxwhiw4HHZz+8tcoBGQAzuuemEDjNekdU5XQg1KLhWsteN?= =?utf-8?q?4sVE/+1dLyjgv36JHd2RuFwMFVKFfLz5Ozld/ZbhDkMwXHwV8LcN+BcT?= =?utf-8?q?XplcQ+OfUmlRsm3/X6t/LhoGo6iXDWE=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0961DF5286 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(376002)(136003)(396003)(189003)(199004)(106356001)(105586002)(107886003)(2351001)(66066001)(8676002)(81156014)(305945005)(97736004)(1730700003)(7736002)(81166006)(256004)(71190400001)(26005)(6512007)(4326008)(14444005)(71200400001)(53936002)(186003)(386003)(99286004)(6506007)(68736007)(52116002)(102836004)(86362001)(55236004)(316002)(5640700003)(8936002)(14454004)(6116002)(3846002)(2616005)(476003)(30864003)(478600001)(50226002)(5660300002)(486006)(2501003)(2906002)(25786009)(44832011)(6436002)(6486002)(36756003)(6916009)(21314003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR07MB4187; H:HE1PR07MB4363.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: pKkgkpqixjsBesnxuSw3ZC9DilcVMqfnDOeLhykLbGBAT2zj02UXK2ogFbZvAI6uXTZI1HefGIk88nvyzrLYlj6BoBFiAbGeUbo/saZ4abp883gip4piAJjIz5fGFFjgKhNK/MKNMP0hBVoY9f0rfs2ugla8H6wgzwPbtBo1JQZWflptvwwlEpxedePQScELZkHopWDGFpFWgp6Lw/U/x8rtPWFKhts0780BTncIVJhlKs3+bGfOUCUFVtGCWzLMy3HucXIt8ze8JwEBLwEuQ2lgw9XALKZqpRTjTePDU2iaKQvWJj/eAanlnlotGri2Eb93h/y5zP2J0hzwDYp/potyUaAKGgE/qlKI9L4BKIAHYBC4yUOlBR8FngXvziaP2YaWx6ibe4wwLC/5WNqDIEeq0qn6OkA7IFWTKkVJROQ= Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 5c31b373-137d-47f0-6809-08d69ca890e0 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Feb 2019 11:41:52.2621 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB4187 X-OriginatorOrg: ericsson.com X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpnleLIzCtJLcpLzFFi42KZGbG9Wre5vCzGYOd9aYujp/cwOzB6PLv5 nzGAMYrLJiU1J7MstUjfLoEr497RP2wFnzoYK3p2X2BrYNzQytjFyMkhIWAicWnuSfYuRi4O IYEjjBLrTrWyQjjfGCU27XvIDlIlJLCESWLNrUiQBIvABGaJmWfvs0BUTWaSWDp3M1T/I0aJ x3s3sXUxcnCwCehITNiSA9ItIqAvcajnLAuIzSygJTF3/l5WEFtYwErixKrZzCDlIgL2Egt3 M0GU60ksb94GVsIioCqxrO0KmM0r4C5xYu5csIMYBcQkvp9awwQxUlzi1pP5TBDvCEgs2XOe GcIWlXj5+B8rhK0kcXHNYnYIW05i8erLbCAnSwhMY5T4sXAvE8TQaImps/5ADdKROHv9CTSM ZCUuze+Gsn0lpjSugRoK9O/EY8kQtpbEsb3b2CGGXhWUeDJpP9S2bInOGc9ZQJ6UEJCR+NCv ClHzkVVi08F17BMY9WcheWIWUBmzgKbE+l1QYQ+Jzf+nM0PYihJTuh+yzwKHhaDEyZlPWBYw sq5iFC1OLS7OTTcy1kstykwuLs7P08tLLdnECEweB7f81t3BuPq14yFGAQ5GJR5epqKyGCHW xLLiytxDjBIczEoivL0gId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rx/hARjhATSE0tSs1NTC1KL YLJMHJxSDYzTe85vc+JNzLhWfbu25odkV8St2/ufXknWuabNMq2+uONn4Q+ur7w9q2t5vpVo zxT9Z/Gx6Bafz7rlk29+2N2/yKbn3Nwf1auiOI4Il5/ZW2958bTrv36Z1XsvRqTMmS+xZeMW y/e5NgcDGHaYbmhwqV+++f6TNMYfLofbQ1pqTxluLeEPjH6gxFKckWioxVxUnAgA560knxoD AAA= X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Anju Thomas Subject: [ovs-dev] [PATCH] Fix crash due to multiple tnl push action 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: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org During slow path packet processing, if the action is to output to a tunnel port, the slow path processing of the encapsulated packet continues on the underlay bridge and additional actions (e.g. optional VLAN encapsulation, bond link selection and finally output to port) are collected there. To prepare for a continuation of the processing of the original packet (e.g. output to other tunnel ports in a flooding scenario), the “tunnel_push” action and the actions of the underlay bridge are encapsulated in a clone() action to preserve the original packet. If the underlay bridge decides to drop the tunnel packet (for example if both bonded ports are down simultaneously), the clone(tunnel_push)) actions previously generated as part of translation of the output to tunnel port are discarded and a stand-alone tunnel_push action is added instead. Thus the tunnel header is pushed on to the original packet. This is the bug. Consequences: If packet processing continues with sending to further tunnel ports, multiple tunnel header pushes will happen on the original packet as typically the tunnels all traverse the same underlay bond which is down. The packet may not have enough headroom to accommodate all the tunnel headers. OVS crashes if it runs out of space while trying to push the tunnel headers. Even in case there is enough headroom, the packet will not be freed since the accumulated action list contains only the tunnel header push action without any output port action. Thus, we either have a crash or a packet buffer leak. Signed-off-by: Anju Thomas --- ofproto/ofproto-dpif-xlate.c | 7 ------- tests/tunnel-push-pop-ipv6.at | 10 +++++----- tests/tunnel-push-pop.at | 18 +++++++++--------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 7777ed8..7e69469 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -3510,13 +3510,6 @@ native_tunnel_output(struct xlate_ctx *ctx, const struct xport *xport, nl_msg_end_non_empty_nested(ctx->odp_actions, clone_ofs); } else { nl_msg_cancel_nested(ctx->odp_actions, clone_ofs); - /* XXX : There is no real use-case for a tunnel push without - * any post actions. However keeping it now - * as is to make the 'make check' happy. Should remove when all the - * make check tunnel test case does something meaningful on a - * tunnel encap packets. - */ - odp_put_tnl_push_action(ctx->odp_actions, &tnl_push_data); } /* Restore context status. */ diff --git a/tests/tunnel-push-pop-ipv6.at b/tests/tunnel-push-pop-ipv6.at index 7ca522a..c9e4a2b 100644 --- a/tests/tunnel-push-pop-ipv6.at +++ b/tests/tunnel-push-pop-ipv6.at @@ -93,28 +93,28 @@ dnl Check VXLAN tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=2]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(4789),header(size=70,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7b)),out_port(100)) + [Datapath actions: drop ]) dnl Check VXLAN tunnel push set tunnel id by flow and checksum AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:124,4"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(4789),header(size=70,type=4,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::93,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7c)),out_port(100)) + [Datapath actions: drop ]) dnl Check GRE tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=3]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(3),header(size=62,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)) + [Datapath actions: drop ]) dnl Check Geneve tunnel push AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:2001:cafe::92->tun_ipv6_dst,5"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(6081),header(size=70,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0xffff),geneve(vni=0x7b)),out_port(100)) + [Datapath actions: drop ]) dnl Check Geneve tunnel push with options @@ -122,7 +122,7 @@ AT_CHECK([ovs-ofctl add-tlv-map int-br "{class=0xffff,type=0x80,len=4}->tun_meta AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:2001:cafe::92->tun_ipv6_dst,set_field:0xa->tun_metadata0,5"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(6081),header(size=78,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0xffff),geneve(crit,vni=0x7b,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(100)) + [Datapath actions: drop ]) dnl Check decapsulation of GRE packet diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at index cc8b1b5..07832fc 100644 --- a/tests/tunnel-push-pop.at +++ b/tests/tunnel-push-pop.at @@ -113,49 +113,49 @@ dnl Check VXLAN tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=2]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x7b)),out_port(100)) + [Datapath actions: drop ]) dnl Check VXLAN GPE tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=8]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0xc000003,vni=0x159)),out_port(100)) + [Datapath actions: drop ]) dnl Check VXLAN tunnel push set tunnel id by flow and checksum AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:124,4"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.93,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0xffff),vxlan(flags=0x8000000,vni=0x7c)),out_port(100)) + [Datapath actions: drop ]) dnl Check GRE tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=3]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)) + [Datapath actions: drop ]) dnl Check L3GRE tunnel push AT_CHECK([ovs-ofctl add-flow int-br action=7]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:01),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: pop_eth,tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x800),key=0x1c8)),out_port(100)) + [Datapath actions: pop_eth ]) dnl Check Geneve tunnel push AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:1.1.2.92->tun_dst,5"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(6081),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(vni=0x7b)),out_port(100)) + [Datapath actions: drop ]) dnl Check Geneve tunnel push with pkt-mark AT_CHECK([ovs-ofctl add-flow int-br "actions=set_tunnel:234,6"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: set(skb_mark(0x4d2)),tnl_push(tnl_port(6081),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b7,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.93,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(vni=0xea)),out_port(100)) + [Datapath actions: set(skb_mark(0x4d2)) ]) dnl Check Geneve tunnel push with options @@ -163,7 +163,7 @@ AT_CHECK([ovs-ofctl add-tlv-map int-br "{class=0xffff,type=0x80,len=4}->tun_meta AT_CHECK([ovs-ofctl add-flow int-br "actions=set_field:1.1.2.92->tun_dst,set_field:0xa->tun_metadata0,5"]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=47,tos=0,ttl=64,frag=no)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(6081),header(size=58,type=5,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(crit,vni=0x7b,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(100)) + [Datapath actions: drop ]) dnl Check decapsulation of GRE packet @@ -325,7 +325,7 @@ AT_CHECK([ovs-ofctl add-flow int-br action=3]) AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=f8:bc:12:44:34:b6,dst=aa:55:aa:55:00:00),eth_type(0x0800),ipv4(src=1.1.3.88,dst=1.1.3.112,proto=17,tos=0,ttl=64,frag=no),udp(src=51283,dst=4789)'], [0], [stdout]) AT_CHECK([tail -1 stdout], [0], - [Datapath actions: tnl_push(tnl_port(3),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=aa:55:aa:55:00:00,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x6558),key=0x1c8)),out_port(100)) + [Datapath actions: drop ]) dnl Verify outer L2 and L3 header flow fields can be matched in the underlay bridge