DPDK patches and discussions
 help / color / mirror / Atom feed
From: Conor Walsh <conor.walsh@intel.com>
To: ferruh.yigit@intel.com, david.marchand@redhat.com,
	longfengx.liang@intel.com, dev@dpdk.org
Cc: david.hunt@intel.com, yipeng1.wang@intel.com,
	sameh.gobriel@intel.com, bruce.richardson@intel.com,
	vladimir.medvedkin@intel.com, hemant.agrawal@nxp.com,
	sachin.saxena@oss.nxp.com, fiona.trahe@intel.com,
	john.griffin@intel.com, deepak.k.jain@intel.com,
	harry.van.haaren@intel.com, ajit.khaparde@broadcom.com,
	somnath.kotur@broadcom.com, xuanziyang2@huawei.com,
	cloud.wangxiaoyun@huawei.com, sthotton@marvell.com,
	srinivasan@marvell.com, heinrich.kuhn@corigine.com,
	hkalra@marvell.com, rmody@marvell.com, dsinghrawat@marvell.com,
	jiawenwu@trustnetic.com, yongwang@vmware.com,
	john.mcnamara@intel.com, gakhil@marvell.com,
	roy.fan.zhang@intel.com, arkadiuszx.kusztal@intel.com,
	michael.baucom@broadcom.com, venkatkumar.duvvuru@broadcom.com,
	lance.richardson@broadcom.com, kishore.padmanabha@broadcom.com,
	jerin.jacob@caviumnetworks.com, mjatharakonda@oneconvergence.com,
	simon.horman@corigine.com, david.george@sophos.com,
	sony.chacko@qlogic.com, harish.patil@qlogic.com,
	stephen@networkplumber.org, jerinjacobk@gmail.com,
	Conor Walsh <conor.walsh@intel.com>,
	stable@dpdk.org
Subject: [PATCH 5/6] drivers/net: fix unused but set variables
Date: Mon, 15 Nov 2021 17:58:54 +0000	[thread overview]
Message-ID: <20211115175855.1091621-6-conor.walsh@intel.com> (raw)
In-Reply-To: <20211115175855.1091621-1-conor.walsh@intel.com>

This patch fixes unused but set variables in the following net drivers:
 - bnxt
 - hinic
 - liquidio
 - nfp
 - octeontx
 - qede
 - txgbe
 - vmxnet3

Bugzilla ID: 881
Fixes: b87abb2e55cb ("net/bnxt: support marking packet")
Fixes: 88badb3aef94 ("net/bnxt: add helper functions for blob/regfile ops")
Fixes: a4957d87e05a ("net/hinic/base: add mgmt module")
Fixes: 5ee7640f95a0 ("net/liquidio: add API to flush IQ")
Fixes: 19af5a38f7b6 ("net/nfp: move CPP bridge to separate file")
Fixes: 9eb5cb3b11cc ("net/octeontx: fix access to indirect buffers")
Fixes: 86a2265e59d7 ("qede: add SRIOV support")
Fixes: b7311360fb67 ("net/txgbe: support VF interrupt")
Fixes: c3ecdbb376da ("vmxnet3: support TSO")
Cc: stable@dpdk.org

Reported-by: Liang Longfeng <longfengx.liang@intel.com>
Signed-off-by: Conor Walsh <conor.walsh@intel.com>
---
 drivers/net/bnxt/bnxt_rxr.c             | 22 ----------------------
 drivers/net/bnxt/tf_ulp/ulp_utils.c     |  3 ---
 drivers/net/hinic/base/hinic_pmd_mgmt.c |  6 ------
 drivers/net/liquidio/lio_rxtx.c         |  2 --
 drivers/net/nfp/nfp_cpp_bridge.c        |  6 ++----
 drivers/net/octeontx/octeontx_rxtx.h    |  3 +--
 drivers/net/qede/base/ecore_vf.c        |  5 +----
 drivers/net/txgbe/txgbe_ethdev_vf.c     |  3 +++
 drivers/net/vmxnet3/vmxnet3_rxtx.c      |  3 +++
 9 files changed, 10 insertions(+), 43 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 8bc8ddc353..157297bc64 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -823,9 +823,6 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp,
 			   struct rte_mbuf *mbuf)
 {
 	uint32_t cfa_code = 0;
-	uint8_t meta_fmt = 0;
-	uint16_t flags2 = 0;
-	uint32_t meta =  0;
 
 	cfa_code = rte_le_to_cpu_16(rxcmp1->cfa_code);
 	if (!cfa_code)
@@ -834,25 +831,6 @@ void bnxt_set_mark_in_mbuf(struct bnxt *bp,
 	if (cfa_code && !bp->mark_table[cfa_code].valid)
 		return;
 
-	flags2 = rte_le_to_cpu_16(rxcmp1->flags2);
-	meta = rte_le_to_cpu_32(rxcmp1->metadata);
-	if (meta) {
-		meta >>= BNXT_RX_META_CFA_CODE_SHIFT;
-
-		/* The flags field holds extra bits of info from [6:4]
-		 * which indicate if the flow is in TCAM or EM or EEM
-		 */
-		meta_fmt = (flags2 & BNXT_CFA_META_FMT_MASK) >>
-			   BNXT_CFA_META_FMT_SHFT;
-
-		/* meta_fmt == 4 => 'b100 => 'b10x => EM.
-		 * meta_fmt == 5 => 'b101 => 'b10x => EM + VLAN
-		 * meta_fmt == 6 => 'b110 => 'b11x => EEM
-		 * meta_fmt == 7 => 'b111 => 'b11x => EEM + VLAN.
-		 */
-		meta_fmt >>= BNXT_CFA_META_FMT_EM_EEM_SHFT;
-	}
-
 	mbuf->hash.fdir.hi = bp->mark_table[cfa_code].mark_id;
 	mbuf->ol_flags |= RTE_MBUF_F_RX_FDIR | RTE_MBUF_F_RX_FDIR_ID;
 }
diff --git a/drivers/net/bnxt/tf_ulp/ulp_utils.c b/drivers/net/bnxt/tf_ulp/ulp_utils.c
index df3afaa6fd..c60d81d14a 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_utils.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_utils.c
@@ -200,7 +200,6 @@ ulp_bs_push_msb(uint8_t *bs, uint16_t pos, uint8_t len, uint8_t *val)
 {
 	int i;
 	int cnt = (len + 7) / 8;
-	int tlen = len;
 
 	/* Handle any remainder bits */
 	int tmp = len % 8;
@@ -211,12 +210,10 @@ ulp_bs_push_msb(uint8_t *bs, uint16_t pos, uint8_t len, uint8_t *val)
 	ulp_bs_put_msb(bs, pos, tmp, val[0]);
 
 	pos += tmp;
-	tlen -= tmp;
 
 	for (i = 1; i < cnt; i++) {
 		ulp_bs_put_msb(bs, pos, 8, val[i]);
 		pos += 8;
-		tlen -= 8;
 	}
 
 	return len;
diff --git a/drivers/net/hinic/base/hinic_pmd_mgmt.c b/drivers/net/hinic/base/hinic_pmd_mgmt.c
index 9b399502de..6ecca407a1 100644
--- a/drivers/net/hinic/base/hinic_pmd_mgmt.c
+++ b/drivers/net/hinic/base/hinic_pmd_mgmt.c
@@ -133,16 +133,12 @@ static void prepare_header(struct hinic_msg_pf_to_mgmt *pf_to_mgmt,
 static void prepare_mgmt_cmd(u8 *mgmt_cmd, u64 *header, void *msg,
 			     int msg_len)
 {
-	u32 cmd_buf_max = MAX_PF_MGMT_BUF_SIZE;
-
 	memset(mgmt_cmd, 0, MGMT_MSG_RSVD_FOR_DEV);
 
 	mgmt_cmd += MGMT_MSG_RSVD_FOR_DEV;
-	cmd_buf_max -= MGMT_MSG_RSVD_FOR_DEV;
 	memcpy(mgmt_cmd, header, sizeof(*header));
 
 	mgmt_cmd += sizeof(*header);
-	cmd_buf_max -= sizeof(*header);
 	memcpy(mgmt_cmd, msg, msg_len);
 }
 
@@ -615,7 +611,6 @@ static int recv_mgmt_msg_handler(struct hinic_msg_pf_to_mgmt *pf_to_mgmt,
 	void *msg_body = header + sizeof(msg_header);
 	u8 *dest_msg;
 	u8 seq_id, seq_len;
-	u32 msg_buf_max = MAX_PF_MGMT_BUF_SIZE;
 	u8 front_id;
 	u16 msg_id;
 
@@ -635,7 +630,6 @@ static int recv_mgmt_msg_handler(struct hinic_msg_pf_to_mgmt *pf_to_mgmt,
 	}
 
 	dest_msg = (u8 *)recv_msg->msg + seq_id * HINIC_MSG_SEG_LEN;
-	msg_buf_max -= seq_id * HINIC_MSG_SEG_LEN;
 	memcpy(dest_msg, msg_body, seq_len);
 
 	if (!HINIC_MSG_HEADER_GET(msg_header, LAST))
diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c
index ef127f26c4..e09798ddd7 100644
--- a/drivers/net/liquidio/lio_rxtx.c
+++ b/drivers/net/liquidio/lio_rxtx.c
@@ -1050,7 +1050,6 @@ lio_update_read_index(struct lio_instr_queue *iq)
 int
 lio_flush_iq(struct lio_device *lio_dev, struct lio_instr_queue *iq)
 {
-	uint32_t tot_inst_processed = 0;
 	uint32_t inst_processed = 0;
 	int tx_done = 1;
 
@@ -1073,7 +1072,6 @@ lio_flush_iq(struct lio_device *lio_dev, struct lio_instr_queue *iq)
 			iq->stats.instr_processed += inst_processed;
 		}
 
-		tot_inst_processed += inst_processed;
 		inst_processed = 0;
 
 	} while (1);
diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c
index 74a0eacb3f..0922ea9cf9 100644
--- a/drivers/net/nfp/nfp_cpp_bridge.c
+++ b/drivers/net/nfp/nfp_cpp_bridge.c
@@ -58,7 +58,7 @@ nfp_cpp_bridge_serve_write(int sockfd, struct nfp_cpp *cpp)
 	off_t offset, nfp_offset;
 	uint32_t cpp_id, pos, len;
 	uint32_t tmpbuf[16];
-	size_t count, curlen, totlen = 0;
+	size_t count, curlen;
 	int err = 0;
 
 	PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu\n", __func__,
@@ -135,7 +135,6 @@ nfp_cpp_bridge_serve_write(int sockfd, struct nfp_cpp *cpp)
 		}
 
 		nfp_offset += pos;
-		totlen += pos;
 		nfp_cpp_area_release(area);
 		nfp_cpp_area_free(area);
 
@@ -160,7 +159,7 @@ nfp_cpp_bridge_serve_read(int sockfd, struct nfp_cpp *cpp)
 	off_t offset, nfp_offset;
 	uint32_t cpp_id, pos, len;
 	uint32_t tmpbuf[16];
-	size_t count, curlen, totlen = 0;
+	size_t count, curlen;
 	int err = 0;
 
 	PMD_CPP_LOG(DEBUG, "%s: offset size %zu, count_size: %zu\n", __func__,
@@ -236,7 +235,6 @@ nfp_cpp_bridge_serve_read(int sockfd, struct nfp_cpp *cpp)
 		}
 
 		nfp_offset += pos;
-		totlen += pos;
 		nfp_cpp_area_release(area);
 		nfp_cpp_area_free(area);
 
diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h
index 56f11d3dd5..b63a5edfb3 100644
--- a/drivers/net/octeontx/octeontx_rxtx.h
+++ b/drivers/net/octeontx/octeontx_rxtx.h
@@ -365,7 +365,7 @@ __octeontx_xmit_mseg_prepare(struct rte_mbuf *tx_pkt, uint64_t *cmd_buf,
 			const uint16_t flag)
 {
 	uint16_t nb_segs, nb_desc = 0;
-	uint16_t gaura_id, len = 0;
+	uint16_t gaura_id;
 	struct rte_mbuf *m_next = NULL, *m_tofree;
 	rte_iova_t iova;
 	uint16_t data_len;
@@ -425,7 +425,6 @@ __octeontx_xmit_mseg_prepare(struct rte_mbuf *tx_pkt, uint64_t *cmd_buf,
 		cmd_buf[nb_desc++] = iova;
 
 		nb_segs--;
-		len += data_len;
 		tx_pkt = m_next;
 	} while (nb_segs);
 
diff --git a/drivers/net/qede/base/ecore_vf.c b/drivers/net/qede/base/ecore_vf.c
index db03bc494f..a36ae47c2b 100644
--- a/drivers/net/qede/base/ecore_vf.c
+++ b/drivers/net/qede/base/ecore_vf.c
@@ -73,7 +73,7 @@ static void ecore_vf_pf_req_end(struct ecore_hwfn *p_hwfn,
 #endif
 static enum _ecore_status_t
 ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,
-		  u8 *done, u32 resp_size)
+		  u8 *done, __rte_unused u32 resp_size)
 {
 	union vfpf_tlvs *p_req = p_hwfn->vf_iov_info->vf2pf_request;
 	struct ustorm_trigger_vf_zone trigger;
@@ -86,9 +86,6 @@ ecore_send_msg2pf(struct ecore_hwfn *p_hwfn,
 	/* output tlvs list */
 	ecore_dp_tlv_list(p_hwfn, p_req);
 
-	/* need to add the END TLV to the message size */
-	resp_size += sizeof(struct channel_list_end_tlv);
-
 	/* Send TLVs over HW channel */
 	OSAL_MEMSET(&trigger, 0, sizeof(struct ustorm_trigger_vf_zone));
 	trigger.vf_pf_msg_valid = 1;
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 67ae69dec3..8eb6fdd3c9 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -1291,6 +1291,9 @@ txgbevf_dev_interrupt_get_status(struct rte_eth_dev *dev)
 	/* Workround for ICR lost */
 	intr->flags |= TXGBE_FLAG_MAILBOX;
 
+	/* To avoid compiler warnings set eicr to used. */
+	RTE_SET_USED(eicr);
+
 	return 0;
 }
 
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index deba64be6a..77a2917137 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -340,6 +340,9 @@ vmxnet3_tq_tx_complete(vmxnet3_tx_queue_t *txq)
 	}
 
 	PMD_TX_LOG(DEBUG, "Processed %d tx comps & command descs.", completed);
+
+	/* To avoid compiler warnings when not in DEBUG mode set completed to used. */
+	RTE_SET_USED(completed);
 }
 
 uint16_t
-- 
2.25.1


  parent reply	other threads:[~2021-11-15 17:59 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 14:01 [PATCH 0/7] " Conor Walsh
2021-11-12 14:01 ` [PATCH 1/7] app/test: " Conor Walsh
2021-11-12 14:29   ` Medvedkin, Vladimir
2021-11-12 14:01 ` [PATCH 2/7] drivers/bus/fslmc: " Conor Walsh
2021-11-12 14:01 ` [PATCH 3/7] drivers/common/qat: " Conor Walsh
2021-11-12 14:01 ` [PATCH 4/7] drivers/event/sw: " Conor Walsh
2021-11-12 15:15   ` Van Haaren, Harry
2021-11-12 14:01 ` [PATCH 5/7] drivers/net: " Conor Walsh
2021-11-12 16:17   ` Ferruh Yigit
2021-11-12 16:27     ` David Marchand
2021-11-12 16:38       ` Walsh, Conor
2021-11-12 16:41         ` Stephen Hemminger
2021-11-12 16:46           ` Walsh, Conor
2021-11-12 16:35     ` Walsh, Conor
2021-11-15  9:28   ` David Marchand
2021-11-16  4:58     ` Somnath Kotur
2021-11-16  5:08       ` Ajit Khaparde
2021-11-12 14:01 ` [PATCH 6/7] examples/performance-thread: " Conor Walsh
2021-11-12 14:01 ` [PATCH 7/7] lib/power: " Conor Walsh
2021-11-12 14:13   ` David Marchand
2021-11-12 14:17     ` Walsh, Conor
2021-11-12 14:26       ` David Marchand
2021-11-15 17:58 ` [PATCH 0/6] " Conor Walsh
2021-11-15 17:58   ` [PATCH 1/6] app/test: " Conor Walsh
2021-11-15 17:58   ` [PATCH 2/6] drivers/bus/fslmc: " Conor Walsh
2021-11-15 17:58   ` [PATCH 3/6] drivers/common/qat: " Conor Walsh
2021-11-15 17:58   ` [PATCH 4/6] drivers/event/sw: " Conor Walsh
2021-11-15 17:58   ` Conor Walsh [this message]
2021-11-16 12:04     ` [PATCH 5/6] drivers/net: " David Marchand
2021-11-15 17:58   ` [PATCH 6/6] examples/performance-thread: " Conor Walsh
2021-11-16 12:28   ` [PATCH 0/6] " David Marchand

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=20211115175855.1091621-6-conor.walsh@intel.com \
    --to=conor.walsh@intel.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=cloud.wangxiaoyun@huawei.com \
    --cc=david.george@sophos.com \
    --cc=david.hunt@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=dsinghrawat@marvell.com \
    --cc=ferruh.yigit@intel.com \
    --cc=fiona.trahe@intel.com \
    --cc=gakhil@marvell.com \
    --cc=harish.patil@qlogic.com \
    --cc=harry.van.haaren@intel.com \
    --cc=heinrich.kuhn@corigine.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=hkalra@marvell.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=jerinjacobk@gmail.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=john.griffin@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=kishore.padmanabha@broadcom.com \
    --cc=lance.richardson@broadcom.com \
    --cc=longfengx.liang@intel.com \
    --cc=michael.baucom@broadcom.com \
    --cc=mjatharakonda@oneconvergence.com \
    --cc=rmody@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    --cc=sachin.saxena@oss.nxp.com \
    --cc=sameh.gobriel@intel.com \
    --cc=simon.horman@corigine.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sony.chacko@qlogic.com \
    --cc=srinivasan@marvell.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=sthotton@marvell.com \
    --cc=venkatkumar.duvvuru@broadcom.com \
    --cc=vladimir.medvedkin@intel.com \
    --cc=xuanziyang2@huawei.com \
    --cc=yipeng1.wang@intel.com \
    --cc=yongwang@vmware.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).