diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index ec96130533cc..bf811565ee24 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -160,6 +160,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, | |||
160 | struct sk_buff *skb = tx_buf->skb; | 160 | struct sk_buff *skb = tx_buf->skb; |
161 | u16 bd_idx = TX_BD(tx_buf->first_bd), new_cons; | 161 | u16 bd_idx = TX_BD(tx_buf->first_bd), new_cons; |
162 | int nbd; | 162 | int nbd; |
163 | u16 split_bd_len = 0; | ||
163 | 164 | ||
164 | /* prefetch skb end pointer to speedup dev_kfree_skb() */ | 165 | /* prefetch skb end pointer to speedup dev_kfree_skb() */ |
165 | prefetch(&skb->end); | 166 | prefetch(&skb->end); |
@@ -167,10 +168,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, | |||
167 | DP(NETIF_MSG_TX_DONE, "fp[%d]: pkt_idx %d buff @(%p)->skb %p\n", | 168 | DP(NETIF_MSG_TX_DONE, "fp[%d]: pkt_idx %d buff @(%p)->skb %p\n", |
168 | txdata->txq_index, idx, tx_buf, skb); | 169 | txdata->txq_index, idx, tx_buf, skb); |
169 | 170 | ||
170 | /* unmap first bd */ | ||
171 | tx_start_bd = &txdata->tx_desc_ring[bd_idx].start_bd; | 171 | tx_start_bd = &txdata->tx_desc_ring[bd_idx].start_bd; |
172 | dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd), | ||
173 | BD_UNMAP_LEN(tx_start_bd), DMA_TO_DEVICE); | ||
174 | 172 | ||
175 | nbd = le16_to_cpu(tx_start_bd->nbd) - 1; | 173 | nbd = le16_to_cpu(tx_start_bd->nbd) - 1; |
176 | #ifdef BNX2X_STOP_ON_ERROR | 174 | #ifdef BNX2X_STOP_ON_ERROR |
@@ -188,12 +186,19 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata, | |||
188 | --nbd; | 186 | --nbd; |
189 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | 187 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); |
190 | 188 | ||
191 | /* ...and the TSO split header bd since they have no mapping */ | 189 | /* TSO headers+data bds share a common mapping. See bnx2x_tx_split() */ |
192 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { | 190 | if (tx_buf->flags & BNX2X_TSO_SPLIT_BD) { |
191 | tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd; | ||
192 | split_bd_len = BD_UNMAP_LEN(tx_data_bd); | ||
193 | --nbd; | 193 | --nbd; |
194 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); | 194 | bd_idx = TX_BD(NEXT_TX_IDX(bd_idx)); |
195 | } | 195 | } |
196 | 196 | ||
197 | /* unmap first bd */ | ||
198 | dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd), | ||
199 | BD_UNMAP_LEN(tx_start_bd) + split_bd_len, | ||
200 | DMA_TO_DEVICE); | ||
201 | |||
197 | /* now free frags */ | 202 | /* now free frags */ |
198 | while (nbd > 0) { | 203 | while (nbd > 0) { |
199 | 204 | ||
@@ -1790,26 +1795,22 @@ static void bnx2x_napi_disable_cnic(struct bnx2x *bp) | |||
1790 | { | 1795 | { |
1791 | int i; | 1796 | int i; |
1792 | 1797 | ||
1793 | local_bh_disable(); | ||
1794 | for_each_rx_queue_cnic(bp, i) { | 1798 | for_each_rx_queue_cnic(bp, i) { |
1795 | napi_disable(&bnx2x_fp(bp, i, napi)); | 1799 | napi_disable(&bnx2x_fp(bp, i, napi)); |
1796 | while (!bnx2x_fp_lock_napi(&bp->fp[i])) | 1800 | while (!bnx2x_fp_ll_disable(&bp->fp[i])) |
1797 | mdelay(1); | 1801 | usleep_range(1000, 2000); |
1798 | } | 1802 | } |
1799 | local_bh_enable(); | ||
1800 | } | 1803 | } |
1801 | 1804 | ||
1802 | static void bnx2x_napi_disable(struct bnx2x *bp) | 1805 | static void bnx2x_napi_disable(struct bnx2x *bp) |
1803 | { | 1806 | { |
1804 | int i; | 1807 | int i; |
1805 | 1808 | ||
1806 | local_bh_disable(); | ||
1807 | for_each_eth_queue(bp, i) { | 1809 | for_each_eth_queue(bp, i) { |
1808 | napi_disable(&bnx2x_fp(bp, i, napi)); | 1810 | napi_disable(&bnx2x_fp(bp, i, napi)); |
1809 | while (!bnx2x_fp_lock_napi(&bp->fp[i])) | 1811 | while (!bnx2x_fp_ll_disable(&bp->fp[i])) |
1810 | mdelay(1); | 1812 | usleep_range(1000, 2000); |
1811 | } | 1813 | } |
1812 | local_bh_enable(); | ||
1813 | } | 1814 | } |
1814 | 1815 | ||
1815 | void bnx2x_netif_start(struct bnx2x *bp) | 1816 | void bnx2x_netif_start(struct bnx2x *bp) |
@@ -1832,7 +1833,8 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) | |||
1832 | bnx2x_napi_disable_cnic(bp); | 1833 | bnx2x_napi_disable_cnic(bp); |
1833 | } | 1834 | } |
1834 | 1835 | ||
1835 | u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) | 1836 | u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb, |
1837 | void *accel_priv) | ||
1836 | { | 1838 | { |
1837 | struct bnx2x *bp = netdev_priv(dev); | 1839 | struct bnx2x *bp = netdev_priv(dev); |
1838 | 1840 | ||