Re: [PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
From: Eric Dumazet Date: Fri, 12 Apr 2013 05:55:39 -0700 > On Fri, 2013-04-12 at 11:20 +0200, Sebastian Hesselbarth wrote: >> With recent support for GRO, there is no need to keep both LRO and >> GRO. This patch therefore removes the deprecated inet_lro support >> from mv643xx_eth. This is work is based on an experimental patch >> provided by Eric Dumazet and Willy Tarreau. >> >> Signed-off-by: Sebastian Hesselbarth >> Based-on-patch-by: Eric Dumazet >> Based-on-patch-by: Willy Tarreau >> --- >> Changes from v1: >> - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) > > Thanks for finishing this patch > > Signed-off-by: Eric Dumazet Applied, but this driver is full of skeletons: drivers/net/ethernet/marvell/mv643xx_eth.c: In function ‘rxq_refill’: drivers/net/ethernet/marvell/mv643xx_eth.c:618:19: error: invalid operands to binary - (have ‘sk_buff_data_t’ and ‘unsigned char *’) which is: size = skb->end - skb->data; that is absolutely not a legal computation. It happens to be in the only configuration for which this driver can be enabled in Kconfig but that is no excuse for it :-)
Re: [PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
On Fri, 2013-04-12 at 11:20 +0200, Sebastian Hesselbarth wrote: > With recent support for GRO, there is no need to keep both LRO and > GRO. This patch therefore removes the deprecated inet_lro support > from mv643xx_eth. This is work is based on an experimental patch > provided by Eric Dumazet and Willy Tarreau. > > Signed-off-by: Sebastian Hesselbarth > Based-on-patch-by: Eric Dumazet > Based-on-patch-by: Willy Tarreau > --- > Changes from v1: > - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) Thanks for finishing this patch Signed-off-by: Eric Dumazet -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
With recent support for GRO, there is no need to keep both LRO and GRO. This patch therefore removes the deprecated inet_lro support from mv643xx_eth. This is work is based on an experimental patch provided by Eric Dumazet and Willy Tarreau. Signed-off-by: Sebastian Hesselbarth Based-on-patch-by: Eric Dumazet Based-on-patch-by: Willy Tarreau --- Changes from v1: - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) Cc: "David S. Miller" Cc: Lennert Buytenhek Cc: Andrew Lunn Cc: Jason Cooper Cc: Florian Fainelli Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Dale Farnsworth Cc: Ben Hutchings Cc: Soeren Moch Cc: Eric Dumazet Cc: Willy Tarreau Cc: net...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/marvell/Kconfig |1 - drivers/net/ethernet/marvell/mv643xx_eth.c | 97 +--- 2 files changed, 3 insertions(+), 95 deletions(-) diff --git a/drivers/net/ethernet/marvell/Kconfig b/drivers/net/ethernet/marvell/Kconfig index 5170ecb..0051f0e 100644 --- a/drivers/net/ethernet/marvell/Kconfig +++ b/drivers/net/ethernet/marvell/Kconfig @@ -21,7 +21,6 @@ if NET_VENDOR_MARVELL config MV643XX_ETH tristate "Marvell Discovery (643XX) and Orion ethernet support" depends on (MV64X60 || PPC32 || PLAT_ORION) && INET - select INET_LRO select PHYLIB select MVMDIO ---help--- diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index c850d04..d0afeea 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -56,8 +56,8 @@ #include #include #include +#include #include -#include #include #include @@ -316,12 +316,6 @@ struct mib_counters { u32 rx_overrun; }; -struct lro_counters { - u32 lro_aggregated; - u32 lro_flushed; - u32 lro_no_desc; -}; - struct rx_queue { int index; @@ -335,9 +329,6 @@ struct rx_queue { dma_addr_t rx_desc_dma; int rx_desc_area_size; struct sk_buff **rx_skb; - - struct net_lro_mgr lro_mgr; - struct net_lro_desc lro_arr[8]; }; struct tx_queue { @@ -373,8 +364,6 @@ struct mv643xx_eth_private { spinlock_t mib_counters_lock; struct mib_counters mib_counters; - struct lro_counters lro_counters; - struct work_struct tx_timeout_task; struct napi_struct napi; @@ -503,42 +492,12 @@ static void txq_maybe_wake(struct tx_queue *txq) } } - -/* rx napi **/ -static int -mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph, - u64 *hdr_flags, void *priv) -{ - unsigned long cmd_sts = (unsigned long)priv; - - /* -* Make sure that this packet is Ethernet II, is not VLAN -* tagged, is IPv4, has a valid IP header, and is TCP. -*/ - if ((cmd_sts & (RX_IP_HDR_OK | RX_PKT_IS_IPV4 | - RX_PKT_IS_ETHERNETV2 | RX_PKT_LAYER4_TYPE_MASK | - RX_PKT_IS_VLAN_TAGGED)) != - (RX_IP_HDR_OK | RX_PKT_IS_IPV4 | -RX_PKT_IS_ETHERNETV2 | RX_PKT_LAYER4_TYPE_TCP_IPV4)) - return -1; - - skb_reset_network_header(skb); - skb_set_transport_header(skb, ip_hdrlen(skb)); - *iphdr = ip_hdr(skb); - *tcph = tcp_hdr(skb); - *hdr_flags = LRO_IPV4 | LRO_TCP; - - return 0; -} - static int rxq_process(struct rx_queue *rxq, int budget) { struct mv643xx_eth_private *mp = rxq_to_mp(rxq); struct net_device_stats *stats = >dev->stats; - int lro_flush_needed; int rx; - lro_flush_needed = 0; rx = 0; while (rx < budget && rxq->rx_desc_count) { struct rx_desc *rx_desc; @@ -599,12 +558,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) skb->ip_summed = CHECKSUM_UNNECESSARY; skb->protocol = eth_type_trans(skb, mp->dev); - if (skb->dev->features & NETIF_F_LRO && - skb->ip_summed == CHECKSUM_UNNECESSARY) { - lro_receive_skb(>lro_mgr, skb, (void *)cmd_sts); - lro_flush_needed = 1; - } else - napi_gro_receive(>napi, skb); + napi_gro_receive(>napi, skb); continue; @@ -624,9 +578,6 @@ err: dev_kfree_skb(skb); } - if (lro_flush_needed) - lro_flush_all(>lro_mgr); - if (rx < budget) mp->work_rx &= ~(1 << rxq->index); @@ -1118,26 +1069,6 @@ static struct net_device_stats *mv643xx_eth_get_stats(struct net_device *dev) return stats; } -static void mv643xx_eth_grab_lro_stats(struct mv643xx_eth_private *mp) -{ - u32 lro_aggregated =
[PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
With recent support for GRO, there is no need to keep both LRO and GRO. This patch therefore removes the deprecated inet_lro support from mv643xx_eth. This is work is based on an experimental patch provided by Eric Dumazet and Willy Tarreau. Signed-off-by: Sebastian Hesselbarth sebastian.hesselba...@gmail.com Based-on-patch-by: Eric Dumazet eric.duma...@gmail.com Based-on-patch-by: Willy Tarreau w...@1wt.eu --- Changes from v1: - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) Cc: David S. Miller da...@davemloft.net Cc: Lennert Buytenhek buyt...@wantstofly.org Cc: Andrew Lunn and...@lunn.ch Cc: Jason Cooper ja...@lakedaemon.net Cc: Florian Fainelli flor...@openwrt.org Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: Paul Mackerras pau...@samba.org Cc: Dale Farnsworth d...@farnsworth.org Cc: Ben Hutchings bhutchi...@solarflare.com Cc: Soeren Moch sm...@web.de Cc: Eric Dumazet eric.duma...@gmail.com Cc: Willy Tarreau w...@1wt.eu Cc: net...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linuxppc-...@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/marvell/Kconfig |1 - drivers/net/ethernet/marvell/mv643xx_eth.c | 97 +--- 2 files changed, 3 insertions(+), 95 deletions(-) diff --git a/drivers/net/ethernet/marvell/Kconfig b/drivers/net/ethernet/marvell/Kconfig index 5170ecb..0051f0e 100644 --- a/drivers/net/ethernet/marvell/Kconfig +++ b/drivers/net/ethernet/marvell/Kconfig @@ -21,7 +21,6 @@ if NET_VENDOR_MARVELL config MV643XX_ETH tristate Marvell Discovery (643XX) and Orion ethernet support depends on (MV64X60 || PPC32 || PLAT_ORION) INET - select INET_LRO select PHYLIB select MVMDIO ---help--- diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index c850d04..d0afeea 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -56,8 +56,8 @@ #include linux/phy.h #include linux/mv643xx_eth.h #include linux/io.h +#include linux/interrupt.h #include linux/types.h -#include linux/inet_lro.h #include linux/slab.h #include linux/clk.h @@ -316,12 +316,6 @@ struct mib_counters { u32 rx_overrun; }; -struct lro_counters { - u32 lro_aggregated; - u32 lro_flushed; - u32 lro_no_desc; -}; - struct rx_queue { int index; @@ -335,9 +329,6 @@ struct rx_queue { dma_addr_t rx_desc_dma; int rx_desc_area_size; struct sk_buff **rx_skb; - - struct net_lro_mgr lro_mgr; - struct net_lro_desc lro_arr[8]; }; struct tx_queue { @@ -373,8 +364,6 @@ struct mv643xx_eth_private { spinlock_t mib_counters_lock; struct mib_counters mib_counters; - struct lro_counters lro_counters; - struct work_struct tx_timeout_task; struct napi_struct napi; @@ -503,42 +492,12 @@ static void txq_maybe_wake(struct tx_queue *txq) } } - -/* rx napi **/ -static int -mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph, - u64 *hdr_flags, void *priv) -{ - unsigned long cmd_sts = (unsigned long)priv; - - /* -* Make sure that this packet is Ethernet II, is not VLAN -* tagged, is IPv4, has a valid IP header, and is TCP. -*/ - if ((cmd_sts (RX_IP_HDR_OK | RX_PKT_IS_IPV4 | - RX_PKT_IS_ETHERNETV2 | RX_PKT_LAYER4_TYPE_MASK | - RX_PKT_IS_VLAN_TAGGED)) != - (RX_IP_HDR_OK | RX_PKT_IS_IPV4 | -RX_PKT_IS_ETHERNETV2 | RX_PKT_LAYER4_TYPE_TCP_IPV4)) - return -1; - - skb_reset_network_header(skb); - skb_set_transport_header(skb, ip_hdrlen(skb)); - *iphdr = ip_hdr(skb); - *tcph = tcp_hdr(skb); - *hdr_flags = LRO_IPV4 | LRO_TCP; - - return 0; -} - static int rxq_process(struct rx_queue *rxq, int budget) { struct mv643xx_eth_private *mp = rxq_to_mp(rxq); struct net_device_stats *stats = mp-dev-stats; - int lro_flush_needed; int rx; - lro_flush_needed = 0; rx = 0; while (rx budget rxq-rx_desc_count) { struct rx_desc *rx_desc; @@ -599,12 +558,7 @@ static int rxq_process(struct rx_queue *rxq, int budget) skb-ip_summed = CHECKSUM_UNNECESSARY; skb-protocol = eth_type_trans(skb, mp-dev); - if (skb-dev-features NETIF_F_LRO - skb-ip_summed == CHECKSUM_UNNECESSARY) { - lro_receive_skb(rxq-lro_mgr, skb, (void *)cmd_sts); - lro_flush_needed = 1; - } else - napi_gro_receive(mp-napi, skb); + napi_gro_receive(mp-napi, skb); continue; @@ -624,9 +578,6 @@ err: dev_kfree_skb(skb); }
Re: [PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
On Fri, 2013-04-12 at 11:20 +0200, Sebastian Hesselbarth wrote: With recent support for GRO, there is no need to keep both LRO and GRO. This patch therefore removes the deprecated inet_lro support from mv643xx_eth. This is work is based on an experimental patch provided by Eric Dumazet and Willy Tarreau. Signed-off-by: Sebastian Hesselbarth sebastian.hesselba...@gmail.com Based-on-patch-by: Eric Dumazet eric.duma...@gmail.com Based-on-patch-by: Willy Tarreau w...@1wt.eu --- Changes from v1: - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) Thanks for finishing this patch Signed-off-by: Eric Dumazet eduma...@google.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] net: mv643xx_eth: remove deprecated inet_lro support
From: Eric Dumazet eric.duma...@gmail.com Date: Fri, 12 Apr 2013 05:55:39 -0700 On Fri, 2013-04-12 at 11:20 +0200, Sebastian Hesselbarth wrote: With recent support for GRO, there is no need to keep both LRO and GRO. This patch therefore removes the deprecated inet_lro support from mv643xx_eth. This is work is based on an experimental patch provided by Eric Dumazet and Willy Tarreau. Signed-off-by: Sebastian Hesselbarth sebastian.hesselba...@gmail.com Based-on-patch-by: Eric Dumazet eric.duma...@gmail.com Based-on-patch-by: Willy Tarreau w...@1wt.eu --- Changes from v1: - also remove INET_LRO from Kconfig (Reported by Eric Dumazet) Thanks for finishing this patch Signed-off-by: Eric Dumazet eduma...@google.com Applied, but this driver is full of skeletons: drivers/net/ethernet/marvell/mv643xx_eth.c: In function ‘rxq_refill’: drivers/net/ethernet/marvell/mv643xx_eth.c:618:19: error: invalid operands to binary - (have ‘sk_buff_data_t’ and ‘unsigned char *’) which is: size = skb-end - skb-data; that is absolutely not a legal computation. It happens to be in the only configuration for which this driver can be enabled in Kconfig but that is no excuse for it :-)