Commit 85a7069b authored by Maciej Lipinski's avatar Maciej Lipinski

[issue #201] moved update of age-time within mutex

The problem was as follows:
- there were two nodes with the same MAC address, sending traffic
  at high frequency
- the above triggers a lot of learning requests to rtud, as a result
- rtu HASH table representation in SHMEM is constantly udpated
- the aging process runs in background (separate process) and updates
  the time the entry was last used.

The update process could not the time of last access in the HASH
table in SHMEM because the learing process was constantly occupying
the SHMEM. The age out process was never aging out entry (even if this
one is within mutex) since the access time was never updated.

Thus, now both, update of last access time and age-out process are
both within mutex that allows the learning and aging-out processes
to both access SHMEM and HW.
parent 857d0646
......@@ -437,9 +437,8 @@ int rtu_fd_set_aging_time(unsigned long t)
*/
void rtu_fd_flush(void)
{
rtu_fd_age_update(); // Update filtering entries age
pthread_mutex_lock(&fd_mutex);
rtu_fd_age_update(); // Update filtering entries age
rtu_fd_age_out(); // Remove old entries
pthread_mutex_unlock(&fd_mutex);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment