lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iKXGXPQZj2nm8ZRdXJsp8A32MSp9BTxhYu7WVns2eAknA@mail.gmail.com>
Date: Mon, 28 Aug 2023 11:31:31 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Simon Horman <horms@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, "Michael S . Tsirkin" <mst@...hat.com>, Jason Wang <jasowang@...hat.com>, 
	Xuan Zhuo <xuanzhuo@...ux.alibaba.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 3/3] net: l2tp_eth: use generic dev->stats fields

On Sat, Aug 19, 2023 at 8:47 PM Simon Horman <horms@...nel.org> wrote:
>
> On Sat, Aug 19, 2023 at 04:40:59AM +0000, Eric Dumazet wrote:
> > Core networking has opt-in atomic variant of dev->stats,
> > simply use DEV_STATS_INC(), DEV_STATS_ADD() and DEV_STATS_READ().
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > ---
> >  net/l2tp/l2tp_eth.c | 32 ++++++++++++--------------------
> >  1 file changed, 12 insertions(+), 20 deletions(-)
> >
> > diff --git a/net/l2tp/l2tp_eth.c b/net/l2tp/l2tp_eth.c
>
> ...
>
> > @@ -146,10 +138,10 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
> >
> >       priv = netdev_priv(dev);
> >       if (dev_forward_skb(dev, skb) == NET_RX_SUCCESS) {
> > -             atomic_long_inc(&priv->rx_packets);
> > -             atomic_long_add(data_len, &priv->rx_bytes);
> > +             DEV_STATS_INC(dev, rx_packets);
> > +             DEV_STATS_ADD(dev, rx_bytes, data_len);
>
> Hi Eric,
>
> W=1 builds with clang-16 and gcc-13 tell me that priv
> is set but unused if this branch is taken.

Oops, thanks, will fix in V2.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ