diff mbox

[U-Boot,2/2] net: increase maximum frame size to accomediate VLAN packets

Message ID 1460590682-28139-2-git-send-email-stefan@agner.ch
State Accepted
Commit 700877a62bfa88ef6e0267749db49f4dc63e2ea2
Delegated to: Joe Hershberger
Headers show

Commit Message

Stefan Agner April 13, 2016, 11:38 p.m. UTC
Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522
bytes long. Increase the default size used to allocate packet
storage by 4 bytes. While at it, let git care about history and
rewrite the comment to represent the situation today only.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---

 include/net.h | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

Comments

Stefan Agner April 13, 2016, 11:41 p.m. UTC | #1
Hi Tom,

Sorry, I accidentally didn't add the v2 in the Subject...

On 2016-04-13 16:38, Stefan Agner wrote:
...
>  /*
> - * Maximum packet size; used to allocate packet storage.
> - * TFTP packets can be 524 bytes + IP header + ethernet header.
> - * Lets be conservative, and go for 38 * 16.  (Must also be
> - * a multiple of 32 bytes).
> - */
> -/*
> - * AS.HARNOIS : Better to set PKTSIZE to maximum size because
> - * traffic type is not always controlled
> - * maximum packet size =  1518
> + * Maximum packet size; used to allocate packet storage. Use
> + * the maxium Ethernet frame size as specified by the Ethernet
> + * standard including the 802.1Q tag (VLAN tagging).
> + * maximum packet size =  1522
>   * maximum packet size and multiple of 32 bytes =  1536
>   */
> -#define PKTSIZE			1518
> +#define PKTSIZE			1522
>  #define PKTSIZE_ALIGN		1536
> -/*#define PKTSIZE		608*/

I rewrote the whole comment, as I felt it does not make sense to keep
history in the source file. Hope this is ok for you.

--
Stefan
Tom Rini April 16, 2016, 1:13 a.m. UTC | #2
On Wed, Apr 13, 2016 at 04:38:02PM -0700, Stefan Agner wrote:

> Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522
> bytes long. Increase the default size used to allocate packet
> storage by 4 bytes. While at it, let git care about history and
> rewrite the comment to represent the situation today only.
> 
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Reviewed-by: Tom Rini <trini@konsulko.com>
Joe Hershberger April 25, 2016, 9:44 p.m. UTC | #3
On Wed, Apr 13, 2016 at 6:38 PM, Stefan Agner <stefan@agner.ch> wrote:
> Ethernet packages with IEEE 802.1Q VLAN support may be up to 1522
> bytes long. Increase the default size used to allocate packet
> storage by 4 bytes. While at it, let git care about history and
> rewrite the comment to represent the situation today only.
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Joe Hershberger May 3, 2016, 8:17 p.m. UTC | #4
Hi Stefan,

https://patchwork.ozlabs.org/patch/610318/ was applied to u-boot-net.git.

Thanks!
-Joe
diff mbox

Patch

diff --git a/include/net.h b/include/net.h
index 1fb4194..05800c4 100644
--- a/include/net.h
+++ b/include/net.h
@@ -465,20 +465,14 @@  struct icmp_hdr {
 #define IP_ICMP_HDR_SIZE	(IP_HDR_SIZE + ICMP_HDR_SIZE)
 
 /*
- * Maximum packet size; used to allocate packet storage.
- * TFTP packets can be 524 bytes + IP header + ethernet header.
- * Lets be conservative, and go for 38 * 16.  (Must also be
- * a multiple of 32 bytes).
- */
-/*
- * AS.HARNOIS : Better to set PKTSIZE to maximum size because
- * traffic type is not always controlled
- * maximum packet size =  1518
+ * Maximum packet size; used to allocate packet storage. Use
+ * the maxium Ethernet frame size as specified by the Ethernet
+ * standard including the 802.1Q tag (VLAN tagging).
+ * maximum packet size =  1522
  * maximum packet size and multiple of 32 bytes =  1536
  */
-#define PKTSIZE			1518
+#define PKTSIZE			1522
 #define PKTSIZE_ALIGN		1536
-/*#define PKTSIZE		608*/
 
 /*
  * Maximum receive ring size; that is, the number of packets