Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2086755rdb; Sun, 11 Feb 2024 10:37:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXFRIfGLaDqY4RG68kudHKK4qIixp5SX/tnm12zc9oXlegBmwlEvKp2/Y2TxNPVGXDztLL/+hQhKpMKpqvW1x63oZyolJmmkNpp/Db0jQ== X-Google-Smtp-Source: AGHT+IE+d4KDXfzShPMVes/fbtLW5lFzkeKZefXSpnIkvWRgRZdBa7jitE4gq1/CLaIUp4bFnHaV X-Received: by 2002:a05:620a:4d03:b0:785:9715:100a with SMTP id wa3-20020a05620a4d0300b007859715100amr3894668qkn.39.1707676631680; Sun, 11 Feb 2024 10:37:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707676631; cv=pass; d=google.com; s=arc-20160816; b=wbmgRaijG2iBnuH9FZBpG318IbEkqqtxkfRj/KE41ft/kNtUN7D12y0aRWPpErWVRp BPgPYA0GDZCm0t8gpxg/f+HYOFn9HtJ9ZEBnM4P8z0avdipgCqBywAyqgpD2SjK9KS/A fWjPX5XI6rmWZ4+TKex2GjAk268yTCMLlP3TfyzNtaShCTK7rIE9abPYsR/h57LD05pm Fbu7/EciwSEsPsE//NbGWuo3uV4D2YHEjegCtlySQRDbZm6b+DYfOeintfEpzSEHcFqC DjXnD0CuRZJOnuozd8SZShoC3tBikp149Q6M3/wrRrDDE0sSBEjuijhgJszRh2lb2tR2 PV2g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature; bh=HccO4k69S/Dtb9/3alJXStUYrXhVB7/VvqULt2kxnNU=; fh=PGpLplS0yG1Ag85W4tsxPuKWwGgmoDFHCDpXRAgj9u4=; b=RC/NmR1KdoGaAL5AqBInGB0tKGoESjfPlMrrZSbFMu63mYzjm+J5CNobZSYlEitOoo +za51gqXYS9TbkvkqD4/yhlAEgp5oWdan9JRgJdeFSyx4mSJ9+HnYQSF+A3ZGDO1KPI8 wSVjjq9iQJzz/AZNSfV40W6+OwBdxi/QlhFohg+kKQhTmB+v69kWUArifSc8amZz837Y eKBI5pUrSySQoxRDte3JaPPzuqSn8zUINp3dj0RMEKrXLzUk3K2SvqyytVzanBZr+93k iEUhs7kJd4dnknD9qNp1dTE0JQeXxQ4Rgkkx01PptAJn4ORQY61fw5ggAizseWhHBiaS Jvyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="lPPvS8/S"; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-60908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com X-Forwarded-Encrypted: i=2; AJvYcCWBaO61B+R11nHj5oQDsn5REkjW9LxwbDjXxYzlwONiu8wsnL7Cv/eYfLeQY9X7SY9+bpTisanw5kAAL//gNFByV0S4fSRuwmzOOeGR4g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id t25-20020a05620a0b1900b007839e747700si4196648qkg.192.2024.02.11.10.37.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 10:37:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b="lPPvS8/S"; arc=pass (i=1 spf=pass spfdomain=marvell.com dkim=pass dkdomain=marvell.com dmarc=pass fromdomain=marvell.com); spf=pass (google.com: domain of linux-kernel+bounces-60908-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60908-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1396A1C20B12 for ; Sun, 11 Feb 2024 18:37:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85C4E43AA0; Sun, 11 Feb 2024 18:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="lPPvS8/S" Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 233A31E4B8; Sun, 11 Feb 2024 18:36:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=67.231.148.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707676617; cv=none; b=onQJ4Elb9XuS0Dl4mBkMkSFyHCSnddEH5CYjxh59U61exQyzsT6hLKXuVxw2ksyCVb9n82ijoxAd4zqOz+YaoKO9VnaZhqKdFTaSEGLarjpgA56ygKAfhhF/ncXHeVA6ur5Moruj/Wj9k0sg90R9UbCqVT61CTGTNXs1HFRXgLU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707676617; c=relaxed/simple; bh=Lcg4lM2G9CuHTtys1fNCLBmGy/ahJXg/HXxHponNmOY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=h3atM5WAcceiW6dUk+QrUaC57mL98LfnPICPR0UEL+Lp9wzC8Dvm3d+oBHMBJfxx9tu8YrgiXIRSh54XsQA5X7emB/z1VtsuFvNF8h9yHByuhm48nkAfSP4Oxl0yBJ8RfuKqZMotQdELTgFwaOHVZYw74fdZ6ETZ+Fg1uKwa9R0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com; spf=pass smtp.mailfrom=marvell.com; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b=lPPvS8/S; arc=none smtp.client-ip=67.231.148.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=marvell.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marvell.com Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41BIaame031602; Sun, 11 Feb 2024 10:36:36 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= from:to:cc:subject:date:message-id:mime-version:content-type; s= pfpt0220; bh=HccO4k69S/Dtb9/3alJXStUYrXhVB7/VvqULt2kxnNU=; b=lPP vS8/S60dxIssMcjZC6DXFKSN/LPDKqyeg6sCeXO45dv+gnzOzYzOdJ5d0JQ2spDF y4eTztH77AWwPYzeLnJRNRB13q7ZRnIx/zGnYawKGngNYkpHoc53RSa4JT8Yk5fw PxUFTNQzKSOvOQPYoUNPWi6XgDZxJfSDY7FEtFL18wr3ZDAUVWpQ/OZ+4/e9yd4s 5vRqu1M/Do1FwX8Cx4fsFCYYJbT226SrSkfGPEIMXjZ1/DXOD868B0Dqu6qGvZh7 g6hZguJls5yR3d8dYWcAp5Rm1pYhOZsyF5cdQvsx6cZNTqG2NPfmBTVsiwskQmzt qUiqEIpg+s+sNMzUstw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3w67cpats0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 11 Feb 2024 10:36:35 -0800 (PST) Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Sun, 11 Feb 2024 10:36:34 -0800 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; Sun, 11 Feb 2024 10:36:34 -0800 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id 58F023F7040; Sun, 11 Feb 2024 10:36:30 -0800 (PST) From: Subbaraya Sundeep To: , CC: , , , , , , , , , , Subbaraya Sundeep Subject: [PATCH 1/2] octeontx2-af: Remove the PF_FUNC validation for NPC transmit rules Date: Mon, 12 Feb 2024 00:06:27 +0530 Message-ID: <1707676587-12711-1-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: yyM0X6rDBn0AxhXiNKuwrT07gzWjv0F8 X-Proofpoint-ORIG-GUID: yyM0X6rDBn0AxhXiNKuwrT07gzWjv0F8 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-11_17,2024-02-08_01,2023-05-22_02 NPC transmit side mcam rules can use the pcifunc of transmitting device for mcam lookup. The commit 18603683d766 ("octeontx2-af: Remove channel verification while installing MCAM rules") removed the receive side channel verification to save hardware MCAM filters while switching packets across interfaces but missed removing transmit side checks. This patch removes transmit side rules validation. Fixes: 18603683d766 ("octeontx2-af: Remove channel verification while installing MCAM rules") Signed-off-by: Subbaraya Sundeep --- .../net/ethernet/marvell/octeontx2/af/rvu_npc.c | 32 ---------------------- 1 file changed, 32 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c index 8cfd74a..e5d6156 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c @@ -61,28 +61,6 @@ int rvu_npc_get_tx_nibble_cfg(struct rvu *rvu, u64 nibble_ena) return 0; } -static int npc_mcam_verify_pf_func(struct rvu *rvu, - struct mcam_entry *entry_data, u8 intf, - u16 pcifunc) -{ - u16 pf_func, pf_func_mask; - - if (is_npc_intf_rx(intf)) - return 0; - - pf_func_mask = (entry_data->kw_mask[0] >> 32) & - NPC_KEX_PF_FUNC_MASK; - pf_func = (entry_data->kw[0] >> 32) & NPC_KEX_PF_FUNC_MASK; - - pf_func = be16_to_cpu((__force __be16)pf_func); - if (pf_func_mask != NPC_KEX_PF_FUNC_MASK || - ((pf_func & ~RVU_PFVF_FUNC_MASK) != - (pcifunc & ~RVU_PFVF_FUNC_MASK))) - return -EINVAL; - - return 0; -} - void rvu_npc_set_pkind(struct rvu *rvu, int pkind, struct rvu_pfvf *pfvf) { int blkaddr; @@ -2851,12 +2829,6 @@ int rvu_mbox_handler_npc_mcam_write_entry(struct rvu *rvu, else nix_intf = pfvf->nix_rx_intf; - if (!is_pffunc_af(pcifunc) && - npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf, pcifunc)) { - rc = NPC_MCAM_INVALID_REQ; - goto exit; - } - /* For AF installed rules, the nix_intf should be set to target NIX */ if (is_pffunc_af(req->hdr.pcifunc)) nix_intf = req->intf; @@ -3208,10 +3180,6 @@ int rvu_mbox_handler_npc_mcam_alloc_and_write_entry(struct rvu *rvu, if (!is_npc_interface_valid(rvu, req->intf)) return NPC_MCAM_INVALID_REQ; - if (npc_mcam_verify_pf_func(rvu, &req->entry_data, req->intf, - req->hdr.pcifunc)) - return NPC_MCAM_INVALID_REQ; - /* Try to allocate a MCAM entry */ entry_req.hdr.pcifunc = req->hdr.pcifunc; entry_req.contig = true; -- 2.7.4