]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: reallocate tx/rx buffer after changing mtu
authorFuyun Liang <liangfuyun1@huawei.com>
Wed, 21 Mar 2018 07:49:20 +0000 (15:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Mar 2018 17:12:01 +0000 (13:12 -0400)
commit6af686116dcbbcc4591ee1616bfb6689aacd6c79
treefe1ea43da98a70e32594954e67bd12cea6f7f5ad
parent5770814a897648bf73ee91fbb2fbfb1e520ee062
net: hns3: reallocate tx/rx buffer after changing mtu

When changing the mtu, the max frame size also will be changed. The tx
buffer size and the rx buffer size to be allocated are determined by max
frame size. So when max frame size is changed, the tx buffer and rx buffer
need to be reallocated.

When the tc_num is changed, the tx buffer and rx buffer need to be
reallocated too. So calling set_mtu and buffer_alloc separately is better.

Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c