summaryrefslogtreecommitdiffstats
path: root/net/strparser
diff options
context:
space:
mode:
authorVakul Garg <vakul.garg@nxp.com>2018-06-20 17:59:49 -0400
committerDavid S. Miller <davem@davemloft.net>2018-06-20 20:54:05 -0400
commit456488cd952c23d451b0bdc5b5226b0707db80f7 (patch)
tree99832c64a319d35a3b9475539654f1e1df03464b /net/strparser
parent73f9c33beb9e85850a11a1597b35a13650352509 (diff)
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: Vakul Garg <vakul.garg@nxp.com> Acked-by: Dave Watson <davejwatson@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/strparser')
-rw-r--r--net/strparser/strparser.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 1a9695183599..373836615c57 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -392,7 +392,7 @@ static int strp_read_sock(struct strparser *strp)
392/* Lower sock lock held */ 392/* Lower sock lock held */
393void strp_data_ready(struct strparser *strp) 393void strp_data_ready(struct strparser *strp)
394{ 394{
395 if (unlikely(strp->stopped)) 395 if (unlikely(strp->stopped) || strp->paused)
396 return; 396 return;
397 397
398 /* This check is needed to synchronize with do_strp_work. 398 /* This check is needed to synchronize with do_strp_work.
@@ -407,9 +407,6 @@ void strp_data_ready(struct strparser *strp)
407 return; 407 return;
408 } 408 }
409 409
410 if (strp->paused)
411 return;
412
413 if (strp->need_bytes) { 410 if (strp->need_bytes) {
414 if (strp_peek_len(strp) < strp->need_bytes) 411 if (strp_peek_len(strp) < strp->need_bytes)
415 return; 412 return;