Re: [PATCH 2.6.36] vlan: Avoid hwaccel vlan packets when vid not used

From: Jesse Gross
Date: Tue Dec 14 2010 - 16:46:46 EST


On Tue, Dec 14, 2010 at 11:15 AM, Matt Carlson <mcarlson@xxxxxxxxxxxx> wrote:
> @@ -9538,17 +9505,8 @@ static void __tg3_set_rx_mode(struct net_device *dev)
>        /* When ASF is in use, we always keep the RX_MODE_KEEP_VLAN_TAG
>         * flag clear.
>         */
> -#if TG3_VLAN_TAG_USED
> -       if (!tp->vlgrp &&
> -           !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
> -               rx_mode |= RX_MODE_KEEP_VLAN_TAG;
> -#else
> -       /* By definition, VLAN is disabled always in this
> -        * case.
> -        */
>        if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF))
>                rx_mode |= RX_MODE_KEEP_VLAN_TAG;
> -#endif

Just one comment:

I don't think this does quite the right thing: it will always disable
vlan stripping unless ASF is in use. However, it's now OK to always
use vlan stripping, so we might as well take advantage of it. Since
without the set_flags Ethtool op there is no way to change this
setting, we should be able to just drop this code block completely
(and the check for RX_MODE_KEEP_VLAN_TAG on receive).

In addition, this should also remove any differences between ASF
enabled/disabled firmware (at least with respect to vlans) since it
will no longer be a factor.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/