From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A04041E08; Mon, 13 Mar 2023 06:24:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F69B41140; Mon, 13 Mar 2023 06:24:17 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D11C741140 for ; Mon, 13 Mar 2023 06:24:15 +0100 (CET) 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 32D303tk008855 for ; Sun, 12 Mar 2023 22:24:15 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=3Mt8QxJiAzQyy6ufqfjTEC8dmu81kQaau3ARNe+JaZo=; b=hZpokAWrME0lhin/HuKPt3eoSIhgeiJH6JEteT+XFw34CLEVJhMHu8GdRWXsrqJ/n7aa JfPTf9/TFzg70I/nIoMMoy1C+d+HZpM9JVnyxwo4gF4l8jhU6zW0YVOe1HdJwCJ0s4VM c4rsKr86ofSom7ttO8kzNMfuoSGo9hWj9+aSubo2UIGmeg/a5gJ4T+gnOsPET/3QUwUw JzrC9YK6pB2dLkE9IUbEREaOawrUEk+Hg5JzZkwvCrGcs3we4il9MjuIqWpp06iLhINP 64h4QzkVDvX3S/WwmxMbdKs/kujN0EKw6E3Jb0a1QOPYYQB57B4HylPlebtj+bHbu1f0 XA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3p8t1t4b7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 12 Mar 2023 22:24:15 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Sun, 12 Mar 2023 22:24:12 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Sun, 12 Mar 2023 22:24:12 -0700 Received: from satheeshpaullabpc.. (unknown [10.28.34.33]) by maili.marvell.com (Postfix) with ESMTP id E93985B6921; Sun, 12 Mar 2023 22:24:09 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Satheesh Paul Subject: [dpdk-dev] [PATCH 2/2] common/cnxk: fix SPI to SA index destroy Date: Mon, 13 Mar 2023 10:54:03 +0530 Message-ID: <20230313052403.230953-2-psatheesh@marvell.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313052403.230953-1-psatheesh@marvell.com> References: <20230313052403.230953-1-psatheesh@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: IQ7NXa1mYUGAnbh9LMk6_DleoILNi6YB X-Proofpoint-ORIG-GUID: IQ7NXa1mYUGAnbh9LMk6_DleoILNi6YB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-12_10,2023-03-10_01,2023-02-09_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Satheesh Paul While destroying SPI to SA index rule, inline device mbox should be used. Adding changes to fix this. Fixes: 04087b781484 ("common/cnxk: support SPI to SA index") Signed-off-by: Kiran Kumar K Signed-off-by: Satheesh Paul --- drivers/common/cnxk/roc_npc.c | 14 ++++++++++---- drivers/common/cnxk/roc_npc_mcam.c | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c index 7228cffb57..ba75207955 100644 --- a/drivers/common/cnxk/roc_npc.c +++ b/drivers/common/cnxk/roc_npc.c @@ -1503,16 +1503,22 @@ npc_rss_group_free(struct npc *npc, struct roc_npc_flow *flow) static int roc_npc_delete_spi_to_sa_action(struct roc_npc *roc_npc, struct roc_npc_flow *flow) { - struct roc_nix *roc_nix = roc_npc->roc_nix; struct nix_spi_to_sa_delete_req *req; + struct nix_inl_dev *inl_dev; + struct idev_cfg *idev; struct mbox *mbox; - struct nix *nix; + + PLT_SET_USED(roc_npc); if (!flow->spi_to_sa_info.has_action || flow->spi_to_sa_info.duplicate) return 0; - nix = roc_nix_to_nix_priv(roc_nix); - mbox = (&nix->dev)->mbox; + idev = idev_get_cfg(); + if (!idev) + return -1; + + inl_dev = idev->nix_inl_dev; + mbox = inl_dev->dev.mbox; req = mbox_alloc_msg_nix_spi_to_sa_delete(mbox); if (req == NULL) return -ENOSPC; diff --git a/drivers/common/cnxk/roc_npc_mcam.c b/drivers/common/cnxk/roc_npc_mcam.c index 948c446312..72892be300 100644 --- a/drivers/common/cnxk/roc_npc_mcam.c +++ b/drivers/common/cnxk/roc_npc_mcam.c @@ -96,10 +96,10 @@ int npc_mcam_free_all_entries(struct npc *npc) { struct npc_mcam_free_entry_req *req; - struct mbox *mbox = npc->mbox; + struct mbox *mbox = mbox_get(npc->mbox); int rc = -ENOSPC; - req = mbox_alloc_msg_npc_mcam_free_entry(mbox_get(mbox)); + req = mbox_alloc_msg_npc_mcam_free_entry(mbox); if (req == NULL) goto exit; req->all = 1; @@ -354,10 +354,10 @@ npc_mcam_alloc_entry(struct npc *npc, struct roc_npc_flow *mcam, { struct npc_mcam_alloc_entry_req *req; struct npc_mcam_alloc_entry_rsp *rsp; - struct mbox *mbox = npc->mbox; + struct mbox *mbox = mbox_get(npc->mbox); int rc = -ENOSPC; - req = mbox_alloc_msg_npc_mcam_alloc_entry(mbox_get(mbox)); + req = mbox_alloc_msg_npc_mcam_alloc_entry(mbox); if (req == NULL) goto exit; req->contig = 1; -- 2.39.2