diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2015-08-28 05:58:16 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2015-08-28 05:58:16 +0000 |
commit | e5562eb9343bddcc11e791103c3371f0528fe481 (patch) | |
tree | 1f508b9593144d2019e8c741e45107704f285ce6 /sys/net/rss_config.h | |
parent | 992bbfac613a12bb73b9a764e71677d6d9e5c9c6 (diff) | |
download | src-e5562eb9343bddcc11e791103c3371f0528fe481.tar.gz src-e5562eb9343bddcc11e791103c3371f0528fe481.zip |
Replace the printf()s with optional rate limited debugging for RSS.
Submitted by: Tiwei Bie <btw@mail.ustc.edu.cn>
Differential Revision: https://reviews.freebsd.org/D3471
Notes
Notes:
svn path=/head/; revision=287245
Diffstat (limited to 'sys/net/rss_config.h')
-rw-r--r-- | sys/net/rss_config.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/rss_config.h b/sys/net/rss_config.h index 37d82ae15426..2ab32a43f58b 100644 --- a/sys/net/rss_config.h +++ b/sys/net/rss_config.h @@ -93,6 +93,21 @@ #define RSS_HASH_PKT_EGRESS 1 /* + * Rate limited debugging routines. + */ +#define RSS_DEBUG(format, ...) do { \ + if (rss_debug) { \ + static struct timeval lastfail; \ + static int curfail; \ + if (ppsratecheck(&lastfail, &curfail, 5)) \ + printf("RSS (%s:%u): " format, __func__, __LINE__,\ + ##__VA_ARGS__); \ + } \ +} while (0) + +extern int rss_debug; + +/* * Device driver interfaces to query RSS properties that must be programmed * into hardware. */ |