From patchwork Sat Jun 30 00:16:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Duyck, Alexander H" X-Patchwork-Id: 168277 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 BCF85B6EF3 for ; Sat, 30 Jun 2012 10:16:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756050Ab2F3AQb (ORCPT ); Fri, 29 Jun 2012 20:16:31 -0400 Received: from mga09.intel.com ([134.134.136.24]:26111 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755693Ab2F3AQa (ORCPT ); Fri, 29 Jun 2012 20:16:30 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 29 Jun 2012 17:16:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,352,1309762800"; d="scan'208";a="159910168" Received: from gitlad.jf.intel.com ([10.23.153.32]) by orsmga001.jf.intel.com with ESMTP; 29 Jun 2012 17:16:29 -0700 Received: from gitlad.jf.intel.com (gitlad.jf.intel.com [127.0.0.1]) by gitlad.jf.intel.com (8.14.2/8.14.2) with ESMTP id q5U0GnNG000606; Fri, 29 Jun 2012 17:16:49 -0700 From: Alexander Duyck Subject: [RFC PATCH 07/10] ixgbe: Add function for setting XPS queue mapping To: netdev@vger.kernel.org Cc: davem@davemloft.net, jeffrey.t.kirsher@intel.com, edumazet@google.com, bhutchings@solarflare.com, therbert@google.com, alexander.duyck@gmail.com Date: Fri, 29 Jun 2012 17:16:49 -0700 Message-ID: <20120630001649.29939.725.stgit@gitlad.jf.intel.com> In-Reply-To: <20120630000652.29939.11108.stgit@gitlad.jf.intel.com> References: <20120630000652.29939.11108.stgit@gitlad.jf.intel.com> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This change adds support for ixgbe to configure the XPS queue mapping on load. The result of this change is that on open we will now be resetting the number of Tx queues, and then setting the default configuration for XPS based on if ATR is enabled or disabled. Signed-off-by: Alexander Duyck --- drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c | 3 +-- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c index 72386fb..a43dae0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c @@ -797,8 +797,7 @@ static int ixgbe_alloc_q_vector(struct ixgbe_adapter *adapter, /* setup affinity mask and node */ if (cpu != -1) cpumask_set_cpu(cpu, &q_vector->affinity_mask); - else - cpumask_copy(&q_vector->affinity_mask, cpu_online_mask); + q_vector->numa_node = node; /* initialize CPU for DCA */ diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index dedb412..06641ea 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -4848,6 +4848,22 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu) return 0; } +static void ixgbe_set_xps_mapping(struct net_device *netdev) +{ + struct ixgbe_adapter *adapter = netdev_priv(netdev); + struct ixgbe_q_vector *q_vector; + u16 i; + + for (i = 0; i < adapter->num_tx_queues; i++) { + q_vector = adapter->tx_ring[i]->q_vector; + + if (!q_vector) + continue; + + netif_set_xps_queue(netdev, &q_vector->affinity_mask, i); + } +} + /** * ixgbe_open - Called when a network interface is made active * @netdev: network interface device structure @@ -4894,6 +4910,8 @@ static int ixgbe_open(struct net_device *netdev) if (err) goto err_set_queues; + /* update the Tx mapping */ + ixgbe_set_xps_mapping(netdev); err = netif_set_real_num_rx_queues(netdev, adapter->num_rx_pools > 1 ? 1 :