[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <075a5d0f9fb9dfc868e82073f930a98bea15e578.camel@redhat.com>
Date: Thu, 30 Aug 2018 16:17:58 -0400
From: Doug Ledford <dledford@...hat.com>
To: Arseny Maslennikov <ar@...msu.ru>, linux-rdma@...r.kernel.org
Cc: Jason Gunthorpe <jgg@...pe.ca>, netdev@...r.kernel.org
Subject: Re: [PATCH v2 1/2] IB/ipoib: Use dev_port to expose network
interface port numbers
On Thu, 2018-08-30 at 21:22 +0300, Arseny Maslennikov wrote:
> Some InfiniBand network devices have multiple ports on the same PCI
> function. This initializes the `dev_port' sysfs field of those
> network interfaces with their port number.
>
> Prior to this the kernel erroneously used the `dev_id' sysfs
> field of those network interfaces to convey the port number to userspace.
>
> The use of `dev_id' was considered correct until Linux 3.15,
> when another field, `dev_port', was defined for this particular
> purpose and `dev_id' was reserved for distinguishing stacked ifaces
> (e.g: VLANs) with the same hardware address as their parent device.
>
> Similar fixes to net/mlx4_en and many other drivers, which started
> exporting this information through `dev_id' before 3.15, were accepted
> into the kernel 4 years ago.
> See 76a066f2a2a0 (`net/mlx4_en: Expose port number through sysfs').
>
> Signed-off-by: Arseny Maslennikov <ar@...msu.ru>
> ---
> drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index e3d28f9ad9c0..ba16a63ee303 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -1880,7 +1880,7 @@ static int ipoib_parent_init(struct net_device *ndev)
> sizeof(union ib_gid));
>
> SET_NETDEV_DEV(priv->dev, priv->ca->dev.parent);
> - priv->dev->dev_id = priv->port - 1;
> + priv->dev->dev_port = priv->port - 1;
I don't know that we can't do this. At least not yet. Expose the new
item to make us compliant with the new docs, and deprecate the old sysfs
item, but we can't just yank the old item. Existing tools/scripts might
(probably) rely on it (existing tools already special case IPoIB
interfaces and we'll need to make sure they don't special case this
element too).
--
Doug Ledford <dledford@...hat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists