From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>
Cc: <jerinj@marvell.com>, <dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>
Subject: [PATCH 25/31] net/cnxk: update different size bit operations
Date: Fri, 11 Aug 2023 14:27:59 +0530 [thread overview]
Message-ID: <20230811085805.441256-25-ndabilpuram@marvell.com> (raw)
In-Reply-To: <20230811085805.441256-1-ndabilpuram@marvell.com>
From: Akhil Goyal <gakhil@marvell.com>
Certain bitwise operations are done with different
sized operands which causes warnings in static code
analysis. The necessary operands are typecast to remove
the warning.
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
drivers/net/cnxk/cn10k_ethdev.c | 2 +-
drivers/net/cnxk/cn10k_rx.h | 10 +++++-----
drivers/net/cnxk/cn10k_tx.h | 12 ++++++------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c
index 4c4acc7cf0..40437d2d73 100644
--- a/drivers/net/cnxk/cn10k_ethdev.c
+++ b/drivers/net/cnxk/cn10k_ethdev.c
@@ -262,7 +262,7 @@ cn10k_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
txq->cpt_desc = inl_lf->nb_desc * 0.7;
txq->sa_base = (uint64_t)dev->outb.sa_base;
- txq->sa_base |= eth_dev->data->port_id;
+ txq->sa_base |= (uint64_t)eth_dev->data->port_id;
PLT_STATIC_ASSERT(ROC_NIX_INL_SA_BASE_ALIGN == BIT_ULL(16));
}
diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 0dc0b0595c..a696427091 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -795,7 +795,7 @@ cn10k_nix_cqe_to_mbuf(const struct nix_cqe_hdr_s *cq, const uint32_t tag,
/* Skip rx ol flags extraction for Security packets */
if ((!(flag & NIX_RX_SEC_REASSEMBLY_F) || !(w1 & BIT(11))) &&
flag & NIX_RX_OFFLOAD_CHECKSUM_F)
- ol_flags |= nix_rx_olflags_get(lookup_mem, w1);
+ ol_flags |= (uint64_t)nix_rx_olflags_get(lookup_mem, w1);
if (flag & NIX_RX_OFFLOAD_VLAN_STRIP_F) {
if (rx->vtag0_gone) {
@@ -1334,10 +1334,10 @@ cn10k_nix_recv_pkts_vector(void *args, struct rte_mbuf **mbufs, uint16_t pkts,
}
if (flags & NIX_RX_OFFLOAD_CHECKSUM_F) {
- ol_flags0 |= nix_rx_olflags_get(lookup_mem, cq0_w1);
- ol_flags1 |= nix_rx_olflags_get(lookup_mem, cq1_w1);
- ol_flags2 |= nix_rx_olflags_get(lookup_mem, cq2_w1);
- ol_flags3 |= nix_rx_olflags_get(lookup_mem, cq3_w1);
+ ol_flags0 |= (uint64_t)nix_rx_olflags_get(lookup_mem, cq0_w1);
+ ol_flags1 |= (uint64_t)nix_rx_olflags_get(lookup_mem, cq1_w1);
+ ol_flags2 |= (uint64_t)nix_rx_olflags_get(lookup_mem, cq2_w1);
+ ol_flags3 |= (uint64_t)nix_rx_olflags_get(lookup_mem, cq3_w1);
}
/* Translate meta to mbuf */
diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h
index 298d243aac..04d02317b1 100644
--- a/drivers/net/cnxk/cn10k_tx.h
+++ b/drivers/net/cnxk/cn10k_tx.h
@@ -484,7 +484,7 @@ cn10k_nix_sec_steorl(uintptr_t io_addr, uint32_t lmt_id, uint8_t lnum,
data &= ~(0x7ULL << 16);
/* Update lines - 1 that contain valid data */
data |= ((uint64_t)(lnum + loff - 1)) << 12;
- data |= lmt_id;
+ data |= (uint64_t)lmt_id;
/* STEOR */
roc_lmt_submit_steorl(data, pa);
@@ -577,7 +577,7 @@ cn10k_nix_prep_sec_vec(struct rte_mbuf *m, uint64x2_t *cmd0, uint64x2_t *cmd1,
nixtx = (nixtx - 1) & ~(BIT_ULL(7) - 1);
nixtx += 16;
- w0 |= cn10k_nix_tx_ext_subs(flags) + 1;
+ w0 |= cn10k_nix_tx_ext_subs(flags) + 1ULL;
dptr += l2_len;
ucode_cmd[1] = dptr;
*cmd1 = vsetq_lane_u16(pkt_len + dlen_adj, *cmd1, 0);
@@ -718,7 +718,7 @@ cn10k_nix_prep_sec(struct rte_mbuf *m, uint64_t *cmd, uintptr_t *nixtx_addr,
nixtx = (nixtx - 1) & ~(BIT_ULL(7) - 1);
nixtx += 16;
- w0 |= cn10k_nix_tx_ext_subs(flags) + 1;
+ w0 |= cn10k_nix_tx_ext_subs(flags) + 1ULL;
dptr += l2_len;
ucode_cmd[1] = dptr;
sg->seg1_size = pkt_len + dlen_adj;
@@ -1421,7 +1421,7 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,
pa = io_addr | (data & 0x7) << 4;
data &= ~0x7ULL;
data |= ((uint64_t)(burst - 1)) << 12;
- data |= lmt_id;
+ data |= (uint64_t)lmt_id;
if (flags & NIX_TX_VWQE_F)
cn10k_nix_vwqe_wait_fc(txq, burst);
@@ -1583,7 +1583,7 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,
data0 &= ~0x7ULL;
/* Move lmtst1..15 sz to bits 63:19 */
data0 <<= 16;
- data0 |= ((burst - 1) << 12);
+ data0 |= ((burst - 1ULL) << 12);
data0 |= (uint64_t)lmt_id;
if (flags & NIX_TX_VWQE_F)
@@ -3193,7 +3193,7 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,
wd.data[0] <<= 16;
wd.data[0] |= ((uint64_t)(lnum - 1)) << 12;
- wd.data[0] |= lmt_id;
+ wd.data[0] |= (uint64_t)lmt_id;
if (flags & NIX_TX_VWQE_F)
cn10k_nix_vwqe_wait_fc(txq, burst);
--
2.25.1
next prev parent reply other threads:[~2023-08-11 9:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 8:57 [PATCH 01/31] common/cnxk: add aura ref count mechanism Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 02/31] common/cnxk: optimize time while configuring fc on VF Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 03/31] common/cnxk: use only user sqb slack when provided Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 04/31] common/cnxk: add workaround for CPT ctx fetch issue Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 05/31] common/cnxk: support rate limit on PFC TM tree Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 06/31] common/cnxk: fixes CGX promisc toggling Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 07/31] common/cnxk: fix xstats for different packet sizes Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 08/31] common/cnxk: disable BP on SDP link while closing SQ Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 09/31] common/cnxk: fix leak in error path Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 10/31] common/cnxk: fix different size bit operations Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 11/31] " Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 12/31] common/cnxk: remove unnecessory ROC API calls Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 13/31] common/cnxk: sync MAC addr set mailbox structure Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 14/31] common/cnxk: add API to get Rx chan count from NIX Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 15/31] common/cnxk: fix BP threshold calculation Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 16/31] common/cnxk: allow same TC on multiple RQs Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 17/31] common/cnxk: expose different params for bp config Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 18/31] common/cnxk: enable CQ stashing Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 19/31] common/cnxk: fix incorrect aura ID Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 20/31] net/cnxk: fix CQ allocation Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 21/31] net/cnxk: fix issue with GCC 4.8 Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 22/31] net/cnxk: add mapping of DMAC address indexes Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 23/31] net/cnxk: support rate limit in PFC TM tree Nithin Dabilpuram
2023-08-11 8:57 ` [PATCH 24/31] net/cnxk: move MAC address set from init to configure Nithin Dabilpuram
2023-08-11 8:57 ` Nithin Dabilpuram [this message]
2023-08-11 8:58 ` [PATCH 26/31] net/cnxk: fix uninitialized variable Nithin Dabilpuram
2023-08-11 8:58 ` [PATCH 27/31] net/cnxk: fix usage of mbuf rearm data Nithin Dabilpuram
2023-08-11 8:58 ` [PATCH 28/31] net/cnxk: fix uninitialized variable Nithin Dabilpuram
2023-08-11 8:58 ` [PATCH 29/31] net/cnxk: check returned value for null Nithin Dabilpuram
2023-08-11 8:58 ` [PATCH 30/31] net/cnxk: add flag check for extension header when used Nithin Dabilpuram
2023-08-11 8:58 ` [PATCH 31/31] net/cnxk: fixes for IPv6 header in reassembly Nithin Dabilpuram
2023-08-14 12:07 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230811085805.441256-25-ndabilpuram@marvell.com \
--to=ndabilpuram@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).