forked from Freescale/linux-fslc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to collect SMC statistics information. Per-cpu variables are used to collect the statistic information for better performance and for reducing concurrency pitfalls. The code that is collecting statistic data is implemented in macros to increase code reuse and readability. Signed-off-by: Guvenc Gulce <[email protected]> Signed-off-by: Karsten Graul <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
7 changed files
with
395 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Shared Memory Communications over RDMA (SMC-R) and RoCE | ||
* | ||
* SMC statistics netlink routines | ||
* | ||
* Copyright IBM Corp. 2021 | ||
* | ||
* Author(s): Guvenc Gulce | ||
*/ | ||
#include <linux/init.h> | ||
#include <linux/mutex.h> | ||
#include <linux/percpu.h> | ||
#include <linux/ctype.h> | ||
#include "smc_stats.h" | ||
|
||
/* serialize fallback reason statistic gathering */ | ||
DEFINE_MUTEX(smc_stat_fback_rsn); | ||
struct smc_stats __percpu *smc_stats; /* per cpu counters for SMC */ | ||
struct smc_stats_reason fback_rsn; | ||
|
||
int __init smc_stats_init(void) | ||
{ | ||
memset(&fback_rsn, 0, sizeof(fback_rsn)); | ||
smc_stats = alloc_percpu(struct smc_stats); | ||
if (!smc_stats) | ||
return -ENOMEM; | ||
|
||
return 0; | ||
} | ||
|
||
void smc_stats_exit(void) | ||
{ | ||
free_percpu(smc_stats); | ||
} |
Oops, something went wrong.