Commit cd0fce03 authored by Breno Leitao's avatar Breno Leitao Committed by Jeff Garzik

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: default avatarBreno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 52845c3f
...@@ -371,9 +371,6 @@ static void s2io_vlan_rx_register(struct net_device *dev, ...@@ -371,9 +371,6 @@ static void s2io_vlan_rx_register(struct net_device *dev,
flags[i]); flags[i]);
} }
/* A flag indicating whether 'RX_PA_CFG_STRIP_VLAN_TAG' bit is set or not */
static int vlan_strip_flag;
/* Unregister the vlan */ /* Unregister the vlan */
static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
{ {
...@@ -2303,7 +2300,7 @@ static int start_nic(struct s2io_nic *nic) ...@@ -2303,7 +2300,7 @@ static int start_nic(struct s2io_nic *nic)
val64 = readq(&bar0->rx_pa_cfg); val64 = readq(&bar0->rx_pa_cfg);
val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG; val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG;
writeq(val64, &bar0->rx_pa_cfg); writeq(val64, &bar0->rx_pa_cfg);
vlan_strip_flag = 0; nic->vlan_strip_flag = 0;
} }
/* /*
...@@ -5010,7 +5007,7 @@ static void s2io_set_multicast(struct net_device *dev) ...@@ -5010,7 +5007,7 @@ static void s2io_set_multicast(struct net_device *dev)
val64 = readq(&bar0->rx_pa_cfg); val64 = readq(&bar0->rx_pa_cfg);
val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG; val64 &= ~RX_PA_CFG_STRIP_VLAN_TAG;
writeq(val64, &bar0->rx_pa_cfg); writeq(val64, &bar0->rx_pa_cfg);
vlan_strip_flag = 0; sp->vlan_strip_flag = 0;
} }
val64 = readq(&bar0->mac_cfg); val64 = readq(&bar0->mac_cfg);
...@@ -5032,7 +5029,7 @@ static void s2io_set_multicast(struct net_device *dev) ...@@ -5032,7 +5029,7 @@ static void s2io_set_multicast(struct net_device *dev)
val64 = readq(&bar0->rx_pa_cfg); val64 = readq(&bar0->rx_pa_cfg);
val64 |= RX_PA_CFG_STRIP_VLAN_TAG; val64 |= RX_PA_CFG_STRIP_VLAN_TAG;
writeq(val64, &bar0->rx_pa_cfg); writeq(val64, &bar0->rx_pa_cfg);
vlan_strip_flag = 1; sp->vlan_strip_flag = 1;
} }
val64 = readq(&bar0->mac_cfg); val64 = readq(&bar0->mac_cfg);
...@@ -8206,6 +8203,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) ...@@ -8206,6 +8203,11 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
/* Initialize device name */ /* Initialize device name */
sprintf(sp->name, "%s Neterion %s", dev->name, sp->product_name); sprintf(sp->name, "%s Neterion %s", dev->name, sp->product_name);
if (vlan_tag_strip)
sp->vlan_strip_flag = 1;
else
sp->vlan_strip_flag = 0;
/* /*
* Make Link state as off at this point, when the Link change * Make Link state as off at this point, when the Link change
* interrupt comes the state will be automatically changed to * interrupt comes the state will be automatically changed to
...@@ -8311,7 +8313,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip, ...@@ -8311,7 +8313,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
* If vlan stripping is disabled and the frame is VLAN tagged, * If vlan stripping is disabled and the frame is VLAN tagged,
* shift the offset by the VLAN header size bytes. * shift the offset by the VLAN header size bytes.
*/ */
if ((!vlan_strip_flag) && if ((!sp->vlan_strip_flag) &&
(rxdp->Control_1 & RXD_FRAME_VLAN_TAG)) (rxdp->Control_1 & RXD_FRAME_VLAN_TAG))
ip_off += HEADER_VLAN_SIZE; ip_off += HEADER_VLAN_SIZE;
} else { } else {
...@@ -8592,7 +8594,7 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag) ...@@ -8592,7 +8594,7 @@ static void queue_rx_frame(struct sk_buff *skb, u16 vlan_tag)
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
if (sp->vlgrp && vlan_tag if (sp->vlgrp && vlan_tag
&& (vlan_strip_flag)) { && (sp->vlan_strip_flag)) {
/* Queueing the vlan frame to the upper layer */ /* Queueing the vlan frame to the upper layer */
if (sp->config.napi) if (sp->config.napi)
vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag); vlan_hwaccel_receive_skb(skb, sp->vlgrp, vlan_tag);
......
...@@ -962,6 +962,7 @@ struct s2io_nic { ...@@ -962,6 +962,7 @@ struct s2io_nic {
int task_flag; int task_flag;
unsigned long long start_time; unsigned long long start_time;
struct vlan_group *vlgrp; struct vlan_group *vlgrp;
int vlan_strip_flag;
#define MSIX_FLG 0xA5 #define MSIX_FLG 0xA5
int num_entries; int num_entries;
struct msix_entry *entries; struct msix_entry *entries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment