On Tue, Oct 18, 2016 at 08:59:17AM +0200, Miroslav Lichvar wrote:
> Would it make sense to print the message only when the status has
> changed?
I'd rather leave them in. These are the events that the kernel is
giving us, and I want to see what rtnl is doing, especially since I
don't completely t
The clock module will want to know the interface indexes, in order to
implement link monitoring. However, the clock does not open any sockets
directly. This helper function lets us keep the clock module free of
socket level code.
Signed-off-by: Richard Cochran
---
sk.c | 10 ++
sk.h |
Changes in V4:
~~
- Tolerate failure when opening the rtnl socket. This is especially
important in order to run the test suite in the clknetsim
environment.
Changes in V3:
~~
- Free rtnl's malloc'ed buffer on the exit path.
Changes in V2:
~~
- Add more exp
Signed-off-by: Richard Cochran
---
clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clock.c b/clock.c
index 8ca749e..55532b8 100644
--- a/clock.c
+++ b/clock.c
@@ -314,7 +314,7 @@ static void clock_freq_est_reset(struct clock *c)
c->fest.origin1 = tmv_zero();
This patch adds a source module that implements RT netlink sockets
for the purpose of link monitoring. Unfortunately the netlink API
offers no possibility for per-port notification. Instead it
forces us to use a de-multiplexing pattern.
Signed-off-by: Richard Cochran
---
makefile | 2 +-
rtn
No functional changes.
Signed-off-by: Richard Cochran
---
clock.c | 14 --
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/clock.c b/clock.c
index 55532b8..3b42109 100644
--- a/clock.c
+++ b/clock.c
@@ -768,20 +768,22 @@ static int clock_add_port(struct clock *c, int ph
Signed-off-by: Richard Cochran
---
port.c | 13 +
port.h | 14 ++
2 files changed, 27 insertions(+)
diff --git a/port.c b/port.c
index 5868983..a1ad6f6 100644
--- a/port.c
+++ b/port.c
@@ -117,6 +117,7 @@ struct port {
int path_trace_enabled;
We use a hash table to remember the mapping. Since our existing hash
table is a simply string hash, we convert the integer index into a decimal
string. Although hashing integers in this way is sub-optimal, the table
will not be used in a performance critical path.
Signed-off-by: Richard Cochran
Poll for link up/down events. When a link goes down, the port becomes
faulty until the link goes up again. We keep the fault timer from the
existing fault detection, but a downed link prevents clear the fault.
The new state machine is depicted in this ascii art diagram:
++