* Re: [PATCH] new net device feature: shared-ipv6-cards
2002-08-19 8:20 Andreas Herrmann
@ 2002-08-19 8:11 ` David S. Miller
0 siblings, 0 replies; 9+ messages in thread
From: David S. Miller @ 2002-08-19 8:11 UTC (permalink / raw)
To: AHERRMAN; +Cc: pekkas, netdev, kuznet, ak
From: "Andreas Herrmann" <AHERRMAN@de.ibm.com>
Date: Mon, 19 Aug 2002 10:20:19 +0200
The following changes are performed:
o Documentation/Configure.help
net/Config.in
Configure option and help text for the new feature.
No config option please. If device driver indicates it wants this
behavior with a flag bit, no need to duplicate this logic.
It is likely that it will not be just z-series machines that
will find this useful.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] new net device feature: shared-ipv6-cards
@ 2002-08-19 8:20 Andreas Herrmann
2002-08-19 8:11 ` David S. Miller
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Herrmann @ 2002-08-19 8:20 UTC (permalink / raw)
To: Pekka Savola, netdev; +Cc: David S. Miller, Alexey Kuznetsov, Andi Kleen
(Obviously, I've forgotten to address the networking kernel
maintainers in my previous mail. So here we go again ...;-)
Hi,
I ask for integration of the attached patch into the
stock kernel. The patch is against kernel version 2.4.19.
This patch allows to replace the part 0xFFFE of an EUI-64 based
interface identifier by another 16 bit value. The new net device
feature is needed to avoid duplicate address conflicts on Linux for
z/Series when shared OSA cards are used with IPv6.
The following changes are performed:
o Documentation/Configure.help
net/Config.in
Configure option and help text for the new feature.
o arch/s390/defconfig
arch/s390x/defconfig
Set option on by default for Linux for z/Series.
o include/linux/netdevice.h
Changed struct net_device to store an id for the card user
instance. Introduced macro for the new net device feature.
o net/ipv6/addrconf.c
Replace 0xFFFE by a card user instance id in function
ipv6_generate_eui64().
o net/8021q/vlan.c
Take new feature into account for VLAN devices in function
register_802_1Q_vlan_device().
On Linux for zSeries OSA network cards can be shared among various
Linuxes. The OSA card has only one MAC address. This leads to
duplicate address conflicts in conjunction with IPv6 and a vanilla
kernel if more than one Linux use the same card. But the device
driver for the card can deliver a unique 16-bit identifier for each
Linux sharing the same card. This identifier is placed instead of the
part 0xFFFE in the interface identifier.
The "u" bit of the interface identifier is not inverted when the new
feature is used. Hence the resulting interface identifier has local
scope according to RFC2373. Consequently this change of the
autoconfiguration does not violate any RFCs.
Regards,
Andreas
--
Linux for eServer Development
Tel : +49-7031-16-4640
Notes mail : Andreas Herrmann/GERMANY/IBM@IBMDE
email : aherrman@de.ibm.com
diff -Naur linux-2.4.19.old/Documentation/Configure.help linux-2.4.19/Documentation/Configure.help
--- linux-2.4.19.old/Documentation/Configure.help Mon Aug 5 10:54:29 2002
+++ linux-2.4.19/Documentation/Configure.help Mon Aug 5 10:56:50 2002
@@ -5404,6 +5404,16 @@
It is safe to say N here for now.
+Prepare net_device struct for shared IPv6 cards
+CONFIG_SHARED_IPV6_CARDS
+ This prepares the net_device structure to contain a card user instance
+ id. On some systems, e.g. IBM zSeries, networking cards can be shared.
+ In order to make IPv6 autoconfiguration useful, each user of the
+ networking card will get a different id which is used for unique
+ address generation (the id is used in the EUI-64 generation).
+
+ Only say yes on IBM zSeries or S/390 systems.
+
# 2.5 tree only
IPv6: routing messages via old netlink
CONFIG_IPV6_NETLINK
diff -Naur linux-2.4.19.old/arch/s390/defconfig linux-2.4.19/arch/s390/defconfig
--- linux-2.4.19.old/arch/s390/defconfig Mon Aug 5 10:54:28 2002
+++ linux-2.4.19/arch/s390/defconfig Mon Aug 5 12:22:33 2002
@@ -146,6 +146,7 @@
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
CONFIG_IPV6=m
+CONFIG_SHARED_IPV6_CARDS=y
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
diff -Naur linux-2.4.19.old/arch/s390x/defconfig linux-2.4.19/arch/s390x/defconfig
--- linux-2.4.19.old/arch/s390x/defconfig Mon Aug 5 10:54:29 2002
+++ linux-2.4.19/arch/s390x/defconfig Mon Aug 5 12:23:29 2002
@@ -146,6 +146,7 @@
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
CONFIG_IPV6=m
+CONFIG_SHARED_IPV6_CARDS=y
# CONFIG_KHTTPD is not set
# CONFIG_ATM is not set
# CONFIG_VLAN_8021Q is not set
diff -Naur linux-2.4.19.old/include/linux/netdevice.h linux-2.4.19/include/linux/netdevice.h
--- linux-2.4.19.old/include/linux/netdevice.h Mon Aug 5 10:54:19 2002
+++ linux-2.4.19/include/linux/netdevice.h Mon Aug 5 12:18:41 2002
@@ -362,6 +362,9 @@
#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
+#define NETIF_F_SHARED_IPV6 2048 /* make IPv6 address autogeneration
+ * network card instance aware
+ */
/* Called after device is detached from network. */
void (*uninit)(struct net_device *dev);
@@ -431,6 +434,9 @@
/* this will get initialized at each interface type init routine */
struct divert_blk *divert;
#endif /* CONFIG_NET_DIVERT */
+#ifdef CONFIG_SHARED_IPV6_CARDS
+ unsigned short dev_id;
+#endif /* CONFIG_SHARED_IPV6_CARDS */
};
diff -Naur linux-2.4.19.old/net/8021q/vlan.c linux-2.4.19/net/8021q/vlan.c
--- linux-2.4.19.old/net/8021q/vlan.c Mon Aug 5 10:54:19 2002
+++ linux-2.4.19/net/8021q/vlan.c Mon Aug 5 10:56:50 2002
@@ -437,6 +437,10 @@
/* IFF_BROADCAST|IFF_MULTICAST; ??? */
new_dev->flags = real_dev->flags;
new_dev->flags &= ~IFF_UP;
+#ifdef CONFIG_SHARED_IPV6_CARDS
+ new_dev->features |= (real_dev->features & NETIF_F_SHARED_IPV6);
+ new_dev->dev_id = real_dev->dev_id;
+#endif
/* Make this thing known as a VLAN device */
new_dev->priv_flags |= IFF_802_1Q_VLAN;
diff -Naur linux-2.4.19.old/net/Config.in linux-2.4.19/net/Config.in
--- linux-2.4.19.old/net/Config.in Mon Aug 5 10:54:19 2002
+++ linux-2.4.19/net/Config.in Mon Aug 5 10:56:50 2002
@@ -25,6 +25,7 @@
if [ "$CONFIG_IPV6" != "n" ]; then
source net/ipv6/Config.in
fi
+ bool ' Prepare net_device struct for shared IPv6 cards' CONFIG_SHARED_IPV6_CARDS
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
source net/khttpd/Config.in
diff -Naur linux-2.4.19.old/net/ipv6/addrconf.c linux-2.4.19/net/ipv6/addrconf.c
--- linux-2.4.19.old/net/ipv6/addrconf.c Mon Aug 5 10:54:19 2002
+++ linux-2.4.19/net/ipv6/addrconf.c Mon Aug 5 10:56:50 2002
@@ -690,9 +690,20 @@
return -1;
memcpy(eui, dev->dev_addr, 3);
memcpy(eui + 5, dev->dev_addr+3, 3);
+#ifdef CONFIG_SHARED_IPV6_CARDS
+ if (dev->features&NETIF_F_SHARED_IPV6) {
+ eui[3] = (dev->dev_id>>8)&0xff;
+ eui[4] = dev->dev_id&0xff;
+ } else {
+ eui[3] = 0xFF;
+ eui[4] = 0xFE;
+ eui[0] ^= 2;
+ }
+#else /* CONFIG_SHARED_IPV6_CARDS */
eui[3] = 0xFF;
eui[4] = 0xFE;
eui[0] ^= 2;
+#endif /* CONFIG_SHARED_IPV6_CARDS */
return 0;
}
return -1;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
@ 2002-08-19 9:57 Andreas Herrmann
0 siblings, 0 replies; 9+ messages in thread
From: Andreas Herrmann @ 2002-08-19 9:57 UTC (permalink / raw)
To: David S. Miller; +Cc: ak, kuznet, netdev, owner-netdev, pekkas
"David S. Miller" <davem@redhat.com>
08/19/02 10:11 AM
> From: "Andreas Herrmann" <AHERRMAN@de.ibm.com>
> Date: Mon, 19 Aug 2002 10:20:19 +0200
> The following changes are performed:
> o Documentation/Configure.help
> net/Config.in
> Configure option and help text for the new feature.
> No config option please. If device driver indicates it wants this
> behavior with a flag bit, no need to duplicate this logic.
> It is likely that it will not be just z-series machines that
> will find this useful.
Ok, that's quite sensible. Then I'd like to add some documentation
either to Documentation/networking/netdevices.txt or a new file (say
Documentation/networking/ipv6-addrconf.txt) to describe the new
feature. Although netdevices.txt seems to be rather incomplete, I
think the description of this netdevice feature belongs herein.
Any other thoughts, comments regarding the patch?
Andreas
--
Linux for eServer Development
Tel : +49-7031-16-4640
Notes mail : Andreas Herrmann/GERMANY/IBM@IBMDE
email : aherrman@de.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
@ 2002-08-21 15:28 Andreas Herrmann
2002-08-21 15:55 ` kuznet
0 siblings, 1 reply; 9+ messages in thread
From: Andreas Herrmann @ 2002-08-21 15:28 UTC (permalink / raw)
To: David S. Miller; +Cc: ak, kuznet, netdev, owner-netdev, pekkas
Hi,
I removed the config option, added documentation to
Documentation/networking/netdevices.txt
and created a new patch for the new net device feature.
Regards,
Andreas
--
diff -Naur linux-2.4.19.old/Documentation/networking/netdevices.txt linux-2.4.19/Documentation/networking/netdevices.txt
--- linux-2.4.19.old/Documentation/networking/netdevices.txt Thu Nov 9 03:09:49 2000
+++ linux-2.4.19/Documentation/networking/netdevices.txt Wed Aug 21 17:11:28 2002
@@ -40,3 +40,18 @@
Sleeping: NO
+struct net_device feature NETIF_F_SHARED_IPV6
+=============================================
+
+On some systems, e.g. IBM zSeries, networking cards can be shared.
+In order to make IPv6 autoconfiguration useful, each user of the
+networking card will get a different id ("card user instance id")
+which is used for unique address generation in ipv6_generate_eui64().
+
+Using this feature, the part 0xFFFE of an EUI-64 based interface
+identifier is replaced by the id, and the "u" bit is not inverted.
+So the "u" bit will indicate local scope.
+
+The id is stored in:
+
+ dev->dev_id
diff -Naur linux-2.4.19.old/include/linux/netdevice.h linux-2.4.19/include/linux/netdevice.h
--- linux-2.4.19.old/include/linux/netdevice.h Sat Aug 3 00:39:45 2002
+++ linux-2.4.19/include/linux/netdevice.h Wed Aug 21 16:01:54 2002
@@ -362,6 +362,9 @@
#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
+#define NETIF_F_SHARED_IPV6 2048 /* make IPv6 address autogeneration
+ * network card instance aware
+ */
/* Called after device is detached from network. */
void (*uninit)(struct net_device *dev);
@@ -431,6 +434,9 @@
/* this will get initialized at each interface type init routine */
struct divert_blk *divert;
#endif /* CONFIG_NET_DIVERT */
+
+ /* for feature NETIF_F_SHARED_IPV6 to store id of shared card */
+ unsigned short dev_id;
};
diff -Naur linux-2.4.19.old/net/8021q/vlan.c linux-2.4.19/net/8021q/vlan.c
--- linux-2.4.19.old/net/8021q/vlan.c Sat Aug 3 00:39:46 2002
+++ linux-2.4.19/net/8021q/vlan.c Wed Aug 21 15:45:31 2002
@@ -437,6 +437,8 @@
/* IFF_BROADCAST|IFF_MULTICAST; ??? */
new_dev->flags = real_dev->flags;
new_dev->flags &= ~IFF_UP;
+ new_dev->features |= (real_dev->features & NETIF_F_SHARED_IPV6);
+ new_dev->dev_id = real_dev->dev_id;
/* Make this thing known as a VLAN device */
new_dev->priv_flags |= IFF_802_1Q_VLAN;
diff -Naur linux-2.4.19.old/net/ipv6/addrconf.c linux-2.4.19/net/ipv6/addrconf.c
--- linux-2.4.19.old/net/ipv6/addrconf.c Sat Aug 3 00:39:46 2002
+++ linux-2.4.19/net/ipv6/addrconf.c Wed Aug 21 15:37:03 2002
@@ -690,9 +690,14 @@
return -1;
memcpy(eui, dev->dev_addr, 3);
memcpy(eui + 5, dev->dev_addr+3, 3);
- eui[3] = 0xFF;
- eui[4] = 0xFE;
- eui[0] ^= 2;
+ if (dev->features&NETIF_F_SHARED_IPV6) {
+ eui[3] = (dev->dev_id>>8)&0xff;
+ eui[4] = dev->dev_id&0xff;
+ } else {
+ eui[3] = 0xFF;
+ eui[4] = 0xFE;
+ eui[0] ^= 2;
+ }
return 0;
}
return -1;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
2002-08-21 15:28 Andreas Herrmann
@ 2002-08-21 15:55 ` kuznet
0 siblings, 0 replies; 9+ messages in thread
From: kuznet @ 2002-08-21 15:55 UTC (permalink / raw)
To: Andreas Herrmann; +Cc: davem, netdev, pekkas
Hello!
> I removed the config option, added documentation to
> Documentation/networking/netdevices.txt
> and created a new patch for the new net device feature.
One thought: if you have to add a new field to struct netdevice,
it makes lots of sense to move further and to add special method
dev->generate_eui64() instead, which will be initialized
to standard eth_generate_eui64() for normal ethernets
and to something private for your device.
In this way we are guaranteed not to have problems of this kind
in future.
Alexey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
@ 2002-08-21 17:00 Andreas Herrmann
2002-08-21 17:13 ` kuznet
2002-08-21 21:55 ` David S. Miller
0 siblings, 2 replies; 9+ messages in thread
From: Andreas Herrmann @ 2002-08-21 17:00 UTC (permalink / raw)
To: kuznet; +Cc: davem, netdev, owner-netdev, pekkas
kuznet@ms2.inr.ac.ru
Sent by: owner-netdev@oss.sgi.com
08/21/02 05:55 PM
> One thought: if you have to add a new field to struct netdevice,
> it makes lots of sense to move further and to add special method
> dev->generate_eui64() instead, which will be initialized
> to standard eth_generate_eui64() for normal ethernets
> and to something private for your device.
I agree with this. Of course this implies changes in the device driver
itself. (Currently our device driver for the shared cards relies on
the changes described in the patch.)
But its the way it should be done.
> In this way we are guaranteed not to have problems of this kind
> in future.
What about implementing your alternative proposal in 2.5 and to use
the current approach in a next 2.4.x kernel?
Regards,
Andreas
--
Linux for eServer Development
Tel : +49-7031-16-4640
Notes mail : Andreas Herrmann/GERMANY/IBM@IBMDE
email : aherrman@de.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
2002-08-21 17:00 [PATCH] new net device feature: shared-ipv6-cards Andreas Herrmann
@ 2002-08-21 17:13 ` kuznet
2002-08-21 21:55 ` David S. Miller
1 sibling, 0 replies; 9+ messages in thread
From: kuznet @ 2002-08-21 17:13 UTC (permalink / raw)
To: Andreas Herrmann; +Cc: davem, netdev, owner-netdev, pekkas
Hello!
> What about implementing your alternative proposal in 2.5 and to use
> the current approach in a next 2.4.x kernel?
I do not see any good reasons to do this differently.
Alexey
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
2002-08-21 17:00 [PATCH] new net device feature: shared-ipv6-cards Andreas Herrmann
2002-08-21 17:13 ` kuznet
@ 2002-08-21 21:55 ` David S. Miller
1 sibling, 0 replies; 9+ messages in thread
From: David S. Miller @ 2002-08-21 21:55 UTC (permalink / raw)
To: AHERRMAN; +Cc: kuznet, netdev, owner-netdev, pekkas
From: "Andreas Herrmann" <AHERRMAN@de.ibm.com>
Date: Wed, 21 Aug 2002 19:00:39 +0200
> In this way we are guaranteed not to have problems of this kind
> in future.
What about implementing your alternative proposal in 2.5 and to use
the current approach in a next 2.4.x kernel?
Just because you have some code depending upon this doesn't
mean that is the way we should implement it in 2.4.x
We should do it right from the start. Because doing it properly
hurts no other driver except for yours. :-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] new net device feature: shared-ipv6-cards
@ 2002-08-22 13:34 Andreas Herrmann
0 siblings, 0 replies; 9+ messages in thread
From: Andreas Herrmann @ 2002-08-22 13:34 UTC (permalink / raw)
To: David S. Miller, kuznet; +Cc: netdev, owner-netdev, pekkas
kuznet@ms2.inr.ac.ru
08/21/02 07:13 PM
> Hello!
> > What about implementing your alternative proposal in 2.5 and to use
> > the current approach in a next 2.4.x kernel?
> I do not see any good reasons to do this differently.
> Alexey
"David S. Miller" <davem@redhat.com>
08/21/02 11:55 PM
> From: "Andreas Herrmann" <AHERRMAN@de.ibm.com>
> Date: Wed, 21 Aug 2002 19:00:39 +0200
> > In this way we are guaranteed not to have problems of this kind
> > in future.
> What about implementing your alternative proposal in 2.5 and to use
> the current approach in a next 2.4.x kernel?
> Just because you have some code depending upon this doesn't
> mean that is the way we should implement it in 2.4.x
> We should do it right from the start. Because doing it properly
> hurts no other driver except for yours. :-)
Well, I tried it;-)
Sometimes programmers are as lazy as something.
But in fact, I'm on your side.
So it's time for another patch. However, I cannot foresee when I
finish this work.
Regards,
Andreas
--
Linux for eServer Development
Tel : +49-7031-16-4640
Notes mail : Andreas Herrmann/GERMANY/IBM@IBMDE
email : aherrman@de.ibm.com
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2002-08-22 13:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-21 17:00 [PATCH] new net device feature: shared-ipv6-cards Andreas Herrmann
2002-08-21 17:13 ` kuznet
2002-08-21 21:55 ` David S. Miller
-- strict thread matches above, loose matches on Subject: below --
2002-08-22 13:34 Andreas Herrmann
2002-08-21 15:28 Andreas Herrmann
2002-08-21 15:55 ` kuznet
2002-08-19 9:57 Andreas Herrmann
2002-08-19 8:20 Andreas Herrmann
2002-08-19 8:11 ` David S. Miller
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).