diff mbox series

net: ti/cpsw_new: Expose the same module parameters as ti/cpsw.

Message ID 20230814211323.3272487-1-gsmecher@threespeedlogic.com (mailing list archive)
State New, archived
Headers show
Series net: ti/cpsw_new: Expose the same module parameters as ti/cpsw. | expand

Commit Message

Graeme Smecher Aug. 14, 2023, 9:13 p.m. UTC
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(+)

Comments

Andrew Lunn Aug. 14, 2023, 9:45 p.m. UTC | #1
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
diff mbox series

Patch

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;