From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Willem de Bruijn <willemb@google.com>,
Eugenia Emantayev <eugenia@mellanox.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net 4/4] net/mlx4_en: get rid of private net_device_stats
Date: Thu, 26 May 2016 12:38:58 +0300 [thread overview]
Message-ID: <6320ccdc-d369-c08c-c959-6c8ed9b88d10@gmail.com> (raw)
In-Reply-To: <1464195039-5098-5-git-send-email-edumazet@google.com>
Hi Eric,
Thanks for the fix.
> We do not need to clear fields that are already 0.
Why is it always true that dev->stats is already 0 at the point ndo_open
is called?
Is it true also in a flow of open -> stop -> open? I searched the kernel
stack for this but couldn't find.
> @@ -1877,7 +1877,6 @@ static void mlx4_en_clear_stats(struct net_device *dev)
> if (mlx4_en_DUMP_ETH_STATS(mdev, priv->port, 1))
> en_dbg(HW, priv, "Failed dumping statistics\n");
>
> - memset(&priv->stats, 0, sizeof(priv->stats));
> memset(&priv->pstats, 0, sizeof(priv->pstats));
> memset(&priv->pkstats, 0, sizeof(priv->pkstats));
> memset(&priv->port_stats, 0, sizeof(priv->port_stats));
The role of this function is to clear the stats, no matter when and
where it is called.
I am aware that clearing the stats structure might be redundant today,
as the function is called only within mlx4_en_open, but we might want to
call the function in other flows in the future.
Regards,
Tariq
next prev parent reply other threads:[~2016-05-26 9:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 16:50 [PATCH net 0/4] net/mlx4_en: fix stats Eric Dumazet
2016-05-25 16:50 ` [PATCH net 1/4] net/mlx4_en: fix tx_dropped bug Eric Dumazet
2016-05-25 21:10 ` Alexei Starovoitov
2016-05-25 16:50 ` [PATCH net 2/4] net/mlx4_en: clear some TX ring stats in mlx4_en_clear_stats() Eric Dumazet
2016-05-25 16:50 ` [PATCH net 3/4] net/mlx4_en: get rid of ret_stats Eric Dumazet
2016-05-25 16:50 ` [PATCH net 4/4] net/mlx4_en: get rid of private net_device_stats Eric Dumazet
2016-05-26 9:38 ` Tariq Toukan [this message]
2016-05-26 12:54 ` Eric Dumazet
2016-05-26 19:38 ` David Miller
2016-05-26 12:58 ` David Laight
2016-05-26 12:59 ` Eric Dumazet
2016-06-03 18:52 ` [PATCH net-next] net/mlx4_en: mlx4_en_netpoll() should schedule TX, not RX Eric Dumazet
2016-06-06 10:38 ` Tariq Toukan
2016-06-08 4:24 ` [PATCH net-next] net/mlx4_en: fix ethtool -x Eric Dumazet
2016-06-09 8:00 ` Tariq Toukan
2016-06-10 6:40 ` David Miller
2016-06-09 10:48 ` [PATCH net-next] net/mlx4_en: mlx4_en_netpoll() should schedule TX, not RX Tariq Toukan
2016-06-10 5:24 ` David Miller
2016-05-26 19:35 ` [PATCH net 4/4] net/mlx4_en: get rid of private net_device_stats David Miller
2016-05-26 5:17 ` [PATCH net 0/4] net/mlx4_en: fix stats David Miller
2016-05-26 9:44 ` Tariq Toukan
2016-05-26 12:57 ` Eric Dumazet
2016-05-26 15:19 ` Or Gerlitz
2016-05-26 17:24 ` Eric Dumazet
2016-05-26 19:46 ` 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=6320ccdc-d369-c08c-c959-6c8ed9b88d10@gmail.com \
--to=ttoukan.linux@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=eugenia@mellanox.com \
--cc=netdev@vger.kernel.org \
--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).