Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp155397iob; Wed, 27 Apr 2022 22:25:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEMO4YQU0y3lparT39TOPRi6jvaFaKXMqXYYMBbXvZPYIiTk/kCUXjk7esZv3J9mRr1Tl6 X-Received: by 2002:a05:6402:155a:b0:425:c0b1:ab07 with SMTP id p26-20020a056402155a00b00425c0b1ab07mr31754350edx.258.1651123537121; Wed, 27 Apr 2022 22:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651123537; cv=none; d=google.com; s=arc-20160816; b=Nut+I+d5uppeESyhpHxHeRQk7IFPPArR1nlrgdTPQS05jZ87tcCPUtDMD58pmK/AyG DecIrewxerA5eMCuLDyj0t19evf+jS11Yad4Uf3va2SVIG6mU3RpYRiTGd5YQiswB3l2 5VmwX1DeHJ6469ucx8JzKl861955YRxffmC8C1XFwvg07QA200mgmmDCRqA59w2XULob sF69Y6BHHaCf6t2M/3HrMEVROXG7NGT5IkwZDiT+wXOgEJo9qtrrdvLTX+pVkyDxMIXF NOOC3/ch5SORI9lfBSnefcBSugZny5V4yENMzDF7VT2I2S1/ucsuvlsCy/BGjU2GGnFu Aj1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Yn6iA4hdzDYZvjsN/nl3B+u0y5prVHrZ7jxNMusXcWE=; b=GiO9MiVY5aco/lgEEsVCGXhN70jB/ub6qRU4OTOTZeies8OfREhU2sARYYHCE+NekB cFds0dbA493XjsDk8uTlsuR/ozm0F+EGiLXSee3CopDGHBVvmAT34ZizsgOvW582+ArO 2FHd2otMDfG6qD43FOIvnc131jZoU6PML9cPvj8EgVAHVCfP1rZgz73Fa+XJssGemHUx oaL+NW5vYYUCtiVrtiIV40HTlwxftivdpCvGK3Wj8c3bqHE+OCtY2vldr71lRlzU6B3D PXdMXWiPULRoBetSM/sG55B8piF55X8c4a3Dhf5m9tbsqXSZqe+p7N0rVY5OhZ6ZDB54 WJuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ymuter3e; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s21-20020a170906169500b006e8625949efsi2891657ejd.923.2022.04.27.22.25.03; Wed, 27 Apr 2022 22:25:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ymuter3e; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241857AbiD1DJS (ORCPT + 99 others); Wed, 27 Apr 2022 23:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241876AbiD1DJR (ORCPT ); Wed, 27 Apr 2022 23:09:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 853E82DA8B for ; Wed, 27 Apr 2022 20:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651115163; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Yn6iA4hdzDYZvjsN/nl3B+u0y5prVHrZ7jxNMusXcWE=; b=Ymuter3eQf4IQDKSxwsNC4i/dC6Yq/29dyTEPBWmJiZ0pVRIzxtuRpzyzh9ip7EGrGX2a/ Y7fO+ftFbSuQnI823vi0GhDKZxmWg6EVnVtjA16OhKM25WdAqOrXO5Jc9VyC5dGki1VclY wmO9M+Os7ZM6n10y+w0QT9qhQa4uY4Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-OwWjIDEmNG2DIh9EuAZ41g-1; Wed, 27 Apr 2022 23:06:01 -0400 X-MC-Unique: OwWjIDEmNG2DIh9EuAZ41g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C70B38039D7; Thu, 28 Apr 2022 03:05:58 +0000 (UTC) Received: from fs-i40c-03.fs.lab.eng.bos.redhat.com (fs-i40c-03.fs.lab.eng.bos.redhat.com [10.16.224.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CA032166B4D; Thu, 28 Apr 2022 03:05:58 +0000 (UTC) From: Alexander Aring To: jukka.rissanen@linux.intel.com Cc: linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org, stefan@datenfreihafen.org, torvalds@linuxfoundation.org Subject: [PATCH bluetooth-next 0/3] net: 6lowpan: simplify lookup by nhc id Date: Wed, 27 Apr 2022 23:05:31 -0400 Message-Id: <20220428030534.3220410-1-aahringo@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi, this patch series removes the rb data structure for looking up a nhc by nhc id. Instead we using the existing nexthdr lookup array by iterating over it and find the right nhc by nhc id. It's simply not worth it to use such complex handling for such small amount of nhc. As we only support nhc ids which fits into 1 byte and there are not two byte nhc ids values specified yet, we let the nhc layer only handle 1 byte values. If there is the need for 2 byte nhc values we can add support for it. - Alex Alexander Aring (3): net: 6lowpan: remove const from scalars net: 6lowpan: use array for find nhc id net: 6lowpan: constify lowpan_nhc structures net/6lowpan/nhc.c | 103 ++++++-------------------------- net/6lowpan/nhc.h | 38 +++++------- net/6lowpan/nhc_dest.c | 9 +-- net/6lowpan/nhc_fragment.c | 9 +-- net/6lowpan/nhc_ghc_ext_dest.c | 9 +-- net/6lowpan/nhc_ghc_ext_frag.c | 11 +--- net/6lowpan/nhc_ghc_ext_hop.c | 9 +-- net/6lowpan/nhc_ghc_ext_route.c | 9 +-- net/6lowpan/nhc_ghc_icmpv6.c | 9 +-- net/6lowpan/nhc_ghc_udp.c | 9 +-- net/6lowpan/nhc_hop.c | 9 +-- net/6lowpan/nhc_ipv6.c | 11 +--- net/6lowpan/nhc_mobility.c | 9 +-- net/6lowpan/nhc_routing.c | 9 +-- net/6lowpan/nhc_udp.c | 9 +-- 15 files changed, 48 insertions(+), 214 deletions(-) -- 2.31.1