updates for testpmd
cover updates for testpmd
This series are minor updates for testpmd application.
Huisong Li (2):
app/testpmd: update Rx RSS HASH offload when setting MQ RSS app/testpmd: retain original FDIR mode when configuring DCB
app/test-pmd/testpmd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.5
PATCH 1/2 app/testpmd: update Rx RSS HASH offload when setting MQ RSS
From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1, ETH_MQ_RX_RSS flag is set in port->dev_conf.rxmode.mq_mode in testpmd application, and DEV_RX_OFFLOAD_RSS_HASH flag is set in rx_offloads (dev->data->dev_conf.rxmode.offloads) according to the ETH_MQ_RX_RSS flag of rxmode.mq_mode in PMD drivers.
However, DEV_RX_OFFLOAD_RSS_HASH is not set to rx_offloads maintained in testpmd application, this will cause the inconsistent problem that rx_offloads is different for testpmd and PMD drivers.
--- app/test-pmd/testpmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +4 -2
@@ -3356,11 +3356,13 @@ init_port_config(void) }if (port->dcb_flag ==0 ) { -if ( port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) +if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) { port->dev_conf.rxmode.mq_mode = (enum rte_eth_rx_mq_mode ) (rx_mq_mode Ð_MQ_RX_RSS ); -else + port->dev_conf.rxmode.offloads |= +DEV_RX_OFFLOAD_RSS_HASH ; + }else port->dev_conf.rxmode.mq_mode =ETH_MQ_RX_NONE ; }
Signature · 1 line
2.9.5
Re: [dpdk-dev] [PATCH 1/2] app/testpmd: update Rx RSS HASH offload when setting MQ RSS
Quoted 9 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1,
ETH_MQ_RX_RSSflag is set inport->dev_conf.rxmode.mq_modein testpmd application, andDEV_RX_OFFLOAD_RSS_HASHflag is set inrx_offloads(dev->data->dev_conf.rxmode.offloads) according to theETH_MQ_RX_RSSflag of rxmode.mq_mode in PMD drivers.
Quoted 3 lines
However,
DEV_RX_OFFLOAD_RSS_HASHis not set torx_offloadsmaintained in testpmd application, this will cause the inconsistent problem thatrx_offloadsis different for testpmd and PMD drivers.
Yes for DEV_RX_OFFLOAD_RSS_HASH, application rx_offload config and PMD one diverges, for *some* PMDs.
This is done to have the backward compatibility of the PMD behavior.
The PMDs that would like to write the provide the calculated hash value back, overwrites the offload config to enable 'DEV_RX_OFFLOAD_RSS_HASH'. And does more work than user requested, this shouldn't have any side affect. Some doesn't provide the hash unless user explicitly requests it.
Applications shouldn't set it blindly, at least first check if PMD supports it but even that case, unless it is needed I think HASH offload shouldn't be requested by default.
Quoted 28 lines
Signed-off-by Huisong Li <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>--- app/test-pmd/testpmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)app/test-pmd/testpmd.c +4
-2@@ -3356,11 +3356,13 @@ init_port_config(void) }if (port->dcb_flag ==0 ) { -if ( port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) +if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) { port->dev_conf.rxmode.mq_mode = (enum rte_eth_rx_mq_mode ) (rx_mq_mode Ð_MQ_RX_RSS ); -else + port->dev_conf.rxmode.offloads |= +DEV_RX_OFFLOAD_RSS_HASH ; + }else port->dev_conf.rxmode.mq_mode =ETH_MQ_RX_NONE ; }
Re: [dpdk-dev] [PATCH 1/2] app/testpmd: update Rx RSS HASH offload when setting MQ RSS
Hi, Ferruh Yigit
Quoted 14 lines · Ferruh Yigit
Quoted 9 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1,
ETH_MQ_RX_RSSflag is set inport->dev_conf.rxmode.mq_modein testpmd application, andDEV_RX_OFFLOAD_RSS_HASHflag is set inrx_offloads(dev->data->dev_conf.rxmode.offloads) according to theETH_MQ_RX_RSSflag of rxmode.mq_mode in PMD drivers.Quoted 3 lines
However,
DEV_RX_OFFLOAD_RSS_HASHis not set torx_offloadsmaintained in testpmd application, this will cause the inconsistent problem thatrx_offloadsis different for testpmd and PMD drivers.
Quoted 8 lines
Yes for
DEV_RX_OFFLOAD_RSS_HASH, applicationrx_offloadconfig and PMD one diverges, for *some* PMDs.This is done to have the backward compatibility of the PMD behavior.
The PMDs that would like to write the provide the calculated hash value back, overwrites the offload config to enable '
DEV_RX_OFFLOAD_RSS_HASH'. And does more work than user requested, this shouldn't have any side affect. Some doesn't provide the hash unless user explicitly requests it.Applications shouldn't set it blindly, at least first check if PMD supports it but even that case, unless it is needed I think HASH offload shouldn't be requested by default.
OK, we are going to do modification to add check if PMD support DEV_RX_OFFLOAD_RSS_HASH before setting it as below:
@@ -3356,11 +3356,13 @@ init_port_config(void)
}
if (port->dcb_flag == 0) {
if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) {
port->dev_conf.rxmode.mq_mode =
(enum rte_eth_rx_mq_mode)
(rx_mq_mode & ETH_MQ_RX_RSS);
if (port->dev_info.rx_offload_capa &
DEV_RX_OFFLOAD_RSS_HASH)
port->dev_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_RSS_HASH;
} else
port->dev_conf.rxmode.mq_mode = ETH_MQ_RX_NONE;
}Thanks, Xavier
Quoted 27 lines
Quoted 27 lines
Signed-off-by Huisong Li <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>---
app/test-pmd/testpmd.c| 6 ++++--1 file changed, 4 insertions(+), 2 deletions(-)app/test-pmd/testpmd.c +1
-1@@ -3356,11 +3356,13 @@ init_port_config(void) } if (port->dcb_flag == 0) { - if( port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) + if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf != 0) {
port->dev_conf.rxmode.mq_mode=
(enumrte_eth_rx_mq_mode) (rx_mq_modeÐ_MQ_RX_RSS); - else
+port->dev_conf.rxmode.offloads|=
+DEV_RX_OFFLOAD_RSS_HASH;
+ } else
port->dev_conf.rxmode.mq_mode=ETH_MQ_RX_NONE; }
Re: [dpdk-dev] [PATCH 1/2] app/testpmd: update Rx RSS HASH offload when setting MQ RSS
Quoted 28 lines · Wei Hu (Xavier)
Hi, Ferruh Yigit
Quoted 14 lines · Ferruh Yigit
Quoted 9 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1,
ETH_MQ_RX_RSSflag is set inport->dev_conf.rxmode.mq_modein testpmd application, andDEV_RX_OFFLOAD_RSS_HASHflag is set inrx_offloads(dev->data->dev_conf.rxmode.offloads) according to theETH_MQ_RX_RSSflag of rxmode.mq_mode in PMD drivers.Quoted 3 lines
However,
DEV_RX_OFFLOAD_RSS_HASHis not set torx_offloadsmaintained in testpmd application, this will cause the inconsistent problem thatrx_offloadsis different for testpmd and PMD drivers.Quoted 8 lines
Yes for
DEV_RX_OFFLOAD_RSS_HASH, applicationrx_offloadconfig and PMD one diverges, for *some* PMDs.This is done to have the backward compatibility of the PMD behavior.
The PMDs that would like to write the provide the calculated hash value back, overwrites the offload config to enable '
DEV_RX_OFFLOAD_RSS_HASH'. And does more work than user requested, this shouldn't have any side affect. Some doesn't provide the hash unless user explicitly requests it.Applications shouldn't set it blindly, at least first check if PMD supports it but even that case, unless it is needed I think HASH offload shouldn't be requested by default.
OK, we are going to do modification to add check if PMD support
DEV_RX_OFFLOAD_RSS_HASHbefore setting it as below:
Quoted 15 lines
@@ -3356,11 +3356,13 @@
init_port_config(void)
}
if (port->dcb_flag== 0) {
if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf!= 0) {port->dev_conf.rxmode.mq_mode=
(enumrte_eth_rx_mq_mode) (rx_mq_modeÐ_MQ_RX_RSS); if (port->dev_info.rx_offload_capa&DEV_RX_OFFLOAD_RSS_HASH)port->dev_conf.rxmode.offloads|=DEV_RX_OFFLOAD_RSS_HASH;
} else
port->dev_conf.rxmode.mq_mode=ETH_MQ_RX_NONE; }
Hi Xavier,
The capability check is correct thing to do, but even in that case I am not sure if we should set the config by default.
The reason to extract the 'DEV_RX_OFFLOAD_RSS_HASH' offload is to gain performance for some NICs, enabling it by default defeats the purpose.
The offload should be enabled when application needs the provided hash value.
I can see you are trying to remove the divergence between PMD and application config, this can be fixed when all PMDs take this user offload request into account instead of overwriting, but for some PMDs it is cheaper to provide the hash value instead of checks, so this divergence is not easy to address.
Re: [dpdk-dev] [PATCH 1/2] app/testpmd: update Rx RSS HASH offload when setting MQ RSS
Hi, Ferruh Yigit
Quoted 47 lines · Ferruh Yigit
Quoted 28 lines · Wei Hu (Xavier)
Hi, Ferruh Yigit
Quoted 14 lines · Ferruh Yigit
Quoted 9 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1,
ETH_MQ_RX_RSSflag is set inport->dev_conf.rxmode.mq_modein testpmd application, andDEV_RX_OFFLOAD_RSS_HASHflag is set inrx_offloads(dev->data->dev_conf.rxmode.offloads) according to theETH_MQ_RX_RSSflag of rxmode.mq_mode in PMD drivers.Quoted 3 lines
However,
DEV_RX_OFFLOAD_RSS_HASHis not set torx_offloadsmaintained in testpmd application, this will cause the inconsistent problem thatrx_offloadsis different for testpmd and PMD drivers.Quoted 8 lines
Yes for
DEV_RX_OFFLOAD_RSS_HASH, applicationrx_offloadconfig and PMD one diverges, for *some* PMDs.This is done to have the backward compatibility of the PMD behavior.
The PMDs that would like to write the provide the calculated hash value back, overwrites the offload config to enable '
DEV_RX_OFFLOAD_RSS_HASH'. And does more work than user requested, this shouldn't have any side affect. Some doesn't provide the hash unless user explicitly requests it.Applications shouldn't set it blindly, at least first check if PMD supports it but even that case, unless it is needed I think HASH offload shouldn't be requested by default.
OK, we are going to do modification to add check if PMD support
DEV_RX_OFFLOAD_RSS_HASHbefore setting it as below:Quoted 15 lines
@@ -3356,11 +3356,13 @@
init_port_config(void)
}
if (port->dcb_flag== 0) {
if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf!= 0) {port->dev_conf.rxmode.mq_mode=
(enumrte_eth_rx_mq_mode) (rx_mq_modeÐ_MQ_RX_RSS); if (port->dev_info.rx_offload_capa&DEV_RX_OFFLOAD_RSS_HASH)port->dev_conf.rxmode.offloads|=DEV_RX_OFFLOAD_RSS_HASH;
} else
port->dev_conf.rxmode.mq_mode=ETH_MQ_RX_NONE; }Hi Xavier,
Quoted 8 lines
The capability check is correct thing to do, but even in that case I am not sure if we should set the config by default.
The reason to extract the '
DEV_RX_OFFLOAD_RSS_HASH' offload is to gain performance for some NICs, enabling it by default defeats the purpose.The offload should be enabled when application needs the provided hash value.
I can see you are trying to remove the divergence between PMD and application config, this can be fixed when all PMDs take this user offload request into account instead of overwriting, but for some PMDs it is cheaper to provide the hash value instead of checks, so this divergence is not easy to address.
OK, please ignore this patch and the V2 patch.
http://patches.dpdk.org/patch/78502/
Thanks.
Regards
Xavier
PATCH 2/2 app/testpmd: retain original FDIR mode when configuring DCB
In reply to Wei Hu (Xavier)From: Huisong Li <[email protected]>
Sometimes, we have to start testpmd application with --pkt-filter-mode to test flow table feature. When using 'port config 0 dcb vt off 4 pfc on' command, the dcb information are configured in init_port_dcb_config function by get_eth_dcb_conf function, And then rte_eth_dev_configure API function will be called to re-configure PMD driver.
The values of rxmode and txmode in rte_eth_conf struct used to configure PMD driver, come from the current values maintained in testpmd. However, the fdir_conf.mode in rte_eth_conf struct is not set, which may cause that some PMD driver cannot test the flow table feature when multiple TCs are enabled.
--- app/test-pmd/testpmd.c | 1 + 1 file changed, 1 insertion(+)
app/test-pmd/testpmd.c +1 -0
@@ -3521,6 +3521,7 @@ init_port_dcb_config(portid_t pid, port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; + port_conf.fdir_conf.mode = rte_port->dev_conf.fdir_conf.mode;/*set configuration of DCB in vt mode and DCB in non-vt mode*/ retval =get_eth_dcb_conf (pid, &port_conf, dcb_mode, num_tcs, pfc_en);
Signature · 1 line
2.9.5
Re: [dpdk-dev] [PATCH 2/2] app/testpmd: retain original FDIR mode when configuring DCB
Quoted 29 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Sometimes, we have to start testpmd application with --pkt-filter-mode to test flow table feature. When using 'port config 0 dcb vt off 4 pfc on' command, the dcb information are configured in
init_port_dcb_configfunction byget_eth_dcb_conffunction, And thenrte_eth_dev_configureAPI function will be called to re-configure PMD driver.The values of rxmode and txmode in
rte_eth_confstruct used to configure PMD driver, come from the current values maintained in testpmd. However, the fdir_conf.mode inrte_eth_confstruct is not set, which may cause that some PMD driver cannot test the flow table feature when multiple TCs are enabled.Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")Signed-off-by Huisong Li <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>--- app/test-pmd/testpmd.c | 1 + 1 file changed, 1 insertion(+)app/test-pmd/testpmd.c +0
-0
app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 3524
Quoted 4 lines
app/test-pmd/testpmd.c +1
-0@@ -3521,6 +3521,7 @@ init_port_dcb_config(portid_t pid, port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; + port_conf.fdir_conf.mode = rte_port->dev_conf.fdir_conf.mode;
This is probably not necessary. FDIR is due for deprecation [1].
https://doc.dpdk.org/guides/rel_notes/deprecation.html
Quoted 6 lines
app/test-pmd/testpmd.c +0
-1/*set configuration of DCB in vt mode and DCB in non-vt mode*/ retval =get_eth_dcb_conf (pid, &port_conf, dcb_mode, num_tcs, pfc_en); --2.9.5
Re: [dpdk-dev] [PATCH 2/2] app/testpmd: retain original FDIR mode when configuring DCB
Hi, Ajit Khaparde
Quoted 31 lines · Ajit Khaparde
Quoted 29 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Sometimes, we have to start testpmd application with --pkt-filter-mode to test flow table feature. When using 'port config 0 dcb vt off 4 pfc on' command, the dcb information are configured in
init_port_dcb_configfunction byget_eth_dcb_conffunction, And thenrte_eth_dev_configureAPI function will be called to re-configure PMD driver.The values of rxmode and txmode in
rte_eth_confstruct used to configure PMD driver, come from the current values maintained in testpmd. However, the fdir_conf.mode inrte_eth_confstruct is not set, which may cause that some PMD driver cannot test the flow table feature when multiple TCs are enabled.Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")Signed-off-by Huisong Li <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>--- app/test-pmd/testpmd.c | 1 + 1 file changed, 1 insertion(+)app/test-pmd/testpmd.c +0
-0@@ -3521,6 +3521,7 @@ init_port_dcb_config(portid_t pid,
Quoted 5 lines
app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 3524
Quoted 3 lines
app/test-pmd/testpmd.c +1
-0port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; + port_conf.fdir_conf.mode = rte_port->dev_conf.fdir_conf.mode;This is probably not necessary. FDIR is due for deprecation [1].
https://doc.dpdk.org/guides/rel_notes/deprecation.html
Thanks your for pointing out it, this patch is really necessary.
Thanks, Xavier
Quoted 5 lines
Quoted 5 lines
app/test-pmd/testpmd.c +0
-1/*set configuration of DCB in vt mode and DCB in non-vt mode*/ retval =get_eth_dcb_conf (pid, &port_conf, dcb_mode, num_tcs, pfc_en); --2.9.5
Re: [dpdk-dev] [PATCH 2/2] app/testpmd: retain original FDIR mode when configuring DCB
Hi, Ajit Khaparde
Quoted 35 lines · Wei Hu (Xavier)
Hi, Ajit Khaparde
Quoted 32 lines · Ajit Khaparde
Quoted 30 lines · Wei Hu (Xavier)
From: Huisong Li <[email protected]>
Sometimes, we have to start testpmd application with --pkt-filter-mode to
test flow table feature. When using 'port config 0 dcb vt off 4 pfc on' command, the dcb information are configured ininit_port_dcb_configfunction byget_eth_dcb_conffunction, And thenrte_eth_dev_configureAPI function will be called to re-configure PMD driver.The values of rxmode and txmode in
rte_eth_confstruct used to configure PMD driver, come from the current values maintained in testpmd. However, the fdir_conf.mode inrte_eth_confstruct is not set, which may cause that some PMD driver cannot test the flow table feature when multiple TCs are enabled.Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")Signed-off-by Huisong Li <[email protected]>Signed-off-by Wei Hu (Xavier) <[email protected]>---
app/test-pmd/testpmd.c| 1 +1 file changed, 1 insertion(+)app/test-pmd/testpmd.c +0
-0@@ -3521,6 +3521,7 @@ init_port_dcb_config(portid_t pid,
Quoted 8 lines
Quoted 5 lines
app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 3524
Quoted 3 lines
app/test-pmd/testpmd.c +1
-0port_conf.rxmode = rte_port->dev_conf.rxmode; port_conf.txmode = rte_port->dev_conf.txmode; + port_conf.fdir_conf.mode = rte_port->dev_conf.fdir_conf.mode;This is probably not necessary. FDIR is due for deprecation [1].
https://doc.dpdk.org/guides/rel_notes/deprecation.htmlThanks your for pointing out it, this patch is really necessary.
Sorry, it is a typo.
This patch is not really necessary.
Thanks, Xavier
Quoted 8 lines
Thanks, Xavier
Quoted 5 lines
Quoted 5 lines
app/test-pmd/testpmd.c +0
-0/*set configuration of DCB in vt mode and DCB in non-vt mode*/ retval = get_eth_dcb_conf(pid, &port_conf, dcb_mode, num_tcs, pfc_en);Signature · 1 line
2.9.5
PATCH v2 1/1 app/testpmd: update Rx RSS HASH offload when setting MQ RSS
In reply to Wei Hu (Xavier)From: Huisong Li <[email protected]>
Currently, when starting testpmd application without '--disable-rss' and the number of Rx queue configured is greater than 1, ETH_MQ_RX_RSS flag is set in port->dev_conf.rxmode.mq_mode in testpmd application, and DEV_RX_OFFLOAD_RSS_HASH flag is set in rx_offloads (dev->data->dev_conf.rxmode.offloads) according to the ETH_MQ_RX_RSS flag of rxmode.mq_mode in PMD drivers.
However, DEV_RX_OFFLOAD_RSS_HASH is not set to rx_offloads maintained in testpmd application, this will cause the inconsistent problem that rx_offloads is different for testpmd and PMD drivers.
---
v1 -> v2: add check if PMD support DEV_RX_OFFLOAD_RSS_HASH before
setting it.
--- app/test-pmd/testpmd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
app/test-pmd/testpmd.c +6 -2
@@ -3353,11 +3353,15 @@ init_port_config(void) }if (port->dcb_flag ==0 ) { -if ( port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) +if (port->dev_conf.rx_adv_conf.rss_conf.rss_hf !=0 ) { port->dev_conf.rxmode.mq_mode = (enum rte_eth_rx_mq_mode ) (rx_mq_mode Ð_MQ_RX_RSS ); -else +if (port->dev_info.rx_offload_capa & +DEV_RX_OFFLOAD_RSS_HASH ) + port->dev_conf.rxmode.offloads |= +DEV_RX_OFFLOAD_RSS_HASH ; + }else port->dev_conf.rxmode.mq_mode =ETH_MQ_RX_NONE ; }
Signature · 1 line
2.9.5