[PATCH v3 2/2] staging: octeon: match exact interface names in pow_send_list
From: Oscar Alejandro Sánchez Lucero via B4 Relay
Date: Wed Nov 11 2026 - 22:35:35 EST
From: Oscar Alejandro Sánchez Lucero <aleszlucero@xxxxxxxxx>
cvm_oct_common_init() searches pow_send_list using strstr(), which matches
substrings instead of exact interface names.
Split a local copy of pow_send_list on comas with strsep() and compare
each entry using strcmp().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@xxxxxxxxx>
---
drivers/staging/octeon/ethernet.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index c77678cb351f..653cf3727ba7 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -431,9 +431,23 @@ int cvm_oct_common_init(struct net_device *dev)
* Force the interface to use the POW send if always_use_pow
* was specified or it is in the pow send list.
*/
- if ((pow_send_group != -1) &&
- (always_use_pow || strstr(pow_send_list, dev->name)))
- priv->queue = -1;
+ if (pow_send_group != -1) {
+ if (always_use_pow) {
+ priv->queue = -1;
+ } else if (pow_send_list[0]) {
+ char list[sizeof(pow_send_list)];
+ char *p = list;
+ char *token;
+
+ strscpy(list, pow_send_list, sizeof(list));
+ while ((token = strsep(&p, ",")) != NULL) {
+ if (!strcmp(token, dev->name)) {
+ priv->queue = -1;
+ break;
+ }
+ }
+ }
+ }
if (priv->queue != -1)
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
--
2.56.0