|
@@ -1299,91 +1299,6 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int bnx2x_set_flags(struct net_device *dev, u32 data)
|
|
|
-{
|
|
|
- struct bnx2x *bp = netdev_priv(dev);
|
|
|
- int changed = 0;
|
|
|
- int rc = 0;
|
|
|
-
|
|
|
- if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
|
|
- printk(KERN_ERR "Handling parity error recovery. Try again later\n");
|
|
|
- return -EAGAIN;
|
|
|
- }
|
|
|
-
|
|
|
- if (!(data & ETH_FLAG_RXVLAN))
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- rc = ethtool_op_set_flags(dev, data, ETH_FLAG_LRO | ETH_FLAG_RXVLAN |
|
|
|
- ETH_FLAG_TXVLAN | ETH_FLAG_RXHASH);
|
|
|
- if (rc)
|
|
|
- return rc;
|
|
|
-
|
|
|
- /* TPA requires Rx CSUM offloading */
|
|
|
- if ((data & ETH_FLAG_LRO) && bp->rx_csum) {
|
|
|
- if (!(bp->flags & TPA_ENABLE_FLAG)) {
|
|
|
- bp->flags |= TPA_ENABLE_FLAG;
|
|
|
- changed = 1;
|
|
|
- }
|
|
|
- } else if (bp->flags & TPA_ENABLE_FLAG) {
|
|
|
- dev->features &= ~NETIF_F_LRO;
|
|
|
- bp->flags &= ~TPA_ENABLE_FLAG;
|
|
|
- changed = 1;
|
|
|
- }
|
|
|
-
|
|
|
- if (changed && netif_running(dev)) {
|
|
|
- bnx2x_nic_unload(bp, UNLOAD_NORMAL);
|
|
|
- rc = bnx2x_nic_load(bp, LOAD_NORMAL);
|
|
|
- }
|
|
|
-
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
-static u32 bnx2x_get_rx_csum(struct net_device *dev)
|
|
|
-{
|
|
|
- struct bnx2x *bp = netdev_priv(dev);
|
|
|
-
|
|
|
- return bp->rx_csum;
|
|
|
-}
|
|
|
-
|
|
|
-static int bnx2x_set_rx_csum(struct net_device *dev, u32 data)
|
|
|
-{
|
|
|
- struct bnx2x *bp = netdev_priv(dev);
|
|
|
- int rc = 0;
|
|
|
-
|
|
|
- if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
|
|
- printk(KERN_ERR "Handling parity error recovery. Try again later\n");
|
|
|
- return -EAGAIN;
|
|
|
- }
|
|
|
-
|
|
|
- bp->rx_csum = data;
|
|
|
-
|
|
|
- /* Disable TPA, when Rx CSUM is disabled. Otherwise all
|
|
|
- TPA'ed packets will be discarded due to wrong TCP CSUM */
|
|
|
- if (!data) {
|
|
|
- u32 flags = ethtool_op_get_flags(dev);
|
|
|
-
|
|
|
- rc = bnx2x_set_flags(dev, (flags & ~ETH_FLAG_LRO));
|
|
|
- }
|
|
|
-
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
-static int bnx2x_set_tso(struct net_device *dev, u32 data)
|
|
|
-{
|
|
|
- if (data) {
|
|
|
- dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN);
|
|
|
- dev->features |= NETIF_F_TSO6;
|
|
|
- } else {
|
|
|
- dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO_ECN);
|
|
|
- dev->features &= ~NETIF_F_TSO6;
|
|
|
- }
|
|
|
-
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
static const struct {
|
|
|
char string[ETH_GSTRING_LEN];
|
|
|
} bnx2x_tests_str_arr[BNX2X_NUM_TESTS] = {
|
|
@@ -2207,16 +2122,6 @@ static const struct ethtool_ops bnx2x_ethtool_ops = {
|
|
|
.set_ringparam = bnx2x_set_ringparam,
|
|
|
.get_pauseparam = bnx2x_get_pauseparam,
|
|
|
.set_pauseparam = bnx2x_set_pauseparam,
|
|
|
- .get_rx_csum = bnx2x_get_rx_csum,
|
|
|
- .set_rx_csum = bnx2x_set_rx_csum,
|
|
|
- .get_tx_csum = ethtool_op_get_tx_csum,
|
|
|
- .set_tx_csum = ethtool_op_set_tx_hw_csum,
|
|
|
- .set_flags = bnx2x_set_flags,
|
|
|
- .get_flags = ethtool_op_get_flags,
|
|
|
- .get_sg = ethtool_op_get_sg,
|
|
|
- .set_sg = ethtool_op_set_sg,
|
|
|
- .get_tso = ethtool_op_get_tso,
|
|
|
- .set_tso = bnx2x_set_tso,
|
|
|
.self_test = bnx2x_self_test,
|
|
|
.get_sset_count = bnx2x_get_sset_count,
|
|
|
.get_strings = bnx2x_get_strings,
|