diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2017-01-08 22:12:27 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-09 14:29:07 -0500 |
commit | f89d21b9c310d43ad8513a3fe345b7677ee7ead7 (patch) | |
tree | 5c752035f1caddcb5680382f4209fb145d1336e2 /drivers/net/ethernet/ti | |
parent | 58fa118f3de45481df2ac2b8b41e8114cae2574d (diff) | |
download | blackbird-obmc-linux-f89d21b9c310d43ad8513a3fe345b7677ee7ead7.tar.gz blackbird-obmc-linux-f89d21b9c310d43ad8513a3fe345b7677ee7ead7.zip |
net: ethernet: ti: cpsw: extend limits for cpsw_get/set_ringparam
Allow to set number of descs close to possible values. In case of
minimum limit it's equal to number of channels to be able to set
at least one desc per channel. For maximum limit leave enough descs
number for tx channels.
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index f339268da11a..02b03ee2e314 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2493,8 +2493,7 @@ static void cpsw_get_ringparam(struct net_device *ndev, /* not supported */ ering->tx_max_pending = 0; ering->tx_pending = cpdma_get_num_tx_descs(cpsw->dma); - /* Max 90% RX buffers */ - ering->rx_max_pending = (descs_pool_size * 9) / 10; + ering->rx_max_pending = descs_pool_size - CPSW_MAX_QUEUES; ering->rx_pending = cpdma_get_num_rx_descs(cpsw->dma); } @@ -2509,8 +2508,8 @@ static int cpsw_set_ringparam(struct net_device *ndev, /* ignore ering->tx_pending - only rx_pending adjustment is supported */ if (ering->rx_mini_pending || ering->rx_jumbo_pending || - ering->rx_pending < (descs_pool_size / 10) || - ering->rx_pending > ((descs_pool_size * 9) / 10)) + ering->rx_pending < CPSW_MAX_QUEUES || + ering->rx_pending > (descs_pool_size - CPSW_MAX_QUEUES)) return -EINVAL; if (ering->rx_pending == cpdma_get_num_rx_descs(cpsw->dma)) |