summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl_ppfe/pfe_hif_lib.c
diff options
context:
space:
mode:
authorKavi Akhila-B46177 <akhila.kavi@nxp.com>2017-11-02 06:35:35 (GMT)
committerXie Xiaobo <xiaobo.xie@nxp.com>2017-12-12 07:32:44 (GMT)
commit5fe8cfe356d2dbf6f9d7e213614d6be9ad0ac592 (patch)
treeded94d4637697909a71446ddb9efa42df2af2ab8 /drivers/staging/fsl_ppfe/pfe_hif_lib.c
parent076847db329b5f61a0698880da894d4479df9416 (diff)
downloadlinux-5fe8cfe356d2dbf6f9d7e213614d6be9ad0ac592.tar.xz
staging: fsl_ppfe/eth: Avoid packet drop at TMU queues
Added flow control between TMU queues and PFE Linux driver, based on TMU credits availability. Added tx_qos module parameter to control this behavior. Use queue-0 as default queue to transmit packets. Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com> Signed-off-by: Akhila Kavi <akhila.kavi@nxp.com> Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
Diffstat (limited to 'drivers/staging/fsl_ppfe/pfe_hif_lib.c')
-rw-r--r--drivers/staging/fsl_ppfe/pfe_hif_lib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/fsl_ppfe/pfe_hif_lib.c b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
index 2ec47bf..eeab4ff 100644
--- a/drivers/staging/fsl_ppfe/pfe_hif_lib.c
+++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
@@ -34,7 +34,10 @@
unsigned int lro_mode;
unsigned int page_mode;
-unsigned int tx_qos;
+unsigned int tx_qos = 1;
+module_param(tx_qos, uint, 0444);
+MODULE_PARM_DESC(tx_qos, "0: disable ,\n"
+ "1: enable (default), guarantee no packet drop at TMU level\n");
unsigned int pfe_pkt_size;
unsigned int pfe_pkt_headroom;
unsigned int emac_txq_cnt;
@@ -576,7 +579,7 @@ void __hif_lib_update_credit(struct hif_client_s *client, unsigned int queue)
if (tx_qos) {
tmu_tx_packets = be32_to_cpu(pe_dmem_read(TMU0_ID +
- client->id, TMU_DM_TX_TRANS, 4));
+ client->id, (TMU_DM_TX_TRANS + (queue * 4)), 4));
/* tx_packets counter overflowed */
if (tmu_tx_packets >