public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel•com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail•com>
Cc: Network Development <netdev@vger•kernel.org>,
	randy.e.witt@intel•com, David Miller <davem@davemloft•net>,
	Eric Dumazet <eric.dumazet@gmail•com>
Subject: Re: [PATCH net-next 0/2] skbuff: Fix applications not being woken for errors
Date: Wed, 14 Mar 2018 12:37:52 -0700	[thread overview]
Message-ID: <878tauwir3.fsf@intel.com> (raw)
In-Reply-To: <CAF=yD-K2xH6uGxC3P7UQab5v26kP85z3axvY8L9NfigCLrP6Hw@mail.gmail.com>

Hi,

Willem de Bruijn <willemdebruijn.kernel@gmail•com> writes:

>> Another interesting fact is that if the POLLIN event is added to the
>> poll() .events, poll() no longer becomes stuck,
>
> The process has registered interest only in POLLIN, which the call to
> sk_data_read (sock_def_readable) will trigger.
>
>> and more interestingly
>> the returned event in .revents is only POLLERR.
>
> datagram_poll will set (E)POLLERR based on non-empty sk_error_queue.
>
>> After a few debugging sessions, we got to 'sock_queue_err_skb()' and
>> how it notifies applications of the error just enqueued. Changing it
>> to use 'sk->sk_error_report()', fixes the issue for hardware and
>> software timestamping. That is patch (2).
>>
>> The "solution" proposed in patch (2) looks like too big a hammer,
>
> It looks fine to me. POLLERR is returned regardless of the mask a
> process sets up in pollfd.events. So waking with sk_error_report
> will fix this while still waking callers waiting on POLLIN.
>
> Note that on sock_dequeue_err_skb, if another notification (of the
> right kind) is waiting, sk_error_report is already called instead of
> sk_data_ready.

Thank you all who did confirm that this was the right fix.

>
> This should perhaps go to net, instead of net-next (though not the
> test).

Will propose it to net, what I am thinking is that now that a few TSN
features are upstream, applications that use hardware timestamping (the
easiest way to trigger this bug) could be more common.

>
> If resending, a small nit in the test: please keep the alphabetical
> order in getopt. The filepath also looks a bit fishy, but git am applied
> the mbox from patchwork without issue.

Will send a second version.


Thanks,
--
Vinicius

      parent reply	other threads:[~2018-03-14 19:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 20:35 [PATCH net-next 0/2] skbuff: Fix applications not being woken for errors Vinicius Costa Gomes
2018-03-13 20:35 ` [PATCH net-next 1/2] selftests/txtimestamp: Add more configurable parameters Vinicius Costa Gomes
2018-03-13 20:35 ` [PATCH net-next 2/2] skbuff: Fix not waking applications when errors are enqueued Vinicius Costa Gomes
2018-03-14 16:40   ` Eric Dumazet
2018-03-14 16:32 ` [PATCH net-next 0/2] skbuff: Fix applications not being woken for errors Willem de Bruijn
2018-03-14 17:39   ` Soheil Hassas Yeganeh
2018-03-14 19:37   ` 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=878tauwir3.fsf@intel.com \
    --to=vinicius.gomes@intel$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=eric.dumazet@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=randy.e.witt@intel$(echo .)com \
    --cc=willemdebruijn.kernel@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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