From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-fw-52003.amazon.com (smtp-fw-52003.amazon.com [52.119.213.152]) (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 C3E6021882F for ; Tue, 17 Jun 2025 11:07:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.119.213.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750158466; cv=none; b=Ynjt8+0MM1XkSHL6kzPDYZRyxDGRPSp7wnEE11XHwctFb6b4OvV5SS2FiLq0qB9vIHvQktMZFDQJ5G9Hn896KN1J3/7fzpwLYp1hC2uGZ9OkNmFfT+gp6gji4XLdKqH30MSZ7g7NnPOKebdMFVYwO2liTLJ/Tmj0sd/YR22OVvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750158466; c=relaxed/simple; bh=tPzeYxMklWfSNwE/FSJEm2TflXcxF7/3qKph1efgiqc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=A6SX+JAk3c3QeMHbs2Q1RKJAsWhgKfTbRRcY26TqhHv/dPb9r01r+M/iG4aM7bM0di9IFxoC1HmDC/3wmU/nrbgDfoeYGpdhrHqHn2/j0tPtJlSKfbY0PCS9AEB4Iw5vSmta3II7+HTSXgE731vnKrjp4RMqSjSzXh4c2swznv8= 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=FKtbSDiO; arc=none smtp.client-ip=52.119.213.152 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="FKtbSDiO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1750158465; x=1781694465; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/oLmxDZ3j7ZnfjqmKc+n2Qaa9t2FjdWDpoye9QaCGJ8=; b=FKtbSDiOVpEGz8xi5yTgfr54GEYX9X4Q25hGKINIVmUwTNgDbbU90YFI +Nr9dOCfMLvpOfz2+4anbFMXyl/1TV+IjCc2aC0YH0SbPAXRtNskHsHlh niYLjmAmo8qfNYKDHOnXhKKkXgqZchyEtx/kYN+sTh5VtHlyT0jOE+gAQ NO6o15gB9HEBH6r8nJj8CzZ+4VJYmrPZhDoXbNI4+YYlgM6TY6bR6RGCr qKJyM9iGGbny8CucAhH1SPtV/eck26tl/F7UXTtyMFGfvDoePK7pZYqw1 cGOcBLAQ1NRoWVcp2DYdqEZHhJRxMjGd5gHpKKwOx/iIxJTTPFO+oa6+7 A==; X-IronPort-AV: E=Sophos;i="6.16,243,1744070400"; d="scan'208";a="105452930" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.43.8.6]) by smtp-border-fw-52003.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2025 11:07:44 +0000 Received: from EX19MTAEUC002.ant.amazon.com [10.0.43.254:43599] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.15.192:2525] with esmtp (Farcaster) id 0ddfac09-1c78-4348-a6f0-97269f1cc0c8; Tue, 17 Jun 2025 11:07:43 +0000 (UTC) X-Farcaster-Flow-ID: 0ddfac09-1c78-4348-a6f0-97269f1cc0c8 Received: from EX19D005EUA002.ant.amazon.com (10.252.50.11) by EX19MTAEUC002.ant.amazon.com (10.252.51.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Tue, 17 Jun 2025 11:07:42 +0000 Received: from HFA15-G9FV5D3.amazon.com (10.85.143.172) by EX19D005EUA002.ant.amazon.com (10.252.50.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1544.14; Tue, 17 Jun 2025 11:07:30 +0000 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 , Andrew Lunn , Leon Romanovsky , Jiri Pirko , Jiri Pirko Subject: [PATCH v13 net-next 5/9] devlink: Add new "enable_phc" generic device param Date: Tue, 17 Jun 2025 14:05:41 +0300 Message-ID: <20250617110545.5659-6-darinzon@amazon.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250617110545.5659-1-darinzon@amazon.com> References: <20250617110545.5659-1-darinzon@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: EX19D037UWB004.ant.amazon.com (10.13.138.84) To EX19D005EUA002.ant.amazon.com (10.252.50.11) Add a new device generic parameter to enable/disable the PHC (PTP Hardware Clock) functionality in the device associated with the devlink instance. Signed-off-by: David Arinzon Reviewed-by: Jiri Pirko --- Documentation/networking/devlink/devlink-params.rst | 3 +++ include/net/devlink.h | 4 ++++ net/devlink/param.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst index 4e01dc32..3da8f4ef 100644 --- a/Documentation/networking/devlink/devlink-params.rst +++ b/Documentation/networking/devlink/devlink-params.rst @@ -137,3 +137,6 @@ own name. * - ``event_eq_size`` - u32 - Control the size of asynchronous control events EQ. + * - ``enable_phc`` + - Boolean + - Enable PHC (PTP Hardware Clock) functionality in the device. diff --git a/include/net/devlink.h b/include/net/devlink.h index 0091f23a..63517646 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -520,6 +520,7 @@ enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_ENABLE_IWARP, DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE, DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE, + DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC, /* add new param generic ids above here*/ __DEVLINK_PARAM_GENERIC_ID_MAX, @@ -578,6 +579,9 @@ enum devlink_param_generic_id { #define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME "event_eq_size" #define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32 +#define DEVLINK_PARAM_GENERIC_ENABLE_PHC_NAME "enable_phc" +#define DEVLINK_PARAM_GENERIC_ENABLE_PHC_TYPE DEVLINK_PARAM_TYPE_BOOL + #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ { \ .id = DEVLINK_PARAM_GENERIC_ID_##_id, \ diff --git a/net/devlink/param.c b/net/devlink/param.c index b29abf8d..396b8a7f 100644 --- a/net/devlink/param.c +++ b/net/devlink/param.c @@ -92,6 +92,11 @@ static const struct devlink_param devlink_param_generic[] = { .name = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME, .type = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE, }, + { + .id = DEVLINK_PARAM_GENERIC_ID_ENABLE_PHC, + .name = DEVLINK_PARAM_GENERIC_ENABLE_PHC_NAME, + .type = DEVLINK_PARAM_GENERIC_ENABLE_PHC_TYPE, + }, }; static int devlink_param_generic_verify(const struct devlink_param *param) -- 2.47.1