Skip to contentSkip to conversation

ucc_geth: Add 8 bytes to max TX frame for VLANs

PATCH In review Andy Fleming 4 participants 4 messages Sep 16, 2008 – Nov 11, 2008

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

PATCH 1/1 ucc_geth: Add 8 bytes to max TX frame for VLANs

From: Joakim Tjernlund <[email protected]>

Creating a VLAN interface on top of ucc_geth adds 4 bytes to the frame and the HW controller is not prepared to TX a frame bigger than 1518 bytes which is 4 bytes too small for a full VLAN frame. Also add 4 extra bytes for future expansion.

---
 drivers/net/ucc_geth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ucc_geth.c +3 -3
index 8f944e5..8fed4bb 100644
@@ -113,10 +113,10 @@ static struct ucc_geth_info ugeth_primary_info = {
 	.maxGroupAddrInHash = 4,
 	.maxIndAddrInHash = 4,
 	.prel = 7,
-	.maxFrameLength = 1518,
+	.maxFrameLength = 1518+8, /* Add 4 bytes for VLAN tags and 4 extra bytes */
 	.minFrameLength = 64,
-	.maxD1Length = 1520,
-	.maxD2Length = 1520,
+	.maxD1Length = 1520+8,
+	.maxD2Length = 1520+8,
 	.vlantype = 0x8100,
 	.ecamptr = ((uint32_t) NULL),
 	.eventRegMask = UCCE_OTHER,
Signature · 1 line
1.5.4.GIT
#1 lore raw
Quoted 19 lines · Andy Fleming

From: Joakim Tjernlund <[email protected]>

Creating a VLAN interface on top of ucc_geth adds 4 bytes to the frame and the HW controller is not prepared to TX a frame bigger than 1518 bytes which is 4 bytes too small for a full VLAN frame. Also add 4 extra bytes for future expansion.

---
 drivers/net/ucc_geth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ucc_geth.c +0 -0
index 8f944e5..8fed4bb 100644
@@ -113,10 +113,10 @@ static struct ucc_geth_info ugeth_primary_info = {
 	.maxGroupAddrInHash = 4,

drivers/net/ucc_geth.c static struct ucc_geth_info ugeth_primary_info = { · line 120

Quoted 10 lines
drivers/net/ucc_geth.c +3 -3
 	.maxIndAddrInHash = 4,
 	.prel = 7,
-	.maxFrameLength = 1518,
+	.maxFrameLength = 1518+8, /* Add 4 bytes for VLAN tags and 4 extra bytes */
 	.minFrameLength = 64,
-	.maxD1Length = 1520,
-	.maxD2Length = 1520,
+	.maxD1Length = 1520+8,
+	.maxD2Length = 1520+8,
 	.vlantype = 0x8100,

Is this still needed?

I found this buried in my inbox.

If so, please resend with the "+8" converted into a named constant. Hardcoding lengths like this without named constants (or comments, on the other lines) tends to be an error-prone practice.

Jeff

#2 lore raw
Quoted 33 lines · Jeff Garzik
Quoted 19 lines · Andy Fleming

From: Joakim Tjernlund <[email protected]>

Creating a VLAN interface on top of ucc_geth adds 4 bytes to the frame and the HW controller is not prepared to TX a frame bigger than 1518 bytes which is 4 bytes too small for a full VLAN frame. Also add 4 extra bytes for future expansion.

---
 drivers/net/ucc_geth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ucc_geth.c +0 -0
index 8f944e5..8fed4bb 100644
@@ -113,10 +113,10 @@ static struct ucc_geth_info ugeth_primary_info = {
 	.maxGroupAddrInHash = 4,

drivers/net/ucc_geth.c static struct ucc_geth_info ugeth_primary_info = { · line 120

Quoted 10 lines
drivers/net/ucc_geth.c +3 -3
 	.maxIndAddrInHash = 4,
 	.prel = 7,
-	.maxFrameLength = 1518,
+	.maxFrameLength = 1518+8, /* Add 4 bytes for VLAN tags and 4 extra bytes */
 	.minFrameLength = 64,
-	.maxD1Length = 1520,
-	.maxD2Length = 1520,
+	.maxD1Length = 1520+8,
+	.maxD2Length = 1520+8,
 	.vlantype = 0x8100,

Is this still needed?

Quoted 5 lines

I found this buried in my inbox.

If so, please resend with the "+8" converted into a named constant. Hardcoding lengths like this without named constants (or comments, on the other lines) tends to be an error-prone practice.

Yes, it is. I do recall the maintainer had some comments though. Secondly, I think it should be changed to 8 extra bytes so you can fit VLAN+pppoe=4+8 bytes. Possibly it could
be configuarble at complile time.

Andy, you think you can work out the details with the maintainer? I am much to busy ATM.

Jocke

#3 lore raw
Quoted 40 lines · Joakim Tjernlund
Quoted 33 lines · Jeff Garzik
Quoted 19 lines · Andy Fleming

From: Joakim Tjernlund <[email protected]>

Creating a VLAN interface on top of ucc_geth adds 4 bytes to the frame and the HW controller is not prepared to TX a frame bigger than 1518 bytes which is 4 bytes too small for a full VLAN frame. Also add 4 extra bytes for future expansion.

---
 drivers/net/ucc_geth.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ucc_geth.c +0 -0
index 8f944e5..8fed4bb 100644
@@ -113,10 +113,10 @@ static struct ucc_geth_info ugeth_primary_info = {
    .maxGroupAddrInHash = 4,

drivers/net/ucc_geth.c static struct ucc_geth_info ugeth_primary_info = { · line 120

Quoted 10 lines
drivers/net/ucc_geth.c +3 -3
    .maxIndAddrInHash = 4,
    .prel = 7,
-   .maxFrameLength = 1518,
+   .maxFrameLength = 1518+8, /* Add 4 bytes for VLAN tags and 4 extra bytes */
    .minFrameLength = 64,
-   .maxD1Length = 1520,
-   .maxD2Length = 1520,
+   .maxD1Length = 1520+8,
+   .maxD2Length = 1520+8,
    .vlantype = 0x8100,

Is this still needed?

Quoted 5 lines

I found this buried in my inbox.

If so, please resend with the "+8" converted into a named constant. Hardcoding lengths like this without named constants (or comments, on the other lines) tends to be an error-prone practice.

Quoted 7 lines

Yes, it is. I do recall the maintainer had some comments though. Secondly, I think it should be changed to 8 extra bytes so you can fit VLAN+pppoe=4+8 bytes. Possibly it could
be configuarble at complile time.

Andy, you think you can work out the details with the maintainer? I am much to busy ATM.

Hmm... me, too. I'm not really familiar with this driver. I suspect that all of the stuff in that structure should be yanked out, and done more sensibly, but I don't have time to do it. I'll ping him about it.

Andy