From owner-svn-src-all@FreeBSD.ORG Wed Mar 25 10:23:02 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA66E537; Wed, 25 Mar 2015 10:23:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 8B39C7A8; Wed, 25 Mar 2015 10:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2PAN2bi082967; Wed, 25 Mar 2015 10:23:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2PAN1aX082962; Wed, 25 Mar 2015 10:23:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201503251023.t2PAN1aX082962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 25 Mar 2015 10:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280518 - in stable/10: share/man/man4 sys/dev/sfxge X-SVN-Group: stable-10 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.18-1 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: Wed, 25 Mar 2015 10:23:02 -0000 Author: arybchik Date: Wed Mar 25 10:23:00 2015 New Revision: 280518 URL: https://svnweb.freebsd.org/changeset/base/280518 Log: MFC: 277894 sfxge: implemented parameter to restrict RSS channels Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: stable/10/share/man/man4/sfxge.4 stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_intr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/sfxge.4 ============================================================================== --- stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/share/man/man4/sfxge.4 Wed Mar 25 10:23:00 2015 (r280518) @@ -108,6 +108,10 @@ If a packet is dropped, the .Va tx_early_drops counter is incremented and the local sender receives ENOBUFS. The value must be greater than or equal to 0. +.It Va hw.sfxge.N.max_rss_channels +The maximum number of allocated RSS channels for the Nth adapter. +If set to 0 or unset, the number of channels is determined by the number +of CPU cores. .El .Sh SUPPORT For general information and support, Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge.c Wed Mar 25 10:23:00 2015 (r280518) @@ -396,11 +396,18 @@ sfxge_create(struct sfxge_softc *sc) device_t dev; efx_nic_t *enp; int error; + char rss_param_name[sizeof(SFXGE_PARAM(%d.max_rss_channels))]; dev = sc->dev; sx_init(&sc->softc_lock, "sfxge_softc"); + sc->max_rss_channels = 0; + snprintf(rss_param_name, sizeof(rss_param_name), + SFXGE_PARAM(%d.max_rss_channels), + (int)device_get_unit(dev)); + TUNABLE_INT_FETCH(rss_param_name, &sc->max_rss_channels); + sc->stats_node = SYSCTL_ADD_NODE( device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge.h Wed Mar 25 10:23:00 2015 (r280518) @@ -229,6 +229,7 @@ struct sfxge_softc { uint64_t ev_stats[EV_NQSTATS]; #endif + unsigned int max_rss_channels; uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; unsigned int rx_indir_table[SFXGE_RX_SCALE_MAX]; Modified: stable/10/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:21:42 2015 (r280517) +++ stable/10/sys/dev/sfxge/sfxge_intr.c Wed Mar 25 10:23:00 2015 (r280518) @@ -298,6 +298,9 @@ sfxge_intr_setup_msix(struct sfxge_softc if (count > EFX_MAXRSS) count = EFX_MAXRSS; + if (sc->max_rss_channels > 0 && count > sc->max_rss_channels) + count = sc->max_rss_channels; + rid = PCIR_BAR(4); resp = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (resp == NULL)