提交 15d72184 编写于 作者: S Sathya Perla 提交者: David S. Miller

be2net: parse vid and vtm fields of rx-compl only if vlanf bit is set

Signed-off-by: NSathya Perla <sathya.perla@emulex.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ac6a0c4a
...@@ -1101,8 +1101,12 @@ static void be_parse_rx_compl_v1(struct be_adapter *adapter, ...@@ -1101,8 +1101,12 @@ static void be_parse_rx_compl_v1(struct be_adapter *adapter,
AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl); AMAP_GET_BITS(struct amap_eth_rx_compl_v1, numfrags, compl);
rxcp->pkt_type = rxcp->pkt_type =
AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl); AMAP_GET_BITS(struct amap_eth_rx_compl_v1, cast_enc, compl);
rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm, compl); if (rxcp->vlanf) {
rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag, compl); rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vtm,
compl);
rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v1, vlan_tag,
compl);
}
} }
static void be_parse_rx_compl_v0(struct be_adapter *adapter, static void be_parse_rx_compl_v0(struct be_adapter *adapter,
...@@ -1127,8 +1131,12 @@ static void be_parse_rx_compl_v0(struct be_adapter *adapter, ...@@ -1127,8 +1131,12 @@ static void be_parse_rx_compl_v0(struct be_adapter *adapter,
AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl); AMAP_GET_BITS(struct amap_eth_rx_compl_v0, numfrags, compl);
rxcp->pkt_type = rxcp->pkt_type =
AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl); AMAP_GET_BITS(struct amap_eth_rx_compl_v0, cast_enc, compl);
rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm, compl); if (rxcp->vlanf) {
rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag, compl); rxcp->vtm = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vtm,
compl);
rxcp->vid = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, vlan_tag,
compl);
}
} }
static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
...@@ -1150,15 +1158,19 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) ...@@ -1150,15 +1158,19 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
else else
be_parse_rx_compl_v0(adapter, compl, rxcp); be_parse_rx_compl_v0(adapter, compl, rxcp);
/* vlanf could be wrongly set in some cards. ignore if vtm is not set */ if (rxcp->vlanf) {
if ((adapter->function_mode & 0x400) && !rxcp->vtm) /* vlanf could be wrongly set in some cards.
rxcp->vlanf = 0; * ignore if vtm is not set */
if ((adapter->function_mode & 0x400) && !rxcp->vtm)
rxcp->vlanf = 0;
if (!lancer_chip(adapter)) if (!lancer_chip(adapter))
rxcp->vid = swab16(rxcp->vid); rxcp->vid = swab16(rxcp->vid);
if ((adapter->pvid == rxcp->vid) && !adapter->vlan_tag[rxcp->vid]) if ((adapter->pvid == rxcp->vid) &&
rxcp->vlanf = 0; !adapter->vlan_tag[rxcp->vid])
rxcp->vlanf = 0;
}
/* As the compl has been parsed, reset it; we wont touch it again */ /* As the compl has been parsed, reset it; we wont touch it again */
compl->dw[offsetof(struct amap_eth_rx_compl_v1, valid) / 32] = 0; compl->dw[offsetof(struct amap_eth_rx_compl_v1, valid) / 32] = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册