From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5B09C30658 for ; Fri, 28 Jun 2024 18:36:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5BFA04059F; Fri, 28 Jun 2024 18:36:49 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id B_fbDfhDWg-f; Fri, 28 Jun 2024 18:36:48 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 590B1405E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1719599808; bh=7bZF09M6R8O0C4JDZi6yzz4HIhxFtL/NIFvwaFWUPZE=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=q7Eh6vNFlY1Cszgx/UMVSn5jK/zQ/Z2srveztjMXqdpfOhAhvmdeutpdILuVLlnes sWdIhTDJM/CV5hNxddgSnbpHsnyaQnvGAS3ZObsVpuzbCMA3gzdYSsKTB5sdUEG9qx L3kpcmK6nfg4ddLPTEzzBLq4agOvepiLaoS0DAdCFkDwuXz005ljzNcr0vp373jIBV T/mfCzVY1mkcHyZy/COEhJOdoXDPisrYb9IYaV9943Tbv5k9m3eUDqWEFNjIFFx6j+ 9Wfc+WjmkcllPcOr+k8KWkkvVInPdKIUZnSCCU3f77AfhKajtoTm2/Irr17TAwpXik EQAo+H5GA+4mQ== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 590B1405E7; Fri, 28 Jun 2024 18:36:48 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id D8C221BF39A for ; Fri, 28 Jun 2024 18:36:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C46D9845B9 for ; Fri, 28 Jun 2024 18:36:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WfFQuBcm-eq2 for ; Fri, 28 Jun 2024 18:36:46 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 0CD87845B5 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0CD87845B5 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp1.osuosl.org (Postfix) with ESMTPS id 0CD87845B5 for ; Fri, 28 Jun 2024 18:36:45 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 236B46223E; Fri, 28 Jun 2024 18:36:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D205C116B1; Fri, 28 Jun 2024 18:36:43 +0000 (UTC) Date: Fri, 28 Jun 2024 19:36:41 +0100 From: Simon Horman To: Marcin Szycik Message-ID: <20240628183641.GG837606@kernel.org> References: <20240627145547.32621-1-marcin.szycik@linux.intel.com> <20240627145547.32621-8-marcin.szycik@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240627145547.32621-8-marcin.szycik@linux.intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719599804; bh=Vu4DMeYFylySur1lZ4EtGg+jOO6nbzB22102RW+KNOs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wjged7CM6F7FluzMhLSH8QUM3VRBeUwE1K9i7VgI4f2vSWHu2iihV2p3tq2qSFWD1 gyr7UlilP+EFBS2Ie3Ly1U8NbpLseZDomKPz+GHUb1pnZ3usAlMVKMdhMJC7zrjXxL g5DyFaSSI1tiDfAp/qhk/RcNpLBNGrhOECaNaD0mM/lNlf6RyyqXo4EUdM3mA6iIcD 5sxSDPQIsncDftfewK76bd4El3uX7XnPnLRuCUJ6H2s55nbvKlsioL+pcn6DZ/s6l+ g39Q+4cF1a+paUCqInhwth1UWiEmx1K2mtNifPyPY3vNuLg+PO4jslg7svoat3Ab2V +iBkfgEDwxPYQ== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Wjged7CM Subject: Re: [Intel-wired-lan] [PATCH iwl-next v3 7/7] ice: Add tracepoint for adding and removing switch rules X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pmenzel@molgen.mpg.de, netdev@vger.kernel.org, aleksander.lobakin@intel.com, intel-wired-lan@lists.osuosl.org, przemyslaw.kitszel@intel.com, michal.swiatkowski@linux.intel.com Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, Jun 27, 2024 at 04:55:47PM +0200, Marcin Szycik wrote: > Track the number of rules and recipes added to switch. Add a tracepoint to > ice_aq_sw_rules(), which shows both rule and recipe count. This information > can be helpful when designing a set of rules to program to the hardware, as > it shows where the practical limit is. Actual limits are known (64 recipes, > 32k rules), but it's hard to translate these values to how many rules the > *user* can actually create, because of extra metadata being implicitly > added, and recipe/rule chaining. Chaining combines several recipes/rules to > create a larger recipe/rule, so one large rule added by the user might > actually consume multiple rules from hardware perspective. > > Rule counter is simply incremented/decremented in ice_aq_sw_rules(), since > all rules are added or removed via it. > > Counting recipes is harder, as recipes can't be removed (only overwritten). > Recipes added via ice_aq_add_recipe() could end up being unused, when > there is an error in later stages of rule creation. Instead, track the > allocation and freeing of recipes, which should reflect the actual usage of > recipes (if something fails after recipe(s) were created, caller should > free them). Also, a number of recipes are loaded from NVM by default - > initialize the recipe counter with the number of these recipes on switch > initialization. > > Example configuration: > cd /sys/kernel/tracing > echo function > current_tracer > echo ice_aq_sw_rules > set_ftrace_filter > echo ice_aq_sw_rules > set_event > echo 1 > tracing_on > cat trace > > Example output: > tc-4097 [069] ...1. 787.595536: ice_aq_sw_rules <-ice_rem_adv_rule > tc-4097 [069] ..... 787.595705: ice_aq_sw_rules: rules=9 recipes=15 > tc-4098 [057] ...1. 787.652033: ice_aq_sw_rules <-ice_add_adv_rule > tc-4098 [057] ..... 787.652201: ice_aq_sw_rules: rules=10 recipes=16 > > Reviewed-by: Michal Swiatkowski > Reviewed-by: Przemek Kitszel > Signed-off-by: Marcin Szycik Reviewed-by: Simon Horman From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3016125634 for ; Fri, 28 Jun 2024 18:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719599805; cv=none; b=JLHNsT/aEHxDUSC/JOp8pVEvxpuCn8pOVfHtVobVLcVE0T6/Nd90FGpjsTzpsdcgPia5dChXDAeUnByYPzIG6ZU7GICb1328cfENdiSeLGUygeAPphEi2oMZ4MqyIR5nzMyHv30EgjmyNeXy2saDkBzCyplQIc/kryZ6T7bW7po= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719599805; c=relaxed/simple; bh=Vu4DMeYFylySur1lZ4EtGg+jOO6nbzB22102RW+KNOs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S/xLhS6vtU1y9WeMV5OqOjfaW2qIpb9L6grsHfOsYcEcs6pl6EU86U/3pnXhPh1pplAuO+byQPvVKu83fD4NVTtm/8SrQfIuhvWHvukBY93MNyrjeuJjwbHci9UA5hC3uHF4ak4SVbIE3ezMKcmKYyTzBcB7HaOx5+mcX18/wMY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wjged7CM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wjged7CM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D205C116B1; Fri, 28 Jun 2024 18:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719599804; bh=Vu4DMeYFylySur1lZ4EtGg+jOO6nbzB22102RW+KNOs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wjged7CM6F7FluzMhLSH8QUM3VRBeUwE1K9i7VgI4f2vSWHu2iihV2p3tq2qSFWD1 gyr7UlilP+EFBS2Ie3Ly1U8NbpLseZDomKPz+GHUb1pnZ3usAlMVKMdhMJC7zrjXxL g5DyFaSSI1tiDfAp/qhk/RcNpLBNGrhOECaNaD0mM/lNlf6RyyqXo4EUdM3mA6iIcD 5sxSDPQIsncDftfewK76bd4El3uX7XnPnLRuCUJ6H2s55nbvKlsioL+pcn6DZ/s6l+ g39Q+4cF1a+paUCqInhwth1UWiEmx1K2mtNifPyPY3vNuLg+PO4jslg7svoat3Ab2V +iBkfgEDwxPYQ== Date: Fri, 28 Jun 2024 19:36:41 +0100 From: Simon Horman To: Marcin Szycik Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, michal.swiatkowski@linux.intel.com, przemyslaw.kitszel@intel.com, aleksander.lobakin@intel.com, pmenzel@molgen.mpg.de Subject: Re: [PATCH iwl-next v3 7/7] ice: Add tracepoint for adding and removing switch rules Message-ID: <20240628183641.GG837606@kernel.org> References: <20240627145547.32621-1-marcin.szycik@linux.intel.com> <20240627145547.32621-8-marcin.szycik@linux.intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240627145547.32621-8-marcin.szycik@linux.intel.com> On Thu, Jun 27, 2024 at 04:55:47PM +0200, Marcin Szycik wrote: > Track the number of rules and recipes added to switch. Add a tracepoint to > ice_aq_sw_rules(), which shows both rule and recipe count. This information > can be helpful when designing a set of rules to program to the hardware, as > it shows where the practical limit is. Actual limits are known (64 recipes, > 32k rules), but it's hard to translate these values to how many rules the > *user* can actually create, because of extra metadata being implicitly > added, and recipe/rule chaining. Chaining combines several recipes/rules to > create a larger recipe/rule, so one large rule added by the user might > actually consume multiple rules from hardware perspective. > > Rule counter is simply incremented/decremented in ice_aq_sw_rules(), since > all rules are added or removed via it. > > Counting recipes is harder, as recipes can't be removed (only overwritten). > Recipes added via ice_aq_add_recipe() could end up being unused, when > there is an error in later stages of rule creation. Instead, track the > allocation and freeing of recipes, which should reflect the actual usage of > recipes (if something fails after recipe(s) were created, caller should > free them). Also, a number of recipes are loaded from NVM by default - > initialize the recipe counter with the number of these recipes on switch > initialization. > > Example configuration: > cd /sys/kernel/tracing > echo function > current_tracer > echo ice_aq_sw_rules > set_ftrace_filter > echo ice_aq_sw_rules > set_event > echo 1 > tracing_on > cat trace > > Example output: > tc-4097 [069] ...1. 787.595536: ice_aq_sw_rules <-ice_rem_adv_rule > tc-4097 [069] ..... 787.595705: ice_aq_sw_rules: rules=9 recipes=15 > tc-4098 [057] ...1. 787.652033: ice_aq_sw_rules <-ice_add_adv_rule > tc-4098 [057] ..... 787.652201: ice_aq_sw_rules: rules=10 recipes=16 > > Reviewed-by: Michal Swiatkowski > Reviewed-by: Przemek Kitszel > Signed-off-by: Marcin Szycik Reviewed-by: Simon Horman