Skip to contentSkip to conversation

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

PATCH In review Graeme Smecher 2 participants 2 messages Aug 14, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/net/ethernet/ti/cpsw_new.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/net/ethernet/ti/cpsw_new.c +11 -0
index c61e4e44a78f..6d05ec288792 100644
@@ -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;
Signature · 1 line
2.39.2
#1 lore raw
Quoted 7 lines · Graeme Smecher

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

Quoted 8 lines

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