|
@@ -840,18 +840,20 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev,
|
|
if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
|
|
if (dev->dev.parent && dev_is_pci(dev->dev.parent) &&
|
|
(ext_filter_mask & RTEXT_FILTER_VF)) {
|
|
(ext_filter_mask & RTEXT_FILTER_VF)) {
|
|
int num_vfs = dev_num_vf(dev->dev.parent);
|
|
int num_vfs = dev_num_vf(dev->dev.parent);
|
|
- size_t size = nla_total_size(sizeof(struct nlattr));
|
|
|
|
- size += nla_total_size(num_vfs * sizeof(struct nlattr));
|
|
|
|
|
|
+ size_t size = nla_total_size(0);
|
|
size += num_vfs *
|
|
size += num_vfs *
|
|
- (nla_total_size(sizeof(struct ifla_vf_mac)) +
|
|
|
|
- nla_total_size(MAX_VLAN_LIST_LEN *
|
|
|
|
- sizeof(struct nlattr)) +
|
|
|
|
|
|
+ (nla_total_size(0) +
|
|
|
|
+ nla_total_size(sizeof(struct ifla_vf_mac)) +
|
|
|
|
+ nla_total_size(sizeof(struct ifla_vf_vlan)) +
|
|
|
|
+ nla_total_size(0) + /* nest IFLA_VF_VLAN_LIST */
|
|
nla_total_size(MAX_VLAN_LIST_LEN *
|
|
nla_total_size(MAX_VLAN_LIST_LEN *
|
|
sizeof(struct ifla_vf_vlan_info)) +
|
|
sizeof(struct ifla_vf_vlan_info)) +
|
|
nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
|
|
nla_total_size(sizeof(struct ifla_vf_spoofchk)) +
|
|
|
|
+ nla_total_size(sizeof(struct ifla_vf_tx_rate)) +
|
|
nla_total_size(sizeof(struct ifla_vf_rate)) +
|
|
nla_total_size(sizeof(struct ifla_vf_rate)) +
|
|
nla_total_size(sizeof(struct ifla_vf_link_state)) +
|
|
nla_total_size(sizeof(struct ifla_vf_link_state)) +
|
|
nla_total_size(sizeof(struct ifla_vf_rss_query_en)) +
|
|
nla_total_size(sizeof(struct ifla_vf_rss_query_en)) +
|
|
|
|
+ nla_total_size(0) + /* nest IFLA_VF_STATS */
|
|
/* IFLA_VF_STATS_RX_PACKETS */
|
|
/* IFLA_VF_STATS_RX_PACKETS */
|
|
nla_total_size_64bit(sizeof(__u64)) +
|
|
nla_total_size_64bit(sizeof(__u64)) +
|
|
/* IFLA_VF_STATS_TX_PACKETS */
|
|
/* IFLA_VF_STATS_TX_PACKETS */
|