From: Arseny Maslennikov <ar@cs.msu.ru>
To: linux-rdma@vger.kernel.org
Cc: Arseny Maslennikov <ar@cs.msu.ru>,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
netdev@vger.kernel.org
Subject: [PATCH 1/3] IB/ipoib: Use dev_port to expose network interface port numbers
Date: Mon, 13 Aug 2018 14:42:22 +0300 [thread overview]
Message-ID: <20180813114224.7065-2-ar@cs.msu.ru> (raw)
In-Reply-To: <20180813114224.7065-1-ar@cs.msu.ru>
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.
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 76a066f2a2a0268b565459c417b59724b5a3197b, commit message:
`net/mlx4_en: Expose port number through sysfs'.
Signed-off-by: Arseny Maslennikov <ar@cs.msu.ru>
---
drivers/infiniband/ulp/ipoib/ipoib_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 26cde95bc0f3..6eb0594fffec 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2253,6 +2253,7 @@ static struct net_device *ipoib_add_port(const char *format,
SET_NETDEV_DEV(priv->dev, hca->dev.parent);
priv->dev->dev_id = port - 1;
+ priv->dev->dev_port = port - 1;
result = ib_query_port(hca, port, &attr);
if (result) {
--
2.18.0
next prev parent reply other threads:[~2018-08-13 11:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-13 11:42 [PATCH 0/3] net, IB/ipoib: Use dev_port to disambiguate Arseny Maslennikov
2018-08-13 11:42 ` Arseny Maslennikov [this message]
2018-08-13 11:42 ` [PATCH 2/3] IB/ipoib: Stop using dev_id to expose port numbers Arseny Maslennikov
2018-08-13 12:40 ` Yuval Shaia
2018-08-13 13:57 ` Arseny Maslennikov
2018-08-13 11:42 ` [PATCH 3/3] Documentation/ABI: document /sys/class/net/*/dev_port Arseny Maslennikov
2018-08-13 17:17 ` [PATCH 0/3] net, IB/ipoib: Use dev_port to disambiguate Jason Gunthorpe
-- strict thread matches above, loose matches on Subject: below --
2018-08-28 21:01 [PATCH 0/3] IB/ipoib: Use dev_port to disambiguate port numbers Arseny Maslennikov
2018-08-28 21:01 ` [PATCH 1/3] IB/ipoib: Use dev_port to expose network interface " Arseny Maslennikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180813114224.7065-2-ar@cs.msu.ru \
--to=ar@cs.msu.ru \
--cc=dledford@redhat.com \
--cc=jgg@ziepe.ca \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox