From patchwork Mon Oct 4 22:00:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Fastabend X-Patchwork-Id: 66744 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 B26F5B70DA for ; Tue, 5 Oct 2010 09:01:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755752Ab0JDWBr (ORCPT ); Mon, 4 Oct 2010 18:01:47 -0400 Received: from mga11.intel.com ([192.55.52.93]:20578 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975Ab0JDWBq (ORCPT ); Mon, 4 Oct 2010 18:01:46 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 04 Oct 2010 15:01:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.57,280,1283756400"; d="scan'208";a="843686493" Received: from unknown (HELO [127.0.0.1]) ([10.23.209.48]) by fmsmga001.fm.intel.com with ESMTP; 04 Oct 2010 15:01:46 -0700 From: John Fastabend Subject: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap num_rx_queues at init time To: bhutchings@solarflare.com, netdev@vger.kernel.org Cc: john.r.fastabend@intel.com, therbert@google.com Date: Mon, 04 Oct 2010 15:00:42 -0700 Message-ID: <20101004220042.3471.92774.stgit@jf-dev1-dcblab> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The logic for netif_set_real_num_rx_queues is the following, netif_set_real_num_rx_queues(dev, rxq) { ... if (dev->reg_state == NETREG_REGISTERED) { ... } else { dev->num_rx_queues = rxq; } dev->real_num_rx_queues = rxq; return 0; } Some drivers init path looks like the following, alloc_etherdev_mq(priv_sz, max_num_queues_ever); ... netif_set_real_num_rx_queues(dev, queues_to_use_now); ... register_netdev(dev); ... Because netif_set_real_num_rx_queues sets num_rx_queues if the reg state is not NETREG_REGISTERED we end up with the incorrect max number of rx queues. This patch proposes to remove the else clause above so this does not occur. Also just reading the function set_real_num it seems a bit unexpected that num_rx_queues gets set. CC: Ben Hutchings Signed-off-by: John Fastabend Acked-by: Eric Dumazet --- net/core/dev.c | 2 -- 1 files changed, 0 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/net/core/dev.c b/net/core/dev.c index a313bab..f78d996 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1592,8 +1592,6 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq) rxq); if (rc) return rc; - } else { - dev->num_rx_queues = rxq; } dev->real_num_rx_queues = rxq;