diff mbox

[net-next,1/2] ldmvsw: add vio version and remote-mac to ethtool info

Message ID 1498061394-233018-2-git-send-email-shannon.nelson@oracle.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Shannon Nelson June 21, 2017, 4:09 p.m. UTC
In the ethtool -i output print the vio version and the remote-mac
of the ldom that the vif device is serving as this vif info is
not exposed elsewhere.  The remote-mac address is most useful for
tracking which client ldom is being served by the vif.

Orabug: 26316362

Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
---
 drivers/net/ethernet/sun/ldmvsw.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Comments

David Miller June 21, 2017, 7:05 p.m. UTC | #1
From: Shannon Nelson <shannon.nelson@oracle.com>
Date: Wed, 21 Jun 2017 09:09:53 -0700

> In the ethtool -i output print the vio version and the remote-mac
> of the ldom that the vif device is serving as this vif info is
> not exposed elsewhere.  The remote-mac address is most useful for
> tracking which client ldom is being served by the vif.
> 
> Orabug: 26316362
> 
> Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>

Although less useful, it is exposed already via the kernel logs.

Also, this is not at all an appropriate place to expose this.  The
"driver info" ethtool command is not a place to post per-connection
or per-link information.

Probably one of the IFLA_* netlink attributes would work best for
this.  You could even use PHYS_PORT_ID for this, which gives you
32 bytes to work with.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Shannon Nelson June 21, 2017, 8:59 p.m. UTC | #2
On 6/21/2017 12:05 PM, David Miller wrote:
> From: Shannon Nelson <shannon.nelson@oracle.com>
> Date: Wed, 21 Jun 2017 09:09:53 -0700
> 
>> In the ethtool -i output print the vio version and the remote-mac
>> of the ldom that the vif device is serving as this vif info is
>> not exposed elsewhere.  The remote-mac address is most useful for
>> tracking which client ldom is being served by the vif.
>>
>> Orabug: 26316362
>>
>> Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
> 
> Although less useful, it is exposed already via the kernel logs.

I had thought about that, but the idea of parsing kernel logs that could 
expire away didn't thrill me.

> 
> Also, this is not at all an appropriate place to expose this.  The
> "driver info" ethtool command is not a place to post per-connection
> or per-link information.

I knew it was a bit of a stretch, but almost made sense.  However, I'd 
still like to put the vio version here - is that acceptable?

> 
> Probably one of the IFLA_* netlink attributes would work best for
> this.  You could even use PHYS_PORT_ID for this, which gives you
> 32 bytes to work with.

Hmmm - good thought.  I'll go poke at this and see what I can come up 
with.  I gather from this that you agree that /sys is not the right 
place for this information, either.

Thanks,
sln
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller June 21, 2017, 9:27 p.m. UTC | #3
From: Shannon Nelson <shannon.nelson@oracle.com>
Date: Wed, 21 Jun 2017 13:59:35 -0700

> On 6/21/2017 12:05 PM, David Miller wrote:
>> Also, this is not at all an appropriate place to expose this.  The
>> "driver info" ethtool command is not a place to post per-connection
>> or per-link information.
> 
> I knew it was a bit of a stretch, but almost made sense.  However, I'd
> still like to put the vio version here - is that acceptable?

That part is fine.

>> Probably one of the IFLA_* netlink attributes would work best for
>> this.  You could even use PHYS_PORT_ID for this, which gives you
>> 32 bytes to work with.
> 
> Hmmm - good thought.  I'll go poke at this and see what I can come up
> with.  I gather from this that you agree that /sys is not the right
> place for this information, either.

Netlink is definitely preferred.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/sun/ldmvsw.c b/drivers/net/ethernet/sun/ldmvsw.c
index 8603e39..de512ef 100644
--- a/drivers/net/ethernet/sun/ldmvsw.c
+++ b/drivers/net/ethernet/sun/ldmvsw.c
@@ -62,8 +62,15 @@ 
 static void vsw_get_drvinfo(struct net_device *dev,
 			    struct ethtool_drvinfo *info)
 {
+	struct vnet_port *port = netdev_priv(dev);
+
 	strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
 	strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
+
+	snprintf(info->fw_version, sizeof(info->fw_version),
+		 "vio %d.%d", port->vio.ver.major, port->vio.ver.minor);
+	snprintf(info->bus_info, sizeof(info->bus_info),
+		 "remote-mac %pM", port->raddr);
 }
 
 static u32 vsw_get_msglevel(struct net_device *dev)