提交 456488cd 编写于 作者: V Vakul Garg 提交者: David S. Miller

strparser: Don't schedule in workqueue in paused state

In function strp_data_ready(), it is useless to call queue_work if
the state of strparser is already paused. The state checking should
be done before calling queue_work. The change reduces the context
switches and improves the ktls-rx throughput by approx 20% (measured
on cortex-a53 based platform).
Signed-off-by: NVakul Garg <vakul.garg@nxp.com>
Acked-by: NDave Watson <davejwatson@fb.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 73f9c33b
......@@ -392,7 +392,7 @@ static int strp_read_sock(struct strparser *strp)
/* Lower sock lock held */
void strp_data_ready(struct strparser *strp)
{
if (unlikely(strp->stopped))
if (unlikely(strp->stopped) || strp->paused)
return;
/* This check is needed to synchronize with do_strp_work.
......@@ -407,9 +407,6 @@ void strp_data_ready(struct strparser *strp)
return;
}
if (strp->paused)
return;
if (strp->need_bytes) {
if (strp_peek_len(strp) < strp->need_bytes)
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册