Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10AD7C433F5 for ; Fri, 25 Feb 2022 19:46:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235338AbiBYTqz (ORCPT ); Fri, 25 Feb 2022 14:46:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235411AbiBYTqs (ORCPT ); Fri, 25 Feb 2022 14:46:48 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D446B21046D for ; Fri, 25 Feb 2022 11:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645818375; x=1677354375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=f5+yvV7jQdjctTYVZiAL7m81521tP1twFlhfHSCMWyc=; b=HfuSq4hB9AZFIY/o5JJGNWXfgYEnep+oxIjN/SIONipchPhE6D4gTkIi gbx//Yf5z7fJAG8YJle79QhaIxhUnXJhZ5dUetv3Q8PF0LVu3BzgUxK2L QTyYIwjMzuGpaeRmylDkjGUf8JRmNHd5ozpq370oMuSbFX6gx46gn0IVa 13QgNwY72SN6/1QkWfgMTU59d4G+XSGjhdub6hUab8lM44UkNZHz7GA/D MS317mjQN2k36VoCZuaNJeLmlR4OyrGYaIjLAVxZt/UZ2E1t0FFQScLtH uHBjtptNWRB9dnNWXR5Kz47QnwBqZJPnTmKqKYKSOno+mthvv1i1yw8zC g==; X-IronPort-AV: E=McAfee;i="6200,9189,10268"; a="339004868" X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="339004868" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2022 11:46:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,137,1643702400"; d="scan'208";a="707972190" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga005.jf.intel.com with ESMTP; 25 Feb 2022 11:46:11 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Slawomir Laba , netdev@vger.kernel.org, anthony.l.nguyen@intel.com, sassmann@redhat.com, Phani Burra , Jacob Keller , Mateusz Palczewski , Konrad Jankowski Subject: [PATCH net 7/8] iavf: Fix missing check for running netdev Date: Fri, 25 Feb 2022 11:46:13 -0800 Message-Id: <20220225194614.136571-8-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220225194614.136571-1-anthony.l.nguyen@intel.com> References: <20220225194614.136571-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Slawomir Laba The driver was queueing reset_task regardless of the netdev state. Do not queue the reset task in iavf_change_mtu if netdev is not running. Fixes: fdd4044ffdc8 ("iavf: Remove timer for work triggering, use delaying work instead") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/iavf/iavf_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c index da50ea3e44c2..be97ac251802 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_main.c +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c @@ -3905,8 +3905,11 @@ static int iavf_change_mtu(struct net_device *netdev, int new_mtu) iavf_notify_client_l2_params(&adapter->vsi); adapter->flags |= IAVF_FLAG_SERVICE_CLIENT_REQUESTED; } - adapter->flags |= IAVF_FLAG_RESET_NEEDED; - queue_work(iavf_wq, &adapter->reset_task); + + if (netif_running(netdev)) { + adapter->flags |= IAVF_FLAG_RESET_NEEDED; + queue_work(iavf_wq, &adapter->reset_task); + } return 0; } -- 2.31.1