提交 f6dafa95 编写于 作者: C Changli Gao 提交者: David S. Miller

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: NChangli Gao <xiaosuo@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 15c2d75f
...@@ -223,7 +223,7 @@ struct packet_skb_cb { ...@@ -223,7 +223,7 @@ struct packet_skb_cb {
#define PACKET_SKB_CB(__skb) ((struct packet_skb_cb *)((__skb)->cb)) #define PACKET_SKB_CB(__skb) ((struct packet_skb_cb *)((__skb)->cb))
static inline struct page *pgv_to_page(void *addr) static inline __pure struct page *pgv_to_page(void *addr)
{ {
if (is_vmalloc_addr(addr)) if (is_vmalloc_addr(addr))
return vmalloc_to_page(addr); return vmalloc_to_page(addr);
...@@ -806,6 +806,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -806,6 +806,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
__packet_set_status(po, h.raw, status); __packet_set_status(po, h.raw, status);
smp_mb(); smp_mb();
#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE == 1
{ {
u8 *start, *end; u8 *start, *end;
...@@ -813,6 +814,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -813,6 +814,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
for (start = h.raw; start < end; start += PAGE_SIZE) for (start = h.raw; start < end; start += PAGE_SIZE)
flush_dcache_page(pgv_to_page(start)); flush_dcache_page(pgv_to_page(start));
} }
#endif
sk->sk_data_ready(sk, 0); sk->sk_data_ready(sk, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册