From patchwork Wed Sep 30 10:49:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 289318 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 96611C4727F for ; Wed, 30 Sep 2020 10:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54304207F7 for ; Wed, 30 Sep 2020 10:49:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="rvdhXyDN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729322AbgI3Ktk (ORCPT ); Wed, 30 Sep 2020 06:49:40 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:1560 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729293AbgI3Ktj (ORCPT ); Wed, 30 Sep 2020 06:49:39 -0400 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 30 Sep 2020 03:48:48 -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:36 +0000 From: Petr Machata To: CC: "David S. Miller" , Jakub Kicinski , Ido Schimmel , Petr Machata Subject: [PATCH net-next 2/6] selftests: forwarding: devlink_lib: Add devlink_cell_size_get() Date: Wed, 30 Sep 2020 12:49:08 +0200 Message-ID: <12dedba4a0d466008b3fe888157335e93e24b56e.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=1601462928; bh=0VEnX2iOdugDux+klqr3itOvTIZF5XzgcDjixEbRm5s=; 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=rvdhXyDNDjWVjm9DIWbpgWed8iUFACC0OESgSKvToHCdNCrC5Ks+xMRCmSnizk0CU cvSJr+E/f0XZCVI2Oc7hz6z8w4kDT5/nf6UTRQRwCweWsjyRkAKpTZYBCHcT1lGypU deqxEVC3oytMlWfC0+yq3CcZZoIxFO13mHZaYcotwRlybOJ0lFmgzpCc6Y4Tru5uxT IHtQj7Je9woqzS27YdBhX7ygP4w5/ohK6i2r54hpqkQ6zcjGZis8Evx9ysRx3uoIuC ht5+Q8gXJxWo0DOpHz5akK+oo0wprMIHk8pC72keYAQoZBfGJrRIuqahCkUd3Xqdnl HAqFT8aB45aQw== Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add a helper that answers the cell size of the devlink device. Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/devlink_lib.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh index ba6aca848702..cf4e5daf767b 100644 --- a/tools/testing/selftests/net/forwarding/devlink_lib.sh +++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh @@ -549,3 +549,9 @@ devlink_cpu_port_get() echo "$DEVLINK_DEV/$cpu_dl_port_num" } + +devlink_cell_size_get() +{ + devlink sb pool show "$DEVLINK_DEV" pool 0 -j \ + | jq '.pool[][].cell_size' +}