Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp395111rdb; Fri, 5 Jan 2024 13:45:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+afOuTBSAXKb2YxVznEMpdGT1Xgl0L3T6XGYmE0l288b/u5az3ENPkcGoBWV3eoSWIfuP X-Received: by 2002:a05:6214:c6c:b0:680:3cf2:b915 with SMTP id t12-20020a0562140c6c00b006803cf2b915mr12162qvj.111.1704491112923; Fri, 05 Jan 2024 13:45:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704491112; cv=none; d=google.com; s=arc-20160816; b=z83lUL0+rqxoVJiOzHeYnDSTWyGWoyqyLr4O3Ul9D82VzCCrDuVikvMbP9yeJ+j51+ kDdmxf1kVnqLCFLM+NUpaZJCjhxKmemHwHpmWIpA2uifIEYRZCe3KhmpYoeYMlAKnHb7 uNaOMavyY/lvvJO8Fwh8jQnMHRU/9uohrYHR+uoIkTh90Qiph7WnAKfteYp/xAlHWaRs 2s1j5RwD5l/JgPjaj0x/FBMRB/P3YPo57l0QhgmFRmjP+eO7htcnOf61PcsW3Ns1VnMq 8DyPeAZIBuRbcgUBwK4Nlvvn1/64EczK4UhJdnBDFxUUVvrKQijNKyxdURlMBYdwAy5j mLLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Xz2fehtQUABfvBHJwLdfs8ouCp382FHOc3EY3q/IFhk=; fh=OgcvO1BEQTvCY+Uwi/8l+aN7vM83RZdI+4BkKLvZfaQ=; b=UXwo3oyw/yxUA4/AogYnAjYQqQxHKDpRb5BegWGeyfOwq62PsMakFl1zxRpm38nu8D v7z1A3aCKZqLjEsaA9NXFrBrQHkF0Ia8w5H8+zzqy3XR2jdrG0bmbi9NXUGrPvmjtyCj CEwhOzvLYk8xRKibhQTWi1KdFfz2X5vOtPUAs1r7Zu0fuqvc/cs144YU0iFBgjHyU0Kh 2v0Xo66Md/WFoWPQpG5NvOjacSGOYeDiAIu0mScDpi/h3/U6kFlg+Li1LiFdc+mzl8Bq vXnQFqDDD4C6ZbCU3FfkmNPkLqls/yDZ+hQasa+W2JeUOwtsVoJ8coVHuaJX0MG5AdVT FCKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXIW9Cjx; spf=pass (google.com: domain of linux-kernel+bounces-18378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18378-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j18-20020a05620a147200b00781df37c2c9si2483063qkl.533.2024.01.05.13.45.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 13:45:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXIW9Cjx; spf=pass (google.com: domain of linux-kernel+bounces-18378-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18378-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A91ED1C23767 for ; Fri, 5 Jan 2024 21:45:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 504A222EEA; Fri, 5 Jan 2024 21:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZXIW9Cjx" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81E91364A1; Fri, 5 Jan 2024 21:45:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11FD5C433C7; Fri, 5 Jan 2024 21:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704491101; bh=S8xwNI2IVLGMzs1d0V3i+KaFfXXiiwzlTAyPMkEB65w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZXIW9CjxpEEA78IVJ1b06aYlo7peW1XEcL1cagcL4tc4I8/O/9rDTpXwwuhkFmGOk dTVCgdLFYIcXYm2xsgMW539leVlZ44OsnpTYmNaJqL12msHAQJkzfAq8ZHq7aK/40/ qUkxlYOnq5wUfUz2jHUBbCPfqzu+MlM6P5GDGFTsLZdbAqpabOmHDFwqVO9vwGsCsQ 9NLNyYKpbLHmMyi1I7Pf3J7WlvAedt7hKI4c6YZjvNCOS6xJsMydT+sGXNK7gNLTLp Ac8+IJOXQiLbhBhMmPRTaSAR+mj5KgiKkCjtfSy8uxjsMBRgV+afSBjrc0RB/fbeK+ Bo+h9ppcMiK4Q== Date: Fri, 5 Jan 2024 21:44:57 +0000 From: Simon Horman To: Naveen Mamindlapalli Cc: davem@davemloft.net, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, sgoutham@marvell.com, Nithin Dabilpuram Subject: Re: [net PATCH] octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2 Message-ID: <20240105214457.GD31813@kernel.org> References: <20240105065423.714-1-naveenm@marvell.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240105065423.714-1-naveenm@marvell.com> On Fri, Jan 05, 2024 at 12:24:23PM +0530, Naveen Mamindlapalli wrote: > From: Nithin Dabilpuram > > RPM0 and RPM1 on the CN10KB SoC have 8 LMACs each, whereas RPM2 > has only 4 LMACs. Similarly, the RPM0 and RPM1 have 256KB FIFO, > whereas RPM2 has 128KB FIFO. This patch fixes an issue with > improper TX credit programming for the RPM2 link. > > Signed-off-by: Nithin Dabilpuram > Signed-off-by: Naveen Mamindlapalli If this is a fix for a user-visible bug then it should have a Fixes tag. Else it should be targeted at net-next. Also, as a potential follow-up, it looks like this file (driver?) could benefit from use of GETMASK/FIELD_GET/FIELD_PREP. But, IMHO, there is no need to do that for this change which is in a style consistent with the rest of the file. > --- > drivers/net/ethernet/marvell/octeontx2/af/rpm.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c > index 4728ba34b0e3..76218f1cb459 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/af/rpm.c > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rpm.c > @@ -506,6 +506,7 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id) > rpm_t *rpm = rpmd; > u8 num_lmacs; > u32 fifo_len; > + u16 max_lmac; > > lmac_info = rpm_read(rpm, 0, RPM2_CMRX_RX_LMACS); > /* LMACs are divided into two groups and each group > @@ -513,7 +514,11 @@ u32 rpm2_get_lmac_fifo_len(void *rpmd, int lmac_id) > * Group0 lmac_id range {0..3} > * Group1 lmac_id range {4..7} > */ > - fifo_len = rpm->mac_ops->fifo_len / 2; > + max_lmac = (rpm_read(rpm, 0, CGX_CONST) >> 24) & 0xFF; > + if (max_lmac > 4) > + fifo_len = rpm->mac_ops->fifo_len / 2; > + else > + fifo_len = rpm->mac_ops->fifo_len; > > if (lmac_id < 4) { > num_lmacs = hweight8(lmac_info & 0xF); > -- > 2.39.0.198.ga38d39a4c5 >