Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s2io: Fix enabling VLAN tag stripping at driver initialization

VLAN doesn't work except if you'd opened the interface in promiscuous
mode before. This happens because VLAN tag stripping is not correctly
marked as enabled at device startup

Also, the vlan_strip_flag field was moved to the private network
structure.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Breno Leitao and committed by
Jeff Garzik
cd0fce03 52845c3f

+11 -8
+10 -8
drivers/net/s2io.c
··· 371 371 flags[i]); 372 372 } 373 373 374 - /* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */ 375 - static int vlan_strip_flag; 376 - 377 374 /* Unregister the vlan */ 378 375 static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) 379 376 { ··· 2300 2303 val64 = readq(&bar0->rx_pa_cfg); 2301 2304 val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG; 2302 2305 writeq(val64, &bar0->rx_pa_cfg); 2303 - vlan_strip_flag = 0; 2306 + nic->vlan_strip_flag = 0; 2304 2307 } 2305 2308 2306 2309 /* ··· 5007 5010 val64 = readq(&bar0->rx_pa_cfg); 5008 5011 val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG; 5009 5012 writeq(val64, &bar0->rx_pa_cfg); 5010 - vlan_strip_flag = 0; 5013 + sp->vlan_strip_flag = 0; 5011 5014 } 5012 5015 5013 5016 val64 = readq(&bar0->mac_cfg); ··· 5029 5032 val64 = readq(&bar0->rx_pa_cfg); 5030 5033 val64 |= RX_PA_CFG_STRIP_VLAN_TAG; 5031 5034 writeq(val64, &bar0->rx_pa_cfg); 5032 - vlan_strip_flag = 1; 5035 + sp->vlan_strip_flag = 1; 5033 5036 } 5034 5037 5035 5038 val64 = readq(&bar0->mac_cfg); ··· 8203 8206 /* Initialize device name */ 8204 8207 sprintf(sp->name, "%s Neterion %s", dev->name, sp->product_name); 8205 8208 8209 + if (vlan_tag_strip) 8210 + sp->vlan_strip_flag = 1; 8211 + else 8212 + sp->vlan_strip_flag = 0; 8213 + 8206 8214 /* 8207 8215 * Make Link state as off at this point, when the Link change 8208 8216 * interrupt comes the state will be automatically changed to ··· 8313 8311 * If vlan stripping is disabled and the frame is VLAN tagged, 8314 8312 * shift the offset by the VLAN header size bytes. 8315 8313 */ 8316 - if ((!vlan_strip_flag) && 8314 + if ((!sp->vlan_strip_flag) && 8317 8315 (rxdp->Control_1 & RXD_FRAME_VLAN_TAG)) 8318 8316 ip_off += HEADER_VLAN_SIZE; 8319 8317 } else { ··· 8594 8592 8595 8593 skb->protocol = eth_type_trans(skb, dev); 8596 8594 if (sp->vlgrp && vlan_tag 8597 - && (vlan_strip_flag)) { 8595 + && (sp->vlan_strip_flag)) { 8598 8596 /* Queueing the vlan frame to the upper layer */ 8599 8597 if (sp->config.napi) 8600 8598 vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag);
+1
drivers/net/s2io.h
··· 962 962 int task_flag; 963 963 unsigned long long start_time; 964 964 struct vlan_group *vlgrp; 965 + int vlan_strip_flag; 965 966 #define MSIX_FLG 0xA5 966 967 int num_entries; 967 968 struct msix_entry *entries;