From: Simon Horman <horms@kernel.org>
To: Geetha sowjanya <gakula@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com,
edumazet@google.com, sgoutham@marvell.com, sbhatta@marvell.com,
hkelam@marvell.com
Subject: Re: [net-next PATCH v5 01/10] octeontx2-pf: Refactoring RVU driver
Date: Tue, 18 Jun 2024 08:40:58 +0100 [thread overview]
Message-ID: <20240618074058.GC8447@kernel.org> (raw)
In-Reply-To: <20240611162213.22213-2-gakula@marvell.com>
On Tue, Jun 11, 2024 at 09:52:04PM +0530, Geetha sowjanya wrote:
> Refactoring and export list of shared functions such that
> they can be used by both RVU NIC and representor driver.
>
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
...
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
...
> @@ -2949,6 +2952,7 @@ static int nix_tx_vtag_alloc(struct rvu *rvu, int blkaddr,
> mutex_unlock(&vlan->rsrc_lock);
>
> regval = size ? vtag : vtag << 32;
> + regval |= (vtag & ~GENMASK_ULL(47, 0)) << 48;
Hi Geetha,
I'm a little confused by the line above.
vtag is a 64 bit value.
It is masked, leaving the upper 16 bits intact,
and the lower 48 bits as zeros.
It is then left-shifted 48 bits.
By my reasoning the result is always 0.
e.g.
0x123456789abcdef1 & ~GENMASK_ULL(47, 0) => 0x1234000000000000
0x1234000000000000 << 48 => 0
Also, I suspect that FIELD_PREP could be used to good effect here.
(And, as an aside, elsewhere in this file/driver.)
> rvu_write64(rvu, blkaddr,
> NIX_AF_TX_VTAG_DEFX_DATA(index), regval);
> @@ -4619,6 +4623,7 @@ static void nix_link_config(struct rvu *rvu, int blkaddr,
> rvu_get_lbk_link_max_frs(rvu, &lbk_max_frs);
> rvu_get_lmac_link_max_frs(rvu, &lmac_max_frs);
>
> + rvu_write64(rvu, blkaddr, NIX_AF_SDP_LINK_CREDIT, SDP_LINK_CREDIT);
> /* Set default min/max packet lengths allowed on NIX Rx links.
> *
> * With HW reset minlen value of 60byte, HW will treat ARP pkts
> @@ -4630,14 +4635,14 @@ static void nix_link_config(struct rvu *rvu, int blkaddr,
> ((u64)lmac_max_frs << 16) | NIC_HW_MIN_FRS);
> }
>
> - for (link = hw->cgx_links; link < hw->lbk_links; link++) {
> + for (link = hw->cgx_links; link < hw->cgx_links + hw->lbk_links; link++) {
> rvu_write64(rvu, blkaddr, NIX_AF_RX_LINKX_CFG(link),
> ((u64)lbk_max_frs << 16) | NIC_HW_MIN_FRS);
> }
> if (hw->sdp_links) {
> link = hw->cgx_links + hw->lbk_links;
> rvu_write64(rvu, blkaddr, NIX_AF_RX_LINKX_CFG(link),
> - SDP_HW_MAX_FRS << 16 | NIC_HW_MIN_FRS);
> + SDP_HW_MAX_FRS << 16 | SDP_HW_MIN_FRS);
> }
>
> /* Get MCS external bypass status for CN10K-B */
...
next prev parent reply other threads:[~2024-06-18 7:41 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 16:22 [net-next PATCH v5 00/10] Introduce RVU representors Geetha sowjanya
2024-06-11 16:22 ` [net-next PATCH v5 01/10] octeontx2-pf: Refactoring RVU driver Geetha sowjanya
2024-06-15 11:15 ` Markus Elfring
2024-06-18 9:03 ` [EXTERNAL] " Geethasowjanya Akula
2024-06-18 7:40 ` Simon Horman [this message]
2024-06-24 9:56 ` Geethasowjanya Akula
2024-06-11 16:22 ` [net-next PATCH v5 02/10] octeontx2-pf: RVU representor driver Geetha sowjanya
2024-06-14 2:02 ` Jakub Kicinski
2024-06-18 9:08 ` [EXTERNAL] " Geethasowjanya Akula
2024-06-15 15:11 ` Markus Elfring
2024-06-17 19:49 ` Simon Horman
2024-06-25 11:58 ` [EXTERNAL] " Geethasowjanya Akula
2024-06-11 16:22 ` [net-next PATCH v5 03/10] octeontx2-pf: Create representor netdev Geetha sowjanya
2024-06-18 8:25 ` Simon Horman
2024-06-24 8:49 ` Geethasowjanya Akula
2024-06-11 16:22 ` [net-next PATCH v5 04/10] octeontx2-pf: Add basic net_device_ops Geetha sowjanya
2024-06-11 16:22 ` [net-next PATCH v5 05/10] octeontx2-af: Add packet path between representor and VF Geetha sowjanya
2024-06-17 20:19 ` Simon Horman
2024-06-18 8:38 ` Simon Horman
2024-06-19 12:16 ` [EXTERNAL] " Geethasowjanya Akula
2024-06-11 16:22 ` [net-next PATCH v5 06/10] octeontx2-pf: Get VF stats via representor Geetha sowjanya
2024-06-20 12:54 ` Simon Horman
2024-06-20 12:56 ` Simon Horman
2024-06-11 16:22 ` [net-next PATCH v5 07/10] octeontx2-pf: Add support to sync link state between representor and VFs Geetha sowjanya
2024-06-20 12:56 ` Simon Horman
2024-06-11 16:22 ` [net-next PATCH v4 08/10] octeontx2-pf: Configure VF mtu via representor Geetha sowjanya
2024-06-20 12:56 ` Simon Horman
2024-06-11 16:22 ` [net-next PATCH v5 09/10] octeontx2-pf: Add representors for sdp MAC Geetha sowjanya
2024-06-18 8:55 ` Simon Horman
2024-06-11 16:22 ` [net-next PATCH v5 10/10] octeontx2-pf: Add devlink port support Geetha sowjanya
2024-06-20 12:57 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618074058.GC8447@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).