Skip to content

Commit

Permalink
Phonet: restore flow control credits when sending fails
Browse files Browse the repository at this point in the history
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 1a98214
	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>
  • Loading branch information
Rémi Denis-Courmont authored and David S. Miller committed Oct 1, 2010
1 parent 1020660 commit e1a5964
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/phonet/pep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,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;
#ifdef CONFIG_PHONET_PIPECTRLR
struct sockaddr_pn spn = {
.spn_family = AF_PHONET,
Expand All @@ -1314,10 +1315,15 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
ph->message_id = PNS_PIPE_DATA;
ph->pipe_handle = pn->pipe_handle;
#ifdef CONFIG_PHONET_PIPECTRLR
return pn_skb_send(sk, skb, &spn);
err = pn_skb_send(sk, skb, &spn);
#else
return pn_skb_send(sk, skb, &pipe_srv);
err = pn_skb_send(sk, skb, &pipe_srv);
#endif

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,
Expand Down

0 comments on commit e1a5964

Please sign in to comment.