linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ti/cpsw_new: Expose the same module parameters as ti/cpsw.
@ 2023-08-14 21:13 Graeme Smecher
  2023-08-14 21:45 ` Andrew Lunn
  0 siblings, 1 reply; 2+ messages in thread
From: Graeme Smecher @ 2023-08-14 21:13 UTC (permalink / raw)
  Cc: Graeme Smecher, Grygorii Strashko, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Wolfram Sang, Lorenzo Bianconi,
	Shay Agroskin, Rob Herring, Yang Yingliang, Marek Majtyka,
	linux-omap, netdev, linux-kernel

The "old" CPSW driver (cpsw.c) exports the following module parameters:

	- ti_cpsw.debug_level
	- ti_cpsw.ale_ageout
	- ti_cpsw.rx_packet_max
	- ti_cpsw.descs_pool_size

This patch exposes the same parameters for the "new" CPSW driver:

	- ti_cpsw_new.debug_level
	- ti_cpsw_new.ale_ageout
	- ti_cpsw_new.rx_packet_max
	- ti_cpsw_new.descs_pool_size

It seems like consistency between the two drivers is a reasonable goal.

Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
---
 drivers/net/ethernet/ti/cpsw_new.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index c61e4e44a78f..6d05ec288792 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -45,9 +45,20 @@
 #include <net/pkt_sched.h>
 
 static int debug_level;
+module_param(debug_level, int, 0);
+MODULE_PARM_DESC(debug_level, "cpsw debug level (NETIF_MSG bits)");
+
 static int ale_ageout = CPSW_ALE_AGEOUT_DEFAULT;
+module_param(ale_ageout, int, 0);
+MODULE_PARM_DESC(ale_ageout, "cpsw ale ageout interval (seconds)");
+
 static int rx_packet_max = CPSW_MAX_PACKET_SIZE;
+module_param(rx_packet_max, int, 0);
+MODULE_PARM_DESC(rx_packet_max, "maximum receive packet size (bytes)");
+
 static int descs_pool_size = CPSW_CPDMA_DESCS_POOL_SIZE_DEFAULT;
+module_param(descs_pool_size, int, 0444);
+MODULE_PARM_DESC(descs_pool_size, "Number of CPDMA CPPI descriptors in pool");
 
 struct cpsw_devlink {
 	struct cpsw_common *cpsw;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: ti/cpsw_new: Expose the same module parameters as ti/cpsw.
  2023-08-14 21:13 [PATCH] net: ti/cpsw_new: Expose the same module parameters as ti/cpsw Graeme Smecher
@ 2023-08-14 21:45 ` Andrew Lunn
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2023-08-14 21:45 UTC (permalink / raw)
  To: Graeme Smecher
  Cc: Grygorii Strashko, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Wolfram Sang, Lorenzo Bianconi, Shay Agroskin,
	Rob Herring, Yang Yingliang, Marek Majtyka, linux-omap, netdev,
	linux-kernel

On Mon, Aug 14, 2023 at 02:13:21PM -0700, Graeme Smecher wrote:
> The "old" CPSW driver (cpsw.c) exports the following module parameters:
> 
> 	- ti_cpsw.debug_level
> 	- ti_cpsw.ale_ageout
> 	- ti_cpsw.rx_packet_max
> 	- ti_cpsw.descs_pool_size
> 
> This patch exposes the same parameters for the "new" CPSW driver:
> 
> 	- ti_cpsw_new.debug_level
> 	- ti_cpsw_new.ale_ageout
> 	- ti_cpsw_new.rx_packet_max
> 	- ti_cpsw_new.descs_pool_size
> 
> It seems like consistency between the two drivers is a reasonable goal.

The new driver was written because the old driver had a lot of bad
practices. module parameters are bad practices, there are better APIs
to use. So that is why they are not present.

ethtool has an API to set debug_level. descs_pool_size sounds a lot
like ethtool --set-ring. I don't know what the other two do, but look
to see if ethtool has an option to set them.

    Andrew

---
pw-bot: cr

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-14 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-14 21:13 [PATCH] net: ti/cpsw_new: Expose the same module parameters as ti/cpsw Graeme Smecher
2023-08-14 21:45 ` Andrew Lunn

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).