Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp8204899rwd; Tue, 20 Jun 2023 11:37:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4mjxN2P8QN/ju8O644nshsVNyV+h5J6FXB66UN2kQMpeyHFD51AJyCs12yTKwoIScCpna7 X-Received: by 2002:a05:6a21:32a0:b0:120:80ba:3df0 with SMTP id yt32-20020a056a2132a000b0012080ba3df0mr4135088pzb.27.1687286250411; Tue, 20 Jun 2023 11:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687286250; cv=none; d=google.com; s=arc-20160816; b=Y+3+We0WGJ+kzyGVKW6WKBrym/vspdn4emKnuGIWr0VidbYZqotycw2vz8KBMlo9Q4 jEF06XNOAEDRuW+6QezLJA1jkocisydBqZidaQWeFNztxkQkj/70tOhGdd92W6k3ygda VqZ15BjQKtXdr8MGCU773uca0O/W8LHDURATSCuftQWqa8rnUR5YBU3dSNotygULi6l0 aMqStiXgQOWJlETLx2aqrhVhAUj/RZ0fZYmPj28rRkefRwrHWhQkS95rWr8+uLhtWY3Y mtUr5jrrXk0zKbtlkVof85szRmhTmZ6vu618cNX+JX3lSLxegizYUFQy+iZDoWP2upva JVSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+q7yAmgNwU13egDAjbphpWU9CRhLsUMLkY1Ln79ZPSE=; b=k3OJ2yL/MyjjZeuuLCpB8R/ElNlqtEV8dEiGRVpTzjaip/5sLYv+mFKoFCEuLwe+3k Sp6crhfjpLnMVdmyDAOBGh1OLjriPwxWUOCy7WHmplt35XWj5Tez1LziEJTJKYp3YwnE LYJ/oSQIXE/9lMRQp6Xo1BglY54LeUaVCG+o0H9dx2L7BZ8LgFn06Xus04NPh0omhG3T mLigHAWeWS68BErVADjjjhj889inctmAbEOseihcPt8hlo37al+fOCFpj1yShqLFa6t/ /+Pho42qHmUCUCkyYqNHCy8Rqcv9NtaJsAU31tsOwLs+LULbxCxZPEvLssq/OyQ/oyLx KxSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PHSUD+Pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 21-20020a621815000000b006662fba14a9si2228084pfy.73.2023.06.20.11.37.18; Tue, 20 Jun 2023 11:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PHSUD+Pa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjFTSa1 (ORCPT + 99 others); Tue, 20 Jun 2023 14:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229914AbjFTSaY (ORCPT ); Tue, 20 Jun 2023 14:30:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 772BC10DA for ; Tue, 20 Jun 2023 11:30:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0E9A061236 for ; Tue, 20 Jun 2023 18:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2825CC433C0; Tue, 20 Jun 2023 18:30:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687285822; bh=YzvlpBIJ1S4sFH9+hFPo656i1oKTPdpC6wWZXmsHRWc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=PHSUD+Pasa8bpAfIKjED6alVB4e3Fk+TexGxStJYHad3fXhv+ZQgliUhTmGpE51TG ZUtm4loVwwbhRi7Hgb6xBQomyKemzogSJiGe22RQXiv5dq8n3Dg8StBa2bbqijZ4F7 MYlGWUp88djXdvtWi9GYcZyL+bY9DfJk3hq87jmOmB/x1VidNpaJ6ReeUNNNDvgSv2 4iTUEv05ZOy98hqaFOSjXfhg5Hex3xl/MKo3DDzmadUr0RFhPELaf6Ce9iDmq0a9EN bGFtU/rUio5mk8/Yvi/JWIR3SCFKXsUrU3gzIhQBOMX8BrHSJtzcbEFWJfWSNkL3Fs N/hBgi5bPnXJg== Date: Tue, 20 Jun 2023 11:30:21 -0700 From: Jakub Kicinski To: Horatiu Vultur Cc: , , , , , , , , Subject: Re: [PATCH net-next v3] net: micrel: Change to receive timestamp in the frame for lan8841 Message-ID: <20230620113021.01d90f90@kernel.org> In-Reply-To: <20230615094740.627051-1-horatiu.vultur@microchip.com> References: <20230615094740.627051-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Jun 2023 11:47:40 +0200 Horatiu Vultur wrote: > Currently for each timestamp frame, the SW needs to go and read the > received timestamp over the MDIO bus. But the HW has the capability > to store the received nanoseconds part and the least significant two > bits of the seconds in the reserved field of the PTP header. In this > way we could save few MDIO transactions (actually a little more > transactions because the access to the PTP registers are indirect) > for each received frame. > > Instead of reading the rest of seconds part of the timestamp of the > frame using MDIO transactions schedule PTP worker thread to read the > seconds part every 500ms and then for each of the received frames use > this information. Because if for example running with 512 frames per > second, there is no point to read 512 times the second part. > > Doing all these changes will give a great CPU usage performance. > Running ptp4l with logSyncInterval of -9 will give a ~60% CPU > improvement. Richard, looks good? I'm not sure if the settime handling is sufficient, some packets may still sneak thru both getting stamped with new value of time and use old upper bits and get stamped with old bits and use new upper. Can we disable timestamping, drain the queue, then change the time and enable stamping again?