netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Ferenc Fejes <ferenc.fejes@ericsson.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"marton12050@gmail.com" <marton12050@gmail.com>,
	"peti.antal99@gmail.com" <peti.antal99@gmail.com>
Subject: Re: igc: missing HW timestamps at TX
Date: Tue, 16 Aug 2022 11:11:47 -0700	[thread overview]
Message-ID: <8735dwhxcs.fsf@intel.com> (raw)
In-Reply-To: <20220816091033.n6zfyiastdugfvfr@skbuf>

Vladimir Oltean <vladimir.oltean@nxp.com> writes:

> Hi Vinicius,
>
> On Mon, Aug 15, 2022 at 04:07:13PM -0700, Vinicius Costa Gomes wrote:
>> The interrupt that is generated is a general/misc interrupt, we have to
>> check on the interrupt cause bit that it's something TimeSync related,
>> and only then, we have to check that it's indeed a TX Timestamp that is
>> ready. And then, there's another register with some bits saying which
>> one of the 4 registers for timestamps that is ready. There are a few
>> levels of indirection, but no polling.
>
> I used the word "poll" after being inspired by the code comments:
>
> /**
>  * igc_ptp_tx_work
>  * @work: pointer to work struct
>  *
>  * This work function polls the TSYNCTXCTL valid bit to determine when a
>  * timestamp has been taken for the current stored skb.
>  */
>

Ah, I see. That comment is misleading/wrong, that was "inherited" from
igb, which has a model that didn't have the TimeSync interrupt cause,
IIRC. Going to fix that.

>> 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.
>
> Ok, so basically it is an attempt of making the interrupt handler threaded,
> which doesn't run in hardirq context?
>

Something like that, I guess. Mixed with "if it ain't broken, don't fix
it", but things are breaking with higher link speeds, different use
cases, more users/interest.

> Note that this decision makes the igc limitation of "single timestampable
> skb in flight" even much worse than it needs to be, because it prolongs
> the "in flight" period until the system_wq actually gets to run the work
> item we create.
>

Yes, no disagreement from my side.

>> 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.
>> 
>> 
>> Cheers,
>> -- 
>> Vinicius


Cheers,
-- 
Vinicius

      reply	other threads:[~2022-08-16 18:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 14:42 igc: missing HW timestamps at TX Ferenc Fejes
2022-07-17 14:46 ` Ferenc Fejes
2022-07-18 14:46   ` Vinicius Costa Gomes
2022-07-19  7:40     ` Ferenc Fejes
2022-08-11  8:54       ` Ferenc Fejes
2022-08-11 13:33         ` Vinicius Costa Gomes
2022-08-12 14:13           ` Ferenc Fejes
2022-08-12 20:16             ` Vladimir Oltean
2022-08-15  6:47               ` Ferenc Fejes
2022-08-15 22:04                 ` Vinicius Costa Gomes
2022-08-16  9:33                 ` Vladimir Oltean
2022-08-17  7:44                   ` Ferenc Fejes
2022-08-15 21:39               ` Vinicius Costa Gomes
2022-08-15 22:26                 ` Vladimir Oltean
2022-08-15 23:07                   ` Vinicius Costa Gomes
2022-08-16  8:51                     ` Kurt Kanzenbach
2022-08-16 20:45                       ` Vinicius Costa Gomes
2022-08-17  6:10                         ` Kurt Kanzenbach
2022-08-17 19:24                           ` Vinicius Costa Gomes
2022-08-16  9:10                     ` Vladimir Oltean
2022-08-16 18:11                       ` Vinicius Costa Gomes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735dwhxcs.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=ferenc.fejes@ericsson.com \
    --cc=marton12050@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peti.antal99@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).