Skip to contentSkip to conversation

testpmd: call cleanup on exit

PATCH Superseded Stephen Hemminger 4 participants 9 messages Jan 7, 2020 – Jan 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)
app/test-pmd/testpmd.c +1 -0
index b3746822366f..a94ad19c8f5a 100644
@@ -3570,5 +3570,6 @@ main(int argc, char** argv)
 			return 1;
 	}
 
+	rte_eal_cleanup();
 	return 0;
 }
Signature · 1 line
2.20.1
#1 lore raw
Quoted 17 lines · Stephen Hemminger

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
 app/test-pmd/testpmd.c | 1 +
 1 file changed, 1 insertion(+)
app/test-pmd/testpmd.c +0 -0
index b3746822366f..a94ad19c8f5a 100644

app/test-pmd/testpmd.c main(int argc, char** argv) · line 3574

Quoted 5 lines
app/test-pmd/testpmd.c +1 -0
@@ -3570,5 +3570,6 @@ main(int argc, char** argv)
                        return 1;
        }
 
+       rte_eal_cleanup();
        return 0;

# How about changing to "return rte_eal_cleanup()" to provide OS the correct stats?
# IMO, we need the same in other applications main() and signal handler too.

Quoted 4 lines
app/test-pmd/testpmd.c +0 -1
 }
--

2.20.1

#2 lore raw

PATCH v2 1/1 testpmd: call cleanup on exit

In reply to Stephen Hemminger

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

 app/test-pmd/testpmd.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
app/test-pmd/testpmd.c +6 -1
index b3746822366f..2eec8afda1ec 100644
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
Signature · 1 line
2.20.1
#3 lore raw

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Regards,

Bernard.

#4 lore raw
Quoted 43 lines · Bernard

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Quoted 4 lines

Regards,

Bernard.

Not sure if it needs to be backported. It depends on the definition of a fix. The original definition of stable was fixes only. Linux has moved on to fixes and backports of missing features like this; but DPDK has mostly stuck to the original definition of stable.

#5 lore raw
Quoted 48 lines · Stephen Hemminger
Quoted 45 lines · Bernard

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Regards,

Quoted 9 lines
Quoted 2 lines

Bernard.

Not sure if it needs to be backported. It depends on the definition of a fix. The original definition of stable was fixes only. Linux has moved on to fixes and backports of missing features like this; but DPDK has mostly stuck to the original definition of stable.

I also tend to think this a fix more then a feature, and although it is a minor fix it is good to get it to reduce the change of the conflict on other stuff in LTS. I will add fix/stable tag while merging.

Acked-by Bernard Iremonger Applied
#6 lore raw
Quoted 59 lines · Ferruh Yigit
Quoted 48 lines · Stephen Hemminger
Quoted 45 lines · Bernard

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Regards,

Quoted 9 lines
Quoted 2 lines

Bernard.

Not sure if it needs to be backported. It depends on the definition of a fix. The original definition of stable was fixes only. Linux has moved on to fixes and backports of missing features like this; but DPDK has mostly stuck to the original definition of stable.

Quoted 4 lines

I also tend to think this a fix more then a feature, and although it is a minor fix it is good to get it to reduce the change of the conflict on other stuff in LTS. I will add fix/stable tag while merging.

Fixes af75078fece3 ("first public release")

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

#7 lore raw
Quoted 65 lines · On Thu, 9 Jan 2020 11:31:30 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 59 lines · Ferruh Yigit
Quoted 48 lines · Stephen Hemminger
Quoted 45 lines · Bernard

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Regards,

Quoted 9 lines
Quoted 2 lines

Bernard.

Not sure if it needs to be backported. It depends on the definition of a fix. The original definition of stable was fixes only. Linux has moved on to fixes and backports of missing features like this; but DPDK has mostly stuck to the original definition of stable.

Quoted 4 lines

I also tend to think this a fix more then a feature, and although it is a minor fix it is good to get it to reduce the change of the conflict on other stuff in LTS. I will add fix/stable tag while merging.

Quoted 6 lines
Fixes af75078fece3 ("first public release")

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

Thanks, my concern about adding it to stable is that it might expose bugs in other places (like drivers). That is good for current release but not something stable users want to see.

#8 lore raw
Quoted 71 lines · Stephen Hemminger
Quoted 68 lines · On Thu, 9 Jan 2020 11:31:30 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 59 lines · Ferruh Yigit
Quoted 48 lines · Stephen Hemminger
Quoted 45 lines · Bernard

Hi Stephen,

Quoted 37 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, January 7, 2020 7:00 PM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>
Subject: [dpdk-dev] [PATCH v2] testpmd: call cleanup on exit

The rte_eal_cleanup code is not exercised by testpmd which is the most used DPDK test tool. Add a call at end of program.

This helps exercise free and close paths which can be checked with tools like valgrind.

---
v2 - report errors

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

b3746822366f..2eec8afda1ec 100644

app/test-pmd/testpmd.c +6 -2
@@ -3570,5 +3570,10 @@ main(int argc, char** argv)
 			return 1;
 	}
 
-	return 0;
+	ret = rte_eal_cleanup();
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			 "EAL cleanup failed: %s\n", strerror(-ret));
+
+	return EXIT_SUCCESS;
 }
--
Quoted 1 line

2.20.1

This looks like a fix to me and is probably worth backporting, it should probably have a fixes line.

Regards,

Quoted 9 lines
Quoted 2 lines

Bernard.

Not sure if it needs to be backported. It depends on the definition of a fix. The original definition of stable was fixes only. Linux has moved on to fixes and backports of missing features like this; but DPDK has mostly stuck to the original definition of stable.

Quoted 4 lines

I also tend to think this a fix more then a feature, and although it is a minor fix it is good to get it to reduce the change of the conflict on other stuff in LTS. I will add fix/stable tag while merging.

Fixes af75078fece3 ("first public release")
Quoted 8 lines
Quoted 3 lines

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

Thanks, my concern about adding it to stable is that it might expose bugs in other places (like drivers). That is good for current release but not something stable users want to see.

Overall I agree, but the 'rte_eal_cleanup()' is pretty simple as of now, only doing a few simple cleanups not full cleanup, that is why I believe it can be OK to add it.