Re: [PATCH] net: bnx2x: convert to hw_features

Michał Mirosław
2011-04-10T15:23:38Z

On Sun, Apr 10, 2011 at 06:10:14PM +0300, Vladislav Zolotarov wrote:
> > +int bnx2x_set_features(struct net_device *dev, u32 features)
> > +{
> > + struct bnx2x *bp = netdev_priv(dev);
> > + u32 flags = bp->flags;
> > +
> > + if (features & NETIF_F_LRO)
> > + flags |= TPA_ENABLE_FLAG;
> > + else
> > + flags &= ~TPA_ENABLE_FLAG;
> > +
> > + if (flags ^ bp->flags) {
> > + bp->flags = flags;
> > +
> > + return bnx2x_reload_if_running(dev);
> > }
> >
> > - return rc;
> > + return 0;
> > }
>
> Thanks a lot, Michal. Looks ok but one remark below.
>
> Every time bnx2x_reload_if_running(dev) is called one has to check if
> there is still a recovery process in progress like u did in the
> bnx2x_fix_features(). So this check is missing in the function above.

bnx2x_set_features() might be called only if bnx2x_fix_features() returns
different feature set than what's already set in dev->features. So this
case is implicitly covered. I'll add a comment for this.

Best Regards,
Michał Mirosław