page_pool: fix logic in __page_pool_get_cached
authorJonathan Lemon <jonathan.lemon@gmail.com>
Tue, 13 Aug 2019 17:45:09 +0000 (10:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Aug 2019 19:27:36 +0000 (12:27 -0700)
commit8d73f8f23e6b869b726cb01dd4747f56dc88660a
treea19e6d1e6829a6106b80e66a2440960cc2a164fa
parent4b58c9b127f04bb3eea5a2a9ab8ef039b9fe9b71
page_pool: fix logic in __page_pool_get_cached

__page_pool_get_cached() will return NULL when the ring is
empty, even if there are pages present in the lookaside cache.

It is also possible to refill the cache, and then return a
NULL page.

Restructure the logic so eliminate both cases.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/page_pool.c