All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth@vger.kernel.org
Cc: aar@pengutronix.de, linux-wpan@vger.kernel.org
Subject: Re: [PATCH 1/3] Bluetooth: 6lowpan: Remove unnecessary peer lookup
Date: Wed, 05 Apr 2017 15:23:12 +0300	[thread overview]
Message-ID: <1491394992.3437.6.camel@linux.intel.com> (raw)
In-Reply-To: <20170403144857.4661-1-luiz.dentz@gmail.com>

Hi Luiz,

On Mon, 2017-04-03 at 17:48 +0300, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> During chan_recv_cb there is already a peer lookup which can be
> passed
> to recv_pkt directly instead of the channel.
> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
>  net/bluetooth/6lowpan.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index b39da8d..2063e96 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -269,27 +269,20 @@ static int give_skb_to_upper(struct sk_buff
> *skb, struct net_device *dev)
>  }
>  
>  static int iphc_decompress(struct sk_buff *skb, struct net_device
> *netdev,
> -			   struct l2cap_chan *chan)
> +			   struct lowpan_peer *peer)
>  {
>  	const u8 *saddr;
>  	struct lowpan_btle_dev *dev;
> -	struct lowpan_peer *peer;
>  
>  	dev = lowpan_btle_dev(netdev);
>  
> -	rcu_read_lock();
> -	peer = __peer_lookup_chan(dev, chan);
> -	rcu_read_unlock();
> -	if (!peer)
> -		return -EINVAL;
> -
>  	saddr = peer->lladdr;
>  
>  	return lowpan_header_decompress(skb, netdev, netdev-
> >dev_addr, saddr);
>  }
>  
>  static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
> -		    struct l2cap_chan *chan)
> +		    struct lowpan_peer *peer)
>  {
>  	struct sk_buff *local_skb;
>  	int ret;
> @@ -342,7 +335,7 @@ static int recv_pkt(struct sk_buff *skb, struct
> net_device *dev,
>  
>  		local_skb->dev = dev;
>  
> -		ret = iphc_decompress(local_skb, dev, chan);
> +		ret = iphc_decompress(local_skb, dev, peer);
>  		if (ret < 0) {
>  			kfree_skb(local_skb);
>  			goto drop;
> @@ -388,7 +381,7 @@ static int chan_recv_cb(struct l2cap_chan *chan,
> struct sk_buff *skb)
>  	if (!dev || !dev->netdev)
>  		return -ENOENT;
>  
> -	err = recv_pkt(skb, dev->netdev, chan);
> +	err = recv_pkt(skb, dev->netdev, peer);
>  	if (err) {
>  		BT_DBG("recv pkt %d", err);
>  		err = -EAGAIN;


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


Cheers,
Jukka



  parent reply	other threads:[~2017-04-05 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 14:48 [PATCH 1/3] Bluetooth: 6lowpan: Remove unnecessary peer lookup Luiz Augusto von Dentz
2017-04-03 14:48 ` [PATCH 2/3] Bluetooth: 6lowpan: Print errors during recv_pkt Luiz Augusto von Dentz
2017-04-05 12:23   ` Jukka Rissanen
2017-04-03 14:48 ` [PATCH 3/3] Bluetooth: L2CAP: Don't return -EAGAIN if out of credits Luiz Augusto von Dentz
2017-04-05 12:24   ` Jukka Rissanen
2017-04-05 12:23 ` Jukka Rissanen [this message]
2017-04-05 13:47 ` [PATCH 1/3] Bluetooth: 6lowpan: Remove unnecessary peer lookup Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491394992.3437.6.camel@linux.intel.com \
    --to=jukka.rissanen@linux.intel.com \
    --cc=aar@pengutronix.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.