|
@@ -1027,6 +1027,22 @@ static int mlx4_en_set_coalesce(struct net_device *dev,
|
|
if (!coal->tx_max_coalesced_frames_irq)
|
|
if (!coal->tx_max_coalesced_frames_irq)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ if (coal->tx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME ||
|
|
|
|
+ coal->rx_coalesce_usecs > MLX4_EN_MAX_COAL_TIME ||
|
|
|
|
+ coal->rx_coalesce_usecs_low > MLX4_EN_MAX_COAL_TIME ||
|
|
|
|
+ coal->rx_coalesce_usecs_high > MLX4_EN_MAX_COAL_TIME) {
|
|
|
|
+ netdev_info(dev, "%s: maximum coalesce time supported is %d usecs\n",
|
|
|
|
+ __func__, MLX4_EN_MAX_COAL_TIME);
|
|
|
|
+ return -ERANGE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (coal->tx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS ||
|
|
|
|
+ coal->rx_max_coalesced_frames > MLX4_EN_MAX_COAL_PKTS) {
|
|
|
|
+ netdev_info(dev, "%s: maximum coalesced frames supported is %d\n",
|
|
|
|
+ __func__, MLX4_EN_MAX_COAL_PKTS);
|
|
|
|
+ return -ERANGE;
|
|
|
|
+ }
|
|
|
|
+
|
|
priv->rx_frames = (coal->rx_max_coalesced_frames ==
|
|
priv->rx_frames = (coal->rx_max_coalesced_frames ==
|
|
MLX4_EN_AUTO_CONF) ?
|
|
MLX4_EN_AUTO_CONF) ?
|
|
MLX4_EN_RX_COAL_TARGET :
|
|
MLX4_EN_RX_COAL_TARGET :
|