diff options
author | adrian <adrian@FreeBSD.org> | 2015-08-28 05:58:16 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2015-08-28 05:58:16 +0000 |
commit | 2d6b12b4999603aa0dff03a24758f30ff6427aa4 (patch) | |
tree | 1f508b9593144d2019e8c741e45107704f285ce6 /sys/net/rss_config.h | |
parent | 52c4e750440575c74c74d764a9cd89684cb0b097 (diff) | |
download | FreeBSD-src-2d6b12b4999603aa0dff03a24758f30ff6427aa4.zip FreeBSD-src-2d6b12b4999603aa0dff03a24758f30ff6427aa4.tar.gz |
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
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 37d82ae..2ab32a4 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. */ |