lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230726114836.GU11388@unreal>
Date:   Wed, 26 Jul 2023 14:48:36 +0300
From:   Leon Romanovsky <leon@...nel.org>
To:     Suman Ghosh <sumang@...vell.com>
Cc:     sgoutham@...vell.com, gakula@...vell.com, sbhatta@...vell.com,
        hkelam@...vell.com, davem@...emloft.net, edumazet@...gle.com,
        kuba@...nel.org, pabeni@...hat.com, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, lcherian@...vell.com,
        jerinj@...vell.com
Subject: Re: [net-next PATCH] octeontx2-af: Tc flower offload support for
 inner VLAN

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@...vell.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@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ