From patchwork Mon Aug 7 10:36:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karol Kolacinski X-Patchwork-Id: 1817744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=A2tV79Yf; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RKCSJ55Hcz1yYl for ; Mon, 7 Aug 2023 20:37:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 008116076C; Mon, 7 Aug 2023 10:37:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 008116076C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1691404639; bh=tvAxWlAZVVQfcWC7KsBunz8MCt7y4TQN7JW6iKLBPnw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=A2tV79YfTVBnSuDjR5TggLAB1C7y2YM2KRATUGN8dUlOzsdsu+UaflJ/LKVIXGvFE YFWL0zZVi4SY10a7+oqvjt+loZ0hwaPT2cc5lLTqGwU8JrIT4WqF03MonQRbIgPASF L/JdTnlEkMq9COVJXkB0XVjNvGmnmUnLShkoln99z/n1QbmTa3OBxizJIiBgN5f5Xp R5XWelzkVnwyHG0qfrI7v5zPdT4QiZ7a+zLdS+HTznAJnM6OX/avPqFKEgsfq5ZYZP MFRjlpU0aL7zhrtOd7xNXsnf6FUIp8e+CCF14Z3xQ9p5iLRMqrTcxnZDDd8fkLe9YQ E6J43XPJXjS6A== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pwt8b_uCWOYv; Mon, 7 Aug 2023 10:37:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id CCD116070A; Mon, 7 Aug 2023 10:37:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org CCD116070A X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 0D7AE1BF3FB for ; Mon, 7 Aug 2023 10:37:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8BF99401A4 for ; Mon, 7 Aug 2023 10:36:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 8BF99401A4 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2LOSihJ6MwIe for ; Mon, 7 Aug 2023 10:36:40 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by smtp2.osuosl.org (Postfix) with ESMTPS id 009DD404F7 for ; Mon, 7 Aug 2023 10:36:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 009DD404F7 X-IronPort-AV: E=McAfee;i="6600,9927,10794"; a="401482320" X-IronPort-AV: E=Sophos;i="6.01,261,1684825200"; d="scan'208";a="401482320" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Aug 2023 03:36:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="874262851" Received: from kkolacin-desk1.igk.intel.com ([10.102.102.152]) by fmsmga001.fm.intel.com with ESMTP; 07 Aug 2023 03:36:41 -0700 From: Karol Kolacinski To: intel-wired-lan@lists.osuosl.org Date: Mon, 7 Aug 2023 12:36:24 +0200 Message-Id: <20230807103624.468230-10-karol.kolacinski@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230807103624.468230-1-karol.kolacinski@intel.com> References: <20230807103624.468230-1-karol.kolacinski@intel.com> MIME-Version: 1.0 Organization: Intel Technology Poland sp. z o.o. - ul. Slowackiego 173, 80-298 Gdansk - KRS 101882 - NIP 957-07-52-316 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691404599; x=1722940599; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mMPvebohTGUBuFLWazFQK5LE80Dwu5LwTr2pUkqzGDM=; b=X4ikHBe8WA7h9K3er4tGYIzx7XtZRVdIu59XB6lpm+4NsS+I5FuaqMyG 6VfUKresJyAIDVraIYTIQeqE+hkQuPDQ0+d6y5TMatima5ogQ69xffXsb GvFCmcHhOq7XYJW1d762Un/sKpsIZvNNsiQjBFckIAlah8XrrhIkzqgU4 PtXtDkqzK3R8I7zgI41YiWwptdG5q43ECshQO+AtgeRqiucOsdeBNMZTB REeKa8nLXnqtkr9gsEY8a26m8YqASJfhJfKQxlcBoRrtS7KSQEb3XYdTX MLIvaMUDDWwUqyzr7+6P4zesw4tGcnpNxQPA0lJpUafwJHuk4zMbUqdgH w==; X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=X4ikHBe8 Subject: [Intel-wired-lan] [PATCH 9/9] ice: stop destroying and reinitalizing Tx tracker during reset X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Karol Kolacinski Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" The ice driver currently attempts to destroy and re-initialize the Tx timestamp tracker during the reset flow. The release of the Tx tracker only happened during CORE reset or GLOBAL reset. The ice_ptp_rebuild() function always calls the ice_ptp_init_tx function which will allocate a new tracker data structure, resulting in memory leaks during PF reset. Certainly the driver should not be allocating a new tracker without removing the old tracker data, as this results in a memory leak. Additionally, there's no reason to remove the tracker memory during a reset. Remove this logic from the reset and rebuild flow. Instead of releasing the Tx tracker, flush outstanding timestamps just before we reset the PHY timestamp block in ice_ptp_cfg_phy_interrupt(). Change-type: ImplementationChange Signed-off-by: Jacob Keller --- drivers/net/ethernet/intel/ice/ice_ptp.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 5dc0c9a27180..d10c43f9266b 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -2629,18 +2629,6 @@ void ice_ptp_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type) if (ice_pf_src_tmr_owned(pf) && reset_type != ICE_RESET_PFR) ice_ptp_rebuild_owner(pf); - /* Init Tx structures */ - if (ice_is_e810(&pf->hw)) { - err = ice_ptp_init_tx_e810(pf, &ptp->port.tx); - } else { - kthread_init_delayed_work(&ptp->port.ov_work, - ice_ptp_wait_for_offsets); - err = ice_ptp_init_tx_e822(pf, &ptp->port.tx, - ptp->port.port_num); - } - if (err) - goto err; - ptp->state = ICE_PTP_READY; /* Start periodic work going */