]> git.baikalelectronics.ru Git - kernel.git/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)
commit6121349cc26b80887dfe6d562a388e664ba25f3e
treeb3de1c314e0d71c792c1dc6de81ffee563e2e0b4
parent17a3885f225b251f62110be629d832105e988887
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