aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x/bnx2x_ethtool.c
diff options
context:
space:
mode:
authorHao Zheng <hzheng@nicira.com>2010-10-20 09:56:11 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 04:26:56 -0400
commit9bcc08939223c5a2bad42748ee53ab69f5338a32 (patch)
tree174e77181d9325bf39c738c02af98e5667cd9403 /drivers/net/bnx2x/bnx2x_ethtool.c
parentf62bbb5e62c6e4a91fb222d22bc46e8d4d7e59ef (diff)
bnx2x: Update bnx2x to use new vlan accleration.
Make the bnx2x driver use the new vlan accleration model. Signed-off-by: Hao Zheng <hzheng@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com> CC: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_ethtool.c')
-rw-r--r--drivers/net/bnx2x/bnx2x_ethtool.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index 54fe0615a8b9..daefef618ef7 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -1117,35 +1117,34 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)
1117 int changed = 0; 1117 int changed = 0;
1118 int rc = 0; 1118 int rc = 0;
1119 1119
1120 if (data & ~(ETH_FLAG_LRO | ETH_FLAG_RXHASH))
1121 return -EINVAL;
1122
1123 if (bp->recovery_state != BNX2X_RECOVERY_DONE) { 1120 if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
1124 printk(KERN_ERR "Handling parity error recovery. Try again later\n"); 1121 printk(KERN_ERR "Handling parity error recovery. Try again later\n");
1125 return -EAGAIN; 1122 return -EAGAIN;
1126 } 1123 }
1127 1124
1125 if (!(data & ETH_FLAG_RXVLAN))
1126 return -EOPNOTSUPP;
1127
1128 if ((data & ETH_FLAG_LRO) && bp->rx_csum && bp->disable_tpa)
1129 return -EINVAL;
1130
1131 rc = ethtool_op_set_flags(dev, data, ETH_FLAG_LRO | ETH_FLAG_RXVLAN |
1132 ETH_FLAG_TXVLAN | ETH_FLAG_RXHASH);
1133 if (rc)
1134 return rc;
1135
1128 /* TPA requires Rx CSUM offloading */ 1136 /* TPA requires Rx CSUM offloading */
1129 if ((data & ETH_FLAG_LRO) && bp->rx_csum) { 1137 if ((data & ETH_FLAG_LRO) && bp->rx_csum) {
1130 if (!bp->disable_tpa) { 1138 if (!(bp->flags & TPA_ENABLE_FLAG)) {
1131 if (!(dev->features & NETIF_F_LRO)) { 1139 bp->flags |= TPA_ENABLE_FLAG;
1132 dev->features |= NETIF_F_LRO; 1140 changed = 1;
1133 bp->flags |= TPA_ENABLE_FLAG; 1141 }
1134 changed = 1; 1142 } else if (bp->flags & TPA_ENABLE_FLAG) {
1135 }
1136 } else
1137 rc = -EINVAL;
1138 } else if (dev->features & NETIF_F_LRO) {
1139 dev->features &= ~NETIF_F_LRO; 1143 dev->features &= ~NETIF_F_LRO;
1140 bp->flags &= ~TPA_ENABLE_FLAG; 1144 bp->flags &= ~TPA_ENABLE_FLAG;
1141 changed = 1; 1145 changed = 1;
1142 } 1146 }
1143 1147
1144 if (data & ETH_FLAG_RXHASH)
1145 dev->features |= NETIF_F_RXHASH;
1146 else
1147 dev->features &= ~NETIF_F_RXHASH;
1148
1149 if (changed && netif_running(dev)) { 1148 if (changed && netif_running(dev)) {
1150 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 1149 bnx2x_nic_unload(bp, UNLOAD_NORMAL);
1151 rc = bnx2x_nic_load(bp, LOAD_NORMAL); 1150 rc = bnx2x_nic_load(bp, LOAD_NORMAL);