Thread (63 messages) 63 messages, 9 authors, 2016-02-10

Re: [PATCH net 0/4] net: add rx_unhandled stat counter

From: Jarod Wilson <hidden>
Date: 2016-01-28 15:11:11
Also in: lkml

On Thu, Jan 28, 2016 at 06:46:50AM -0800, Eric Dumazet wrote:
On Thu, 2016-01-28 at 06:44 -0800, Eric Dumazet wrote:
quoted
On Thu, 2016-01-28 at 06:42 -0800, Eric Dumazet wrote:
quoted
Sure, you also can set stats64->rx_unhandled to 0 here, just to be 100%
safe.
And not add the memset(stats64, 0, sizeof(*stats64)), since we have the
guarantee to properly init whole stats64 structure.
Or a more tricky

memset((char *)stats64 + sizeof(struct net_device_stats),
       0,
       sizeof(*stats64) - sizeof(struct net_device_stats));
I think I like this best, since it won't require someone to notice they
have to add an explicit initialization if they add a new counter, as well
as saving us from memset'ing the entire struct, the majority of which
we'll initialize moments later. Just needs some documentation updates,
which I've done locally. Will rebuild, re-test, then hopefully get an
updated patchset out the door.

-- 
Jarod Wilson
jarod@redhat.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help