lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 06 Sep 2016 08:08:25 -0700
From:   Roopa Prabhu <roopa@...ulusnetworks.com>
To:     Jiri Pirko <jiri@...nulli.us>
CC:     netdev@...r.kernel.org, davem@...emloft.net, nogahf@...lanox.com,
        idosch@...lanox.com, eladr@...lanox.com, yotamg@...lanox.com,
        ogerlitz@...lanox.com, nikolay@...ulusnetworks.com,
        linville@...driver.com, tgraf@...g.ch, gospo@...ulusnetworks.com,
        sfeldma@...il.com, sd@...asysnail.net, eranbe@...lanox.com,
        ast@...mgrid.com, edumazet@...gle.com, hannes@...essinduktion.org,
        f.fainelli@...il.com, dsa@...ulusnetworks.com
Subject: Re: [patch net-next v7 1/3] netdevice: Add offload statistics ndo

On 9/5/16, 10:18 AM, Jiri Pirko wrote:
> From: Nogah Frankel <nogahf@...lanox.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@...lanox.com>
> Signed-off-by: Jiri Pirko <jiri@...lanox.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,

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ