Skip to content

Commit

Permalink
strparser: Queue work when being unpaused
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
tomratbert authored and davem330 committed Aug 23, 2016
1 parent 3c90a94 commit cff6a33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 1 addition & 4 deletions include/net/strparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions net/strparser/strparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit cff6a33

Please sign in to comment.