Subject: Re: [RFC PATCH v2] Gemini: Gigabit ethernet driver

From: Stephen Hemminger <[email-masked]>
Date: Wed, 29 Dec 2010 11:57:16 -0800

On Wed, 29 Dec 2010 20:52:26 +0100
Eric Dumazet <[email-masked]> wrote:

> Le mercredi 29 décembre 2010 à 11:28 -0800, Stephen Hemminger a écrit :
> 
> > It looks like the comment/documentation in netdevice.h is incorrect.
> > 
> >  * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
> >  *	Called when a user wants to get the network device usage
> >  *	statistics. Drivers must do one of the following:
> >  *	1. Define @ndo_get_stats64 to fill in a zero-initialised
> >  *	   rtnl_link_stats64 structure passed by the caller.
> >  *	2. Define @ndo_get_stats to update a net_device_stats structure
> >  *	   (which should normally be dev->stats) and return a pointer to
> >  *	   it. The structure may be changed asynchronously only if each
> >  *	   field is written atomically.
> >  *	3. Update dev->stats asynchronously and atomically, and define
> >  *	   neither operation.
> > 
> 
> You mean we should insert a new line ?
> I believe this documentation is up to date.
> 
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index cc916c5..3add243 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -721,7 +721,9 @@ struct xps_dev_maps {
>   *                      struct rtnl_link_stats64 *storage);
>   * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
>   *	Called when a user wants to get the network device usage
> - *	statistics. Drivers must do one of the following:
> + *	statistics.
> + *
> + * Drivers must do one of the following:
                     ^
                    only

Need to make it clear that get_stats is not needed if get_stats64 is defined.

--