From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755602AbcA1PLL (ORCPT ); Thu, 28 Jan 2016 10:11:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55615 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbcA1PLJ (ORCPT ); Thu, 28 Jan 2016 10:11:09 -0500 Date: Thu, 28 Jan 2016 10:11:08 -0500 From: Jarod Wilson To: Eric Dumazet Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jiri Pirko , Daniel Borkmann , Tom Herbert , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , netdev@vger.kernel.org Subject: Re: [PATCH net 0/4] net: add rx_unhandled stat counter Message-ID: <20160128151108.GF59058@redhat.com> References: <1453489882-57948-1-git-send-email-jarod@redhat.com> <1453926098-40181-1-git-send-email-jarod@redhat.com> <1453928987.20722.29.camel@edumazet-glaptop2.roam.corp.google.com> <20160128060215.GB59058@redhat.com> <20160128061808.GD59058@redhat.com> <1453986002.7627.20.camel@edumazet-glaptop2.roam.corp.google.com> <20160128143806.GE59058@redhat.com> <1453992162.7627.35.camel@edumazet-glaptop2.roam.corp.google.com> <1453992265.7627.37.camel@edumazet-glaptop2.roam.corp.google.com> <1453992410.7627.39.camel@edumazet-glaptop2.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453992410.7627.39.camel@edumazet-glaptop2.roam.corp.google.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > On Thu, 2016-01-28 at 06:42 -0800, Eric Dumazet wrote: > > > > > > > > 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