From patchwork Thu Sep 30 08:25:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kumar A Sanghvi X-Patchwork-Id: 66123 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DB7E0B7110 for ; Thu, 30 Sep 2010 18:26:35 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754731Ab0I3IZc (ORCPT ); Thu, 30 Sep 2010 04:25:32 -0400 Received: from eu1sys200aog108.obsmtp.com ([207.126.144.125]:49116 "EHLO eu1sys200aog108.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754696Ab0I3IZ0 (ORCPT ); Thu, 30 Sep 2010 04:25:26 -0400 Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob108.postini.com ([207.126.147.11]) with SMTP ID DSNKTKRJbzin/6pqUffE6d3uSxnk9yer2cc6@postini.com; Thu, 30 Sep 2010 08:25:25 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 07C8BB8; Thu, 30 Sep 2010 08:25:11 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id CC59BAFA; Thu, 30 Sep 2010 08:25:10 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id B62B9A8083; Thu, 30 Sep 2010 10:25:05 +0200 (CEST) Received: from localhost (10.201.54.119) by exdcvycastm022.EQ1STM.local (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.1.393.1; Thu, 30 Sep 2010 10:25:09 +0200 From: Kumar A Sanghvi To: , , , Cc: , Kumar Sanghvi , Linus Walleij Subject: [PATCH 4/4] Phonet: restore flow control credits when sending fails Date: Thu, 30 Sep 2010 13:55:05 +0530 Message-ID: <1285835105-20293-1-git-send-email-kumar.sanghvi@stericsson.com> X-Mailer: git-send-email 1.7.2.dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rémi Denis-Courmont 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 Date: Mon Aug 30 12:57:03 2010 +0000 Phonet: restore flow control credits when sending fails Signed-off-by: Rémi Denis-Courmont Signed-off-by: David S. Miller Signed-off-by: Kumar Sanghvi Acked-by: Linus Walleij --- 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 9746c6d..aa3d870 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c @@ -1289,6 +1289,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, @@ -1315,10 +1316,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,