From patchwork Tue Oct 28 19:30:42 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirsher, Jeffrey T" X-Patchwork-Id: 6141 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.176.167]) by ozlabs.org (Postfix) with ESMTP id D9216DDE1E for ; Wed, 29 Oct 2008 06:31:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752977AbYJ1TbJ (ORCPT ); Tue, 28 Oct 2008 15:31:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752968AbYJ1TbH (ORCPT ); Tue, 28 Oct 2008 15:31:07 -0400 Received: from qmta05.westchester.pa.mail.comcast.net ([76.96.62.48]:55376 "EHLO QMTA05.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbYJ1TbG (ORCPT ); Tue, 28 Oct 2008 15:31:06 -0400 Received: from OMTA14.westchester.pa.mail.comcast.net ([76.96.62.60]) by QMTA05.westchester.pa.mail.comcast.net with comcast id YJCb1a0091HzFnQ55KX2Ry; Tue, 28 Oct 2008 19:31:02 +0000 Received: from gitlost.lost ([63.64.152.142]) by OMTA14.westchester.pa.mail.comcast.net with comcast id YKWi1a01C34bfcX3aKWlkw; Tue, 28 Oct 2008 19:31:00 +0000 X-Authority-Analysis: v=1.0 c=1 a=91WoCdgLGyMA:10 a=bFONqLh9LmK7Fx4ZsSQA:9 a=x_q7TmC0SsN9ba9hFXkA:7 a=2VGgBrHEnzXPnAoswRcbLODr4_4A:4 a=dGJ0OcVc7YAA:10 a=iYlkOlhu7C0A:10 From: Jeff Kirsher Subject: [PATCH] pktgen: fix multiple queue warning To: davem@davemloft.net Cc: netdev@vger.kernel.org, jeff@garzik.org, Jesse Brandeburg , Jeff Kirsher , Robert Olsson Date: Tue, 28 Oct 2008 12:30:42 -0700 Message-ID: <20081028193042.22781.15774.stgit@gitlost.lost> 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 From: Jesse Brandeburg when testing the new pktgen module with multiple queues and ixgbe with: pgset "flag QUEUE_MAP_CPU" I found that I was getting errors in dmesg like: pktgen: WARNING: QUEUE_MAP_CPU disabled because CPU count (8) exceeds number <4>pktgen: WARNING: of tx queues (8) on eth15 you'll note, 8 really doesn't exceed 8. This patch seemed to fix the logic errors and also the attempts at limiting line length in printk (which didn't work anyway) Signed-off-by: Jesse Brandeburg Signed-off-by: Jeff Kirsher CC: Robert Olsson Signed-off-by: Robert Olsson --- --- net/core/pktgen.c | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 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/pktgen.c b/net/core/pktgen.c index 99f656d..a47f5ba 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -1973,28 +1973,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) /* make sure that we don't pick a non-existing transmit queue */ ntxq = pkt_dev->odev->real_num_tx_queues; - if (ntxq <= num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { + if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " - "disabled because CPU count (%d) exceeds number ", - num_online_cpus()); - printk(KERN_WARNING "pktgen: WARNING: of tx queues " - "(%d) on %s \n", ntxq, pkt_dev->odev->name); + "disabled because CPU count (%d) exceeds number " + "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, + pkt_dev->odev->name); pkt_dev->flags &= ~F_QUEUE_MAP_CPU; } if (ntxq <= pkt_dev->queue_map_min) { printk(KERN_WARNING "pktgen: WARNING: Requested " - "queue_map_min (%d) exceeds number of tx\n", - pkt_dev->queue_map_min); - printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " - "%s, resetting\n", ntxq, pkt_dev->odev->name); + "queue_map_min (zero-based) (%d) exceeds valid range " + "[0 - %d] for (%d) queues on %s, resetting\n", + pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq, + pkt_dev->odev->name); pkt_dev->queue_map_min = ntxq - 1; } - if (ntxq <= pkt_dev->queue_map_max) { + if (pkt_dev->queue_map_max >= ntxq) { printk(KERN_WARNING "pktgen: WARNING: Requested " - "queue_map_max (%d) exceeds number of tx\n", - pkt_dev->queue_map_max); - printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " - "%s, resetting\n", ntxq, pkt_dev->odev->name); + "queue_map_max (zero-based) (%d) exceeds valid range " + "[0 - %d] for (%d) queues on %s, resetting\n", + pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq, + pkt_dev->odev->name); pkt_dev->queue_map_max = ntxq - 1; }