Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3769150ybl; Mon, 13 Jan 2020 02:16:04 -0800 (PST) X-Google-Smtp-Source: APXvYqzhYf7Wqjpys6nOehO70AjT0TqeYHE7g+MaFzr/Y+igDKNxIAJeSZlO8wIMi6YjovHpo84x X-Received: by 2002:a05:6830:155a:: with SMTP id l26mr12668832otp.339.1578910564191; Mon, 13 Jan 2020 02:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578910564; cv=none; d=google.com; s=arc-20160816; b=Xgf0dkN+DcdsjILlfyq7El94sbBvtvKDkNF769y8uXK1X8Fs6piNItd6xldSVHTkNi Ta0Dx7uHvbh52ZcJEe0oClTWnzU3r18rwFkij7Pok5mGHvA5QTdU47Uxv19GPjBP29sx UYG4XKjcuGfsVe753dAncLPxgwu61XVyW52HdozccTWLCLgeQPxJviMzbNWVycwSj+ag H7pIMGkPSon1/iDbo0YO+geiebWUrNjTCbGrRxk+Gidqw85A6GeyVG2ooHd/RHIRUYby Y4elyNySo/8x9PYh8dFU0rd4zyL4fC7+MtzlTNUxc2ICBgevGfSfw7XxvbsUZR/fpAel C+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=bVCfoy+rxzHWZj4+8x/9cs6YxTsQq7oVkpAsP10F1+Y=; b=Ymff7tKfE9vVZ/ux0+XNrUdGPKHM6yrPW+hg2xip+UFR0LdGps8ywS1FTSS71Mq2lx B/BsodGh/6J7VlDa9FspkaoRVlKIE5PcX4Q0WafSvn+3VajiKwh1bHIaATL7Lu+dQm3r 41FFSSkIXaGZNj+cp83E0jmCO9mBmJKFPUIpwyz2AfmZtF4dHWzXsysAiX4pjWi6bjX4 TJ3SrlL57uiyF2Ee7mca81IGDEK048yktiw1SSIGIEotUVQTwd3wloj/tZ//yzZuV+hn KBSvwYjnvueKGbwKkShNTaV2XfisFdq7CUUXHlNfAY2U22N9y/NqkLvBDihdbyhJeBWj iiyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si5697655oij.160.2020.01.13.02.15.52; Mon, 13 Jan 2020 02:16:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728804AbgAMKNl (ORCPT + 99 others); Mon, 13 Jan 2020 05:13:41 -0500 Received: from mga03.intel.com ([134.134.136.65]:10161 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728773AbgAMKNi (ORCPT ); Mon, 13 Jan 2020 05:13:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 02:13:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,428,1571727600"; d="scan'208";a="397116812" Received: from bong5-hp-z440.png.intel.com ([10.221.118.136]) by orsmga005.jf.intel.com with ESMTP; 13 Jan 2020 02:13:35 -0800 From: Ong Boon Leong To: netdev@vger.kernel.org Cc: Jose Abreu , Giuseppe Cavallaro , Alexandre Torgue , "David S . Miller" , Maxime Coquelin , Ong Boon Leong , Tan Tee Min , Voon Weifeng , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net 4/7] net: stmmac: Fix priority steering for tx/rx queue >3 Date: Tue, 14 Jan 2020 10:01:13 +0800 Message-Id: <1578967276-55956-5-git-send-email-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> References: <1578967276-55956-1-git-send-email-boon.leong.ong@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Voon Weifeng Fix MACRO function define for TX and RX user priority queue steering for register masking and shifting. Fixes: a8f5102af2a7 ("net: stmmac: TX and RX queue priority configuration") Signed-off-by: Voon Weifeng Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h index 2dc70d1..798a53a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h @@ -97,12 +97,14 @@ #define GMAC_RX_FLOW_CTRL_RFE BIT(0) /* RX Queues Priorities */ -#define GMAC_RXQCTRL_PSRQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -#define GMAC_RXQCTRL_PSRQX_SHIFT(x) ((x) * 8) +#define GMAC_RXQCTRL_PSRQX_MASK(x) GENMASK(7 + (((x) % 4) * 8), \ + 0 + (((x) % 4) * 8)) +#define GMAC_RXQCTRL_PSRQX_SHIFT(x) (((x) % 4) * 8) /* TX Queues Priorities */ -#define GMAC_TXQCTRL_PSTQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -#define GMAC_TXQCTRL_PSTQX_SHIFT(x) ((x) * 8) +#define GMAC_TXQCTRL_PSTQX_MASK(x) GENMASK(7 + (((x) % 4) * 8), \ + 0 + (((x) % 4) * 8)) +#define GMAC_TXQCTRL_PSTQX_SHIFT(x) (((x) % 4) * 8) /* MAC Flow Control TX */ #define GMAC_TX_FLOW_CTRL_TFE BIT(1) -- 2.7.4