> From: Jakub Kicinski <k...@kernel.org> > Sent: Wednesday, December 16, 2020 6:14 AM > > On Tue, 15 Dec 2020 01:03:50 -0800 Saeed Mahameed wrote: > > +static ssize_t sfnum_show(struct device *dev, struct device_attribute > > +*attr, char *buf) { > > + struct auxiliary_device *adev = container_of(dev, struct > auxiliary_device, dev); > > + struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, > > +adev); > > + > > + return scnprintf(buf, PAGE_SIZE, "%u\n", sf_dev->sfnum); } static > > +DEVICE_ATTR_RO(sfnum); > > + > > +static struct attribute *sf_device_attrs[] = { > > + &dev_attr_sfnum.attr, > > + NULL, > > +}; > > + > > +static const struct attribute_group sf_attr_group = { > > + .attrs = sf_device_attrs, > > +}; > > + > > +static const struct attribute_group *sf_attr_groups[2] = { > > + &sf_attr_group, > > + NULL > > +}; > > Why the sysfs attribute? Devlink should be able to report device name so > there's no need for a tie in from the other end. There isn't a need to enforce a devlink instance creation either, those mlx5 driver does it. systemd/udev looks after the sysfs attributes, so its parent device, similar to how phys_port_name etc looked for representor side.
- [net-next v5 03/15] devlink: Introduce PCI SF port flavour ... Saeed Mahameed
- Re: [net-next v5 03/15] devlink: Introduce PCI SF port... Jakub Kicinski
- RE: [net-next v5 03/15] devlink: Introduce PCI SF ... Parav Pandit
- Re: [net-next v5 03/15] devlink: Introduce PCI... Jakub Kicinski
- Re: [net-next v5 03/15] devlink: Introduce... Saeed Mahameed
- Re: [net-next v5 03/15] devlink: Intr... Jakub Kicinski
- RE: [net-next v5 03/15] devlink: ... Parav Pandit
- [net-next v5 01/15] net/mlx5: Fix compilation warning for 3... Saeed Mahameed
- [net-next v5 07/15] net/mlx5: SF, Add auxiliary device supp... Saeed Mahameed
- Re: [net-next v5 07/15] net/mlx5: SF, Add auxiliary de... Jakub Kicinski
- RE: [net-next v5 07/15] net/mlx5: SF, Add auxiliar... Parav Pandit
- Re: [net-next v5 07/15] net/mlx5: SF, Add auxi... Jakub Kicinski
- RE: [net-next v5 07/15] net/mlx5: SF, Add ... Parav Pandit
- Re: [net-next v5 07/15] net/mlx5: SF,... Jakub Kicinski
- RE: [net-next v5 07/15] net/mlx5:... Parav Pandit
- Re: [net-next v5 07/15] net/mlx5:... Jakub Kicinski
- [net-next v5 06/15] net/mlx5: Introduce vhca state event no... Saeed Mahameed
- [net-next v5 15/15] net/mlx5: Add devlink subfunction port ... Saeed Mahameed
- [net-next v5 11/15] net/mlx5: SF, Add port add delete funct... Saeed Mahameed
- Re: [net-next v5 11/15] net/mlx5: SF, Add port add del... Jakub Kicinski