From patchwork Tue Jun 26 11:08:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Mintz X-Patchwork-Id: 167389 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 6933EB6F86 for ; Tue, 26 Jun 2012 21:10:33 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754261Ab2FZLKb (ORCPT ); Tue, 26 Jun 2012 07:10:31 -0400 Received: from mms2.broadcom.com ([216.31.210.18]:3214 "EHLO mms2.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753814Ab2FZLKa (ORCPT ); Tue, 26 Jun 2012 07:10:30 -0400 Received: from [10.9.200.131] by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Tue, 26 Jun 2012 04:09:33 -0700 X-Server-Uuid: 4500596E-606A-40F9-852D-14843D8201B2 Received: from mail-irva-13.broadcom.com (10.11.16.103) by IRVEXCHHUB01.corp.ad.broadcom.com (10.9.200.131) with Microsoft SMTP Server id 8.2.247.2; Tue, 26 Jun 2012 04:10:23 -0700 Received: from lb-tlvb-yuvalmin.il.broadcom.com ( lb-tlvb-yuvalmin.il.broadcom.com [10.185.6.94]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id 889CA9F9F5; Tue, 26 Jun 2012 04:10:21 -0700 (PDT) Message-ID: <4FE9983C.2060006@broadcom.com> Date: Tue, 26 Jun 2012 14:08:44 +0300 From: "Yuval Mintz" User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Alexander Duyck" cc: eilong@broadcom.com, davem@davemloft.net, netdev@vger.kernel.org, "Jeff Kirsher" , "John Fastabend" Subject: Re: [RFC net-next (v2) 12/14] ixgbe: set maximal number of default RSS queues References: <1340624745-8650-1-git-send-email-yuvalmin@broadcom.com> <1340624745-8650-13-git-send-email-yuvalmin@broadcom.com> <4FE88770.7070007@intel.com> <1340646818.2486.27.camel@lb-tlvb-eilong.il.broadcom.com> <4FE8B019.4030807@intel.com> In-Reply-To: <4FE8B019.4030807@intel.com> X-WSS-ID: 63F747E73NK52089-01-01 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org >> How about this: >> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c >> index af1a531..23a8609 100644 >> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c >> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c >> @@ -277,6 +277,8 @@ static inline bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) >> bool ret = false; >> struct ixgbe_ring_feature *f = &adapter->ring_feature[RING_F_RSS]; >> >> + f->indices = min_t(int, netif_get_num_default_rss_queues(), f->indices); >> + >> if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { >> f->mask = 0xF; >> adapter->num_rx_queues = f->indices; >> @@ -302,7 +304,9 @@ static inline bool ixgbe_set_fdir_queues(struct ixgbe_adapter *adapter) >> bool ret = false; >> struct ixgbe_ring_feature *f_fdir = &adapter->ring_feature[RING_F_FDIR]; >> >> - f_fdir->indices = min_t(int, num_online_cpus(), f_fdir->indices); >> + f_fdir->indices = min_t(int, netif_get_num_default_rss_queues(), >> + f_fdir->indices); >> + >> f_fdir->mask = 0; >> >> /* >> @@ -339,8 +343,7 @@ static inline bool ixgbe_set_fcoe_queues(struct ixgbe_adapter *adapter) >> if (!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED)) >> return false; >> >> - f->indices = min_t(int, num_online_cpus(), f->indices); >> - >> + f->indices = min_t(int, f->indices, netif_get_num_default_rss_queues()); >> adapter->num_rx_queues = 1; >> adapter->num_tx_queues = 1; >> > This makes much more sense, but still needs a few minor changes. Well, what about this one: --- 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 af1a531..0dd1e51 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c @@ -277,6 +277,7 @@ static inline bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) bool ret = false; struct ixgbe_ring_feature *f = &adapter->ring_feature[RING_F_RSS]; + f->indices = min_t(int, netif_get_num_default_rss_queues(), f->indices); if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { f->mask = 0xF; adapter->num_rx_queues = f->indices; @@ -376,7 +377,7 @@ static inline bool ixgbe_set_dcb_queues(struct ixgbe_adapter *adapter) /* Map queue offset and counts onto allocated tx queues */ per_tc_q = min_t(unsigned int, dev->num_tx_queues / tcs, DCB_QUEUE_CAP); - q = min_t(int, num_online_cpus(), per_tc_q); + q = min_t(int, netif_get_num_default_rss_queues(), per_tc_q); for (i = 0; i < tcs; i++) { netdev_set_tc_queue(dev, i, q, offset);