From: Eric Dumazet <eric.dumazet@gmail.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Denys Fedoryshchenko <denys@visp.net.lb>,
davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: Deadlock, L2TP over IP are not working, 3.4.1
Date: Thu, 07 Jun 2012 23:30:06 +0200 [thread overview]
Message-ID: <1339104606.6001.4.camel@edumazet-glaptop> (raw)
In-Reply-To: <20120607205356.GA2491@electric-eye.fr.zoreil.com>
On Thu, 2012-06-07 at 22:53 +0200, Francois Romieu wrote:
> Any reason why it could not be made LLTX ?
>
> /* via l2tp_session_priv() */
> @@ -87,25 +95,56 @@ static int l2tp_eth_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> {
> struct l2tp_eth *priv = netdev_priv(dev);
> struct l2tp_session *session = priv->session;
> + struct l2tp_eth_stats *tstats = &priv->tstats;
>
> l2tp_xmit_skb(session, skb, session->hdr_len);
>
> - dev->stats.tx_bytes += skb->len;
> - dev->stats.tx_packets++;
> + u64_stats_update_begin(&tstats->syncp);
> + tstats->packets++;
> + tstats->bytes += skb->len;
> + u64_stats_update_end(&tstats->syncp);
>
> return 0;
> }
>
Its racy.
If LLTX is used, this means several cpus can execute this code at the
same time.
You need percpu stats, or use atomic primitives.
next prev parent reply other threads:[~2012-06-07 21:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-06 9:54 Deadlock, L2TP over IP are not working, 3.4.1 Denys Fedoryshchenko
2012-06-07 20:53 ` Francois Romieu
2012-06-07 21:30 ` Eric Dumazet [this message]
2012-06-07 22:37 ` Francois Romieu
2012-06-08 5:47 ` Eric Dumazet
2012-06-08 15:41 ` Benjamin LaHaise
2012-06-08 15:56 ` Denys Fedoryshchenko
2012-06-08 16:04 ` Eric Dumazet
2012-06-10 12:14 ` Hong zhi guo
2012-06-10 13:31 ` Eric Dumazet
2012-06-10 13:38 ` Eric Dumazet
2012-06-25 15:35 ` [PATCH] net: l2tp_eth: use LLTX to avoid LOCKDEP splats Eric Dumazet
2012-06-26 23:43 ` David Miller
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=1339104606.6001.4.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=denys@visp.net.lb \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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