Commit ad85de0f authored by Petr Oros's avatar Petr Oros Committed by Tony Nguyen
Browse files

ice: fix inverted ready check for VF representors



Commit 0f00a897 ("ice: check if SF is ready in ethtool ops")
refactored the VF readiness check into a generic repr->ops.ready()
callback but implemented ice_repr_ready_vf() with inverted logic:

  return !ice_check_vf_ready_for_cfg(repr->vf);

ice_check_vf_ready_for_cfg() returns 0 on success, so the negation
makes ready() return non-zero when the VF is ready. All callers treat
non-zero as "not ready, skip", causing ndo_get_stats64, get_drvinfo,
get_strings and get_ethtool_stats to always bail out in switchdev mode.

Remove the erroneous negation. The SF variant ice_repr_ready_sf() is
already correct (returns !active, i.e. non-zero when not active).

Fixes: 0f00a897 ("ice: check if SF is ready in ethtool ops")
Signed-off-by: default avatarPetr Oros <poros@redhat.com>
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: default avatarPatryk Holda <patryk.holda@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent c7fcd269
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ ice_repr_reg_netdev(struct net_device *netdev, const struct net_device_ops *ops)

static int ice_repr_ready_vf(struct ice_repr *repr)
{
	return !ice_check_vf_ready_for_cfg(repr->vf);
	return ice_check_vf_ready_for_cfg(repr->vf);
}

static int ice_repr_ready_sf(struct ice_repr *repr)