From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] dpaa_eth: add ethtool coalesce control Date: Wed, 07 Nov 2018 22:33:11 -0800 (PST) Message-ID: <20181107.223311.1952221214450219759.davem@davemloft.net> References: <1541598823-22533-1-git-send-email-madalin.bucur@nxp.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: madalin.bucur@nxp.com Return-path: In-Reply-To: <1541598823-22533-1-git-send-email-madalin.bucur@nxp.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Madalin Bucur 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.