From patchwork Mon Jul 11 19:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 9224035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B11C860760 for ; Mon, 11 Jul 2016 19:51:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3DEF27E15 for ; Mon, 11 Jul 2016 19:51:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9890527E78; Mon, 11 Jul 2016 19:51:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1455627E15 for ; Mon, 11 Jul 2016 19:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbcGKTvS (ORCPT ); Mon, 11 Jul 2016 15:51:18 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:46627 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751051AbcGKTvR (ORCPT ); Mon, 11 Jul 2016 15:51:17 -0400 Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=omega.localdomain) by metis.ext.pengutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1bMhEZ-00038F-DZ; Mon, 11 Jul 2016 21:51:15 +0200 From: Alexander Aring To: linux-wpan@vger.kernel.org Cc: kernel@pengutronix.de, luiz.dentz@gmail.com, kaspar@schleiser.de, jukka.rissanen@linux.intel.com, linux-bluetooth@vger.kernel.org, Patrik.Flykt@linux.intel.com, Alexander Aring Subject: [RFC bluetooth-next 02/20] nhc: add TODO for nhc work Date: Mon, 11 Jul 2016 21:50:26 +0200 Message-Id: <20160711195044.25343-3-aar@pengutronix.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160711195044.25343-1-aar@pengutronix.de> References: <20160711195044.25343-1-aar@pengutronix.de> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: aar@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-wpan@vger.kernel.org Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a TODO for nhc to do everything what we need inside compress handling. Also we should check if the compression doesn't add more bytes than sending raw next header format. We don't hit that issue yet because NHC id is at worst case one byte long like the next header byte in IPv6 header (which will be elided when using NHC). But on NHC id's which are two bytes long it's likely that compressions adds more data than sending raw next header. The root of this issue to care about is that with running IPHC after a IPv6 packet which is 1280 bytes long, the IPHC, NHC header with payload should not exceed 1280 bytes. This will break bluetooth L2CAP mtu which is 1280 bytes as well. Signed-off-by: Alexander Aring --- net/6lowpan/nhc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/net/6lowpan/nhc.c b/net/6lowpan/nhc.c index 7008d53..55df7f7 100644 --- a/net/6lowpan/nhc.c +++ b/net/6lowpan/nhc.c @@ -94,6 +94,21 @@ static struct lowpan_nhc *lowpan_nhc_by_nhcid(const struct sk_buff *skb) return NULL; } +/* TODO remove this and do everything in compress callback, + * this means, setting NHC bit in IPHC, check if compression + * make sense and doing compression. We will hit the issue + * when having two bytes long NHC ID's that the IPHC compression + * could be have more bytes than using raw next header, this + * will break btle 6lowpan. + * + * Marcel told to look into skb frag and linearlize functionality. + * This way is very ugly. + * Additonal change handling that sending compressed on transmit + * is default disabled. Use a compression flag e.g. RFC6775 + * + * I see nhc in a bad state currently, this need to be fixed + * before adding new nhc's. + */ int lowpan_nhc_check_compression(struct sk_buff *skb, const struct ipv6hdr *hdr, u8 **hc_ptr) {