From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AABD2A0613 for ; Mon, 5 Aug 2019 06:05:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DE2DD1BE3D; Mon, 5 Aug 2019 06:05:23 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 64B981BE24 for ; Mon, 5 Aug 2019 06:05:21 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7545KwS002903; Sun, 4 Aug 2019 21:05:20 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=tSKtZ1M+zH6rzDYYRfEfp9CBjcHQpvuYTBRgZYH9R2Q=; b=jN0slAW+B9iLXPbQh0Ynwfj1Bkkn+r/e5pj1o7tQ/kgJLUSORA1++mUFVyPnHB7fAnjv iRIGigNxXdGHfuAk+DCeZJqVuUx/BQmalnxEmgEgNlZCVT/XpzE3TC3XWA1gBAnnUS60 l21DeOLXyX451BTDFz4/VcmjhC0Cr1zrUMn/LdwGETIVOaiD8joy5feLi6OFcS8lPIrk GkHGLJw3s+mjG53F+kjafQauErkPO529cOnqT9JLZiFc06d5B/t7xakOhkqnwYErHH9e TE9UiMPVSPkWKkHW12DNyTyjRVxeSI2lwNdKBDj2WNOTn/M3kFC+G5dvSVdmAtuXClds Tw== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2u57mqwd71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 04 Aug 2019 21:05:20 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 4 Aug 2019 21:05:18 -0700 Received: from NAM01-BY2-obe.outbound.protection.outlook.com (104.47.34.54) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 4 Aug 2019 21:05:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XrlhTEwku0+g8NpKLsZMkSjcLONBign/Iz7YyYXcP0Hy9XFHfbBFrkRv7qwuLUyHP7txF+5jQG3TdjS249gTdo7SDwELDZfIofkh8MDDEbSi4wNpIVvCsxKzBnMdgSRZ2u9deyo3jhPSkZVzfCA3QQYtZ5dZG/RugupP4t6rfSw9Lbjvfch3QBnSLjVqQprteksIL9su/KyYXppPcfATEMExCeIi5a3kNX4VoZL+mLGlbfUc/Nl1oGJLzExtyBgMXi3XH2vNebtiaRndzv4DG640umsGmiRcy+Jyg1sjFL78eguRh8qCURSCv+TOYDKwZzHc6vZ2YK2dBeVeCSfzdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tSKtZ1M+zH6rzDYYRfEfp9CBjcHQpvuYTBRgZYH9R2Q=; b=PIATRqyfcziS63r5ahZ284knYL312vJOY2yGr5535ZvkSLk6yC9eD5LBtv09lzvm0Wcu6ba1ILo3U2Dtf2PII1UPi8kylDmYmnkbTA28+y+HeN7Z5OtMN7NwAO4upuMxmT+bBIJS0mV/AOg0mytTCspKFUqq5C7yaTHhAwMfff4Z7ZiWb4Tlp5lPX3Etr6ZCWQNXg4s85kewEMlRoU4PvaYbVPURfjbAHSoHLIBDEeNQHvrOxfQPVxMgKX0ABCG/U8yylTnz7BmokthprYWk8zERalQWbssLxx7Zd/eVHIjjnAgLYsgUyBrjfN+cd3vpEMAkBc6rreN160X1Xqxa6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=marvell.com;dmarc=pass action=none header.from=marvell.com;dkim=pass header.d=marvell.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tSKtZ1M+zH6rzDYYRfEfp9CBjcHQpvuYTBRgZYH9R2Q=; b=oU8SKJkKjaBmMOvEeklpxNpaLI4OKH7HKirCTvrtciwtOMgVPCU4VLPgrAmwtGLycLdkC2nt3p7ZJ43eGPe53aRvqTv5QMSYVXPsorTUoCdfoET6rnXlXRkkQ1eDDBv5Uh3I4+wvou25zscS6Gii7LSNfO3J1Lmc8ooR3pA2JhI= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2632.namprd18.prod.outlook.com (20.179.94.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.17; Mon, 5 Aug 2019 04:05:17 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5877:72b7:40cf:2013]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5877:72b7:40cf:2013%3]) with mapi id 15.20.2136.018; Mon, 5 Aug 2019 04:05:17 +0000 From: Jerin Jacob Kollanukkaran To: Harman Kalra , Nithin Kumar Dabilpuram , Vamsi Krishna Attunuru , Kiran Kumar Kokkilagadda CC: "dev@dpdk.org" , "thomas@monjalon.net" Thread-Topic: [PATCH] drivers/octeontx2: fix coverity issues Thread-Index: AQHVSpUlhGe/9LHxDk616iQ+gX/YCabr8JEA Date: Mon, 5 Aug 2019 04:05:16 +0000 Message-ID: References: <1564903224-16945-1-git-send-email-hkalra@marvell.com> In-Reply-To: <1564903224-16945-1-git-send-email-hkalra@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f599ff10-9653-4873-2461-08d7195a1ffc x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:BYAPR18MB2632; x-ms-traffictypediagnostic: BYAPR18MB2632: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:262; x-forefront-prvs: 01208B1E18 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(39850400004)(396003)(376002)(136003)(13464003)(199004)(189003)(55236004)(6116002)(3846002)(33656002)(2906002)(8676002)(256004)(74316002)(76116006)(305945005)(7736002)(14444005)(71200400001)(71190400001)(8936002)(81156014)(81166006)(14454004)(11346002)(486006)(186003)(26005)(446003)(476003)(478600001)(66066001)(25786009)(4326008)(66946007)(66476007)(7696005)(66556008)(64756008)(66446008)(54906003)(5660300002)(52536014)(99286004)(9686003)(102836004)(55016002)(6246003)(6506007)(53546011)(86362001)(30864003)(229853002)(53936002)(6436002)(110136005)(316002)(76176011)(68736007)(6636002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2632; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Gcut8zErQWnmyTDMa2cSZIL3AdSGQwLA3Rq9coA/DfvkjA1Jx/qmWPKPPRHUkTahL9coYOdlpFHW8O3GPpuZB3Hcho+nIgPYMXrr4192aYV9epeGzWx7ksn2SellPWec53c7aZOnHANxRGdepPjNc1WggOoQBcgBuFCZ5qJMhPC0Yf11+YBGQu+zXOW063etnXjuGljo8pKGjMU635jb3lyK6o72Vkxt0r3Sf42ZUoaf6D7P82lYmavK4VwgLhANpX4hpzNVutnQDjhhhcjY5gQg0henH5FD1FYIVCaWuW8vsRY2gNFtkYw1BHgTvM+CoxYaOoJR9w4HBveET/oCqbDeXNLB5riq+gx1NGjyqobQaL/AlryHZQQTmYrL9GOWy6HihStW0fArY7Yqv3KXQtd1LIwqGjVp0iXli5vf+H0= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f599ff10-9653-4873-2461-08d7195a1ffc X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Aug 2019 04:05:16.8604 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jerinj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2632 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-05_02:2019-07-31,2019-08-05 signatures=0 Subject: Re: [dpdk-dev] [PATCH] drivers/octeontx2: fix coverity issues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Harman Kalra > Sent: Sunday, August 4, 2019 12:51 PM > To: Jerin Jacob Kollanukkaran ; Nithin Kumar > Dabilpuram ; Vamsi Krishna Attunuru > ; Kiran Kumar Kokkilagadda > > Cc: dev@dpdk.org; Harman Kalra > Subject: [PATCH] drivers/octeontx2: fix coverity issues >=20 > Addresed issues reported by coverity: NULL pointer dereferencing issues, > unchecked return value, uinitialized scalar value, probable deadcode case= s, > unintended sign extension, bad bit shift operation, Wrong sizeof argument > (SIZEOF_MISMATCH) >=20 > Coverity issue: 343396, 345028, 344977, 345015, 345025, 344969, Coverity > issue: 345014, 344966, 343437, 344993, 345007, 344988, Coverity issue: 34= 3405, > 344999, 345003 >=20 > Fixes: 58f6f93c34c1 ("net/octeontx2: add module EEPROM dump") > Fixes: 38f566280abb ("net/octeontx2: add link stats operations") > Fixes: b5dc3140448e ("net/octeontx2: support base PTP") > Fixes: ba1b3b081edf ("net/octeontx2: support VLAN offloads") > Fixes: 092b38341859 ("net/octeontx2: add flow init and fini") > Fixes: 3da1b85b6d06 ("common/octeontx2: add FLR IRQ handler") > Fixes: 2548ab774f92 ("mempool/octeontx2: add context dump support") > Fixes: 2b71657c8660 ("common/octeontx2: add mbox request and response > definition") >=20 > Signed-off-by: Harman Kalra Acked-by: Jerin Jacob > --- > drivers/common/octeontx2/otx2_dev.c | 3 +-- > drivers/common/octeontx2/otx2_mbox.h | 4 ++-- > drivers/mempool/octeontx2/otx2_mempool_debug.c | 2 +- > drivers/net/octeontx2/otx2_ethdev.c | 3 ++- > drivers/net/octeontx2/otx2_ethdev_ops.c | 7 ++++++- > drivers/net/octeontx2/otx2_flow.c | 10 ++++------ > drivers/net/octeontx2/otx2_link.c | 8 ++++++-- > drivers/net/octeontx2/otx2_ptp.c | 15 ++++++++++++--- > drivers/net/octeontx2/otx2_tm.h | 2 +- > drivers/net/octeontx2/otx2_vlan.c | 12 +++++++----- > 10 files changed, 42 insertions(+), 24 deletions(-) >=20 > diff --git a/drivers/common/octeontx2/otx2_dev.c > b/drivers/common/octeontx2/otx2_dev.c > index f58a6e725..910270975 100644 > --- a/drivers/common/octeontx2/otx2_dev.c > +++ b/drivers/common/octeontx2/otx2_dev.c > @@ -791,9 +791,8 @@ otx2_pf_vf_flr_irq(void *param) > if (!(intr & (1ULL << vf))) > continue; >=20 > - vf =3D 64 * i + vf; > otx2_base_dbg("FLR: i :%d intr: 0x%" PRIx64 ", vf- > %d", > - i, intr, vf); > + i, intr, (64 * i + vf)); > /* Clear interrupt */ > otx2_write64(BIT_ULL(vf), bar2 + > RVU_PF_VFFLR_INTX(i)); > /* Disable the interrupt */ > diff --git a/drivers/common/octeontx2/otx2_mbox.h > b/drivers/common/octeontx2/otx2_mbox.h > index b2c59c86e..009015fa5 100644 > --- a/drivers/common/octeontx2/otx2_mbox.h > +++ b/drivers/common/octeontx2/otx2_mbox.h > @@ -13,8 +13,8 @@ >=20 > #include >=20 > -#define SZ_64K (64 * 1024) > -#define SZ_1K (1 * 1024) > +#define SZ_64K (64ULL * 1024ULL) > +#define SZ_1K (1ULL * 1024ULL) > #define MBOX_SIZE SZ_64K >=20 > /* AF/PF: PF initiated, PF/VF VF initiated */ diff --git > a/drivers/mempool/octeontx2/otx2_mempool_debug.c > b/drivers/mempool/octeontx2/otx2_mempool_debug.c > index eef61ef07..8bd395389 100644 > --- a/drivers/mempool/octeontx2/otx2_mempool_debug.c > +++ b/drivers/mempool/octeontx2/otx2_mempool_debug.c > @@ -91,7 +91,7 @@ otx2_mempool_ctx_dump(struct otx2_npa_lf *lf) > struct npa_aq_enq_req *aq; > struct npa_aq_enq_rsp *rsp; > uint32_t q; > - int rc; > + int rc =3D 0; >=20 > for (q =3D 0; q < lf->nr_pools; q++) { > /* Skip disabled POOL */ > diff --git a/drivers/net/octeontx2/otx2_ethdev.c > b/drivers/net/octeontx2/otx2_ethdev.c > index 3fb7bd93f..99fcb36c3 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.c > +++ b/drivers/net/octeontx2/otx2_ethdev.c > @@ -749,7 +749,8 @@ nix_sq_uninit(struct otx2_eth_txq *txq) > while (count) { > void *next_sqb; >=20 > - next_sqb =3D *(void **)((uintptr_t)sqb_buf + ((sqes_per_sqb > - 1) * > + next_sqb =3D *(void **)((uintptr_t)sqb_buf + (uint32_t) > + ((sqes_per_sqb - 1) * > nix_sq_max_sqe_sz(txq))); > npa_lf_aura_op_free(txq->sqb_pool->pool_id, 1, > (uint64_t)sqb_buf); > diff --git a/drivers/net/octeontx2/otx2_ethdev_ops.c > b/drivers/net/octeontx2/otx2_ethdev_ops.c > index 5a16a3c04..2a79e20bb 100644 > --- a/drivers/net/octeontx2/otx2_ethdev_ops.c > +++ b/drivers/net/octeontx2/otx2_ethdev_ops.c > @@ -352,10 +352,15 @@ nix_get_fwdata(struct otx2_eth_dev *dev) { > struct otx2_mbox *mbox =3D dev->mbox; > struct cgx_fw_data *rsp =3D NULL; > + int rc; >=20 > otx2_mbox_alloc_msg_cgx_get_aux_link_info(mbox); >=20 > - otx2_mbox_process_msg(mbox, (void *)&rsp); > + rc =3D otx2_mbox_process_msg(mbox, (void *)&rsp); > + if (rc) { > + otx2_err("Failed to get fw data: %d", rc); > + return NULL; > + } >=20 > return rsp; > } > diff --git a/drivers/net/octeontx2/otx2_flow.c > b/drivers/net/octeontx2/otx2_flow.c > index c463075cb..bdbf123a9 100644 > --- a/drivers/net/octeontx2/otx2_flow.c > +++ b/drivers/net/octeontx2/otx2_flow.c > @@ -844,7 +844,7 @@ otx2_flow_init(struct otx2_eth_dev *hw) > } >=20 > npc->free_entries =3D rte_zmalloc(NULL, npc->flow_max_priority > - * sizeof(struct rte_bitmap), > + * sizeof(struct rte_bitmap *), > 0); > if (npc->free_entries =3D=3D NULL) { > otx2_err("free_entries alloc failed"); @@ -853,7 +853,7 @@ > otx2_flow_init(struct otx2_eth_dev *hw) > } >=20 > npc->free_entries_rev =3D rte_zmalloc(NULL, npc->flow_max_priority > - * sizeof(struct rte_bitmap), > + * sizeof(struct rte_bitmap *), > 0); > if (npc->free_entries_rev =3D=3D NULL) { > otx2_err("free_entries_rev alloc failed"); @@ -862,7 +862,7 > @@ otx2_flow_init(struct otx2_eth_dev *hw) > } >=20 > npc->live_entries =3D rte_zmalloc(NULL, npc->flow_max_priority > - * sizeof(struct rte_bitmap), > + * sizeof(struct rte_bitmap *), > 0); > if (npc->live_entries =3D=3D NULL) { > otx2_err("live_entries alloc failed"); @@ -871,7 +871,7 @@ > otx2_flow_init(struct otx2_eth_dev *hw) > } >=20 > npc->live_entries_rev =3D rte_zmalloc(NULL, npc->flow_max_priority > - * sizeof(struct rte_bitmap), > + * sizeof(struct rte_bitmap *), > 0); > if (npc->live_entries_rev =3D=3D NULL) { > otx2_err("live_entries_rev alloc failed"); @@ -948,8 +948,6 > @@ otx2_flow_init(struct otx2_eth_dev *hw) > rte_free(npc->flow_entry_info); > if (npc_mem) > rte_free(npc_mem); > - if (nix_mem) > - rte_free(nix_mem); > return rc; > } >=20 > diff --git a/drivers/net/octeontx2/otx2_link.c > b/drivers/net/octeontx2/otx2_link.c > index 8fcbdc9b7..725b793d4 100644 > --- a/drivers/net/octeontx2/otx2_link.c > +++ b/drivers/net/octeontx2/otx2_link.c > @@ -52,10 +52,14 @@ otx2_eth_dev_link_status_update(struct otx2_dev > *dev, > struct cgx_link_user_info *link) > { > struct otx2_eth_dev *otx2_dev =3D (struct otx2_eth_dev *)dev; > - struct rte_eth_dev *eth_dev =3D otx2_dev->eth_dev; > struct rte_eth_link eth_link; > + struct rte_eth_dev *eth_dev; >=20 > - if (!link || !dev || !eth_dev->data->dev_conf.intr_conf.lsc) > + if (!link || !dev) > + return; > + > + eth_dev =3D otx2_dev->eth_dev; > + if (!eth_dev || !eth_dev->data->dev_conf.intr_conf.lsc) > return; >=20 > if (nix_wait_for_link_cfg(otx2_dev)) { diff --git > a/drivers/net/octeontx2/otx2_ptp.c b/drivers/net/octeontx2/otx2_ptp.c > index 52e5456b5..fd13c2678 100644 > --- a/drivers/net/octeontx2/otx2_ptp.c > +++ b/drivers/net/octeontx2/otx2_ptp.c > @@ -102,7 +102,7 @@ nix_ptp_config(struct rte_eth_dev *eth_dev, int en) > { > struct otx2_eth_dev *dev =3D otx2_eth_pmd_priv(eth_dev); > struct otx2_mbox *mbox =3D dev->mbox; > - uint8_t rc =3D 0; > + uint8_t rc =3D -EINVAL; >=20 > if (otx2_dev_is_vf(dev)) > return rc; > @@ -136,9 +136,16 @@ int > otx2_eth_dev_ptp_info_update(struct otx2_dev *dev, bool ptp_en) { > struct otx2_eth_dev *otx2_dev =3D (struct otx2_eth_dev *)dev; > - struct rte_eth_dev *eth_dev =3D otx2_dev->eth_dev; > + struct rte_eth_dev *eth_dev; > int i; >=20 > + if (!dev) > + return -EINVAL; > + > + eth_dev =3D otx2_dev->eth_dev; > + if (!eth_dev) > + return -EINVAL; > + > otx2_dev->ptp_en =3D ptp_en; > for (i =3D 0; i < eth_dev->data->nb_rx_queues; i++) { > struct otx2_eth_rxq *rxq =3D eth_dev->data->rx_queues[i]; > @@ -174,8 +181,10 @@ otx2_nix_timesync_enable(struct rte_eth_dev > *eth_dev) > ts =3D rte_eth_dma_zone_reserve(eth_dev, "otx2_ts", > 0, OTX2_ALIGN, OTX2_ALIGN, > dev->node); > - if (ts =3D=3D NULL) > + if (ts =3D=3D NULL) { > otx2_err("Failed to allocate mem for tx tstamp addr"); > + return -ENOMEM; > + } >=20 > dev->tstamp.tx_tstamp_iova =3D ts->iova; > dev->tstamp.tx_tstamp =3D ts->addr; > diff --git a/drivers/net/octeontx2/otx2_tm.h > b/drivers/net/octeontx2/otx2_tm.h index 2a009eece..4712b0935 100644 > --- a/drivers/net/octeontx2/otx2_tm.h > +++ b/drivers/net/octeontx2/otx2_tm.h > @@ -62,7 +62,7 @@ TAILQ_HEAD(otx2_nix_tm_node_list, > otx2_nix_tm_node); TAILQ_HEAD(otx2_nix_tm_shaper_profile_list, > otx2_nix_tm_shaper_profile); >=20 > #define MAX_SCHED_WEIGHT ((uint8_t)~0) > -#define NIX_TM_RR_QUANTUM_MAX ((1 << 24) - 1) > +#define NIX_TM_RR_QUANTUM_MAX (BIT_ULL(24) - 1) >=20 > /* DEFAULT_RR_WEIGHT * NIX_TM_RR_QUANTUM_MAX / > MAX_SCHED_WEIGHT */ > /* =3D NIX_MAX_HW_MTU */ > diff --git a/drivers/net/octeontx2/otx2_vlan.c > b/drivers/net/octeontx2/otx2_vlan.c > index 189c45174..c01089b44 100644 > --- a/drivers/net/octeontx2/otx2_vlan.c > +++ b/drivers/net/octeontx2/otx2_vlan.c > @@ -303,7 +303,7 @@ nix_vlan_mcam_config(struct rte_eth_dev *eth_dev, > entry.kw[kwi] |=3D NPC_LT_LB_CTAG << mkex->lb_lt_offset; > entry.kw_mask[kwi] |=3D 0xFULL << mkex->lb_lt_offset; >=20 > - mcam_data =3D (vlan_id << 16); > + mcam_data =3D ((uint32_t)vlan_id << 16); > mcam_mask =3D (BIT_ULL(16) - 1) << 16; > otx2_mbox_memcpy(key_data + mkex->lb_xtract.key_off, > &mcam_data, mkex->lb_xtract.len + 1); > @@ -649,7 +649,9 @@ otx2_nix_vlan_filter_set(struct rte_eth_dev > *eth_dev, uint16_t vlan_id, > } else { > TAILQ_FOREACH(entry, &vlan->fltr_tbl, next) { > if (entry->vlan_id =3D=3D vlan_id) { > - nix_vlan_mcam_free(dev, entry- > >mcam_idx); > + rc =3D nix_vlan_mcam_free(dev, entry- > >mcam_idx); > + if (rc) > + return rc; > TAILQ_REMOVE(&vlan->fltr_tbl, entry, next); > rte_free(entry); > break; > @@ -707,7 +709,7 @@ otx2_nix_vlan_offload_set(struct rte_eth_dev > *eth_dev, int mask) > struct otx2_eth_dev *dev =3D otx2_eth_pmd_priv(eth_dev); > uint64_t offloads =3D dev->rx_offloads; > struct rte_eth_rxmode *rxmode; > - int rc; > + int rc =3D 0; >=20 > rxmode =3D ð_dev->data->dev_conf.rxmode; >=20 > @@ -837,8 +839,8 @@ otx2_nix_vlan_pvid_set(struct rte_eth_dev *dev, > uint16_t vlan_id, int on) > vtag_cfg->vtag_size =3D NIX_VTAGSIZE_T4; >=20 > if (vlan->outer_vlan_tpid) > - vtag_cfg->tx.vtag0 =3D > - (vlan->outer_vlan_tpid << 16) | vlan_id; > + vtag_cfg->tx.vtag0 =3D ((uint32_t)vlan- > >outer_vlan_tpid > + << 16) | vlan_id; > else > vtag_cfg->tx.vtag0 =3D > ((RTE_ETHER_TYPE_VLAN << 16) | vlan_id); > -- > 2.18.0