net: hns3: fix ethtool tx copybreak buf size indicating not aligned issue
[linux-2.6-microblaze.git] / drivers / net / ethernet / hisilicon / hns3 / hns3_ethtool.c
index 6469238..ae30dbe 100644 (file)
@@ -1818,7 +1818,8 @@ static int hns3_set_tunable(struct net_device *netdev,
                old_tx_spare_buf_size = h->kinfo.tx_spare_buf_size;
                new_tx_spare_buf_size = *(u32 *)data;
                ret = hns3_set_tx_spare_buf_size(netdev, new_tx_spare_buf_size);
-               if (ret) {
+               if (ret ||
+                   (!priv->ring->tx_spare && new_tx_spare_buf_size != 0)) {
                        int ret1;
 
                        netdev_warn(netdev,