]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'netdev-page_frag_alloc-fixes'
authorDavid S. Miller <davem@davemloft.net>
Sun, 17 Feb 2019 23:48:43 +0000 (15:48 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Feb 2019 23:48:43 +0000 (15:48 -0800)
commitd6d911e1c41fb1e842bc2a73e3a7240d2fcf10e9
tree1ff1c631dd480f88ed716d02d858bba7530726d6
parentc81c3cf2ece058e18b69af168766bc3ead340c80
parent883bf8b60d63749fd169c4fcb9248d4a6df11ea9
Merge branch 'netdev-page_frag_alloc-fixes'

Alexander Duyck says:

====================
Address recent issues found in netdev page_frag_alloc usage

This patch set addresses a couple of issues that I had pointed out to Jann
Horn in response to a recent patch submission.

The first issue is that I wanted to avoid the need to read/modify/write the
size value in order to generate the value for pagecnt_bias. Instead we can
just use a fixed constant which reduces the need for memory read operations
and the overall number of instructions to update the pagecnt bias values.

The other, and more important issue is, that apparently we were letting tun
access the napi_alloc_cache indirectly through netdev_alloc_frag and as a
result letting it create unaligned accesses via unaligned allocations. In
order to prevent this I have added a call to SKB_DATA_ALIGN for the fragsz
field so that we will keep the offset in the napi_alloc_cache
SMP_CACHE_BYTES aligned.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>