All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Thomas <pthomas8589@gmail.com>
To: netdev@vger.kernel.org
Subject: Re: [PATCH] Check for SKBTX_HW_TSTAMP in macb driver
Date: Tue, 12 Mar 2019 16:05:11 -0400	[thread overview]
Message-ID: <CAD56B7fFxfkCE7oKyoMWZ4YR+TKQODmoZV7QksStdT0T8Kig6Q@mail.gmail.com> (raw)
In-Reply-To: <20190312195053.21741-1-pthomas8589@gmail.com>

On Tue, Mar 12, 2019 at 3:51 PM Paul Thomas <pthomas8589@gmail.com> wrote:
>
> Make sure SKBTX_HW_TSTAMP (i.e. SOF_TIMESTAMPING_TX_HARDWARE) has been enabled for this skb
> This is a concept for discussion, more testing is needed.
> It does fix the issue where normal socks that aren't expecting a timestamp will not wake
> up on select.
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index ad099fd01b45..b2f184fc1370 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -898,11 +898,13 @@ static void macb_tx_interrupt(struct macb_queue *queue)
>
>                         /* First, update TX stats if needed */
>                         if (skb) {
> -                               if (gem_ptp_do_txstamp(queue, skb, desc) == 0) {
> -                                       /* skb now belongs to timestamp buffer
> -                                        * and will be removed later
> -                                        */
I think the above does the same thing as if CONFIG_MACB_USE_HWSTAMP is
undefined regarding cleanup, so there is no extra cleanup if the
gem_ptp_do_txstamp() path isn't taken, but I wasn't sure about the
"skb now belongs to the timestamp buffer" if we don't go down that
path.
> -                                       tx_skb->skb = NULL;
> +                               if(unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
This looks like how other drivers are doing things
> +                                       if (gem_ptp_do_txstamp(queue, skb, desc) == 0) {
> +                                               /* skb now belongs to timestamp buffer
> +                                                * and will be removed later
> +                                                */
> +                                               tx_skb->skb = NULL;
> +                                       }
>                                 }
>                                 netdev_vdbg(bp->dev, "skb %u (data %p) TX complete\n",
>                                             macb_tx_ring_wrap(bp, tail),
> --
> 2.17.1
>

  reply	other threads:[~2019-03-12 20:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 19:50 [PATCH] Check for SKBTX_HW_TSTAMP in macb driver Paul Thomas
2019-03-12 20:05 ` Paul Thomas [this message]
2019-03-12 21:37   ` Keller, Jacob E
2019-03-13  5:59     ` Harini Katakam
2019-03-13 14:50       ` Keller, Jacob E
2019-03-12 21:34 ` Keller, Jacob E
2019-03-12 21:39   ` Keller, Jacob E
2019-03-12 22:05     ` Paul Thomas
2019-03-12 23:07       ` Keller, Jacob E
2019-03-12 23:30         ` Paul Thomas
2019-03-13  5:40           ` Harini Katakam
2019-03-13 14:46             ` Keller, Jacob E

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=CAD56B7fFxfkCE7oKyoMWZ4YR+TKQODmoZV7QksStdT0T8Kig6Q@mail.gmail.com \
    --to=pthomas8589@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.