From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp151.iad.emailsrvr.com (smtp151.iad.emailsrvr.com [207.97.245.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by huchra.bufferbloat.net (Postfix) with ESMTPS id D74BB202223 for ; Fri, 22 Jun 2012 13:11:16 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp45.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 8550A9038A; Fri, 22 Jun 2012 16:11:15 -0400 (EDT) X-Virus-Scanned: OK Received: from legacy11.wa-web.iad1a (legacy11.wa-web.iad1a.rsapps.net [192.168.4.97]) by smtp45.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 6C7EF902A4; Fri, 22 Jun 2012 16:11:15 -0400 (EDT) Received: from reed.com (localhost.localdomain [127.0.0.1]) by legacy11.wa-web.iad1a (Postfix) with ESMTP id 5703A27B8001; Fri, 22 Jun 2012 16:11:15 -0400 (EDT) Received: by apps.rackspace.com (Authenticated sender: dpreed@reed.com, from: dpreed@reed.com) with HTTP; Fri, 22 Jun 2012 16:11:15 -0400 (EDT) Date: Fri, 22 Jun 2012 16:11:15 -0400 (EDT) From: dpreed@reed.com To: "Robert Bradley" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_20120622161115000000_43574" Importance: Normal X-Priority: 3 (Normal) X-Type: html In-Reply-To: References: Message-ID: <1340395875.353911244@apps.rackspace.com> X-Mailer: webmail7.0 Cc: cerowrt-devel@lists.bufferbloat.net Subject: Re: [Cerowrt-devel] Fwd: [PATCH] ag71xx: Added support for baby-jumbo packets. X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jun 2012 20:11:17 -0000 ------=_20120622161115000000_43574 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =0AGood step. Why not allow 9K byte jumbos when one's packets traverse a p= ath that is internal to the local area, and all the 1 GigE links support 9K= ?=0A =0A-----Original Message-----=0AFrom: "Robert Bradley" =0ASent: Friday, June 22, 2012 3:12pm=0ATo: cerowrt-devel@lists= .bufferbloat.net=0ASubject: [Cerowrt-devel] Fwd: [PATCH] ag71xx: Added supp= ort for baby-jumbo packets.=0A=0A=0A=0AFor those of you not following the o= penwrt-devel mailing list, this is=0Aan updated version of the baby-jumbo p= atch I posted previously in=0Aresponse to Alexander's post. This version i= s slightly less=0Aconservative about extended frame lengths (up to 1518 oct= ets), but=0Aremoves the awkward magic constant. The maximum MTU is now cal= culated=0Aby subtracting header lengths from AG71XX_TX_MTU_LEN. I also use= this=0Ato calculate the maximum received packet size. Defining=0AAG71XX_M= AX_DATA_LEN as 1500 (or ETH_DATA_LEN) restores the original=0Abehaviour.=0A= =0A=0A---------- Forwarded message ----------=0AFrom: Robert Bradley =0ADate: 22 June 2012 13:50=0ASubject: [PATCH] ag71xx:= Added support for baby-jumbo packets.=0ATo: openwrt-devel@lists.openwrt.or= g=0A=0A=0ARFC 4638 support means that a full 1500-octet frame can be transm= itted=0Athrough a PPPoE tunnel. For this to work, the network card must su= pport=0Ababy-jumbo frames of 1508 octets plus headers. This patch enables = the use=0Aof MTUs up to 1518 octets (derived from the existing AG71XX_TX_MT= U_LEN=0Avalue by subtracting header sizes).=0A=0AThe default MTU size is un= changed; if large frames are desired, ifconfig=0Amust be used to set the ne= w MTU.=0A=0ASigned-off-by: Robert Bradley =0A---= =0A .../files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h | 17 +++++++++++= +++++-=0A .../drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c | 18 +++++= ++++++++++++-=0A 2 files changed, 33 insertions(+), 2 deletions(-)=0A=0Adif= f --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag7= 1xx.h=0Ab/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag7= 1xx.h=0Aindex b9d95ad..7f77a59 100644=0A--- a/target/linux/ar71xx/files/dri= vers/net/ethernet/atheros/ag71xx/ag71xx.h=0A+++ b/target/linux/ar71xx/files= /drivers/net/ethernet/atheros/ag71xx/ag71xx.h=0A@@ -51,8 +51,23 @@=0A #defi= ne AG71XX_INT_INIT (AG71XX_INT_ERR | AG71XX_INT_POLL)=0A=0A #define = AG71XX_TX_MTU_LEN 1540=0A+/*=0A+ * AG71XX_MAX_DATA_LEN equals the maxi= mum possible MTU that a frame of length=0A+ * AG71XX_TX_MTU_LEN can have. = This may be larger than ETH_DATA_LEN! This=0A+ * define is necessary for b= aby jumbo packet support (as per RFC 4638).=0A+ *=0A+ * Redefining this as = ETH_DATA_LEN restores the 1500-octet MTU limit.=0A+ */=0A+#define AG71XX_MA= X_DATA_LEN \=0A+ (AG71XX_TX_MTU_LEN - (ETH_FCS_LEN + VLAN_HLEN + E= TH_HLEN))=0A+/*=0A+ * Define AG71XX_RX_PKT_SIZE using AG71XX_MAX_DATA_LEN += ETH_HLEN rather than=0A+ * ETH_FRAME_LEN so that baby jumbo frames can be = used safely. This definition=0A+ * means that setting AG71XX_MAX_DATA_LEN = to ETH_DATA_LEN restores the old=0A+ * values, which are safe for standard = frames.=0A+ */=0A #define AG71XX_RX_PKT_SIZE \=0A- (ETH_FRAME_LEN= + ETH_FCS_LEN + VLAN_HLEN)=0A+ (AG71XX_MAX_DATA_LEN + ETH_HLEN + ETH= _FCS_LEN + VLAN_HLEN)=0A #define AG71XX_RX_BUF_SIZE (AG71XX_RX_PKT_SIZE + N= ET_SKB_PAD + NET_IP_ALIGN)=0A=0A #define AG71XX_TX_RING_SIZE_DEFAULT 64= =0Adiff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71= xx/ag71xx_main.c=0Ab/target/linux/ar71xx/files/drivers/net/ethernet/atheros= /ag71xx/ag71xx_main.c=0Aindex fb99d27..d3e850b 100644=0A--- a/target/linux/= ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c=0A+++ b/targ= et/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c=0A@= @ -1042,13 +1042,29 @@ static void ag71xx_netpoll(struct net_device *dev)= =0A }=0A #endif=0A=0A+/*=0A+ * ag71xx_change_mtu: set interface MTU.=0A+ * = A modified eth_change_mtu, changing the upper limit from ETH_DATA_LEN to=0A= + * AG71XX_MAX_DATA_LEN. This means that baby jumbo packets may be used by= =0A+ * PPPoE users, assuming that AG71XX_MAX_DATA_LEN > ETH_DATA_LEN.=0A+ *= =0A+ * Returns 0 on success, -EINVAL otherwise.=0A+ */=0A+static int ag71xx= _change_mtu(struct net_device *dev, int new_mtu)=0A+{=0A+ if (new_mtu= < 68 || new_mtu > AG71XX_MAX_DATA_LEN)=0A+ return -E= INVAL;=0A+ dev->mtu =3D new_mtu;=0A+ return 0;=0A+}=0A+=0A stat= ic const struct net_device_ops ag71xx_netdev_ops =3D {=0A .ndo_open = =3D ag71xx_open,=0A .ndo_stop =3D ag71xx_stop,=0A .ndo= _start_xmit =3D ag71xx_hard_start_xmit,=0A .ndo_do_ioctl = =3D ag71xx_do_ioctl,=0A .ndo_tx_timeout =3D ag71xx_tx_timeout,=0A- = .ndo_change_mtu =3D eth_change_mtu,=0A+ .ndo_change_mtu= =3D ag71xx_change_mtu,=0A .ndo_set_mac_address =3D eth_mac_addr= ,=0A .ndo_validate_addr =3D eth_validate_addr,=0A #ifdef CONFIG_NET_PO= LL_CONTROLLER=0A--=0ARobert Bradley=0A=0A=0A-- =0ARobert Bradley=0A________= _______________________________________=0ACerowrt-devel mailing list=0ACero= wrt-devel@lists.bufferbloat.net=0Ahttps://lists.bufferbloat.net/listinfo/ce= rowrt-devel ------=_20120622161115000000_43574 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Good step.=   Why not allow 9K byte jumbos when one's packets traverse a path that= is internal to the local area, and all the 1 GigE links support 9K?

=0A=

 

=0A

-----Original Message-----
From: "Robert Bradley" <robert.bradl= ey1@gmail.com>
Sent: Friday, June 22, 2012 3:12pm
To: cerowrt-= devel@lists.bufferbloat.net
Subject: [Cerowrt-devel] Fwd: [PATCH] ag71= xx: Added support for baby-jumbo packets.

=0A
=0A

For those of you not = following the openwrt-devel mailing list, this is
an updated version o= f the baby-jumbo patch I posted previously in
response to Alexander's = post. This version is slightly less
conservative about extended frame= lengths (up to 1518 octets), but
removes the awkward magic constant. = The maximum MTU is now calculated
by subtracting header lengths from = AG71XX_TX_MTU_LEN. I also use this
to calculate the maximum received = packet size. Defining
AG71XX_MAX_DATA_LEN as 1500 (or ETH_DATA_LEN) r= estores the original
behaviour.


---------- Forwarded = message ----------
From: Robert Bradley <robert.bradley1@gmail.com&= gt;
Date: 22 June 2012 13:50
Subject: [PATCH] ag71xx: Added suppo= rt for baby-jumbo packets.
To: openwrt-devel@lists.openwrt.org

RFC 4638 support means that a full 1500-octet frame can be transm= itted
through a PPPoE tunnel.  For this to work, the network card= must support
baby-jumbo frames of 1508 octets plus headers.  Thi= s patch enables the use
of MTUs up to 1518 octets (derived from the ex= isting AG71XX_TX_MTU_LEN
value by subtracting header sizes).

The default MTU size is unchanged; if large frames are desired, ifconfig<= br />must be used to set the new MTU.

Signed-off-by: Robert Brad= ley <robert.bradley1@gmail.com>
---
.../files/drivers/net/= ethernet/atheros/ag71xx/ag71xx.h | 17 ++++++++++++++++-
.../drivers/n= et/ethernet/atheros/ag71xx/ag71xx_main.c  | 18 +++++++++++++++++-
2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a= /target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h<= br />index b9d95ad..7f77a59 100644
--- a/target/linux/ar71xx/files/dri= vers/net/ethernet/atheros/ag71xx/ag71xx.h
+++ b/target/linux/ar71xx/fi= les/drivers/net/ethernet/atheros/ag71xx/ag71xx.h
@@ -51,8 +51,23 @@ #define AG71XX_INT_INIT        (AG71XX_INT_ERR | AG= 71XX_INT_POLL)

#define AG71XX_TX_MTU_LEN      15= 40
+/*
+ * AG71XX_MAX_DATA_LEN equals the maximum possible MTU th= at a frame of length
+ * AG71XX_TX_MTU_LEN can have.  This may be= larger than ETH_DATA_LEN!  This
+ * define is necessary for baby= jumbo packet support (as per RFC 4638).
+ *
+ * Redefining this = as ETH_DATA_LEN restores the 1500-octet MTU limit.
+ */
+#define = AG71XX_MAX_DATA_LEN    \
+       (AG71XX_TX_M= TU_LEN - (ETH_FCS_LEN + VLAN_HLEN + ETH_HLEN))
+/*
+ * Define AG7= 1XX_RX_PKT_SIZE using AG71XX_MAX_DATA_LEN + ETH_HLEN rather than
+ * E= TH_FRAME_LEN so that baby jumbo frames can be used safely.  This defin= ition
+ * means that setting AG71XX_MAX_DATA_LEN to ETH_DATA_LEN resto= res the old
+ * values, which are safe for standard frames.
+ */<= br /> #define AG71XX_RX_PKT_SIZE     \
-      = ; (ETH_FRAME_LEN + ETH_FCS_LEN + VLAN_HLEN)
+       (AG= 71XX_MAX_DATA_LEN + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)
#define AG71X= X_RX_BUF_SIZE (AG71XX_RX_PKT_SIZE + NET_SKB_PAD + NET_IP_ALIGN)

= #define AG71XX_TX_RING_SIZE_DEFAULT    64
diff --git a/targ= et/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ma= in.c
index fb99d27..d3e850b 100644
--- a/target/linux/ar71xx/file= s/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux= /ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -10= 42,13 +1042,29 @@ static void ag71xx_netpoll(struct net_device *dev)
= }
#endif

+/*
+ * ag71xx_change_mtu: set interface MTU= .
+ * A modified eth_change_mtu, changing the upper limit from ETH_DAT= A_LEN to
+ * AG71XX_MAX_DATA_LEN.  This means that baby jumbo pac= kets may be used by
+ * PPPoE users, assuming that AG71XX_MAX_DATA_LEN= > ETH_DATA_LEN.
+ *
+ * Returns 0 on success, -EINVAL otherwi= se.
+ */
+static int ag71xx_change_mtu(struct net_device *dev, in= t new_mtu)
+{
+       if (new_mtu < 68 || new_m= tu > AG71XX_MAX_DATA_LEN)
+           &nbs= p;           return -EINVAL;
+     =   dev->mtu =3D new_mtu;
+       return 0;
= +}
+
static const struct net_device_ops ag71xx_netdev_ops =3D {<= br /> .ndo_open               =3D ag71xx= _open,
.ndo_stop               =3D= ag71xx_stop,
.ndo_start_xmit         =3D ag71xx_= hard_start_xmit,
.ndo_do_ioctl           =3D= ag71xx_do_ioctl,
.ndo_tx_timeout         =3D ag7= 1xx_tx_timeout,
-       .ndo_change_mtu     &= nbsp;   =3D eth_change_mtu,
+       .ndo_change_mt= u         =3D ag71xx_change_mtu,
.ndo_set_mac_add= ress    =3D eth_mac_addr,
.ndo_validate_addr     =  =3D eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
-= -
Robert Bradley


--
Robert Bradley
_______= ________________________________________
Cerowrt-devel mailing listCerowrt-devel@lists.bufferbloat.net
https://lists.bufferbloat.net/l= istinfo/cerowrt-devel

=0A
------=_20120622161115000000_43574--