diff options
author | arybchik <arybchik@FreeBSD.org> | 2016-06-06 09:05:52 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2016-06-06 09:05:52 +0000 |
commit | 33db8de27ce4df5e6bf99656495215b9a3f842d4 (patch) | |
tree | 016839a675b1adbd9a6028110792a3e172c6bcb7 | |
parent | 65c79e638a0f970c6fe0d082e68d3ffdfc6da38e (diff) | |
download | FreeBSD-src-33db8de27ce4df5e6bf99656495215b9a3f842d4.zip FreeBSD-src-33db8de27ce4df5e6bf99656495215b9a3f842d4.tar.gz |
sfxge(4): restrict the maximum number of RSS channels by the number of RSS buckets
This is done because one has no point to have more channels since they
will be unused.
Submitted by: Ivan Malov <Ivan.Malov at oktetlabs.ru>
Reviewed by: gnn
Sponsored by: Solarflare Communications, Inc.
Differential Revision: https://reviews.freebsd.org/D6720
-rw-r--r-- | sys/dev/sfxge/sfxge.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c index 0b61f1b..dcc9a07 100644 --- a/sys/dev/sfxge/sfxge.c +++ b/sys/dev/sfxge/sfxge.c @@ -34,6 +34,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include <sys/param.h> #include <sys/kernel.h> #include <sys/bus.h> @@ -58,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include <net/if_media.h> #include <net/if_types.h> +#ifdef RSS +#include <net/rss_config.h> +#endif + #include "common/efx.h" #include "sfxge.h" @@ -127,7 +133,15 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc) * - hardwire maximum RSS channels * - administratively specified maximum RSS channels */ +#ifdef RSS + /* + * Avoid extra limitations so that the number of queues + * may be configured at administrator's will + */ + evq_max = MIN(MAX(rss_getnumbuckets(), 1), EFX_MAXRSS); +#else evq_max = MIN(mp_ncpus, EFX_MAXRSS); +#endif if (sc->max_rss_channels > 0) evq_max = MIN(evq_max, sc->max_rss_channels); @@ -163,6 +177,14 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc) KASSERT(sc->evq_max <= evq_max, ("allocated more than maximum requested")); +#ifdef RSS + if (sc->evq_max < rss_getnumbuckets()) + device_printf(sc->dev, "The number of allocated queues (%u) " + "is less than the number of RSS buckets (%u); " + "performance degradation might be observed", + sc->evq_max, rss_getnumbuckets()); +#endif + /* * NIC is kept initialized in the case of success to be able to * initialize port to find out media types. |