From patchwork Mon Feb 4 15:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 1036008 X-Patchwork-Delegate: dsahern@gmail.com Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=netronome.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="MqxSjJuv"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43tWpF1YKVz9s4Z for ; Tue, 5 Feb 2019 02:29:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730186AbfBDP3H (ORCPT ); Mon, 4 Feb 2019 10:29:07 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:41299 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727571AbfBDP3H (ORCPT ); Mon, 4 Feb 2019 10:29:07 -0500 Received: by mail-qk1-f193.google.com with SMTP id u188so137337qkh.8 for ; Mon, 04 Feb 2019 07:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fezD8ERZrJ5LWntL1/TCfurbTul1/s16aQzxEzQrYqg=; b=MqxSjJuvutqTGwCczqjPfkttRf5kloe2U3VN4p8l3x80/4u+Hcnimxu9mzjUf6JeqC L2PVzRHqegdvdGo6zu6VIht50YAk5n8IqvUsRRLPX2VTYC9MiZjkRxNTHmWoYp/gNqs0 HUrGBWlLLlQXRZ+byrKnps2LH4RCFRb37tQPJmnO0q2AWQSl835duw3u/p35QW5CCd19 EK3hQB/qvWvvjKjBZuxZ5ORZmOQu7t5mldHqoVt+fSjXHx16D7Dulgr6YBf9Yv0EJd36 UP6ED9T8FIj2t8r4oqTh96gAee43vCqJp5lGV9dGZa7LZD34R1fnNDwV7xnkTk4k7dhd FKpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fezD8ERZrJ5LWntL1/TCfurbTul1/s16aQzxEzQrYqg=; b=X4gy/4wCfceIZ4+LiUNaDIF0yrMV0F/1A9jsucAHVPzEMkxyWpfXUil2+aFafOZVIs 7swlbsRQKXJF624BmvP6iUMiV8LfwuEJRgEAbGCUpQ27MLiNSqVrEUeZQi+fFOhZstiH fSdqOMX3E8HRRKgwi+fRKuy32bZUEmQf2dvhVH5H5K3cP4MVMY2mBtnL2thQTLObJcmI hwNnfIChiDXV04jOz7Km4VXI3hRff61CGV5hPIJzkZoUQH7SMD4SbFQB1uM7rufVzhc1 WIK+LL4Snqb+1OvuC0U1n/1W3dGJghMfDCEqsT3mFWYiHbcfqI8MerTEY1yteFawkoSG gu7g== X-Gm-Message-State: AHQUAubeSr8O3U5eqPLBYU0f2BanYB/K5a6b92Jh9xJERgu4J/f2K+g+ 9DRaDANqjoi+I5xmZeMvSo2Giw== X-Google-Smtp-Source: AHgI3IYpbJSoDkN6HaPpU7L8UK/vTpXHF0sxPPSpgICKT1HjJdvKo65oAy44WySKAnyrbux+fIr7Ww== X-Received: by 2002:a37:d4d7:: with SMTP id s84mr2486271qks.28.1549294146326; Mon, 04 Feb 2019 07:29:06 -0800 (PST) Received: from jkicinski-Precision-T1700.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id v24sm1504474qtb.37.2019.02.04.07.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Feb 2019 07:29:05 -0800 (PST) From: Jakub Kicinski To: idosch@mellanox.com, jiri@resnulli.us, dsahern@gmail.com Cc: stephen@networkplumber.org, oss-drivers@netronome.com, netdev@vger.kernel.org, Jakub Kicinski Subject: [PATCH iproute2-next v3] devlink: report cell size Date: Mon, 4 Feb 2019 07:28:59 -0800 Message-Id: <20190204152859.6667-1-jakub.kicinski@netronome.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Print the value of DEVLINK_ATTR_SB_POOL_CELL_SIZE, if reported. Example: pci/0000:82:00.0: sb 1 pool 0 type egress size 40945664 thtype static cell_size 2048 sb 2 pool 0 type egress size 258867200 thtype static cell_size 10240 ... v3: - don't double space. v2: - fix spelling. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Acked-by: Jiri Pirko --- devlink/devlink.c | 3 +++ man/man8/devlink-sb.8 | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/devlink/devlink.c b/devlink/devlink.c index fc4b18d1b613..40f6105af109 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -2891,6 +2891,9 @@ static void pr_out_sb_pool(struct dl *dl, struct nlattr **tb) mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_SIZE])); pr_out_str(dl, "thtype", threshold_type_name(mnl_attr_get_u8(tb[DEVLINK_ATTR_SB_POOL_THRESHOLD_TYPE]))); + if (tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE]) + pr_out_uint(dl, "cell_size", + mnl_attr_get_u32(tb[DEVLINK_ATTR_SB_POOL_CELL_SIZE])); pr_out_handle_end(dl); } diff --git a/man/man8/devlink-sb.8 b/man/man8/devlink-sb.8 index 1882833a3fa7..91b681897d01 100644 --- a/man/man8/devlink-sb.8 +++ b/man/man8/devlink-sb.8 @@ -128,6 +128,16 @@ Behaviour of this argument it the same for every command. - specifies the devlink device to show pools. If this argument is omitted all pools of all devices are listed. +Display available pools listing their +.B type, size, thtype +and +.B cell_size. cell_size +is the allocation granularity of memory within the shared buffer. Drivers +may round up, round down or reject +.B size +passed to the set command if it is not multiple of +.B cell_size. + .SS devlink sb pool set - set attributes of pool .PP