[PATCH 2/2] net: ll_temac: fix checksum offload logic

Previous thread: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0 by Arnaud Ebalard on Wednesday, May 26, 2010 - 10:01 am. (15 messages)

Next thread: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used by John Linn on Wednesday, May 26, 2010 - 10:29 am. (6 messages)
From: John Linn
Date: Wednesday, May 26, 2010 - 10:29 am

The current checksum offload code does not work and this corrects
that functionality. It also updates the interrupt coallescing
initialization so than there are fewer interrupts and performance
is increased.

Signed-off-by: Brian Hill <brian.hill@xilinx.com>
Signed-off-by: John Linn <john.linn@xilinx.com>
---
 drivers/net/ll_temac.h      |    5 +++
 drivers/net/ll_temac_main.c |   82 ++++++++++++++++++++++++++++++------------
 2 files changed, 63 insertions(+), 24 deletions(-)

diff --git a/drivers/net/ll_temac.h b/drivers/net/ll_temac.h
index c033584..2e0c9cc 100644
--- a/drivers/net/ll_temac.h
+++ b/drivers/net/ll_temac.h
@@ -295,6 +295,10 @@ This option defaults to enabled (set) */
 
 #define MULTICAST_CAM_TABLE_NUM 4
 
+/* TEMAC Synthesis features */
+#define TEMAC_FEATURE_RX_CSUM  (1 << 0)
+#define TEMAC_FEATURE_TX_CSUM  (1 << 1)
+
 /* TX/RX CURDESC_PTR points to first descriptor */
 /* TX/RX TAILDESC_PTR points to last descriptor in linked list */
 
@@ -353,6 +357,7 @@ struct temac_local {
 	struct mutex indirect_mutex;
 	u32 options;			/* Current options word */
 	int last_link;
+	unsigned temac_features;
 
 	/* Buffer descriptors */
 	struct cdmac_bd *tx_bd_v;
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
index 0615737..52dcc84 100644
--- a/drivers/net/ll_temac_main.c
+++ b/drivers/net/ll_temac_main.c
@@ -245,7 +245,7 @@ static int temac_dma_bd_init(struct net_device *ndev)
 					  CHNL_CTRL_IRQ_COAL_EN);
 	/* 0x10220483 */
 	/* 0x00100483 */
-	lp->dma_out(lp, RX_CHNL_CTRL, 0xff010000 |
+	lp->dma_out(lp, RX_CHNL_CTRL, 0xff070000 |
 					  CHNL_CTRL_IRQ_EN |
 					  CHNL_CTRL_IRQ_DLY_EN |
 					  CHNL_CTRL_IRQ_COAL_EN |
@@ -574,6 +574,10 @@ static void temac_start_xmit_done(struct net_device *ndev)
 		if (cur_p->app4)
 			dev_kfree_skb_irq((struct sk_buff *)cur_p->app4);
 		cur_p->app0 = 0;
+		cur_p->app1 = 0;
+		cur_p->app2 = 0;
+		cur_p->app3 = 0;
+		cur_p->app4 = 0;
 
 		ndev->stats.tx_packets++;
 ...
From: David Miller
Date: Wednesday, May 26, 2010 - 8:45 pm

aFrom: John Linn <john.linn@xilinx.com>

Applied, although I changed "temac_features" to be explicitly
"unsigned int" instead of just plain "unsigned"

--

From: John Linn
Date: Thursday, May 27, 2010 - 6:26 am

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.


--

Previous thread: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0 by Arnaud Ebalard on Wednesday, May 26, 2010 - 10:01 am. (15 messages)

Next thread: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used by John Linn on Wednesday, May 26, 2010 - 10:29 am. (6 messages)