Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5219921rwb; Wed, 9 Aug 2023 00:02:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGpD7l4fFVinRMKb0fP5/Jlazt8caNTpzRCkHJOG2eJfd8+P1j1kwejb+rEBBpjdB4dnh18 X-Received: by 2002:ac2:5f4e:0:b0:4fb:81f2:4228 with SMTP id 14-20020ac25f4e000000b004fb81f24228mr989988lfz.31.1691564544203; Wed, 09 Aug 2023 00:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691564544; cv=none; d=google.com; s=arc-20160816; b=IDqU3fmwNdKWE2N+fOeKg3UdIjdRddsYf8XwEGJXdiQR3Qk9ee8PA125rfZumoSbuz AwpOn/CXVYbvG7+fA0CuQzFmY4F3V7kLwd4enT+QZhu8REucd6a+RHXBeaiY5VtrKzWO hze+GyLnoeySqZnUEwRmqCkJuX/GKLkx1rgk4639x8oMUZVvwmKBTle/p84FVizgzScA oIfSN3l9VvrHzpim9iF96E1J/Pfs885fkA8Qwgb0PEmzrpU044HnAcm0y16LKBanxkwk WZhPJYXgtLmEnvdW/fdMDfiV21EsfaIB6r8/UaucO0bfYaAWSa4MogICRVDu6XP4mnTS 2tmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Yx9yKTjG6oSu+ogeiBB9HVwjJYXMB5oiDs93tZ82S6Y=; fh=IcMKsvdyfQrTkyBhD0XykSHRPQYMZdm4srEmSE983mc=; b=ruY5jLTbEHxk605RBWOlw2swwF0ROsj6lBzKqr1s5hj7jCgc4rHaJUHU3SePhQkA6t v5KnRkXq88gHgHgbH4EcNb+P8SbCRBRKa6CA4vpackv0BOxhceLY5d8LxeFKkZCzWdNV mwajId0D4EpMmCF4Jl+UIknadN4/rPlydYOrx1LBqPnjF3VtWQ6D1pLnZIIINTio4ESj v87hKiR0fG03fooXGD7xfVAv491Tono9o1cwxGbQ3zQ6dcX1LxiS5vGnunEGV/2HkvHg RCwULtK5fFfcXfWPKOzdEByiHcJU4QuLo1bjsXQbfIpV5GZQXCXL6cuztCZ1T3TZ85gb g6LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=CJc9HDD6; 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=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v18-20020a056402185200b00523215dd857si7550081edy.52.2023.08.09.00.01.59; Wed, 09 Aug 2023 00:02:24 -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=@marvell.com header.s=pfpt0220 header.b=CJc9HDD6; 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=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230194AbjHIGk6 (ORCPT + 99 others); Wed, 9 Aug 2023 02:40:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjHIGk5 (ORCPT ); Wed, 9 Aug 2023 02:40:57 -0400 Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60FA310CF; Tue, 8 Aug 2023 23:40:57 -0700 (PDT) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 379661kq023099; Tue, 8 Aug 2023 23:40:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Yx9yKTjG6oSu+ogeiBB9HVwjJYXMB5oiDs93tZ82S6Y=; b=CJc9HDD6fLFnwrJPoAtsXonXITzMsORXmLKUKl+sSnRuXpMhBPXnGZaz8JZ3mgJMkwyw jK0LbHwAUSwRbDNN7A7/Upmdc+1mfkNyOfY/lTnHY6cN3rG6ib9WnfE9hYYgyKO51pAG nULgmWScZetIQydv502A6NfgGS/FLW5xgxHIkye7eygtTsjj9ebv4M9yxXpKTvH/0qHe x8o+f5riCnkghjBNAyCZudI92Cx5OEti0MFVgwIJ+wocrUReFG8tGOo/5Sx6aG2BE4AG Id+lpCFvW20DpjItPDQG+TFCZGUi/BmSeu0r4/An5DWDhoLKQeRxK2mm9HpW8V82NxyT Hg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3sc57sg3db-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 23:40:48 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 8 Aug 2023 23:40:46 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 8 Aug 2023 23:40:46 -0700 Received: from marvell-OptiPlex-7090.marvell.com (unknown [10.28.36.165]) by maili.marvell.com (Postfix) with ESMTP id 8CF4D3F705A; Tue, 8 Aug 2023 23:40:42 -0700 (PDT) From: Ratheesh Kannoth To: , CC: , , , , , , , , , , Ratheesh Kannoth Subject: [PATCH net-next] octeontx2-af: Harden rule validation. Date: Wed, 9 Aug 2023 12:10:39 +0530 Message-ID: <20230809064039.1167803-1-rkannoth@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: p8UOcCxHr2z4ruJRnT98wdnww5h5Osn7 X-Proofpoint-ORIG-GUID: p8UOcCxHr2z4ruJRnT98wdnww5h5Osn7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-09_04,2023-08-08_01,2023-05-22_02 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 Accept TC offload classifier rule only if SPI field can be extracted by HW. Signed-off-by: Ratheesh Kannoth --- drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 5c8f9fc15ff8..237f82082ebe 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c @@ -580,7 +580,9 @@ static void npc_set_features(struct rvu *rvu, int blkaddr, u8 intf) if (!npc_check_field(rvu, blkaddr, NPC_LB, intf)) *features &= ~BIT_ULL(NPC_OUTER_VID); - if (*features & (BIT_ULL(NPC_IPPROTO_AH) | BIT_ULL(NPC_IPPROTO_ESP))) + /* Set SPI flag only if AH/ESP and IPSEC_SPI are in the key */ + if (npc_check_field(rvu, blkaddr, NPC_IPSEC_SPI, intf) && + (*features & (BIT_ULL(NPC_IPPROTO_ESP) | BIT_ULL(NPC_IPPROTO_AH)))) *features |= BIT_ULL(NPC_IPSEC_SPI); /* for vlan ethertypes corresponding layer type should be in the key */ -- 2.25.1