Thread (36 messages) 36 messages, 5 authors, 2016-01-27

Re: [PATCH v4 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in l3fwd

From: Wang, Zhihong <hidden>
Date: 2015-12-31 02:21:00

-----Original Message-----
From: Stephen Hemminger [mailto:stephen@networkplumber.org]
Sent: Thursday, December 31, 2015 10:09 AM
To: Wang, Zhihong <redacted>
Cc: Ananyev, Konstantin <redacted>; dev@dpdk.org; Qiu,
Michael [off-list ref]
Subject: Re: [PATCH v4 3/3] examples/l3fwd: Handle SIGINT and SIGTERM in
l3fwd

On Thu, 31 Dec 2015 01:44:20 +0000
"Wang, Zhihong" [off-list ref] wrote:
quoted
quoted
quoted
+#define PORT_IDLE 0
+#define PORT_INIT 1
+#define PORT_WORK 2
+#define PORT_STOP 3
+#define PORT_QUIT 4
Seems ok, but over-complicated.
I think all you need is just IDLE, INIT, QUIT.
Yes for l2/l3fwd 3 states are enough.
I implement a full state machine so it can also serve as an example on how to
do this in other cases, like where stop might be called before or during init.

These are examples, it is better to have as little code as necessary to get the job
done. That makes the example clearer.  Adding extra unnecessary complexity
just makes it harder to understand.

Thanks for the suggestions!
I'll send the v5 combining your comments and Konstantin's together to make it simpler.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help