From patchwork Mon Nov 19 16:11:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10688869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA6EF1923 for ; Mon, 19 Nov 2018 16:11:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D89332A0DC for ; Mon, 19 Nov 2018 16:11:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCE4F2A0F8; Mon, 19 Nov 2018 16:11:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 771072A101 for ; Mon, 19 Nov 2018 16:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729957AbeKTCfi (ORCPT ); Mon, 19 Nov 2018 21:35:38 -0500 Received: from mail-eopbgr10068.outbound.protection.outlook.com ([40.107.1.68]:28374 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730008AbeKTCfi (ORCPT ); Mon, 19 Nov 2018 21:35:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iJdMyIPOKeEgqKKh+34J31SFn3lCEId9/Y0RZg5hpkw=; b=IGztC13LFDxMtnaj67i9a0Q/UzSfW1NsnltEyWnByOZEsa+7ojA4AsKdjxA/kiubZKPFj3aIzChs0pfpnYV8gTSbh2ArRJHcTvxd8zNjVci2rDzYDtAfDlyn/mlWTxhDid8feCJvhGxCLWqIINg53Mm3yZ+fPtSDCkEEhzlww3Y= Received: from AM0PR05MB4978.eurprd05.prod.outlook.com (20.177.42.95) by AM0PR05MB4899.eurprd05.prod.outlook.com (20.177.41.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.35; Mon, 19 Nov 2018 16:11:30 +0000 Received: from AM0PR05MB4978.eurprd05.prod.outlook.com ([fe80::f953:cde4:ff8d:501a]) by AM0PR05MB4978.eurprd05.prod.outlook.com ([fe80::f953:cde4:ff8d:501a%4]) with mapi id 15.20.1339.026; Mon, 19 Nov 2018 16:11:30 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" , "linux-kselftest@vger.kernel.org" CC: "davem@davemloft.net" , "shuah@kernel.org" , Jiri Pirko , Petr Machata , "roopa@cumulusnetworks.com" , mlxsw , Ido Schimmel Subject: [PATCH net-next 14/18] selftests: forwarding: vxlan_bridge_1d: Add an ECN encap test Thread-Topic: [PATCH net-next 14/18] selftests: forwarding: vxlan_bridge_1d: Add an ECN encap test Thread-Index: AQHUgCKDSd5GWXYjTE2/4IDdE6EPpA== Date: Mon, 19 Nov 2018 16:11:22 +0000 Message-ID: <20181119161006.5405-15-idosch@mellanox.com> References: <20181119161006.5405-1-idosch@mellanox.com> In-Reply-To: <20181119161006.5405-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM5PR0601CA0031.eurprd06.prod.outlook.com (2603:10a6:203:68::17) To AM0PR05MB4978.eurprd05.prod.outlook.com (2603:10a6:208:d0::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM0PR05MB4899;6:h5GmRJpNsZHvWvtJTq+bbhmxzvD3L2GZRcuRShwrJjR8gEtRmV4mFV27VWpKjNYQbtGhavQGivb4Lc8frVl2Q6sRkaVp1myZ58L8BJy1ad6+nAhhqYmwFu3U2BLrbyNsTx50G3jdD93yHlRm/ao56SYt6Uye0h4ih/AQSB5AYcyZukh7uEh6mcYGJhfUnJMmIIqKW+ZY3WOG6p/uwZVxtj2gN7CYLwM/K90nGHc4LA451IPWUloITHukyhcTT8jB8QBPttr/Kj1tUSr/vV6d9C7WwbwFCNsQgbqU9GwBUd9bGo4zOg5tblEW54GdXKWky8Gz40JQqtslPnn2ULfLkd271XkIS1jD4BQcJG8wtrXMW42i+qJzxoG26TaKhh58SCJ0B0bGyIEWmjq2RfQFl8R/bnAtf1/61rXZotZ4wYC5M4c6hxsIskRKKAiiH3gqxk1AJOS2GpPs1ptP3NUV6Q==;5:GL7DoxdeDD4PEX//to2xA0amFhE5iy/zBTDFX/oW3KOiZx5su6ZG8O7M729ddqWKyMptxshEL2mMTqABF0HDM3026em8F+akGhAG1oJ0cFThv/LaHjiEH0qqLm+RI2HbUsk29hClk0anA1y9sCrR201y9Unggh1dDCevBn2is1Q=;7:PDyNpTeir/kONBPyqoXBViec+IwT6EPrY20KEChvySUmOJscamZOpz9sCQnZ793FIu3Nv3B7dlB1HcT+O0KKyhfC3rnC2okYKN3Oyw5UrZUurNRlHeiRxA9JHna9duBL5gX1/jU1kuB3A7bQWqzGAw== x-ms-office365-filtering-correlation-id: 2baf66f2-3d78-4a61-32de-08d64e39a617 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:AM0PR05MB4899; x-ms-traffictypediagnostic: AM0PR05MB4899: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231415)(944501410)(52105112)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:AM0PR05MB4899;BCL:0;PCL:0;RULEID:;SRVR:AM0PR05MB4899; x-forefront-prvs: 08617F610C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39860400002)(346002)(366004)(136003)(396003)(199004)(189003)(8676002)(6666004)(386003)(68736007)(26005)(14454004)(36756003)(8936002)(1076002)(102836004)(3846002)(6116002)(6506007)(4326008)(186003)(81166006)(81156014)(52116002)(25786009)(11346002)(110136005)(316002)(478600001)(54906003)(76176011)(2906002)(6512007)(107886003)(53936002)(99286004)(2616005)(2501003)(7736002)(86362001)(446003)(66066001)(6436002)(476003)(5660300001)(305945005)(106356001)(256004)(105586002)(6486002)(97736004)(71200400001)(486006)(71190400001)(2900100001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR05MB4899;H:AM0PR05MB4978.eurprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nuYb5oIvypzBSnkVGkUzKCe8oZFC92Z7wnYZ0VEXMIqv7WB5HdAb3FW9E9H2/oNHoNjRx7Gb0ffSEDXO7iQ4kHOQOFNR7fZ1suwrilXE7nv3daVQoX04diKnvNp3+NGN2LpcpW6cuEG7/44gzbMI6k/UfFIswuLSwZi6jnFa7R+hXnuQ2m1WW8SlH0BhiIF5EQD5u7S9cLSWIdFxRoFOn0xhMGUrj+6aWy2JeVM+T/woaEZZGupoo5+NaIwQgUpr/Z/5osXRJS5AmkeQszSyBL479Wb6zbuaqpC0SClcsRv4jv0jDEGDqw94MJs1Ew7WBU+xIWevIrpyAZj9GYiUWWU8sSQWqmBcwxG++KWWCNk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2baf66f2-3d78-4a61-32de-08d64e39a617 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2018 16:11:22.9446 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4899 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Petr Machata Test that ECN bits in the VXLAN envelope are correctly deduced from the overlay packet. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- .../net/forwarding/vxlan_bridge_1d.sh | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh index ac1070937ae7..82a124cbd523 100755 --- a/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh +++ b/tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh @@ -70,6 +70,7 @@ export VXPORT test_unicast test_ttl test_tos + test_ecn_encap reapply_config ping_ipv4 test_flood @@ -521,6 +522,31 @@ test_tos() log_test "VXLAN: envelope TOS inheritance" } +__test_ecn_encap() +{ + local q=$1; shift + local tos=$1; shift + + RET=0 + + tc filter add dev v1 egress pref 77 prot ip \ + flower ip_tos $tos action pass + sleep 1 + vxlan_ping_test $h1 192.0.2.3 "-Q $q" v1 egress 77 10 + tc filter del dev v1 egress pref 77 prot ip + + log_test "VXLAN: ECN encap: $q->$tos" +} + +test_ecn_encap() +{ + # In accordance with INET_ECN_encapsulate() + __test_ecn_encap 0x00 0x00 + __test_ecn_encap 0x01 0x01 + __test_ecn_encap 0x02 0x02 + __test_ecn_encap 0x03 0x02 +} + test_all() { echo "Running tests with UDP port $VXPORT"