From patchwork Thu Dec 16 17:49:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 105170 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D3E34A0032; Thu, 16 Dec 2021 18:52:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE2CA40DF7; Thu, 16 Dec 2021 18:52:43 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 18FC641156 for ; Thu, 16 Dec 2021 18:52:41 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1BGBdWdM030046 for ; Thu, 16 Dec 2021 09:52:41 -0800 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=xhMN7Za1c8ktz7fyd/2M21kOZOZxJUkClZv6jWdMVsc=; b=Y59e1TaeWUfi1mha46WmJRP/SO4WEKUARF3Fs2n94gUAEmxENkJqPg+19Gdn/f5yOuXj 6Gff9/TBNhVfWH9vfQSYz9Lc5XGa3+98iSRcskFCkEe8ZRqPEB0zl5ubGVdDG+i5wuin okS8YbfbNUAOeP59UQwRTsKnGhT6xx+qqO0ONS+nS9uUdDm0xL2cd3IoBMBTuNn50QqX BelX+av846bv+QYED+0hcl26MX0iS+R60+ULMBHrOUgekXiLCxtHLpeP3Q3DCKdlMKJM jXk3tVqf8iOP65R/2k+B9BM6unB4i/58q2UR/+X/clc3jviwJfkSk8hgNl02Mk7JwFpV bw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3d04s71nx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 16 Dec 2021 09:52:41 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Dec 2021 09:52:39 -0800 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.2 via Frontend Transport; Thu, 16 Dec 2021 09:52:39 -0800 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id A34683F7048; Thu, 16 Dec 2021 09:52:37 -0800 (PST) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Anoob Joseph , Archana Muniganti , Tejasree Kondoj , Subject: [PATCH v2 05/29] common/cnxk: verify input args Date: Thu, 16 Dec 2021 23:19:11 +0530 Message-ID: <1639676975-1316-6-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1639676975-1316-1-git-send-email-anoobj@marvell.com> References: <1638859858-734-1-git-send-email-anoobj@marvell.com> <1639676975-1316-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: GHTBLpVSdHOP4FS2NlIGMpRDGA6lPJI4 X-Proofpoint-ORIG-GUID: GHTBLpVSdHOP4FS2NlIGMpRDGA6lPJI4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-16_06,2021-12-16_01,2021-12-02_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 Add input arg verification. Signed-off-by: Anoob Joseph --- drivers/common/cnxk/hw/cpt.h | 2 ++ drivers/common/cnxk/roc_cpt.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/common/cnxk/hw/cpt.h b/drivers/common/cnxk/hw/cpt.h index 919f842..ccc7af4 100644 --- a/drivers/common/cnxk/hw/cpt.h +++ b/drivers/common/cnxk/hw/cpt.h @@ -64,6 +64,7 @@ union cpt_lf_ctx_flush { struct { uint64_t cptr : 46; uint64_t inval : 1; + uint64_t reserved_47_63 : 17; } s; }; @@ -71,6 +72,7 @@ union cpt_lf_ctx_reload { uint64_t u; struct { uint64_t cptr : 46; + uint64_t reserved_46_63 : 18; } s; }; diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index 8f8e6d3..1bc7a29 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -681,8 +681,10 @@ roc_cpt_lf_ctx_flush(struct roc_cpt_lf *lf, void *cptr, bool inval) { union cpt_lf_ctx_flush reg; - if (lf == NULL) + if (lf == NULL) { + plt_err("Could not trigger CTX flush"); return -ENOTSUP; + } reg.u = 0; reg.s.inval = inval;