* Re: [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state
2018-06-20 21:59 [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state Vakul Garg
@ 2018-06-20 17:32 ` Dave Watson
2018-06-21 0:54 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Dave Watson @ 2018-06-20 17:32 UTC (permalink / raw)
To: Vakul Garg
Cc: davem, doronrk, tom, john.fastabend, netdev, ebiggers,
linux-kernel
On 06/21/18 03:29 AM, Vakul Garg wrote:
> 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).
Nice find, works for me. Although current code isn't broken, just
slower, net-next would be fine.
Acked-by: Dave Watson <davejwatson@fb.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state
@ 2018-06-20 21:59 Vakul Garg
2018-06-20 17:32 ` Dave Watson
2018-06-21 0:54 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Vakul Garg @ 2018-06-20 21:59 UTC (permalink / raw)
To: davem
Cc: doronrk, tom, john.fastabend, davejwatson, netdev, ebiggers,
linux-kernel, Vakul Garg
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>
---
net/strparser/strparser.c | 5 +----
1 file changed, 1 insertion(+), 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)
/* 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;
--
2.13.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state
2018-06-20 21:59 [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state Vakul Garg
2018-06-20 17:32 ` Dave Watson
@ 2018-06-21 0:54 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-06-21 0:54 UTC (permalink / raw)
To: vakul.garg
Cc: doronrk, tom, john.fastabend, davejwatson, netdev, ebiggers,
linux-kernel
From: Vakul Garg <vakul.garg@nxp.com>
Date: Thu, 21 Jun 2018 03:29:49 +0530
> 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>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-21 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 21:59 [PATCH net][RESEND] strparser: Don't schedule in workqueue in paused state Vakul Garg
2018-06-20 17:32 ` Dave Watson
2018-06-21 0:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox