From patchwork Wed Sep 30 10:49:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 289317 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3FF8C4727E for ; Wed, 30 Sep 2020 10:49:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 587DD207C3 for ; Wed, 30 Sep 2020 10:49:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="pTRZ+Ray" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729356AbgI3Ktv (ORCPT ); Wed, 30 Sep 2020 06:49:51 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:5197 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbgI3Kto (ORCPT ); Wed, 30 Sep 2020 06:49:44 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 30 Sep 2020 03:48:02 -0700 Received: from localhost.localdomain (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 30 Sep 2020 10:49:41 +0000 From: Petr Machata To: CC: "David S. Miller" , Jakub Kicinski , Ido Schimmel , Petr Machata Subject: [PATCH net-next 4/6] selftests: mlxsw: qos_lib: Add a wrapper for running mlnx_qos Date: Wed, 30 Sep 2020 12:49:10 +0200 Message-ID: <4d06176354d79a574c63b3ed255f988f20053c2a.1601462261.git.petrm@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601462882; bh=8WRI6atJG+3oeVWkigOZBWVCOSBYWfaIQ2LmQIiPuLI=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:Content-Type: X-Originating-IP:X-ClientProxiedBy; b=pTRZ+RayqY+ceJKBS44TtEWBZlREtrJ99J+UjcC6rQyVr8zHRpjSR4G55gWtddGWM AmG14lJ/wmG8Stf/XZPJ4rhB3qDRhEqJ5AVsXlQRwat/bYfLOOaVrSuFa/dKECTFjF YCSBwtAEgaPT2DSXDJo6QUoMxrENp+8V3YRgHDnsTvMCyUF3S5UIcJ1+Lp6j7sX19e 5L0x14UWl3v8Asgl5UDpRanEKc8IAK1UMOfvzwd8KcDqnj9eG9N4hGxeZATg9wRKvM XPAsLTEnktl9Si92tUVUgMRArvjV9XkR7rPihqdplA8Ie5jF4Ty2pBfm/xCwIBLnBq TWgopUWUtJH5A== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org mlnx_qos is a script for configuration of DCB. Despite the name it is not actually Mellanox-specific in any way. It is currently the only ad-hoc tool available (in contrast to a daemon that manages an interface on an ongoing basis). However, it is very verbose and parsing out error messages is not really possible. Add a wrapper that makes it easier to use the tool. Signed-off-by: Petr Machata --- .../testing/selftests/drivers/net/mlxsw/qos_lib.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh index faa51012cdac..0bf76f13c030 100644 --- a/tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh +++ b/tools/testing/selftests/drivers/net/mlxsw/qos_lib.sh @@ -82,3 +82,17 @@ bail_on_lldpad() fi fi } + +__mlnx_qos() +{ + local err + + mlnx_qos "$@" 2>/dev/null + err=$? + + if ((err)); then + echo "Error ($err) in mlnx_qos $@" >/dev/stderr + fi + + return $err +}