提交 deaec0f6 编写于 作者: S Stanislaw Gruszka 提交者: David S. Miller

qlcnic: fail when try to setup unsupported features

Signed-off-by: NStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ef2519b1
......@@ -983,12 +983,19 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
struct qlcnic_adapter *adapter = netdev_priv(netdev);
int hw_lro;
if (data & ~ETH_FLAG_LRO)
return -EOPNOTSUPP;
if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
return -EINVAL;
ethtool_op_set_flags(netdev, data);
hw_lro = (data & ETH_FLAG_LRO) ? QLCNIC_LRO_ENABLED : 0;
if (data & ETH_FLAG_LRO) {
hw_lro = QLCNIC_LRO_ENABLED;
netdev->features |= NETIF_F_LRO;
} else {
hw_lro = 0;
netdev->features &= ~NETIF_F_LRO;
}
if (qlcnic_config_hw_lro(adapter, hw_lro))
return -EIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册