Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1417591iog; Thu, 16 Jun 2022 06:05:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3VpQwwafhYzcGaMhhexAWH1XCpp+kVshlUHzM2LrGd7nMPaO7x8TiI1ya9t5Da7cCmux+ X-Received: by 2002:a17:906:519c:b0:712:1c90:1c39 with SMTP id y28-20020a170906519c00b007121c901c39mr4619636ejk.620.1655384706365; Thu, 16 Jun 2022 06:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655384706; cv=none; d=google.com; s=arc-20160816; b=D3caa3unvN09nRTGQ0pgEprIf3zbv5PAZMCTkvp0mfTUCOBneA4lyqltVxvV5yJq7b anqE4645lgU77Tkfs2+CQRiMSHlSial1YNo0TdPIZyihzQEz/RRQqLZJE/jY7XXloACO sEFbi/fOQDXy5nleNVRVdqLZW1Ow6+lE66iPHfuGiSKQd8aH9MQqfPCN7Nn5sW5y6YTI PGuE36KM7PChQwHDAZWU3NhHhzVNoHuJwCbUNf+aO0b2skaY2OTp9FzT6nWVDNcsLWf8 1IX8SpktaWIkKLeRXH0w/JwYfxxtn2wuSLPC0+iK4AZ8Nub9qdreXIrxnzyUBAkXHSwM tjlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PJVjgB1WV8axjnD/ZQGZ1cJuRqJKIs9CwL3dt0JUN1o=; b=eyzTFaTipDztuBQ81ZP7bTZtKeDYQA0utnWAw2GeaD/ppo/DG68ITfW37L+zD1Cs/N eNzF9PfEN4v0oTRFj8kyHIaHflBoTcOCorzOxkENIreEr4mbMjDHrdnXWxbb/BM282/Q n33vc9PL0wr8lB6KlYTNMR4+k08O6HGoUz1fgV7KaKwVbyWnIBUfcPixmtOgJgvib4uY 7u04wYdCZS373qmw36VFYWpTtftUl/PZsM8ERpcErt5scp1ZaWHHfz/jkUy3imiSnsxT B7/qKX1IUOmTZSXOiOcKh1irma9V8D+c3vD4Vr9GA6NJGxvadCYpoYaesbSxyKKUqto/ LM3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I3axTmT6; 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 y17-20020a056402135100b0042ee0cc482bsi2132581edw.170.2022.06.16.06.03.57; Thu, 16 Jun 2022 06:05:06 -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=I3axTmT6; 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 S1376425AbiFPM5c (ORCPT + 99 others); Thu, 16 Jun 2022 08:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376402AbiFPM5a (ORCPT ); Thu, 16 Jun 2022 08:57:30 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AAAA02DF for ; Thu, 16 Jun 2022 05:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655384247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PJVjgB1WV8axjnD/ZQGZ1cJuRqJKIs9CwL3dt0JUN1o=; b=I3axTmT6dSF82THq4vTnl3OmT/UIVPFj7bq5iCW3wbU3hZyfcnMisSmOGc81JOn/sSEMWZ 6fJbuT7UM48sBOvbnAV2asRJ+AUz4qhhRNnV+es4Yk8kSQc5QBU2EhyPnMtPCrEMXCDjVZ x83K7OSaYPRg4utBSVBxrMEiGAgswt8= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-YsiZQfftMuKQxPvG8JAzPA-1; Thu, 16 Jun 2022 08:57:26 -0400 X-MC-Unique: YsiZQfftMuKQxPvG8JAzPA-1 Received: by mail-qv1-f72.google.com with SMTP id 7-20020a0562140d0700b0046bd3ff4a9dso1524338qvh.10 for ; Thu, 16 Jun 2022 05:57:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PJVjgB1WV8axjnD/ZQGZ1cJuRqJKIs9CwL3dt0JUN1o=; b=2UDnZmSVowrr7xuvOCEvtVlOmkB1QxVXjdTjFlal3FQssBYmDXXqPCagpsiuHVo7ex uW5PSsiCXYGLvpCjPThn6dX36Le0P7lxMimviXx70a2x2dGUV/6in8Vb4Dq1BNm8cwMv UPhri1pljnr/xfUjoT0JXT890bgvNiYefPU93/twMtuWoYJDjcizPqJlju9k2m5w+HF5 NW1unjt7rw1lk56VweFOlYdE/tZQ6G00gXFMdVCZpwjLVbUMxz+x2fK39QgWxvBmXxji OMYyuWeR8/N4F69Kj4yZ8XOj5s0LYlgtqA2FHYocO4o0Y1/6HCsE89Gqk11ImINuZEe4 Y26A== X-Gm-Message-State: AJIora9bQ/aF6IDwVe5gociTnsyQRZ11zPWWTT/sHiZB1+RZPtz3zywH mn74xTGZAFvg6Yr4EtoC43G+/ZroZRQDtrtW1ix3m4Uoudo5nnGG1bZtihjmsY2z/iF0HPt1ZNF odQ9nYSZ2FF+FF/Kps3Uf35L6jADZ2xbj7iRGJXLr8JZe X-Received: by 2002:ad4:594d:0:b0:46b:9c03:4fd1 with SMTP id eo13-20020ad4594d000000b0046b9c034fd1mr3802385qvb.92.1655384245580; Thu, 16 Jun 2022 05:57:25 -0700 (PDT) X-Received: by 2002:ad4:594d:0:b0:46b:9c03:4fd1 with SMTP id eo13-20020ad4594d000000b0046b9c034fd1mr3802374qvb.92.1655384245372; Thu, 16 Jun 2022 05:57:25 -0700 (PDT) MIME-Version: 1.0 References: <20220613032922.1030739-1-aahringo@redhat.com> <20220613032922.1030739-2-aahringo@redhat.com> <3b7a9363-1fea-d4a3-360d-a2e60b1038c7@datenfreihafen.org> In-Reply-To: <3b7a9363-1fea-d4a3-360d-a2e60b1038c7@datenfreihafen.org> From: Alexander Aring Date: Thu, 16 Jun 2022 08:57:14 -0400 Message-ID: Subject: Re: [PATCH wpan-next 2/2] 6lowpan: nhc: drop EEXIST limitation To: Stefan Schmidt Cc: linux-wpan - ML , linux-bluetooth@vger.kernel.org, Network Development Content-Type: text/plain; charset="UTF-8" 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, On Thu, Jun 16, 2022 at 3:57 AM Stefan Schmidt wrote: > > > Hello Alex. > > On 13.06.22 05:29, Alexander Aring wrote: > > In nhc we have compression() and uncompression(). Currently we have a > > limitation that we return -EEXIST when it's the nhc is already > > registered according the nexthdr. But on receiving handling and the > > nhcid we can indeed support both at the same time. > > The sentence above is not really clear to me. Do you want to say that on > rx we can support more than one nhcid? I am a bit confused why you write > both here. Where does the limit to two come from? > It's simple when you look at how it's working. On rx we have nhcid lookup and on tx we have nexthdr lookup. These are two different registration numbers and there can be multiple compression for one nexthdr: N:1 The limit was always there because we did not support multiple nexthdr registrations. > We remove the current > > static array implementation and replace it by a dynamic list handling to > > get rid of this limitation. > > > > Signed-off-by: Alexander Aring > > --- > > net/6lowpan/nhc.c | 69 ++++++++++++++++++++++++++++++----------------- > > 1 file changed, 44 insertions(+), 25 deletions(-) > > > > diff --git a/net/6lowpan/nhc.c b/net/6lowpan/nhc.c > > index 7b374595328d..3d7c50139142 100644 > > --- a/net/6lowpan/nhc.c > > +++ b/net/6lowpan/nhc.c > > @@ -12,13 +12,30 @@ > > > > #include "nhc.h" > > > > -static const struct lowpan_nhc *lowpan_nexthdr_nhcs[NEXTHDR_MAX + 1]; > > +struct lowpan_nhc_entry { > > + const struct lowpan_nhc *nhc; > > + struct list_head list; > > +}; > > + > > static DEFINE_SPINLOCK(lowpan_nhc_lock); > > +static LIST_HEAD(lowpan_nexthdr_nhcs); > > + > > +const struct lowpan_nhc *lowpan_nhc_by_nexthdr(u8 nexthdr) > > +{ > > + const struct lowpan_nhc_entry *e; > > + > > + list_for_each_entry(e, &lowpan_nexthdr_nhcs, list) { > > + if (e->nhc->nexthdr == nexthdr && > > + e->nhc->compress) > > + return e->nhc; > > We will always go with the first one we find? Do I miss something or > does that mean the one registered as seond and above will never be taken > into acount? That is currently true for the tx side. This just allows more than we currently support without breaking the past. - Alex