From: Ivan Khoronzhuk Date: Fri, 31 May 2019 13:47:25 +0000 (+0300) Subject: net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set X-Git-Tag: v5.4-rc1~836^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09faf5a7d7c0bcb07faba072f611937af9dd5788;p=platform%2Fkernel%2Flinux-rpi.git net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set Fix ability to set RX descriptor number, the reason - initially "tx_max_pending" was set incorrectly, but the issue appears after adding sanity check, so fix is for "sanity" patch. Fixes: 37e2d99b59c476 ("ethtool: Ensure new ring parameters are within bounds during SRINGPARAM") Signed-off-by: Ivan Khoronzhuk Reviewed-by: Grygorii Strashko Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c index a4a7ec0..6d1c9eb 100644 --- a/drivers/net/ethernet/ti/cpsw_ethtool.c +++ b/drivers/net/ethernet/ti/cpsw_ethtool.c @@ -643,7 +643,7 @@ void cpsw_get_ringparam(struct net_device *ndev, struct cpsw_common *cpsw = priv->cpsw; /* not supported */ - ering->tx_max_pending = 0; + ering->tx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; ering->tx_pending = cpdma_get_num_tx_descs(cpsw->dma); ering->rx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; ering->rx_pending = cpdma_get_num_rx_descs(cpsw->dma);