All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Konstantin Khorenko <khorenko@virtuozzo.com>
Cc: Jarod Wilson <jarod@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Veaceslav Falico <vfalico@gmail.com>,
	Andy Gospodarek <andy@greyhouse.net>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH] bonding: show full hw address in sysfs for slave entries
Date: Fri, 29 Mar 2019 13:43:25 -0700	[thread overview]
Message-ID: <4734.1553892205@famine> (raw)
In-Reply-To: <20190328102921.11680-1-khorenko@virtuozzo.com>

Konstantin Khorenko <khorenko@virtuozzo.com> wrote:

>Bond expects ethernet hwaddr for its slave, but it can be longer than 6
>bytes - infiniband interface for example.
>
> # cat /sys/devices/<skipped>/net/ib0/address
> 80:00:02:08:fe:80:00:00:00:00:00:00:7c:fe:90:03:00:be:5d:e1
>
> # cat /sys/devices/<skipped>/net/ib0/bonding_slave/perm_hwaddr
> 80:00:02:08:fe:80
>
>So print full hwaddr in sysfs "bonding_slave/perm_hwaddr" as well.
>
>Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
>---
> drivers/net/bonding/bond_sysfs_slave.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
>index 2f120b2ffef0..4985268e2273 100644
>--- a/drivers/net/bonding/bond_sysfs_slave.c
>+++ b/drivers/net/bonding/bond_sysfs_slave.c
>@@ -55,7 +55,9 @@ static SLAVE_ATTR_RO(link_failure_count);
> 
> static ssize_t perm_hwaddr_show(struct slave *slave, char *buf)
> {
>-	return sprintf(buf, "%pM\n", slave->perm_hwaddr);
>+	return sprintf(buf, "%*phC\n",
>+		       slave->dev->addr_len,
>+		       slave->perm_hwaddr);
> }
> static SLAVE_ATTR_RO(perm_hwaddr);

Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>

	-J

---
	-Jay Vosburgh, jay.vosburgh@canonical.com

      parent reply	other threads:[~2019-03-29 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 10:29 [PATCH] bonding: show full hw address in sysfs for slave entries Konstantin Khorenko
2019-03-29 20:33 ` David Miller
2019-03-29 20:43 ` Jay Vosburgh [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=4734.1553892205@famine \
    --to=jay.vosburgh@canonical.com \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=jarod@redhat.com \
    --cc=khorenko@virtuozzo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vfalico@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.