diff mbox series

[net-next] nfp: flower: set sysfs link to device for representors

Message ID 20180517100520.23971-1-jiri@resnulli.us
State Not Applicable, archived
Delegated to: David Miller
Headers show
Series [net-next] nfp: flower: set sysfs link to device for representors | expand

Commit Message

Jiri Pirko May 17, 2018, 10:05 a.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

Do this so the sysfs has "device" link correctly set.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 drivers/net/ethernet/netronome/nfp/flower/main.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Or Gerlitz May 17, 2018, 12:25 p.m. UTC | #1
On Thu, May 17, 2018 at 1:05 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> Do this so the sysfs has "device" link correctly set.

please no

This is likely to create bunch of issues with respect to how libvirt
deals with the representors.

We were discussing it off list between nfp and mlnx driver people. We
need to put
the open stack folks and kernel developers into the same thread. I can
make a post
on that next week
Jiri Pirko May 17, 2018, 12:42 p.m. UTC | #2
Thu, May 17, 2018 at 02:25:14PM CEST, gerlitz.or@gmail.com wrote:
>On Thu, May 17, 2018 at 1:05 PM, Jiri Pirko <jiri@resnulli.us> wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>>
>> Do this so the sysfs has "device" link correctly set.
>
>please no
>
>This is likely to create bunch of issues with respect to how libvirt
>deals with the representors.

Once netdev is there because of some probed pci device, this link should
be set. That is one of the basics.

What "bunch of issues" are you talking about? Please be specific.


>
>We were discussing it off list between nfp and mlnx driver people. We
>need to put
>the open stack folks and kernel developers into the same thread. I can
>make a post
>on that next week
Jakub Kicinski May 17, 2018, 5:51 p.m. UTC | #3
On Thu, 17 May 2018 14:42:10 +0200, Jiri Pirko wrote:
> Thu, May 17, 2018 at 02:25:14PM CEST, gerlitz.or@gmail.com wrote:
> >On Thu, May 17, 2018 at 1:05 PM, Jiri Pirko <jiri@resnulli.us> wrote:  
> >> From: Jiri Pirko <jiri@mellanox.com>
> >>
> >> Do this so the sysfs has "device" link correctly set.  
> >
> >please no
> >
> >This is likely to create bunch of issues with respect to how libvirt
> >deals with the representors.  
> 
> Once netdev is there because of some probed pci device, this link should
> be set. That is one of the basics.
> 
> What "bunch of issues" are you talking about? Please be specific.

Libvirt may pick any device under sys/bus/pci/devices/$vf/physfn/net/
to run legacy SR-IOV NDOs on.  nfp currently exposes those on all
representors.  

Or correctly points out that running SR-IOV NDOs on non-PF reprs makes
very limited amount of sense and we should fix libvirt and remove the
NDOs for non-PF nfp reprs.

AFAICT since nfp does provide the NDOs on all reprs nothing should
break with this patch, but ip link will now start listing VF state on
each representor.  Meaning that if we have 100 VFs enabled simple "ip
link list" will produce upwards of 10,000 lines of output.
David Miller May 21, 2018, 3:49 p.m. UTC | #4
From: Jiri Pirko <jiri@resnulli.us>
Date: Thu, 17 May 2018 12:05:20 +0200

> From: Jiri Pirko <jiri@mellanox.com>
> 
> Do this so the sysfs has "device" link correctly set.
> 
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>

Please sort out the non-PF representor issue with Or and Jakub.

Thanks.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c
index 4e67c0cbf9f0..976ed112387d 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/main.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/main.c
@@ -267,6 +267,7 @@  nfp_flower_spawn_vnic_reprs(struct nfp_app *app,
 				app->pf->vf_cfg_mem + i * NFP_NET_CFG_BAR_SZ;
 		}
 
+		SET_NETDEV_DEV(repr, &priv->nn->pdev->dev);
 		eth_hw_addr_random(repr);
 
 		port_id = nfp_flower_cmsg_pcie_port(nfp_pcie, vnic_type,