* [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB
@ 2021-10-09 8:41 Min Hu (Connor)
2021-10-11 6:49 ` Li, Xiaoyun
2021-10-11 9:12 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
0 siblings, 2 replies; 5+ messages in thread
From: Min Hu (Connor) @ 2021-10-09 8:41 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, thomas, xiaoyun.li
From: Huisong Li <lihuisong@huawei.com>
When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
rte_port->dev_conf. But some configurations, such as the link_speed, were
not saved if it were set before configuring DCB.
Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
app/test-pmd/testpmd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index eec4f1b81d..12a0db8796 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3729,10 +3729,8 @@ init_port_dcb_config(portid_t pid,
}
rte_port = &ports[pid];
- memset(&port_conf, 0, sizeof(struct rte_eth_conf));
-
- port_conf.rxmode = rte_port->dev_conf.rxmode;
- port_conf.txmode = rte_port->dev_conf.txmode;
+ /* retain the original device configuration. */
+ memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
/*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.33.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB
2021-10-09 8:41 [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB Min Hu (Connor)
@ 2021-10-11 6:49 ` Li, Xiaoyun
2021-10-11 9:15 ` Min Hu (Connor)
2021-10-11 9:12 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
1 sibling, 1 reply; 5+ messages in thread
From: Li, Xiaoyun @ 2021-10-11 6:49 UTC (permalink / raw)
To: Min Hu (Connor), dev; +Cc: Yigit, Ferruh, thomas
Hi
> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Saturday, October 9, 2021 16:42
> To: dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; thomas@monjalon.net; Li, Xiaoyun
> <xiaoyun.li@intel.com>
> Subject: [PATCH] app/testpmd: retain all original dev conf when config DCB
>
> From: Huisong Li <lihuisong@huawei.com>
>
> When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
> rte_port->dev_conf. But some configurations, such as the link_speed, were not
> saved if it were set before configuring DCB.
"if they were" or "if it was"
>
> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
> class")
> Cc: stable@dpdk.org
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
> app/test-pmd/testpmd.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> eec4f1b81d..12a0db8796 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -3729,10 +3729,8 @@ init_port_dcb_config(portid_t pid,
> }
> rte_port = &ports[pid];
>
> - memset(&port_conf, 0, sizeof(struct rte_eth_conf));
> -
> - port_conf.rxmode = rte_port->dev_conf.rxmode;
> - port_conf.txmode = rte_port->dev_conf.txmode;
> + /* retain the original device configuration. */
> + memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
>
> /*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.33.0
Except the small issue in commit log,
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB
2021-10-11 6:49 ` Li, Xiaoyun
@ 2021-10-11 9:15 ` Min Hu (Connor)
0 siblings, 0 replies; 5+ messages in thread
From: Min Hu (Connor) @ 2021-10-11 9:15 UTC (permalink / raw)
To: Li, Xiaoyun, dev; +Cc: Yigit, Ferruh, thomas
在 2021/10/11 14:49, Li, Xiaoyun 写道:
> Hi
>
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Saturday, October 9, 2021 16:42
>> To: dev@dpdk.org
>> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; thomas@monjalon.net; Li, Xiaoyun
>> <xiaoyun.li@intel.com>
>> Subject: [PATCH] app/testpmd: retain all original dev conf when config DCB
>>
>> From: Huisong Li <lihuisong@huawei.com>
>>
>> When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
>> rte_port->dev_conf. But some configurations, such as the link_speed, were not
>> saved if it were set before configuring DCB.
>
> "if they were" or "if it was"
>
>>
>> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
>> class")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>> ---
>> app/test-pmd/testpmd.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
>> eec4f1b81d..12a0db8796 100644
>> --- a/app/test-pmd/testpmd.c
>> +++ b/app/test-pmd/testpmd.c
>> @@ -3729,10 +3729,8 @@ init_port_dcb_config(portid_t pid,
>> }
>> rte_port = &ports[pid];
>>
>> - memset(&port_conf, 0, sizeof(struct rte_eth_conf));
>> -
>> - port_conf.rxmode = rte_port->dev_conf.rxmode;
>> - port_conf.txmode = rte_port->dev_conf.txmode;
>> + /* retain the original device configuration. */
>> + memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
>>
>> /*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.33.0
>
> Except the small issue in commit log,
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Thanks Xiaoyun,
V2 has been sent.
> .
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] app/testpmd: retain all original dev conf when config DCB
2021-10-09 8:41 [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB Min Hu (Connor)
2021-10-11 6:49 ` Li, Xiaoyun
@ 2021-10-11 9:12 ` Min Hu (Connor)
2021-10-11 15:27 ` Ferruh Yigit
1 sibling, 1 reply; 5+ messages in thread
From: Min Hu (Connor) @ 2021-10-11 9:12 UTC (permalink / raw)
To: dev; +Cc: ferruh.yigit, xiaoyun.li
From: Huisong Li <lihuisong@huawei.com>
When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
rte_port->dev_conf. But some configurations, such as the link_speed, were
not saved if they were set before configuring DCB.
Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org
Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
v2:
* fixed commit log.
---
app/test-pmd/testpmd.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index eec4f1b81d..12a0db8796 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -3729,10 +3729,8 @@ init_port_dcb_config(portid_t pid,
}
rte_port = &ports[pid];
- memset(&port_conf, 0, sizeof(struct rte_eth_conf));
-
- port_conf.rxmode = rte_port->dev_conf.rxmode;
- port_conf.txmode = rte_port->dev_conf.txmode;
+ /* retain the original device configuration. */
+ memcpy(&port_conf, &rte_port->dev_conf, sizeof(struct rte_eth_conf));
/*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.33.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v2] app/testpmd: retain all original dev conf when config DCB
2021-10-11 9:12 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
@ 2021-10-11 15:27 ` Ferruh Yigit
0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2021-10-11 15:27 UTC (permalink / raw)
To: Min Hu (Connor), dev; +Cc: xiaoyun.li
On 10/11/2021 10:12 AM, Min Hu (Connor) wrote:
> From: Huisong Li <lihuisong@huawei.com>
>
> When configuring DCB, testpmd retains the rx_mode/tx_mode configuration in
> rte_port->dev_conf. But some configurations, such as the link_speed, were
> not saved if they were set before configuring DCB.
>
> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
> Cc: stable@dpdk.org
>
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> Acked-by: Xiaoyun Li <xiaoyun.li@intel.com>
Applied to dpdk-next-net/main, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-10-11 15:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 8:41 [dpdk-dev] [PATCH] app/testpmd: retain all original dev conf when config DCB Min Hu (Connor)
2021-10-11 6:49 ` Li, Xiaoyun
2021-10-11 9:15 ` Min Hu (Connor)
2021-10-11 9:12 ` [dpdk-dev] [PATCH v2] " Min Hu (Connor)
2021-10-11 15:27 ` 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).