diff options
author | Rémi Denis-Courmont <remi.denis-courmont@nokia.com> | 2010-09-29 18:33:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-30 20:57:30 -0400 |
commit | e1a5964f0c32a75b17360cfc565d25aaedbff747 (patch) | |
tree | 1929d1aa0b94147b017ae6a4ce6d60abe16c0946 /net/phonet | |
parent | 1020660189bb72ae25fd68733ee473d29b8604b5 (diff) |
Phonet: restore flow control credits when sending fails
This patch restores the below flow control patch submitted by Rémi
Denis-Courmont, which accidentaly got lost due to Pipe controller patch
on Phonet.
commit 1a98214feef2221cd7c24b17cd688a5a9d85b2ea
Author: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Date: Mon Aug 30 12:57:03 2010 +0000
Phonet: restore flow control credits when sending fails
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kumar Sanghvi <kumar.sanghvi@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/phonet')
-rw-r--r-- | net/phonet/pep.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 7bf23cf36b02..552fb665645f 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -1288,6 +1288,7 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb) | |||
1288 | { | 1288 | { |
1289 | struct pep_sock *pn = pep_sk(sk); | 1289 | struct pep_sock *pn = pep_sk(sk); |
1290 | struct pnpipehdr *ph; | 1290 | struct pnpipehdr *ph; |
1291 | int err; | ||
1291 | #ifdef CONFIG_PHONET_PIPECTRLR | 1292 | #ifdef CONFIG_PHONET_PIPECTRLR |
1292 | struct sockaddr_pn spn = { | 1293 | struct sockaddr_pn spn = { |
1293 | .spn_family = AF_PHONET, | 1294 | .spn_family = AF_PHONET, |
@@ -1314,10 +1315,15 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb) | |||
1314 | ph->message_id = PNS_PIPE_DATA; | 1315 | ph->message_id = PNS_PIPE_DATA; |
1315 | ph->pipe_handle = pn->pipe_handle; | 1316 | ph->pipe_handle = pn->pipe_handle; |
1316 | #ifdef CONFIG_PHONET_PIPECTRLR | 1317 | #ifdef CONFIG_PHONET_PIPECTRLR |
1317 | return pn_skb_send(sk, skb, &spn); | 1318 | err = pn_skb_send(sk, skb, &spn); |
1318 | #else | 1319 | #else |
1319 | return pn_skb_send(sk, skb, &pipe_srv); | 1320 | err = pn_skb_send(sk, skb, &pipe_srv); |
1320 | #endif | 1321 | #endif |
1322 | |||
1323 | if (err && pn_flow_safe(pn->tx_fc)) | ||
1324 | atomic_inc(&pn->tx_credits); | ||
1325 | return err; | ||
1326 | |||
1321 | } | 1327 | } |
1322 | 1328 | ||
1323 | static int pep_sendmsg(struct kiocb *iocb, struct sock *sk, | 1329 | static int pep_sendmsg(struct kiocb *iocb, struct sock *sk, |