Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2815685pxb; Mon, 11 Jan 2021 22:04:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJyO8MgevOSF65B6EzM+080ODTjhQXe2yCa66u6mteNqfI2mV4wDGBrFAYM0Q6YWAnoaIPwK X-Received: by 2002:a17:906:a8f:: with SMTP id y15mr2080209ejf.552.1610431492711; Mon, 11 Jan 2021 22:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610431492; cv=none; d=google.com; s=arc-20160816; b=vSUa3E/L5eDW3QwOiH1dhOlTuXax6K3wKGuscj4hYPQqSkbh//kAPAhLPXk+XYYrqS RcjIi6/IWwihUQ7c2jclk17Dp5D0Xwo7BsEDrcv3BcITW2Cof0GRPSoAwyS6oQGF9dgL 74Zr/+v8ky0bUcWiEeT8N+UH22buxw0lO9rJlgL0HON8rIdzjkbQdT5TViqNtBnsCgm2 k3Cg7Qt5de7dsAYiCsKEkTZotrBw+9JYBH5beG6nt2TtfktzgaybF/OV4MAdMgYzAb4u LrcJOollcD4+opA6tutT8ixbDQGboaQNWR4RXSWzJtdtdtPcZfbACw+9W4FJ03RalRx8 RGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bPtiZkpRE+bBPi/xRF6ZYJmP2A1bz9bitxZpMUdMb74=; b=gR3PTtRA8xfQCcP+QvtHrTNyIAENSuw5CW+ixYxdVVomFamX56nkp5dFNNOSBrHCLQ Sk8x73Tp9ssruLgxyPDc/0yPIE/3rk4GE7V4xRR+wYb3um5wPWQufEjnw19tdbzKFOWo sXZmlRKm+f7FXp6AHY6+8WBGbP7tUlgIB99N9g8gAUwnL+mTOSnz82pQQYSo4r9yTQ2B BPtQmM3SwTyoRZa6eXNCDEIk9DItUAOH2EyWsYGSqCUrdRQlKoUYpFX91JQLvZJ1HccC e3M5zjEWQIhJiLSuoPq03fT387f5GvVhHiDy3ZBe6M9otKHxyvvdG64NAJwt37+VnPnL buEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AcdKb5fm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb21si823806edb.91.2021.01.11.22.04.29; Mon, 11 Jan 2021 22:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AcdKb5fm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731624AbhAKNnC (ORCPT + 99 others); Mon, 11 Jan 2021 08:43:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:58930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731316AbhAKNMC (ORCPT ); Mon, 11 Jan 2021 08:12:02 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE53D22795; Mon, 11 Jan 2021 13:11:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610370706; bh=CYlp0IubFJHrQ+Yfeh+mGQzOj/6wXnEUndV+uBbPNPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AcdKb5fmPb34ZDmFU25JI7f2T8FDJQjsJHnT3u8O5h52c+ZAlNr7I2JEqxL50Na8Y ZEeyZsTd2THsJlcDGYLXLXQYFNh2ixhakzIR/PdoEUFLWmHc/ibt1yznBl+xqljl8q iumEkIMdUroYdjH+DLpFDoG+61C087M+5oxtjpLs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Chulski , Jakub Kicinski Subject: [PATCH 5.4 32/92] net: mvpp2: fix pkt coalescing int-threshold configuration Date: Mon, 11 Jan 2021 14:01:36 +0100 Message-Id: <20210111130040.692896300@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210111130039.165470698@linuxfoundation.org> References: <20210111130039.165470698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stefan Chulski [ Upstream commit 4f374d2c43a9e5e773f1dee56db63bd6b8a36276 ] The packet coalescing interrupt threshold has separated registers for different aggregated/cpu (sw-thread). The required value should be loaded for every thread but not only for 1 current cpu. Fixes: 213f428f5056 ("net: mvpp2: add support for TX interrupts and RX queue distribution modes") Signed-off-by: Stefan Chulski Link: https://lore.kernel.org/r/1608748521-11033-1-git-send-email-stefanc@marvell.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -2161,17 +2161,18 @@ static void mvpp2_rx_pkts_coal_set(struc static void mvpp2_tx_pkts_coal_set(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) { - unsigned int thread = mvpp2_cpu_to_thread(port->priv, get_cpu()); + unsigned int thread; u32 val; if (txq->done_pkts_coal > MVPP2_TXQ_THRESH_MASK) txq->done_pkts_coal = MVPP2_TXQ_THRESH_MASK; val = (txq->done_pkts_coal << MVPP2_TXQ_THRESH_OFFSET); - mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id); - mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val); - - put_cpu(); + /* PKT-coalescing registers are per-queue + per-thread */ + for (thread = 0; thread < MVPP2_MAX_THREADS; thread++) { + mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_NUM_REG, txq->id); + mvpp2_thread_write(port->priv, thread, MVPP2_TXQ_THRESH_REG, val); + } } static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)