ionic_lif_reset(struct ionic_lif *lif)
{
struct ionic_dev *idev = &lif->adapter->idev;
+ int err;
IONIC_PRINT_CALL();
ionic_dev_cmd_lif_reset(idev, lif->index);
- ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+ err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
+ if (err)
+ IONIC_PRINT(WARNING, "Failed to reset lif");
}
static void
}
void
-ionic_dev_remove_mac(struct rte_eth_dev *eth_dev, uint32_t index __rte_unused)
+ionic_dev_remove_mac(struct rte_eth_dev *eth_dev, uint32_t index)
{
struct ionic_lif *lif = IONIC_ETH_DEV_TO_LIF(eth_dev);
struct ionic_adapter *adapter = lif->adapter;
+ struct rte_ether_addr *mac_addr;
IONIC_PRINT_CALL();
return;
}
- if (!rte_is_valid_assigned_ether_addr(ð_dev->data->mac_addrs[index]))
+ mac_addr = ð_dev->data->mac_addrs[index];
+
+ if (!rte_is_valid_assigned_ether_addr(mac_addr))
return;
- ionic_lif_addr_del(lif, (const uint8_t *)
- ð_dev->data->mac_addrs[index]);
+ ionic_lif_addr_del(lif, (const uint8_t *)mac_addr);
}
int
done = ionic_wait_ctx_for_completion(lif, qcq, ctx,
IONIC_DEVCMD_TIMEOUT);
- err = ionic_adminq_check_err(ctx, !done /* timed out */);
- return err;
+ return ionic_adminq_check_err(ctx, !done /* timed out */);
}
static int
int err;
err = ionic_dev_cmd_wait(idev, max_wait);
- if (err)
- return err;
- return ionic_dev_cmd_check_error(idev);
+ if (!err)
+ err = ionic_dev_cmd_check_error(idev);
+
+ return err;
}
int
ionic_init(struct ionic_adapter *adapter)
{
struct ionic_dev *idev = &adapter->idev;
- int err;
ionic_dev_cmd_init(idev);
- err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
- return err;
+ return ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
}
int
ionic_reset(struct ionic_adapter *adapter)
{
struct ionic_dev *idev = &adapter->idev;
- int err;
ionic_dev_cmd_reset(idev);
- err = ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
- return err;
+ return ionic_dev_cmd_wait_check(idev, IONIC_DEVCMD_TIMEOUT);
}
int