net/smc: Make SMC statistics network namespace aware

Make the gathered SMC statistics network namespace aware, for each
namespace collect an own set of statistic information.

Signed-off-by: Guvenc Gulce <guvenc@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Guvenc Gulce
2021-06-16 16:52:58 +02:00
committed by David S. Miller
parent f0dd7bf5e3
commit 194730a9be
8 changed files with 163 additions and 108 deletions

View File

@ -2058,8 +2058,8 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb)
/* check for reusable slot in the link group */
buf_desc = smc_buf_get_slot(bufsize_short, lock, buf_list);
if (buf_desc) {
SMC_STAT_RMB_SIZE(is_smcd, is_rmb, bufsize);
SMC_STAT_BUF_REUSE(is_smcd, is_rmb);
SMC_STAT_RMB_SIZE(smc, is_smcd, is_rmb, bufsize);
SMC_STAT_BUF_REUSE(smc, is_smcd, is_rmb);
memset(buf_desc->cpu_addr, 0, bufsize);
break; /* found reusable slot */
}
@ -2074,13 +2074,13 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_smcd, bool is_rmb)
if (IS_ERR(buf_desc)) {
if (!is_dgraded) {
is_dgraded = true;
SMC_STAT_RMB_DOWNGRADED(is_smcd, is_rmb);
SMC_STAT_RMB_DOWNGRADED(smc, is_smcd, is_rmb);
}
continue;
}
SMC_STAT_RMB_ALLOC(is_smcd, is_rmb);
SMC_STAT_RMB_SIZE(is_smcd, is_rmb, bufsize);
SMC_STAT_RMB_ALLOC(smc, is_smcd, is_rmb);
SMC_STAT_RMB_SIZE(smc, is_smcd, is_rmb, bufsize);
buf_desc->used = 1;
mutex_lock(lock);
list_add(&buf_desc->list, buf_list);