Message ID | d7ff49057dfaf2b48d90da1493a717b96e30ed9f.1529969058.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 1F8EC6038C for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 23:33:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ECE128619 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 23:33:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0365F286F6; Mon, 25 Jun 2018 23:33:06 +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 3AD9628619 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 23:33:05 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41F57z3hl4zF1Gt for <patchwork-linux-mlxsw@patchwork.kernel.org>; Tue, 26 Jun 2018 09:33:03 +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="qXw3A+Ff"; 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.3.42; helo=eur03-am5-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="qXw3A+Ff"; dkim-atps=neutral Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30042.outbound.protection.outlook.com [40.107.3.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41F57v6P5QzF1Gj for <linux-mlxsw@lists.ozlabs.org>; Tue, 26 Jun 2018 09:32:59 +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=e3YtOyM/O0a9tcyQ7Vu7IrKOwoKvywq4ZpnkB9gNBAo=; b=qXw3A+FfuG9lyfqh0sR36HAmKgbq8umoAwqY4MxY+tiQvdAjlxyaR8NRSnuW6tg79Johq1KWi6SuRIeJc2I1jzoMipSiHJwUR+IprIhZPcaO2qjuralN/xgBUJYct+YLcLkvKOxp8rRHpURCU43V2JVKapY/GCbc3iyK4n7xhXU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.23; Mon, 25 Jun 2018 23:32:54 +0000 From: Petr Machata <petrm@mellanox.com> To: <linux-internal@mellanox.com> Subject: [PATCH net-next mlxsw 1/3] selftests: forwarding: lib: Avoid trapping soft devices In-Reply-To: <cover.1529969058.git.petrm@mellanox.com> References: <cover.1529969058.git.petrm@mellanox.com> Message-Id: <d7ff49057dfaf2b48d90da1493a717b96e30ed9f.1529969058.git.petrm@mellanox.com> Date: Tue, 26 Jun 2018 01:32:28 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: CWLP265CA0208.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:4e::28) To AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1d0b791-e10c-4eb3-3035-08d5daf3fa22 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4183; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 3:tVrw3h0VKUV/tQl1sAXV3Zd0VMfq+AA+cmQlq6S03iIr6Qm3xUsWxKOI4syAzaHBYi0PcBNy1SgmD7v7u5WiA9g2M7+orw9d8lr0aeu33QYo05Vs+i7pQURcXeeeYvcQuwYE/miRIHMq1Y5psNN1RBs9sgWs5jsdHjWAUtcpWr1qowyVu2vCS9kDQ0f+Dd9zGNCCLiCKLbClqnXDO2C25Q+XWjZiV6YDXb77PlLcMoMxYSGD9NdXZjp9fQYUxSMG; 25:xqKIgRDU22mTqQVpQMAPub25BoKna/ryYQ7CMVUjMHI7jg6AiSWcvi32IpUq4baokQ0w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zJQo1ek8bxRRB5SQIqt6xZf; 4:c2Dq+RbwdWbYrsCcVN+awPHmmTOhC6z0ETmW7+OZ53Y0mJ1WvtwtETLjDhYPiaYU49+NCn0AGnwlO3TTN+xJ8I9JgfzC8BM9NTxTpPVm1Vra2Z1HsxoJXhOiZPqJmnnU1b4Zg16EGzTN6Pnnjs7pLZWoR4q9Yra5SVuWmjHwcydPpLQ+ZKQ2wgr+xZrMSa1pPjzMaJ8qgb0/PF4IJY79ONMF4U39srRXhCT2y57H2y+pAELJKV4pS12ajRWQnUv4RmfqPtCmTeb/NPsYNLIDjw== X-Microsoft-Antispam-PRVS: <AM6PR05MB41834AAD4E31071695D3D678DB4A0@AM6PR05MB4183.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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM6PR05MB4183; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4183; X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(346002)(39860400002)(366004)(136003)(396003)(189003)(199004)(6116002)(16526019)(52116002)(81166006)(6496006)(81156014)(186003)(6862004)(86362001)(26005)(3846002)(48376002)(956004)(316002)(66066001)(37006003)(2616005)(16586007)(58126008)(476003)(8676002)(386003)(486006)(446003)(36756003)(11346002)(97736004)(5660300001)(106356001)(105586002)(47776003)(51416003)(76176011)(25786009)(118296001)(6486002)(8936002)(2351001)(478600001)(6666003)(6636002)(305945005)(7736002)(50466002)(68736007)(53936002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4183; 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; AM6PR05MB4183; 23:dhAR9+1bMRw8JYE26OW2ehkjzJU8WJQTQ4C3sfOqq?= =?us-ascii?Q?xvAf6IHq7DhkuheNrE0XKrZWTMvNUPwEU+FiEuqhJmYKfggvBIuNT7fZ2OVB?= =?us-ascii?Q?Ntco1egOXGYwZm4b5YRyYR13S3xhmbKrk0mrZH3XUU/fcn0wKNGAVgTSHVjO?= =?us-ascii?Q?YjSgNeVfgA8y0WM7OV8oWJGeC6/D3TEtVisHLBPz5J/QH8Sl9/xADDVkkm5l?= =?us-ascii?Q?LcedKBjFw4+8oYAvzC3BVGh++3NbDi6SqLCCaQ9/PVVogu28JDB8DBKDjw2A?= =?us-ascii?Q?QsbgVyI0Bb4sNljMDIDE5EqnoGGRZecSSI8KuwE+uNoIPjhiAiHPcIBuz1d2?= =?us-ascii?Q?nP3dzfNUcOkXzRaV5MZuFKXcsyrBGrrOi25amgcNMXKXdV1sTqebhP+B0Qco?= =?us-ascii?Q?l/AopBuLEhRfTOpwzAKpJcUWdu2/5+VUgQNLPa5LQwr4qIDkQjtieYhgycq+?= =?us-ascii?Q?J05JHhh80ez3MfExsAGzCNe4QA+j0/x2H32lP74lBEiClBLkyOCsm0pjfGjy?= =?us-ascii?Q?3Rzd13aQ0C8z/Z0n3a5KkqpKsxqpfHhDOcZXeOprGCN///KbkDqoQigQFEEW?= =?us-ascii?Q?PqHWoHP4RomVkjbz1ORUnWLp4QnLk5DQnJFKmsH8ZyWXNkimWjIDTqCUnmPj?= =?us-ascii?Q?71Nn5Z/plz1TtM7KEP/A/3vGsRunSoxFWIli3aAbKp/St2Im6hTxdhJnPMEi?= =?us-ascii?Q?eSP+XxZ7fPFWtrbU/zKK9gk8o+/TMQMCAivDnlYyxXcnyr0PqobUPdbP3rYB?= =?us-ascii?Q?8owt9u35ASw6TslQGjef//piC/2ABXfydFP0x1mffiX3veDxDpywgwaEui9o?= =?us-ascii?Q?ZXOCXGWnRMyzUzvA+iDvw0fH3L3FaInG68giez/thwjBBGuaHfLLe6cRv08b?= =?us-ascii?Q?VSINNimXb42g2AyroxuqdWoI9SGLEk5SH2x5fl4vvzIG0eXaNKgqGjZEKHGj?= =?us-ascii?Q?8rNkDdGclUdBBuk1TxyRNEJvw9G0Cezz2OuvvtUpCu+LWiAKPPvvQCPCQFED?= =?us-ascii?Q?a7X26+7uJRfZzFVKHpKe43uGL37OokDrcrNdIXGkj/LrzzJkSz6HJFZOcC4F?= =?us-ascii?Q?PUqiO/1p47o8u74ntqzS5kCyir+oUi1BnArlzYGCbq4MWwCSiMqKiJ6wCVwq?= =?us-ascii?Q?QonsSp8Qb7HE3IbhYdwSXNBNvZHy39s/gZoDfGtAMvrPaB7Geq1Cjbwabw/3?= =?us-ascii?Q?nKtUBPwNLJ1vX4qmZCvcfQ90mRweKrg03cg?= X-Microsoft-Antispam-Message-Info: kQ3VKn4vlJaG2CraWo6U2j8WEryRknDGQpjE9bvLIsvgXlsKGo+rF/bJCYqObjioAQxvDa2gUUNzHXg2MtD00odVTCIccmEr8svOmzjTEQ6bEsN1y8W+QwSB4+V8weyKCixEGI3JWZKsDWBfovXp9dEf4OBWQ5nV0dLOAdjcOf7IRlN9sPW9HAbP7apiU7P0SNsgyIF89qIwJ5hTt4QSQ2CVbBO53TqMi/dTNlN+Z9xKdDBp6fYdjFizW1SgZ1WMGda7VOrnpBujDDKAPjX2a9OYHeu31dopnojKpj3ZZ/Jh8liY3UqEqvEZlXRl83qBhmkN/Gl/pD21qG8kh2c+WrLWbbkarZj//W93Ko5zeAM= X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 6:b1B9WZwlIZ4peQ9Bpb/cd3Nn4yI8jfve4dLHDeTLa6ls0bx2fWlKTaf9bLPQ1+8af2L8s+SEizU1rYwH0aSCoz1McKFJxjHpm0MFbPA+Rv/9gdL4GEN0s5idljsHnr4FQS9EsMGJ+pk/xiBD1eIzqTZw8CWZLEb8RYE0QoxTDDEyZO8x0VfVpwMYakkfic3yuoCls+2tyWrlRCZA6NrSCu1UEjc0lhNonKIdg3xcvsNGuJCRm1k4NTqLXZyUp2jAo/FbxSPR4JmTmuJVSqWGIFMoqyUn9RM9JWuiPw1mTTVZscKfzUEhkkqYoO1ZKHIvh4uMauRL+SL7lUb83Ilby9l2EWsuhMl/P3njohD0GbhN5bbIoBgOpuc9WnBgV5wk6C7oa6XQ+XSiTWzCdOj6nYhrTZz9VyH07dk8IZFtLRRI6QN9Qv7dCVlQFjaEWYzYEOKow5DyUMRmTcxtQ7lDBg==; 5:Ex+FN6rF+Bxo6cPCF9TSaLbdQJMqkvzIkQFL+n0fJQpYbALDvPwgTIUgUKGkIfFBGxudWVB0ljZEppEqgMWOt5G8SDzr1VgmU21uqfANyUd9WvIncqnsS8DWY095yqkFJxxehuKMpGLhJ/L4MXhxT3egmOnWBufmrDlLFZiaYgw=; 24:QYBHeI7u3+TTh5lwgFPrtDOgkj//D/PDnqiecurUSh+VdQzBqKqDrO2GxAFBjgZub1OT7Hhb0t8iUdO8tSh2qKzSKWsWr6i+bNvy5WlO7/Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 7:qBlFtPZpTTwGmvBTK0ou6+bcKwaESVsRDaTccILVsyH+xpxhR2M0bhrZV5mP2hHrHVxOW+v2ws2MStstzcvigbrpO9a5jQv+S8ltPoLUscFKqQiv/jebfN+OFITXmj3vkDP5L8Bo8qX1dks11DpFheiVzwUzdg5J+3HY5ndb+htzZZXL2KMvlU8ki5Pz0Na/hNXsB/3gagE9DblDUutwhccIwXc21BrJh2fD/zTzy2WdfqqeYdSWvFSHKepBiSH/ X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2018 23:32:54.8589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1d0b791-e10c-4eb3-3035-08d5daf3fa22 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4183 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 6d2c261ddb2f..d9657ffc5c6a 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -460,9 +460,15 @@ trap_install() local dev=$1; shift local direction=$1; shift - # For slow-path testing, we need to install a trap to get to - # slow path the packets that would otherwise be switched in HW. - tc filter add dev $dev $direction pref 1 flower skip_sw action trap + # Some devices may not support or need in-hardware trapping of traffic + # (e.g. the veth pairs that this library creates for non-existent + # loopbacks). Use continue instead, so that there is a filter in there + # (some tests check counters), and so that other filters are still + # processed. + tc filter add dev $dev $direction pref 1 \ + flower skip_sw action trap 2>/dev/null \ + || tc filter add dev $dev $direction pref 1 \ + flower action continue } trap_uninstall() @@ -470,11 +476,13 @@ trap_uninstall() local dev=$1; shift local direction=$1; shift - tc filter del dev $dev $direction pref 1 flower skip_sw + tc filter del dev $dev $direction pref 1 flower } slow_path_trap_install() { + # For slow-path testing, we need to install a trap to get to + # slow path the packets that would otherwise be switched in HW. if [ "${tcflags/skip_hw}" != "$tcflags" ]; then trap_install "$@" fi
There are several cases where traffic that would normally be forwarded in silicon needs to be observed in slow path. That's achieved by trapping such traffic, and the functions trap_install() and trap_uninstall() realize that. However, such treatment is obviously wrong if the device in question is actually a soft device not backed by an ASIC. Besides that, there might be hard devices out there which don't support the trap action. Therefore try to trap if possible, but fall back to inserting a continue if not. Signed-off-by: Petr Machata <petrm@mellanox.com> --- tools/testing/selftests/net/forwarding/lib.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)