]> 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)
commit19a62e0f1b6946c4cff6c91ed2bc8aed5e50ee8e
treefe1ea43da98a70e32594954e67bd12cea6f7f5ad
parent4c9928874891553981e067e4af4a5785fd0fbd0d
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