From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-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 8E82B1A0BF1 for ; Wed, 7 May 2025 17:13:35 +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=1746638017; cv=none; b=H814lHCaGGdmj0p+vhxoxxHVTTZPAETMp0Wvm0/kSZvKDVtp3wUXcrMNHgKS+boYkIuX7TbgU1BHX01D7RlVWrpFdH3ydqobrCRGdDn10bCCyey/tQpFj2v/QeGtuFYi4pY3ZRkyGeUHrDFQCVgejvUt0wkerlvqXhxATkRX0l0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746638017; c=relaxed/simple; bh=J72i1Wp9oi7hk2jMR7W27GcfTd+rvOi9NRjQWL1s9Ns=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=EEZxJqPGZ1q4P/m/bGiTuiMRTgGh1mnSzuw9BM7ic95c1Ue3BdNK9/rM0nsI7Mq5KlJq3mcbNtKbVbg9siX2pArZMLPMiH7+LxrJbwXrVgxAXNVsHNdhyZXGXAA2l861qBE6TUxDOCaHRor26BhReYkraLV2IvUJiGC+LiTgtmo= 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=d/geZy1b; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="d/geZy1b" Received: from pps.filterd (m0431384.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 547BwCVc020032; Wed, 7 May 2025 10:13:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-type:date:from:message-id:mime-version:subject:to; s= pfpt0220; bh=maXAM3pb0IjEkH/dFLOHGfXfA9wJbky+XD1BhVA28PQ=; b=d/g eZy1bv53ZHTDX70BDswBt3S9WhgcH4BSlO0CDpT71JNU1szR4K68kIRiJfld4Ino U2RarT5Rhf3dM9vchwxV9hgIlm+fJwiK/9SyESrLvr37O3iA7ADHkmHw44TFDf39 94bz9r1Jx1SAu0Z2DMAnkawcYMD8HtRqa7MPuVs0RDSD4LuHHRBXVo2gNC9IQ9+G WgY/Lw1IaK/tp4sQdFexrV1shdtKqzGOS2HzX7C8Ck2rW8fG3deAf3RXdcqSGvnJ yuPQ35fiyBEtrNIfnJsdUQbnfTDp/OWJJUhRYXa2OH7tvrqm9szhW5iSOWg3JOPt 12iyBSj3a1GAI82m+hQ== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 46g4kp93nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 May 2025 10:13:15 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 7 May 2025 10:13:14 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 7 May 2025 10:13:14 -0700 Received: from hyd1358.marvell.com (unknown [10.29.37.11]) by maili.marvell.com (Postfix) with ESMTP id D37A03F708A; Wed, 7 May 2025 10:13:10 -0700 (PDT) From: Subbaraya Sundeep To: , , , , , , , , CC: , Subbaraya Sundeep Subject: [PATCH] octeontx2-pf: Do not reallocate all ntuple filters Date: Wed, 7 May 2025 22:42:56 +0530 Message-ID: <1746637976-10328-1-git-send-email-sbhatta@marvell.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTA3MDE1OSBTYWx0ZWRfX2xPEGDipUm3X GfIhc+rV92gNhNQ/zGzUf0tfBckFtKlEP3mGRRxxTAcEdwZyf6uczhoU8UbvO1hYlFo7h/FC8YR s14VdHGYRvM7/4lj6m7eJKXd4/5UehcpYnO4misW7Ylz3aE1xYDjdpBqgQyncdqnCPFaQXIjdEz ouLvCS+Lo+JpnN2ihQ/5uv4Yi7hvGoqzJOdXZig6fWqQYrE8hXy4h3DyDrl+ijJ1/zh/mcXP7J6 AUP0+00ZWXVpn27204aicKkE0FoyIzaEdO2Wm8xg7Hdz1+mdmEutkOdhxCLBtwmELPen1U7lTE+ yvvONgXkx8Pdfs1oIiAwbkXSQw5iL1rd2I7lhTAsXbqNBlgMf/nBnG4N7HQUk7TJ2Hu4winZFyB LHJxlSC2vaYivCrSkEX26Dum3Vw0DeD7cQVcVj2yZmiTrZ8ZgRaZvthWpfv0smLrCvHo162B X-Proofpoint-GUID: yB-65sUR_toTfvNwrQyEwJ92AzMxhR6O X-Authority-Analysis: v=2.4 cv=evffzppX c=1 sm=1 tr=0 ts=681b94ab cx=c_pps a=rEv8fa4AjpPjGxpoe8rlIQ==:117 a=rEv8fa4AjpPjGxpoe8rlIQ==:17 a=dt9VzEwgFbYA:10 a=M5GUcnROAAAA:8 a=JJ9OIAJi2aS0bon4u0AA:9 a=OBjm3rFKGHvpk9ecZwUJ:22 X-Proofpoint-ORIG-GUID: yB-65sUR_toTfvNwrQyEwJ92AzMxhR6O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-07_05,2025-05-06_01,2025-02-21_01 If ntuple filters count is modified followed by unicast filters count using devlink then the ntuple count set by user is ignored and all the ntuple filters are being reallocated. Fix this by storing the ntuple count set by user using devlink. Fixes: 39c469188b6d ("octeontx2-pf: Add ucast filter count configurability via devlink.") Signed-off-by: Subbaraya Sundeep --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 1 + drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c | 1 + drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h index 1e88422..d6b4b74 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -356,6 +356,7 @@ struct otx2_flow_config { struct list_head flow_list_tc; u8 ucast_flt_cnt; bool ntuple; + u16 ntuple_cnt; }; struct dev_hw_ops { diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c index 33ec9a7..e13ae548 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c @@ -41,6 +41,7 @@ static int otx2_dl_mcam_count_set(struct devlink *devlink, u32 id, if (!pfvf->flow_cfg) return 0; + pfvf->flow_cfg->ntuple_cnt = ctx->val.vu16; otx2_alloc_mcam_entries(pfvf, ctx->val.vu16); return 0; diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c index 47bfd1f..64c6d916 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c @@ -247,7 +247,7 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf) mutex_unlock(&pfvf->mbox.lock); /* Allocate entries for Ntuple filters */ - count = otx2_alloc_mcam_entries(pfvf, OTX2_DEFAULT_FLOWCOUNT); + count = otx2_alloc_mcam_entries(pfvf, flow_cfg->ntuple_cnt); if (count <= 0) { otx2_clear_ntuple_flow_info(pfvf, flow_cfg); return 0; @@ -307,6 +307,7 @@ int otx2_mcam_flow_init(struct otx2_nic *pf) INIT_LIST_HEAD(&pf->flow_cfg->flow_list_tc); pf->flow_cfg->ucast_flt_cnt = OTX2_DEFAULT_UNICAST_FLOWS; + pf->flow_cfg->ntuple_cnt = OTX2_DEFAULT_FLOWCOUNT; /* Allocate bare minimum number of MCAM entries needed for * unicast and ntuple filters. -- 2.7.4