netdev: storage address support
Subsystems (3)
PATCH 1/1 netdev: storage address support
From: Chris Leech <[email protected]>
Fibre Channel over Ethernet (FCoE) uses a second MAC address dedicated to FCoE traffic on an Ethernet link. There are two supported addressing modes, negotiated at fabric discovery time with the gateway switch or Fibre Channel Forwarder (FCF).
1) Fabric Provided MAC Address (FPMA)
The MAC address is dynamically generated from the assigned FC ID. The FCoE stack supports this today and adds the address to the device with the dev_unicast_add() API.
2) Server Provided MAC Address (SPMA)
The server indicates to the FCF the address it would like to use for FCoE traffic. It's expected that SPMA capable interfaces will have a storage dedicated MAC address programed into EPROM, flash, or other non-volatile storage which the driver will be able to provide to the FCoE stack.
This adds a net_device_ops function to query a driver for a dedicated storage address.
If ndo_get_storage_address is implemented, then the address will also be exposed as a sysfs attribute. In order to do that, a new optional attrs group is added to the net_device, with the visibility of each attribute protected by a call to netdev_show_optional_attr().
---
include/linux/netdevice.h | 3 ++- net/core/net-sysfs.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletions(-)
include/linux/netdevice.h +2 -1
@@ -602,6 +602,7 @@ struct net_device_ops {int (*ndo_fcoe_ddp_done)(struct net_device *dev,u16 xid);#endif +void * (*ndo_get_storage_address)(struct net_device *dev); };/*
@@ -846,7 +847,7 @@ struct net_device/* class/net/name entry */ struct device dev;/* space for optional statistics and wireless sysfs groups */ -struct attribute_group *sysfs_groups[3 ]; +struct attribute_group *sysfs_groups[4 ];/* rtnetlink link ops */ const struct rtnl_link_ops *rtnl_link_ops;
net/core/net-sysfs.c +41 -0
53 lines not on this page · raw message
David Miller
maintainerFrom: Jeff Kirsher <[email protected]>
Date: Fri, 24 Apr 2009 01:03:50 -0700
Quoted 6 lines
2) Server Provided MAC Address (SPMA)
The server indicates to the FCF the address it would like to use for FCoE traffic. It's expected that SPMA capable interfaces will have a storage dedicated MAC address programed into EPROM, flash, or other non-volatile storage which the driver will be able to provide to the FCoE stack.
Quoted 7 lines
This adds a
net_device_opsfunction to query a driver for a dedicated storage address.If
ndo_get_storage_addressis implemented, then the address will also be exposed as a sysfs attribute. In order to do that, a new optional attrs group is added to thenet_device, with the visibility of each attribute protected by a call tonetdev_show_optional_attr().
This should be what is currently provided in netdev->perm_addr[]
I really see no difference.
Quoted 12 lines · David Miller
From: Jeff Kirsher <[email protected]>
Date: Fri, 24 Apr 2009 01:03:50 -0700Quoted 9 lines
2) Server Provided MAC Address (SPMA)
The server indicates to the FCF the address it would like to use for FCoE traffic. It's expected that SPMA capable interfaces will have a storage dedicated MAC address programed into EPROM, flash, or other non-volatile storage which the driver will be able to provide to the FCoE stack.This adds a
net_device_opsfunction to query a driver for a dedicated storage address.
Quoted 8 lines
Quoted 4 lines
If
ndo_get_storage_addressis implemented, then the address will also be exposed as a sysfs attribute. In order to do that, a new optional attrs group is added to thenet_device, with the visibility of each attribute protected by a call tonetdev_show_optional_attr().This should be what is currently provided in netdev->perm_addr[]
I really see no difference.
There seems to be some desire to use separate MAC address for LAN and SAN traffic on a converged network, even when using the server provided addressing mode for FCoE. So I'm looking at a device that has an extra MAC address in it's EEPROM, that's intended to be used for SAN traffic only.
At first glance Jiri's "list of device addresses" patch seems to be heading towards a more general approach to having multiple MAC addresses, without providing any sort of intent on how they should be used. But given that it's trying to solve a bonding + bridging issue, the addresses involved seem fairly dynamic and I'm not sure how it differs much from the existing uc_list.
Ignoring the issue of intended use for the moment, if an ethernet driver wanted to advertise several MAC addresses to the system how should it go about that?
- Chris
David Miller
maintainerFrom: Chris Leech <[email protected]>
Date: Mon, 27 Apr 2009 15:28:00 -0700
Quoted 3 lines
Ignoring the issue of intended use for the moment, if an ethernet driver wanted to advertise several MAC addresses to the system how should it go about that?
Now that's a more interesting question.
It seems better to formalize this. It can be an ethtool
callback or whatever, but what it should do is return an array of addresses, types, and perhaps even indexes with types.
So you could return LAN1, LAN2, LAN3, and SAN1.
Quoted 7 lines · Tue, Apr 28, 2009 at 03:48:54AM CEST, [email protected] wrote:
From: Chris Leech <[email protected]>
Date: Mon, 27 Apr 2009 15:28:00 -0700Quoted 3 lines
Ignoring the issue of intended use for the moment, if an ethernet driver wanted to advertise several MAC addresses to the system how should it go about that?
Quoted 6 lines
Now that's a more interesting question.
It seems better to formalize this. It can be an ethtool
callback or whatever, but what it should do is return an array of addresses, types, and perhaps even indexes with types.
Well the list of device addresses from my patch can pretty much solve this. There can be additional field in struct netdev_hw_addr to store flags to identify the mac address type (like primary, lan, san, slave, etc).
I think it would be better to do this in general (in struct net_device) then inside each driver exported by ethtool or whatever.
Quoted 6 lines
So you could return LAN1, LAN2, LAN3, and SAN1.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Tue, 28 Apr 2009 10:30:48 +0200
Quoted 15 lines
Quoted 7 lines · Tue, Apr 28, 2009 at 03:48:54AM CEST, [email protected] wrote:
From: Chris Leech <[email protected]>
Date: Mon, 27 Apr 2009 15:28:00 -0700Quoted 3 lines
Ignoring the issue of intended use for the moment, if an ethernet driver wanted to advertise several MAC addresses to the system how should it go about that?
Quoted 6 lines
Now that's a more interesting question.
It seems better to formalize this. It can be an ethtool
callback or whatever, but what it should do is return an array of addresses, types, and perhaps even indexes with types.
Quoted 6 lines
Well the list of device addresses from my patch can pretty much solve this. There can be additional field in struct
netdev_hw_addrto store flags to identify the mac address type (like primary, lan, san, slave, etc).I think it would be better to do this in general (in struct
net_device) then inside each driver exported by ethtool or whatever.
Agreed, can you update your patch to provide such a 'type' tag?
Thanks!
Quoted 18 lines · Tue, Apr 28, 2009 at 11:12:49AM CEST, [email protected] wrote:
From: Jiri Pirko <[email protected]>
Date: Tue, 28 Apr 2009 10:30:48 +0200Quoted 15 lines
Quoted 13 lines · Tue, Apr 28, 2009 at 03:48:54AM CEST, [email protected] wrote:
From: Chris Leech <[email protected]>
Date: Mon, 27 Apr 2009 15:28:00 -0700Quoted 3 lines
Ignoring the issue of intended use for the moment, if an ethernet driver wanted to advertise several MAC addresses to the system how should it go about that?
Now that's a more interesting question.
It seems better to formalize this. It can be an ethtool
callback or whatever, but what it should do is return an array of addresses, types, and perhaps even indexes with types.
Quoted 8 lines
Quoted 6 lines
Well the list of device addresses from my patch can pretty much solve this. There can be additional field in struct
netdev_hw_addrto store flags to identify the mac address type (like primary, lan, san, slave, etc).I think it would be better to do this in general (in struct
net_device) then inside each driver exported by ethtool or whatever.Agreed, can you update your patch to provide such a 'type' tag?
Ok, I'll do that. What types do you have on the top of your head?
Quoted 2 lines
Thanks!
David Miller
maintainerFrom: Jiri Pirko <[email protected]>
Date: Tue, 28 Apr 2009 12:18:17 +0200
Quoted 4 lines
Quoted 1 line · Tue, Apr 28, 2009 at 11:12:49AM CEST, [email protected] wrote:
Agreed, can you update your patch to provide such a 'type' tag?
Ok, I'll do that. What types do you have on the top of your head?
Just start with SAN, LAN, and the ones you need for your work.