From patchwork Wed Feb 6 17:58:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 218707 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 395252C02EB for ; Thu, 7 Feb 2013 04:58:50 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932075Ab3BFR6q (ORCPT ); Wed, 6 Feb 2013 12:58:46 -0500 Received: from mail-vc0-f202.google.com ([209.85.220.202]:47001 "EHLO mail-vc0-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067Ab3BFR6n (ORCPT ); Wed, 6 Feb 2013 12:58:43 -0500 Received: by mail-vc0-f202.google.com with SMTP id m8so174853vcd.1 for ; Wed, 06 Feb 2013 09:58:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:subject:message-id:user-agent:mime-version :content-type; bh=JISPZXXvf+rYkfCXIP7WAVs5Dyh9zT729bEpJgiEbbY=; b=SwixwtYDFxhVj5+xFLqSEs0BkXtq/bFVXW2VvMNGD1kEQjfaO8TebtBrhP8Jnxde16 3ACYhfIkdGH/lJKusB3QD+NIHs3hI6pR7ri+eAmsQ2ghkJtJx0jyvSXjiNocaWKCbxxn 10z/eTWj+7lvERK1cQO9/qf91xdP2QVlHYTS0P8/xhD+lo7ZY6hW24ygHjNEoyopNRki OuUbtVrY39nCc2FyQmqjuJ59OSxrGk0KNxq+OcqR5hbOqrcpI+FoAsX4WZAMGoQkIQWr VmnVncavM75pHsNpYrDijS6cLqjQvMtw8q4KlyVX0G9autXtGyktjjamW99abC9Zgkk9 Sbvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:subject:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=JISPZXXvf+rYkfCXIP7WAVs5Dyh9zT729bEpJgiEbbY=; b=AEYO6G3+LAfB8ebM8YMA6GhebpNJusif+0QDWbHtJLUMW+nXRfMlQpjHmN0yY80u9F rEILh3R05MRhCDS797acbvm0cIQNEBkuK6q+dlh0/hGXUkBT0SD53c399jqBp1SV7bvV ST/dvHzEikNHsf7V7Gozv5+GIaTzc9xHysHiqRMn/w/p19JHc7OQIUQ88fYalDGXua/V 90H+8c0yJ31xUf+hjL6EeHhxpUhfzJz3a9CNqZTED7YhPDu4qBRdlQlC1Y7J+zb5IPe+ U4Ga6NR4R7/B0xpMv1qbJMvA2AEgBRBbv6sJTuf0lCfW4aiQVWSy4z7MDaI6DX4vBhvh 0Cew== X-Received: by 10.236.134.43 with SMTP id r31mr13127349yhi.6.1360173522296; Wed, 06 Feb 2013 09:58:42 -0800 (PST) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id e21si602097anp.1.2013.02.06.09.58.42 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 06 Feb 2013 09:58:42 -0800 (PST) Received: from pokey.mtv.corp.google.com (pokey.mtv.corp.google.com [172.17.131.25]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 279E831C0F3; Wed, 6 Feb 2013 09:58:42 -0800 (PST) Received: by pokey.mtv.corp.google.com (Postfix, from userid 60832) id C9C2722F07E; Wed, 6 Feb 2013 09:58:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by pokey.mtv.corp.google.com (Postfix) with ESMTP id B805A22F025; Wed, 6 Feb 2013 09:58:41 -0800 (PST) Date: Wed, 6 Feb 2013 09:58:41 -0800 (PST) From: Tom Herbert To: davem@davemloft.net, yevgenyp@mellanox.com, netdev@vger.kernel.org, amirv@mellanox.com Subject: [PATCH v2] mlx4_en: Fix BQL reset TX queue call point Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmjrP01zy80zAl7Ih6MCG2NwzBBC82yMIGYsab3CywY8tFWGTxRmfSycPZVAVX2FF/GVe+ki+jz1sMVE+D3CDQXPInswzDdnTSn1kAtRQsLgH19uC54Wx0FAQmv/WnMwJ2hpf4srSxLOKDnniyYtmGqe+zGooMq+z00PdZal95VPLbG1te2OVvst7IVa+ty+K13LUYI Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Fix issue in Mellanox driver related to BQL. netdev_tx_reset_queue was not being called in certain situations where the device was being start and stopped. Moved netdev_tx_reset_queue from the reset device path to mlx4_en_free_tx_buf which is where the rings are cleaned in a reset (specifically from device being stopped). Signed-off-by: Tom Herbert Acked-By: Amir Vadai --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 3 --- drivers/net/ethernet/mellanox/mlx4/en_tx.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index ac1c14f..94042f6 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1323,15 +1323,12 @@ static void mlx4_en_restart(struct work_struct *work) watchdog_task); struct mlx4_en_dev *mdev = priv->mdev; struct net_device *dev = priv->dev; - int i; en_dbg(DRV, priv, "Watchdog task called for port %d\n", priv->port); mutex_lock(&mdev->state_lock); if (priv->port_up) { mlx4_en_stop_port(dev, 1); - for (i = 0; i < priv->tx_ring_num; i++) - netdev_tx_reset_queue(priv->tx_ring[i].tx_queue); if (mlx4_en_start_port(dev)) en_err(priv, "Failed restarting port %d\n", priv->port); } diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 30724d8..e06fce7 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c @@ -294,6 +294,8 @@ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring) cnt++; } + netdev_tx_reset_queue(ring->tx_queue); + if (cnt) en_dbg(DRV, priv, "Freed %d uncompleted tx descriptors\n", cnt);