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 755B3A0613 for ; Sun, 4 Aug 2019 09:20:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 950A51BEE1; Sun, 4 Aug 2019 09:20:57 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 68AC01BEBA for ; Sun, 4 Aug 2019 09:20:56 +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 x747KtJb026281 for ; Sun, 4 Aug 2019 00:20:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=LPSDN0aN0a4nAQjHlTyBAkYOMHY2L2XEWghcndUEMts=; b=DIg5qv67qo1kEkBjRdLTbzVBvG+7XKZIUJAlZtcxmCf+AQSjTby3LXBLDx860Ri5ZrE4 n34RCS3TPrlbNGAms9Yu1Rp77yD/NSSb/32WTxSfgAPENkOxcc54OYa8/6wSzKd6incZ M92avvuY8lJ6PrjDFXYlbpJzvKYR6IN/pTF8nV5knsvRmnPstEvaBwwFKhktTR8gPZXf 5tiQ1nTbxkz7doBVTSeq5NO8RzKjcBUoM00vFEdkcPC0/nZBQl3TfEdRWwcOWZzxoWGd ZVcopJqB9HAkd18pEa/YTO2kRNiFStx6HcXol1cewiEEPHpokRIsGfgZtHjd+kK4ewfo Sg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2u57mqtp5h-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sun, 04 Aug 2019 00:20:55 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 4 Aug 2019 00:20:54 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.52) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sun, 4 Aug 2019 00:20:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cgusb9gt59lLb5OqNl6M10InZWCQE7wbA6xLtW6WYPPw/fkdWIs28HXscBfxEpxiwF46RM3iMrgJlrZ/6rgyCwYvxp7qj3ZAopGcJdXVtFgfDCF6Zv6Qobb8dJtCB3wEup9LVdD/NH+k4ZFnHQXjr5TISnfc0Wyy6Uai92JUAD7uuF6uCmPCeffPDBUYGLzQ8L7Cl68+7SuQ7h24VTRFej0hy6QuK+PbFerp9gRXiSscr8tzQVEXUnt7bX2Gqoa4RXU9u7fVHdxymk0Vnon/HUOmZAzPszlKFeaJe0KpJFrITqmd+aJgPrRl1zelys8NFQt8UxqgdJxyqtMdUa9AYg== 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=LPSDN0aN0a4nAQjHlTyBAkYOMHY2L2XEWghcndUEMts=; b=GlrT0VvP26KadVpZK+7hIz1gYZ/glismWjFCHCySipM2Fz5pj8A7TtLmYFS+UMk31t5oQSYeW1Z/rLbJSouGYkwfqWHXGb/5Fo4C+h9lNVTTrdc2h9Cv24xIftZ5Enuf2SPY2zQAZHdSEBSSobrTSGxegozrf7ap8zs/mRXpbZDBk68HjylCQT9MOh5RJ8HToFsUSA+gwAOtJr+vQX0KEMl5cGPMGcN9kID7YlOmwJGRuZvjFVZe2PGPXTn462clp3Wd37WooftK5OCsqMMoSUD81P8UnRplsEvctI7kZ597lizRlGu3uYjzGNhhCQHUKtGRKrvDrzF5zYYAlRmJFQ== 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=LPSDN0aN0a4nAQjHlTyBAkYOMHY2L2XEWghcndUEMts=; b=krbJlBALphB2WlyczuIQb2Un03nnUj7yIZOLjl3DAOfLc5JyZqy014CTbZJW/enXt0TkwLr2UtwB1E/Z66pqOxG4PEY8dbjNObJWkPsMQ0FWXmmDUCKT72SG+IscQlcwUWnVAxfKZ8w7/e+hOrT68ORr+ZQ4PQbmAmgMn89DVfM= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (20.179.21.149) by MN2PR18MB3023.namprd18.prod.outlook.com (20.179.84.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.13; Sun, 4 Aug 2019 07:20:52 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::4447:9459:5386:2e18%7]) with mapi id 15.20.2136.010; Sun, 4 Aug 2019 07:20:52 +0000 From: Harman Kalra To: Jerin Jacob Kollanukkaran , Nithin Kumar Dabilpuram , Vamsi Krishna Attunuru , Kiran Kumar Kokkilagadda CC: "dev@dpdk.org" , Harman Kalra Thread-Topic: [PATCH] drivers/octeontx2: fix coverity issues Thread-Index: AQHVSpUlhGe/9LHxDk616iQ+gX/YCQ== Date: Sun, 4 Aug 2019 07:20:52 +0000 Message-ID: <1564903224-16945-1-git-send-email-hkalra@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BMXPR01CA0073.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::13) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:3e::21) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 848f6700-8e3f-4984-6e45-08d718ac4832 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:MN2PR18MB3023; x-ms-traffictypediagnostic: MN2PR18MB3023: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:262; x-forefront-prvs: 0119DC3B5E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(366004)(376002)(39850400004)(346002)(189003)(199004)(4326008)(26005)(6512007)(6636002)(186003)(99286004)(478600001)(6486002)(50226002)(5660300002)(6436002)(14444005)(256004)(102836004)(86362001)(71200400001)(71190400001)(3846002)(6116002)(486006)(476003)(14454004)(107886003)(110136005)(66446008)(64756008)(6506007)(386003)(68736007)(8676002)(66476007)(66556008)(66946007)(2616005)(52116002)(53936002)(305945005)(2906002)(55236004)(7736002)(54906003)(81156014)(81166006)(8936002)(25786009)(316002)(66066001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3023; H:MN2PR18MB2848.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: z1t1vckE8ZNuXNdAPTYXgq0GIpphR7IdmP/3Z0cKoX+n0OeJWzjIUeoOKsh3YQwB6NYMmbvgNTzyJo2LXMf6LdBeuBEyjsWHV7Jd4pUsDi1rp8/JVpOeAP18ffopEJeCbBlEvgATg/5Xu9Igeoc5sAhUua/zDaayEPJ72Wy79mIMxxjTx8wtt29UTr6lGnbcGdIAf86CQbkE4Y4z9xCoXDr9ByeHGcoHNmwyrKf1Wg0Y1D5GVe94pMVdXhjf7nCnNFUykno3fPcqNEibxB/EVpmSaaruOX1NHpVlmst0osmeHtjh8rkwh2+k08uIqMzCBUPCqjqUwtJ1YLu+pfzI+sap8q0Bpf1Wb8SOPTH6KeZnooQq9khY9WG1+Po4pgf0CjbA+L44e6Ahz3qqrlnPTR00tgyn90EFuP/+SN0xVgs= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 848f6700-8e3f-4984-6e45-08d718ac4832 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Aug 2019 07:20:52.5028 (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: hkalra@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3023 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-04_04:2019-07-31,2019-08-04 signatures=0 Subject: [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" Addresed issues reported by coverity: NULL pointer dereferencing issues, unchecked return value, uinitialized scalar value, probable deadcode cases, unintended sign extension, bad bit shift operation, Wrong sizeof argument (SIZEOF_MISMATCH) Coverity issue: 343396, 345028, 344977, 345015, 345025, 344969, Coverity issue: 345014, 344966, 343437, 344993, 345007, 344988, Coverity issue: 343405, 344999, 345003 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 defin= ition") Signed-off-by: Harman Kalra --- 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(-) 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/octeontx= 2/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/mempo= ol/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/ot= x2_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/octeontx= 2/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_t= m.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, u= int16_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, u= int16_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); --=20 2.18.0