Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit fa6ab2d

Browse files
Marcin Szycikgregkh
authored andcommitted
ice: Fix netif_is_ice() in Safe Mode
[ Upstream commit 8e60dbc ] netif_is_ice() works by checking the pointer to netdev ops. However, it only checks for the default ice_netdev_ops, not ice_netdev_safe_mode_ops, so in Safe Mode it always returns false, which is unintuitive. While it doesn't look like netif_is_ice() is currently being called anywhere in Safe Mode, this could change and potentially lead to unexpected behaviour. Fixes: df006dd ("ice: Add initial support framework for LAG") Reviewed-by: Przemek Kitszel <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Reviewed-by: Brett Creeley <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent a91c6e1 commit fa6ab2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ ice_indr_setup_tc_cb(struct net_device *netdev, struct Qdisc *sch,
8484

8585
bool netif_is_ice(const struct net_device *dev)
8686
{
87-
return dev && (dev->netdev_ops == &ice_netdev_ops);
87+
return dev && (dev->netdev_ops == &ice_netdev_ops ||
88+
dev->netdev_ops == &ice_netdev_safe_mode_ops);
8889
}
8990

9091
/**

0 commit comments

Comments
 (0)