rtnetlink.c (bb598c1b8c9bf56981927dcb8c0dc34b8ff95342) rtnetlink.c (7e75f74a171a8146cc3ee92d5562878b40c25fb5)
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 826 unchanged lines hidden (view full) ---

835
836/* All VF info */
837static inline int rtnl_vfinfo_size(const struct net_device *dev,
838 u32 ext_filter_mask)
839{
840 if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
841 (ext_filter_mask & RTEXT_FILTER_VF)) {
842 int num_vfs = dev_num_vf(dev->dev.parent);
1/*
2 * INET An implementation of the TCP/IP protocol suite for the LINUX
3 * operating system. INET is implemented using the BSD Socket
4 * interface as the means of communication with the user level.
5 *
6 * Routing netlink socket interface: protocol independent part.
7 *
8 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>

--- 826 unchanged lines hidden (view full) ---

835
836/* All VF info */
837static inline int rtnl_vfinfo_size(const struct net_device *dev,
838 u32 ext_filter_mask)
839{
840 if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
841 (ext_filter_mask & RTEXT_FILTER_VF)) {
842 int num_vfs = dev_num_vf(dev->dev.parent);
843 size_t size = nla_total_size(sizeof(struct nlattr));
844 size += nla_total_size(num_vfs * sizeof(struct nlattr));
843 size_t size = nla_total_size(0);
845 size += num_vfs *
844 size += num_vfs *
846 (nla_total_size(sizeof(struct ifla_vf_mac)) +
845 (nla_total_size(0) +
846 nla_total_size(sizeof(struct ifla_vf_mac)) +
847 nla_total_size(sizeof(struct ifla_vf_vlan)) +
848 nla_total_size(0) + /* nest IFLA_VF_VLAN_LIST */
847 nla_total_size(MAX_VLAN_LIST_LEN *
849 nla_total_size(MAX_VLAN_LIST_LEN *
848 sizeof(struct nlattr)) +
849 nla_total_size(MAX_VLAN_LIST_LEN *
850 sizeof(struct ifla_vf_vlan_info)) +
851 nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
850 sizeof(struct ifla_vf_vlan_info)) +
851 nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
852 nla_total_size(sizeof(struct ifla_vf_tx_rate)) +
852 nla_total_size(sizeof(struct ifla_vf_rate)) +
853 nla_total_size(sizeof(struct ifla_vf_link_state)) +
854 nla_total_size(sizeof(struct ifla_vf_rss_query_en)) +
853 nla_total_size(sizeof(struct ifla_vf_rate)) +
854 nla_total_size(sizeof(struct ifla_vf_link_state)) +
855 nla_total_size(sizeof(struct ifla_vf_rss_query_en)) +
856 nla_total_size(0) + /* nest IFLA_VF_STATS */
855 /* IFLA_VF_STATS_RX_PACKETS */
856 nla_total_size_64bit(sizeof(__u64)) +
857 /* IFLA_VF_STATS_TX_PACKETS */
858 nla_total_size_64bit(sizeof(__u64)) +
859 /* IFLA_VF_STATS_RX_BYTES */
860 nla_total_size_64bit(sizeof(__u64)) +
861 /* IFLA_VF_STATS_TX_BYTES */
862 nla_total_size_64bit(sizeof(__u64)) +

--- 3261 unchanged lines hidden ---
857 /* IFLA_VF_STATS_RX_PACKETS */
858 nla_total_size_64bit(sizeof(__u64)) +
859 /* IFLA_VF_STATS_TX_PACKETS */
860 nla_total_size_64bit(sizeof(__u64)) +
861 /* IFLA_VF_STATS_RX_BYTES */
862 nla_total_size_64bit(sizeof(__u64)) +
863 /* IFLA_VF_STATS_TX_BYTES */
864 nla_total_size_64bit(sizeof(__u64)) +

--- 3261 unchanged lines hidden ---