netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: edward.cree@amd.com
Cc: linux-net-drivers@amd.com, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, edumazet@google.com,
	Edward Cree <ecree.xilinx@gmail.com>,
	netdev@vger.kernel.org, habetsm.xilinx@gmail.com,
	Jonathan Cooper <jonathan.s.cooper@amd.com>
Subject: Re: [PATCH net-next 6/7] sfc: add debugfs entries for filter table status
Date: Mon, 11 Dec 2023 19:25:40 +0000	[thread overview]
Message-ID: <20231211192540.GR5817@kernel.org> (raw)
In-Reply-To: <fc28d967fbffd53f61a1d42332ee7bc64435df7c.1702314695.git.ecree.xilinx@gmail.com>

On Mon, Dec 11, 2023 at 05:18:31PM +0000, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Filter table management is complicated by the possibility of overflow
>  kicking us into a promiscuous fallback for either unicast or multicast.
>  Expose the internal flags that drive this.
> Since the table state (efx->filter_state) has a separate, shorter
>  lifetime than struct efx_nic, put its debugfs nodes in a subdirectory
>  (efx->filter_state->debug_dir) so that they can be cleaned up easily
>  before the filter_state is freed.
> 
> Reviewed-by: Jonathan Cooper <jonathan.s.cooper@amd.com>
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>

...

> index 4ff6586116ee..a4ab45082c8f 100644
> --- a/drivers/net/ethernet/sfc/mcdi_filters.c
> +++ b/drivers/net/ethernet/sfc/mcdi_filters.c
> @@ -1348,6 +1348,20 @@ int efx_mcdi_filter_table_probe(struct efx_nic *efx, bool multicast_chaining)
>  	INIT_LIST_HEAD(&table->vlan_list);
>  	init_rwsem(&table->lock);
>  
> +#ifdef CONFIG_DEBUG_FS
> +	table->debug_dir = debugfs_create_dir("filters", efx->debug_dir);
> +	debugfs_create_bool("uc_promisc", 0444, table->debug_dir,
> +			    &table->uc_promisc);
> +	debugfs_create_bool("mc_promisc", 0444, table->debug_dir,
> +			    &table->mc_promisc);
> +	debugfs_create_bool("mc_promisc_last", 0444, table->debug_dir,
> +			    &table->mc_promisc_last);
> +	debugfs_create_bool("mc_overflow", 0444, table->debug_dir,
> +			    &table->mc_overflow);
> +	debugfs_create_bool("mc_chaining", 0444, table->debug_dir,
> +			    &table->mc_chaining);
> +#endif
> +
>  	efx->filter_state = table;
>  
>  	return 0;
> @@ -1518,6 +1532,10 @@ void efx_mcdi_filter_table_remove(struct efx_nic *efx)
>  		return;
>  
>  	vfree(table->entry);
> +#ifdef CONFIG_DEBUG_FS
> +	/* Remove debugfs entries pointing into @table */
> +	debugfs_remove_recursive(table->debug_dir);
> +#endif
>  	kfree(table);
>  }
>  

Hi Edward,

I think debugfs.h needs to be included so that debugfs_*() are defined.

...

-- 
pw-bot: changes-requested


  reply	other threads:[~2023-12-11 19:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11 17:18 [PATCH net-next 0/7] sfc: initial debugfs support edward.cree
2023-12-11 17:18 ` [PATCH net-next 1/7] sfc: initial debugfs implementation edward.cree
2023-12-15  0:05   ` Nelson, Shannon
2024-02-08 21:25     ` Edward Cree
2023-12-11 17:18 ` [PATCH net-next 2/7] sfc: debugfs for channels edward.cree
2023-12-12 19:54   ` kernel test robot
2023-12-11 17:18 ` [PATCH net-next 3/7] sfc: debugfs for (nic) RX queues edward.cree
2023-12-12 22:06   ` kernel test robot
2023-12-15  0:05   ` Nelson, Shannon
2025-02-14 15:51     ` Edward Cree
2025-02-14 17:39       ` Nelson, Shannon
2023-12-11 17:18 ` [PATCH net-next 4/7] sfc: debugfs for (nic) TX queues edward.cree
2023-12-13  0:15   ` kernel test robot
2023-12-11 17:18 ` [PATCH net-next 5/7] sfc: add debugfs nodes for loopback mode edward.cree
2023-12-11 17:18 ` [PATCH net-next 6/7] sfc: add debugfs entries for filter table status edward.cree
2023-12-11 19:25   ` Simon Horman [this message]
2023-12-15  0:05   ` Nelson, Shannon
2025-02-14 16:23     ` Edward Cree
2025-02-14 17:47       ` Nelson, Shannon
2023-12-11 17:18 ` [PATCH net-next 7/7] sfc: add debugfs node for filter table contents edward.cree
2023-12-11 19:17   ` Simon Horman
2023-12-12 13:58     ` Edward Cree
2023-12-12 15:14       ` Edward Cree
2023-12-12 16:19         ` Jakub Kicinski
2023-12-13 12:15           ` Edward Cree
2023-12-14 16:56             ` Simon Horman
2023-12-15  0:05   ` Nelson, Shannon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231211192540.GR5817@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=edward.cree@amd.com \
    --cc=habetsm.xilinx@gmail.com \
    --cc=jonathan.s.cooper@amd.com \
    --cc=kuba@kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).