Thread (11 messages) flat view 11 messages, 3 authors, 2022-08-07

Re: rose timer t error displayed in /proc/net/rose

From: Bernard f6bvp <hidden>
Date: 2022-08-01 10:44:06
Also in: linux-hams

I used concurrently ~/ax25tools/user_call/rose_call in order to perform 
a connect request to my local node :

./rose_call rose0 f6bvp f6bvp-4 2080175524

Looking again at /proc/net/rose it seems that rose->timer is not stopped 
immediately when 0 value is reached and counts down result to an 
underflow (long -1 value).

After a few more clock tics rose->timer is reinitialized to 180 and rose 
state st changes from 1 to 2.

dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode
2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  1  0  0  0   6 200 180 180   5   0/000     0     0 77873
2080175524 F6BVP-4   2080175524 F6BVP-0   rose0 002 00001  2  0  0  0 147 200 180 180   5   0/000     0     0 76283
*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195
*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194
*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456
bernard@ubuntu-f6bvp:~$ cat /proc/net/rose
dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode
2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  1  0  0  0 73786976294838200 200 180 180   5   0/000     0     0 77873
2080175524 F6BVP-4   2080175524 F6BVP-0   rose0 002 00001  2  0  0  0 135 200 180 180   5   0/000     0     0 76283
*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195
*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194
*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456
bernard@ubuntu-f6bvp:~$ cat /proc/net/rose
dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode
2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  1  0  0  0 73786976294838195 200 180 180   5   0/000     0     0 77873
2080175524 F6BVP-4   2080175524 F6BVP-0   rose0 002 00001  2  0  0  0 131 200 180 180   5   0/000     0     0 76283
*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195
*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194
*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456
bernard@ubuntu-f6bvp:~$ cat /proc/net/rose
dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode
2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  2  0  0  0 178 200 180 180   5   0/000     0     0 77873
2080175524 F6BVP-4   2080175524 F6BVP-0   rose0 002 00001  2  0  0  0 129 200 180 180   5   0/000     0     0 76283
*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195
*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194
*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456

At the end of state st 2 count down rose->timer is correctly stopped 
while displaying 0

and rose client applications time out.

dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode

2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  2  0  0  0   2 200 180 180   5   0/000     0     0 77873

*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195

*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194

*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456

bernard@ubuntu-f6bvp:~$ cat /proc/net/rose

dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode

2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  2  0  0  0   1 200 180 180   5   0/000     0     0 77873

*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195

*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194

*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456

bernard@ubuntu-f6bvp:~$ cat /proc/net/rose

dest_addr  dest_call src_addr   src_call  dev   lci neigh st vs vr va   t  t1  t2  t3  hb    idle Snd-Q Rcv-Q inode

2080175524 WP-0      2080175524 NODE-0    rose0 001 00001  2  0  0  0   0 200 180 180   5   0/000     0     0 77873

*          *         2080175524 ROUTE-0   rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35195

*          *         2080175524 F6BVP-15  rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 35194

*          *         2080175524 WP-0      rose0 000 00000  0  0  0  0   0 200 180 180   5   0/000     0     0 36456


Le 01/08/2022 à 02:39, Francois Romieu a écrit :
quoted hunk ↗ jump to hunk
Bernard f6bvp [off-list ref] :
quoted
Rose proc timer t error

Timer t is decremented one by one during normal operations.

When decreasing from 1 to 0 it displays a very large number until next clock
tic as demonstrated below.

t1, t2 and t3 are correctly handled.
"t" is ax25_display_timer(&rose->timer) / HZ whereas "tX" are rose->tX / HZ.

ax25_display_timer() does not like jiffies > timer->expires (and it should
probably return plain seconds btw).

You may try the hack below.
diff --git a/net/ax25/ax25_timer.c b/net/ax25/ax25_timer.c
index 85865ebfdfa2..b77433fff0c9 100644
--- a/net/ax25/ax25_timer.c
+++ b/net/ax25/ax25_timer.c
@@ -108,10 +108,9 @@ int ax25_t1timer_running(ax25_cb *ax25)
  
  unsigned long ax25_display_timer(struct timer_list *timer)
  {
-	if (!timer_pending(timer))
-		return 0;
+	long delta = timer->expires - jiffies;
  
-	return timer->expires - jiffies;
+	return jiffies_delta_to_clock_t(delta) * HZ;
  }
  
  EXPORT_SYMBOL(ax25_display_timer);
-- 
73 de Bernard f6bvp / ai7bg

http://radiotelescope-lavillette.fr/au-jour-le-jour/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help