From: Alexander Duyck <alexander.h.duyck@intel.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, richardcochran@gmail.com,
davem@davemloft.net, willemb@google.com
Subject: Re: [PATCH 2/2] net-timestamp: Make the clone operation stand-alone from phy timestamping
Date: Wed, 03 Sep 2014 16:02:39 -0700 [thread overview]
Message-ID: <54079E0F.5010604@intel.com> (raw)
In-Reply-To: <1409781908.26422.55.camel@edumazet-glaptop2.roam.corp.google.com>
On 09/03/2014 03:05 PM, Eric Dumazet wrote:
> On Wed, 2014-09-03 at 14:07 -0700, Eric Dumazet wrote:
>
>>
>> Normally, if one skb holds a reference to a socket, it should have
>> skb->destructor set to a cleanup function.
>>
>> Otherwise, we rely on callers following a convention, to release sk
>> reference.
>>
>> If you believe its needed, it should be dully documented.
>
>
> BTW, skb_orphan() would BUG() on this case (skb->destrutor == NULL and
> skb->sk != NULL)
That was why we were setting skb->sk to null before passing it to
sock_queue_err_skb. I think I found the reason why things were done the
way they were. It looks like skb_orphan is called in
sock_queue_err_skb. So any destructor added would be fired there before
before being replaced.
The only part I am not sure about is if that would actually be any sort
of issue. Do we really need to hold the extra reference to the socket
all the way through the sock_queue_err_skb call or can we just let it
get dropped with the call to skb_orphan and let the fact that the
message is being queued be good enough?
I'm not sure due to the comment about "before exiting rcu section, make
sure dst is refcounted". It kind of implies I should be able to hand
off the reference counts without worrying about the socket being freed
out from under me.
Thanks,
Alex
next prev parent reply other threads:[~2014-09-03 23:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 15:53 [PATCH 0/2] Combine standard and phy timestamping logic Alexander Duyck
2014-09-03 15:53 ` [PATCH 1/2] net-timestamp: Merge shared code between phy and regular timestamping Alexander Duyck
2014-09-03 18:50 ` Willem de Bruijn
2014-09-03 15:53 ` [PATCH 2/2] net-timestamp: Make the clone operation stand-alone from phy timestamping Alexander Duyck
2014-09-03 18:54 ` Willem de Bruijn
2014-09-03 21:24 ` Alexander Duyck
2014-09-03 21:07 ` Eric Dumazet
2014-09-03 22:05 ` Eric Dumazet
2014-09-03 23:02 ` Alexander Duyck [this message]
2014-09-04 2:03 ` Eric Dumazet
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=54079E0F.5010604@intel.com \
--to=alexander.h.duyck@intel.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=willemb@google.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).