From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Use dev_port for the ID of a network device.
Date: Tue, 1 Jul 2014 09:26:38 -0300 [thread overview]
Message-ID: <20140701122637.GB1204@oc0268524204.ibm.com> (raw)
In-Reply-To: <87egy54lwb.fsf@nemi.mork.no>
On Tue, Jul 01, 2014 at 08:45:56AM +0200, Bjørn Mork wrote:
> Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> writes:
>
> > diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
> > index c80c30a..6de9c98 100644
> > --- a/src/udev/udev-builtin-net_id.c
> > +++ b/src/udev/udev-builtin-net_id.c
> > @@ -186,9 +186,14 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
> > return -ENOENT;
> >
> > /* kernel provided multi-device index */
> > - attr = udev_device_get_sysattr_value(dev, "dev_id");
> > - if (attr)
> > + attr = udev_device_get_sysattr_value(dev, "dev_port");
> > + if (attr) {
> > dev_id = strtol(attr, NULL, 16);
> > + } else {
> > + attr = udev_device_get_sysattr_value(dev, "dev_id");
> > + if (attr)
> > + dev_id = strtol(attr, NULL, 16);
> > + }
> >
> > /* compose a name based on the raw kernel's PCI bus, slot numbers */
> > s = names->pci_path;
>
> Note that the base of the new attribute is 10, not 16:
>
> bjorn@nemi:/usr/local/src/git/linux$ git grep dev_port net/core/
> net/core/net-sysfs.c:NETDEVICE_SHOW_RO(dev_port, fmt_dec);
> net/core/net-sysfs.c: &dev_attr_dev_port.attr,
> bjorn@nemi:/usr/local/src/git/linux$ git grep dev_id net/core/
> net/core/net-sysfs.c:NETDEVICE_SHOW_RO(dev_id, fmt_hex);
> net/core/net-sysfs.c: &dev_attr_dev_id.attr,
>
>
>
> Bjørn
>
Thanks for noticing, I'll fix that.
Cascardo.
prev parent reply other threads:[~2014-07-01 12:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 20:36 [PATCH] Use dev_port for the ID of a network device Thadeu Lima de Souza Cascardo
2014-07-01 0:33 ` Kay Sievers
2014-07-01 12:32 ` [systemd-devel] " Thadeu Lima de Souza Cascardo
2014-07-01 12:45 ` Tom Gundersen
2014-07-01 12:59 ` Kay Sievers
2014-07-01 13:18 ` Amir Vadai
2014-07-01 6:45 ` Bjørn Mork
2014-07-01 7:40 ` Bjørn Mork
2014-07-01 12:25 ` Thadeu Lima de Souza Cascardo
2014-07-01 12:26 ` Thadeu Lima de Souza Cascardo [this message]
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=20140701122637.GB1204@oc0268524204.ibm.com \
--to=cascardo@linux.vnet.ibm.com \
--cc=bjorn@mork.no \
--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;
as well as URLs for NNTP newsgroup(s).