Commit 9f271d91 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

net/rtpc: fix non-rt signal overflow

rtdm_nrtsig_pend() is based on ipipe_post_root_work(), which keeps a
copy of every request descriptor internally until it is consumed by
the secondary mode handler. Triggering rtdm_nrtsig_pend() every time a
packet is relayed from the stack to the tap device may cause such
request buffer to overflow under pressure.

To address this issue, trigger the non-rt signal only when the call
completion queue transitions from empty to non-empty state.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 5d33c049
......@@ -146,12 +146,15 @@ static inline struct rt_proc_call *rtpc_dequeue_pending_call(void)
static inline void rtpc_queue_processed_call(struct rt_proc_call *call)
{
rtdm_lockctx_t context;
bool trigger;
rtdm_lock_get_irqsave(&processed_calls_lock, context);
trigger = list_empty(&processed_calls);
list_add_tail(&call->list_entry, &processed_calls);
rtdm_lock_put_irqrestore(&processed_calls_lock, context);
rtdm_nrtsig_pend(&rtpc_nrt_signal);
if (trigger)
rtdm_nrtsig_pend(&rtpc_nrt_signal);
}
static inline struct rt_proc_call *rtpc_dequeue_processed_call(void)
......
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