* Re: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) [not found] <20210416060705.21998-1-decui@microsoft.com> @ 2021-04-16 16:40 ` Stephen Hemminger 2021-04-16 17:10 ` Haiyang Zhang 0 siblings, 1 reply; 5+ messages in thread From: Stephen Hemminger @ 2021-04-16 16:40 UTC (permalink / raw) To: Dexuan Cui Cc: davem, kuba, kys, haiyangz, sthemmin, wei.liu, liuwe, netdev, leon, andrew, bernd, rdunlap, shacharr, linux-kernel, linux-hyperv 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-16 16:40 ` [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Stephen Hemminger @ 2021-04-16 17:10 ` Haiyang Zhang 2021-04-16 17:58 ` Dexuan Cui 0 siblings, 1 reply; 5+ messages in thread From: Haiyang Zhang @ 2021-04-16 17:10 UTC (permalink / raw) To: Stephen Hemminger, Dexuan Cui Cc: davem, kuba, KY Srinivasan, Stephen Hemminger, wei.liu, Wei Liu, netdev, leon, andrew, bernd, rdunlap, Shachar Raindel, linux-kernel, linux-hyperv > -----Original Message----- > From: Stephen Hemminger <stephen@networkplumber.org> > Sent: Friday, April 16, 2021 12:40 PM > To: Dexuan Cui <decui@microsoft.com> > Cc: davem@davemloft.net; kuba@kernel.org; KY Srinivasan > <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; Stephen > Hemminger <sthemmin@microsoft.com>; wei.liu@kernel.org; Wei Liu > <liuwe@microsoft.com>; netdev@vger.kernel.org; leon@kernel.org; > andrew@lunn.ch; bernd@petrovitsch.priv.at; rdunlap@infradead.org; > Shachar Raindel <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) > > 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. This is for the Multi vPorts feature of MANA driver, which allows one VF to create multiple vPorts (NICs). They have the same PCI device and same VF serial number, but different MACs. So we put the change in one patch to avoid distro vendors missing this change when backporting the MANA driver. Thanks, - Haiyang ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-16 17:10 ` Haiyang Zhang @ 2021-04-16 17:58 ` Dexuan Cui 2021-04-16 18:08 ` Stephen Hemminger 0 siblings, 1 reply; 5+ messages in thread From: Dexuan Cui @ 2021-04-16 17:58 UTC (permalink / raw) To: Haiyang Zhang, Stephen Hemminger Cc: davem, kuba, KY Srinivasan, Stephen Hemminger, wei.liu, Wei Liu, netdev, leon, andrew, bernd, rdunlap, Shachar Raindel, linux-kernel, linux-hyperv > From: Haiyang Zhang <haiyangz@microsoft.com> > Sent: Friday, April 16, 2021 10:11 AM > > From: Stephen Hemminger <stephen@networkplumber.org> > > > ... > > > @@ -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. > > This is for the Multi vPorts feature of MANA driver, which allows one VF to > create multiple vPorts (NICs). They have the same PCI device and same VF > serial number, but different MACs. > > So we put the change in one patch to avoid distro vendors missing this > change when backporting the MANA driver. > > Thanks, > - Haiyang The netvsc change should come together in the same patch with this VF driver, otherwise the multi-vPorts functionality doesn't work properly. The netvsc change should not break any other existing VF drivers, because Hyper-V NIC SR-IOV implementation requires the the NetVSC network interface and the VF network interface should have the same MAC address, otherwise things won't work. Thanks, Dexuan ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-16 17:58 ` Dexuan Cui @ 2021-04-16 18:08 ` Stephen Hemminger 2021-04-16 18:44 ` Dexuan Cui 0 siblings, 1 reply; 5+ messages in thread From: Stephen Hemminger @ 2021-04-16 18:08 UTC (permalink / raw) To: Dexuan Cui Cc: Haiyang Zhang, davem, kuba, KY Srinivasan, Stephen Hemminger, wei.liu, Wei Liu, netdev, leon, andrew, bernd, rdunlap, Shachar Raindel, linux-kernel, linux-hyperv On Fri, 16 Apr 2021 17:58:45 +0000 Dexuan Cui <decui@microsoft.com> wrote: > > > > > > 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. > > > > This is for the Multi vPorts feature of MANA driver, which allows one VF to > > create multiple vPorts (NICs). They have the same PCI device and same VF > > serial number, but different MACs. > > > > So we put the change in one patch to avoid distro vendors missing this > > change when backporting the MANA driver. > > > > Thanks, > > - Haiyang > > The netvsc change should come together in the same patch with this VF > driver, otherwise the multi-vPorts functionality doesn't work properly. > > The netvsc change should not break any other existing VF drivers, because > Hyper-V NIC SR-IOV implementation requires the the NetVSC network > interface and the VF network interface should have the same MAC address, > otherwise things won't work. > > Thanks, > Dexuan Distro vendors should be able to handle a patch series. Don't see why this could not be two patch series. ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) 2021-04-16 18:08 ` Stephen Hemminger @ 2021-04-16 18:44 ` Dexuan Cui 0 siblings, 0 replies; 5+ messages in thread From: Dexuan Cui @ 2021-04-16 18:44 UTC (permalink / raw) To: Stephen Hemminger Cc: Haiyang Zhang, davem, kuba, KY Srinivasan, Stephen Hemminger, wei.liu, Wei Liu, netdev, leon, andrew, bernd, rdunlap, Shachar Raindel, linux-kernel, linux-hyperv > From: Stephen Hemminger <stephen@networkplumber.org> > Sent: Friday, April 16, 2021 11:09 AM > ... > On Fri, 16 Apr 2021 17:58:45 +0000 > Dexuan Cui <decui@microsoft.com> wrote: > > > > > > > > > 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. > > > > > > This is for the Multi vPorts feature of MANA driver, which allows one VF to > > > create multiple vPorts (NICs). They have the same PCI device and same VF > > > serial number, but different MACs. > > > > > > So we put the change in one patch to avoid distro vendors missing this > > > change when backporting the MANA driver. > > > > > > Thanks, > > > - Haiyang > > > > The netvsc change should come together in the same patch with this VF > > driver, otherwise the multi-vPorts functionality doesn't work properly. > > > > The netvsc change should not break any other existing VF drivers, because > > Hyper-V NIC SR-IOV implementation requires the the NetVSC network > > interface and the VF network interface should have the same MAC address, > > otherwise things won't work. > > > > Thanks, > > Dexuan > > Distro vendors should be able to handle a patch series. > Don't see why this could not be two patch series. Ok. Will split this into 2 patches (the first one is the netvsc change, and the second is the Linux VF driver) and post v8 shortly. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-16 18:44 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20210416060705.21998-1-decui@microsoft.com> 2021-04-16 16:40 ` [PATCH v7 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Stephen Hemminger 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
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).