From: Kees Bakker <kees@ijzerbout.nl>
To: Geetha sowjanya <gakula@marvell.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com,
jiri@resnulli.us, edumazet@google.com, sgoutham@marvell.com,
sbhatta@marvell.com, hkelam@marvell.com
Subject: Re: [net-next PATCH v12 11/12] octeontx2-pf: Adds TC offload support
Date: Fri, 15 Nov 2024 21:53:19 +0100 [thread overview]
Message-ID: <01c3b716-1450-4e15-85f5-76985ccf3f13@ijzerbout.nl> (raw)
In-Reply-To: <20241107160839.23707-12-gakula@marvell.com>
Op 07-11-2024 om 17:08 schreef Geetha sowjanya:
> Implements tc offload support for rvu representors.
>
> Usage example:
>
> - Add tc rule to drop packets with vlan id 3 using port
> representor(Rpf1vf0).
>
> # tc filter add dev Rpf1vf0 protocol 802.1Q parent ffff: flower
> vlan_id 3 vlan_ethtype ipv4 skip_sw action drop
>
> - Redirect packets with vlan id 5 and IPv4 packets to eth1,
> after stripping vlan header.
>
> # tc filter add dev Rpf1vf0 ingress protocol 802.1Q flower vlan_id 5
> vlan_ethtype ipv4 skip_sw action vlan pop action mirred ingress
> redirect dev eth1
>
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
> ---
> .../marvell/octeontx2/af/rvu_npc_fs.c | 14 ++-
> .../ethernet/marvell/octeontx2/af/rvu_rep.c | 4 +
> .../marvell/octeontx2/nic/otx2_common.h | 7 ++
> .../marvell/octeontx2/nic/otx2_flows.c | 5 -
> .../ethernet/marvell/octeontx2/nic/otx2_tc.c | 25 ++--
> .../net/ethernet/marvell/octeontx2/nic/rep.c | 115 ++++++++++++++++++
> .../net/ethernet/marvell/octeontx2/nic/rep.h | 1 +
> 7 files changed, 154 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> index 150635de2bd5..9d08fd466a43 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> @@ -1416,6 +1416,7 @@ int rvu_mbox_handler_npc_install_flow(struct rvu *rvu,
> struct npc_install_flow_rsp *rsp)
> {
> bool from_vf = !!(req->hdr.pcifunc & RVU_PFVF_FUNC_MASK);
> + bool from_rep_dev = !!is_rep_dev(rvu, req->hdr.pcifunc);
> struct rvu_switch *rswitch = &rvu->rswitch;
> int blkaddr, nixlf, err;
> struct rvu_pfvf *pfvf;
> @@ -1472,14 +1473,19 @@ int rvu_mbox_handler_npc_install_flow(struct rvu *rvu,
> /* AF installing for a PF/VF */
> if (!req->hdr.pcifunc)
(1)
> target = req->vf;
> +
> /* PF installing for its VF */
> - else if (!from_vf && req->vf) {
> + if (!from_vf && req->vf && !from_rep_dev) {
(2)
> target = (req->hdr.pcifunc & ~RVU_PFVF_FUNC_MASK) | req->vf;
> pf_set_vfs_mac = req->default_rule &&
> (req->features & BIT_ULL(NPC_DMAC));
> }
> - /* msg received from PF/VF */
> +
> + /* Representor device installing for a representee */
> + if (from_rep_dev && req->vf)
> + target = req->vf;
This now makes all previous assignments to `target` useless. See (1) and (2)
You created an if-else construct with an assignment to `target` in both
paths.
Can you please check the logic again?
> else
> + /* msg received from PF/VF */
> target = req->hdr.pcifunc;
>
> /* ignore chan_mask in case pf func is not AF, revisit later */
> [...]
next prev parent reply other threads:[~2024-11-15 20:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-07 16:08 [net-next PATCH v12 00/12] Introduce RVU representors Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 01/12] octeontx2-pf: RVU representor driver Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 02/12] octeontx2-pf: Create representor netdev Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 03/12] octeontx2-pf: Add basic net_device_ops Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 04/12] octeontx2-af: Add packet path between representor and VF Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 05/12] octeontx2-pf: Get VF stats via representor Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 06/12] octeontx2-pf: Add support to sync link state between representor and VFs Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 07/12] octeontx2-pf: Configure VF mtu via representor Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 08/12] octeontx2-pf: Add representors for sdp MAC Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 09/12] octeontx2-pf: Add devlink port support Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 10/12] octeontx2-pf: Implement offload stats ndo for representors Geetha sowjanya
2024-11-07 16:08 ` [net-next PATCH v12 11/12] octeontx2-pf: Adds TC offload support Geetha sowjanya
2024-11-15 20:53 ` Kees Bakker [this message]
2024-11-07 16:08 ` [net-next PATCH v12 12/12] Documentation: octeontx2: Add Documentation for RVU representors Geetha sowjanya
2024-11-13 12:00 ` [net-next PATCH v12 00/12] Introduce " patchwork-bot+netdevbpf
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=01c3b716-1450-4e15-85f5-76985ccf3f13@ijzerbout.nl \
--to=kees@ijzerbout.nl \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jiri@resnulli.us \
--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
all inboxes | Powered by JetHome®