Date: Thu, 29 Jan 2015 19:09:14 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277894 - in head: share/man/man4 sys/dev/sfxge Message-ID: <201501291909.t0TJ9EOJ082675@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arybchik Date: Thu Jan 29 19:09:14 2015 New Revision: 277894 URL: https://svnweb.freebsd.org/changeset/base/277894 Log: sfxge: implemented parameter to restrict RSS channels Submitted by: Artem V. Andreev <Artem.Andreev at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/share/man/man4/sfxge.4 head/sys/dev/sfxge/sfxge.c head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_intr.c Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Jan 29 19:06:14 2015 (r277893) +++ head/share/man/man4/sfxge.4 Thu Jan 29 19:09:14 2015 (r277894) @@ -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: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Thu Jan 29 19:06:14 2015 (r277893) +++ head/sys/dev/sfxge/sfxge.c Thu Jan 29 19:09:14 2015 (r277894) @@ -397,11 +397,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: head/sys/dev/sfxge/sfxge.h ============================================================================== --- head/sys/dev/sfxge/sfxge.h Thu Jan 29 19:06:14 2015 (r277893) +++ head/sys/dev/sfxge/sfxge.h Thu Jan 29 19:09:14 2015 (r277894) @@ -230,6 +230,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: head/sys/dev/sfxge/sfxge_intr.c ============================================================================== --- head/sys/dev/sfxge/sfxge_intr.c Thu Jan 29 19:06:14 2015 (r277893) +++ head/sys/dev/sfxge/sfxge_intr.c Thu Jan 29 19:09:14 2015 (r277894) @@ -302,6 +302,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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501291909.t0TJ9EOJ082675>