|
@@ -2477,9 +2477,9 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index)
|
|
|
/* set the tpa flag for each queue. The tpa flag determines the queue
|
|
|
* minimal size so it must be set prior to queue memory allocation
|
|
|
*/
|
|
|
- if (bp->flags & TPA_ENABLE_FLAG)
|
|
|
+ if (bp->dev->features & NETIF_F_LRO)
|
|
|
fp->mode = TPA_MODE_LRO;
|
|
|
- else if (bp->flags & GRO_ENABLE_FLAG &&
|
|
|
+ else if (bp->dev->features & NETIF_F_GRO &&
|
|
|
bnx2x_mtu_allows_gro(bp->dev->mtu))
|
|
|
fp->mode = TPA_MODE_GRO;
|
|
|
else
|
|
@@ -3249,7 +3249,7 @@ int bnx2x_low_latency_recv(struct napi_struct *napi)
|
|
|
|
|
|
if ((bp->state == BNX2X_STATE_CLOSED) ||
|
|
|
(bp->state == BNX2X_STATE_ERROR) ||
|
|
|
- (bp->flags & (TPA_ENABLE_FLAG | GRO_ENABLE_FLAG)))
|
|
|
+ (bp->dev->features & (NETIF_F_LRO | NETIF_F_GRO)))
|
|
|
return LL_FLUSH_FAILED;
|
|
|
|
|
|
if (!bnx2x_fp_lock_poll(fp))
|
|
@@ -4840,19 +4840,9 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
|
|
|
int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
|
|
|
{
|
|
|
struct bnx2x *bp = netdev_priv(dev);
|
|
|
- u32 flags = bp->flags;
|
|
|
- u32 changes;
|
|
|
+ netdev_features_t changes = features ^ dev->features;
|
|
|
bool bnx2x_reload = false;
|
|
|
-
|
|
|
- if (features & NETIF_F_LRO)
|
|
|
- flags |= TPA_ENABLE_FLAG;
|
|
|
- else
|
|
|
- flags &= ~TPA_ENABLE_FLAG;
|
|
|
-
|
|
|
- if (features & NETIF_F_GRO)
|
|
|
- flags |= GRO_ENABLE_FLAG;
|
|
|
- else
|
|
|
- flags &= ~GRO_ENABLE_FLAG;
|
|
|
+ int rc;
|
|
|
|
|
|
/* VFs or non SRIOV PFs should be able to change loopback feature */
|
|
|
if (!pci_num_vf(bp->pdev)) {
|
|
@@ -4869,24 +4859,23 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- changes = flags ^ bp->flags;
|
|
|
-
|
|
|
/* if GRO is changed while LRO is enabled, don't force a reload */
|
|
|
- if ((changes & GRO_ENABLE_FLAG) && (flags & TPA_ENABLE_FLAG))
|
|
|
- changes &= ~GRO_ENABLE_FLAG;
|
|
|
+ if ((changes & NETIF_F_GRO) && (features & NETIF_F_LRO))
|
|
|
+ changes &= ~NETIF_F_GRO;
|
|
|
|
|
|
/* if GRO is changed while HW TPA is off, don't force a reload */
|
|
|
- if ((changes & GRO_ENABLE_FLAG) && bp->disable_tpa)
|
|
|
- changes &= ~GRO_ENABLE_FLAG;
|
|
|
+ if ((changes & NETIF_F_GRO) && bp->disable_tpa)
|
|
|
+ changes &= ~NETIF_F_GRO;
|
|
|
|
|
|
if (changes)
|
|
|
bnx2x_reload = true;
|
|
|
|
|
|
- bp->flags = flags;
|
|
|
-
|
|
|
if (bnx2x_reload) {
|
|
|
- if (bp->recovery_state == BNX2X_RECOVERY_DONE)
|
|
|
- return bnx2x_reload_if_running(dev);
|
|
|
+ if (bp->recovery_state == BNX2X_RECOVERY_DONE) {
|
|
|
+ dev->features = features;
|
|
|
+ rc = bnx2x_reload_if_running(dev);
|
|
|
+ return rc ? rc : 1;
|
|
|
+ }
|
|
|
/* else: bnx2x_nic_load() will be called at end of recovery */
|
|
|
}
|
|
|
|