提交 ce11ff5e 编写于 作者: F françois romieu 提交者: David S. Miller

r8169: fix vlan tag read ordering.

Control of receive descriptor must not be returned to ethernet chipset
before vlan tag processing is done.

VLAN tag receive word is now reset both in normal and error path.
Signed-off-by: NFrancois Romieu <romieu@fr.zoreil.com>
Spotted-by: NTimo Teras <timo.teras@iki.fi>
Cc: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 56a666dc
...@@ -1826,8 +1826,6 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb) ...@@ -1826,8 +1826,6 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
if (opts2 & RxVlanTag) if (opts2 & RxVlanTag)
__vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff)); __vlan_hwaccel_put_tag(skb, swab16(opts2 & 0xffff));
desc->opts2 = 0;
} }
static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd) static int rtl8169_gset_tbi(struct net_device *dev, struct ethtool_cmd *cmd)
...@@ -6064,8 +6062,6 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget ...@@ -6064,8 +6062,6 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
!(status & (RxRWT | RxFOVF)) && !(status & (RxRWT | RxFOVF)) &&
(dev->features & NETIF_F_RXALL)) (dev->features & NETIF_F_RXALL))
goto process_pkt; goto process_pkt;
rtl8169_mark_to_asic(desc, rx_buf_sz);
} else { } else {
struct sk_buff *skb; struct sk_buff *skb;
dma_addr_t addr; dma_addr_t addr;
...@@ -6086,16 +6082,14 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget ...@@ -6086,16 +6082,14 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
if (unlikely(rtl8169_fragmented_frame(status))) { if (unlikely(rtl8169_fragmented_frame(status))) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
rtl8169_mark_to_asic(desc, rx_buf_sz); goto release_descriptor;
continue;
} }
skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry], skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry],
tp, pkt_size, addr); tp, pkt_size, addr);
rtl8169_mark_to_asic(desc, rx_buf_sz);
if (!skb) { if (!skb) {
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
continue; goto release_descriptor;
} }
rtl8169_rx_csum(skb, status); rtl8169_rx_csum(skb, status);
...@@ -6111,6 +6105,10 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget ...@@ -6111,6 +6105,10 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
tp->rx_stats.bytes += pkt_size; tp->rx_stats.bytes += pkt_size;
u64_stats_update_end(&tp->rx_stats.syncp); u64_stats_update_end(&tp->rx_stats.syncp);
} }
release_descriptor:
desc->opts2 = 0;
wmb();
rtl8169_mark_to_asic(desc, rx_buf_sz);
} }
count = cur_rx - tp->cur_rx; count = cur_rx - tp->cur_rx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册