net/i40e: fix division by 0
authorYong Wang <wang.yong19@zte.com.cn>
Fri, 23 Jun 2017 10:57:47 +0000 (06:57 -0400)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 6 Jul 2017 13:00:57 +0000 (15:00 +0200)
commitb734923ddc348886bea968ecd4cda5090f2c2934
tree324ca0c86c7b83845aa03cf1c7476165e2ceb9fd
parentdc66e5fd01b9565b392833167c792cc6df9bc64c
net/i40e: fix division by 0

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")
Cc: stable@dpdk.org
Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
drivers/net/i40e/i40e_ethdev.c