[dpdk-stable] patch 'net/i40e: fix division by 0' has been queued to LTS release 16.11.3

Yuanhan Liu yliu at fridaylinux.org
Fri Jul 14 12:33:56 CEST 2017


Hi,

FYI, your patch has been queued to LTS release 16.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/19/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From e4cfe6205efdff66da14ab233ba2f1cd2b3eb9be Mon Sep 17 00:00:00 2001
From: Yong Wang <wang.yong19 at zte.com.cn>
Date: Fri, 23 Jun 2017 06:57:47 -0400
Subject: [PATCH] net/i40e: fix division by 0

[ upstream commit b734923ddc348886bea968ecd4cda5090f2c2934 ]

In function i40e_vsi_config_tc_queue_mapping(), if 'enabled_tcmap' is 0,
'total_tc' might be 0. Then 'total_tc' might be used in a division
by 0 in "qpnum_per_tc = i40e_align_floor(vsi->nb_qps / total_tc)".

Fix it by changing 'total_tc' from 0 to 1 just as func
i40e_vsi_update_queue_mapping() does.

Fixes: 4861cde46116 ("i40e: new poll mode driver")

Signed-off-by: Yong Wang <wang.yong19 at zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu at intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index afa2098..4a1f4c8 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -4012,6 +4012,8 @@ i40e_vsi_config_tc_queue_mapping(struct i40e_vsi *vsi,
 	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++)
 		if (enabled_tcmap & (1 << i))
 			total_tc++;
+	if (total_tc == 0)
+		total_tc = 1;
 	vsi->enabled_tc = enabled_tcmap;
 
 	/* Number of queues per enabled TC */
-- 
2.7.4



More information about the stable mailing list