diff options
Diffstat (limited to 'drivers/net/ethernet/realtek/r8169.c')
| -rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index ad0020af2193..c70ab40d8698 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
| @@ -2561,7 +2561,7 @@ static int rtl_check_firmware(struct rtl8169_private *tp, struct rtl_fw *rtl_fw) | |||
| 2561 | int rc = -EINVAL; | 2561 | int rc = -EINVAL; |
| 2562 | 2562 | ||
| 2563 | if (!rtl_fw_format_ok(tp, rtl_fw)) { | 2563 | if (!rtl_fw_format_ok(tp, rtl_fw)) { |
| 2564 | netif_err(tp, ifup, dev, "invalid firwmare\n"); | 2564 | netif_err(tp, ifup, dev, "invalid firmware\n"); |
| 2565 | goto out; | 2565 | goto out; |
| 2566 | } | 2566 | } |
| 2567 | 2567 | ||
| @@ -5067,8 +5067,6 @@ static void rtl_hw_reset(struct rtl8169_private *tp) | |||
| 5067 | RTL_W8(ChipCmd, CmdReset); | 5067 | RTL_W8(ChipCmd, CmdReset); |
| 5068 | 5068 | ||
| 5069 | rtl_udelay_loop_wait_low(tp, &rtl_chipcmd_cond, 100, 100); | 5069 | rtl_udelay_loop_wait_low(tp, &rtl_chipcmd_cond, 100, 100); |
| 5070 | |||
| 5071 | netdev_reset_queue(tp->dev); | ||
| 5072 | } | 5070 | } |
| 5073 | 5071 | ||
| 5074 | static void rtl_request_uncached_firmware(struct rtl8169_private *tp) | 5072 | static void rtl_request_uncached_firmware(struct rtl8169_private *tp) |
| @@ -7049,7 +7047,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
| 7049 | u32 status, len; | 7047 | u32 status, len; |
| 7050 | u32 opts[2]; | 7048 | u32 opts[2]; |
| 7051 | int frags; | 7049 | int frags; |
| 7052 | bool stop_queue; | ||
| 7053 | 7050 | ||
| 7054 | if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) { | 7051 | if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) { |
| 7055 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); | 7052 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); |
| @@ -7090,8 +7087,6 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
| 7090 | 7087 | ||
| 7091 | txd->opts2 = cpu_to_le32(opts[1]); | 7088 | txd->opts2 = cpu_to_le32(opts[1]); |
| 7092 | 7089 | ||
| 7093 | netdev_sent_queue(dev, skb->len); | ||
| 7094 | |||
| 7095 | skb_tx_timestamp(skb); | 7090 | skb_tx_timestamp(skb); |
| 7096 | 7091 | ||
| 7097 | /* Force memory writes to complete before releasing descriptor */ | 7092 | /* Force memory writes to complete before releasing descriptor */ |
| @@ -7106,16 +7101,11 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
| 7106 | 7101 | ||
| 7107 | tp->cur_tx += frags + 1; | 7102 | tp->cur_tx += frags + 1; |
| 7108 | 7103 | ||
| 7109 | stop_queue = !TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS); | 7104 | RTL_W8(TxPoll, NPQ); |
| 7110 | 7105 | ||
| 7111 | if (!skb->xmit_more || stop_queue || | 7106 | mmiowb(); |
| 7112 | netif_xmit_stopped(netdev_get_tx_queue(dev, 0))) { | ||
| 7113 | RTL_W8(TxPoll, NPQ); | ||
| 7114 | |||
| 7115 | mmiowb(); | ||
| 7116 | } | ||
| 7117 | 7107 | ||
| 7118 | if (stop_queue) { | 7108 | if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { |
| 7119 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must | 7109 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must |
| 7120 | * not miss a ring update when it notices a stopped queue. | 7110 | * not miss a ring update when it notices a stopped queue. |
| 7121 | */ | 7111 | */ |
| @@ -7198,7 +7188,6 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev) | |||
| 7198 | static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) | 7188 | static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) |
| 7199 | { | 7189 | { |
| 7200 | unsigned int dirty_tx, tx_left; | 7190 | unsigned int dirty_tx, tx_left; |
| 7201 | unsigned int bytes_compl = 0, pkts_compl = 0; | ||
| 7202 | 7191 | ||
| 7203 | dirty_tx = tp->dirty_tx; | 7192 | dirty_tx = tp->dirty_tx; |
| 7204 | smp_rmb(); | 7193 | smp_rmb(); |
| @@ -7222,8 +7211,10 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) | |||
| 7222 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, | 7211 | rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb, |
| 7223 | tp->TxDescArray + entry); | 7212 | tp->TxDescArray + entry); |
| 7224 | if (status & LastFrag) { | 7213 | if (status & LastFrag) { |
| 7225 | pkts_compl++; | 7214 | u64_stats_update_begin(&tp->tx_stats.syncp); |
| 7226 | bytes_compl += tx_skb->skb->len; | 7215 | tp->tx_stats.packets++; |
| 7216 | tp->tx_stats.bytes += tx_skb->skb->len; | ||
| 7217 | u64_stats_update_end(&tp->tx_stats.syncp); | ||
| 7227 | dev_kfree_skb_any(tx_skb->skb); | 7218 | dev_kfree_skb_any(tx_skb->skb); |
| 7228 | tx_skb->skb = NULL; | 7219 | tx_skb->skb = NULL; |
| 7229 | } | 7220 | } |
| @@ -7232,13 +7223,6 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) | |||
| 7232 | } | 7223 | } |
| 7233 | 7224 | ||
| 7234 | if (tp->dirty_tx != dirty_tx) { | 7225 | if (tp->dirty_tx != dirty_tx) { |
| 7235 | netdev_completed_queue(tp->dev, pkts_compl, bytes_compl); | ||
| 7236 | |||
| 7237 | u64_stats_update_begin(&tp->tx_stats.syncp); | ||
| 7238 | tp->tx_stats.packets += pkts_compl; | ||
| 7239 | tp->tx_stats.bytes += bytes_compl; | ||
| 7240 | u64_stats_update_end(&tp->tx_stats.syncp); | ||
| 7241 | |||
| 7242 | tp->dirty_tx = dirty_tx; | 7226 | tp->dirty_tx = dirty_tx; |
| 7243 | /* Sync with rtl8169_start_xmit: | 7227 | /* Sync with rtl8169_start_xmit: |
| 7244 | * - publish dirty_tx ring index (write barrier) | 7228 | * - publish dirty_tx ring index (write barrier) |
