From: Jakub Kicinski Date: Mon, 4 Feb 2019 15:28:59 +0000 (-0800) Subject: devlink: report cell size X-Git-Tag: v5.1.0~27^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d886c66092818f51fc1ddc4030f050b390d2ce9;p=thirdparty%2Fiproute2.git devlink: report cell size 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 Signed-off-by: David Ahern --- diff --git a/devlink/devlink.c b/devlink/devlink.c index 3651e90c1..4c44c3bea 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -2722,6 +2722,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 1882833a3..91b681897 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