Skip to content

Commit b25ddb0

Browse files
osctobedavem330
authored andcommitted
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>
1 parent e84b479 commit b25ddb0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter,
459459
struct cmd_desc_type0 *first_desc, struct sk_buff *skb,
460460
struct qlcnic_host_tx_ring *tx_ring)
461461
{
462-
u8 l4proto, opcode = 0, hdr_len = 0;
462+
u8 l4proto, opcode = 0, hdr_len = 0, tag_vlan = 0;
463463
u16 flags = 0, vlan_tci = 0;
464464
int copied, offset, copy_len, size;
465465
struct cmd_desc_type0 *hwdesc;
@@ -472,14 +472,16 @@ static int qlcnic_tx_pkt(struct qlcnic_adapter *adapter,
472472
flags = QLCNIC_FLAGS_VLAN_TAGGED;
473473
vlan_tci = ntohs(vh->h_vlan_TCI);
474474
protocol = ntohs(vh->h_vlan_encapsulated_proto);
475+
tag_vlan = 1;
475476
} else if (skb_vlan_tag_present(skb)) {
476477
flags = QLCNIC_FLAGS_VLAN_OOB;
477478
vlan_tci = skb_vlan_tag_get(skb);
479+
tag_vlan = 1;
478480
}
479481
if (unlikely(adapter->tx_pvid)) {
480-
if (vlan_tci && !(adapter->flags & QLCNIC_TAGGING_ENABLED))
482+
if (tag_vlan && !(adapter->flags & QLCNIC_TAGGING_ENABLED))
481483
return -EIO;
482-
if (vlan_tci && (adapter->flags & QLCNIC_TAGGING_ENABLED))
484+
if (tag_vlan && (adapter->flags & QLCNIC_TAGGING_ENABLED))
483485
goto set_flags;
484486

485487
flags = QLCNIC_FLAGS_VLAN_OOB;

0 commit comments

Comments
 (0)