Index: head/sys/dev/sfxge/sfxge.c =================================================================== --- head/sys/dev/sfxge/sfxge.c +++ head/sys/dev/sfxge/sfxge.c @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -58,6 +60,10 @@ #include #include +#ifdef RSS +#include +#endif + #include "common/efx.h" #include "sfxge.h" @@ -127,7 +133,15 @@ * - 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 @@ 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.