From: Wei Zhao Date: Tue, 22 Jan 2019 08:11:03 +0000 (+0800) Subject: net/i40e: fix queue region DCB configure X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=991a2e812fcfdba6d47b77462e06859262def583;p=dpdk.git net/i40e: fix queue region DCB configure DCB is not necessary to be configured if no user priority of queue region is requested. Unexpected configuration of DCB will cause unexpected behavior, like FDIR does not work on those queues, but could cause more issues. Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush") Cc: stable@dpdk.org Signed-off-by: Wei Zhao Tested-by: Yuan Peng Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index 7ce5d02faf..c49c872b63 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -2818,13 +2818,23 @@ i40e_queue_region_dcb_configure(struct i40e_hw *hw, struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config; int32_t ret = -EINVAL; uint16_t i, j, prio_index, region_index; - uint8_t tc_map, tc_bw, bw_lf; + uint8_t tc_map, tc_bw, bw_lf, dcb_flag = 0; if (!info->queue_region_number) { PMD_DRV_LOG(ERR, "No queue region been set before"); return ret; } + for (i = 0; i < info->queue_region_number; i++) { + if (info->region[i].user_priority_num) { + dcb_flag = 1; + break; + } + } + + if (dcb_flag == 0) + return 0; + dcb_cfg = &dcb_cfg_local; memset(dcb_cfg, 0, sizeof(struct i40e_dcbx_config));