Lines Matching defs:sdev

64 static int siw_device_register(struct siw_device *sdev, const char *name)
66 struct ib_device *base_dev = &sdev->base_dev;
70 sdev->vendor_part_id = dev_id++;
78 siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr);
85 struct siw_device *sdev = to_siw_dev(base_dev);
87 xa_destroy(&sdev->qp_xa);
88 xa_destroy(&sdev->mem_xa);
187 int siw_get_tx_cpu(struct siw_device *sdev)
190 int i, num_cpus, cpu, min_use, node = sdev->numa_node, tx_cpu = -1;
222 siw_dbg(&sdev->base_dev,
306 struct siw_device *sdev = NULL;
310 sdev = ib_alloc_device(siw_device, base_dev);
311 if (!sdev)
314 base_dev = &sdev->base_dev;
316 sdev->netdev = netdev;
370 xa_init_flags(&sdev->qp_xa, XA_FLAGS_ALLOC1);
371 xa_init_flags(&sdev->mem_xa, XA_FLAGS_ALLOC1);
384 sdev->attrs.max_qp = SIW_MAX_QP;
385 sdev->attrs.max_qp_wr = SIW_MAX_QP_WR;
386 sdev->attrs.max_ord = SIW_MAX_ORD_QP;
387 sdev->attrs.max_ird = SIW_MAX_IRD_QP;
388 sdev->attrs.max_sge = SIW_MAX_SGE;
389 sdev->attrs.max_sge_rd = SIW_MAX_SGE_RD;
390 sdev->attrs.max_cq = SIW_MAX_CQ;
391 sdev->attrs.max_cqe = SIW_MAX_CQE;
392 sdev->attrs.max_mr = SIW_MAX_MR;
393 sdev->attrs.max_pd = SIW_MAX_PD;
394 sdev->attrs.max_mw = SIW_MAX_MW;
395 sdev->attrs.max_srq = SIW_MAX_SRQ;
396 sdev->attrs.max_srq_wr = SIW_MAX_SRQ_WR;
397 sdev->attrs.max_srq_sge = SIW_MAX_SGE;
399 INIT_LIST_HEAD(&sdev->cep_list);
400 INIT_LIST_HEAD(&sdev->qp_list);
402 atomic_set(&sdev->num_ctx, 0);
403 atomic_set(&sdev->num_srq, 0);
404 atomic_set(&sdev->num_qp, 0);
405 atomic_set(&sdev->num_cq, 0);
406 atomic_set(&sdev->num_mr, 0);
407 atomic_set(&sdev->num_pd, 0);
409 sdev->numa_node = dev_to_node(&netdev->dev);
410 spin_lock_init(&sdev->lock);
412 return sdev;
425 struct siw_device *sdev =
434 list_for_each_safe(pos, tmp, &sdev->qp_list) {
441 ib_device_put(&sdev->base_dev);
444 static void siw_device_goes_down(struct siw_device *sdev)
446 if (ib_device_try_get(&sdev->base_dev)) {
447 INIT_WORK(&sdev->netdev_down, siw_netdev_down);
448 schedule_work(&sdev->netdev_down);
457 struct siw_device *sdev;
465 sdev = to_siw_dev(base_dev);
469 sdev->state = IB_PORT_ACTIVE;
470 siw_port_event(sdev, 1, IB_EVENT_PORT_ACTIVE);
474 siw_device_goes_down(sdev);
478 sdev->state = IB_PORT_DOWN;
479 siw_port_event(sdev, 1, IB_EVENT_PORT_ERR);
492 ib_unregister_device_queued(&sdev->base_dev);
496 siw_port_event(sdev, 1, IB_EVENT_LID_CHANGE);
508 ib_device_put(&sdev->base_dev);
520 struct siw_device *sdev = NULL;
531 sdev = siw_device_create(netdev);
532 if (sdev) {
536 sdev->state = IB_PORT_ACTIVE;
538 sdev->state = IB_PORT_DOWN;
540 rv = siw_device_register(sdev, basedev_name);
542 ib_dealloc_device(&sdev->base_dev);