diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2018-11-07 11:50:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-08 01:37:55 -0500 |
commit | b25ddb00bc1b96613edcb525f19203a7d1405fce (patch) | |
tree | 8577994a6bf89c08ef10ad6219ffeb8bf1642793 | |
parent | e84b47941e15e6666afb8ee8b21d1c3fc1a013af (diff) |
qlcnic: remove assumption that vlan_tci != 0
VLAN.TCI == 0 is perfectly valid (802.1p), so allow it to be accelerated.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 9647578cbe6a..14f26bf3b388 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -459,7 +459,7 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter, | |||
459 | struct cmd_desc_type0 *first_desc, struct sk_buff *skb, | 459 | struct cmd_desc_type0 *first_desc, struct sk_buff *skb, |
460 | struct qlcnic_host_tx_ring *tx_ring) | 460 | struct qlcnic_host_tx_ring *tx_ring) |
461 | { | 461 | { |
462 | u8 l4proto, opcode = 0, hdr_len = 0; | 462 | u8 l4proto, opcode = 0, hdr_len = 0, tag_vlan = 0; |
463 | u16 flags = 0, vlan_tci = 0; | 463 | u16 flags = 0, vlan_tci = 0; |
464 | int copied, offset, copy_len, size; | 464 | int copied, offset, copy_len, size; |
465 | struct cmd_desc_type0 *hwdesc; | 465 | struct cmd_desc_type0 *hwdesc; |
@@ -472,14 +472,16 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter, | |||
472 | flags = QLCNIC_FLAGS_VLAN_TAGGED; | 472 | flags = QLCNIC_FLAGS_VLAN_TAGGED; |
473 | vlan_tci = ntohs(vh->h_vlan_TCI); | 473 | vlan_tci = ntohs(vh->h_vlan_TCI); |
474 | protocol = ntohs(vh->h_vlan_encapsulated_proto); | 474 | protocol = ntohs(vh->h_vlan_encapsulated_proto); |
475 | tag_vlan = 1; | ||
475 | } else if (skb_vlan_tag_present(skb)) { | 476 | } else if (skb_vlan_tag_present(skb)) { |
476 | flags = QLCNIC_FLAGS_VLAN_OOB; | 477 | flags = QLCNIC_FLAGS_VLAN_OOB; |
477 | vlan_tci = skb_vlan_tag_get(skb); | 478 | vlan_tci = skb_vlan_tag_get(skb); |
479 | tag_vlan = 1; | ||
478 | } | 480 | } |
479 | if (unlikely(adapter->tx_pvid)) { | 481 | if (unlikely(adapter->tx_pvid)) { |
480 | if (vlan_tci && !(adapter->flags & QLCNIC_TAGGING_ENABLED)) | 482 | if (tag_vlan && !(adapter->flags & QLCNIC_TAGGING_ENABLED)) |
481 | return -EIO; | 483 | return -EIO; |
482 | if (vlan_tci && (adapter->flags & QLCNIC_TAGGING_ENABLED)) | 484 | if (tag_vlan && (adapter->flags & QLCNIC_TAGGING_ENABLED)) |
483 | goto set_flags; | 485 | goto set_flags; |
484 | 486 | ||
485 | flags = QLCNIC_FLAGS_VLAN_OOB; | 487 | flags = QLCNIC_FLAGS_VLAN_OOB; |