]> Git Repo - linux.git/commitdiff
strparser: Don't schedule in workqueue in paused state
authorVakul Garg <[email protected]>
Wed, 20 Jun 2018 21:59:49 +0000 (03:29 +0530)
committerDavid S. Miller <[email protected]>
Thu, 21 Jun 2018 00:54:05 +0000 (09:54 +0900)
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 <[email protected]>
Acked-by: Dave Watson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/strparser/strparser.c

index 1a96951835999091c81ba451700f0a74565d9c59..373836615c5773de94e1bb47ad0676df886521e2 100644 (file)
@@ -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;
This page took 0.054714 seconds and 4 git commands to generate.