commit 5b9d245c47cf3c3b2e712a6b097e7c6b8c832324 Author: Steven Smith Date: Fri Oct 30 10:55:21 2009 +0000 netback: make sure that pg->mapping is never NULL for a page mapped from a foreign domain. Otherwise, the foreign maps tracking infrastructure gets confused, and thinks that the foreign page is local. This means that you can't forward that packet to another foreign domain. This leads to very high packet drop, and hence very poor performance. Signed-off-by: Steven Smith diff --git a/drivers/xen/netback/netback.c b/drivers/xen/netback/netback.c index 65aa74e..c24debf 100644 --- a/drivers/xen/netback/netback.c +++ b/drivers/xen/netback/netback.c @@ -98,12 +98,12 @@ static inline unsigned long idx_to_kaddr(unsigned int idx) /* extra field used in struct page */ static inline void netif_set_page_index(struct page *pg, unsigned int index) { - *(unsigned long *)&pg->mapping = index; + *(unsigned long *)&pg->mapping = index + 1; } static inline int netif_page_index(struct page *pg) { - unsigned long idx = (unsigned long)pg->mapping; + unsigned long idx = (unsigned long)pg->mapping - 1; if (!PageForeign(pg)) return -1;