From: Tom Herbert <tom@herbertland.com>
To: <davem@davemloft.net>, <netdev@vger.kernel.org>
Cc: <kernel-team@fb.com>
Subject: [PATCH net-next 1/2] strparser: Queue work when being unpaused
Date: Tue, 23 Aug 2016 11:55:30 -0700 [thread overview]
Message-ID: <1471978531-3231140-2-git-send-email-tom@herbertland.com> (raw)
In-Reply-To: <1471978531-3231140-1-git-send-email-tom@herbertland.com>
When the upper layer unpauses a stream parser connection we need to
queue rx_work to make sure no events are missed.
Signed-off-by: Tom Herbert <tom@herbertland.com>
---
include/net/strparser.h | 5 +----
net/strparser/strparser.c | 11 +++++++++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/include/net/strparser.h b/include/net/strparser.h
index fdb3d67..91fa0b9 100644
--- a/include/net/strparser.h
+++ b/include/net/strparser.h
@@ -88,10 +88,7 @@ static inline void strp_pause(struct strparser *strp)
}
/* May be called without holding lock for attached socket */
-static inline void strp_unpause(struct strparser *strp)
-{
- strp->rx_paused = 0;
-}
+void strp_unpause(struct strparser *strp);
static inline void save_strp_stats(struct strparser *strp,
struct strp_aggr_stats *agg_stats)
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index 68334b5..4ecfc10 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -445,6 +445,17 @@ int strp_init(struct strparser *strp, struct sock *csk,
}
EXPORT_SYMBOL_GPL(strp_init);
+void strp_unpause(struct strparser *strp)
+{
+ strp->rx_paused = 0;
+
+ /* Sync setting rx_paused with RX work */
+ smp_mb();
+
+ queue_work(strp_wq, &strp->rx_work);
+}
+EXPORT_SYMBOL_GPL(strp_unpause);
+
/* strp must already be stopped so that strp_tcp_recv will no longer be called.
* Note that strp_done is not called with the lower socket held.
*/
--
2.8.0.rc2
next prev parent reply other threads:[~2016-08-23 19:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-23 18:55 [PATCH net-next 0/2] strp: Minor fixes to strparser and kcm Tom Herbert
2016-08-23 18:55 ` Tom Herbert [this message]
2016-08-23 18:55 ` [PATCH net-next 2/2] kcm: Fix locking issue Tom Herbert
2016-08-23 23:23 ` [PATCH net-next 0/2] strp: Minor fixes to strparser and kcm David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1471978531-3231140-2-git-send-email-tom@herbertland.com \
--to=tom@herbertland.com \
--cc=davem@davemloft.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).