Author: arybchik Date: Mon Jun 6 09:05:52 2016 New Revision: 301491 URL: https://svnweb.freebsd.org/changeset/base/301491
Log: 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 Modified: head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Mon Jun 6 09:05:06 2016 (r301490) +++ head/sys/dev/sfxge/sfxge.c Mon Jun 6 09:05:52 2016 (r301491) @@ -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_ * - 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_ 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. _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"