diff mbox

[2/6] Bluetooth: 6lowpan: Don't drop packets when run out of credits

Message ID 20170411192103.3209-2-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Luiz Augusto von Dentz April 11, 2017, 7:20 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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 <luiz.von.dentz@intel.com>
---
 net/bluetooth/6lowpan.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Jukka Rissanen April 12, 2017, 1:56 p.m. UTC | #1
Hi Luiz,

On Tue, 2017-04-11 at 22:20 +0300, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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 <luiz.von.dentz@intel.com>
> ---
>  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;
>  }


Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>


Cheers,
Jukka

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }