Commit ab307a39 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by David S. Miller

mv643xx_eth: make LRO unconditional

Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 97daee83
...@@ -2301,6 +2301,7 @@ config UGETH_TX_ON_DEMAND ...@@ -2301,6 +2301,7 @@ config UGETH_TX_ON_DEMAND
config MV643XX_ETH config MV643XX_ETH
tristate "Marvell Discovery (643XX) and Orion ethernet support" tristate "Marvell Discovery (643XX) and Orion ethernet support"
depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || PLAT_ORION depends on MV64360 || MV64X60 || (PPC_MULTIPLATFORM && PPC32) || PLAT_ORION
select INET_LRO
select PHYLIB select PHYLIB
help help
This driver supports the gigabit ethernet MACs in the This driver supports the gigabit ethernet MACs in the
...@@ -2310,16 +2311,6 @@ config MV643XX_ETH ...@@ -2310,16 +2311,6 @@ config MV643XX_ETH
Some boards that use the Discovery chipset are the Momenco Some boards that use the Discovery chipset are the Momenco
Ocelot C and Jaguar ATX and Pegasos II. Ocelot C and Jaguar ATX and Pegasos II.
config MV643XX_ETH_LRO
tristate "Marvell 643XX ethernet driver LRO support"
depends on MV643XX_ETH
select INET_LRO
help
Say y here if you want to use Large Receive Offload for the
mv643xx_eth driver.
If in doubt, say N.
config QLA3XXX config QLA3XXX
tristate "QLogic QLA3XXX Network Driver Support" tristate "QLogic QLA3XXX Network Driver Support"
depends on PCI depends on PCI
......
...@@ -351,10 +351,8 @@ struct rx_queue { ...@@ -351,10 +351,8 @@ struct rx_queue {
int rx_desc_area_size; int rx_desc_area_size;
struct sk_buff **rx_skb; struct sk_buff **rx_skb;
#ifdef CONFIG_MV643XX_ETH_LRO
struct net_lro_mgr lro_mgr; struct net_lro_mgr lro_mgr;
struct net_lro_desc lro_arr[8]; struct net_lro_desc lro_arr[8];
#endif
}; };
struct tx_queue { struct tx_queue {
...@@ -516,7 +514,6 @@ static void txq_maybe_wake(struct tx_queue *txq) ...@@ -516,7 +514,6 @@ static void txq_maybe_wake(struct tx_queue *txq)
/* rx napi ******************************************************************/ /* rx napi ******************************************************************/
#ifdef CONFIG_MV643XX_ETH_LRO
static int static int
mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph, mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph,
u64 *hdr_flags, void *priv) u64 *hdr_flags, void *priv)
...@@ -542,7 +539,6 @@ mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph, ...@@ -542,7 +539,6 @@ mv643xx_get_skb_header(struct sk_buff *skb, void **iphdr, void **tcph,
return 0; return 0;
} }
#endif
static int rxq_process(struct rx_queue *rxq, int budget) static int rxq_process(struct rx_queue *rxq, int budget)
{ {
...@@ -612,13 +608,11 @@ static int rxq_process(struct rx_queue *rxq, int budget) ...@@ -612,13 +608,11 @@ static int rxq_process(struct rx_queue *rxq, int budget)
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
skb->protocol = eth_type_trans(skb, mp->dev); skb->protocol = eth_type_trans(skb, mp->dev);
#ifdef CONFIG_MV643XX_ETH_LRO
if (skb->dev->features & NETIF_F_LRO && if (skb->dev->features & NETIF_F_LRO &&
skb->ip_summed == CHECKSUM_UNNECESSARY) { skb->ip_summed == CHECKSUM_UNNECESSARY) {
lro_receive_skb(&rxq->lro_mgr, skb, (void *)cmd_sts); lro_receive_skb(&rxq->lro_mgr, skb, (void *)cmd_sts);
lro_flush_needed = 1; lro_flush_needed = 1;
} else } else
#endif
netif_receive_skb(skb); netif_receive_skb(skb);
continue; continue;
...@@ -640,10 +634,8 @@ err: ...@@ -640,10 +634,8 @@ err:
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
#ifdef CONFIG_MV643XX_ETH_LRO
if (lro_flush_needed) if (lro_flush_needed)
lro_flush_all(&rxq->lro_mgr); lro_flush_all(&rxq->lro_mgr);
#endif
if (rx < budget) if (rx < budget)
mp->work_rx &= ~(1 << rxq->index); mp->work_rx &= ~(1 << rxq->index);
...@@ -1231,7 +1223,6 @@ static void mv643xx_eth_grab_lro_stats(struct mv643xx_eth_private *mp) ...@@ -1231,7 +1223,6 @@ static void mv643xx_eth_grab_lro_stats(struct mv643xx_eth_private *mp)
u32 lro_no_desc = 0; u32 lro_no_desc = 0;
int i; int i;
#ifdef CONFIG_MV643XX_ETH_LRO
for (i = 0; i < mp->rxq_count; i++) { for (i = 0; i < mp->rxq_count; i++) {
struct rx_queue *rxq = mp->rxq + i; struct rx_queue *rxq = mp->rxq + i;
...@@ -1239,7 +1230,6 @@ static void mv643xx_eth_grab_lro_stats(struct mv643xx_eth_private *mp) ...@@ -1239,7 +1230,6 @@ static void mv643xx_eth_grab_lro_stats(struct mv643xx_eth_private *mp)
lro_flushed += rxq->lro_mgr.stats.flushed; lro_flushed += rxq->lro_mgr.stats.flushed;
lro_no_desc += rxq->lro_mgr.stats.no_desc; lro_no_desc += rxq->lro_mgr.stats.no_desc;
} }
#endif
mp->lro_counters.lro_aggregated = lro_aggregated; mp->lro_counters.lro_aggregated = lro_aggregated;
mp->lro_counters.lro_flushed = lro_flushed; mp->lro_counters.lro_flushed = lro_flushed;
...@@ -1939,7 +1929,6 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) ...@@ -1939,7 +1929,6 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index)
nexti * sizeof(struct rx_desc); nexti * sizeof(struct rx_desc);
} }
#ifdef CONFIG_MV643XX_ETH_LRO
rxq->lro_mgr.dev = mp->dev; rxq->lro_mgr.dev = mp->dev;
memset(&rxq->lro_mgr.stats, 0, sizeof(rxq->lro_mgr.stats)); memset(&rxq->lro_mgr.stats, 0, sizeof(rxq->lro_mgr.stats));
rxq->lro_mgr.features = LRO_F_NAPI; rxq->lro_mgr.features = LRO_F_NAPI;
...@@ -1952,7 +1941,6 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index) ...@@ -1952,7 +1941,6 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index)
rxq->lro_mgr.get_skb_header = mv643xx_get_skb_header; rxq->lro_mgr.get_skb_header = mv643xx_get_skb_header;
memset(&rxq->lro_arr, 0, sizeof(rxq->lro_arr)); memset(&rxq->lro_arr, 0, sizeof(rxq->lro_arr));
#endif
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment