diff options
author | Nimrod Andy <B38611@freescale.com> | 2014-09-23 03:40:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-26 16:05:21 -0400 |
commit | befe82133588c3b3c44c5e803b4b434e8665a673 (patch) | |
tree | 40592db0d9bada9f2f21b847def23799d94d9c70 | |
parent | f4a775d14489a801a5b8b0540e23ab82e2703091 (diff) |
net: fec: Add Ftype to BD to distiguish three tx queues for AVB
The current driver loss Ftype field init for BD, which cause tx
queue #1 and #2 cannot work well.
Add Ftype field to BD to distiguish three queues for AVB:
0 -> Best Effort
1 -> ClassA
2 -> ClassB
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/fec.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 26fb1de98826..354a30954fb1 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -308,6 +308,7 @@ struct bufdesc_ex { | |||
308 | #define RCMR_CMP_2 (RCMR_CMP_CFG(4, 0) | RCMR_CMP_CFG(5, 1) | \ | 308 | #define RCMR_CMP_2 (RCMR_CMP_CFG(4, 0) | RCMR_CMP_CFG(5, 1) | \ |
309 | RCMR_CMP_CFG(6, 2) | RCMR_CMP_CFG(7, 3)) | 309 | RCMR_CMP_CFG(6, 2) | RCMR_CMP_CFG(7, 3)) |
310 | #define RCMR_CMP(X) ((X == 1) ? RCMR_CMP_1 : RCMR_CMP_2) | 310 | #define RCMR_CMP(X) ((X == 1) ? RCMR_CMP_1 : RCMR_CMP_2) |
311 | #define FEC_TX_BD_FTYPE(X) ((X & 0xF) << 20) | ||
311 | 312 | ||
312 | /* The number of Tx and Rx buffers. These are allocated from the page | 313 | /* The number of Tx and Rx buffers. These are allocated from the page |
313 | * pool. The code may assume these are power of two, so it it best | 314 | * pool. The code may assume these are power of two, so it it best |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 7379f4bb74b0..5386f885feda 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -426,6 +426,8 @@ fec_enet_txq_submit_frag_skb(struct fec_enet_priv_tx_q *txq, | |||
426 | } | 426 | } |
427 | 427 | ||
428 | if (fep->bufdesc_ex) { | 428 | if (fep->bufdesc_ex) { |
429 | if (id_entry->driver_data & FEC_QUIRK_HAS_AVB) | ||
430 | estatus |= FEC_TX_BD_FTYPE(queue); | ||
429 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 431 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
430 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; | 432 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; |
431 | ebdp->cbd_bdu = 0; | 433 | ebdp->cbd_bdu = 0; |
@@ -555,6 +557,9 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq, | |||
555 | fep->hwts_tx_en)) | 557 | fep->hwts_tx_en)) |
556 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; | 558 | skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; |
557 | 559 | ||
560 | if (id_entry->driver_data & FEC_QUIRK_HAS_AVB) | ||
561 | estatus |= FEC_TX_BD_FTYPE(queue); | ||
562 | |||
558 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 563 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
559 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; | 564 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; |
560 | 565 | ||
@@ -599,6 +604,7 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb, | |||
599 | const struct platform_device_id *id_entry = | 604 | const struct platform_device_id *id_entry = |
600 | platform_get_device_id(fep->pdev); | 605 | platform_get_device_id(fep->pdev); |
601 | struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc); | 606 | struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc); |
607 | unsigned short queue = skb_get_queue_mapping(skb); | ||
602 | unsigned short status; | 608 | unsigned short status; |
603 | unsigned int estatus = 0; | 609 | unsigned int estatus = 0; |
604 | dma_addr_t addr; | 610 | dma_addr_t addr; |
@@ -629,6 +635,8 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb, | |||
629 | bdp->cbd_bufaddr = addr; | 635 | bdp->cbd_bufaddr = addr; |
630 | 636 | ||
631 | if (fep->bufdesc_ex) { | 637 | if (fep->bufdesc_ex) { |
638 | if (id_entry->driver_data & FEC_QUIRK_HAS_AVB) | ||
639 | estatus |= FEC_TX_BD_FTYPE(queue); | ||
632 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 640 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
633 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; | 641 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; |
634 | ebdp->cbd_bdu = 0; | 642 | ebdp->cbd_bdu = 0; |
@@ -659,6 +667,7 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq, | |||
659 | platform_get_device_id(fep->pdev); | 667 | platform_get_device_id(fep->pdev); |
660 | int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | 668 | int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
661 | struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc); | 669 | struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc); |
670 | unsigned short queue = skb_get_queue_mapping(skb); | ||
662 | void *bufaddr; | 671 | void *bufaddr; |
663 | unsigned long dmabuf; | 672 | unsigned long dmabuf; |
664 | unsigned short status; | 673 | unsigned short status; |
@@ -692,6 +701,8 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq, | |||
692 | bdp->cbd_datlen = hdr_len; | 701 | bdp->cbd_datlen = hdr_len; |
693 | 702 | ||
694 | if (fep->bufdesc_ex) { | 703 | if (fep->bufdesc_ex) { |
704 | if (id_entry->driver_data & FEC_QUIRK_HAS_AVB) | ||
705 | estatus |= FEC_TX_BD_FTYPE(queue); | ||
695 | if (skb->ip_summed == CHECKSUM_PARTIAL) | 706 | if (skb->ip_summed == CHECKSUM_PARTIAL) |
696 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; | 707 | estatus |= BD_ENET_TX_PINS | BD_ENET_TX_IINS; |
697 | ebdp->cbd_bdu = 0; | 708 | ebdp->cbd_bdu = 0; |