From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3858CD591A9 for ; Mon, 18 Nov 2024 17:24:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E0A79404ED; Mon, 18 Nov 2024 17:24:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id fK7dKOWplPel; Mon, 18 Nov 2024 17:24:31 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BBCCD404FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1731950671; bh=rUXx7AHuL5dCXpI2cGqfImWmgJC3Jxc0yzSlNk/JcyE=; h=Date:To:Cc:References:From:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VsAzINMHobZswRw23zNkoyLlqE+hH0lCTEaIT2D5iQN5fYTmWTSAPelekAS1dbnkW c9aXcyRrD7+21SAxe2wQmi8YHpes5dhwmWGn/nPFCgGLBfAs73ms3hj9Jp7A5gFa3d geJY6UFy4SnqDZn1uBHsCoEv5AfISY4goz30RpuRSQwRa9Uu9cwFcXF41QA2U3Xg1S GnNW+OWrt2S6h+5ifo6oq7/O6JD/GRFo2W3ug0CD0Gl+0IPMvhkCZazzScEHUPQRyS R2tbvj804nIuC5Hz2hLU+BfQUUbhx2U9yYjWocIKM9PEU0RKHU7Mdhy0zi8LGyrksy mJZsK8R1P5c2Q== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id BBCCD404FE; Mon, 18 Nov 2024 17:24:31 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id E40EBDB3 for ; Mon, 18 Nov 2024 17:24:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id D20BF6086A for ; Mon, 18 Nov 2024 17:24:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id N3H34bPDL4Bb for ; Mon, 18 Nov 2024 17:24:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:41d0:1004:224b::b1; helo=out-177.mta0.migadu.com; envelope-from=vadim.fedorenko@linux.dev; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org A87E36084D DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A87E36084D Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b1]) by smtp3.osuosl.org (Postfix) with ESMTPS id A87E36084D for ; Mon, 18 Nov 2024 17:24:27 +0000 (UTC) Message-ID: <82643a3a-e71d-4fb9-a65f-43e6af195112@linux.dev> Date: Mon, 18 Nov 2024 09:24:18 -0800 MIME-Version: 1.0 To: "Olech, Milena" , "intel-wired-lan@lists.osuosl.org" Cc: "netdev@vger.kernel.org" , "Nguyen, Anthony L" , "Kitszel, Przemyslaw" , "Hay, Joshua A" , "Lobakin, Aleksander" References: <20241113154616.2493297-1-milena.olech@intel.com> <20241113154616.2493297-9-milena.olech@intel.com> <2dc0096d-93be-42f9-b646-e74c3b36126c@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1731950664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rUXx7AHuL5dCXpI2cGqfImWmgJC3Jxc0yzSlNk/JcyE=; b=Z0vICdKIL4FoxAIhKzQmCluuWuCPYsObPbxRM0Jls0GTbzNtalDUwdsY1lvUyr8NIO2eGi roypuSLDTd8F9jcK8v9pAcYWOueQUiyx4qdDqTN1Nh0yuXV/MZbAk4j1iLHUW200nSHCu5 Y0y6K2ZBYnAFn5CSfQ0ymKWB/9PN7F4= X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=Z0vICdKI Subject: Re: [Intel-wired-lan] [PATCH iwl-net 08/10] idpf: add Tx timestamp flows X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On 18/11/2024 07:07, Olech, Milena wrote: > On 11/14/2024 1:52 PM, Vadim Fedorenko wrote: > >> On 13/11/2024 15:46, Milena Olech wrote: >>> Add functions to request Tx timestamp for the PTP packets, read the Tx >>> timestamp when the completion tag for that packet is being received, >>> extend the Tx timestamp value and set the supported timestamping modes. >>> >>> Tx timestamp is requested for the PTP packets by setting a TSYN bit and >>> index value in the Tx context descriptor. The driver assumption is that >>> the Tx timestamp value is ready to be read when the completion tag is >>> received. Then the driver schedules delayed work and the Tx timestamp >>> value read is requested through virtchnl message. At the end, the Tx >>> timestamp value is extended to 64-bit and provided back to the skb. >>> >>> Co-developed-by: Josh Hay >>> Signed-off-by: Josh Hay >>> Reviewed-by: Alexander Lobakin >>> Signed-off-by: Milena Olech [skipped] >>> +/** >>> + * idpf_ptp_extend_ts - Convert a 40b timestamp to 64b nanoseconds >>> + * @adapter: Driver specific private structure >>> + * @in_tstamp: Ingress/egress timestamp value >>> + * >>> + * It is assumed that the caller verifies the timestamp is valid prior to >>> + * calling this function. >>> + * >>> + * Extract the 32bit nominal nanoseconds and extend them. Use the cached PHC >>> + * time stored in the device private PTP structure as the basis for timestamp >>> + * extension. >>> + * >>> + * Return: Tx timestamp value extended to 64 bits. >>> + */ >>> +u64 idpf_ptp_extend_ts(const struct idpf_adapter *adapter, u64 in_tstamp) >>> +{ >>> + unsigned long discard_time; >>> + >>> + discard_time = adapter->ptp->cached_phc_jiffies + 2 * HZ; >>> + >>> + if (time_is_before_jiffies(discard_time)) >>> + return 0; >> >> It might be a good idea to count such events, just to provide at least >> some information to the client regarding zero timestamp? > > You mean to calculate skipped Tx timestamps? Yes, we have special metric in ethtool to provide info about issues with TX timestamp, it would be great to have idpf implemented this interface. > >> >>> + >>> + return idpf_ptp_tstamp_extend_32b_to_64b(adapter->ptp->cached_phc_time, >>> + lower_32_bits(in_tstamp)); >>> +} >> >> >> [... skip ...] > > Thanks, > Milena