[ofa-general][PATCH 8/12 v1] mlx4: Dynamic port configuration
Yevgeny Petrilin
yevgenyp at mellanox.co.il
Thu Jun 5 06:46:39 PDT 2008
Roland Dreier wrote:
> > +static ssize_t show_port_type(struct device *dev,
> > + struct device_attribute *attr,
> > + char *buf)
> > +{
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > + struct mlx4_dev *mdev = pci_get_drvdata(pdev);
> > + int i;
> > +
> > + sprintf(buf, "Current port types:\n");
> > + for (i = 1; i <= MLX4_MAX_PORTS; i++) {
> > + sprintf(buf, "%sPort%d: %s\n", buf, i,
> > + (mdev->caps.port_type[i] == MLX4_PORT_TYPE_IB)?
> > + "ib": "eth");
> > + }
> > + return strlen(buf);
> > +}
>
> This violates the one-value-per-file rule for sysfs if I am reading the
> code correctly.
>
> - R.
>
The purpose of this sysfs file is to show the port configuration of the device,
so I would refer to this as a single value.
We could present the configuration as a single, comma separated string.
Is it a reasonable solution, or should we have a sysfs file for each port?
Thanks,
Yevgeny
--
Yevgeny Petrilin
Mellanox Technalogies LTD.
SW- Linux
Phone: +972 (4) 909 7200 (ext.7677)
Mobile: +972 (54) 783 9222
E-mail: yevgenyp at mellanox.co.il
----------------------------------------------------------------------
Emails belong on computers, trees belong in forests; if you must print
this, do it on recycled paper.
http://www.greenpeace.org/international/
----------------------------------------------------------------------
Disclaimer added by CodeTwo Exchange Rules
http://www.codetwo.com
More information about the general
mailing list