netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Phonet: restore flow control credits when sending fails
@ 2010-08-30 22:57 Rémi Denis-Courmont
  2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rémi Denis-Courmont @ 2010-08-30 22:57 UTC (permalink / raw)
  To: netdev

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
 net/phonet/pep.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index b2a3ae6..5034f0f 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -834,6 +834,7 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
 {
 	struct pep_sock *pn = pep_sk(sk);
 	struct pnpipehdr *ph;
+	int err;
 
 	if (pn_flow_safe(pn->tx_fc) &&
 	    !atomic_add_unless(&pn->tx_credits, -1, 0)) {
@@ -852,7 +853,10 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
 		ph->message_id = PNS_PIPE_DATA;
 	ph->pipe_handle = pn->pipe_handle;
 
-	return pn_skb_send(sk, skb, &pipe_srv);
+	err = pn_skb_send(sk, skb, &pipe_srv);
+	if (err && pn_flow_safe(pn->tx_fc))
+		atomic_inc(&pn->tx_credits);
+	return err;
 }
 
 static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-31 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-30 22:57 [PATCH 1/3] Phonet: restore flow control credits when sending fails Rémi Denis-Courmont
2010-08-30 22:57 ` [PATCH 2/3] Phonet: correct sendmsg() error code from sock_alloc_send_skb() Rémi Denis-Courmont
2010-08-31 20:04   ` David Miller
2010-08-30 22:57 ` [PATCH 3/3] Phonet: do not set POLLOUT in case of send buffer overflow Rémi Denis-Courmont
2010-08-31 20:04   ` David Miller
2010-08-31 20:04 ` [PATCH 1/3] Phonet: restore flow control credits when sending fails David Miller

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).