linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size
@ 2010-06-06 12:28 Saeed Bishara
  2010-06-06 12:28 ` [PATCH 2/2] set packet size limit for the mv643xx csum offloading Saeed Bishara
  2010-06-08 17:08 ` [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Lennert Buytenhek
  0 siblings, 2 replies; 26+ messages in thread
From: Saeed Bishara @ 2010-06-06 12:28 UTC (permalink / raw)
  To: linux-arm-kernel

Some controllers (KW, Dove) limits the TX IP/layer4 checksum offloading to a max size.

Signed-off-by: Saeed Bishara <saeed@marvell.com>
---
 drivers/net/mv643xx_eth.c   |   10 ++++++++++
 include/linux/mv643xx_eth.h |    4 ++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index e345ec8..79243dd 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -289,6 +289,7 @@ struct mv643xx_eth_shared_private {
 	unsigned int t_clk;
 	int extended_rx_coal_limit;
 	int tx_bw_control;
+	int tx_csum_limit;
 };
 
 #define TX_BW_CONTROL_ABSENT		0
@@ -2468,6 +2469,14 @@ static int mv643xx_eth_change_mtu(struct net_device *dev, int new_mtu)
 	mv643xx_eth_recalc_skb_size(mp);
 	tx_set_rate(mp, 1000000000, 16777216);
 
+	if (mp->shared->tx_csum_limit && dev->mtu > mp->shared->tx_csum_limit) {
+		dev->features &= ~NETIF_F_IP_CSUM;
+		dev->vlan_features &= ~NETIF_F_IP_CSUM;
+	} else {
+		dev->features |= NETIF_F_IP_CSUM;
+		dev->vlan_features |= NETIF_F_IP_CSUM;
+	}
+
 	if (!netif_running(dev))
 		return 0;
 
@@ -2666,6 +2675,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
 	 * Detect hardware parameters.
 	 */
 	msp->t_clk = (pd != NULL && pd->t_clk != 0) ? pd->t_clk : 133000000;
+	msp->tx_csum_limit = pd->tx_csum_limit;
 	infer_hw_params(msp);
 
 	platform_set_drvdata(pdev, msp);
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index cbbbe9b..7402718 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -19,6 +19,10 @@ struct mv643xx_eth_shared_platform_data {
 	struct mbus_dram_target_info	*dram;
 	struct platform_device	*shared_smi;
 	unsigned int		t_clk;
+	/*
+	 * Max packet size for Tx IP/Layer 4 checksum (0 -> no limit)
+	 */
+	int			tx_csum_limit;
 };
 
 #define MV643XX_ETH_PHY_ADDR_DEFAULT	0
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2010-09-01  7:49 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-06 12:28 [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Saeed Bishara
2010-06-06 12:28 ` [PATCH 2/2] set packet size limit for the mv643xx csum offloading Saeed Bishara
2010-06-08 17:09   ` Lennert Buytenhek
2010-07-15 20:26   ` Martin Michlmayr
2010-07-16  6:08     ` Lennert Buytenhek
2010-08-31 11:17       ` saeed bishara
2010-08-31 13:13       ` saeed bishara
2010-08-31 16:48         ` Lennert Buytenhek
2010-09-01  7:42           ` saeed bishara
2010-09-01  7:49             ` Lennert Buytenhek
2010-08-13 22:28   ` Maxime Bizon
2010-08-31 11:17     ` saeed bishara
2010-08-31 13:13     ` saeed bishara
2010-06-08 17:08 ` [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Lennert Buytenhek
2010-06-09  8:21   ` Saeed Bishara
2010-06-09  8:51     ` [PATCH 1/2 v2] mv643xx_eth: use sw csum for big packets Saeed Bishara
2010-06-10  6:43       ` Lennert Buytenhek
2010-06-10  7:38         ` Saeed Bishara
2010-06-12  8:31           ` Lennert Buytenhek
2010-06-13  7:38             ` Saeed Bishara
2010-06-14  9:32               ` Lennert Buytenhek
2010-06-20 11:49                 ` saeed bishara
2010-06-20 11:58                   ` Lennert Buytenhek
2010-06-27  4:22                     ` David Miller
2010-06-09 19:10     ` [PATCH 1/2] mv643xx_eth: disable csum offloading if the hw limited by max size Lennert Buytenhek
2010-06-09 19:22       ` Abhijeet Gole

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).