Skip to contentSkip to conversation

app/testpmd: retain all original dev conf when config DCB

PATCH Superseded Min Hu (Connor) 3 participants 5 messages Oct 9, 2021 – Oct 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: retain all original dev conf when config DCB

From: Huisong Li <[email protected]>

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")
---
 app/test-pmd/testpmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
app/test-pmd/testpmd.c +2 -4
index eec4f1b81d..12a0db8796 100644
@@ -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);
Signature · 1 line
2.33.0
Acked-by on v1 1/1
#1 lore raw

Hi

Quoted 8 lines

-----Original Message-----
From: Min Hu (Connor) <[email protected]>
Sent: Saturday, October 9, 2021 16:42
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; [email protected]; Li, Xiaoyun <[email protected]>
Subject: [PATCH] app/testpmd: retain all original dev conf when config DCB

Quoted 5 lines

From: Huisong Li <[email protected]>

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"

Quoted 28 lines
Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic

class")
Cc: [email protected]

---
 app/test-pmd/testpmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

eec4f1b81d..12a0db8796 100644

app/test-pmd/testpmd.c +2 -4
@@ -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,
Quoted 3 lines

pfc_en);
--
2.33.0

Except the small issue in commit log,

#2 lore raw
Quoted 44 lines · Xiaoyun

Hi

Quoted 8 lines

-----Original Message-----
From: Min Hu (Connor) <[email protected]>
Sent: Saturday, October 9, 2021 16:42
To: [email protected]
Cc: Yigit, Ferruh <[email protected]>; [email protected]; Li, Xiaoyun <[email protected]>
Subject: [PATCH] app/testpmd: retain all original dev conf when config DCB

Quoted 5 lines

From: Huisong Li <[email protected]>

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"

Quoted 26 lines
Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic

class")
Cc: [email protected]

---
  app/test-pmd/testpmd.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

eec4f1b81d..12a0db8796 100644

app/test-pmd/testpmd.c +2 -4
@@ -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));
 
Quoted 8 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);
--
2.33.0

Except the small issue in commit log,

Thanks Xiaoyun,
V2 has been sent.

Quoted 2 lines

.

#3 lore raw

PATCH v2 1/1 app/testpmd: retain all original dev conf when config DCB

In reply to Min Hu (Connor)

From: Huisong Li <[email protected]>

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")

---
v2:
* fixed commit log.

---
 app/test-pmd/testpmd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
app/test-pmd/testpmd.c +2 -4
index eec4f1b81d..12a0db8796 100644
@@ -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);
Signature · 1 line
2.33.0
Applied
#4 lore raw
Quoted 6 lines · Min Hu (Connor)

From: Huisong Li <[email protected]>

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.

Quoted 6 lines
Fixes 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")

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