[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM0PR05MB4866E222E33DBD4C40A7EA9CD1A00@AM0PR05MB4866.eurprd05.prod.outlook.com>
Date: Tue, 27 Aug 2019 12:00:34 +0000
From: Parav Pandit <parav@...lanox.com>
To: Cornelia Huck <cohuck@...hat.com>
CC: "alex.williamson@...hat.com" <alex.williamson@...hat.com>,
Jiri Pirko <jiri@...lanox.com>,
"kwankhede@...dia.com" <kwankhede@...dia.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH 3/4] mdev: Expose mdev alias in sysfs tree
> -----Original Message-----
> From: Cornelia Huck <cohuck@...hat.com>
> Sent: Tuesday, August 27, 2019 5:25 PM
> To: Parav Pandit <parav@...lanox.com>
> Cc: alex.williamson@...hat.com; Jiri Pirko <jiri@...lanox.com>;
> kwankhede@...dia.com; davem@...emloft.net; kvm@...r.kernel.org; linux-
> kernel@...r.kernel.org; netdev@...r.kernel.org
> Subject: Re: [PATCH 3/4] mdev: Expose mdev alias in sysfs tree
>
> On Tue, 27 Aug 2019 11:52:21 +0000
> Parav Pandit <parav@...lanox.com> wrote:
>
> > > -----Original Message-----
> > > From: Cornelia Huck <cohuck@...hat.com>
> > > Sent: Tuesday, August 27, 2019 5:05 PM
> > > To: Parav Pandit <parav@...lanox.com>
> > > Cc: alex.williamson@...hat.com; Jiri Pirko <jiri@...lanox.com>;
> > > kwankhede@...dia.com; davem@...emloft.net; kvm@...r.kernel.org;
> > > linux- kernel@...r.kernel.org; netdev@...r.kernel.org
> > > Subject: Re: [PATCH 3/4] mdev: Expose mdev alias in sysfs tree
> > >
> > > On Tue, 27 Aug 2019 11:07:37 +0000
> > > Parav Pandit <parav@...lanox.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Cornelia Huck <cohuck@...hat.com>
> > > > > Sent: Tuesday, August 27, 2019 4:17 PM
> > > > > To: Parav Pandit <parav@...lanox.com>
> > > > > Cc: alex.williamson@...hat.com; Jiri Pirko <jiri@...lanox.com>;
> > > > > kwankhede@...dia.com; davem@...emloft.net; kvm@...r.kernel.org;
> > > > > linux- kernel@...r.kernel.org; netdev@...r.kernel.org
> > > > > Subject: Re: [PATCH 3/4] mdev: Expose mdev alias in sysfs tree
> > > > >
> > > > > On Mon, 26 Aug 2019 15:41:18 -0500 Parav Pandit
> > > > > <parav@...lanox.com> wrote:
> > >
> > > > > > +static ssize_t alias_show(struct device *device,
> > > > > > + struct device_attribute *attr, char *buf) {
> > > > > > + struct mdev_device *dev = mdev_from_dev(device);
> > > > > > +
> > > > > > + if (!dev->alias)
> > > > > > + return -EOPNOTSUPP;
> > > > >
> > > > > I'm wondering how to make this consumable by userspace in the
> > > > > easiest
> > > way.
> > > > > - As you do now (userspace gets an error when trying to read)?
> > > > > - Returning an empty value (nothing to see here, move along)?
> > > > No. This is confusing, to return empty value, because it says that
> > > > there is an
> > > alias but it is some weird empty string.
> > > > If there is alias, it shows exactly what it is.
> > > > If no alias it returns an error code = unsupported -> inline with
> > > > other widely
> > > used subsystem.
> > > >
> > > > > - Or not creating the attribute at all? That would match what userspace
> > > > > sees on older kernels, so it needs to be able to deal with
> > > > > that
> > > > New sysfs files can appear. Tool cannot say that I was not
> > > > expecting this file
> > > here.
> > > > User space is supposed to work with the file they are off interest.
> > > > Mdev interface has option to specify vendor specific files, though
> > > > in usual
> > > manner it's not recommended.
> > > > So there is no old user space, new kernel issue here.
> > >
> > > I'm not talking about old userspace/new kernel, but new userspace/old
> kernel.
> > > Code that wants to consume this attribute needs to be able to cope
> > > with its absence anyway.
> > >
> > Old kernel doesn't have alias file.
> > If some tool tries to read this file it will fail to open non existing file; open()
> system call is already taking care of it.
>
> Yes, that was exactly my argument?
I misunderstood probably.
I re-read all 3 options you posted.
I do not see any issue in reporting error code similar to other widely used netdev subsystem, hence propose what is posted in the patch.
Powered by blists - more mailing lists