net: hns3: unify the page reusing for page size 4K and 64K
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 6 May 2019 02:48:50 +0000 (10:48 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 7 May 2019 17:37:14 +0000 (10:37 -0700)
commit389ca14615e5ea4f9a56d765ac1e0da22d8105c3
tree8ff37e077d62268317c86a1c95f634f3fd37a000
parentce74370c2ce9a90c16167131f837e14b5e3c57ed
net: hns3: unify the page reusing for page size 4K and 64K

When page size is 64K, RX buffer is currently not reused when the
page_offset is moved to last buffer. This patch adds checking to
decide whether the buffer page can be reused when last_offset is
moved beyond last offset.

If the driver is the only user of page when page_offset is moved
to beyond last offset, then buffer can be reused and page_offset
is set to zero.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c