Commit 5d33c049 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

net/rtmac: vnic: 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 VNIC may cause such request
buffer to overflow under pressure.

To address this issue, trigger the non-rt signal only when the RX
queue transitions from empty to non-empty state as a result of
enqueuing the next skb.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent acafac31
......@@ -52,8 +52,8 @@ int rtmac_vnic_rx(struct rtskb *rtskb, u16 type)
rtskb->protocol = type;
rtskb_queue_tail(&rx_queue, rtskb);
rtdm_nrtsig_pend(&vnic_signal);
if (rtskb_queue_tail_check(&rx_queue, rtskb))
rtdm_nrtsig_pend(&vnic_signal);
return 0;
}
......
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