Thread (29 messages) 29 messages, 8 authors, 2011-03-08

Re: [net-next 08/12] ixgb: convert to new VLAN model

flat view

From: Jesse Gross <hidden>
Date: 2011-01-07 15:41:19

On Thu, Jan 6, 2011 at 7:29 PM,  [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+static int ixgb_set_flags(struct net_device *netdev, u32 data)
+{
+       struct ixgb_adapter *adapter = netdev_priv(netdev);
+       bool need_reset;
+       int rc;
+
+       /*
+        * TX vlan insertion does not work per HW design when Rx stripping is
+        * disabled.  Disable txvlan when rxvlan is off.
+        */
+       if ((data & ETH_FLAG_RXVLAN) != (netdev->features & NETIF_F_HW_VLAN_RX))
+               data ^= ETH_FLAG_TXVLAN;
Does this really do the right thing?  If the RX vlan setting is
changed, it will do the opposite of what the user requested for TX
vlan?

So if I start with both on (the default) and turn them both off in one
command (a valid setting), I will get RX off and TX on (an invalid
setting).

Why not:

if (!(data & ETH_FLAG_RXVLAN))
        data &= ~ETH_FLAG_TXVLAN;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help