* [PATCH v2.6.26] Fix frame size calculation when hardware VLAN acceleration is on
@ 2008-03-24 15:53 Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Only process completed frames Andy Fleming
0 siblings, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2008-03-24 15:53 UTC (permalink / raw)
To: jeff; +Cc: netdev, Dai Haruki, Andy Fleming
From: Dai Haruki <dai.haruki@freescale.com>
In gfar_change_mtu(), the frame size needs to be increased to account for the
extra 4 bytes VLAN adds to the ethernet header. However, it was being increased
by the length of the whole header (18 bytes), which is wrong.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/gianfar.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 718cf77..0ab4b26 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1185,7 +1185,7 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
int frame_size = new_mtu + ETH_HLEN;
if (priv->vlan_enable)
- frame_size += VLAN_ETH_HLEN;
+ frame_size += VLAN_HLEN;
if (gfar_uses_fcb(priv))
frame_size += GMAC_FCB_LEN;
--
1.5.4.23.gef5b9
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2.6.26] Only process completed frames
2008-03-24 15:53 [PATCH v2.6.26] Fix frame size calculation when hardware VLAN acceleration is on Andy Fleming
@ 2008-03-24 15:53 ` Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Fix Rx/Tx HW interrupt coalescing counter reset procedure Andy Fleming
0 siblings, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2008-03-24 15:53 UTC (permalink / raw)
To: jeff; +Cc: netdev, Andy Fleming, Dai Haruki
If the LAST bit is not set in the RxBD, it's possible we're processing an
incomplete frame, which is bad. While we're at it, add a constant for
the error bitmask, so the whole if-clause fits on one line, and is more
legible.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/gianfar.c | 4 +---
drivers/net/gianfar.h | 3 +++
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 0ab4b26..a59edf7 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1526,9 +1526,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
rmb();
skb = priv->rx_skbuff[priv->skb_currx];
- if (!(bdp->status &
- (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET
- | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {
+ if ((bdp->status & RXBD_LAST) && !(bdp->status & RXBD_ERR)) {
/* Increment the number of packets */
dev->stats.rx_packets++;
howmany++;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 46cd773..26eb6ab 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -340,6 +340,9 @@ extern const char gfar_driver_version[];
#define RXBD_OVERRUN 0x0002
#define RXBD_TRUNCATED 0x0001
#define RXBD_STATS 0x01ff
+#define RXBD_ERR (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET \
+ | RXBD_CRCERR | RXBD_OVERRUN \
+ | RXBD_TRUNCATED)
/* Rx FCB status field bits */
#define RXFCB_VLN 0x8000
--
1.5.4.23.gef5b9
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2.6.26] Fix Rx/Tx HW interrupt coalescing counter reset procedure.
2008-03-24 15:53 ` [PATCH v2.6.26] Only process completed frames Andy Fleming
@ 2008-03-24 15:53 ` Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Fix the data buffer stashing amount Andy Fleming
0 siblings, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2008-03-24 15:53 UTC (permalink / raw)
To: jeff; +Cc: netdev, Andy Fleming, Dai Haruki
- Fix Rx/Tx HW interrupt coalescing counter reset logic. Disabling is required before resetting the counter.
- Update the Default both Rx and Tx coalescing timer threshold. Formerly 4 is set which is equal to 1.5 frame at the line rate of 1GbE interface, and it doesn't match to the coalescing frame count which is set to 16. Threashold 21 is matched to frame count 16.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
---
drivers/net/gianfar.c | 18 +++++++++---------
drivers/net/gianfar.h | 4 ++--
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index a59edf7..601f93e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1299,11 +1299,11 @@ static irqreturn_t gfar_transmit(int irq, void *dev_id)
/* If we are coalescing the interrupts, reset the timer */
/* Otherwise, clear it */
- if (priv->txcoalescing)
+ if (likely(priv->txcoalescing)) {
+ gfar_write(&priv->regs->txic, 0);
gfar_write(&priv->regs->txic,
mk_ic_value(priv->txcount, priv->txtime));
- else
- gfar_write(&priv->regs->txic, 0);
+ }
spin_unlock(&priv->txlock);
@@ -1417,11 +1417,11 @@ irqreturn_t gfar_receive(int irq, void *dev_id)
/* If we are coalescing interrupts, update the timer */
/* Otherwise, clear it */
- if (priv->rxcoalescing)
+ if (likely(priv->rxcoalescing)) {
+ gfar_write(&priv->regs->rxic, 0);
gfar_write(&priv->regs->rxic,
mk_ic_value(priv->rxcount, priv->rxtime));
- else
- gfar_write(&priv->regs->rxic, 0);
+ }
spin_unlock_irqrestore(&priv->rxlock, flags);
#endif
@@ -1593,11 +1593,11 @@ static int gfar_poll(struct napi_struct *napi, int budget)
/* If we are coalescing interrupts, update the timer */
/* Otherwise, clear it */
- if (priv->rxcoalescing)
+ if (likely(priv->rxcoalescing)) {
+ gfar_write(&priv->regs->rxic, 0);
gfar_write(&priv->regs->rxic,
mk_ic_value(priv->rxcount, priv->rxtime));
- else
- gfar_write(&priv->regs->rxic, 0);
+ }
}
return howmany;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 26eb6ab..119019a 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -124,11 +124,11 @@ extern const char gfar_driver_version[];
#define DEFAULT_TX_COALESCE 1
#define DEFAULT_TXCOUNT 16
-#define DEFAULT_TXTIME 4
+#define DEFAULT_TXTIME 21
#define DEFAULT_RX_COALESCE 1
#define DEFAULT_RXCOUNT 16
-#define DEFAULT_RXTIME 4
+#define DEFAULT_RXTIME 21
#define TBIPA_VALUE 0x1f
#define MIIMCFG_INIT_VALUE 0x00000007
--
1.5.4.23.gef5b9
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2.6.26] Fix the data buffer stashing amount
2008-03-24 15:53 ` [PATCH v2.6.26] Fix Rx/Tx HW interrupt coalescing counter reset procedure Andy Fleming
@ 2008-03-24 15:53 ` Andy Fleming
2008-03-26 4:46 ` Jeff Garzik
0 siblings, 1 reply; 5+ messages in thread
From: Andy Fleming @ 2008-03-24 15:53 UTC (permalink / raw)
To: jeff; +Cc: netdev, Dai Haruki
From: Dai Haruki <dai.haruki@freescale.com>
- Buffer stashing parameter change to 96 from 64 in order to cover the Layer 4 header.
Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
---
drivers/net/gianfar.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 119019a..ea8671f 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -102,7 +102,7 @@ extern const char gfar_driver_version[];
#define DEFAULT_FIFO_TX_STARVE 0x40
#define DEFAULT_FIFO_TX_STARVE_OFF 0x80
#define DEFAULT_BD_STASH 1
-#define DEFAULT_STASH_LENGTH 64
+#define DEFAULT_STASH_LENGTH 96
#define DEFAULT_STASH_INDEX 0
/* The number of Exact Match registers */
--
1.5.4.23.gef5b9
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2.6.26] Fix the data buffer stashing amount
2008-03-24 15:53 ` [PATCH v2.6.26] Fix the data buffer stashing amount Andy Fleming
@ 2008-03-26 4:46 ` Jeff Garzik
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Garzik @ 2008-03-26 4:46 UTC (permalink / raw)
To: Andy Fleming; +Cc: netdev, Dai Haruki
Andy Fleming wrote:
> From: Dai Haruki <dai.haruki@freescale.com>
>
> - Buffer stashing parameter change to 96 from 64 in order to cover the Layer 4 header.
>
> Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
> ---
> drivers/net/gianfar.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
applied all four patches
Please include a "gianfar: " prefix or similar in your subject line.
After the bracketed info is stripped by automated tools, we are only
left with a vague "Fix the data buffer stashing amount" one-line
description of your change, with no clue as to what area of the kernel
this change applies to
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-26 4:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-24 15:53 [PATCH v2.6.26] Fix frame size calculation when hardware VLAN acceleration is on Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Only process completed frames Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Fix Rx/Tx HW interrupt coalescing counter reset procedure Andy Fleming
2008-03-24 15:53 ` [PATCH v2.6.26] Fix the data buffer stashing amount Andy Fleming
2008-03-26 4:46 ` Jeff Garzik
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).