From patchwork Wed Dec 15 20:02:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fenghua Yu X-Patchwork-Id: 75677 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id BEFA71007D6 for ; Thu, 16 Dec 2010 07:14:40 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755312Ab0LOUOM (ORCPT ); Wed, 15 Dec 2010 15:14:12 -0500 Received: from mga14.intel.com ([143.182.124.37]:5800 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754970Ab0LOUOJ (ORCPT ); Wed, 15 Dec 2010 15:14:09 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 15 Dec 2010 12:14:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,350,1288594800"; d="scan'208";a="362217866" Received: from fenghua-desk.sc.intel.com ([10.3.52.216]) by azsmga001.ch.intel.com with ESMTP; 15 Dec 2010 12:13:54 -0800 From: "Fenghua Yu" To: "David S. Miller" , "Eric Dumazet" , "John Fastabend" , "Xinan Tang" , "Junchang Wang" Cc: "netdev" , "linux-kernel" , Fenghua Yu , Junchang Wang , Xinan Tang Subject: [PATCH 3/3] drivers/net/ixgbe/ixgbe_main.c: get tx queue mapping specified in socket Date: Wed, 15 Dec 2010 12:02:06 -0800 Message-Id: X-Mailer: git-send-email 1.7.2 In-Reply-To: References: In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Fenghua Yu Instead of using calculated tx queue mapping, this patch selects tx queue mapping which is specified in socket. By doing this, tx queue mapping can be bigger than the number of cores and stressfully use multiqueue TSS. Or application can specify some of cores/queues to send packets and implement flexible load balance policies. Signed-off-by: Fenghua Yu Signed-off-by: Junchang Wang Signed-off-by: Xinan Tang --- drivers/net/ixgbe/ixgbe_main.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index eee0b29..4d98928 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c @@ -6255,7 +6255,14 @@ static int ixgbe_maybe_stop_tx(struct net_device *netdev, static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb) { struct ixgbe_adapter *adapter = netdev_priv(dev); - int txq = smp_processor_id(); + int txq; + + txq = sk_tx_queue_get(skb->sk); + + if (txq >= 0 && txq < dev->real_num_tx_queues) + return txq; + + txq = smp_processor_id(); #ifdef IXGBE_FCOE __be16 protocol;