IXGBE_VT_MSGINFO_SHIFT;
if (index) {
- if (new_mac == NULL)
- return -1;
-
if (!rte_is_valid_assigned_ether_addr(
(struct rte_ether_addr *)new_mac)) {
PMD_DRV_LOG(ERR, "set invalid mac vf:%d\n", vf);
hw->mac.ops.set_rar(hw, vf_info[vf].mac_count,
new_mac, vf, IXGBE_RAH_AV);
} else {
- hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count);
- vf_info[vf].mac_count = 0;
+ if (vf_info[vf].mac_count) {
+ hw->mac.ops.clear_rar(hw, vf_info[vf].mac_count);
+ vf_info[vf].mac_count = 0;
+ }
}
return 0;
}