diff options
author | Kavi Akhila-B46177 <akhila.kavi@nxp.com> | 2017-11-02 06:35:35 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-12-12 07:32:44 (GMT) |
commit | 5fe8cfe356d2dbf6f9d7e213614d6be9ad0ac592 (patch) | |
tree | ded94d4637697909a71446ddb9efa42df2af2ab8 /drivers/staging/fsl_ppfe/pfe_eth.c | |
parent | 076847db329b5f61a0698880da894d4479df9416 (diff) | |
download | linux-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_eth.c')
-rw-r--r-- | drivers/staging/fsl_ppfe/pfe_eth.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/staging/fsl_ppfe/pfe_eth.c b/drivers/staging/fsl_ppfe/pfe_eth.c index a6d1fb7..7d4493f 100644 --- a/drivers/staging/fsl_ppfe/pfe_eth.c +++ b/drivers/staging/fsl_ppfe/pfe_eth.c @@ -293,10 +293,10 @@ static int pfe_eth_sysfs_init(struct net_device *ndev) /* Initialize the default values */ /* - * By default, packets without conntrack will use this default high + * By default, packets without conntrack will use this default low * priority queue */ - priv->default_priority = 15; + priv->default_priority = 0; /* Create our sysfs files */ err = device_create_file(&ndev->dev, &dev_attr_default_priority); @@ -1594,10 +1594,17 @@ static int pfe_eth_might_stop_tx(struct pfe_eth_priv_s *priv, int queuenum, unsigned int n_segs) { ktime_t kt; + int tried = 0; +try_again: if (unlikely((__hif_tx_avail(&pfe->hif) < n_desc) || - (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) || + (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) || (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < n_segs))) { + if (!tried) { + __hif_lib_update_credit(&priv->client, queuenum); + tried = 1; + goto try_again; + } #ifdef PFE_ETH_TX_STATS if (__hif_tx_avail(&pfe->hif) < n_desc) { priv->stop_queue_hif[queuenum]++; @@ -1720,8 +1727,10 @@ static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv) netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); - for (ii = 0; ii < emac_txq_cnt; ii++) + for (ii = 0; ii < emac_txq_cnt; ii++) { pfe_eth_flush_txQ(priv, ii, 0, 0); + __hif_lib_update_credit(&priv->client, ii); + } } void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int |