]> git.itanic.dy.fi Git - linux-stable/commit
net: hns3: Add support for using order 1 pages with a 4K buffer
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 29 Jul 2019 02:53:30 +0000 (10:53 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Jul 2019 15:23:41 +0000 (08:23 -0700)
commitdbba6da0c67ca99721b74760d3cc69df8a5a8230
treeb3de1c314e0d71c792c1dc6de81ffee563e2e0b4
parent0812545487eca362126cc1ef6b7798ecac693629
net: hns3: Add support for using order 1 pages with a 4K buffer

Hardware supports 0.5K, 1K, 2K, 4K RX buffer size, the
RX buffer can not be reused because the hns3_page_order
return 0 when page size and RX buffer size are both 4096.

So this patch changes the hns3_page_order to return 1 when
RX buffer is greater than half of the page size and page size
is less the 8192, and dev_alloc_pages has already been used
to allocate the compound page for RX buffer.

This patch also changes hnae3_* to hns3_* for page order
and RX buffer size calculation because they are used in
hns3 module.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Reviewed-by: Peng Li <lipeng321@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
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h