All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC bluetooth-next 00/20] bluetooth: rework 6lowpan implementation
@ 2016-07-11 19:50 Alexander Aring
  2016-07-11 19:50 ` [RFC bluetooth-next 01/20] 6lowpan: ndisc: don't remove short address Alexander Aring
                   ` (22 more replies)
  0 siblings, 23 replies; 56+ messages in thread
From: Alexander Aring @ 2016-07-11 19:50 UTC (permalink / raw)
  To: linux-wpan
  Cc: kernel, luiz.dentz, kaspar, jukka.rissanen, linux-bluetooth,
	Patrik.Flykt, Alexander Aring

Hi,

I want to write a short summary here, to see what I changed to the old
implementation, please see last RFC patch.

How to use it (I know some commands are deprecated and should not be used),
I have two scripts to do that:

Node A (run at first):

---

#!/bin/sh
modprobe btusb
modprobe bluetooth_6lowpan

hciconfig hci0 up
echo "hci0 1" > /sys/kernel/debug/bluetooth/6lowpan_enable

hciconfig hci0 leadv

hciconfig

---

hcicondif will printout the address of hci dev, remember that.

Node B (run after Node A stuff):

---

#!/bin/sh

if [ "$#" -ne 1 ]; then
	echo "run $0 \$SLAVE_ADDRESS, where SLAVE_ADDRESS is the BTLE slave"
	exit 1
fi

modprobe btusb
modprobe bluetooth_6lowpan

hciconfig hci0 up
echo "hci0 1" > /sys/kernel/debug/bluetooth/6lowpan_enable

hcitool lecc $1

echo "connect $1 1" > /sys/kernel/debug/bluetooth/6lo0

---

Where $1 is the address of the Node A.

Well done. Your connection should be established. Except you have crap usb
dongles like me (broadcom) where sometimes the reset functionality seems to
be not working 100% correctly. btw: my workaround, replug usb dongles (but
I always need to tell the new usb bus information my qemu vm :-() 

KNOWN BUGS and how to reproduce that one:

First, thanks to Luiz Augusto von Dentz, which tried to help me there.
But I gave up, the BUG still exists and it's because L2CAP implementation
or I use xmit functionality wrong.

The issue is "tx credits in L2CAP (bluetooth experts know what I mean here)
will be reach to zero at the same time on both nodes. This occurs a deadlock
and nobody will transmit anything anymore".

So far I understand these tx credits are to avoid buffer-bloating. My
workaround to fix that was to allow buffer bloating:

#define L2CAP_LE_MAX_CREDITS            10
changed to (some high number which doesn't reach 2^16):
#define L2CAP_LE_MAX_CREDITS            60000

This will introduce buffer-bloating which I happily see when doing high payload
pings. (I think on high traffic you will reach that issue also with this
workaround, it's just not likely.)

---

HOW TO REPRODUCE:

It's simple, do some high payloads which makes lot tx/rcv traffic on both sides:

Node A:

 ping6 $IP_NODEB%6lo0 -s 60000

Node B:

 ping6 ff02::1%6lo0

that's one example, but you need to produce some transmit data on both nodes to
see that the nodes stucks in -11 (EAGAIN) of l2cap_chan_send.

Doing that and activate "#define DEBUG" in "bluetooth/6lowpan.c". After some time
Node A print outs (depends on ping6 implementation, iputils in my case):

.... icmp_seq=33 Destination unreachable: Address unreachable

also on Node B, there comes maybe never a responds from Node B anymore. Then it's
likely that you hit the deadlock.

Now run dmesg on both nodes, you will see each transmit (l2cap_chan_send) ends in:

"transmit return value -11"

if this will be printed out via dmesg on both nodes, you hit the deadlock and
nothing will be transmitted anymore. I need bluetooth experts to solve this
issue. :-)

Otherwise I detected no issues yet, also I tried to remove my usb dongle while
high tx/rcv bandwidth at runtime from the qemu vm without crashing the kernel
(very important test for me).

- Alex

Alexander Aring (20):
  6lowpan: ndisc: don't remove short address
  nhc: add TODO for nhc work
  ieee802154: 6lowpan: remove headroom check
  ieee802154: 6lowpan: move skb cb BUILD_BUG_ON check
  6lowpan: remove LOWPAN_IPHC_MAX_HEADER_LEN
  6lowpan: hold netdev while unregister
  6lowpan: introduce generic default naming
  6lowpan: move rx defines to generic
  bluetooth: introduce l2cap_hdev_chan_connect
  bluetooth: add hci dev notifier
  bluetooth: export functions and variables
  6lowpan: bluetooth: remove implementation
  ieee802154: 6lowpan: move header create to 6lowpan
  6lowpan: move dev_init to generic
  6lowpan: iphc: override l2 packet information
  ipv6: addrconf: fix 48 bit 6lowpan autoconfiguration
  6lowpan: iphc: add handling for btle
  6lowpan: move multicast flags to generic
  6lowpan: delete addr_len handling to generic
  6lowpan: bluetooth: add new implementation

 include/net/6lowpan.h              |   30 +-
 include/net/bluetooth/hci_core.h   |   14 +
 include/net/bluetooth/l2cap.h      |    3 +
 net/6lowpan/core.c                 |   47 +-
 net/6lowpan/iphc.c                 |  111 +++
 net/6lowpan/ndisc.c                |    2 -
 net/6lowpan/nhc.c                  |   15 +
 net/bluetooth/6lowpan.c            | 1788 ++++++++++++++----------------------
 net/bluetooth/hci_core.c           |   26 +
 net/bluetooth/hci_sock.c           |    2 +
 net/bluetooth/l2cap_core.c         |   29 +-
 net/ieee802154/6lowpan/6lowpan_i.h |    9 -
 net/ieee802154/6lowpan/core.c      |   23 +-
 net/ieee802154/6lowpan/tx.c        |   94 +-
 net/ipv6/addrconf.c                |   19 +-
 15 files changed, 1008 insertions(+), 1204 deletions(-)

-- 
2.9.0


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

end of thread, other threads:[~2016-08-05  9:18 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-11 19:50 [RFC bluetooth-next 00/20] bluetooth: rework 6lowpan implementation Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 01/20] 6lowpan: ndisc: don't remove short address Alexander Aring
2016-07-19 13:19   ` Michael Richardson
2016-07-19 18:03     ` Alexander Aring
2016-07-21  6:37       ` Alexander Aring
2016-07-21  7:10         ` Alexander Aring
2016-07-21  8:44       ` Michael Richardson
2016-07-11 19:50 ` [RFC bluetooth-next 02/20] nhc: add TODO for nhc work Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 03/20] ieee802154: 6lowpan: remove headroom check Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 04/20] ieee802154: 6lowpan: move skb cb BUILD_BUG_ON check Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 05/20] 6lowpan: remove LOWPAN_IPHC_MAX_HEADER_LEN Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 06/20] 6lowpan: hold netdev while unregister Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 07/20] 6lowpan: introduce generic default naming Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 08/20] 6lowpan: move rx defines to generic Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 09/20] bluetooth: introduce l2cap_hdev_chan_connect Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 10/20] bluetooth: add hci dev notifier Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 11/20] bluetooth: export functions and variables Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 12/20] 6lowpan: bluetooth: remove implementation Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 13/20] ieee802154: 6lowpan: move header create to 6lowpan Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 14/20] 6lowpan: move dev_init to generic Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 15/20] 6lowpan: iphc: override l2 packet information Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 16/20] ipv6: addrconf: fix 48 bit 6lowpan autoconfiguration Alexander Aring
2016-07-12 20:16   ` Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 17/20] 6lowpan: iphc: add handling for btle Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 18/20] 6lowpan: move multicast flags to generic Alexander Aring
2016-07-12 20:34   ` Alexander Aring
2016-07-13 11:15     ` Jukka Rissanen
2016-07-14  8:21       ` Alexander Aring
2016-07-14  8:36         ` Alexander Aring
2016-07-19 14:51       ` Michael Richardson
2016-07-19 18:20         ` Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 19/20] 6lowpan: delete addr_len handling " Alexander Aring
2016-07-11 19:50 ` [RFC bluetooth-next 20/20] 6lowpan: bluetooth: add new implementation Alexander Aring
2016-07-12 21:19   ` Alexander Aring
2016-07-14 11:40     ` Luiz Augusto von Dentz
2016-07-17 15:52       ` Alexander Aring
2016-07-18  8:59         ` Luiz Augusto von Dentz
2016-07-18 21:52           ` Alexander Aring
2016-07-19  5:45             ` Johan Hedberg
2016-07-19  8:23               ` Luiz Augusto von Dentz
2016-07-19 21:05                 ` Alexander Aring
2016-07-20  7:39                   ` Johan Hedberg
2016-07-20  8:14                     ` Luiz Augusto von Dentz
2016-07-20 10:22                     ` Marcel Holtmann
2016-07-19  8:49             ` Luiz Augusto von Dentz
2016-07-19 14:48               ` Michael Richardson
2016-07-19 21:24               ` Alexander Aring
2016-07-12 14:51 ` [RFC bluetooth-next 00/20] bluetooth: rework 6lowpan implementation Luiz Augusto von Dentz
2016-07-12 18:35   ` Alexander Aring
2016-07-13  9:12     ` Alexander Aring
2016-07-13 10:13       ` Luiz Augusto von Dentz
2016-07-13 10:56         ` Alexander Aring
2016-07-14 12:02           ` Luiz Augusto von Dentz
2016-07-19 12:58 ` Michael Richardson
2016-08-05  7:15 ` Bakke, Glenn Ruben
2016-08-05  9:18   ` Alexander Aring

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.