From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.246.1.125]) (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 313A6374E5B; Thu, 30 Apr 2026 03:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.246.1.125 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777519569; cv=none; b=qyEcV5P+oZAonG6gQ81pQfriOO2X0FSS6ogxCyOJzMcSvd7+XCoSG7G/naGZs/Jb1lhtqLIfwZSi/rtid4e1taL6u3ObCpCw0s82rtQS/8BP76FI5cPQvPNjf8uzxdbHy3Kkl5g0F6r4O0f85yIHochisYUgmQ/LnOrjH8CURGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777519569; c=relaxed/simple; bh=jqhlIrcty+/38FAJX8PZYvlIQQAa5RtOsDPAxuLnfLU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=daYsZ4ORszwz7Slx9pW3m0hIlLdEZKq/D4fSifKRX0IDfWjnQK4g0oKmgbg0U5ZJkuE9d+5VnKJ2qXeWwYIKzdJY9t4dqqzN/pOqUpJ7RAPsSod1VKEDWRYtVXktZwfkJP9SOzAkI666lgRp38Pv66JkA4rvtJjmwD6fVW/ev1A= 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 (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=o8Kji3yd; arc=none smtp.client-ip=44.246.1.125 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 (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="o8Kji3yd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1777519568; x=1809055568; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uTNsHirW9MQ7UG5wIj2LKKv8CGaK5oaijbwCuhkMxB0=; b=o8Kji3ydhw6fWCNnxLUaZvJd4XAtUIbvOOazWedvFDZ7KK0zZ+hTmyp7 a+lmBdwhalwwKysy/6vYQ7txACUbWX3ajaj8f0ijjugzgA8rjvZ+RFbpS dMcqqO3C5hmlHWluAgqTFDNUy5iJ61B5AzSvny8UlqZw3Fr+efGY40gD0 Edq3HZuRotigAL41udhadhyIluxICnX8EQFmL1BosQZcH/XUi/yMU9Nii LBo2YEGHS4wVp97iq8XKGCV+1axFGGrN8ZG+/qWk4semhe2JORLfbiHDH 8m+G4iXXGfKRIC0MQYmDH3mXhKps/ptKauPtvgemE/Y6EFmxzLB3rqd71 A==; X-CSE-ConnectionGUID: r/e5eBokRbC/hzz+B5Hz+w== X-CSE-MsgGUID: KhgNigxZT8K6+uBSP3o5BQ== X-IronPort-AV: E=Sophos;i="6.23,207,1770595200"; d="scan'208";a="18530929" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2026 03:26:05 +0000 Received: from EX19MTAUWC002.ant.amazon.com [205.251.233.111:12637] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.4.227:2525] with esmtp (Farcaster) id 5138c450-4015-4f97-a9ee-9a796c387afa; Thu, 30 Apr 2026 03:26:05 +0000 (UTC) X-Farcaster-Flow-ID: 5138c450-4015-4f97-a9ee-9a796c387afa Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Thu, 30 Apr 2026 03:26:04 +0000 Received: from dev-dsk-akiyano-1c-2138b29d.eu-west-1.amazon.com (172.19.83.6) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.37; Thu, 30 Apr 2026 03:25:59 +0000 From: Arthur Kiyanovski To: David Miller , Jakub Kicinski , CC: Arthur Kiyanovski , Richard Cochran , Eric Dumazet , Paolo Abeni , David Woodhouse , Thomas Gleixner , Miroslav Lichvar , Andrew Lunn , Wen Gu , Xuan Zhuo , David Woodhouse , "Yonatan Sarna" , Zorik Machulsky , "Alexander Matushevsky" , Saeed Bshara , Matt Wilson , Anthony Liguori , Nafea Bshara , Evgeny Schmeilin , Netanel Belgazal , Ali Saidi , Benjamin Herrenschmidt , Noam Dagan , David Arinzon , Evgeny Ostrovsky , Ofir Tabachnik , Amit Bernstein , , , Subject: [PATCH v2 net-next 6/8] net: ena: Update PHC admin interface for error bound support Date: Thu, 30 Apr 2026 03:25:03 +0000 Message-ID: <20260430032507.11586-7-akiyano@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260430032507.11586-1-akiyano@amazon.com> References: <20260430032507.11586-1-akiyano@amazon.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: EX19D031UWC003.ant.amazon.com (10.13.139.252) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Extend the ENA admin interface to support error bound. Add error_bound to the PHC response structure. Introduce a feature version mechanism to indicate device supports error_bound, and add an error flag for error_bound retrieval failures. This enables the driver to retrieve error_bound information from the device alongside timestamps. Signed-off-by: Amit Bernstein Signed-off-by: Arthur Kiyanovski --- .../net/ethernet/amazon/ena/ena_admin_defs.h | 17 +++++++++++------ drivers/net/ethernet/amazon/ena/ena_com.c | 11 ++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h index 898ecd9..2d132c4 100644 --- a/drivers/net/ethernet/amazon/ena/ena_admin_defs.h +++ b/drivers/net/ethernet/amazon/ena/ena_admin_defs.h @@ -128,12 +128,14 @@ enum ena_admin_get_stats_scope { ENA_ADMIN_ETH_TRAFFIC = 1, }; -enum ena_admin_phc_type { - ENA_ADMIN_PHC_TYPE_READLESS = 0, +enum ena_admin_phc_feature_version { + /* Readless with error_bound */ + ENA_ADMIN_PHC_FEATURE_VERSION_0 = 0, }; enum ena_admin_phc_error_flags { ENA_ADMIN_PHC_ERROR_FLAG_TIMESTAMP = BIT(0), + ENA_ADMIN_PHC_ERROR_FLAG_ERROR_BOUND = BIT(1), }; /* ENA SRD configuration for ENI */ @@ -1035,10 +1037,10 @@ struct ena_admin_queue_ext_feature_desc { }; struct ena_admin_feature_phc_desc { - /* PHC type as defined in enum ena_admin_get_phc_type, - * used only for GET command. + /* PHC version as defined in enum ena_admin_phc_feature_version, + * used only for GET command as max supported PHC version by the device. */ - u8 type; + u8 version; /* Reserved - MBZ */ u8 reserved1[3]; @@ -1224,7 +1226,10 @@ struct ena_admin_phc_resp { /* PHC timestamp (nsec) */ u64 timestamp; - u8 reserved2[12]; + u8 reserved2[8]; + + /* Timestamp error limit (nsec) */ + u32 error_bound; /* Bit field of enum ena_admin_phc_error_flags */ u32 error_flags; diff --git a/drivers/net/ethernet/amazon/ena/ena_com.c b/drivers/net/ethernet/amazon/ena/ena_com.c index e67b592..1549d6e 100644 --- a/drivers/net/ethernet/amazon/ena/ena_com.c +++ b/drivers/net/ethernet/amazon/ena/ena_com.c @@ -1682,11 +1682,11 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) struct ena_admin_set_feat_cmd set_feat_cmd; int ret = 0; - /* Get device PHC default configuration */ + /* Get default device PHC configuration */ ret = ena_com_get_feature(ena_dev, &get_feat_resp, ENA_ADMIN_PHC_CONFIG, - 0); + ENA_ADMIN_PHC_FEATURE_VERSION_0); if (unlikely(ret)) { netdev_err(ena_dev->net_device, "Failed to get PHC feature configuration, error: %d\n", @@ -1694,10 +1694,11 @@ int ena_com_phc_config(struct ena_com_dev *ena_dev) return ret; } - /* Supporting only readless PHC retrieval */ - if (get_feat_resp.u.phc.type != ENA_ADMIN_PHC_TYPE_READLESS) { + /* Supporting only PHC V0 (readless mode with error bound) */ + if (get_feat_resp.u.phc.version != ENA_ADMIN_PHC_FEATURE_VERSION_0) { netdev_err(ena_dev->net_device, - "Unsupported PHC type, error: %d\n", + "Unsupported PHC version (0x%X), error: %d\n", + get_feat_resp.u.phc.version, -EOPNOTSUPP); return -EOPNOTSUPP; } -- 2.47.3