diff options
author | Changli Gao <xiaosuo@gmail.com> | 2010-12-06 23:26:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-08 13:43:41 -0500 |
commit | f6dafa95d1a48f73ab4a5b0f7dc0dcb72817e051 (patch) | |
tree | f922f2991f04ffd29d76e4fbaf07ec299efbdd1c /net/packet | |
parent | 15c2d75f49189e1769c5e8f5f099d03d055c4910 (diff) |
af_packet: eliminate pgv_to_page on some arches
Some arches don't need flush_dcache_page(), and don't implement it, so
we can eliminate pgv_to_page() calls on those arches.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 17eafe5b48c6..9292ec93eb52 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -223,7 +223,7 @@ struct packet_skb_cb { | |||
223 | 223 | ||
224 | #define PACKET_SKB_CB(__skb) ((struct packet_skb_cb *)((__skb)->cb)) | 224 | #define PACKET_SKB_CB(__skb) ((struct packet_skb_cb *)((__skb)->cb)) |
225 | 225 | ||
226 | static inline struct page *pgv_to_page(void *addr) | 226 | static inline __pure struct page *pgv_to_page(void *addr) |
227 | { | 227 | { |
228 | if (is_vmalloc_addr(addr)) | 228 | if (is_vmalloc_addr(addr)) |
229 | return vmalloc_to_page(addr); | 229 | return vmalloc_to_page(addr); |
@@ -806,6 +806,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, | |||
806 | 806 | ||
807 | __packet_set_status(po, h.raw, status); | 807 | __packet_set_status(po, h.raw, status); |
808 | smp_mb(); | 808 | smp_mb(); |
809 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1 | ||
809 | { | 810 | { |
810 | u8 *start, *end; | 811 | u8 *start, *end; |
811 | 812 | ||
@@ -813,6 +814,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, | |||
813 | for (start = h.raw; start < end; start += PAGE_SIZE) | 814 | for (start = h.raw; start < end; start += PAGE_SIZE) |
814 | flush_dcache_page(pgv_to_page(start)); | 815 | flush_dcache_page(pgv_to_page(start)); |
815 | } | 816 | } |
817 | #endif | ||
816 | 818 | ||
817 | sk->sk_data_ready(sk, 0); | 819 | sk->sk_data_ready(sk, 0); |
818 | 820 | ||