Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Stefan Schmidt <stefan@osg.samsung.com>
Cc: linux-wpan@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [RFCv2 bluetooth-next 02/16] ieee802154: 6lowpan: register packet layer while open
Date: Tue, 1 Sep 2015 09:38:24 +0200	[thread overview]
Message-ID: <20150901073821.GA1454@omega> (raw)
In-Reply-To: <55E37A2C.7080502@osg.samsung.com>

On Sun, Aug 30, 2015 at 11:48:28PM +0200, Stefan Schmidt wrote:
> Hello.
> 
> On 20/08/15 18:47, Alexander Aring wrote:
> >This patch moves the open count handling while doing open of a lowpan
> >interface. We need the packet handler register at first when one lowpan
> >interface is up.
> The code itself looks fine, but I have trouble to gte the why from your
> commit message. Why is this change needed?
> 

It's a slightly improvement. There exists a small case when ALL lowpan
interfaces are down and the ieee802154_6lowpan module still receives
frames. We don't need to receive frames when all lowpan interfaces are
down. This will end always in the upcomming (!netif_running(ldev))
condition.

Does it sounds useful?

> >Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> >---
> >  net/ieee802154/6lowpan/core.c | 28 ++++++++++++++++++----------
> >  1 file changed, 18 insertions(+), 10 deletions(-)
> >
> >diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> >index 3cc76f0..8e9da1d 100644
> >--- a/net/ieee802154/6lowpan/core.c
> >+++ b/net/ieee802154/6lowpan/core.c
> >@@ -76,9 +76,27 @@ static int lowpan_dev_init(struct net_device *ldev)
> >  	return 0;
> >  }
> >+static int lowpan_open(struct net_device *dev)
> >+{
> >+	if (!open_count)
> >+		lowpan_rx_init();
> >+	open_count++;
> >+	return 0;
> >+}
> >+
> >+static int lowpan_stop(struct net_device *dev)
> >+{
> >+	open_count--;
> >+	if (!open_count)
> >+		lowpan_rx_exit();
> >+	return 0;
> >+}
> >+
> >  static const struct net_device_ops lowpan_netdev_ops = {
> >  	.ndo_init		= lowpan_dev_init,
> >  	.ndo_start_xmit		= lowpan_xmit,
> >+	.ndo_open		= lowpan_open,
> >+	.ndo_stop		= lowpan_stop,
> >  };
> >  static void lowpan_setup(struct net_device *ldev)
> >@@ -149,11 +167,6 @@ static int lowpan_newlink(struct net *src_net, struct net_device *ldev,
> >  	}
> >  	wdev->ieee802154_ptr->lowpan_dev = ldev;
> >-	if (!open_count)
> >-		lowpan_rx_init();
> >-
> >-	open_count++;
> >-
> >  	return 0;
> >  }
> >@@ -163,11 +176,6 @@ static void lowpan_dellink(struct net_device *ldev, struct list_head *head)
> >  	ASSERT_RTNL();
> >-	open_count--;
> >-
> >-	if (!open_count)
> >-		lowpan_rx_exit();
> >-
> >  	wdev->ieee802154_ptr->lowpan_dev = NULL;
> >  	unregister_netdevice(ldev);
> >  	dev_put(wdev);
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> 

Why is this a SOB?

- Alex

  reply	other threads:[~2015-09-01  7:38 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20 16:47 [RFCv2 bluetooth-next 00/16] ieee802154: 6lowpan: cleanup and rework dispatch evaluation Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 01/16] ieee802154: 6lowpan: change dev vars to wdev and ldev Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 02/16] ieee802154: 6lowpan: register packet layer while open Alexander Aring
2015-08-30 21:48   ` Stefan Schmidt
2015-09-01  7:38     ` Alexander Aring [this message]
2015-09-01  7:45       ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 03/16] ieee802154: 6lowpan: remove check on null Alexander Aring
2015-08-30 21:49   ` Stefan Schmidt
2015-09-01  7:52     ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 04/16] ieee802154: 6lowpan: remove set to zero Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 05/16] ieee802154: 6lowpan: remove EXPORT_SYMBOL Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 06/16] ieee802154: 6lowpan: change if lowpan dev is running Alexander Aring
2015-08-30 21:51   ` Stefan Schmidt
2015-09-01  7:53     ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 07/16] ieee802154: 6lowpan: cleanup pull of iphc bytes Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 08/16] ieee802154: 6lowpan: trivial checks at first Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 09/16] ieee802154: 6lowpan: earlier skb->dev switch Alexander Aring
2015-08-30 21:54   ` Stefan Schmidt
2015-09-01  7:53     ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 10/16] ieee820154: 6lowpan: dispatch evaluation rework Alexander Aring
2015-08-27 17:53   ` Alexander Aring
2015-08-31  9:28   ` Stefan Schmidt
2015-09-01  7:43     ` Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 11/16] ieee802154: 6lowpan: add generic lowpan header check Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 12/16] ieee802154: 6lowpan: add handler for all dispatch values Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 13/16] ieee802154: 6lowpan: add check for reserved dispatch Alexander Aring
2015-08-30 22:00   ` Stefan Schmidt
2015-09-01  7:39     ` Alexander Aring
2015-09-01  7:56     ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 14/16] ieee802154: 6lowpan: check on valid 802.15.4 frame Alexander Aring
2015-08-30 22:03   ` Stefan Schmidt
2015-09-01  7:57     ` Stefan Schmidt
2015-08-20 16:47 ` [RFCv2 bluetooth-next 15/16] ieee802154: 6lowpan: remove packet type to host Alexander Aring
2015-08-20 16:47 ` [RFCv2 bluetooth-next 16/16] ieee802154: 6lowpan: remove tx full-size calc workaround Alexander Aring
2015-08-30 22:06   ` Stefan Schmidt
2015-09-01  7:57     ` Stefan Schmidt
2015-08-30 21:45 ` [RFCv2 bluetooth-next 00/16] ieee802154: 6lowpan: cleanup and rework dispatch evaluation Stefan Schmidt

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=20150901073821.GA1454@omega \
    --to=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    --cc=stefan@osg.samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox