aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@emulex.com>2011-02-20 06:41:53 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-22 13:26:46 -0500
commit3968fa1e58896187ee5629db0720d93b9313ad9f (patch)
treeb2ec3d6fcc3342afad5a81e0c1a6380d493bffee /drivers/net
parentb2aebe6d8102ed55c161371a6ac4d945c95c334c (diff)
be2net: fix to ignore transparent vlan ids wrongly indicated by NIC
With transparent VLAN tagging, the ASIC wrongly indicates packets with VLAN ID. Strip them off in the driver. The VLAN Tag to be stripped will be given to the host as an async message. Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/benet/be.h1
-rw-r--r--drivers/net/benet/be_cmds.c14
-rw-r--r--drivers/net/benet/be_cmds.h13
-rw-r--r--drivers/net/benet/be_main.c6
4 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index fb605e83446c..7bf8dd4edeb4 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -311,6 +311,7 @@ struct be_adapter {
311 struct be_vf_cfg vf_cfg[BE_MAX_VF]; 311 struct be_vf_cfg vf_cfg[BE_MAX_VF];
312 u8 is_virtfn; 312 u8 is_virtfn;
313 u32 sli_family; 313 u32 sli_family;
314 u16 pvid;
314}; 315};
315 316
316#define be_physfn(adapter) (!adapter->is_virtfn) 317#define be_physfn(adapter) (!adapter->is_virtfn)
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 7120106db8cb..59d25acf4374 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -124,6 +124,16 @@ static void be_async_grp5_qos_speed_process(struct be_adapter *adapter,
124 } 124 }
125} 125}
126 126
127/*Grp5 PVID evt*/
128static void be_async_grp5_pvid_state_process(struct be_adapter *adapter,
129 struct be_async_event_grp5_pvid_state *evt)
130{
131 if (evt->enabled)
132 adapter->pvid = evt->tag;
133 else
134 adapter->pvid = 0;
135}
136
127static void be_async_grp5_evt_process(struct be_adapter *adapter, 137static void be_async_grp5_evt_process(struct be_adapter *adapter,
128 u32 trailer, struct be_mcc_compl *evt) 138 u32 trailer, struct be_mcc_compl *evt)
129{ 139{
@@ -141,6 +151,10 @@ static void be_async_grp5_evt_process(struct be_adapter *adapter,
141 be_async_grp5_qos_speed_process(adapter, 151 be_async_grp5_qos_speed_process(adapter,
142 (struct be_async_event_grp5_qos_link_speed *)evt); 152 (struct be_async_event_grp5_qos_link_speed *)evt);
143 break; 153 break;
154 case ASYNC_EVENT_PVID_STATE:
155 be_async_grp5_pvid_state_process(adapter,
156 (struct be_async_event_grp5_pvid_state *)evt);
157 break;
144 default: 158 default:
145 dev_warn(&adapter->pdev->dev, "Unknown grp5 event!\n"); 159 dev_warn(&adapter->pdev->dev, "Unknown grp5 event!\n");
146 break; 160 break;
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h
index 331e9540bc74..a5af2963e7ef 100644
--- a/drivers/net/benet/be_cmds.h
+++ b/drivers/net/benet/be_cmds.h
@@ -88,6 +88,7 @@ struct be_mcc_compl {
88#define ASYNC_EVENT_CODE_GRP_5 0x5 88#define ASYNC_EVENT_CODE_GRP_5 0x5
89#define ASYNC_EVENT_QOS_SPEED 0x1 89#define ASYNC_EVENT_QOS_SPEED 0x1
90#define ASYNC_EVENT_COS_PRIORITY 0x2 90#define ASYNC_EVENT_COS_PRIORITY 0x2
91#define ASYNC_EVENT_PVID_STATE 0x3
91struct be_async_event_trailer { 92struct be_async_event_trailer {
92 u32 code; 93 u32 code;
93}; 94};
@@ -134,6 +135,18 @@ struct be_async_event_grp5_cos_priority {
134 struct be_async_event_trailer trailer; 135 struct be_async_event_trailer trailer;
135} __packed; 136} __packed;
136 137
138/* When the event code of an async trailer is GRP5 and event type is
139 * PVID state, the mcc_compl must be interpreted as follows
140 */
141struct be_async_event_grp5_pvid_state {
142 u8 enabled;
143 u8 rsvd0;
144 u16 tag;
145 u32 event_tag;
146 u32 rsvd1;
147 struct be_async_event_trailer trailer;
148} __packed;
149
137struct be_mcc_mailbox { 150struct be_mcc_mailbox {
138 struct be_mcc_wrb wrb; 151 struct be_mcc_wrb wrb;
139 struct be_mcc_compl compl; 152 struct be_mcc_compl compl;
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index b9e170da12de..cd6fda776d8d 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1047,6 +1047,9 @@ static void be_rx_compl_process(struct be_adapter *adapter,
1047 if ((adapter->function_mode & 0x400) && !vtm) 1047 if ((adapter->function_mode & 0x400) && !vtm)
1048 vlanf = 0; 1048 vlanf = 0;
1049 1049
1050 if ((adapter->pvid == vlanf) && !adapter->vlan_tag[vlanf])
1051 vlanf = 0;
1052
1050 if (unlikely(vlanf)) { 1053 if (unlikely(vlanf)) {
1051 if (!adapter->vlan_grp || adapter->vlans_added == 0) { 1054 if (!adapter->vlan_grp || adapter->vlans_added == 0) {
1052 kfree_skb(skb); 1055 kfree_skb(skb);
@@ -1087,6 +1090,9 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
1087 if ((adapter->function_mode & 0x400) && !vtm) 1090 if ((adapter->function_mode & 0x400) && !vtm)
1088 vlanf = 0; 1091 vlanf = 0;
1089 1092
1093 if ((adapter->pvid == vlanf) && !adapter->vlan_tag[vlanf])
1094 vlanf = 0;
1095
1090 skb = napi_get_frags(&eq_obj->napi); 1096 skb = napi_get_frags(&eq_obj->napi);
1091 if (!skb) { 1097 if (!skb) {
1092 be_rx_compl_discard(adapter, rxo, rxcp); 1098 be_rx_compl_discard(adapter, rxo, rxcp);