[dpdk-dev] ixgbe: fix reta query and update on x550

Message ID 1458268055-22668-1-git-send-email-xiao.w.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Xiao Wang March 18, 2016, 2:27 a.m. UTC
  For x550 device, the reta table has 512 entries, but in function
ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an
"uint8_t i" to traverse the entries, this will lead the function
to an endless loop.

This patch changes the data type from uint8_t to uint16_t to fix
the issue.

Fixes: 4bee94a6c22f ("ixgbe: support 512 RSS entries on x550")

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Wenzhuo Lu March 18, 2016, 3:19 a.m. UTC | #1
Hi,


> -----Original Message-----
> From: Wang, Xiao W
> Sent: Friday, March 18, 2016 10:28 AM
> To: Zhang, Helin
> Cc: dev@dpdk.org; Lu, Wenzhuo; Wang, Xiao W
> Subject: [PATCH] ixgbe: fix reta query and update on x550
> 
> For x550 device, the reta table has 512 entries, but in function
> ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an "uint8_t i"
> to traverse the entries, this will lead the function to an endless loop.
> 
> This patch changes the data type from uint8_t to uint16_t to fix the issue.
> 
> Fixes: 4bee94a6c22f ("ixgbe: support 512 RSS entries on x550")
> 
> Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  
Bruce Richardson March 22, 2016, 5:19 p.m. UTC | #2
On Fri, Mar 18, 2016 at 03:19:35AM +0000, Lu, Wenzhuo wrote:
> Hi,
> 
> 
> > -----Original Message-----
> > From: Wang, Xiao W
> > Sent: Friday, March 18, 2016 10:28 AM
> > To: Zhang, Helin
> > Cc: dev@dpdk.org; Lu, Wenzhuo; Wang, Xiao W
> > Subject: [PATCH] ixgbe: fix reta query and update on x550
> > 
> > For x550 device, the reta table has 512 entries, but in function
> > ixgbe_dev_rss_reta_query and ixgbe_dev_rss_reta_update we use an "uint8_t i"
> > to traverse the entries, this will lead the function to an endless loop.
> > 
> > This patch changes the data type from uint8_t to uint16_t to fix the issue.
> > 
> > Fixes: 4bee94a6c22f ("ixgbe: support 512 RSS entries on x550")
> > 
> > Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> 
Applied to dpdk-next-net/rel_16_04

/Bruce
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index afe6582..46c5d4d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3640,11 +3640,11 @@  ixgbe_dev_rss_reta_update(struct rte_eth_dev *dev,
 			  struct rte_eth_rss_reta_entry64 *reta_conf,
 			  uint16_t reta_size)
 {
-	uint8_t i, j, mask;
+	uint16_t i, sp_reta_size;
+	uint8_t j, mask;
 	uint32_t reta, r;
 	uint16_t idx, shift;
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint16_t sp_reta_size;
 	uint32_t reta_reg;
 
 	PMD_INIT_FUNC_TRACE();
@@ -3694,11 +3694,11 @@  ixgbe_dev_rss_reta_query(struct rte_eth_dev *dev,
 			 struct rte_eth_rss_reta_entry64 *reta_conf,
 			 uint16_t reta_size)
 {
-	uint8_t i, j, mask;
+	uint16_t i, sp_reta_size;
+	uint8_t j, mask;
 	uint32_t reta;
 	uint16_t idx, shift;
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint16_t sp_reta_size;
 	uint32_t reta_reg;
 
 	PMD_INIT_FUNC_TRACE();