Skb frags may be backed by highmem and/or compound pages. Highmem pages need kmap_atomic mappings to access. But kmap_atomic maps a single page, not the entire compound page. skb_foreach_page iterates over an skb frag, in one step in the common case, page by page only if kmap_atomic must be called for each page. The decision logic is captured in skb_frag_must_loop. CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP extends kmap from highmem to all pages, to increase code coverage. Extend skb_frag_must_loop to this new condition.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -366,7 +366,7 @@ static inline void skb_frag_size_sub(skb_frag_t *frag, int delta) · 365 unmodified lines | ||
| 366 | 366 | static inline bool skb_frag_must_loop(struct page *p) |
| 367 | 367 | { |
| 368 | 368 | #if defined(CONFIG_HIGHMEM) |
| 369 | − if (PageHighMem(p)) | |
| 369 | + if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP) || PageHighMem(p)) | |
| 370 | 370 | return true; |
| 371 | 371 | #endif |
| 372 | 372 | return false; |