From: Madalin Bucur <madalin.bu...@nxp.com>
Date: Wed,  7 Nov 2018 15:53:43 +0200

> +static int dpaa_set_coalesce(struct net_device *dev,
> +                          struct ethtool_coalesce *c)
> +{
> +     const cpumask_t *cpus = qman_affine_cpus();
> +     struct qman_portal *portal;
> +     u32 period;
> +     u8 thresh;
> +     int cpu;
> +
> +     period = c->rx_coalesce_usecs;
> +     thresh = c->rx_max_coalesced_frames;
> +
> +     for_each_cpu(cpu, cpus) {
> +             portal = qman_get_affine_portal(cpu);
> +             qman_portal_set_iperiod(portal, period);
> +             qman_dqrr_set_ithresh(portal, thresh);
> +     }

You really have to check to see if the user is trying to configure
a setting you don't support, for example if the user tries
to set ->use_adative_rx_coalesce or uses a period or threshold
value which is out of range.

Thanks.

Reply via email to