netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Dexuan Cui <decui@microsoft.com>
Cc: davem@davemloft.net, kuba@kernel.org, kys@microsoft.com,
	haiyangz@microsoft.com, sthemmin@microsoft.com,
	wei.liu@kernel.org, liuwe@microsoft.com, netdev@vger.kernel.org,
	leon@kernel.org, andrew@lunn.ch, bernd@petrovitsch.priv.at,
	rdunlap@infradead.org, shacharr@microsoft.com,
	linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)
Date: Fri, 16 Apr 2021 09:40:06 -0700	[thread overview]
Message-ID: <20210416094006.70661f47@hermes.local> (raw)
In-Reply-To: <20210416060705.21998-1-decui@microsoft.com>

On Thu, 15 Apr 2021 23:07:05 -0700
Dexuan Cui <decui@microsoft.com> wrote:

> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 7349a70af083..f682a5572d84 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -2297,6 +2297,7 @@ static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev)
>  {
>  	struct device *parent = vf_netdev->dev.parent;
>  	struct net_device_context *ndev_ctx;
> +	struct net_device *ndev;
>  	struct pci_dev *pdev;
>  	u32 serial;
>  
> @@ -2319,8 +2320,17 @@ static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev)
>  		if (!ndev_ctx->vf_alloc)
>  			continue;
>  
> -		if (ndev_ctx->vf_serial == serial)
> -			return hv_get_drvdata(ndev_ctx->device_ctx);
> +		if (ndev_ctx->vf_serial != serial)
> +			continue;
> +
> +		ndev = hv_get_drvdata(ndev_ctx->device_ctx);
> +		if (ndev->addr_len != vf_netdev->addr_len ||
> +		    memcmp(ndev->perm_addr, vf_netdev->perm_addr,
> +			   ndev->addr_len) != 0)
> +			continue;
> +
> +		return ndev;
> +
>  	}
>  
>  	netdev_notice(vf_netdev,


This probably should be a separate patch.
I think it is trying to address the case of VF discovery in Hyper-V/Azure where the reported
VF from Hypervisor is bogus or confused.


  reply	other threads:[~2021-04-16 16:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  6:07 [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Dexuan Cui
2021-04-16 16:40 ` Stephen Hemminger [this message]
2021-04-16 17:10   ` Haiyang Zhang
2021-04-16 17:58     ` Dexuan Cui
2021-04-16 18:08       ` Stephen Hemminger
2021-04-16 18:44         ` Dexuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210416094006.70661f47@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew@lunn.ch \
    --cc=bernd@petrovitsch.priv.at \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=kys@microsoft.com \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuwe@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=shacharr@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).