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 05/10] octeontx2-af: Add packet path between representor and VF
Date: Tue, 18 Jun 2024 09:38:39 +0100 [thread overview]
Message-ID: <20240618083839.GE8447@kernel.org> (raw)
In-Reply-To: <20240611162213.22213-6-gakula@marvell.com>
On Tue, Jun 11, 2024 at 09:52:08PM +0530, Geetha sowjanya wrote:
> Current HW, do not support in-built switch which will forward pkts
> between representee and representor. When representor is put under
> a bridge and pkts needs to be sent to representee, then pkts from
> representor are sent on a HW internal loopback channel, which again
> will be punted to ingress pkt parser. Now the rules that this patch
> installs are the MCAM filters/rules which will match against these
> pkts and forward them to representee.
> The rules that this patch installs are for basic
> representor <=> representee path similar to Tun/TAP between VM and
> Host.
>
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
...
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
...
> +void rvu_rep_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)
> +{
> + struct rvu_switch *rswitch = &rvu->rswitch;
> + struct npc_mcam *mcam = &rvu->hw->mcam;
> + u32 max = rswitch->used_entries;
> + int blkaddr;
> + u16 entry;
> +
> + if (!rswitch->used_entries)
> + return;
> +
> + blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
> +
> + if (blkaddr < 0)
> + return;
> +
> + rvu_switch_enable_lbk_link(rvu, pcifunc, ena);
> + mutex_lock(&mcam->lock);
> + for (entry = 0; entry < max; entry++) {
> + if (rswitch->entry2pcifunc[entry] == pcifunc)
> + npc_enable_mcam_entry(rvu, mcam, blkaddr, entry, ena);
> + }
> + mutex_unlock(&mcam->lock);
> +}
> +
> +int rvu_rep_pf_init(struct rvu *rvu)
> +{
> + u16 pcifunc = rvu->rep_pcifunc;
> + struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);
nit: It would be nice to maintain reverse xmas tree order - longest line to
shortest - for local variable declarations in this file.
Here, I think that could be (completely untested!):
u16 pcifunc = rvu->rep_pcifunc;
struct rvu_pfvf *pfvf;
pfvf = rvu_get_pfvf(rvu, pcifunc);
Edward Cree's tool is useful here:
https://github.com/ecree-solarflare/xmastree
> +
> + set_bit(NIXLF_INITIALIZED, &pfvf->flags);
> + rvu_switch_enable_lbk_link(rvu, pcifunc, true);
> + rvu_rep_rx_vlan_cfg(rvu, pcifunc);
> + return 0;
> +}
...
next prev parent reply other threads:[~2024-06-18 8:38 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
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 [this message]
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=20240618083839.GE8447@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).