From patchwork Thu Jan 17 11:47:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Vadai X-Patchwork-Id: 213220 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 E4BFC2C007B for ; Thu, 17 Jan 2013 22:47:41 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756135Ab3AQLrk (ORCPT ); Thu, 17 Jan 2013 06:47:40 -0500 Received: from eu1sys200aog116.obsmtp.com ([207.126.144.141]:41823 "HELO eu1sys200aog116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754976Ab3AQLrg (ORCPT ); Thu, 17 Jan 2013 06:47:36 -0500 Received: from mtlsws123.lab.mtl.com ([82.166.227.17]) (using TLSv1) by eu1sys200aob116.postini.com ([207.126.147.11]) with SMTP ID DSNKUPfk1CXwVnY0LWBRJzBRVCt6CYTFtPqK@postini.com; Thu, 17 Jan 2013 11:47:35 UTC Received: from r-vnc07.mtr.labs.mlnx (r-vnc07.mtr.labs.mlnx [10.208.0.119]) by mtlsws123.lab.mtl.com (8.13.8/8.13.8) with ESMTP id r0HBm2YP018838; Thu, 17 Jan 2013 13:48:04 +0200 From: Amir Vadai To: "David S. Miller" Cc: netdev@vger.kernel.org, Or Gerlitz , Amir Vadai Subject: [PATCH net-next V1 6/6] net/mlx4_en: Initialize RFS filters lock and list in init_netdev Date: Thu, 17 Jan 2013 13:47:21 +0200 Message-Id: <1358423241-2452-7-git-send-email-amirv@mellanox.com> X-Mailer: git-send-email 1.7.8.2 In-Reply-To: <1358423241-2452-1-git-send-email-amirv@mellanox.com> References: <1358423241-2452-1-git-send-email-amirv@mellanox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org filters_lock might have been used while it was re-initialized. Moved filters_lock and filters_list initialization to init_netdev instead of alloc_resources which is called every time the device is configured. Signed-off-by: Amir Vadai --- drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 805e242..9c42812 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c @@ -1454,9 +1454,6 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->rx_ring_num); if (!priv->dev->rx_cpu_rmap) goto err; - - INIT_LIST_HEAD(&priv->filters); - spin_lock_init(&priv->filters_lock); #endif return 0; @@ -1651,6 +1648,11 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, if (err) goto out; +#ifdef CONFIG_RFS_ACCEL + INIT_LIST_HEAD(&priv->filters); + spin_lock_init(&priv->filters_lock); +#endif + /* Allocate page for receive rings */ err = mlx4_alloc_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE, MLX4_EN_PAGE_SIZE);