All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
@ 2014-10-16  2:21 roy.qing.li
  2014-10-17 13:10 ` Jukka Rissanen
  2014-10-17 14:11 ` Marcel Holtmann
  0 siblings, 2 replies; 6+ messages in thread
From: roy.qing.li @ 2014-10-16  2:21 UTC (permalink / raw)
  To: linux-bluetooth, marcel, gustavo, johan.hedberg

From: Li RongQing <roy.qing.li@gmail.com>

netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
negative value

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
---
 net/bluetooth/6lowpan.c |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index c2e0d14..9b5c89b 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
 static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
 {
 	struct sk_buff *skb_cp;
-	int ret;
 
 	skb_cp = skb_copy(skb, GFP_ATOMIC);
 	if (!skb_cp)
 		return -ENOMEM;
 
-	ret = netif_rx(skb_cp);
-	if (ret < 0) {
-		BT_DBG("receive skb %d", ret);
-		return NET_RX_DROP;
-	}
-
-	return ret;
+	return netif_rx(skb_cp);
 }
 
 static int process_data(struct sk_buff *skb, struct net_device *netdev,
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
  2014-10-16  2:21 [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper roy.qing.li
@ 2014-10-17 13:10 ` Jukka Rissanen
  2014-10-17 14:08   ` Marcel Holtmann
  2014-10-17 15:01   ` Alexander Aring
  2014-10-17 14:11 ` Marcel Holtmann
  1 sibling, 2 replies; 6+ messages in thread
From: Jukka Rissanen @ 2014-10-17 13:10 UTC (permalink / raw)
  To: roy.qing.li; +Cc: linux-bluetooth, marcel, gustavo, johan.hedberg

Hi,

On to, 2014-10-16 at 10:21 +0800, roy.qing.li@gmail.com wrote:
> From: Li RongQing <roy.qing.li@gmail.com>
> 
> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> negative value
> 
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
>  net/bluetooth/6lowpan.c |    9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> index c2e0d14..9b5c89b 100644
> --- a/net/bluetooth/6lowpan.c
> +++ b/net/bluetooth/6lowpan.c
> @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
>  static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
>  {
>  	struct sk_buff *skb_cp;
> -	int ret;
>  
>  	skb_cp = skb_copy(skb, GFP_ATOMIC);
>  	if (!skb_cp)
>  		return -ENOMEM;
>  
> -	ret = netif_rx(skb_cp);
> -	if (ret < 0) {
> -		BT_DBG("receive skb %d", ret);
> -		return NET_RX_DROP;
> -	}
> -
> -	return ret;
> +	return netif_rx(skb_cp);
>  }
>  
>  static int process_data(struct sk_buff *skb, struct net_device *netdev,

Ack to this.

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


Cheers,
Jukka

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
  2014-10-17 13:10 ` Jukka Rissanen
@ 2014-10-17 14:08   ` Marcel Holtmann
  2014-10-17 14:20     ` Jukka Rissanen
  2014-10-17 15:01   ` Alexander Aring
  1 sibling, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2014-10-17 14:08 UTC (permalink / raw)
  To: Jukka Rissanen
  Cc: roy.qing.li, linux-bluetooth, Gustavo F. Padovan, Johan Hedberg

Hi Jukka,

>> From: Li RongQing <roy.qing.li@gmail.com>
>> 
>> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
>> negative value
>> 
>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
>> ---
>> net/bluetooth/6lowpan.c |    9 +--------
>> 1 file changed, 1 insertion(+), 8 deletions(-)
>> 
>> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
>> index c2e0d14..9b5c89b 100644
>> --- a/net/bluetooth/6lowpan.c
>> +++ b/net/bluetooth/6lowpan.c
>> @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
>> static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
>> {
>> 	struct sk_buff *skb_cp;
>> -	int ret;
>> 
>> 	skb_cp = skb_copy(skb, GFP_ATOMIC);
>> 	if (!skb_cp)
>> 		return -ENOMEM;
>> 
>> -	ret = netif_rx(skb_cp);
>> -	if (ret < 0) {
>> -		BT_DBG("receive skb %d", ret);
>> -		return NET_RX_DROP;
>> -	}
>> -
>> -	return ret;
>> +	return netif_rx(skb_cp);
>> }
>> 
>> static int process_data(struct sk_buff *skb, struct net_device *netdev,
> 
> Ack to this.
> 
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>

this should be acked-by or reviewed-by and not signed-off-by. The signed-off-by is only if you would send Roy's original patch on his behalf or you would be in the chain of sending patches along the maintainer trees.

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
  2014-10-16  2:21 [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper roy.qing.li
  2014-10-17 13:10 ` Jukka Rissanen
@ 2014-10-17 14:11 ` Marcel Holtmann
  1 sibling, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2014-10-17 14:11 UTC (permalink / raw)
  To: roy.qing.li; +Cc: linux-bluetooth, Gustavo F. Padovan, Johan Hedberg

Hi Roy,

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> negative value
> 
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> net/bluetooth/6lowpan.c |    9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
  2014-10-17 14:08   ` Marcel Holtmann
@ 2014-10-17 14:20     ` Jukka Rissanen
  0 siblings, 0 replies; 6+ messages in thread
From: Jukka Rissanen @ 2014-10-17 14:20 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: roy.qing.li, linux-bluetooth, Gustavo F. Padovan, Johan Hedberg

On pe, 2014-10-17 at 16:08 +0200, Marcel Holtmann wrote:
> Hi Jukka,
> 
> >> From: Li RongQing <roy.qing.li@gmail.com>
> >> 
> >> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> >> negative value
> >> 
> >> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> >> ---
> >> net/bluetooth/6lowpan.c |    9 +--------
> >> 1 file changed, 1 insertion(+), 8 deletions(-)
> >> 
> >> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> >> index c2e0d14..9b5c89b 100644
> >> --- a/net/bluetooth/6lowpan.c
> >> +++ b/net/bluetooth/6lowpan.c
> >> @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
> >> static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
> >> {
> >> 	struct sk_buff *skb_cp;
> >> -	int ret;
> >> 
> >> 	skb_cp = skb_copy(skb, GFP_ATOMIC);
> >> 	if (!skb_cp)
> >> 		return -ENOMEM;
> >> 
> >> -	ret = netif_rx(skb_cp);
> >> -	if (ret < 0) {
> >> -		BT_DBG("receive skb %d", ret);
> >> -		return NET_RX_DROP;
> >> -	}
> >> -
> >> -	return ret;
> >> +	return netif_rx(skb_cp);
> >> }
> >> 
> >> static int process_data(struct sk_buff *skb, struct net_device *netdev,
> > 
> > Ack to this.
> > 
> > Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> 
> this should be acked-by or reviewed-by and not signed-off-by. The signed-off-by is only if you would send Roy's original patch on his behalf or you would be in the chain of sending patches along the maintainer trees.

Do'h! Yep, I meant to say Acked-by (too many things going on same
time :)

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


> 
> Regards
> 
> Marcel
> 


Cheers,
Jukka

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
  2014-10-17 13:10 ` Jukka Rissanen
  2014-10-17 14:08   ` Marcel Holtmann
@ 2014-10-17 15:01   ` Alexander Aring
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Aring @ 2014-10-17 15:01 UTC (permalink / raw)
  To: Jukka Rissanen
  Cc: roy.qing.li, linux-bluetooth, marcel, gustavo, johan.hedberg

Hi Jukka,

On Fri, Oct 17, 2014 at 04:10:45PM +0300, Jukka Rissanen wrote:
> Hi,
> 
> On to, 2014-10-16 at 10:21 +0800, roy.qing.li@gmail.com wrote:
> > From: Li RongQing <roy.qing.li@gmail.com>
> > 
> > netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> > negative value
> > 
> > Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> > ---
> >  net/bluetooth/6lowpan.c |    9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> > 
> > diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> > index c2e0d14..9b5c89b 100644
> > --- a/net/bluetooth/6lowpan.c
> > +++ b/net/bluetooth/6lowpan.c
> > @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
> >  static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
> >  {
> >  	struct sk_buff *skb_cp;
> > -	int ret;
> >  
> >  	skb_cp = skb_copy(skb, GFP_ATOMIC);
> >  	if (!skb_cp)
> >  		return -ENOMEM;
> >  
> > -	ret = netif_rx(skb_cp);
> > -	if (ret < 0) {
> > -		BT_DBG("receive skb %d", ret);
> > -		return NET_RX_DROP;
> > -	}
> > -
> > -	return ret;
> > +	return netif_rx(skb_cp);
> >  }
> >  
> >  static int process_data(struct sk_buff *skb, struct net_device *netdev,
> 
> Ack to this.
> 

Just for notice: this doesn't fix anything, because it's currently
broken.

This is part of issue that lowpan_process_data returns sometimes errno
and (NET_RX_DROP or NET_RX_SUCCESS).

Martin tries to fix this issue, but it seems that this isn't easy.

The lowpan_process_data function still returns sometimes a errno or
NET_RX_DROP. So a check on (ret < 0) or (ret == NET_RX_DROP) doesn't
work. I mean this patch is okay for me, but there still are some
problems around. :-)

Simple we can't return errno or NET_RX_FOO in lowpan_process_data, but I
am sure Martin still working on a fix for this issue. We need to change
everything to returning errno's only.

- Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-17 15:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16  2:21 [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper roy.qing.li
2014-10-17 13:10 ` Jukka Rissanen
2014-10-17 14:08   ` Marcel Holtmann
2014-10-17 14:20     ` Jukka Rissanen
2014-10-17 15:01   ` Alexander Aring
2014-10-17 14:11 ` Marcel Holtmann

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.