From patchwork Wed Aug 7 22:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13756827 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 F20526D1B4 for ; Wed, 7 Aug 2024 22:45:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070730; cv=none; b=oMhPGR8OrR5P4xb6xi/Rzb7XCx0yj1pK3E6HlIGhiAbLmkKF7yxmcA+K/U9fGYh5Ui+W+wPL2ntJli1xT/RWQHGXcYJgXnbyivA4AszvTUCbkezFqkntFVP5kCVFszU0US6hyRNo28fk0R1K1i37S30TERbdfNwoDekQNrblIq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070730; c=relaxed/simple; bh=6ZK86bRiFrZmTFnriLaSueGHXM2tQ42j3OAX4JBwcQY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TDqSSR2OTxaCz/N6OzhYNDWeJsyHxLaFOTz2N5751eWxDB/6n1J9KS8uatbnfUOSHzmlknyeiaoyLFZmJWk2XklK/Eq2SeiD3Tl2tX5vaV46PVw9j6KTxX/0VCZMieQdSfmXfbG2eSOk7BHKT8owVenkwn2sbAf2cJYiggO9zdg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Cd/WW+eJ; arc=none smtp.client-ip=192.198.163.10 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="Cd/WW+eJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723070729; x=1754606729; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6ZK86bRiFrZmTFnriLaSueGHXM2tQ42j3OAX4JBwcQY=; b=Cd/WW+eJALzU2i/vxfNWpeUta5gOuU+RAZWCjmjoJS6RfuIM6/Ka4YQA eKsRpdsbLVAfP9sQJkyYYfqTyd3amBmiBPqbvCs7roG3pQOTQM2UIzY40 N4gFhZuT1MR3JkvANQQ0W0y9dDYJxUw5iXpSVWNFVkbYn8pu8OcSNu4nB 2THhz3LiK001IgoxMNTU3zYrTodKuGEJ2OkAoDU5dW1d8LrMvEh11x9Iu mJbWcxgkSE8IuVx8BHaFySbY0MPaQT3ncSvq5tWU7yUYoWsXiaHZgtZAf 78LNVLOghuyqYHSM6062M3/7wRnKc1Oa0GhCrLHn1C35MMoL/An7QeZzq w==; X-CSE-ConnectionGUID: RLWtpDpzRdqNsvd6JkKpPA== X-CSE-MsgGUID: FGI0AjP0Q5KgPhZkx226yA== X-IronPort-AV: E=McAfee;i="6700,10204,11157"; a="32573961" X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="32573961" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 15:45:28 -0700 X-CSE-ConnectionGUID: JRG9iN8OQTeDM4Y6fWfVZw== X-CSE-MsgGUID: OenSlLI+TYWzFZYxoo53XQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="57088289" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 07 Aug 2024 15:45:27 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Grzegorz Nitka , anthony.l.nguyen@intel.com, horms@kernel.org, Sergey Temerkhanov , Przemek Kitszel , Pucha Himasekhar Reddy Subject: [PATCH net 1/3] ice: Fix reset handler Date: Wed, 7 Aug 2024 15:45:18 -0700 Message-ID: <20240807224521.3819189-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240807224521.3819189-1-anthony.l.nguyen@intel.com> References: <20240807224521.3819189-1-anthony.l.nguyen@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: Grzegorz Nitka Synchronize OICR IRQ when preparing for reset to avoid potential race conditions between the reset procedure and OICR Fixes: 4aad5335969f ("ice: add individual interrupt allocation") Signed-off-by: Grzegorz Nitka Signed-off-by: Sergey Temerkhanov Reviewed-by: Przemek Kitszel Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- 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 3de020020bc4..6f97ed471fe9 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -559,6 +559,8 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type) if (test_bit(ICE_PREPARED_FOR_RESET, pf->state)) return; + synchronize_irq(pf->oicr_irq.virq); + ice_unplug_aux_dev(pf); /* Notify VFs of impending reset */ From patchwork Wed Aug 7 22:45:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13756828 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 78DD8155731 for ; Wed, 7 Aug 2024 22:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070731; cv=none; b=hqThBbxM0kKKc5CejVmgFYoDv87UC5gnsu1mKOopKK3fJZjAvul7JNpDdMLHbLZ2oYRSW1r+dno0W42MSYIvs4F9j5iX0sdmmwPyWZugdnqoMhBVQXdiyQFdspyZe6pJ0s7iZiwkF/3wEArS/ZBl9d7GxFu1YHPSlljMHD+V3Dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070731; c=relaxed/simple; bh=hlwZhIMz6OecyfysiaO+zZ3EBLz/1il4ZoMK5zb8UkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TQVEwpvHisg7MASeS7ekaGEWBBxj5/y9cayI4n7slk3GSXY80APGwO83Sqyh96JMws4PZE77g0jJbZHDn6hadF40yKC39uz496K9W0Tksv4z4Z7Kwd/00K9b/lbMdhCCGqbHhKb5IFEOE3VvaTkBbQbackLh4iAryWPI1xfUkFQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Qo/Cf/SQ; arc=none smtp.client-ip=192.198.163.10 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="Qo/Cf/SQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723070730; x=1754606730; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hlwZhIMz6OecyfysiaO+zZ3EBLz/1il4ZoMK5zb8UkI=; b=Qo/Cf/SQFNtNmBgbvSZVArp09ODpnugUKpsjVCI6plkKhHK9jVVil6lm GKM2RS9qjJbY9ZVb8IrEFWvf48gBWFQQVjivdBRPHJzrklFWrKU6VRfq/ zQuujWw2v66YPQSDGxCBVJwm2+LmEHY1Uf9uKu0u3X3UOEyv/rwqy7dv8 7LDUOEmg8D5OmFmp2AEKlG3/GiYKXencQIIoIOz6IAiQo4DeyB4m9Pzm0 fznwU+8tAOLUhbqYwkraC2CvdCwwhfX2Ea82VN04umOI2A3jmlkkjo21s gKiZPNf2HAvzZX3iGCjqB/Mrm2y7N9xqIPPYWoMl4UVXopxYYu2fg7w6m Q==; X-CSE-ConnectionGUID: qDx6IHQjRtO9O6InyelhzA== X-CSE-MsgGUID: XvC04ZlrQE+aDZBMN3HNGA== X-IronPort-AV: E=McAfee;i="6700,10204,11157"; a="32573963" X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="32573963" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 15:45:28 -0700 X-CSE-ConnectionGUID: lTwIQudYS++l0ScBs1We5g== X-CSE-MsgGUID: B5PWR/BzSYejrxCbqkb/9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="57088292" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 07 Aug 2024 15:45:27 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Grzegorz Nitka , anthony.l.nguyen@intel.com, richardcochran@gmail.com, horms@kernel.org, Karol Kolacinski , Sergey Temerkhanov , Przemek Kitszel , Pucha Himasekhar Reddy Subject: [PATCH net 2/3] ice: Skip PTP HW writes during PTP reset procedure Date: Wed, 7 Aug 2024 15:45:19 -0700 Message-ID: <20240807224521.3819189-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240807224521.3819189-1-anthony.l.nguyen@intel.com> References: <20240807224521.3819189-1-anthony.l.nguyen@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: Grzegorz Nitka Block HW write access for the driver while the device is in reset to avoid potential race condition and access to the PTP HW in non-nominal state which could lead to undesired effects Fixes: 4aad5335969f ("ice: add individual interrupt allocation") Signed-off-by: Grzegorz Nitka Co-developed-by: Karol Kolacinski Signed-off-by: Karol Kolacinski Signed-off-by: Sergey Temerkhanov Reviewed-by: Przemek Kitszel Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ptp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index e2786cc13286..ef2e858f49bb 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -1477,6 +1477,10 @@ void ice_ptp_link_change(struct ice_pf *pf, u8 port, bool linkup) /* Update cached link status for this port immediately */ ptp_port->link_up = linkup; + /* Skip HW writes if reset is in progress */ + if (pf->hw.reset_ongoing) + return; + switch (hw->ptp.phy_model) { case ICE_PHY_E810: /* Do not reconfigure E810 PHY */ From patchwork Wed Aug 7 22:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 13756829 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 BFC2D155A58 for ; Wed, 7 Aug 2024 22:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070732; cv=none; b=sNogfeLZX2GsOB28Lofp2rwhZW+7nyfc4msgd/3AkYerrf/wcvM2WKQ0YTb9/NvnvM0XmSoFFq7cLXsufzVHvhWnbdSuaYbcOXsJ2aliQStfrvmzGRolJxLkgt2FAGA8VDlCH4XJ+zwkQ4Vyc+MroQqwa+Znq6NwHLjpnF+kLOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723070732; c=relaxed/simple; bh=5opfEZqHHujyFFZLzwf9QTfP3PZh3lLAcZSFEoDTIAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IhTdZ9Jlgr6zcQ3JEqXLM/qfDfnChKqwt9m1nrgMTxsBStoyPplTydTyFS0Jkf3nsvqfelEtlHe2Xw3Nj1SuKvEtlg2gcP0vtKtlnesqT1soHoieTox85QaMQk5yKn0I0IxuDhbFPNeGBFV2/CDDyKu5k5UFBExcLt8fmdY4PXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=B7Y5DB8c; arc=none smtp.client-ip=192.198.163.10 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="B7Y5DB8c" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723070731; x=1754606731; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5opfEZqHHujyFFZLzwf9QTfP3PZh3lLAcZSFEoDTIAQ=; b=B7Y5DB8cIjHDhmUdtmeHNtGPYENn5cW6x9iYDesQY/eeC8U2az4Ins7a yDeDUPzWrMQVXQyfwz0h8gt5Dl+ELPfHjgcpP141nb4L81dSzcX1YYuJ7 VagqPlupUx4xugtrv5130E8lzr+n5OULOnjoezGpoJKBz98DtvOxiaLXW 0idiTuJD19huswJb0/JIcqKBOXufRJf5tsVJgBuzSzNiuLcZGVHxUQpYj I1yhMvgls7fTjKnSAawO0/6ncDzSR7tf0Hrv8XGnE30K27DY22QI0G+UR GzF5U1POHl9cCZNaxrzFkbvA3TOpppgO5TFjNrzCyefpRGjq3wmwmYFoG A==; X-CSE-ConnectionGUID: yQXHnly5QiOa3z0BdR5DSw== X-CSE-MsgGUID: IIpYlUYuR5O4asI7bCIJYA== X-IronPort-AV: E=McAfee;i="6700,10204,11157"; a="32573973" X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="32573973" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2024 15:45:29 -0700 X-CSE-ConnectionGUID: tQfNV9N4Rhqe0W44MwA+YA== X-CSE-MsgGUID: DsIj6w++Qf6assyaLhjDrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,271,1716274800"; d="scan'208";a="57088295" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by fmviesa010.fm.intel.com with ESMTP; 07 Aug 2024 15:45:28 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Mateusz Polchlopek , anthony.l.nguyen@intel.com, horms@kernel.org, Wojciech Drewek , Pucha Himasekhar Reddy Subject: [PATCH net 3/3] ice: Fix incorrect assigns of FEC counts Date: Wed, 7 Aug 2024 15:45:20 -0700 Message-ID: <20240807224521.3819189-4-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240807224521.3819189-1-anthony.l.nguyen@intel.com> References: <20240807224521.3819189-1-anthony.l.nguyen@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: Mateusz Polchlopek Commit ac21add2540e ("ice: Implement driver functionality to dump fec statistics") introduces obtaining FEC correctable and uncorrectable stats per netdev in ICE driver. Unfortunately the assignment of values to fec_stats structure has been done incorrectly. This commit fixes the assignments. Fixes: ac21add2540e ("ice: Implement driver functionality to dump fec statistics") Reviewed-by: Wojciech Drewek Signed-off-by: Mateusz Polchlopek Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ethtool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index 8c990c976132..bc79ba974e49 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -4673,10 +4673,10 @@ static int ice_get_port_fec_stats(struct ice_hw *hw, u16 pcs_quad, u16 pcs_port, if (err) return err; - fec_stats->uncorrectable_blocks.total = (fec_corr_high_val << 16) + - fec_corr_low_val; - fec_stats->corrected_blocks.total = (fec_uncorr_high_val << 16) + - fec_uncorr_low_val; + fec_stats->corrected_blocks.total = (fec_corr_high_val << 16) + + fec_corr_low_val; + fec_stats->uncorrectable_blocks.total = (fec_uncorr_high_val << 16) + + fec_uncorr_low_val; return 0; }