lkml.org 
[lkml]   [2011]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 21/62] net: remove the second argument of k[un]map_atomic()
From
Date
Le dimanche 27 novembre 2011 à 13:27 +0800, Cong Wang a écrit :
> Signed-off-by: Cong Wang <amwang@redhat.com>
> ---

> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index cf480b5..b194beb 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -3878,11 +3878,9 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
> if (length <= copybreak &&
> skb_tailroom(skb) >= length) {
> u8 *vaddr;
> - vaddr = kmap_atomic(buffer_info->page,
> - KM_SKB_DATA_SOFTIRQ);
> + vaddr = kmap_atomic(buffer_info->page);
> memcpy(skb_tail_pointer(skb), vaddr, length);
> - kunmap_atomic(vaddr,
> - KM_SKB_DATA_SOFTIRQ);
> + kunmap_atomic(vaddr);
> /* re-use the page, so don't erase
> * buffer_info->page */
> skb_put(skb, length);
> diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
> index a855db1..8603c87 100644
> --- a/drivers/net/ethernet/intel/e1000e/netdev.c
> +++ b/drivers/net/ethernet/intel/e1000e/netdev.c
> @@ -1272,9 +1272,9 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
> */
> dma_sync_single_for_cpu(&pdev->dev, ps_page->dma,
> PAGE_SIZE, DMA_FROM_DEVICE);
> - vaddr = kmap_atomic(ps_page->page, KM_SKB_DATA_SOFTIRQ);
> + vaddr = kmap_atomic(ps_page->page);
> memcpy(skb_tail_pointer(skb), vaddr, l1);
> - kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
> + kunmap_atomic(vaddr);
> dma_sync_single_for_device(&pdev->dev, ps_page->dma,
> PAGE_SIZE, DMA_FROM_DEVICE);
>
> @@ -1465,12 +1465,10 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
> if (length <= copybreak &&
> skb_tailroom(skb) >= length) {
> u8 *vaddr;
> - vaddr = kmap_atomic(buffer_info->page,
> - KM_SKB_DATA_SOFTIRQ);
> + vaddr = kmap_atomic(buffer_info->page);
> memcpy(skb_tail_pointer(skb), vaddr,
> length);
> - kunmap_atomic(vaddr,
> - KM_SKB_DATA_SOFTIRQ);
> + kunmap_atomic(vaddr);
> /* re-use the page, so don't erase
> * buffer_info->page */
> skb_put(skb, length);

But why are these drivers using kmap_atomic() in first place, since
their fragments are allocated in regular zone (GFP_ATOMIC or
GFP_KERNEL) ?




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-11-27 09:09    [W:0.234 / U:4.816 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site