From patchwork Tue Mar 4 19:04:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Arinzon, David" X-Patchwork-Id: 14001288 Received: from smtp-fw-80006.amazon.com (smtp-fw-80006.amazon.com [99.78.197.217]) (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 B03C72063E0 for ; Tue, 4 Mar 2025 19:05:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=99.78.197.217 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741115126; cv=none; b=JZTpt2gD41b+imtKaATo0lQV3uyGTzhlOl/ZyNZjGFoslYfmNBSTdjg+p1I7KICNaXjLbIdrdqScVP7ja4fwZWo8snw0eJnIHFc2M3TmnM3wJaLX3JA3gE7rh09+3Zp4qih0U48ny7cg6Ztka4Zm3ivLRNrsfZEGdJOPm+ZKBfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741115126; c=relaxed/simple; bh=VymyZI8orx5mQ4IUaLUYYJXe3CCShwinSpMBCQQvcOM=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f/UqtdVwBKn2sqLsFZSxOqf4Pd1hhCiv0WyoIsSsFfjDhoowDKgdf+VOXvRnr2W5P3VarYqVSym1bsz5FzBc9E2BPURRdlJF96WbhAG6ADJw18m+FVbBFMCw8TEuDJ0P+39doZgmfantg3UOlrJHtYGjC6MPDm3huTwoNCVgIq4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b=M6++a+VC; arc=none smtp.client-ip=99.78.197.217 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="M6++a+VC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1741115125; x=1772651125; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cmWgUx2CIt2BnglFLLO24rSuYNOpAMYfwt5mIgC/rtA=; b=M6++a+VCjau1GK4IBR8HrDJs5qikI9OIF6pOjweRhLXcu1RMX447UbqE gKBc9wvS0xwTejL2kZ88LtlA+UR6p6TJ1Wqqk8Giqi4023NYVfZQLAGk4 7t/IYGK6XDG/FohaFgtU8DkNWHb/gj5v7a5trI5ziO4sRlWABFgUbMmYg I=; X-IronPort-AV: E=Sophos;i="6.14,220,1736812800"; d="scan'208";a="28366152" Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.214]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2025 19:05:23 +0000 Received: from EX19MTAUWA001.ant.amazon.com [10.0.21.151:28015] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.23.28:2525] with esmtp (Farcaster) id bbe242e5-0c1a-4bba-8f1a-e481b9b8010d; Tue, 4 Mar 2025 19:05:22 +0000 (UTC) X-Farcaster-Flow-ID: bbe242e5-0c1a-4bba-8f1a-e481b9b8010d Received: from EX19D010UWB002.ant.amazon.com (10.13.138.71) by EX19MTAUWA001.ant.amazon.com (10.250.64.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Tue, 4 Mar 2025 19:05:14 +0000 Received: from EX19MTAUWA002.ant.amazon.com (10.250.64.202) by EX19D010UWB002.ant.amazon.com (10.13.138.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Tue, 4 Mar 2025 19:05:13 +0000 Received: from email-imr-corp-prod-pdx-1box-2b-8c2c6aed.us-west-2.amazon.com (10.25.36.210) by mail-relay.amazon.com (10.250.64.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14 via Frontend Transport; Tue, 4 Mar 2025 19:05:13 +0000 Received: from HFA15-G9FV5D3.amazon.com (unknown [10.85.143.178]) by email-imr-corp-prod-pdx-1box-2b-8c2c6aed.us-west-2.amazon.com (Postfix) with ESMTP id 681B1A07D3; Tue, 4 Mar 2025 19:05:07 +0000 (UTC) From: David Arinzon To: David Miller , Jakub Kicinski , CC: David Arinzon , Eric Dumazet , Paolo Abeni , Simon Horman , "Richard Cochran" , "Woodhouse, David" , "Machulsky, Zorik" , "Matushevsky, Alexander" , Saeed Bshara , "Wilson, Matt" , "Liguori, Anthony" , "Bshara, Nafea" , "Schmeilin, Evgeny" , "Belgazal, Netanel" , "Saidi, Ali" , "Herrenschmidt, Benjamin" , "Kiyanovski, Arthur" , "Dagan, Noam" , "Bernstein, Amit" , "Agroskin, Shay" , "Ostrovsky, Evgeny" , "Tabachnik, Ofir" , "Machnikowski, Maciek" , Rahul Rameshbabu , Gal Pressman , Vadim Fedorenko Subject: [PATCH v8 net-next 0/5] PHC support in ENA driver Date: Tue, 4 Mar 2025 21:04:59 +0200 Message-ID: <20250304190504.3743-1-darinzon@amazon.com> X-Mailer: git-send-email 2.34.1 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 Changes in v8: - Create a sysfs entry for each PHC stat Changes in v7 (https://lore.kernel.org/netdev/20250218183948.757-1-darinzon@amazon.com/): - Move PHC stats to sysfs - Add information about PHC enablement - Remove unrelated style changes Changes in v6 (https://lore.kernel.org/netdev/20250206141538.549-1-darinzon@amazon.com/): - Remove PHC error bound Changes in v5 (https://lore.kernel.org/netdev/20250122102040.752-1-darinzon@amazon.com/): - Add PHC error bound - Add PHC enablement and error bound retrieval through sysfs Changes in v4 (https://lore.kernel.org/netdev/20241114095930.200-1-darinzon@amazon.com/): - Minor documentation change (resolution instead of accuracy) Changes in v3 (https://lore.kernel.org/netdev/20241103113140.275-1-darinzon@amazon.com/): - Resolve a compilation error Changes in v2 (https://lore.kernel.org/netdev/20241031085245.18146-1-darinzon@amazon.com/): - CCd PTP maintainer - Fixed style issues - Fixed documentation warning v1 (https://lore.kernel.org/netdev/20241021052011.591-1-darinzon@amazon.com/) This patchset adds the support for PHC (PTP Hardware Clock) in the ENA driver. The documentation part of the patchset includes additional information, including statistics, utilization and invocation examples through the testptp utility. David Arinzon (5): net: ena: Add PHC support in the ENA driver net: ena: PHC silent reset net: ena: PHC enable through sysfs net: ena: PHC stats through sysfs net: ena: Add PHC documentation .../device_drivers/ethernet/amazon/ena.rst | 96 +++++++ drivers/net/ethernet/amazon/Kconfig | 1 + drivers/net/ethernet/amazon/ena/Makefile | 2 +- .../net/ethernet/amazon/ena/ena_admin_defs.h | 63 ++++- drivers/net/ethernet/amazon/ena/ena_com.c | 247 ++++++++++++++++++ drivers/net/ethernet/amazon/ena/ena_com.h | 83 ++++++ drivers/net/ethernet/amazon/ena/ena_ethtool.c | 16 +- drivers/net/ethernet/amazon/ena/ena_netdev.c | 44 +++- drivers/net/ethernet/amazon/ena/ena_netdev.h | 6 + drivers/net/ethernet/amazon/ena/ena_phc.c | 230 ++++++++++++++++ drivers/net/ethernet/amazon/ena/ena_phc.h | 37 +++ .../net/ethernet/amazon/ena/ena_regs_defs.h | 8 + drivers/net/ethernet/amazon/ena/ena_sysfs.c | 163 ++++++++++++ drivers/net/ethernet/amazon/ena/ena_sysfs.h | 28 ++ 14 files changed, 1014 insertions(+), 10 deletions(-) create mode 100644 drivers/net/ethernet/amazon/ena/ena_phc.c create mode 100644 drivers/net/ethernet/amazon/ena/ena_phc.h create mode 100644 drivers/net/ethernet/amazon/ena/ena_sysfs.c create mode 100644 drivers/net/ethernet/amazon/ena/ena_sysfs.h