Commit 3968fa1e authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller

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: default avatarAjit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b2aebe6d
...@@ -311,6 +311,7 @@ struct be_adapter { ...@@ -311,6 +311,7 @@ struct be_adapter {
struct be_vf_cfg vf_cfg[BE_MAX_VF]; struct be_vf_cfg vf_cfg[BE_MAX_VF];
u8 is_virtfn; u8 is_virtfn;
u32 sli_family; u32 sli_family;
u16 pvid;
}; };
#define be_physfn(adapter) (!adapter->is_virtfn) #define be_physfn(adapter) (!adapter->is_virtfn)
......
...@@ -124,6 +124,16 @@ static void be_async_grp5_qos_speed_process(struct be_adapter *adapter, ...@@ -124,6 +124,16 @@ static void be_async_grp5_qos_speed_process(struct be_adapter *adapter,
} }
} }
/*Grp5 PVID evt*/
static void be_async_grp5_pvid_state_process(struct be_adapter *adapter,
struct be_async_event_grp5_pvid_state *evt)
{
if (evt->enabled)
adapter->pvid = evt->tag;
else
adapter->pvid = 0;
}
static void be_async_grp5_evt_process(struct be_adapter *adapter, static void be_async_grp5_evt_process(struct be_adapter *adapter,
u32 trailer, struct be_mcc_compl *evt) u32 trailer, struct be_mcc_compl *evt)
{ {
...@@ -141,6 +151,10 @@ static void be_async_grp5_evt_process(struct be_adapter *adapter, ...@@ -141,6 +151,10 @@ static void be_async_grp5_evt_process(struct be_adapter *adapter,
be_async_grp5_qos_speed_process(adapter, be_async_grp5_qos_speed_process(adapter,
(struct be_async_event_grp5_qos_link_speed *)evt); (struct be_async_event_grp5_qos_link_speed *)evt);
break; break;
case ASYNC_EVENT_PVID_STATE:
be_async_grp5_pvid_state_process(adapter,
(struct be_async_event_grp5_pvid_state *)evt);
break;
default: default:
dev_warn(&adapter->pdev->dev, "Unknown grp5 event!\n"); dev_warn(&adapter->pdev->dev, "Unknown grp5 event!\n");
break; break;
......
...@@ -88,6 +88,7 @@ struct be_mcc_compl { ...@@ -88,6 +88,7 @@ struct be_mcc_compl {
#define ASYNC_EVENT_CODE_GRP_5 0x5 #define ASYNC_EVENT_CODE_GRP_5 0x5
#define ASYNC_EVENT_QOS_SPEED 0x1 #define ASYNC_EVENT_QOS_SPEED 0x1
#define ASYNC_EVENT_COS_PRIORITY 0x2 #define ASYNC_EVENT_COS_PRIORITY 0x2
#define ASYNC_EVENT_PVID_STATE 0x3
struct be_async_event_trailer { struct be_async_event_trailer {
u32 code; u32 code;
}; };
...@@ -134,6 +135,18 @@ struct be_async_event_grp5_cos_priority { ...@@ -134,6 +135,18 @@ struct be_async_event_grp5_cos_priority {
struct be_async_event_trailer trailer; struct be_async_event_trailer trailer;
} __packed; } __packed;
/* When the event code of an async trailer is GRP5 and event type is
* PVID state, the mcc_compl must be interpreted as follows
*/
struct be_async_event_grp5_pvid_state {
u8 enabled;
u8 rsvd0;
u16 tag;
u32 event_tag;
u32 rsvd1;
struct be_async_event_trailer trailer;
} __packed;
struct be_mcc_mailbox { struct be_mcc_mailbox {
struct be_mcc_wrb wrb; struct be_mcc_wrb wrb;
struct be_mcc_compl compl; struct be_mcc_compl compl;
......
...@@ -1047,6 +1047,9 @@ static void be_rx_compl_process(struct be_adapter *adapter, ...@@ -1047,6 +1047,9 @@ static void be_rx_compl_process(struct be_adapter *adapter,
if ((adapter->function_mode & 0x400) && !vtm) if ((adapter->function_mode & 0x400) && !vtm)
vlanf = 0; vlanf = 0;
if ((adapter->pvid == vlanf) && !adapter->vlan_tag[vlanf])
vlanf = 0;
if (unlikely(vlanf)) { if (unlikely(vlanf)) {
if (!adapter->vlan_grp || adapter->vlans_added == 0) { if (!adapter->vlan_grp || adapter->vlans_added == 0) {
kfree_skb(skb); kfree_skb(skb);
...@@ -1087,6 +1090,9 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, ...@@ -1087,6 +1090,9 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
if ((adapter->function_mode & 0x400) && !vtm) if ((adapter->function_mode & 0x400) && !vtm)
vlanf = 0; vlanf = 0;
if ((adapter->pvid == vlanf) && !adapter->vlan_tag[vlanf])
vlanf = 0;
skb = napi_get_frags(&eq_obj->napi); skb = napi_get_frags(&eq_obj->napi);
if (!skb) { if (!skb) {
be_rx_compl_discard(adapter, rxo, rxcp); be_rx_compl_discard(adapter, rxo, rxcp);
......
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