提交 0e15df49 编写于 作者: B Bruce Allan 提交者: Jeff Kirsher

e1000e: minor whitespace and indentation cleanup

Cleanup of some whitespace and indentation of a single code block.
Signed-off-by: NBruce Allan <bruce.w.allan@intel.com>
Tested-by: NAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 e885d762
...@@ -280,8 +280,8 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val) ...@@ -280,8 +280,8 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
#define er16flash(reg) __er16flash(hw, (reg)) #define er16flash(reg) __er16flash(hw, (reg))
#define er32flash(reg) __er32flash(hw, (reg)) #define er32flash(reg) __er32flash(hw, (reg))
#define ew16flash(reg,val) __ew16flash(hw, (reg), (val)) #define ew16flash(reg, val) __ew16flash(hw, (reg), (val))
#define ew32flash(reg,val) __ew32flash(hw, (reg), (val)) #define ew32flash(reg, val) __ew32flash(hw, (reg), (val))
static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw) static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw)
{ {
......
...@@ -1267,43 +1267,49 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done, ...@@ -1267,43 +1267,49 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done,
skb_put(skb, length); skb_put(skb, length);
{ {
/* /*
* this looks ugly, but it seems compiler issues make it * this looks ugly, but it seems compiler issues make
* more efficient than reusing j * it more efficient than reusing j
*/ */
int l1 = le16_to_cpu(rx_desc->wb.upper.length[0]); int l1 = le16_to_cpu(rx_desc->wb.upper.length[0]);
/*
* page alloc/put takes too long and effects small packet
* throughput, so unsplit small packets and save the alloc/put
* only valid in softirq (napi) context to call kmap_*
*/
if (l1 && (l1 <= copybreak) &&
((length + l1) <= adapter->rx_ps_bsize0)) {
u8 *vaddr;
ps_page = &buffer_info->ps_pages[0];
/* /*
* there is no documentation about how to call * page alloc/put takes too long and effects small
* kmap_atomic, so we can't hold the mapping * packet throughput, so unsplit small packets and
* very long * save the alloc/put only valid in softirq (napi)
* context to call kmap_*
*/ */
dma_sync_single_for_cpu(&pdev->dev, ps_page->dma, if (l1 && (l1 <= copybreak) &&
PAGE_SIZE, DMA_FROM_DEVICE); ((length + l1) <= adapter->rx_ps_bsize0)) {
vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ); u8 *vaddr;
memcpy(skb_tail_pointer(skb), vaddr, l1);
kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); ps_page = &buffer_info->ps_pages[0];
dma_sync_single_for_device(&pdev->dev, ps_page->dma,
PAGE_SIZE, DMA_FROM_DEVICE); /*
* there is no documentation about how to call
/* remove the CRC */ * kmap_atomic, so we can't hold the mapping
if (!(adapter->flags2 & FLAG2_CRC_STRIPPING)) * very long
l1 -= 4; */
dma_sync_single_for_cpu(&pdev->dev,
skb_put(skb, l1); ps_page->dma,
goto copydone; PAGE_SIZE,
} /* if */ DMA_FROM_DEVICE);
vaddr = kmap_atomic(ps_page->page,
KM_SKB_DATA_SOFTIRQ);
memcpy(skb_tail_pointer(skb), vaddr, l1);
kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
dma_sync_single_for_device(&pdev->dev,
ps_page->dma,
PAGE_SIZE,
DMA_FROM_DEVICE);
/* remove the CRC */
if (!(adapter->flags2 & FLAG2_CRC_STRIPPING))
l1 -= 4;
skb_put(skb, l1);
goto copydone;
} /* if */
} }
for (j = 0; j < PS_PAGE_BUFFERS; j++) { for (j = 0; j < PS_PAGE_BUFFERS; j++) {
...@@ -4969,7 +4975,7 @@ static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size) ...@@ -4969,7 +4975,7 @@ static int e1000_maybe_stop_tx(struct e1000_ring *tx_ring, int size)
return __e1000_maybe_stop_tx(tx_ring, size); return __e1000_maybe_stop_tx(tx_ring, size);
} }
#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1)
static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
struct net_device *netdev) struct net_device *netdev)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册