Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp932615rwb; Wed, 26 Jul 2023 05:21:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlEpahNTV+PF34zcqhs2WMgLfe8IO0bobtCJppqhMRQMtSd+yrTzm488IO2FDMNnrJHgJdHD X-Received: by 2002:a05:6512:b9a:b0:4f8:4719:1f4a with SMTP id b26-20020a0565120b9a00b004f847191f4amr1943443lfv.7.1690374103772; Wed, 26 Jul 2023 05:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690374103; cv=none; d=google.com; s=arc-20160816; b=jo+Nhtx0LZwujjg1nIJr0T1oIh9zZM8CcBKsrGWnw1U3SMfxbGgAfxdBpcZNt0oZh9 SoUFnjN7CH8hYuZC29ZlJbY3KdI/bw5BSE6b93I++tF6MY7M+m9x2/pgzu7I9qcZEqFr vM4LO5ZXLcc/OKLioN9231QFe6bXEaeJr9LEZ+a4xK+OQ3PcCeohCSgr2DMRh2K+1IUd NiTPoFVpe73Y11TEmZP6hPA11OKnkfRDAO7PUUdpf2o4HqW/9knXae9L8AsV35dSOF8z sEnYdwu1wadJEuxL3ObKBhqkiKxYXjk/6IV2EgCM/SS5DUXMMQy7rl1TIp13k9CJ6i7k EFdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d1IffWswYLPuFRts2/v4dr2NYAp+9dm0FFPc6LAWHFg=; fh=sOcE0Q2QqTbZbv9eTdbirwSVk7wRAfoRiML8VY/DQ7A=; b=sCv+tD+/aFPI8q/wmzhU7BPbCxlEOTLvGdo3opn2xp//efPsyI2h9hpVkI6jaYYWnV yeAbBpoyC+pbmfkK4eKkamQSXFj06bU2PjnRhA+anYW91/CoWVlFnaz3/YrYQUwu0bgl 6V5VkcJx11U9cv9lQmnxfNuC5V0330bneMugd0bKIeNvr0Ya6Q+3nkl9hL4Qi9JHmLwC mnN+5l93aRM2GidKLutOG6+9ak9E/oewXwEltezR+71c+H2hDuoAmmuawmoCn6F2QdT7 Uhr7ubnsMluBSgKxWCcCTJcJWolHFFQ+AcOxxyHnGH5Gcie8IshIRkhTAnYbNKW5VTZe wYRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FO/McMF4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jp7-20020a170906f74700b00993150e5326si8954607ejb.626.2023.07.26.05.21.18; Wed, 26 Jul 2023 05:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="FO/McMF4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234334AbjGZLtR (ORCPT + 99 others); Wed, 26 Jul 2023 07:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234296AbjGZLtQ (ORCPT ); Wed, 26 Jul 2023 07:49:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43F0630FC for ; Wed, 26 Jul 2023 04:48:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 505E961AE1 for ; Wed, 26 Jul 2023 11:48:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E39E5C433C7; Wed, 26 Jul 2023 11:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690372121; bh=eZG9v0oZO9uEfsEIeSuInQVaRCDGDxegAVVDWaK0lZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FO/McMF4qjCJ/ZEnvhx0ROGZLqNZRvkrnD/QyR5ni2dYbxz78blKyECZOeUSmTOYl p/Bd0GGnU4Hq+WBUscxgIngIdoLN8Cfzw4quDBiosVJsARc4iSDKujlP6LM7yu8OEb P0niNcp41mrQ7Is4Ri8H1gOTNcuIvI4M3voLzyhOpYoBtC4mw8Cn1MKcR79mjPF897 GCChIgLoqO3+kyWIV1LIkpTvQaBUE0/Kx6wiGjZ+tnSzW/YgClnDFO/TWSExNbOMJA yg3yBBatxEnLBnr73eu6OgGvpori4tpJr/Aop2PkwBIJ1fUfwXkQwvFfLxAg+uHulF zkrVjB6xThYWQ== Date: Wed, 26 Jul 2023 14:48:36 +0300 From: Leon Romanovsky To: Suman Ghosh 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 Message-ID: <20230726114836.GU11388@unreal> References: <20230725103442.2749183-1-sumang@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230725103442.2749183-1-sumang@marvell.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > .../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