summaryrefslogtreecommitdiff
path: root/net/smc/smc_stats.c
diff options
context:
space:
mode:
authorWen Gu <guwen@linux.alibaba.com>2024-08-14 16:08:27 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-08-20 12:38:23 +0300
commite0d103542b06c36240e3887edfe49578464866eb (patch)
tree5797d50e999e52c9eb2cac75375b4aefa4bd2d5d /net/smc/smc_stats.c
parentd386d59b7c1a39112ca875327339ed519df2b96c (diff)
downloadlinux-e0d103542b06c36240e3887edfe49578464866eb.tar.xz
net/smc: introduce statistics for ringbufs usage of net namespace
The buffer size histograms in smc_stats, namely rx/tx_rmbsize, record the sizes of ringbufs for all connections that have ever appeared in the net namespace. They are incremental and we cannot know the actual ringbufs usage from these. So here introduces statistics for current ringbufs usage of existing smc connections in the net namespace into smc_stats, it will be incremented when new connection uses a ringbuf and decremented when the ringbuf is unused. Signed-off-by: Wen Gu <guwen@linux.alibaba.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/smc/smc_stats.c')
-rw-r--r--net/smc/smc_stats.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/smc/smc_stats.c b/net/smc/smc_stats.c
index ca14c0f3a07d..e71b17d1e21c 100644
--- a/net/smc/smc_stats.c
+++ b/net/smc/smc_stats.c
@@ -218,6 +218,12 @@ static int smc_nl_fill_stats_tech_data(struct sk_buff *skb,
smc_tech->tx_bytes,
SMC_NLA_STATS_PAD))
goto errattr;
+ if (nla_put_uint(skb, SMC_NLA_STATS_T_RX_RMB_USAGE,
+ smc_tech->rx_rmbuse))
+ goto errattr;
+ if (nla_put_uint(skb, SMC_NLA_STATS_T_TX_RMB_USAGE,
+ smc_tech->tx_rmbuse))
+ goto errattr;
if (nla_put_u64_64bit(skb, SMC_NLA_STATS_T_RX_CNT,
smc_tech->rx_cnt,
SMC_NLA_STATS_PAD))