From patchwork Fri Dec 15 11:01:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wojciech Drewek X-Patchwork-Id: 13494285 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DADFF2421D for ; Fri, 15 Dec 2023 11:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ft0IY+dw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702638224; x=1734174224; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=izoEArmY3BTSCQrEPl2eZ2gxCJtnlinZSxzFEQRzkJk=; b=Ft0IY+dw0JN419jMADXY78lQxcW2SG5LfMU7YFZ2/CFhMc75T6txTwek VNA4cID+0lGvIDTxeUBan4NDVlDmRTdzSfdfhVx/2yBUCTkqXrImBJYz5 2E7gMWkX83TnqeCNRGs0pKUC0Th40q56fX9jNFpC5Gn1HlLSVNBo5dafm ilJLEjk9X+OSgrN7X09uIhOvSom0ZCpZdGNeNthBHHY/o4LQlhvE8w5M3 aOEF9Ohcq+zy4H9EGT5z3MjOMusX198s73R4Pgzagm+xNcwExp5vBc4mW kA/obafEz1Z423mxD13ttPawJgl6d3rjuWkb+PFfna+5t3VMbY2uC7lvY A==; X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="385679107" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="385679107" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 03:03:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="918408308" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="918408308" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmsmga001.fm.intel.com with ESMTP; 15 Dec 2023 03:03:42 -0800 Received: from rozewie.igk.intel.com (unknown [10.211.8.69]) by irvmail002.ir.intel.com (Postfix) with ESMTP id A003639C83; Fri, 15 Dec 2023 11:03:41 +0000 (GMT) From: Wojciech Drewek To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org Subject: [PATCH iwl-net 1/2] ice: Fix link_down_on_close message Date: Fri, 15 Dec 2023 12:01:56 +0100 Message-Id: <20231215110157.296923-2-wojciech.drewek@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231215110157.296923-1-wojciech.drewek@intel.com> References: <20231215110157.296923-1-wojciech.drewek@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Katarzyna Wieczerzycka The driver should not report an error message when for a medialess port the link_down_on_close flag is enabled and the physical link cannot be set down. Fixes: 8ac7132704f3 ("ice: Fix interface being down after reset with link-down-on-close flag on") Reviewed-by: Przemek Kitszel Signed-off-by: Katarzyna Wieczerzycka Signed-off-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) --- drivers/net/ethernet/intel/ice/ice_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index cfa584627993..67c2ed2e61f9 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -2145,7 +2145,7 @@ static int ice_configure_phy(struct ice_vsi *vsi) /* Ensure we have media as we cannot configure a medialess port */ if (!(phy->link_info.link_info & ICE_AQ_MEDIA_AVAILABLE)) - return -EPERM; + return -ENOMEDIUM; ice_print_topo_conflict(vsi); @@ -9295,8 +9295,12 @@ int ice_stop(struct net_device *netdev) int link_err = ice_force_phys_link_state(vsi, false); if (link_err) { - netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n", - vsi->vsi_num, link_err); + if (link_err == -ENOMEDIUM) + netdev_info(vsi->netdev, "Skipping link reconfig - no media attached, VSI %d\n", + vsi->vsi_num); + else + netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n", + vsi->vsi_num, link_err); return -EIO; } } From patchwork Fri Dec 15 11:01:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wojciech Drewek X-Patchwork-Id: 13494286 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7541A1C2B3 for ; Fri, 15 Dec 2023 11:03:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="l1O6AUUs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702638225; x=1734174225; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r91IwQB98GjbzYQuxtqMyFt4lszlbhRTuZ/jgO7vu+s=; b=l1O6AUUsWgQGB76O+i2jgumj6LjO5HYurHD/ezL1aFHtxAF8ym1CDqX/ Bl2ZDeEavU7PkNeqvOL/U6xamRpu52yp4N8j8HNnIoCYERfunQ6mTKJtp bwP1uFiyL0v1YOZWVOYg1y786xy21OIlAZMivW5XZ5Fr9cO8gT8r3WP1m vUs/1t66GBPPsCPkyudHdg3ga6gWAQIsZfQz5EJOg3XbdE+yr9dG6LB3z jya0Ps4ANbzkyKUyvjTswrkrOo2wAfGIPYOJu7N7q6WPeZUShxGmmgOdy uY5vYd70//TQ2hjIIn6hwBrmbHL38LXKFkjyrlHq68wqQAQ3EfX3YCurI w==; X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="385679109" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="385679109" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2023 03:03:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10924"; a="918408309" X-IronPort-AV: E=Sophos;i="6.04,278,1695711600"; d="scan'208";a="918408309" Received: from irvmail002.ir.intel.com ([10.43.11.120]) by fmsmga001.fm.intel.com with ESMTP; 15 Dec 2023 03:03:42 -0800 Received: from rozewie.igk.intel.com (unknown [10.211.8.69]) by irvmail002.ir.intel.com (Postfix) with ESMTP id DF2A039C86; Fri, 15 Dec 2023 11:03:41 +0000 (GMT) From: Wojciech Drewek To: intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org Subject: [PATCH iwl-net 2/2] ice: Shut down VSI with "link-down-on-close" enabled Date: Fri, 15 Dec 2023 12:01:57 +0100 Message-Id: <20231215110157.296923-3-wojciech.drewek@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231215110157.296923-1-wojciech.drewek@intel.com> References: <20231215110157.296923-1-wojciech.drewek@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Ngai-Mint Kwan Disabling netdev with ethtool private flag "link-down-on-close" enabled can cause NULL pointer dereference bug. Shut down VSI regardless of "link-down-on-close" state. Fixes: 8ac7132704f3 ("ice: Fix interface being down after reset with link-down-on-close flag on") Reviewed-by: Przemek Kitszel Signed-off-by: Ngai-Mint Kwan Signed-off-by: Wojciech Drewek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) --- drivers/net/ethernet/intel/ice/ice_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 67c2ed2e61f9..a56fbc39e7fd 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -9301,6 +9301,8 @@ int ice_stop(struct net_device *netdev) else netdev_err(vsi->netdev, "Failed to set physical link down, VSI %d error %d\n", vsi->vsi_num, link_err); + + ice_vsi_close(vsi); return -EIO; } }