Lines Matching full:dd
24 struct hfi1_devdata *dd = rx->dd; in hfi1_netdev_setup_ctxt() local
31 ret = hfi1_create_rcvhdrq(dd, uctxt); in hfi1_netdev_setup_ctxt()
53 hfi1_rcvctrl(uctxt->dd, rcvctrl_ops, uctxt); in hfi1_netdev_setup_ctxt()
58 static int hfi1_netdev_allocate_ctxt(struct hfi1_devdata *dd, in hfi1_netdev_allocate_ctxt() argument
64 if (dd->flags & HFI1_FROZEN) in hfi1_netdev_allocate_ctxt()
67 ret = hfi1_create_ctxtdata(dd->pport, dd->node, &uctxt); in hfi1_netdev_allocate_ctxt()
69 dd_dev_err(dd, "Unable to create ctxtdata, failing open\n"); in hfi1_netdev_allocate_ctxt()
85 dd_dev_info(dd, "created netdev context %d\n", uctxt->ctxt); in hfi1_netdev_allocate_ctxt()
91 static void hfi1_netdev_deallocate_ctxt(struct hfi1_devdata *dd, in hfi1_netdev_deallocate_ctxt() argument
100 hfi1_rcvctrl(dd, HFI1_RCVCTRL_CTXT_DIS | in hfi1_netdev_deallocate_ctxt()
108 msix_free_irq(dd, uctxt->msix_intr); in hfi1_netdev_deallocate_ctxt()
114 hfi1_clear_ctxt_pkey(dd, uctxt); in hfi1_netdev_deallocate_ctxt()
125 struct hfi1_devdata *dd = rx->dd; in hfi1_netdev_allot_ctxt() local
127 rc = hfi1_netdev_allocate_ctxt(dd, ctxt); in hfi1_netdev_allot_ctxt()
129 dd_dev_err(dd, "netdev ctxt alloc failed %d\n", rc); in hfi1_netdev_allot_ctxt()
135 dd_dev_err(dd, "netdev ctxt setup failed %d\n", rc); in hfi1_netdev_allot_ctxt()
136 hfi1_netdev_deallocate_ctxt(dd, *ctxt); in hfi1_netdev_allot_ctxt()
145 * @dd: device on which to allocate netdev contexts
156 u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, in hfi1_num_netdev_contexts() argument
167 dd_dev_info(dd, "No receive contexts available for netdevs.\n"); in hfi1_num_netdev_contexts()
172 dd_dev_err(dd, "Unable to allocate cpu_mask for netdevs.\n"); in hfi1_num_netdev_contexts()
176 cpumask_and(node_cpu_mask, cpu_mask, cpumask_of_node(dd->node)); in hfi1_num_netdev_contexts()
190 struct hfi1_devdata *dd = rx->dd; in hfi1_netdev_rxq_init() local
193 rx->num_rx_q = dd->num_netdev_contexts; in hfi1_netdev_rxq_init()
195 GFP_KERNEL, dd->node); in hfi1_netdev_rxq_init()
198 dd_dev_err(dd, "Unable to allocate netdev queue data\n"); in hfi1_netdev_rxq_init()
212 dd_dev_info(dd, "Setting rcv queue %d napi to context %d\n", in hfi1_netdev_rxq_init()
228 dd_dev_err(dd, "Unable to allot receive context\n"); in hfi1_netdev_rxq_init()
233 hfi1_netdev_deallocate_ctxt(dd, rxq->rcd); in hfi1_netdev_rxq_init()
247 struct hfi1_devdata *dd = rx->dd; in hfi1_netdev_rxq_deinit() local
253 hfi1_netdev_deallocate_ctxt(dd, rxq->rcd); in hfi1_netdev_rxq_deinit()
270 dd_dev_info(rx->dd, "enabling queue %d on context %d\n", i, in enable_queues()
273 hfi1_rcvctrl(rx->dd, in enable_queues()
283 msix_netdev_synchronize_irq(rx->dd); in disable_queues()
288 dd_dev_info(rx->dd, "disabling queue %d on context %d\n", i, in disable_queues()
292 hfi1_rcvctrl(rx->dd, in disable_queues()
305 * @dd: hfi1 dev data
307 int hfi1_netdev_rx_init(struct hfi1_devdata *dd) in hfi1_netdev_rx_init() argument
309 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_rx_init()
325 * @dd: hfi1 dev data
327 int hfi1_netdev_rx_destroy(struct hfi1_devdata *dd) in hfi1_netdev_rx_destroy() argument
329 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_rx_destroy()
343 * @dd: hfi1 dev data
348 * Updates dd struct pointer upon success.
353 int hfi1_alloc_rx(struct hfi1_devdata *dd) in hfi1_alloc_rx() argument
357 dd_dev_info(dd, "allocating rx size %ld\n", sizeof(*rx)); in hfi1_alloc_rx()
358 rx = kzalloc_node(sizeof(*rx), GFP_KERNEL, dd->node); in hfi1_alloc_rx()
362 rx->dd = dd; in hfi1_alloc_rx()
368 dd->netdev_rx = rx; in hfi1_alloc_rx()
373 void hfi1_free_rx(struct hfi1_devdata *dd) in hfi1_free_rx() argument
375 if (dd->netdev_rx) { in hfi1_free_rx()
376 dd_dev_info(dd, "hfi1 rx freed\n"); in hfi1_free_rx()
377 kfree(dd->netdev_rx); in hfi1_free_rx()
378 dd->netdev_rx = NULL; in hfi1_free_rx()
389 * @dd: hfi1 dev data
391 void hfi1_netdev_enable_queues(struct hfi1_devdata *dd) in hfi1_netdev_enable_queues() argument
395 if (!dd->netdev_rx) in hfi1_netdev_enable_queues()
398 rx = dd->netdev_rx; in hfi1_netdev_enable_queues()
407 void hfi1_netdev_disable_queues(struct hfi1_devdata *dd) in hfi1_netdev_disable_queues() argument
411 if (!dd->netdev_rx) in hfi1_netdev_disable_queues()
414 rx = dd->netdev_rx; in hfi1_netdev_disable_queues()
429 * @dd: hfi1 dev data
433 int hfi1_netdev_add_data(struct hfi1_devdata *dd, int id, void *data) in hfi1_netdev_add_data() argument
435 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_add_data()
444 * @dd: hfi1 dev data
447 void *hfi1_netdev_remove_data(struct hfi1_devdata *dd, int id) in hfi1_netdev_remove_data() argument
449 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_remove_data()
457 * @dd: hfi1 dev data
460 void *hfi1_netdev_get_data(struct hfi1_devdata *dd, int id) in hfi1_netdev_get_data() argument
462 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_get_data()
470 * @dd: hfi1 dev data
473 void *hfi1_netdev_get_first_data(struct hfi1_devdata *dd, int *start_id) in hfi1_netdev_get_first_data() argument
475 struct hfi1_netdev_rx *rx = dd->netdev_rx; in hfi1_netdev_get_first_data()