DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com
Subject: [dpdk-dev] [PATCH v2 07/15] net/bnxt: fix a bad bit shift operation
Date: Tue, 24 Oct 2017 16:19:45 -0500	[thread overview]
Message-ID: <20171024211953.12021-8-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20171024211953.12021-1-ajit.khaparde@broadcom.com>

We are left shifting more bits than we should be doing.
This patch fixes that.
Coverity issue: 127546

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 786e41c9d..15ef0b2a2 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -662,13 +662,14 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev,
 	uint64_t pool_mask = eth_dev->data->mac_pool_sel[index];
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter, *temp_filter;
-	int i;
+	uint32_t pool = RTE_MIN(MAX_FF_POOLS, ETH_64_POOLS);
+	uint32_t i;
 
 	/*
 	 * Loop through all VNICs from the specified filter flow pools to
 	 * remove the corresponding MAC addr filter
 	 */
-	for (i = 0; i < MAX_FF_POOLS; i++) {
+	for (i = 0; i < pool; i++) {
 		if (!(pool_mask & (1ULL << i)))
 			continue;
 
-- 
2.13.5 (Apple Git-94)

  parent reply	other threads:[~2017-10-24 21:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 17:35 [dpdk-dev] [PATCH 0/3] patchset for bnxt PMD Ajit Khaparde
2017-10-12 17:35 ` [dpdk-dev] [PATCH 1/3] net/bnxt: handle Rx multi queue creation properly Ajit Khaparde
2017-10-12 17:35 ` [dpdk-dev] [PATCH 2/3] net/bnxt: remove redundant code parsing pool_map Ajit Khaparde
2017-10-12 17:35 ` [dpdk-dev] [PATCH 3/3] net/bnxt: update HWRM API to 1.8.2 Ajit Khaparde
2017-10-20 19:28   ` Ferruh Yigit
2017-10-20 19:39   ` Ferruh Yigit
2017-10-24 21:19     ` [dpdk-dev] [PATCH v2 00/15] bnxt patchset Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 01/15] net/bnxt: update HWRM to 1.8.2 Ajit Khaparde
2017-10-24 22:50         ` Ferruh Yigit
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 02/15] net/bnxt: fix tx_offload capability Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 03/15] net/bnxt: fix rx_offload capability Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 04/15] net/bnxt: handle Rx multi queue creation properly Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 05/15] net/bnxt: remove redundant code parsing pool_map Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 06/15] net/bnxt: fix redirecting traffic to a VF Ajit Khaparde
2017-10-24 21:19       ` Ajit Khaparde [this message]
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 08/15] net/bnxt: fix a null pointer dereference Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 09/15] net/bnxt: fix an issue reported by Coverity Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 10/15] net/bnxt: fix a potential null pointer dereference Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 11/15] net/bnxt: fix a potential null poiner dereference Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 12/15] net/bnxt: fix a null pointer deref Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 13/15] net/bnxt: fix a pointer deref before null check Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 14/15] net/bnxt: fix an issue reported by Coverity Ajit Khaparde
2017-10-24 21:19       ` [dpdk-dev] [PATCH v2 15/15] net/bnxt: check VLANs from pool_map only for VMDQ Ajit Khaparde
2017-10-24 22:49       ` [dpdk-dev] [PATCH v2 00/15] bnxt patchset Ferruh Yigit

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=20171024211953.12021-8-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).