public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roopa Prabhu <roopa@cumulusnetworks•com>
To: Jiri Pirko <jiri@resnulli•us>
Cc: netdev@vger•kernel.org, davem@davemloft•net, nogahf@mellanox•com,
	idosch@mellanox•com, eladr@mellanox•com, yotamg@mellanox•com,
	ogerlitz@mellanox•com, nikolay@cumulusnetworks•com,
	linville@tuxdriver•com, tgraf@suug•ch, gospo@cumulusnetworks•com,
	sfeldma@gmail•com, sd@queasysnail•net, eranbe@mellanox•com,
	ast@plumgrid•com, edumazet@google•com,
	hannes@stressinduktion•org, f.fainelli@gmail•com,
	dsa@cumulusnetworks•com
Subject: Re: [patch net-next v7 1/3] netdevice: Add offload statistics ndo
Date: Tue, 06 Sep 2016 08:08:25 -0700	[thread overview]
Message-ID: <57CEDBE9.1090501@cumulusnetworks.com> (raw)
In-Reply-To: <1473095937-27100-2-git-send-email-jiri@resnulli.us>

On 9/5/16, 10:18 AM, Jiri Pirko wrote:
> From: Nogah Frankel <nogahf@mellanox•com>
>
> Add a new ndo to return statistics for offloaded operation.
> Since there can be many different offloaded operation with many
> stats types, the ndo gets an attribute id by which it knows which
> stats are wanted. The ndo also gets a void pointer to be cast according
> to the attribute id.
>
> Signed-off-by: Nogah Frankel <nogahf@mellanox•com>
> Signed-off-by: Jiri Pirko <jiri@mellanox•com>
> ---
>  include/linux/netdevice.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 67bb978..2d2c09b 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -924,6 +924,14 @@ struct netdev_xdp {
>   *	3. Update dev->stats asynchronously and atomically, and define
>   *	   neither operation.
>   *
> + * bool (*ndo_has_offload_stats)(int attr_id)
> + *	Return true if this device supports offload stats of this attr_id.
> + *
> + * int (*ndo_get_offload_stats)(int attr_id, const struct net_device *dev,
> + *	void *attr_data)
> + *	Get statistics for offload operations by attr_id. Write it into the
> + *	attr_data pointer.
> + *

this could have been a single ndo_get_offload_stats like the others.
and possibly new ndo_get_offload_stats_size.
Ideally the driver could do the nest.
But, this can be changed if needed in the future.

>   * int (*ndo_vlan_rx_add_vid)(struct net_device *dev, __be16 proto, u16 vid);
>   *	If device supports VLAN filtering this function is called when a
>   *	VLAN id is registered.
> @@ -1155,6 +1163,10 @@ struct net_device_ops {
>  
>  	struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev,
>  						     struct rtnl_link_stats64 *storage);
> +	bool			(*ndo_has_offload_stats)(int attr_id);
> +	int			(*ndo_get_offload_stats)(int attr_id,
> +							 const struct net_device *dev,
> +							 void *attr_data);
>  	struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
>  
>  	int			(*ndo_vlan_rx_add_vid)(struct net_device *dev,

  reply	other threads:[~2016-09-06 15:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 17:18 [patch net-next v7 0/3] return offloaded stats as default and expose original sw stats Jiri Pirko
2016-09-05 17:18 ` [patch net-next v7 1/3] netdevice: Add offload statistics ndo Jiri Pirko
2016-09-06 15:08   ` Roopa Prabhu [this message]
2016-09-06 15:46     ` Jiri Pirko
2016-09-05 17:18 ` [patch net-next v7 2/3] net: core: Add offload stats to if_stats_msg Jiri Pirko
2016-09-06 15:20   ` Roopa Prabhu
2016-09-07 14:31     ` Nogah Frankel
2016-09-05 17:18 ` [patch net-next v7 3/3] mlxsw: spectrum: Implement offload stats ndo and expose HW stats by default Jiri Pirko
2016-09-06 14:59 ` [patch net-next v7 0/3] return offloaded stats as default and expose original sw stats Roopa Prabhu

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=57CEDBE9.1090501@cumulusnetworks.com \
    --to=roopa@cumulusnetworks$(echo .)com \
    --cc=ast@plumgrid$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsa@cumulusnetworks$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=eladr@mellanox$(echo .)com \
    --cc=eranbe@mellanox$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=gospo@cumulusnetworks$(echo .)com \
    --cc=hannes@stressinduktion$(echo .)org \
    --cc=idosch@mellanox$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=linville@tuxdriver$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nikolay@cumulusnetworks$(echo .)com \
    --cc=nogahf@mellanox$(echo .)com \
    --cc=ogerlitz@mellanox$(echo .)com \
    --cc=sd@queasysnail$(echo .)net \
    --cc=sfeldma@gmail$(echo .)com \
    --cc=tgraf@suug$(echo .)ch \
    --cc=yotamg@mellanox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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