From nobody Sat Feb 7 17:48:57 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D11EFEB64DD for ; Wed, 5 Jul 2023 03:38:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230401AbjGEDim (ORCPT ); Tue, 4 Jul 2023 23:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjGEDii (ORCPT ); Tue, 4 Jul 2023 23:38:38 -0400 Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00C8E1A2; Tue, 4 Jul 2023 20:38:37 -0700 (PDT) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 364Lu0cD004348; Tue, 4 Jul 2023 20:38:25 -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=wB0DSkHbuSEPjLODB+OEbokuQbKF1FQqCpHYFSRULkQ=; b=gTTOJ2uosPRNJ2+X1BKLQWUREXXelWReX8YZAHESHeJ2wlsVqAzea7cmA9PO9tOH0/nV 8fgx2soEUIdVETzJeacU6EDdCpXkIB4njIwPJsc2OjSoA+5zhY7357pKz/voywKPlPC7 kcwXATzS19/gv5amNfBylOjVFL0+yyVeuVO2kJ1xDa2cHOzSWpCyNbOkFr/p5b0DNOxb 7crDqNfQeTPwXnM2EbtnrMSyvMcUWnKgoKek1LQvF/wXJukBch2NU8LSTtgQfGuwfntF yuwVbWv/rTYFvBO6a7sX6LMSCgtd8gJAMpfTVYkBd39ZaREokjr6KxiBNzbdvSaAsLa6 Tg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3rjknj98h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 04 Jul 2023 20:38:24 -0700 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; Tue, 4 Jul 2023 20:38:22 -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, 4 Jul 2023 20:38:22 -0700 Received: from marvell-OptiPlex-7090.marvell.com (unknown [10.28.36.165]) by maili.marvell.com (Postfix) with ESMTP id 3D9A93F7057; Tue, 4 Jul 2023 20:38:19 -0700 (PDT) From: Ratheesh Kannoth To: , CC: , , , , , , , , , "Ratheesh Kannoth" Subject: [PATCH net] octeontx2-af: Promisc enable/disable through mbox Date: Wed, 5 Jul 2023 09:08:13 +0530 Message-ID: <20230705033813.2744357-1-rkannoth@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: nf0j3nLTex24kgZEEv-YCnqWm3cbiScO X-Proofpoint-ORIG-GUID: nf0j3nLTex24kgZEEv-YCnqWm3cbiScO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-04_16,2023-07-04_01,2023-05-22_02 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" In Legacy silicon, promisc mode is only modified through CGX mbox messages. In CN10KB silicon, it modified from CGX mbox and NIX. This breaks legacy application behaviour. Fix this by removing call from NIX. Fixes: d6c9784baf59 ("octeontx2-af: Invoke exact match functions if support= ed") Signed-off-by: Ratheesh Kannoth --- .../ethernet/marvell/octeontx2/af/rvu_nix.c | 11 ++--------- .../marvell/octeontx2/af/rvu_npc_hash.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/= net/ethernet/marvell/octeontx2/af/rvu_nix.c index 0d745ae1cc9a..04b0e885f9d2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c @@ -4069,21 +4069,14 @@ int rvu_mbox_handler_nix_set_rx_mode(struct rvu *rv= u, struct nix_rx_mode *req, } =20 /* install/uninstall promisc entry */ - if (promisc) { + if (promisc) rvu_npc_install_promisc_entry(rvu, pcifunc, nixlf, pfvf->rx_chan_base, pfvf->rx_chan_cnt); - - if (rvu_npc_exact_has_match_table(rvu)) - rvu_npc_exact_promisc_enable(rvu, pcifunc); - } else { + else if (!nix_rx_multicast) rvu_npc_enable_promisc_entry(rvu, pcifunc, nixlf, false); =20 - if (rvu_npc_exact_has_match_table(rvu)) - rvu_npc_exact_promisc_disable(rvu, pcifunc); - } - return 0; } =20 diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/dri= vers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c index 9f11c1e40737..7ee7bc256bde 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c @@ -1164,8 +1164,10 @@ static u16 __rvu_npc_exact_cmd_rules_cnt_update(stru= ct rvu *rvu, int drop_mcam_i { struct npc_exact_table *table; u16 *cnt, old_cnt; + bool promisc; =20 table =3D rvu->hw->table; + promisc =3D table->promisc_mode[drop_mcam_idx]; =20 cnt =3D &table->cnt_cmd_rules[drop_mcam_idx]; old_cnt =3D *cnt; @@ -1177,13 +1179,16 @@ static u16 __rvu_npc_exact_cmd_rules_cnt_update(str= uct rvu *rvu, int drop_mcam_i =20 *enable_or_disable_cam =3D false; =20 - /* If all rules are deleted, disable cam */ + if (promisc) + goto done; + + /* If all rules are deleted and not already in promisc mode; disable cam = */ if (!*cnt && val < 0) { *enable_or_disable_cam =3D true; goto done; } =20 - /* If rule got added, enable cam */ + /* If rule got added and not already in promisc mode; enable cam */ if (!old_cnt && val > 0) { *enable_or_disable_cam =3D true; goto done; @@ -1462,6 +1467,11 @@ int rvu_npc_exact_promisc_disable(struct rvu *rvu, u= 16 pcifunc) *promisc =3D false; mutex_unlock(&table->lock); =20 + /* Enable drop rule */ + rvu_npc_enable_mcam_by_entry_index(rvu, drop_mcam_idx, NIX_INTF_RX, true); + + dev_dbg(rvu->dev, "%s: disabled promisc mode (cgx=3D%d lmac=3D%d)\n", + __func__, cgx_id, lmac_id); return 0; } =20 @@ -1503,6 +1513,11 @@ int rvu_npc_exact_promisc_enable(struct rvu *rvu, u1= 6 pcifunc) *promisc =3D true; mutex_unlock(&table->lock); =20 + /* disable drop rule */ + rvu_npc_enable_mcam_by_entry_index(rvu, drop_mcam_idx, NIX_INTF_RX, false= ); + + dev_dbg(rvu->dev, "%s: Enabled promisc mode (cgx=3D%d lmac=3D%d)\n", + __func__, cgx_id, lmac_id); return 0; } =20 --=20 2.25.1