Message ID | f1578e8fee0a3e2afd436c0ff0d49ba04e7c3bbf.1532961216.git.petrm@mellanox.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-kselftest-owner@kernel.org> 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 8DFDD14BC for <patchwork-linux-kselftest@patchwork.kernel.org>; Mon, 30 Jul 2018 14:40:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E57229EEF for <patchwork-linux-kselftest@patchwork.kernel.org>; Mon, 30 Jul 2018 14:40:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 717FA29F0C; Mon, 30 Jul 2018 14:40:03 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 C82A029EEF for <patchwork-linux-kselftest@patchwork.kernel.org>; Mon, 30 Jul 2018 14:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731962AbeG3QPS (ORCPT <rfc822;patchwork-linux-kselftest@patchwork.kernel.org>); Mon, 30 Jul 2018 12:15:18 -0400 Received: from mail-eopbgr60049.outbound.protection.outlook.com ([40.107.6.49]:30291 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731914AbeG3QPS (ORCPT <rfc822;linux-kselftest@vger.kernel.org>); Mon, 30 Jul 2018 12:15:18 -0400 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=DAwbO29l3lAtDnLvnnb6NHArXPAT1WCrvBpvQJC8DZM=; b=QoMvW4ulxCW7giuHPYAS5NcnyZ0G87po/4npEd/KqoXz0o0ioO/JqdRK6l9B/BoQ2W9Otql8ahgMBCqci2VWikE9145P3gfaVNlLNCk8cs2QYbNdgHV5TN3pvdD/hhmrqwsZWQXoWFhAoNO/nniYfJYKXN8NWiTKl4t4geOVNqQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM0PR05MB4178.eurprd05.prod.outlook.com (2603:10a6:208:57::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Mon, 30 Jul 2018 14:39:56 +0000 From: Petr Machata <petrm@mellanox.com> To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: davem@davemloft.net, shuah@kernel.org Subject: [PATCH net-next 2/5] selftests: forwarding: lib: Support team devices In-Reply-To: <cover.1532961216.git.petrm@mellanox.com> References: <cover.1532961216.git.petrm@mellanox.com> Message-Id: <f1578e8fee0a3e2afd436c0ff0d49ba04e7c3bbf.1532961216.git.petrm@mellanox.com> Date: Mon, 30 Jul 2018 16:39:52 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: LO2P265CA0064.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::28) To AM0PR05MB4178.eurprd05.prod.outlook.com (2603:10a6:208:57::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 955f2f96-0685-43bf-c5dd-08d5f62a520b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR05MB4178; X-Microsoft-Exchange-Diagnostics: 1;AM0PR05MB4178;3:AJiUMflRUzNrOEp6+SvZa8DlZnLoMJqw2hmJLKtZW4R9R8CwtqfCqQrGdFYBMEJIrUh6QwFHD6gjqw7A8N9tR1iSMvOO6omXEQdCgiZ9yUzktAjLllSA1Lv77TjLq8VWnEarH5Es777WyCss3Xbtqt9GCbDss0o9x5sP5e4vlcYtOc5TsURX0nVIE5FyG2gLlRVL74hCi24FHdwQPw6H74LxjAvcAOgJYkFNQAqOI1OrwuSYJkoVHiptFg8qRw1/;25:zzibmt74A7Zrwb8Zu9OEi9G0QFrjdcDyqUFjz7Y4xhHDBsWBW1fgi06ldEKh0aQ5gmDYFb8ZyjBNk7fIkMJJWsONY0A3k/Pa1pD5/JWpVui4+P2N19y9JY3SWeFY94brJvHMV8R2RlnGejzVI48yjPP1HF53MfLXjJBq+CEdjfRt/DaJ3CYRO4aqv0QpDRg3z6+6CUGkD5HYkdB7Z3Lx9tMFzUkIKMTlUc1Iu+TkWSA/k/0nLBDJvvk7t24yk/XmHzF1sfid9UP1MHcvwz/0CEYPIlgsyVWf/HaZTvb+M9Ev3AiepVcfV6VxA9ck2JwtrbARvPmsUowmHDsLwrXd3w==;31:eVtc/ogJmuR5fBDqLr3Jti1dWB/XDXw+TbghjbyD8zw8EEZJ4KDV/p0xiTQWUJSmiFiqJLdpN+Uy5HnadNhpJHmU3SOxwr0r/OvPoZW4OVgUQplN3f76ghq4F7009e3H6xpK4wbJgfLEuTpfzCbMdFRNCo/RjIFRf27epeYtzhRp1fz8Cp3TSF9ZYeJ0EaLox1Zc/YTqNbWA6KLAOkjfYSRkJIFPciNghlDHBez9/ns= X-MS-TrafficTypeDiagnostic: AM0PR05MB4178: X-Microsoft-Exchange-Diagnostics: 1;AM0PR05MB4178;20:le1H8qax24hrUaKfVL7esWhdlW13ydAgSnRAaMtmvEF2o27zRZqB9sXqi+kIo9jhbIlBI6Ih+TWykeSLAuXIRRODBc96KmBTMDOvoZkNZGePpqUVHd33a43z80Ln6x/X1nsdktoXbj6Z1gFPooGw2iirIEiHsOhCYRPrlk4oF3GVPyk1l46IG3FMCTkNZriSsh86Qa9x423mRHmUJPshamUXiP0RlAGtWLAPaaRIrvxyB7/s+6y8MgVT3IWgsKGd4DORexRz5SDd597G96mqvklRnxLVcVRtX5/YcTnslIMpSARZP1wDyrjxUxEOm8hWF2lhyANvzqzdS+OCQoa23dgpeqr+cvhitBebskyAiWCykbDS3U6Zmq+J0DKMIujL8XQm968fF84DlMvnEM2DhoxhSeBoKvFFDeeD2JewiFpxDMCNH7G672IfteIYt6VISpxlFtr3jAU9onjybH/MrsNWEbCizFvQJkBJEGN5XcYTXNF4HE6PLF55P2WsJtmL;4:hoIHGCf5VT687eq5sTW532nEwOfkbDPy5wNcIx/mc3yhLXL+Lt60TUhC/RJYNHTdAe/CTd9bn0AEr4mQZ0POJgIXrMYwNNjePlBBbgDFNlsHA1Lfy00Ev02fSatVgjzNM33wLCUQShJO79IrBIxAIH7XESvs6YID49stmgeCfkOv289cOcyuLC4Yv05OXujYhrFd2QPFegKt9jrEmSlC8dkkqwclNbp3nJx72A0h6+lVjYdTiwZXjMB/+1JdHc0GhPLiZornlBFUfbnLAPGXRw== X-Microsoft-Antispam-PRVS: <AM0PR05MB4178E746BAEE9EBD36BD68B5DB2F0@AM0PR05MB4178.eurprd05.prod.outlook.com> 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)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:AM0PR05MB4178;BCL:0;PCL:0;RULEID:;SRVR:AM0PR05MB4178; X-Forefront-PRVS: 0749DC2CE6 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39860400002)(136003)(396003)(346002)(376002)(366004)(189003)(199004)(68736007)(386003)(6666003)(478600001)(53936002)(58126008)(36756003)(956004)(50466002)(86362001)(2906002)(486006)(48376002)(575784001)(8676002)(66066001)(2616005)(47776003)(476003)(4326008)(52116002)(7736002)(5660300001)(25786009)(81156014)(81166006)(105586002)(16526019)(186003)(3846002)(11346002)(446003)(6116002)(8936002)(6486002)(76176011)(106356001)(316002)(305945005)(97736004)(51416003)(118296001)(16586007)(6496006)(26005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR05MB4178;H:t540p;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;AM0PR05MB4178;23:wrrNlPodVUwbUc9P5dG5P43EIkFsuYndY66zbxQlfZnmVDDih/HktBOqrN3cNnMLCGc81bjpZhvGwIDXxXxVeVvPRladWA/14jI6nVORWjfQG3f99ra1QfYq6mM7lM4HMlnRKHImHtGig94OlKvSEtED0M3wfw7A+qQoyXSb+hXt5geFR8fu9iByUlTuWnRj5ZYmAKK6Rff6gGzltEdXu5mPHbO2d1md0QSsh/xVJ31JTFBxnN3Lx2U1trC/Vyoy3m/Cz/yRtsceCql6BqlWBYuyK2xoIiaCbpwFy40B0qT5jq+4yLoSZc6f8PbNoDnG6SGwuoDqx7gr3W8Ld5DLOoYAOHW/dsMY+U4o1w2NZFo9rEDBpKAV4hELonB3KxRZ4ZK6uPu4aWgG2wz/nB/ieD0dg6X6Dw7BlGEgVZc5MG9skr06QLYHnQMmZVfMm503mYy5AomMul+dhHKbJDC7ahcaNHJ3jffk8XPc3fsNcGiXnqtiIvBhHa66HzznOSI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microsoft-Exchange-Diagnostics: 1;AM0PR05MB4178;6:Gz8orBOUbWZ3dXXWQpv0QIA0DT5gGcSTpdluamMcKNDJQFadZBwOJ1v8h6YMPCvXjsL5EFTiigetkdZeR5q1fDtN+piA5bhzTBRkXUdJ1K6ecE4WUrrC8v5kBT7bfFX+fND3BXB8KaPzs1Ld+ngA1EO/XJbzTKhULgKqM7VbkKawSZ+9BNIPFkXihlKORP5Jc8jWdo6J78kAFEInJlWRaLMkFv75zLgQGSdAL4eiN2JeaZHerDIEUiYhCGqOSAXRHgXHJWSEFwWhwIFE6EndTzHZJWZJi66fE0Yz3us74zuGqOzGNsOQECK8hIeU58ph0cwwECTRd3crZIwlMtZhQENHJYX4AlTUXjfKQx2hTsjKLkEtmVusO1DjyHw4hoOwqCxHbmEm4T5Ca56OiFO6wLKSXFnUYxqBBdtYyddG8ulpVkn/+R+kMQI4Zv+kdaHa3a4opnybJReFsczEl26NdQ==;5:xgEpsxtRATDmMNnGtE7G8ZvY84O8NtaI/Ql0y6LUOy5liKFxpVnhAr/6mEsARXnzcHNVKmGiA70ZgSXxnN/8PcwQoqo6OWEXgPDIDjDJsMa86z8zqncb/mRDt6QshCBf55Vl9P9IfAn3g0eN3vCJKZ8oCFwQ5OMYbErGqg1zMX8=;7:crvEQNjkwzWvlzLE9T06DjOOekFvAVGG/tesKbKQw5+1zvAdiwIE2dx6UW/TA1seQYoFwbL4m+wB3Nhi3BXiGRy4s0zEvugYr/vvH87cLdRLBTYB4mE3uIV5cBIIhYx4O+fbpfKOz2jHxJjI2/O8XYNLEwTYjPrU+MM6raBVXysu09gq/oF+foWCDKNuJEHwPHQjK4yyMqC84LgGPBEiCVTgEC/bGNHzhRTXNzFmT3wLbuAB4Km+/ZH6/OFd6UFm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jul 2018 14:39:56.5403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 955f2f96-0685-43bf-c5dd-08d5f62a520b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4178 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kselftest.vger.kernel.org> X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
A test for mirror-to-gretap with team in UL packet path
|
expand
|
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 81e36157bf16..3a4eba4f0d08 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -8,6 +8,7 @@ PING=${PING:=ping} PING6=${PING6:=ping6} MZ=${MZ:=mausezahn} +TEAMD=${TEAMD:=teamd} WAIT_TIME=${WAIT_TIME:=5} PAUSE_ON_FAIL=${PAUSE_ON_FAIL:=no} PAUSE_ON_CLEANUP=${PAUSE_ON_CLEANUP:=no} @@ -425,6 +426,28 @@ vlan_destroy() ip link del dev $name } +team_create() +{ + local if_name=$1; shift + local mode=$1; shift + + require_command $TEAMD + $TEAMD -t $if_name -d -c '{"runner": {"name": "'$mode'"}}' + for slave in "$@"; do + ip link set dev $slave down + ip link set dev $slave master $if_name + ip link set dev $slave up + done + ip link set dev $if_name up +} + +team_destroy() +{ + local if_name=$1; shift + + $TEAMD -t $if_name -k +} + master_name_get() { local if_name=$1
Add team_create() and team_destroy() to manage team netdevices. Signed-off-by: Petr Machata <petrm@mellanox.com> --- tools/testing/selftests/net/forwarding/lib.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)