Commit b25ddb00 authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

qlcnic: remove assumption that vlan_tci != 0

VLAN.TCI == 0 is perfectly valid (802.1p), so allow it to be accelerated.
Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e84b4794
...@@ -459,7 +459,7 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter, ...@@ -459,7 +459,7 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter,
struct cmd_desc_type0 *first_desc, struct sk_buff *skb, struct cmd_desc_type0 *first_desc, struct sk_buff *skb,
struct qlcnic_host_tx_ring *tx_ring) struct qlcnic_host_tx_ring *tx_ring)
{ {
u8 l4proto, opcode = 0, hdr_len = 0; u8 l4proto, opcode = 0, hdr_len = 0, tag_vlan = 0;
u16 flags = 0, vlan_tci = 0; u16 flags = 0, vlan_tci = 0;
int copied, offset, copy_len, size; int copied, offset, copy_len, size;
struct cmd_desc_type0 *hwdesc; struct cmd_desc_type0 *hwdesc;
...@@ -472,14 +472,16 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter, ...@@ -472,14 +472,16 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter,
flags = QLCNIC_FLAGS_VLAN_TAGGED; flags = QLCNIC_FLAGS_VLAN_TAGGED;
vlan_tci = ntohs(vh->h_vlan_TCI); vlan_tci = ntohs(vh->h_vlan_TCI);
protocol = ntohs(vh->h_vlan_encapsulated_proto); protocol = ntohs(vh->h_vlan_encapsulated_proto);
tag_vlan = 1;
} else if (skb_vlan_tag_present(skb)) { } else if (skb_vlan_tag_present(skb)) {
flags = QLCNIC_FLAGS_VLAN_OOB; flags = QLCNIC_FLAGS_VLAN_OOB;
vlan_tci = skb_vlan_tag_get(skb); vlan_tci = skb_vlan_tag_get(skb);
tag_vlan = 1;
} }
if (unlikely(adapter->tx_pvid)) { if (unlikely(adapter->tx_pvid)) {
if (vlan_tci && !(adapter->flags & QLCNIC_TAGGING_ENABLED)) if (tag_vlan && !(adapter->flags & QLCNIC_TAGGING_ENABLED))
return -EIO; return -EIO;
if (vlan_tci && (adapter->flags & QLCNIC_TAGGING_ENABLED)) if (tag_vlan && (adapter->flags & QLCNIC_TAGGING_ENABLED))
goto set_flags; goto set_flags;
flags = QLCNIC_FLAGS_VLAN_OOB; flags = QLCNIC_FLAGS_VLAN_OOB;
......
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