Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5079868rwl; Tue, 28 Mar 2023 16:07:32 -0700 (PDT) X-Google-Smtp-Source: AK7set/zn8uZ/pmWBD8PA+jpWIQhLoRv96AJ4fgWs5bt1imHXSsfHTyHWq84aErErptDzaXwwvXC X-Received: by 2002:a05:6a20:1a9c:b0:d8:a2ee:6b60 with SMTP id ci28-20020a056a201a9c00b000d8a2ee6b60mr15221025pzb.42.1680044851793; Tue, 28 Mar 2023 16:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680044851; cv=none; d=google.com; s=arc-20160816; b=JCidUUMviOv7yZZK5cG5kBAxEJvESHPvE8Q3+boYcNM1bVWBUtwO6qhHgvcOUYR6eG TndhjnPGqS67+Rdo39Z7yZFwZLb1LMewQ2qjg+7uZoVAnLm9e7GGeIOSKUu8unqZG0Pp ZXN/tNgyippCnOTlUlBhzPN7tbTyPt1OEYaNfF9Q42589PXs/RXnRSQOU6DetP3ZVb/C ItaKmNGhYy1096EPlbahSKkci9v/0jt26loylFLahVE+0QGIKyxIBiaM7w/ha1zkEwrL jo41OuFTRbv91LFPQIsG5lbY4eV4CQiV33jGat4jCcQLS8N/WGjw3B5k+JatfZPDkpzx A+9A== 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=LBln1p+NSeAnycDPLWXmgVYy/UDB+aBM5998ZESAXcM=; b=KKXfy/m5fQdS3RAIBmzNwDA//MHWhZJ7hp8AlX4kBySZFkVr1iPHhyI5XtzJ5vF5fF i9fuvSjYAMMZsYCu/+Q5HOdyny/BDKg0DlrJXwglq/s6bjyiYkIC/FknwoMWyn2Ldnlq JYnpAzJ9mXLX0WHaGw1s1vMnfFpDV2Q2ZY8KiZ/IAjFLYK55DPzPzi0svpHj3zfsomjr vXHvkVWZfMELh8mLX5+pyhQESVXBV65Wqmx/wi/5Wv3ah7O4Ir860tYUTgFAyhuBhKBI LW5mhlBMeMTzGt0YmpauJbBWIUEnaKl0WbbXnBShTadXhdrF7Fv32Gys0e7vgGMr92ir Ixyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J9GsfARB; 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 t11-20020a056a0021cb00b00628a75401bdsi16910023pfj.142.2023.03.28.16.07.18; Tue, 28 Mar 2023 16:07:31 -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=J9GsfARB; 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 S229531AbjC1W6a (ORCPT + 60 others); Tue, 28 Mar 2023 18:58:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjC1W63 (ORCPT ); Tue, 28 Mar 2023 18:58:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C271172B; Tue, 28 Mar 2023 15:58:28 -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 126236198E; Tue, 28 Mar 2023 22:58:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C9F9C433EF; Tue, 28 Mar 2023 22:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680044307; bh=zLi38Xt9VsJj/nJhVMCROcthOPxshVt41T5fETfR7sc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J9GsfARBLOIO/j8qiK8ifgUVWcC9pgbha5FW5g4295bEv1isJRFE+fOktowrYJScz di5S0UMxYo4GLGOhL7XOvok9tZ+OLrkEsDDwpIfrV3VG+07fBgzCyndQTMaGt3LULt IGQs18SvDGOie0q5h7Hut9RQU7OLJZm8B3WJcqd6upSRIrfyQSWZXB1TK1mrkZqLQ2 aWewjKi0IUVmqmpnPocm4YR6sUFKJIsj35t8RwF3CaXwThne8dFHdNFZCaYkXg6xNZ JNAVgmdSmhwMkDoc2QNYzNtcMpkZbClLy1ap41yJWA6IyiTJFDZe00huYQpRlHdRpF LEYE0XbPcHTVg== Date: Tue, 28 Mar 2023 15:58:26 -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: <20230328155826.38e9e077@kernel.org> In-Reply-To: References: <00659771ed54353f92027702c5bbb84702da62ce.camel@sipsolutions.net> <20230327180950.79e064da@kernel.org> 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 Tue, 28 Mar 2023 09:37:43 +0200 Johannes Berg wrote: > > My knee jerk idea would be to either use the top 8 bits of the > > skb reason enum to denote the space. And then we'd say 0 is core > > 1 is wifi (enum ieee80211_rx_result) etc. Within the WiFi space > > you can use whatever encoding you like. > > Right. That's not _that_ far from what I proposed above, except you pull > the core out Thinking about it again, maybe yours is actually cleaner. Having the subsystem reason on the top bits, I mean. That way after masking the specific bits out the lower bits can still provide a valid "global" drop reason. The UNUSABLE vs MONITOR bits I'd be tempted to put in the "global" reason, but maybe that's not a great idea given Eric's concern :) > > On a quick look nothing is indexed by the reason directly, so no > > problems with using the high bits. > > I think you missed he drop_reasons[] array in skbuff.c, but I guess we > could just not add these to the DEFINE_DROP_REASON() macro (and couldn't > really add them anyway). > > The only user seems to be drop_monitor, which anyway checks the array > bounds (in the trace hit function.) > > Or we change the design of this to actually have each subsystem provide > an array/a callback for their namespace, if the strings are important? > Some registration/unregistration might be needed for modules, but that > could be done. Right, drop monitor is good ol' kernel code, we can make it do whatever we want. I was worried that tracing / BPF may tie our hands but they support sparse enums just fine.