netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sørensen, Stefan" <Stefan.Sorensen@spectralink.com>
To: "richardcochran@gmail.com" <richardcochran@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] dp83640: don't recieve time stamps twice
Date: Wed, 19 Apr 2017 11:28:34 +0000	[thread overview]
Message-ID: <1492601312.3108.3.camel@spectralink.com> (raw)
In-Reply-To: <20170419103135.GA1670@localhost.localdomain>

On Wed, 2017-04-19 at 12:31 +0200, Richard Cochran wrote:
> Can we please fix this in another way?  There is no need to hold the
> spin lock during the callback into the networking stack.  Instead,
> how about the following diff, which also fixes the other call site...


I agree that this is a better way to fix it - I think that this was the
purpose of the patch that got halfway mixed in.

@@ -874,14 +874,15 @@ static void decode_rxts(struct dp83640_private
> *dp83640,
>  			shhwtstamps = skb_hwtstamps(skb);
>  			memset(shhwtstamps, 0,
> sizeof(*shhwtstamps));
>  			shhwtstamps->hwtstamp = ns_to_ktime(rxts-
> >ns);
> -			netif_rx_ni(skb);
>  			list_add(&rxts->list, &dp83640->rxpool);
>  			break;
>  		}
>  	}
>  	spin_unlock(&dp83640->rx_queue.lock);
>  
> -	if (!shhwtstamps)
> +	if (shhwtstamps)
> +		netif_rx_ni(skb);
> +	else
>  		list_add_tail(&rxts->list, &dp83640->rxts);
>  out:
>  	spin_unlock_irqrestore(&dp83640->rx_lock, flags);

Here we still hold rx_lock while during the callback, wouldn't it be
beneficial to release that first?

Stefan

  parent reply	other threads:[~2017-04-19 11:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 19:14 [PATCH] dp83640: don't recieve time stamps twice Dan Carpenter
2017-04-18 20:19 ` Richard Cochran
2017-04-19  9:16 ` Sørensen, Stefan
2017-04-19 10:31   ` Richard Cochran
2017-04-19 10:53     ` Dan Carpenter
2017-04-19 11:28     ` Sørensen, Stefan [this message]
2017-04-19 11:54       ` Richard Cochran
2017-04-20 20:02     ` David Miller
2017-04-20 21:30       ` Richard Cochran

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=1492601312.3108.3.camel@spectralink.com \
    --to=stefan.sorensen@spectralink.com \
    --cc=andrew@lunn.ch \
    --cc=dan.carpenter@oracle.com \
    --cc=f.fainelli@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.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).