netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Suman Ghosh <sumang@marvell.com>
Cc: sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com,
	hkelam@marvell.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, lcherian@marvell.com,
	jerinj@marvell.com
Subject: Re: [net-next PATCH] octeontx2-af: Tc flower offload support for inner VLAN
Date: Wed, 26 Jul 2023 14:48:36 +0300	[thread overview]
Message-ID: <20230726114836.GU11388@unreal> (raw)
In-Reply-To: <20230725103442.2749183-1-sumang@marvell.com>

On Tue, Jul 25, 2023 at 04:04:42PM +0530, Suman Ghosh wrote:
> This patch extends current TC flower offload support to allow filters
> involving inner VLAN matching, to be offloaded to HW.
> 
> Example command:
> tc filter add dev eth2 protocol 802.1AD parent ffff: flower vlan_id 10
> vlan_ethtype 802.1Q cvlan_id 20 skip_sw action drop
> 
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> ---
>  .../net/ethernet/marvell/octeontx2/af/mbox.h  |   1 +
>  .../net/ethernet/marvell/octeontx2/af/npc.h   |   3 +
>  .../marvell/octeontx2/af/rvu_debugfs.c        |   5 +
>  .../marvell/octeontx2/af/rvu_npc_fs.c         |  13 +++
>  .../ethernet/marvell/octeontx2/nic/otx2_tc.c  | 106 +++++++++++-------
>  5 files changed, 90 insertions(+), 38 deletions(-)

<...>

> +	if (!is_inner)
> +		flow_rule_match_vlan(rule, &match);
> +	else
> +		flow_rule_match_cvlan(rule, &match);

<...>

> +		if (!is_inner) {
> +			flow_spec->vlan_tci = htons(vlan_tci);
> +			flow_mask->vlan_tci = htons(vlan_tci_mask);
> +			req->features |= BIT_ULL(NPC_OUTER_VID);
> +		} else {
> +			flow_spec->vlan_itci = htons(vlan_tci);
> +			flow_mask->vlan_itci = htons(vlan_tci_mask);
> +			req->features |= BIT_ULL(NPC_INNER_VID);
> +		}

Slightly better approach will be to reverse these checks from
"if (!is_inner)" to be "f (is_inner)".

Other than that,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

  reply	other threads:[~2023-07-26 11:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 10:34 [net-next PATCH] octeontx2-af: Tc flower offload support for inner VLAN Suman Ghosh
2023-07-26 11:48 ` Leon Romanovsky [this message]
2023-07-27  5:03   ` [EXT] " Suman Ghosh

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=20230726114836.GU11388@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=sumang@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).