From owner-svn-src-all@freebsd.org Mon Jun 6 09:05:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB75B6DE4B; Mon, 6 Jun 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 280C810BF; Mon, 6 Jun 2016 09:05:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5695qdl046797; Mon, 6 Jun 2016 09:05:52 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5695qFe046796; Mon, 6 Jun 2016 09:05:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201606060905.u5695qFe046796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 6 Jun 2016 09:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301491 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2016 09:05:53 -0000 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 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 __FBSDID("$FreeBSD$"); +#include "opt_rss.h" + #include #include #include @@ -58,6 +60,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef RSS +#include +#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.