From owner-svn-src-all@FreeBSD.ORG Fri May 18 18:29:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D90106566B; Fri, 18 May 2012 18:29:45 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43E338FC08; Fri, 18 May 2012 18:29:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4IITj2s068315; Fri, 18 May 2012 18:29:45 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4IITj8T068313; Fri, 18 May 2012 18:29:45 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201205181829.q4IITj8T068313@svn.freebsd.org> From: Sean Bruno Date: Fri, 18 May 2012 18:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235616 - stable/8/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 18 May 2012 18:29:45 -0000 Author: sbruno Date: Fri May 18 18:29:44 2012 New Revision: 235616 URL: http://svn.freebsd.org/changeset/base/235616 Log: MFC r235210 Modify the binding of queues to attach to as many CPUs as possible when using more than one igb(4) adapter. This means that queues will not be bound to the same CPUs if there are more CPUs availble. This is only applicable to a system that has multiple interfaces. Modified: stable/8/sys/dev/e1000/if_igb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/e1000/ (props changed) Modified: stable/8/sys/dev/e1000/if_igb.c ============================================================================== --- stable/8/sys/dev/e1000/if_igb.c Fri May 18 18:26:03 2012 (r235615) +++ stable/8/sys/dev/e1000/if_igb.c Fri May 18 18:29:44 2012 (r235616) @@ -364,6 +364,13 @@ TUNABLE_INT("hw.igb.num_queues", &igb_nu SYSCTL_INT(_hw_igb, OID_AUTO, num_queues, CTLFLAG_RDTUN, &igb_num_queues, 0, "Number of queues to configure, 0 indicates autoconfigure"); +/* +** Global variable to store last used CPU when binding queues +** to CPUs in igb_allocate_msix. Starts at CPU_FIRST and increments when a +** queue is bound to a cpu. +*/ +static int igb_last_bind_cpu = -1; + /* How many packets rxeof tries to clean at a time */ static int igb_rx_process_limit = 100; TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit); @@ -2484,8 +2491,16 @@ igb_allocate_msix(struct adapter *adapte ** Bind the msix vector, and thus the ** rings to the corresponding cpu. */ - if (adapter->num_queues > 1) - bus_bind_intr(dev, que->res, i); + if (adapter->num_queues > 1) { + if (igb_last_bind_cpu < 0) + igb_last_bind_cpu = CPU_FIRST(); + bus_bind_intr(dev, que->res, igb_last_bind_cpu); + device_printf(dev, + "Bound queue %d to cpu %d\n", + i,igb_last_bind_cpu); + igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu); + igb_last_bind_cpu = igb_last_bind_cpu % mp_ncpus; + } #if __FreeBSD_version >= 800000 TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, que->txr);