Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1071848rwl; Wed, 29 Mar 2023 12:13:53 -0700 (PDT) X-Google-Smtp-Source: AKy350a53W/g65qwDPMycyEk7EAIigcb8ynmmMzOnxma8xlfVmC3qRQVGJ8ekZ1DPt6M9gbqJ/tH X-Received: by 2002:a17:906:36d7:b0:93d:cffb:80ba with SMTP id b23-20020a17090636d700b0093dcffb80bamr21867811ejc.66.1680117233164; Wed, 29 Mar 2023 12:13:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680117233; cv=none; d=google.com; s=arc-20160816; b=YC+xaGiOmjIGLrPMgibanAZkHqecU4mtHC68EzbAyrbDhvEobnBapYekjAVW2NwE11 7BerxhQPJeLQzfrpicGSmNrjnZsHL7jC3UOosHGpNEm5Mx5/zXVavMFsey/VxPUZaWG/ uJjY0i6MS1k1dpbYOYx1wuxFfDSyeqoxNwLEA2I12pY9sosqZlXWo6jgGMma8Lr7SB2i F9L42uQsnNCLdgSVl10EKKcWDgdJv9AfOUxaNEa64QIahBG2k0NJawgZJUei4Rm/d0Mr uSVFy+kzlg/7pirT/FoDwr5zHdls9sgO61utf2Vg9J0lteHL0xedyyrBvymPnyi15Doh Khaw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ywDflq/CA799+JObwZaQthLodkLMOvwppxU3dQShVH0=; b=UXMNjsQqNWdO004nvILQ9Jk2rLmjU9HXYj9K1q0z8fDSU3/7lT/DDoAGZLK3xyCQ4v FHOj2omW3RjElhkCbq9y0Jo/45pX1Huv8zYV0vOo6xvp6Snh4LTujnpoZLEXVGdNLOs1 pT491f10SW/gxKQ9JIO45QGCjkP6SBVbqYsE6EpwrfXMNVXvGQOPfjeyVtH1ePFRr+Y+ RwvbSnfydE6EUcSmq9iByr5i1Dc6zJFYoBo+Qe6e7/S4PekCbushTWNiL3dN+jQMEXu8 tn2cY0dwt0Gt0HlDMOuzkW2cnX3zCdW8va9bbM0OHKo+1isyxODNQwm06tX51hhPq3ha l5VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G3+zepOx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ty27-20020a170907c71b00b0093d8207777esi15008162ejc.858.2023.03.29.12.13.37; Wed, 29 Mar 2023 12:13:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@kernel.org header.s=k20201202 header.b=G3+zepOx; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbjC2TKD (ORCPT + 59 others); Wed, 29 Mar 2023 15:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbjC2TKC (ORCPT ); Wed, 29 Mar 2023 15:10:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5530A1738; Wed, 29 Mar 2023 12:10:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E438761E03; Wed, 29 Mar 2023 19:10:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34C17C433D2; Wed, 29 Mar 2023 19:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680117000; bh=5Hn7+0ZK5/XQHEYNsy9dx1DtIonq3QdM74Uz2skPZUo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=G3+zepOxNynVPmZaS4hNvO6/zX6qVBKnwlSn82n/o7wGoKWCGri1RnaljtckLw9yf khL99+7AzWfnOVDyqJir/5uVpC3nLrhk9Cks/iaJeVzda43j+Z1iF+X/b5Kf2CnTW9 /RzWoIrJYR6h+6+EhkLACxZAx98eAlqly1VxTR8Sl69XuoBPghd4D+ikQgRmCDT2tm z7pjBCV5+ANFdkXUv/Wla5tK/KM47HP+D25KsWK8q4srvaQhn/Hq3KRvd16fCaILZW WoCs0ECx/Qg9DfpJJ3Cjtm0py1nDTtKp3WfcnkC0wTG7F3zqZM7zuUhyFaHNO+MCbS /taF+JQ7RQiEg== Date: Wed, 29 Mar 2023 12:09:59 -0700 From: Jakub Kicinski To: Johannes Berg Cc: Eric Dumazet , netdev@vger.kernel.org, linux-wireless@vger.kernel.org Subject: Re: traceability of wifi packet drops Message-ID: <20230329120959.5f9eef1c@kernel.org> In-Reply-To: <37311ab0f31d719a65858de31cec7a840cf8fe40.camel@sipsolutions.net> References: <00659771ed54353f92027702c5bbb84702da62ce.camel@sipsolutions.net> <20230327180950.79e064da@kernel.org> <20230328155826.38e9e077@kernel.org> <8304ec7e430815edf3b79141c90272e36683e085.camel@sipsolutions.net> <20230329110205.1202eb60@kernel.org> <37311ab0f31d719a65858de31cec7a840cf8fe40.camel@sipsolutions.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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-wireless@vger.kernel.org On Wed, 29 Mar 2023 20:57:26 +0200 Johannes Berg wrote: > On Wed, 2023-03-29 at 11:02 -0700, Jakub Kicinski wrote: > > But it's just a thought, all of the approaches seem acceptable. > > I _think_ I like the one I prototyped this morning better, I'm not sure > I like the subsystem == existing reason part _that_ much. It ultimately > doesn't matter much, it just feels odd that you'd be allowed to have a, > I don't know picking a random example, SKB_DROP_REASON_DUP_FRAG with a > fine-grained higher bits value? > > Not that we'll ever be starved for space ... Ack, for most drop_reasons having higher order bits would make no sense. > > Quick code change perhaps illustrates it best: > > > > Yeah, that ends up really looking very similar :-) > > Then again thinking about the implementation, we'd not be able to use a > simple array for the sub-reasons, or at least that'd waste a bunch of > space, since there are already quite a few 'main' reasons and we'd > want/need to add the mac80211 ones (with sub-reason) at the end. So that > makes a big array for the sub-reasons that's very sparsely populated (*) > Extending with a high 'subsystem' like I did this morning is more > compact here. > > (*) or put the sub-reasons pointer/num with the 'main' reasons into the > drop_reasons[] array but that would take the same additional space Yup, the only difference is that the collector side is simpler if the subsystem is a valid drop reason. For those who don't expect to care about subsystem drop details the aggregate stats are still (bpftrace notation): @stats[reason & 0xffff] = count(); With the higher bits we have to add a layer of stats to the collection? $grp = reason >> 24; if ($grp != 0) @groups[$grp] = count(); else @stats[reason] = count(); That said, I'm probably over-thinking because most will do: @stats[reason] = count(); ... which works the same regardless. > So ... which one do _you_ like better? I think I somewhat prefer the one > with adding a high bits subsystem, but I can relatively easily rejigger > my changes from this morning to implement the semantics you had here > too. No preference. You're coding it up so you're in the best position to pick :)