From patchwork Thu Jul 9 19:30:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 29640 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4B2E4B6F44 for ; Fri, 10 Jul 2009 05:30:39 +1000 (EST) Received: by ozlabs.org (Postfix) id 3A896DDDF8; Fri, 10 Jul 2009 05:30:39 +1000 (EST) 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 CC5D2DDDE7 for ; Fri, 10 Jul 2009 05:30:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbZGITad (ORCPT ); Thu, 9 Jul 2009 15:30:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753290AbZGITac (ORCPT ); Thu, 9 Jul 2009 15:30:32 -0400 Received: from sj-iport-2.cisco.com ([171.71.176.71]:60026 "EHLO sj-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753270AbZGITab (ORCPT ); Thu, 9 Jul 2009 15:30:31 -0400 X-IronPort-AV: E=Sophos;i="4.42,375,1243814400"; d="scan'208";a="184540208" Received: from sj-dkim-4.cisco.com ([171.71.179.196]) by sj-iport-2.cisco.com with ESMTP; 09 Jul 2009 19:30:27 +0000 Received: from sj-core-5.cisco.com (sj-core-5.cisco.com [171.71.177.238]) by sj-dkim-4.cisco.com (8.12.11/8.12.11) with ESMTP id n69JUQed010446; Thu, 9 Jul 2009 12:30:26 -0700 Received: from xbh-sjc-231.amer.cisco.com (xbh-sjc-231.cisco.com [128.107.191.100]) by sj-core-5.cisco.com (8.13.8/8.14.3) with ESMTP id n69JUQw2024832; Thu, 9 Jul 2009 19:30:26 GMT Received: from xfe-sjc-212.amer.cisco.com ([171.70.151.187]) by xbh-sjc-231.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 9 Jul 2009 12:30:26 -0700 Received: from roland-conroe ([10.33.42.9]) by xfe-sjc-212.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 9 Jul 2009 12:30:26 -0700 Received: by roland-conroe (Postfix, from userid 33217) id 23670E71D7; Thu, 9 Jul 2009 12:30:26 -0700 (PDT) From: Roland Dreier To: Divy Le Ray , "David S. Miller" Cc: netdev@vger.kernel.org Subject: [PATCH for 2.6.31] cxgb3: Fix crash caused by stashing wrong netdev_queue References: <4A554A1D.3070703@chelsio.com> X-Message-Flag: Warning: May contain useful information Date: Thu, 09 Jul 2009 12:30:25 -0700 In-Reply-To: <4A554A1D.3070703@chelsio.com> (Divy Le Ray's message of "Wed, 08 Jul 2009 18:38:37 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) MIME-Version: 1.0 X-OriginalArrivalTime: 09 Jul 2009 19:30:26.0433 (UTC) FILETIME=[B5F14710:01CA00CB] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=1502; t=1247167827; x=1248031827; c=relaxed/simple; s=sjdkim4002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rdreier@cisco.com; z=From:=20Roland=20Dreier=20 |Subject:=20[PATCH=20for=202.6.31]=20cxgb3=3A=20Fix=20crash =20caused=20by=20stashing=20wrong=20netdev_queue |Sender:=20; bh=+JiPFYQGQrLXo+u0SggOVN/2GP+GcHghDHnc8/bB/aU=; b=TZTm8jdoWNyrn0DsSI2R38BNOXCixFq+JOJiL3U4kCfhVTQzRZPHPz93l0 VGZvBM1JxgMHMektUpPGIfbCqJ3O9pYAJqYS3/Sh0plkxf3LlLVeuNVx86uI qoq5HUmCAL; Authentication-Results: sj-dkim-4; header.From=rdreier@cisco.com; dkim=pass ( sig from cisco.com/sjdkim4002 verified; ); Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit c3a8c5b6 ("cxgb3: move away from LLTX") exposed a bug in how cxgb3 looks up the netdev_queue it stashes away in a qset during initialization. For multiport devices, the TX queue index it uses is offset by the first_qset index of each port. This leads to a crash once LLTX is removed, since hard_start_xmit is called with one TX queue lock held, while the TX reclaim timer task grabs a different (wrong) TX queue lock when it frees skbs. Fix this by removing the first_qset offset used to look up the TX queue passed into t3_sge_alloc_qset() from setup_sge_qsets(). Signed-off-by: Roland Dreier Acked-by: Divy Le Ray --- OK, found the bug that was causing the crash I saw. With this patch everything looks solid again. Please apply. drivers/net/cxgb3/cxgb3_main.c | 3 +-- 1 files changed, 1 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/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 538dda4..fb5df5c 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c @@ -642,8 +642,7 @@ static int setup_sge_qsets(struct adapter *adap) struct port_info *pi = netdev_priv(dev); pi->qs = &adap->sge.qs[pi->first_qset]; - for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; - ++j, ++qset_idx) { + for (j = 0; j < pi->nqsets; ++j, ++qset_idx) { set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); err = t3_sge_alloc_qset(adap, qset_idx, 1, (adap->flags & USING_MSIX) ? qset_idx + 1 :