DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: chas3@att.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH 4/5] net/bonding: fix incorrect packet count type for lacp
Date: Wed, 20 Mar 2019 12:47:21 +0100	[thread overview]
Message-ID: <1553082442-18850-5-git-send-email-david.marchand@redhat.com> (raw)
In-Reply-To: <1553082442-18850-1-git-send-email-david.marchand@redhat.com>

Caught by code review, those variables are supposed to be on 16bits to
avoid endless loops in the (unlikely?) case where the application asks
for receiving more than 256 packets and the accumulated num_rx_total
count reaches 256:

uint16_t num_rx_total = 0;
uint8_t j, k;

j = num_rx_total;
num_rx_total += rte_eth_rx_burst();

for (k = j; k < 2 && k < num_rx_total; k++)
	rte_prefetch0(rte_pktmbuf_mtod(bufs[k], void *));

while (j < num_rx_total) {
	j++;
}

Fixes: 46fb43683679 ("bond: add mode 4")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index bbe2568..ae66a70 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -405,8 +405,9 @@
 	uint8_t collecting;  /* current slave collecting status */
 	const uint8_t promisc = internals->promiscuous_en;
 	uint8_t subtype;
-	uint8_t j, k;
 	uint16_t i;
+	uint16_t j;
+	uint16_t k;
 
 	/* Copy slave list to protect against slave up/down changes during tx
 	 * bursting */
-- 
1.8.3.1

  parent reply	other threads:[~2019-03-20 11:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 11:47 [dpdk-dev] [PATCH 0/5] bonding fixes David Marchand
2019-03-20 11:47 ` David Marchand
2019-03-20 11:47 ` [dpdk-dev] [PATCH 1/5] doc: fix incorrect bond examples David Marchand
2019-03-20 11:47   ` David Marchand
2019-03-20 11:47 ` [dpdk-dev] [PATCH 2/5] net/bonding: fix incorrect bond port id types David Marchand
2019-03-20 11:47   ` David Marchand
2019-03-20 11:47 ` [dpdk-dev] [PATCH 3/5] net/bonding: fix incorrect slave " David Marchand
2019-03-20 11:47   ` David Marchand
2019-03-20 11:47 ` David Marchand [this message]
2019-03-20 11:47   ` [dpdk-dev] [PATCH 4/5] net/bonding: fix incorrect packet count type for lacp David Marchand
2019-03-20 11:47 ` [dpdk-dev] [PATCH 5/5] net/bonding: fix incorrect rxq/txq index types David Marchand
2019-03-20 11:47   ` David Marchand
2019-03-21 20:12 ` [dpdk-dev] [PATCH 0/5] bonding fixes Ferruh Yigit
2019-03-21 20:12   ` Ferruh Yigit
2019-03-21 20:21   ` David Marchand
2019-03-21 20:21     ` 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=1553082442-18850-5-git-send-email-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=chas3@att.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).