Skip to contentSkip to conversation

VLAN patches

PATCH Applied Andersson Björn 7 participants 20 messages Sep 30, 2002 – Oct 12, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,
I hope you are the right receiver of 8021q-patches. We are running SuSe 8.0, i.e kernel 2.4.18.

- When addding several egress-mappings we get stuck in an eternal loop if they end up in the same hash-bucket, see vlan_dev.c.path.

- If we try to remove a vlan with VID 0, ifconfig stops working completly.
We fixed it with vlan.c.patch.

Signature · 4 lines
* Björn Andersson                   [email protected] *
* Ericsson Enterprise AB            NA/EBC/BEES/DNCC                *
* Nacka Strand                      tel: +46-8-422 3512             *
* 13 189 Stockholm, Sweden          fax: +46-8-422 1010             *
net/8021q/vlan.c renamed from net/8021q/vlan.c.orig +1 -1
@@ -207,7 +207,7 @@
 #endif
 
 	/* sanity check */
-	if ((vlan_id >= VLAN_VID_MASK) || (vlan_id <= 0))
+	if ((vlan_id >= VLAN_VID_MASK) || (vlan_id < 0))
 		return -EINVAL;
 
 	spin_lock_bh(&vlan_group_lock);
net/8021q/vlan_dev.c renamed from net/8021q/vlan_dev.c.orig +1 -0
@@ -570,6 +570,7 @@
 					dev_put(dev);
 					return 0;
 				}
+				mp = mp->next;
 			}
 
 			/* Create a new mapping then. */
#1 lore raw
Quoted 3 lines · Andersson Björn

Hi,
I hope you are the right receiver of 8021q-patches. We are running SuSe 8.0, i.e kernel 2.4.18.

NETDEV isn't right place. I resent your letter to:
[email protected]

(which is strictly posting-by-subscribers-only / others-via-moderator
list...)

Quoted 2 lines
Signature · 1 line
* Björn Andersson                   [email protected] *

/Matti Aarnio

#2 lore raw
Quoted 7 lines · Matti Aarnio
Quoted 3 lines · Andersson Björn

Hi,
I hope you are the right receiver of 8021q-patches. We are running SuSe 8.0, i.e kernel 2.4.18.

Quoted 5 lines

NETDEV isn't right place. I resent your letter to:
[email protected]

(which is strictly posting-by-subscribers-only / others-via-moderator
list...)

It is nice to get VLAN questions and patches to the vlan list, but I see no reason to restrict patches to that list. Dave is doing a lot of the VLAN patching and up-keep these days, and I'm not even sure he reads the vlan list....

So, I personally would be happy to have patches sent to the vlan list, and cc'd to netdev and/or lkml. Questions about using/configuring vlans should most likely remain on the vlan mailing list though...

Thanks,
Ben

Quoted 9 lines
Quoted 4 lines
Signature · 2 lines
-- 
* Björn Andersson                   [email protected] *

/Matti Aarnio

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#3 lore raw
In reply to Andersson Björn

Dave, please apply this patch if you haven't already, it seems correct to me.

Quoted 19 lines · Andersson Björn

Hi,
I hope you are the right receiver of 8021q-patches. We are running SuSe 8.0, i.e kernel 2.4.18.

- When addding several egress-mappings we get stuck in an eternal loop if they end up in the same hash-bucket, see vlan_dev.c.path.

------------------------------------------------------------------------

net/8021q/vlan_dev.c renamed from net/8021q/vlan_dev.c.orig +1 -0
@@ -570,6 +570,7 @@
 					dev_put(dev);
 					return 0;
 				}
+				mp = mp->next;
 			}
 
 			/* Create a new mapping then. */
Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#4 lore raw

From: Ben Greear <[email protected]>
Date: Sat, 05 Oct 2002 12:23:36 -0700

Dave, please apply this patch if you haven't already, it seems correct to me.

Applied to both 2.4.x and 2.5.x sources, thanks.

#5 lore raw
In reply to Andersson Björn

This patch looks good too, though the (vlan_id < 0) test is redundant since vlan_id is an unsigned number. For clarity of code, I wouldn't mind if it stayed in though.

Quoted 24 lines · Andersson Björn

Hi,
I hope you are the right receiver of 8021q-patches. We are running SuSe 8.0, i.e kernel 2.4.18.

- If we try to remove a vlan with VID 0, ifconfig stops working completly.
We fixed it with vlan.c.patch.

------------------------------------------------------------------------

net/8021q/vlan.c renamed from net/8021q/vlan.c.orig +1 -1
@@ -207,7 +207,7 @@
 #endif
 
 	/* sanity check */
-	if ((vlan_id >= VLAN_VID_MASK) || (vlan_id <= 0))
+	if ((vlan_id >= VLAN_VID_MASK) || (vlan_id < 0))
 		return -EINVAL;
 
 	spin_lock_bh(&vlan_group_lock);
Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#6 lore raw

From: Ben Greear <[email protected]>
Date: Sat, 05 Oct 2002 12:27:15 -0700

This patch looks good too, though the (vlan_id < 0) test is redundant since vlan_id is an unsigned number. For clarity of code, I wouldn't mind if it stayed in though.

VLAN ID zero is illegal. You should not use ifconfig with a VID of zero.

#7 lore raw
Quoted 10 lines · David S. Miller

From: Ben Greear <[email protected]>
Date: Sat, 05 Oct 2002 12:27:15 -0700

This patch looks good too, though the (vlan_id < 0) test is redundant since vlan_id is an unsigned number. For clarity of code, I wouldn't mind if it stayed in though.

VLAN ID zero is illegal. You should not use ifconfig with a VID of zero.

As someone mentioned, vlan of 0 may be used to do a priority-only type of VLAN. I don't know how much this makes sense though...

If we do decide to restrict it, the right place to restrict is in the creation clause, not the deletion code, as exists now.

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#8 lore raw

From: Ben Greear <[email protected]>
Date: Sat, 05 Oct 2002 21:31:45 -0700

As someone mentioned, vlan of 0 may be used to do a priority-only type of VLAN. I don't know how much this makes sense though...

If we do decide to restrict it, the right place to restrict is in the creation clause, not the deletion code, as exists now.

I think we should, please submit a patch which denies it on both config and delete.

My most recent reading of 802.1q made it very clear that VID 0 is special and should not be assigned to any interface.

#9 lore raw
Quoted 3 lines · David S. Miller

I think we should, please submit a patch which denies it on both config and delete.

A packet with VLANid 0 and an 802.1p tag > 0 is legal. I think its known as a "priority tagged" packet (not 100% sure about the term). Therefore VLANid 0 MUST be accepted and ability to send it should be there.
BTW, what about VLANid 0xFFF?

cheers,
jamal

#10 lore raw

From: jamal <[email protected]>
Date: Sun, 6 Oct 2002 18:47:50 -0400 (EDT)

A packet with VLANid 0 and an 802.1p tag > 0 is legal. I think its known as a "priority tagged" packet (not 100% sure about the term). Therefore VLANid 0 MUST be accepted and ability to send it should be there.

Great, I stand corrected, please send me a patch which therefore accepts VID 0 on create and destroy.

BTW, what about VLANid 0xFFF?

Your guess is as good as mine ;-)

#11 lore raw
Quoted 10 lines · David S. Miller

From: jamal <[email protected]>
Date: Sun, 6 Oct 2002 18:47:50 -0400 (EDT)

A packet with VLANid 0 and an 802.1p tag > 0 is legal. I think its known as a "priority tagged" packet (not 100% sure about the term). Therefore VLANid 0 MUST be accepted and ability to send it should be there.

Great, I stand corrected, please send me a patch which therefore accepts VID 0 on create and destroy.

It already accepts on create, you just need to add the patch that was already sent to allow for delete.

Quoted 2 lines
   BTW, what about VLANid 0xFFF?

I think it is reserved, but my spec is 3 years old, and I don't know where it is right now, so whatever it is now, let's not touch it :)

Quoted 3 lines

Your guess is as good as mine ;-)

Signature · 3 lines
Ben Greear <[email protected]>       <Ben_Greear AT excite.com>
President of Candela Technologies Inc      http://www.candelatech.com
ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear
#12 lore raw

From: Ben Greear <[email protected]>
Date: Sun, 06 Oct 2002 20:35:38 -0700

It already accepts on create, you just need to add the patch that was already sent to allow for delete.

Done.

#13 lore raw
In reply to Ben Greear

According to 802.1Q (which is BTW available freely from IEEE's site) 0xFFF VID is "Reserved for implementation use. This VID value shall not be configured as a PVID, configured in any Filtering Database entry, used in any Management operation, or transmitted in a tag header.".

Regarding the 0 VID it is indeed used for priority-only frames. Shouldn't it be supported by alowing the user to configure a priority map for the ethernet device (rather than creating another user-visible device?

Quoted 17 lines · Ben Greear
Quoted 8 lines · David S. Miller

From: jamal
A packet with VLANid 0 and an 802.1p tag > 0 is legal. I
think its known as a "priority tagged" packet (not 100% sure about the term). Therefore VLANid 0 MUST be accepted and ability to send it should be there.

Great, I stand corrected, please send me a patch which therefore accepts VID 0 on create and destroy.

It already accepts on create, you just need to add the patch that was already sent to allow for delete.

Quoted 1 line
   BTW, what about VLANid 0xFFF?

I think it is reserved, but my spec is 3 years old, and I don't know where it is right now, so whatever it is now, let's not touch it :)

Signature · 6 lines
Eran Mann
Senior Software Engineer
MRV International
Tel: 972-4-9936297
Fax: 972-4-9890430
www.mrv.com
#14 lore raw

From: Eran Mann <[email protected]>
Date: Mon, 07 Oct 2002 09:09:38 +0200

Regarding the 0 VID it is indeed used for priority-only frames. Shouldn't it be supported by alowing the user to configure a priority map for the ethernet device (rather than creating another user-visible device?

I don't have any opinion about this, besides the fact that if the device based interface we have now can do whatever the user wants we should not add a new configuration mechanism just to provide some alias that effectively accomplishes the same task.

#15 lore raw
Quoted 7 lines · David S. Miller

From: Eran Mann

Regarding the 0 VID it is indeed used for priority-only frames. Shouldn't it be supported by alowing the user to configure a priority map for the ethernet device (rather than creating another user-visible device?

Quoted 5 lines

I don't have any opinion about this, besides the fact that if the device based interface we have now can do whatever the user wants we should not add a new configuration mechanism just to provide some alias that effectively accomplishes the same task.

I was thinking more in the line of:

# vconfig set_egress_map eth0 XX YY
etc...
(once CONFIG_VLAN_8021Q=y|m ofcourse)
Signature · 6 lines
Eran Mann
Senior Software Engineer
MRV International
Tel: 972-4-9936297
Fax: 972-4-9890430
www.mrv.com
#16 lore raw
In reply to Eran Mann
Quoted 5 lines · Eran Mann

Regarding the 0 VID it is indeed used for priority-only frames. Shouldn't it be supported by alowing the user to configure a priority map for the ethernet device (rather than creating another user-visible device?

That or you complain and drop the packet when someone sends; btw also VLANid > 0 and p tag 0 is legal - i guess that is the default for linux.
On a side not:
I never liked Bens patches that much compared to the other VLAN imp. -- would have prefered a marriage of the two.

cheers,
jamal

#17 lore raw

From: jamal <[email protected]>
Date: Mon, 7 Oct 2002 08:05:07 -0400 (EDT)

I never liked Bens patches that much compared to the other VLAN imp. -- would have prefered a marriage of the two.

There is a long thread deep in the archives for these lists saying why Ben's code went it.

Please, let's not duplicate that conversation ok?