Netdev List
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Manfred Rudigier <manfred.rudigier@omicron.at>
Cc: David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"afleming@freescale.com" <afleming@freescale.com>,
	"avorontsov@mvista.com" <avorontsov@mvista.com>
Subject: Re: [PATCH] gianfar: Fix invalid TX frames returned on error queue when time stamping.
Date: Mon, 9 Jan 2012 13:49:08 +0100	[thread overview]
Message-ID: <20120109124908.GB4404@cherladcori01> (raw)
In-Reply-To: <95DC1AA8EC908B48939B72CF375AA5E3013A99124D@alice.at.omicron.at>

On Mon, Jan 09, 2012 at 08:16:01AM +0100, Manfred Rudigier wrote:
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Thursday, January 05, 2012 19:27
> 
> >From: Manfred Rudigier <manfred.rudigier@omicron.at>
> >Date: Thu, 5 Jan 2012 15:50:21 +0100
> >
> >> +
> >> +		/* Keep sock if we must return a time stamp on the err queue */
> >> +		skb_new->sk = skb->sk;
> >
> >When I see something like this without any kind of reference counting or
> >similar, I am gravely concerned.
> 
> The skb_tstamp_tx function called during gfar_clean_tx_ring requires
> the skb->sk pointer to be set. Otherwise no time stamp can be queued
> on the socket error queue.
> What would be the correct way for doing this?

Hi Manfred,

You have to make sure the new clone holds a reference on skb->sk.
A recent, similar problem was discussed:

    http://comments.gmane.org/gmane.linux.network/208143

And the solution came in:

    commit da92b194cc36b5dc1fbd85206aeeffd80bee0c39
    Author: Richard Cochran <richardcochran@gmail.com>
    Date:   Fri Oct 21 00:49:15 2011 +0000

    net: hold sock reference while processing tx timestamps

HTH,

Richard

  parent reply	other threads:[~2012-01-09 12:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 14:50 [PATCH] gianfar: Fix invalid TX frames returned on error queue when time stamping Manfred Rudigier
2012-01-05 18:26 ` David Miller
2012-01-09  7:16   ` Manfred Rudigier
2012-01-09  7:43     ` Eric Dumazet
2012-01-09  9:36       ` Manfred Rudigier
2012-01-09  9:58         ` Eric Dumazet
2012-01-09 10:43           ` Manfred Rudigier
2012-01-09 12:41         ` Richard Cochran
2012-01-09 12:50           ` Richard Cochran
2012-01-09 12:49     ` Richard Cochran [this message]
2012-01-09 14:45       ` Manfred Rudigier

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=20120109124908.GB4404@cherladcori01 \
    --to=richardcochran@gmail.com \
    --cc=afleming@freescale.com \
    --cc=avorontsov@mvista.com \
    --cc=davem@davemloft.net \
    --cc=manfred.rudigier@omicron.at \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox