Skip to content

Commit de6be6c

Browse files
stephen hemmingerdavem330
authored andcommitted
sky2: don't do GRO on second port
There's something very important I forgot to tell you. What? Don't cross the GRO streams. Why? It would be bad. I'm fuzzy on the whole good/bad thing. What do you mean, "bad"? Try to imagine all the Internet as you know it stopping instantaneously and every bit in every packet swapping at the speed of light. Total packet reordering. Right. That's bad. Okay. All right. Important safety tip. Thanks, Hubert The simplest way to stop this is just avoid doing GRO on the second port. Very few Marvell boards support two ports per ring, and GRO is just an optimization. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 750e9fa commit de6be6c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

drivers/net/sky2.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2520,24 +2520,27 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
25202520
}
25212521
}
25222522

2523-
static inline void sky2_skb_rx(const struct sky2_port *sky2,
2523+
static inline void sky2_skb_rx(struct napi_struct *napi,
2524+
const struct sky2_port *sky2,
25242525
u32 status, struct sk_buff *skb)
25252526
{
25262527
#ifdef SKY2_VLAN_TAG_USED
2527-
u16 vlan_tag = be16_to_cpu(sky2->rx_tag);
25282528
if (sky2->vlgrp && (status & GMR_FS_VLAN)) {
2529-
if (skb->ip_summed == CHECKSUM_NONE)
2529+
u16 vlan_tag = be16_to_cpu(sky2->rx_tag);
2530+
2531+
if (skb->ip_summed == CHECKSUM_NONE ||
2532+
sky2->netdev != napi->dev)
25302533
vlan_hwaccel_receive_skb(skb, sky2->vlgrp, vlan_tag);
25312534
else
2532-
vlan_gro_receive(&sky2->hw->napi, sky2->vlgrp,
2533-
vlan_tag, skb);
2535+
vlan_gro_receive(napi, sky2->vlgrp, vlan_tag, skb);
25342536
return;
25352537
}
25362538
#endif
2537-
if (skb->ip_summed == CHECKSUM_NONE)
2539+
if (skb->ip_summed == CHECKSUM_NONE ||
2540+
sky2->netdev != napi->dev)
25382541
netif_receive_skb(skb);
25392542
else
2540-
napi_gro_receive(&sky2->hw->napi, skb);
2543+
napi_gro_receive(napi, skb);
25412544
}
25422545

25432546
static inline void sky2_rx_done(struct sky2_hw *hw, unsigned port,
@@ -2638,7 +2641,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
26382641

26392642
skb->protocol = eth_type_trans(skb, dev);
26402643

2641-
sky2_skb_rx(sky2, status, skb);
2644+
sky2_skb_rx(&hw->napi, sky2, status, skb);
26422645

26432646
/* Stop after net poll weight */
26442647
if (++work_done >= to_do)

0 commit comments

Comments
 (0)