aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index d5e796832fdd..45b1f6635282 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -429,9 +429,12 @@ static inline void wrb_fill(struct be_eth_wrb *wrb, u64 addr, int len)
429 wrb->frag_len = len & ETH_WRB_FRAG_LEN_MASK; 429 wrb->frag_len = len & ETH_WRB_FRAG_LEN_MASK;
430} 430}
431 431
432static void wrb_fill_hdr(struct be_eth_hdr_wrb *hdr, struct sk_buff *skb, 432static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
433 u32 wrb_cnt, u32 len) 433 struct sk_buff *skb, u32 wrb_cnt, u32 len)
434{ 434{
435 u8 vlan_prio = 0;
436 u16 vlan_tag = 0;
437
435 memset(hdr, 0, sizeof(*hdr)); 438 memset(hdr, 0, sizeof(*hdr));
436 439
437 AMAP_SET_BITS(struct amap_eth_hdr_wrb, crc, hdr, 1); 440 AMAP_SET_BITS(struct amap_eth_hdr_wrb, crc, hdr, 1);
@@ -449,10 +452,15 @@ static void wrb_fill_hdr(struct be_eth_hdr_wrb *hdr, struct sk_buff *skb,
449 AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1); 452 AMAP_SET_BITS(struct amap_eth_hdr_wrb, udpcs, hdr, 1);
450 } 453 }
451 454
452 if (vlan_tx_tag_present(skb)) { 455 if (adapter->vlan_grp && vlan_tx_tag_present(skb)) {
453 AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1); 456 AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan, hdr, 1);
454 AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan_tag, 457 vlan_tag = vlan_tx_tag_get(skb);
455 hdr, vlan_tx_tag_get(skb)); 458 vlan_prio = (vlan_tag & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
459 /* If vlan priority provided by OS is NOT in available bmap */
460 if (!(adapter->vlan_prio_bmap & (1 << vlan_prio)))
461 vlan_tag = (vlan_tag & ~VLAN_PRIO_MASK) |
462 adapter->recommended_prio;
463 AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan_tag, hdr, vlan_tag);
456 } 464 }
457 465
458 AMAP_SET_BITS(struct amap_eth_hdr_wrb, event, hdr, 1); 466 AMAP_SET_BITS(struct amap_eth_hdr_wrb, event, hdr, 1);
@@ -532,7 +540,7 @@ static int make_tx_wrbs(struct be_adapter *adapter,
532 queue_head_inc(txq); 540 queue_head_inc(txq);
533 } 541 }
534 542
535 wrb_fill_hdr(hdr, first_skb, wrb_cnt, copied); 543 wrb_fill_hdr(adapter, hdr, first_skb, wrb_cnt, copied);
536 be_dws_cpu_to_le(hdr, sizeof(*hdr)); 544 be_dws_cpu_to_le(hdr, sizeof(*hdr));
537 545
538 return copied; 546 return copied;