Skip to contentSkip to conversation

nfp: flower: set sysfs link to device for representors

PATCH In review Jiri Pirko 4 participants 5 messages May 17, 2018 – May 21, 2018

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 nfp: flower: set sysfs link to device for representors

From: Jiri Pirko <[email protected]>

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

---
 drivers/net/ethernet/netronome/nfp/flower/main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/netronome/nfp/flower/main.c +1 -0
index 4e67c0cbf9f0..976ed112387d 100644
@@ -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,
Signature · 1 line
2.14.3
#1 lore raw
Quoted 3 lines · Jiri Pirko

From: Jiri Pirko <[email protected]>

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

author
#2 lore raw
Quoted 9 lines · Thu, May 17, 2018 at 02:25:14PM CEST, [email protected] wrote:
Quoted 3 lines · Jiri Pirko

From: Jiri Pirko <[email protected]>

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.

Quoted 6 lines

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

#3 lore raw
Quoted 8 lines · Jiri Pirko
Quoted 7 lines · Thu, May 17, 2018 at 02:25:14PM CEST, [email protected] wrote:
Quoted 3 lines · Jiri Pirko

From: Jiri Pirko <[email protected]>

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

please no

Quoted 7 lines
Quoted 2 lines

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.