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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D33FEC25B0E for ; Tue, 16 Aug 2022 20:45:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237194AbiHPUp5 (ORCPT ); Tue, 16 Aug 2022 16:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237025AbiHPUp4 (ORCPT ); Tue, 16 Aug 2022 16:45:56 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2895988DEC for ; Tue, 16 Aug 2022 13:45:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660682756; x=1692218756; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=hCZyn0XASUQiYpVFt/664nMlYYX0sfN8DjTaw2BiDwc=; b=cr8SF2jElyhq1xQnXlp+W8dMbeHipDRCxZAUH63zQ9y7TAKF5T9tscx+ FZu+Rn5VNlGyOzc506txQrdrY4Het56JQggtR7pYxTo6me2LNkS6DMdyx Zap89RksP4oKX3VmLkkR1HFPsK5aIb02ua8BZgPQeFPMnkLIjwymJcwr+ vReAtgjD9OXiSvYrkL9SOmc5rSVUKFTyAj8zn9aMaiSQvLRPWJR6cV4xh EUd9Sp27tvQi7FW03ZQlH75Mb6zMmz8i10eNZ78ENqRR4wAMf3IJMtTKT z2D1vysHxD0lEDPk193O8k0w/vHXj5c3MsKjT7bUEKqCUqnKaOwKXKeHM A==; X-IronPort-AV: E=McAfee;i="6400,9594,10441"; a="293120941" X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="293120941" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 13:45:55 -0700 X-IronPort-AV: E=Sophos;i="5.93,242,1654585200"; d="scan'208";a="607182100" Received: from vcostago-desk1.jf.intel.com (HELO vcostago-desk1) ([10.54.70.10]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Aug 2022 13:45:55 -0700 From: Vinicius Costa Gomes To: Kurt Kanzenbach , Vladimir Oltean Cc: Ferenc Fejes , "netdev@vger.kernel.org" , "marton12050@gmail.com" , "peti.antal99@gmail.com" Subject: Re: igc: missing HW timestamps at TX In-Reply-To: <87edxgr2q0.fsf@kurt> References: <87tu7emqb9.fsf@intel.com> <695ec13e018d1111cf3e16a309069a72d55ea70e.camel@ericsson.com> <87tu6i6h1k.fsf@intel.com> <252755c5f3b83c86fac5cb60c70931204b0ed6df.camel@ericsson.com> <252755c5f3b83c86fac5cb60c70931204b0ed6df.camel@ericsson.com> <20220812201654.qx7e37otu32pxnbk@skbuf> <87v8qti3u2.fsf@intel.com> <20220815222639.346wachaaq5zjwue@skbuf> <87k079hzry.fsf@intel.com> <87edxgr2q0.fsf@kurt> Date: Tue, 16 Aug 2022 13:45:55 -0700 Message-ID: <87v8qrhq7w.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Kurt Kanzenbach writes: > Hi Vinicius, > > On Mon Aug 15 2022, Vinicius Costa Gomes wrote: >> I think your question is more "why there's that workqueue on igc?"/"why >> don't you retrieve the TX timestamp 'inline' with the interrupt?", if I >> got that right, then, I don't have a good reason, apart from the feeling >> that reading all those (5-6?) registers may take too long for a >> interrupt handler. And it's something that's being done the same for >> most (all?) Intel drivers. > > We do have one optimization for igb which attempts to read the Tx > timestamp directly from the ISR. If that's not ready *only* then we > schedule the worker. I do assume igb and igc have the same logic for > retrieving the timestamps here. > That seems a sensible approach. And yes, the timestamping logic is the same. > The problem with workqueues is that under heavy system load, it might be > deferred and timestamps will be lost. I guess that workqueue was added > because of something like this: 1f6e8178d685 ("igb: Prevent dropped Tx > timestamps via work items and interrupts."). > >> >> I have a TODO to experiment with removing the workqueue, and retrieving >> the TX timestamp in the same context as the interrupt handler, but other >> things always come up. > > Let me know if you have interest in that igb patch. That would be great! Thanks. > > Thanks, > Kurt Cheers, -- Vinicius