* [PATCH] staging: octeon: match exact interface names in pow_send_list
@ 2026-11-07 7:36 Oscar Alejandro Sánchez Lucero via B4 Relay
0 siblings, 0 replies; only message in thread
From: Oscar Alejandro Sánchez Lucero via B4 Relay @ 2026-11-07 7:36 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-staging, linux-kernel, Oscar Alejandro Sánchez Lucero
From: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
cvm_oct_common_init() checks whether dev->name is present in the
comma-separated pow_send_list module parameter using strstr(). This
causes false positives when one interface name is a prefix of another
(for example, matching "eth1" when pow_send_list contains "eth10").
Copy pow_send_list to a temporary buffer, tokenize it with strsep(),
and compare each comma-separated entry with strcmp().
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
---
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 42ec4b8324a8..6684eeb3fc8f 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;
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261107-octeon-pow-send-list-9947e66a10f0
Best regards,
--
Oscar Alejandro Sánchez Lucero <aleszlucero@gmail.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-07 7:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-07 7:36 [PATCH] staging: octeon: match exact interface names in pow_send_list Oscar Alejandro Sánchez Lucero via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®