提交 a92dbd96 编写于 作者: E Ezequiel Garcia 提交者: David S. Miller

net: mvneta: Check tx queue setup error in mvneta_change_mtu()

This commit checks the return code of mvneta_setup_txq() call
in mvneta_change_mtu(). Also, use the netdevice pointer directly
instead of dereferencing the port structure. While here, let's
fix a tiny comment typo.
Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3d4ea02f
...@@ -2425,24 +2425,28 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu) ...@@ -2425,24 +2425,28 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
return 0; return 0;
/* The interface is running, so we have to force a /* The interface is running, so we have to force a
* reallocation of the RXQs * reallocation of the queues
*/ */
mvneta_stop_dev(pp); mvneta_stop_dev(pp);
mvneta_cleanup_txqs(pp); mvneta_cleanup_txqs(pp);
mvneta_cleanup_rxqs(pp); mvneta_cleanup_rxqs(pp);
pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu);
pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
ret = mvneta_setup_rxqs(pp); ret = mvneta_setup_rxqs(pp);
if (ret) { if (ret) {
netdev_err(pp->dev, "unable to setup rxqs after MTU change\n"); netdev_err(dev, "unable to setup rxqs after MTU change\n");
return ret; return ret;
} }
mvneta_setup_txqs(pp); ret = mvneta_setup_txqs(pp);
if (ret) {
netdev_err(dev, "unable to setup txqs after MTU change\n");
return ret;
}
mvneta_start_dev(pp); mvneta_start_dev(pp);
mvneta_port_up(pp); mvneta_port_up(pp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册