[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250324100103.73324cc0@kernel.org>
Date: Mon, 24 Mar 2025 10:01:03 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Simon Horman <horms@...nel.org>
Cc: Mark Bloch <mbloch@...dia.com>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Sabrina Dubroca <sd@...asysnail.net>, Kuniyuki Iwashima
<kuniyu@...zon.com>, Leon Romanovsky <leon@...nel.org>, David Ahern
<dsahern@...nel.org>, netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
Mark Zhang <markzhang@...dia.com>, Maher Sanalla <msanalla@...dia.com>
Subject: Re: [PATCH net] rtnetlink: Allocate vfinfo size for VF GUIDs when
supported
On Thu, 20 Mar 2025 15:11:50 +0000 Simon Horman wrote:
> Perhaps I'm over thinking things here,
> perhaps the following is easier on the eyes?
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index d1e559fce918..60fac848e092 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -1151,6 +1151,9 @@ static inline int rtnl_vfinfo_size(const struct net_device *dev,
> 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_trust)));
> + if (dev->netdev_ops->ndo_get_vf_guid)
> + size += num_vfs * 2 *
> + nla_total_size(sizeof(struct ifla_vf_guid));
> if (~ext_filter_mask & RTEXT_FILTER_SKIP_STATS) {
> size += num_vfs *
> (nla_total_size(0) + /* nest IFLA_VF_STATS */
Yes, please
--
pw-bot: cr
Powered by blists - more mailing lists