Message ID | 72186042a74eb29311897e0388fe983ce0dba91c.1528993447.git.petrm@mellanox.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show
Return-Path: <linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 02A7B60348 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Thu, 14 Jun 2018 16:41:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0C5328C06 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Thu, 14 Jun 2018 16:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB60A28D6D; Thu, 14 Jun 2018 16:41:16 +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=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 07EAE28C40 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Thu, 14 Jun 2018 16:40:23 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4168HL145HzF0Pd for <patchwork-linux-mlxsw@patchwork.kernel.org>; Fri, 15 Jun 2018 02:30:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="UwARNc4s"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.8.80; helo=eur04-vi1-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=<UNKNOWN>) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="UwARNc4s"; dkim-atps=neutral Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80080.outbound.protection.outlook.com [40.107.8.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4168HB2dyxzDrqN for <linux-mlxsw@lists.ozlabs.org>; Fri, 15 Jun 2018 02:30:14 +1000 (AEST) 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=b07rn/hfB2ey3lOCEXnYYea8dZ9GM8JRLPH02BH9axE=; b=UwARNc4s54NqYY8SaRjBdO/GaSvSYWICAkD60ZD9nrMR1jk07nQ299xhvjM65NfmqSZGGqFW26Bf68a5sH4ZsjU0pvGDd4vYadKumsmiuTuuIZAVkV8mg/o7j28Y42IF73OJ0ug7XUqkgGSEhc7LD23EJTTdlvNuy9kNM9KL0Ho= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.16; Thu, 14 Jun 2018 16:30:07 +0000 From: Petr Machata <petrm@mellanox.com> To: <linux-internal@mellanox.com> Subject: [PATCH net-next mlxsw v2 3/5] selftests: forwarding: lib: Support team devices In-Reply-To: <cover.1528993447.git.petrm@mellanox.com> References: <cover.1528993447.git.petrm@mellanox.com> Message-Id: <72186042a74eb29311897e0388fe983ce0dba91c.1528993447.git.petrm@mellanox.com> Date: Thu, 14 Jun 2018 18:30:02 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: LNXP265CA0055.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::19) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 283c2511-89f3-487d-1ff0-08d5d214173d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:7fneHaXVxYnefU2oeKxtFuY00gEyTR+F7CGIu1JQ/o3Wc8M5rnGnwKlewF9g8oUsUDLaD4WUWnDpM0Y7x9t9tHQKFFwMJpdyeLw4o4nEE0amUBV6ZndNxqHQc2Xn5SZ/Yhjtm1vRO4BZc7mM2ZJX4Eyctv16+2LBQELACOHoOK8CfteF+UaDny+kJ6jiTzp7THx2Hzs9COkIG0tCeFK6GwbllrAFaVyf/tacO5SnKExxBjpwWoQaOrPIUWKg9rFx; 25:FSSdoZWoyxvJxpbim9MbILxTQQuVv1ChGwfLcGd9DqWacu5B6jdnwYclKUjrQNCHlg3BNjHgIpDcKeMdeDMY80oEBHgqPwcyuxch10s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c6GXLrWvBisoSL2kyJcjvYgEVbiTv+LszKaltj63XqwyI/TsFpWRMjX2rHCeB+QkqMtJIfZGtyHkJXBw7pyRK++4GvXk9zknHil1JvlPFNcAvOQVZV6QYKPwvQeWj6JYgWjYlCRjMkLVosI3AszcGRQ6UfzI0N1juI5UWs7Vq2J8d4Ym64z6n4NER5B1NHDocBUzFAatAxHF5TjoZRZ7c63mvn9b8ADDfwb4Eb/rAfITrJYFKrW/uQaEtIvozBtxWjVH+FFrQ== X-Microsoft-Antispam-PRVS: <VI1PR05MB4191BB30EC976A5C7489BB4EDB7D0@VI1PR05MB4191.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)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0703B549E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(39860400002)(376002)(39380400002)(189003)(199004)(8936002)(486006)(446003)(11346002)(105586002)(6496006)(305945005)(6486002)(48376002)(386003)(106356001)(16586007)(37006003)(58126008)(47776003)(52116002)(51416003)(66066001)(7736002)(316002)(478600001)(6666003)(6636002)(81166006)(8676002)(81156014)(5660300001)(118296001)(476003)(956004)(2616005)(76176011)(50466002)(25786009)(97736004)(3846002)(6116002)(68736007)(86362001)(26005)(53936002)(16526019)(186003)(6862004)(36756003)(2351001)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; 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: =?us-ascii?Q?1; VI1PR05MB4191; 23:I1k5VRDvKEQSmCUxheeG5gPjQiLodeYFsl7rkzXpX?= =?us-ascii?Q?2n6jdxzbudVAXyNC5H4DZqEiMAwD2t9S5dcjN9Ic+7VvHqVwjPKVV1UAsoWq?= =?us-ascii?Q?sIwno5HwCqxK6onCPAnQM1kriIFPwMqvmLNatCeDWXtUmmXRQLiqylNe3S8u?= =?us-ascii?Q?tMFBzLUls3VWXFV5qm5i+ZuhefyYBB/E4t28z/tgiwmeFBdD/fuT4lTAba5a?= =?us-ascii?Q?ioQ198Eo8P1iIGjviEmIvEJXUio8Dv01Ds/NiIT+cvtiBWcGsckn5VuhV7Ag?= =?us-ascii?Q?tkRHVI66wmlRC52l59KLUc1Tz0CjsVc/yhIypDYBY3hWhg6N2QFJhda073gt?= =?us-ascii?Q?rbyIVh/73H+WkXHM3M99Jy6sDxgPv4EQ9dm2D+pULjWVDJFB125PzU/fW7Z0?= =?us-ascii?Q?pOYT06WrE47r0ueyqxwhMTF7S144EPm4iIXSOZVPhNj5x8DfMYYN0umy+6X1?= =?us-ascii?Q?/L5ymxj2+pcW+ALqKpcFu28Hg3YaAwiMRQlCwv+nVf/A4Z3pw9wfWrYHF0mG?= =?us-ascii?Q?jZ0pD5opeb/GBiY+wbsSYb/JmeZJkN+90wH9+Db0Sx44fwcRqlXwbvYrJGN+?= =?us-ascii?Q?HJl9wzaflKgNVRbIM//DUtp+Y2qJ4XxTScx+VuM72WdET+yjz44Xx7CiyCjb?= =?us-ascii?Q?ItrNS/88Z9voAP3yF6zGANgWRqYO0GYmJTC88rnyS7/0IN7nSOZghfA3FU6W?= =?us-ascii?Q?7exyZWPAc/99zNrQ2ttrHuEshASa1fEiiJS24okhBwCZTd/s+UNulVSQ99CJ?= =?us-ascii?Q?Sqmf+vnkrIKOpxMP0eFuGudtDCJXTxLMKDJDOfQq3nc+m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DFFGAiRPWe62oLJ7+Mz/sqBEU1rl2ZHsFZ/kk1DfSrcui/I6aCUfihK3luDXD53VsnEC+79EK++lxT/OVdTRnap2frmYNn6aup8jgm+0n3sIcQUtqbMSQcsXqYob9J51uVK8D7ea2L1j8NIk+S6KNtdiEXY6A9hNYDXE2RpqHCjqyAqOIK/zQKSnzOotK0f2BuLA==; 5:ER6W2HsRX6Eb0Blh50D0r/oMTQSi5deZ+ZQe1U70fG80QunIzat2Tj6WU2UVE0+kPsMK/Tp01s+o/xfUMo/5Quktc+Fw+SMJsNHjRHd9pqm5/EXlIdp/x9rByAe0inzCfdEQnJnSS4UzqJOZJaoXL6kCooTvETOdxJUYkkyfapY=; 24:yO0eh8YZIWo3tYbi9LFhROLdcvKKNv6RRa+pbAUD0lparVYh1rlxtzEk/A34031/OhTqAF7RXIv/EPJprToqeFMkcFSCpPPt2NROpJzGhJQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:E4C8362y15L+vZ+W5iGNJxPjmK591e2FBRbVH57wzTKsbD0YvJIUp9+vo6DwnFE55Gq9MN+t1Y7oSkSiifTS5280oOzL3tSthAEh+V4FJrLeW1GWkPIzrJUvrBRPuGnZavHuLeq0SiV5UkC843tHEJrk8TKwUOqeyy6/5fFxIMiQHFfUgiLqIy+oKHVu03eDH3wRTh+7ybnwk8pWWBO9+RrFY1mgo1rR8WdfyeDl58AIZZubfFsJbBJpnfpdeCdY X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2018 16:30:07.1041 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 283c2511-89f3-487d-1ff0-08d5d214173d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development <linux-mlxsw.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linux-mlxsw/> List-Post: <mailto:linux-mlxsw@lists.ozlabs.org> List-Help: <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 0ae21eca2668..8f60c6ce418e 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} @@ -397,6 +398,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> --- Notes: Changes from v1 to v2: - Refer to teamd as $TEAMD - require_command $TEAMD tools/testing/selftests/net/forwarding/lib.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)