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] [day] [month] [year] [list]
Date:	Thu, 11 Jun 2015 20:37:10 +0300
From:	Or Gerlitz <gerlitz.or@...il.com>
To:	John Fastabend <john.fastabend@...il.com>
Cc:	Or Gerlitz <ogerlitz@...lanox.com>,
	"David S. Miller" <davem@...emloft.net>,
	Linux Netdev List <netdev@...r.kernel.org>,
	Amir Vadai <amirv@...lanox.com>, Tal Alon <talal@...lanox.com>,
	Eran Ben Elisha <eranbe@...lanox.com>,
	Hadar Hen Zion <hadarh@...lanox.com>,
	Greg Rose <gregory.v.rose@...el.com>,
	Mitch Williams <mitch.a.williams@...el.com>
Subject: Re: [PATCH net-next 12/13] net/core: Add reading VF statistics
 through the PF netdevice

On Wed, Jun 10, 2015 at 6:23 PM, John Fastabend
<john.fastabend@...il.com> wrote:
> On 06/10/2015 07:59 AM, Or Gerlitz wrote:
>>
>> From: Eran Ben Elisha <eranbe@...lanox.com>
>>
>> Add ndo_get_vf_stats where the PF retrieves and fills the VFs traffic
>> statistics. Add rtnl_link_vf_stats64 for passing the VF statistics from
>> the PF to user-space.
>>
>> Signed-off-by: Eran Ben Elisha <eranbe@...lanox.com>
>> Signed-off-by: Hadar Hen Zion <hadarh@...lanox.com>
>> Signed-off-by: Or Gerlitz <ogerlitz@...lanox.com>
>> ---
>>   include/linux/netdevice.h    |    4 ++++
>>   include/uapi/linux/if_link.h |   11 +++++++++++
>>   net/core/rtnetlink.c         |   12 ++++++++++--
>>   3 files changed, 25 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
>> index 6f5f71f..b1d3b88 100644
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -1100,6 +1100,10 @@ struct net_device_ops {
>>                                                      struct ifla_vf_info
>> *ivf);
>>         int                     (*ndo_set_vf_link_state)(struct net_device
>> *dev,
>>                                                          int vf, int
>> link_state);
>> +       int                     (*ndo_get_vf_stats)(struct net_device
>> *dev,
>> +                                                   int vf,
>> +                                                   struct
>> rtnl_link_vf_stats64
>> +                                                   *vf_stats);
>>         int                     (*ndo_set_vf_port)(struct net_device *dev,
>>                                                    int vf,
>>                                                    struct nlattr *port[]);
>> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
>> index 1737b7a..9c25aeb 100644
>> --- a/include/uapi/linux/if_link.h
>> +++ b/include/uapi/linux/if_link.h
>> @@ -70,6 +70,16 @@ struct rtnl_link_stats64 {
>>         __u64   tx_compressed;
>>   };
>>
>> +/* VF statistics structure */
>> +struct rtnl_link_vf_stats64 {
>> +       __u64   rx_packets;             /* total packets received       */
>> +       __u64   tx_packets;             /* total packets transmitted    */
>> +       __u64   rx_bytes;               /* total bytes received         */
>> +       __u64   tx_bytes;               /* total bytes transmitted      */
>> +       __u64   broadcast;              /* broadcast packets received   */
>> +       __u64   multicast;              /* multicast packets received   */
>> +};
>
>
> Can we encode this in a nested netlink structure when its passed
> up to userspace? I have more stats I would like to export in the
> future such as dropped packets and if we put the structure in the UAPI
> we wont be able to easily extend this.

Yep, makes sense, I asked Eran to look on doing so.

> The structure could be moved into ./include/linux/if_link.h though.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ