提交 ec37a48d 编写于 作者: J Jesse Gross 提交者: David S. Miller

bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.

Some cards don't support changing vlan offloading settings.  Make
Ethtool set_flags return -EINVAL in those cases.
Reported-by: NBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: NJesse Gross <jesse@nicira.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0988c4c7
...@@ -7528,7 +7528,7 @@ bnx2_set_flags(struct net_device *dev, u32 data) ...@@ -7528,7 +7528,7 @@ bnx2_set_flags(struct net_device *dev, u32 data)
if (!(bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) && if (!(bp->flags & BNX2_FLAG_CAN_KEEP_VLAN) &&
!(data & ETH_FLAG_RXVLAN)) !(data & ETH_FLAG_RXVLAN))
return -EOPNOTSUPP; return -EINVAL;
rc = ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH | ETH_FLAG_RXVLAN | rc = ethtool_op_set_flags(dev, data, ETH_FLAG_RXHASH | ETH_FLAG_RXVLAN |
ETH_FLAG_TXVLAN); ETH_FLAG_TXVLAN);
......
...@@ -1123,7 +1123,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data) ...@@ -1123,7 +1123,7 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
} }
if (!(data & ETH_FLAG_RXVLAN)) if (!(data & ETH_FLAG_RXVLAN))
return -EOPNOTSUPP; return -EINVAL;
if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa) if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册