nvethernet: update min rx coalescing timer value

MGBE and EQOS supports different rx coalescing
timer value. Add logic for check for same
for input from ethtool and DT

Bug 200767374

Change-Id: I324d48200f4bd5ce71f7740411c8da5b06275134
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2589963
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rakesh Goyal
2021-09-06 15:23:46 +05:30
committed by Revanth Kumar Uppala
parent 78035314d0
commit c33c0b334c
2 changed files with 27 additions and 7 deletions

View File

@@ -5590,14 +5590,25 @@ static int ether_parse_dt(struct ether_priv_data *pdata)
if (ret < 0) {
osi_dma->use_riwt = OSI_DISABLE;
} else {
if ((osi_dma->rx_riwt > OSI_MAX_RX_COALESCE_USEC) ||
(osi_dma->rx_riwt < OSI_MIN_RX_COALESCE_USEC)) {
if (osi_dma->mac == OSI_MAC_HW_MGBE &&
(osi_dma->rx_riwt > OSI_MAX_RX_COALESCE_USEC ||
osi_dma->rx_riwt < OSI_MGBE_MIN_RX_COALESCE_USEC)) {
dev_err(dev,
"invalid rx_riwt, must be inrange %d to %d\n",
OSI_MIN_RX_COALESCE_USEC,
OSI_MGBE_MIN_RX_COALESCE_USEC,
OSI_MAX_RX_COALESCE_USEC);
return -EINVAL;
} else if (osi_dma->mac == OSI_MAC_HW_EQOS &&
(osi_dma->rx_riwt > OSI_MAX_RX_COALESCE_USEC ||
osi_dma->rx_riwt <
OSI_EQOS_MIN_RX_COALESCE_USEC)) {
dev_err(dev,
"invalid rx_riwt, must be inrange %d to %d\n",
OSI_EQOS_MIN_RX_COALESCE_USEC,
OSI_MAX_RX_COALESCE_USEC);
return -EINVAL;
}
osi_dma->use_riwt = OSI_ENABLE;
}
/* rx_frames value to be set */

View File

@@ -1010,11 +1010,20 @@ static int ether_set_coalesce(struct net_device *dev,
if (ec->rx_coalesce_usecs == OSI_DISABLE) {
osi_dma->use_riwt = OSI_DISABLE;
} else if ((ec->rx_coalesce_usecs > OSI_MAX_RX_COALESCE_USEC) ||
(ec->rx_coalesce_usecs < OSI_MIN_RX_COALESCE_USEC)) {
} else if (osi_dma->mac == OSI_MAC_HW_EQOS &&
(ec->rx_coalesce_usecs > OSI_MAX_RX_COALESCE_USEC ||
ec->rx_coalesce_usecs < OSI_EQOS_MIN_RX_COALESCE_USEC)) {
netdev_err(dev, "invalid rx_usecs, must be in a range of %d to %d usec\n",
OSI_EQOS_MIN_RX_COALESCE_USEC,
OSI_MAX_RX_COALESCE_USEC);
return -EINVAL;
} else if (osi_dma->mac == OSI_MAC_HW_MGBE &&
(ec->rx_coalesce_usecs > OSI_MAX_RX_COALESCE_USEC ||
ec->rx_coalesce_usecs < OSI_MGBE_MIN_RX_COALESCE_USEC)) {
netdev_err(dev,
"invalid rx_usecs, must be in a range of"
" %d to %d usec\n", OSI_MIN_RX_COALESCE_USEC,
"invalid rx_usecs, must be in a range of %d to %d usec\n",
OSI_MGBE_MIN_RX_COALESCE_USEC,
OSI_MAX_RX_COALESCE_USEC);
return -EINVAL;
} else {