Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1900160ybb; Fri, 29 Mar 2019 13:44:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyT6kFA6vFH6FGBspRC3YZqKFs4xHeN+yYX2uoVI1hNh+ddhgZGQiTAGHKCTaGrdb76vFU X-Received: by 2002:a17:902:e002:: with SMTP id ca2mr38443693plb.131.1553892294704; Fri, 29 Mar 2019 13:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553892294; cv=none; d=google.com; s=arc-20160816; b=GhwSHrCNCk9evMKbBbYsfCQO2w/4CtpRG/6ANXNUs5Rs6ecwn9xJkDVYedysOZe4E6 hnMN9HbjZz0Bx2lh3uUGiyfZoYCsDHwASPOgwHOULaxe23sMtPqXwnHLCzz3oeEQOc6p LGsj02JO43Yipc9r7hA/5CmKAgUPsSuzlCI3pUv2LUDSbbCl80vQf7nUzGVmN9667GqK toyBLAHkpYp3YfPaIcT9H3E1dm/I5EUyREO+XNU2ZCDZrE3X3PogBGUHlCwxId5NRXg8 wNEnTWgqCaq22wEcXXaIA1dhUM54jevsacCCkkHMqJKqok5exNmJ6Tg0va+uK8FZ1FcU p5kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:comments:references:in-reply-to:subject:cc :to:from; bh=DWrXeYeCub7xCdtkREk0bzvGQn0CofY5tP5Qb73XGzc=; b=qNfGOb3w+OgHVTVJwo8cbiSNJWF2wOL1ghP20Mn8jWjLEj/1bDXvDqzCqHexKUhF0m VG84kNYTtBTAa/grthVg7zvVT6IsrTJvo5iJm7Gixc2rbHPCGe21uM5sDXxnz1Z5fEHo 2DPYLEzHCODv54zsw23l9CaqzVokZGfXJP+qbW6xiVxHr1uY5b5G+tDyK/JQTV1h4i6f T7U0mytexDZJwhJvJfYTeQ4Jrunk+u9VHIMSW+Nz6qaLQZsPScUTgAPdC+oyPug9vmhO 5Sy4BNYXHwcHwzulV7VsVzCnmBZn4Q/5ZNyJvn1z/+nf29TUGca3KVlHMy7Nqp4xZ+Oh Hh2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si2739463pga.0.2019.03.29.13.44.39; Fri, 29 Mar 2019 13:44:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730367AbfC2Une convert rfc822-to-8bit (ORCPT + 99 others); Fri, 29 Mar 2019 16:43:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:41540 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730238AbfC2Und (ORCPT ); Fri, 29 Mar 2019 16:43:33 -0400 Received: from c-67-160-6-8.hsd1.wa.comcast.net ([67.160.6.8] helo=famine.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1h9yLX-0000bo-TH; Fri, 29 Mar 2019 20:43:28 +0000 Received: by famine.localdomain (Postfix, from userid 1000) id F2FA660868; Fri, 29 Mar 2019 13:43:25 -0700 (PDT) Received: from famine (localhost [127.0.0.1]) by famine.localdomain (Postfix) with ESMTP id ECDF39F839; Fri, 29 Mar 2019 13:43:25 -0700 (PDT) From: Jay Vosburgh To: Konstantin Khorenko cc: Jarod Wilson , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Veaceslav Falico , Andy Gospodarek , "David S . Miller" Subject: Re: [PATCH] bonding: show full hw address in sysfs for slave entries In-reply-to: <20190328102921.11680-1-khorenko@virtuozzo.com> References: <20190328102921.11680-1-khorenko@virtuozzo.com> Comments: In-reply-to Konstantin Khorenko message dated "Thu, 28 Mar 2019 13:29:21 +0300." X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 27.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4733.1553892205.1@famine> Content-Transfer-Encoding: 8BIT Date: Fri, 29 Mar 2019 13:43:25 -0700 Message-ID: <4734.1553892205@famine> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Konstantin Khorenko wrote: >Bond expects ethernet hwaddr for its slave, but it can be longer than 6 >bytes - infiniband interface for example. > > # cat /sys/devices//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//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 >--- > 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 -J --- -Jay Vosburgh, jay.vosburgh@canonical.com