net/i40e: fix queue region error in priority configuration

Message ID 1548144663-3735-1-git-send-email-wei.zhao1@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/i40e: fix queue region error in priority configuration |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Zhao1, Wei Jan. 22, 2019, 8:11 a.m. UTC
  There is no need to set vlan priority realted resigsters
when there is no configuration about that in queue region.

Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush")
Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/i40e/rte_pmd_i40e.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
  

Comments

Zhao1, Wei Jan. 22, 2019, 9:31 a.m. UTC | #1
Tested-by: Peng Yuan < yuan.peng@intel.com@intel.com>


applied the patch [https://patches.dpdk.org/patch/49990/]  to dpdk 19.02-rc3
commit 84a1d4a873634f53cc6e3555dc78ca611bbc3458
verified with fortville 4*10g NIC
driver: i40e
version: 2.7.11
firmware-version: 6.01 0x80003205 1.1691.0
./usertools/dpdk-devbind.py -b igb_uio 05:00.0 05:00.1
./x86_64-native-linuxapp-gcc/app/testpmd -c 1ff -n 4 - -i --rxq=8 --txq=8 --nb-cores=2  --nb-ports=2  --pkt-filter-mode=perfect
   port config all rss all
   set verbose 1
   port config 0 pctype mapping update 15 28
   port config 0 pctype mapping update 17 30
   set port 0 queue-region region_id 0 queue_start_index 2 queue_num 4
   set port 0 queue-region region_id 1 queue_start_index 6 queue_num 1
   set port 0 queue-region region_id 0 flowtype 15
   set port 0 queue-region region_id 1 flowtype 17
   set port 0 queue-region flush on
   port config all rss 28
   port config all rss 30
   start
Input packet: sendp([Ether(type=0x8863,dst='ff:ff:ff:ff:ff:ff')/PPPoED()],iface="enp131s0f3",count=100)
testpmd showed:
testpmd> show port stats all
  ######################## NIC statistics for port 0  ########################
  RX-packets: 100        RX-missed: 0          RX-bytes:  6000
  RX-errors: 0
  RX-nombuf:  0
  TX-packets: 0          TX-errors: 0          TX-bytes:  0
  Throughput (since last show)
  Rx-pps:            0
  Tx-pps:            0
  ############################################################################
  ######################## NIC statistics for port 1  ########################
  RX-packets: 0          RX-missed: 0          RX-bytes:  0
  RX-errors: 0
  RX-nombuf:  0
  TX-packets: 100        TX-errors: 0          TX-bytes:  6000
  Throughput (since last show)
  Rx-pps:            0
  Tx-pps:            0
  ############################################################################
 
the issue is not reproduced.


> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, January 22, 2019 4:11 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Peng, Yuan
> <yuan.peng@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] net/i40e: fix queue region error in priority configuration
> 
> There is no need to set vlan priority realted resigsters when there is no
> configuration about that in queue region.
> 
> Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush")
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/i40e/rte_pmd_i40e.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/i40e/rte_pmd_i40e.c
> b/drivers/net/i40e/rte_pmd_i40e.c index 7ce5d02..c49c872 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));
> 
> --
> 2.7.5
  
Qi Zhang Jan. 22, 2019, 12:48 p.m. UTC | #2
> -----Original Message-----
> From: Zhao1, Wei
> Sent: Tuesday, January 22, 2019 4:11 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Peng, Yuan
> <yuan.peng@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] net/i40e: fix queue region error in priority configuration

Change title to below since it's all about if we need to call i40e_set_dcb_config

fix queue region dcb configure


> 
> There is no need to set vlan priority realted resigsters when there is no
> configuration about that in queue region.

Reword to 

DCB is not necessary to be configured if no user priority of queue region is requested.
> 
> Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush")
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel with above change.

Thanks
Qi
  
Ferruh Yigit Jan. 22, 2019, 4:33 p.m. UTC | #3
On 1/22/2019 12:48 PM, Zhang, Qi Z wrote:
> 
> 
>> -----Original Message-----
>> From: Zhao1, Wei
>> Sent: Tuesday, January 22, 2019 4:11 PM
>> To: dev@dpdk.org
>> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Peng, Yuan
>> <yuan.peng@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
>> Subject: [PATCH] net/i40e: fix queue region error in priority configuration
> 
> Change title to below since it's all about if we need to call i40e_set_dcb_config
> 
> fix queue region dcb configure
> 
> 
>>
>> There is no need to set vlan priority realted resigsters when there is no
>> configuration about that in queue region.
> 
> Reword to 
> 
> DCB is not necessary to be configured if no user priority of queue region is requested.

Extended description with provided information as below, please comment if
change required for this update.

"
    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")
>> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> 
> Applied to dpdk-next-net-intel with above change.
> 
> Thanks
> Qi
>
  
Qi Zhang Jan. 23, 2019, 1:56 a.m. UTC | #4
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, January 23, 2019 12:34 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>;
> dev@dpdk.org
> Cc: stable@dpdk.org; Peng, Yuan <yuan.peng@intel.com>
> Subject: Re: [dpdk-stable] [PATCH] net/i40e: fix queue region error in priority
> configuration
> 
> On 1/22/2019 12:48 PM, Zhang, Qi Z wrote:
> >
> >
> >> -----Original Message-----
> >> From: Zhao1, Wei
> >> Sent: Tuesday, January 22, 2019 4:11 PM
> >> To: dev@dpdk.org
> >> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Peng, Yuan
> >> <yuan.peng@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> >> Subject: [PATCH] net/i40e: fix queue region error in priority
> >> configuration
> >
> > Change title to below since it's all about if we need to call
> > i40e_set_dcb_config
> >
> > fix queue region dcb configure
> >
> >
> >>
> >> There is no need to set vlan priority realted resigsters when there
> >> is no configuration about that in queue region.
> >
> > Reword to
> >
> > DCB is not necessary to be configured if no user priority of queue region is
> requested.
> 
> Extended description with provided information as below, please comment if
> change required for this update.
> 
> "
>     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.
> "

Looks good to me
Thanks
Qi
> 

> >>
> >> Fixes: 7cbecc2f7424 ("net/i40e: support queue region set and flush")
> >> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> >
> > Acked-by: Qi Zhang <qi.z.zhang@intel.com>
> >
> > Applied to dpdk-next-net-intel with above change.
> >
> > Thanks
> > Qi
> >
  

Patch

diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c
index 7ce5d02..c49c872 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));