Lines Matching refs:ionic

16 	struct ionic *ionic = from_timer(ionic, t, watchdog_timer);  in ionic_watchdog_cb()  local
17 struct ionic_lif *lif = ionic->lif; in ionic_watchdog_cb()
21 mod_timer(&ionic->watchdog_timer, in ionic_watchdog_cb()
22 round_jiffies(jiffies + ionic->watchdog_period)); in ionic_watchdog_cb()
27 hb = ionic_heartbeat_check(ionic); in ionic_watchdog_cb()
28 dev_dbg(ionic->dev, "%s: hb %d running %d UP %d\n", in ionic_watchdog_cb()
71 static int ionic_get_preferred_cpu(struct ionic *ionic, in ionic_get_preferred_cpu() argument
78 cpu = cpumask_local_spread(0, dev_to_node(ionic->dev)); in ionic_get_preferred_cpu()
83 static void ionic_queue_dbell_napi_work(struct ionic *ionic, in ionic_queue_dbell_napi_work() argument
91 cpu = ionic_get_preferred_cpu(ionic, &qcq->intr); in ionic_queue_dbell_napi_work()
92 queue_work_on(cpu, ionic->wq, &qcq->doorbell_napi_work); in ionic_queue_dbell_napi_work()
97 struct ionic *ionic = container_of(work, struct ionic, in ionic_doorbell_check_dwork() local
99 struct ionic_lif *lif = ionic->lif; in ionic_doorbell_check_dwork()
115 ionic_queue_dbell_napi_work(ionic, lif->txqcqs[i]); in ionic_doorbell_check_dwork()
116 ionic_queue_dbell_napi_work(ionic, lif->rxqcqs[i]); in ionic_doorbell_check_dwork()
128 ionic_queue_doorbell_check(ionic, IONIC_NAPI_DEADLINE); in ionic_doorbell_check_dwork()
131 bool ionic_doorbell_wa(struct ionic *ionic) in ionic_doorbell_wa() argument
133 u8 asic_type = ionic->idev.dev_info.asic_type; in ionic_doorbell_wa()
138 static int ionic_watchdog_init(struct ionic *ionic) in ionic_watchdog_init() argument
140 struct ionic_dev *idev = &ionic->idev; in ionic_watchdog_init()
142 timer_setup(&ionic->watchdog_timer, ionic_watchdog_cb, 0); in ionic_watchdog_init()
143 ionic->watchdog_period = IONIC_WATCHDOG_SECS * HZ; in ionic_watchdog_init()
147 idev->last_hb_time = jiffies - 2 * ionic->watchdog_period; in ionic_watchdog_init()
155 ionic->wq = alloc_workqueue("%s-wq", WQ_UNBOUND, 0, in ionic_watchdog_init()
156 dev_name(ionic->dev)); in ionic_watchdog_init()
157 if (!ionic->wq) { in ionic_watchdog_init()
158 dev_err(ionic->dev, "alloc_workqueue failed"); in ionic_watchdog_init()
162 if (ionic_doorbell_wa(ionic)) in ionic_watchdog_init()
163 INIT_DELAYED_WORK(&ionic->doorbell_check_dwork, in ionic_watchdog_init()
169 void ionic_queue_doorbell_check(struct ionic *ionic, int delay) in ionic_queue_doorbell_check() argument
173 if (!ionic->lif->doorbell_wa) in ionic_queue_doorbell_check()
176 cpu = ionic_get_preferred_cpu(ionic, &ionic->lif->adminqcq->intr); in ionic_queue_doorbell_check()
177 queue_delayed_work_on(cpu, ionic->wq, &ionic->doorbell_check_dwork, in ionic_queue_doorbell_check()
181 void ionic_init_devinfo(struct ionic *ionic) in ionic_init_devinfo() argument
183 struct ionic_dev *idev = &ionic->idev; in ionic_init_devinfo()
199 dev_dbg(ionic->dev, "fw_version %s\n", idev->dev_info.fw_version); in ionic_init_devinfo()
202 int ionic_dev_setup(struct ionic *ionic) in ionic_dev_setup() argument
204 struct ionic_dev_bar *bar = ionic->bars; in ionic_dev_setup()
205 unsigned int num_bars = ionic->num_bars; in ionic_dev_setup()
206 struct ionic_dev *idev = &ionic->idev; in ionic_dev_setup()
207 struct device *dev = ionic->dev; in ionic_dev_setup()
237 ionic_init_devinfo(ionic); in ionic_dev_setup()
246 err = ionic_watchdog_init(ionic); in ionic_dev_setup()
256 if (num_bars < 3 || !ionic->bars[IONIC_PCI_BAR_CMB].len) { in ionic_dev_setup()
271 void ionic_dev_teardown(struct ionic *ionic) in ionic_dev_teardown() argument
273 struct ionic_dev *idev = &ionic->idev; in ionic_dev_teardown()
280 destroy_workqueue(ionic->wq); in ionic_dev_teardown()
310 int ionic_heartbeat_check(struct ionic *ionic) in ionic_heartbeat_check() argument
313 struct ionic_dev *idev = &ionic->idev; in ionic_heartbeat_check()
314 struct ionic_lif *lif = ionic->lif; in ionic_heartbeat_check()
330 dev_dbg(ionic->dev, "%s: do_check_time again\n", __func__); in ionic_heartbeat_check()
340 dev_info(ionic->dev, "FW generation 0x%02x -> 0x%02x\n", in ionic_heartbeat_check()
363 dev_dbg(ionic->dev, "fw_status 0x%02x ready %d idev->ready %d last_hb 0x%x state 0x%02lx\n", in ionic_heartbeat_check()
377 dev_info(ionic->dev, "FW stopped 0x%02x\n", fw_status); in ionic_heartbeat_check()
382 dev_info(ionic->dev, "FW running 0x%02x\n", fw_status); in ionic_heartbeat_check()
415 dev_dbg(ionic->dev, "%s: fw_hb %u last_fw_hb %u ready %u\n", in ionic_heartbeat_check()
424 dev_info(ionic->dev, "FW heartbeat stalled at %d\n", fw_hb); in ionic_heartbeat_check()
426 dev_info(ionic->dev, "FW heartbeat restored at %d\n", fw_hb); in ionic_heartbeat_check()
593 int ionic_set_vf_config(struct ionic *ionic, int vf, in ionic_set_vf_config() argument
605 mutex_lock(&ionic->dev_cmd_lock); in ionic_set_vf_config()
606 ionic_dev_cmd_go(&ionic->idev, &cmd); in ionic_set_vf_config()
607 err = ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_set_vf_config()
608 mutex_unlock(&ionic->dev_cmd_lock); in ionic_set_vf_config()
613 void ionic_vf_start(struct ionic *ionic) in ionic_vf_start() argument
620 if (!(ionic->ident.dev.capabilities & cpu_to_le64(IONIC_DEV_CAP_VF_CTRL))) in ionic_vf_start()
623 ionic_dev_cmd_go(&ionic->idev, &cmd); in ionic_vf_start()
624 ionic_dev_cmd_wait(ionic, DEVCMD_TIMEOUT); in ionic_vf_start()
705 struct ionic_dev *idev = &lif->ionic->idev; in ionic_get_cmb()
723 struct ionic_dev *idev = &lif->ionic->idev; in ionic_put_cmb()
749 cq->idev = &lif->ionic->idev; in ionic_cq_init()