From owner-freebsd-net@FreeBSD.ORG Wed Apr 25 00:11:29 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D678106566B; Wed, 25 Apr 2012 00:11:29 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout1-b.corp.bf1.yahoo.com (mrout1-b.corp.bf1.yahoo.com [98.139.253.104]) by mx1.freebsd.org (Postfix) with ESMTP id E1A728FC12; Wed, 25 Apr 2012 00:11:28 +0000 (UTC) Received: from [IPv6:::1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout1-b.corp.bf1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id q3P0B7Pi050614; Tue, 24 Apr 2012 17:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yahoo-inc.com; s=cobra; t=1335312668; bh=hcG8WaJbILWzEh0kCIls3xfvZpCkba1lhkY8EucwgEM=; h=Subject:From:Reply-To:To:Cc:Content-Type:Date:Message-ID: Mime-Version:Content-Transfer-Encoding; b=qewm5zrVAOQykuho7wckq8lxMj4gUK/KUj966dOIccrK1nxbMQnS0mZphCIW0lv3e fQ18TcGhtFv6pHBJikfMbo1k0VEdwsBwaaUnx3hB9h3spFmRYbuRHqZjLum6tlgKjQ Lt8uKanYMJdYOInd6QBq5DqFT+oYQPWbWhLfUV4M= From: Sean Bruno To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset="UTF-8" Date: Tue, 24 Apr 2012 17:11:07 -0700 Message-ID: <1335312667.11564.13.camel@powernoodle-l7.corp.yahoo.com> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Milter-Version: master.31+4-gbc07cd5+ X-CLX-ID: 312668000 Cc: Jack Vogel , John Baldwin Subject: igb(4) Pondering a bind to cpu patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Apr 2012 00:11:29 -0000 http://people.freebsd.org/~sbruno/if_igb.c.txt Scenario I've just seen: 8 core machine 2 igb(4) interfaces set num_queues=4 igb0:0 --> cpu0 igb0:1 --> cpu1 igb0:2 --> cpu2 igb0:3 --> cpu3 igb1:0 --> cpu0 igb1:1 --> cpu1 igb1:2 --> cpu2 igb1:3 --> cpu3 I suspect, that we need a static global to keep track of what cpu last was last bound to a queue. My patch does do this, but I don't know if its the right thing. Since I'm doing multiple interfaces, I need to make sure I don't schedule a queue to a non existent cpu, so take a modulo of the counter and the number of cpus in the box. Perhaps not the most elegant solution, but its a thing? Sean