From patchwork Tue Apr 11 19:20:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 9675999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCE8C60231 for ; Tue, 11 Apr 2017 19:21:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2CC2859E for ; Tue, 11 Apr 2017 19:21:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1EAA285A1; Tue, 11 Apr 2017 19:21:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F5E42859E for ; Tue, 11 Apr 2017 19:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753278AbdDKTVK (ORCPT ); Tue, 11 Apr 2017 15:21:10 -0400 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33021 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753227AbdDKTVJ (ORCPT ); Tue, 11 Apr 2017 15:21:09 -0400 Received: by mail-lf0-f65.google.com with SMTP id r36so818383lfi.0; Tue, 11 Apr 2017 12:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B1EGUtQfiokVWMUYfwGR04N91U5puAlmNVsSRybtH8Y=; b=GrpqYZgsTYUKtKp73yhgb7zOl0Qzc4UohdayuAQ66MzrHLAMmr7nF+cbWE+IuWuYA5 sanWtweTnGK1nrQRVeDMNXefKPA2lNoPlmkAKkXwIFJefSgL4cwbKGmY8A+ejl6+XrW2 4b9XcfjIbSBEu2R57gUqaNqJV2n2qjNohdlp/C9Jw/T2r4ExbtKBNOvGcsBh59TAahf4 9M7cEU4Eysh0Hlzfp+Mtlbe5hCxkKw4nxYKIKglPB+1LXEWlpXG5808f4eJMTIE+j1aZ MvMtft7nsxL9IjwWJDYvtVdte3B99J3Kzv54V9tIBFGJh7HwE3XTWSNFvYN+VGaumFEZ uEcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B1EGUtQfiokVWMUYfwGR04N91U5puAlmNVsSRybtH8Y=; b=TCEvmcMkmVGdxmK9hDNxRzuI1GPgW/02vB2DuklVpO/o2ir8WS/8vgP88ofbSkBnUi EfwMmmw/qk0+upHiVbqG6pP0KDS5tPUB9Vn71QNTl3PUhHDNPmbL+BHlMubyft/Oumgz ABUqa6Nngjcy/PCtWM5agekSPhQwsu+u0pCUCtKbrPkJIGmG/GsbkI8k1k6AQXgBRC1f fP2XGWrtsxyomPsnEungDNXo0XuxGVSS4Mda6wQ6untKTPV1magEtx+Wm9JbHsDoNPSr H8/w3vupg4+pfKgs5TxiF1JqKvB+AZpyaNjzH7mDDkwn/vIjH+VUVM4tDDnGf5DGhitR Cm/w== X-Gm-Message-State: AFeK/H3D/gSGoWgUhq/Vt5Khtgq1+kQyOOs0k5u47KX38uElUKcRnfNks2TTvYffgeiwcA== X-Received: by 10.25.43.205 with SMTP id r196mr17698383lfr.116.1491938466823; Tue, 11 Apr 2017 12:21:06 -0700 (PDT) Received: from vudentzs-t460s.pp.htv.fi (89-27-7-11.bb.dnainternet.fi. [89.27.7.11]) by smtp.gmail.com with ESMTPSA id c1sm3604962lfc.55.2017.04.11.12.21.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 12:21:06 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Cc: patrik.flykt@linux.intel.com, aar@pengutronix.de, jukka.rissanen@linux.intel.com, linux-wpan@vger.kernel.org Subject: [PATCH 2/6] Bluetooth: 6lowpan: Don't drop packets when run out of credits Date: Tue, 11 Apr 2017 22:20:59 +0300 Message-Id: <20170411192103.3209-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170411192103.3209-1-luiz.dentz@gmail.com> References: <20170411192103.3209-1-luiz.dentz@gmail.com> Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Luiz Augusto von Dentz Since l2cap_chan_send will now queue the packets there is no point in checking the credits anymore. Signed-off-by: Luiz Augusto von Dentz Acked-by: Jukka Rissanen --- net/bluetooth/6lowpan.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index 5b91e85..22bd936 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c @@ -478,15 +478,8 @@ static int send_pkt(struct l2cap_chan *chan, struct sk_buff *skb, return 0; } - if (!err) - err = (!chan->tx_credits ? -EAGAIN : 0); - - if (err < 0) { - if (err == -EAGAIN) - netdev->stats.tx_dropped++; - else - netdev->stats.tx_errors++; - } + if (err < 0) + netdev->stats.tx_errors++; return err; }