Skip to contentSkip to conversation

idpf: Fix flow rule delete failure due to invalid validation

PATCH In review Sreedevi Joshi 3 participants 4 messages Jan 13 – Jan 16

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

PATCH 1/1 idpf: Fix flow rule delete failure due to invalid validation

When deleting a flow rule using "ethtool -N <dev> delete <location>", idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even though ethtool doesn't populate this field for delete operations. The uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check and ring_cookie validation during delete operations since action validation is not required when removing existing rules.

Fixes ada3e24b84a0 ("idpf: add flow steering support")
---
 drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -3
index 2efa3c08aba5..49cefb973f4d 100644
@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev,
 	vport_config = vport->adapter->vport_config[np->vport_idx];
 	user_config = &vport_config->user_config;
 
-	if (!idpf_sideband_action_ena(vport, fsp))
-		return -EOPNOTSUPP;
-
 	rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL);
 	if (!rule)
 		return -ENOMEM;
Signature · 1 line
2.25.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Sreedevi Joshi

When deleting a flow rule using "ethtool -N <dev> delete <location>", idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even though ethtool doesn't populate this field for delete operations. The uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check and ring_cookie validation during delete operations since action validation is not required when removing existing rules.

Quoted 3 lines
Fixes ada3e24b84a0 ("idpf: add flow steering support")

Thanks,

I agree with your analysis.
And that the problem was introduced by the cited commit.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Sreedevi Joshi

[Cc: +Ahmed Zaki]

Dear Sreedevi,

Thank you for your patch.

Am 13.01.26 um 19:01 schrieb Sreedevi Joshi:

Quoted 21 lines

When deleting a flow rule using "ethtool -N <dev> delete <location>", idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even though ethtool doesn't populate this field for delete operations. The uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check and ring_cookie validation during delete operations since action validation is not required when removing existing rules.

Fixes ada3e24b84a0 ("idpf: add flow steering support")
---
  drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -0
index 2efa3c08aba5..49cefb973f4d 100644

drivers/net/ethernet/intel/idpf/idpf_ethtool.c static int idpf_del_flow_steer(struct net_device *netdev, · line 312

Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -3
@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev,
  	vport_config = vport->adapter->vport_config[np->vport_idx];
  	user_config = &vport_config->user_config;
 
-	if (!idpf_sideband_action_ena(vport, fsp))
-		return -EOPNOTSUPP;
-
  	rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL);
  	if (!rule)
  		return -ENOMEM;

Kind regards,

Paul

#3 lore raw

[Cc: Remove Ahmed as address bounces]

Am 16.01.26 um 18:39 schrieb Paul Menzel:

Quoted 43 lines

Dear Sreedevi,

Thank you for your patch.

Am 13.01.26 um 19:01 schrieb Sreedevi Joshi:

Quoted 21 lines

When deleting a flow rule using "ethtool -N <dev> delete <location>", idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even though ethtool doesn't populate this field for delete operations. The uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate rule deletions. Remove the unnecessary sideband action enable check and ring_cookie validation during delete operations since action validation is not required when removing existing rules.

Fixes ada3e24b84a0 ("idpf: add flow steering support")

---
  drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 ---

  1 file changed, 3 deletions(-)
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -0
index 2efa3c08aba5..49cefb973f4d 100644

drivers/net/ethernet/intel/idpf/idpf_ethtool.c static int idpf_del_flow_steer(struct net_device · line 312

Quoted 9 lines
drivers/net/ethernet/intel/idpf/idpf_ethtool.c +0 -3
@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device 
 *netdev,
       vport_config = vport->adapter->vport_config[np->vport_idx];
       user_config = &vport_config->user_config;
-    if (!idpf_sideband_action_ena(vport, fsp))
-        return -EOPNOTSUPP;
-
       rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL);
       if (!rule)
           return -ENOMEM;

Kind regards,

Paul