DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] bugfix for testpmd
@ 2021-04-22  7:03 Min Hu (Connor)
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf Min Hu (Connor)
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads Min Hu (Connor)
  0 siblings, 2 replies; 7+ messages in thread
From: Min Hu (Connor) @ 2021-04-22  7:03 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, xiaoyun.li

This patchset contains two bugfixes for testpmd.

Chengchang Tang (2):
  app/testpmd: fix integer overflow during get DCB conf
  app/testpmd: fix max queue number when configure Tx offloads

 app/test-pmd/cmdline.c | 2 +-
 app/test-pmd/testpmd.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf
  2021-04-22  7:03 [dpdk-dev] [PATCH 0/2] bugfix for testpmd Min Hu (Connor)
@ 2021-04-22  7:03 ` Min Hu (Connor)
  2021-04-25  2:05   ` Li, Xiaoyun
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads Min Hu (Connor)
  1 sibling, 1 reply; 7+ messages in thread
From: Min Hu (Connor) @ 2021-04-22  7:03 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, xiaoyun.li

From: Chengchang Tang <tangchengchang@huawei.com>

In C, constant is treated as integer. Therefore, if nb_queque_pools is
ETH_32_POOLS, the shift here may cause integer overflow.

Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index afa2a6b..6784160 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3640,7 +3640,7 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf *eth_conf,
 		for (i = 0; i < vmdq_rx_conf->nb_pool_maps; i++) {
 			vmdq_rx_conf->pool_map[i].vlan_id = vlan_tags[i];
 			vmdq_rx_conf->pool_map[i].pools =
-				1 << (i % vmdq_rx_conf->nb_queue_pools);
+				1ULL << (i % vmdq_rx_conf->nb_queue_pools);
 		}
 		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
 			vmdq_rx_conf->dcb_tc[i] = i % num_tcs;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads
  2021-04-22  7:03 [dpdk-dev] [PATCH 0/2] bugfix for testpmd Min Hu (Connor)
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf Min Hu (Connor)
@ 2021-04-22  7:03 ` Min Hu (Connor)
  2021-04-25  2:08   ` Li, Xiaoyun
  1 sibling, 1 reply; 7+ messages in thread
From: Min Hu (Connor) @ 2021-04-22  7:03 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, xiaoyun.li

From: Chengchang Tang <tangchengchang@huawei.com>

When txq offload is configured, max rxq is used as the max queue. This
patch fixes it.

Fixes: 74453ac9ef67 ("app/testpmd: fix queue offload configuration")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f0fa6e8..1cb1027 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4666,7 +4666,7 @@ cmd_config_queue_tx_offloads(struct rte_port *port)
 	int k;
 
 	/* Apply queue tx offloads configuration */
-	for (k = 0; k < port->dev_info.max_rx_queues; k++)
+	for (k = 0; k < port->dev_info.max_tx_queues; k++)
 		port->tx_conf[k].offloads =
 			port->dev_conf.txmode.offloads;
 }
-- 
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf Min Hu (Connor)
@ 2021-04-25  2:05   ` Li, Xiaoyun
  2021-04-25  3:21     ` Min Hu (Connor)
  0 siblings, 1 reply; 7+ messages in thread
From: Li, Xiaoyun @ 2021-04-25  2:05 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh

Hi

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 15:04
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf
> 
> From: Chengchang Tang <tangchengchang@huawei.com>
> 
> In C, constant is treated as integer. Therefore, if nb_queque_pools is
> ETH_32_POOLS, the shift here may cause integer overflow.
> 
> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
> class")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  app/test-pmd/testpmd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> afa2a6b..6784160 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3640,7 +3640,7 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf
> *eth_conf,
>  		for (i = 0; i < vmdq_rx_conf->nb_pool_maps; i++) {
>  			vmdq_rx_conf->pool_map[i].vlan_id = vlan_tags[i];
>  			vmdq_rx_conf->pool_map[i].pools =
> -				1 << (i % vmdq_rx_conf->nb_queue_pools);
> +				1ULL << (i % vmdq_rx_conf->nb_queue_pools);

In get_eth_dcb_conf(),
vmdq_rx_conf->nb_queue_pools =
			(num_tcs ==  ETH_4_TCS ? ETH_32_POOLS : ETH_16_POOLS);

It will only be 16 or 32.
So I don't think this patch is necessary unless you're going to use the value ETH_64_POOLS.

>  		}
>  		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
>  			vmdq_rx_conf->dcb_tc[i] = i % num_tcs;
> --
> 2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads
  2021-04-22  7:03 ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads Min Hu (Connor)
@ 2021-04-25  2:08   ` Li, Xiaoyun
  2021-04-26 14:21     ` Ferruh Yigit
  0 siblings, 1 reply; 7+ messages in thread
From: Li, Xiaoyun @ 2021-04-25  2:08 UTC (permalink / raw)
  To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh


> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Thursday, April 22, 2021 15:04
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
> Subject: [PATCH 2/2] app/testpmd: fix max queue number when configure Tx
> offloads
> 
> From: Chengchang Tang <tangchengchang@huawei.com>
> 
> When txq offload is configured, max rxq is used as the max queue. This patch
> fixes it.
> 
> Fixes: 74453ac9ef67 ("app/testpmd: fix queue offload configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
>  app/test-pmd/cmdline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> f0fa6e8..1cb1027 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -4666,7 +4666,7 @@ cmd_config_queue_tx_offloads(struct rte_port *port)
>  	int k;
> 
>  	/* Apply queue tx offloads configuration */
> -	for (k = 0; k < port->dev_info.max_rx_queues; k++)
> +	for (k = 0; k < port->dev_info.max_tx_queues; k++)
>  		port->tx_conf[k].offloads =
>  			port->dev_conf.txmode.offloads;
>  }
> --
> 2.7.4

Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf
  2021-04-25  2:05   ` Li, Xiaoyun
@ 2021-04-25  3:21     ` Min Hu (Connor)
  0 siblings, 0 replies; 7+ messages in thread
From: Min Hu (Connor) @ 2021-04-25  3:21 UTC (permalink / raw)
  To: Li, Xiaoyun, dev; +Cc: Yigit, Ferruh



在 2021/4/25 10:05, Li, Xiaoyun 写道:
> Hi
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Thursday, April 22, 2021 15:04
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
>> Subject: [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf
>>
>> From: Chengchang Tang <tangchengchang@huawei.com>
>>
>> In C, constant is treated as integer. Therefore, if nb_queque_pools is
>> ETH_32_POOLS, the shift here may cause integer overflow.
>>
>> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
>> class")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>   app/test-pmd/testpmd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
>> afa2a6b..6784160 100644
>> --- a/app/test-pmd/testpmd.c
>> +++ b/app/test-pmd/testpmd.c
>> @@ -3640,7 +3640,7 @@ get_eth_dcb_conf(portid_t pid, struct rte_eth_conf
>> *eth_conf,
>>   		for (i = 0; i < vmdq_rx_conf->nb_pool_maps; i++) {
>>   			vmdq_rx_conf->pool_map[i].vlan_id = vlan_tags[i];
>>   			vmdq_rx_conf->pool_map[i].pools =
>> -				1 << (i % vmdq_rx_conf->nb_queue_pools);
>> +				1ULL << (i % vmdq_rx_conf->nb_queue_pools);
> 
> In get_eth_dcb_conf(),
> vmdq_rx_conf->nb_queue_pools =
> 			(num_tcs ==  ETH_4_TCS ? ETH_32_POOLS : ETH_16_POOLS);
> 
> It will only be 16 or 32.
> So I don't think this patch is necessary unless you're going to use the value ETH_64_POOLS.
> 
Agreed, this patch can be abandoned, thanks.
>>   		}
>>   		for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) {
>>   			vmdq_rx_conf->dcb_tc[i] = i % num_tcs;
>> --
>> 2.7.4
> 
> .
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads
  2021-04-25  2:08   ` Li, Xiaoyun
@ 2021-04-26 14:21     ` Ferruh Yigit
  0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2021-04-26 14:21 UTC (permalink / raw)
  To: Li, Xiaoyun, Min Hu (Connor), dev

On 4/25/2021 3:08 AM, Li, Xiaoyun wrote:
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Thursday, April 22, 2021 15:04
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
>> Subject: [PATCH 2/2] app/testpmd: fix max queue number when configure Tx
>> offloads
>>
>> From: Chengchang Tang <tangchengchang@huawei.com>
>>
>> When txq offload is configured, max rxq is used as the max queue. This patch
>> fixes it.
>>
>> Fixes: 74453ac9ef67 ("app/testpmd: fix queue offload configuration")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>>  app/test-pmd/cmdline.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
>> f0fa6e8..1cb1027 100644
>> --- a/app/test-pmd/cmdline.c
>> +++ b/app/test-pmd/cmdline.c
>> @@ -4666,7 +4666,7 @@ cmd_config_queue_tx_offloads(struct rte_port *port)
>>  int k;
>>
>>  /* Apply queue tx offloads configuration */
>> -for (k = 0; k < port->dev_info.max_rx_queues; k++)
>> +for (k = 0; k < port->dev_info.max_tx_queues; k++)
>>  port->tx_conf[k].offloads =
>>  port->dev_conf.txmode.offloads;
>>  }
>> --
>> 2.7.4
> 
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
> 

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-04-26 14:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  7:03 [dpdk-dev] [PATCH 0/2] bugfix for testpmd Min Hu (Connor)
2021-04-22  7:03 ` [dpdk-dev] [PATCH 1/2] app/testpmd: fix integer overflow during get DCB conf Min Hu (Connor)
2021-04-25  2:05   ` Li, Xiaoyun
2021-04-25  3:21     ` Min Hu (Connor)
2021-04-22  7:03 ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix max queue number when configure Tx offloads Min Hu (Connor)
2021-04-25  2:08   ` Li, Xiaoyun
2021-04-26 14:21     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).