1 // SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
3 * Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
6 #include <linux/module.h>
8 #include <linux/utsname.h>
9 #include <linux/version.h>
11 #include <rdma/ib_user_verbs.h>
12 #include <rdma/uverbs_ioctl.h>
16 #define PCI_DEV_ID_EFA0_VF 0xefa0
17 #define PCI_DEV_ID_EFA1_VF 0xefa1
18 #define PCI_DEV_ID_EFA2_VF 0xefa2
19 #define PCI_DEV_ID_EFA3_VF 0xefa3
21 static const struct pci_device_id efa_pci_tbl
[] = {
22 { PCI_VDEVICE(AMAZON
, PCI_DEV_ID_EFA0_VF
) },
23 { PCI_VDEVICE(AMAZON
, PCI_DEV_ID_EFA1_VF
) },
24 { PCI_VDEVICE(AMAZON
, PCI_DEV_ID_EFA2_VF
) },
25 { PCI_VDEVICE(AMAZON
, PCI_DEV_ID_EFA3_VF
) },
29 MODULE_AUTHOR("Amazon.com, Inc. or its affiliates");
30 MODULE_LICENSE("Dual BSD/GPL");
31 MODULE_DESCRIPTION(DEVICE_NAME
);
32 MODULE_DEVICE_TABLE(pci
, efa_pci_tbl
);
36 #define EFA_BASE_BAR_MASK (BIT(EFA_REG_BAR) | BIT(EFA_MEM_BAR))
38 #define EFA_AENQ_ENABLED_GROUPS \
39 (BIT(EFA_ADMIN_FATAL_ERROR) | BIT(EFA_ADMIN_WARNING) | \
40 BIT(EFA_ADMIN_NOTIFICATION) | BIT(EFA_ADMIN_KEEP_ALIVE))
42 extern const struct uapi_definition efa_uapi_defs
[];
44 /* This handler will called for unknown event group or unimplemented handlers */
45 static void unimplemented_aenq_handler(void *data
,
46 struct efa_admin_aenq_entry
*aenq_e
)
48 struct efa_dev
*dev
= (struct efa_dev
*)data
;
50 ibdev_err(&dev
->ibdev
,
51 "Unknown event was received or event with unimplemented handler\n");
54 static void efa_keep_alive(void *data
, struct efa_admin_aenq_entry
*aenq_e
)
56 struct efa_dev
*dev
= (struct efa_dev
*)data
;
58 atomic64_inc(&dev
->stats
.keep_alive_rcvd
);
61 static struct efa_aenq_handlers aenq_handlers
= {
63 [EFA_ADMIN_KEEP_ALIVE
] = efa_keep_alive
,
65 .unimplemented_handler
= unimplemented_aenq_handler
68 static void efa_release_bars(struct efa_dev
*dev
, int bars_mask
)
70 struct pci_dev
*pdev
= dev
->pdev
;
73 release_bars
= pci_select_bars(pdev
, IORESOURCE_MEM
) & bars_mask
;
74 pci_release_selected_regions(pdev
, release_bars
);
77 static void efa_process_comp_eqe(struct efa_dev
*dev
, struct efa_admin_eqe
*eqe
)
79 u16 cqn
= eqe
->u
.comp_event
.cqn
;
82 /* Safe to load as we're in irq and removal calls synchronize_irq() */
83 cq
= xa_load(&dev
->cqs_xa
, cqn
);
85 ibdev_err_ratelimited(&dev
->ibdev
,
86 "Completion event on non-existent CQ[%u]",
91 cq
->ibcq
.comp_handler(&cq
->ibcq
, cq
->ibcq
.cq_context
);
94 static void efa_process_eqe(struct efa_com_eq
*eeq
, struct efa_admin_eqe
*eqe
)
96 struct efa_dev
*dev
= container_of(eeq
->edev
, struct efa_dev
, edev
);
98 if (likely(EFA_GET(&eqe
->common
, EFA_ADMIN_EQE_EVENT_TYPE
) ==
99 EFA_ADMIN_EQE_EVENT_TYPE_COMPLETION
))
100 efa_process_comp_eqe(dev
, eqe
);
102 ibdev_err_ratelimited(&dev
->ibdev
,
103 "Unknown event type received %lu",
104 EFA_GET(&eqe
->common
,
105 EFA_ADMIN_EQE_EVENT_TYPE
));
108 static irqreturn_t
efa_intr_msix_comp(int irq
, void *data
)
110 struct efa_eq
*eq
= data
;
111 struct efa_com_dev
*edev
= eq
->eeq
.edev
;
113 efa_com_eq_comp_intr_handler(edev
, &eq
->eeq
);
118 static irqreturn_t
efa_intr_msix_mgmnt(int irq
, void *data
)
120 struct efa_dev
*dev
= data
;
122 efa_com_admin_q_comp_intr_handler(&dev
->edev
);
123 efa_com_aenq_intr_handler(&dev
->edev
, data
);
128 static int efa_request_irq(struct efa_dev
*dev
, struct efa_irq
*irq
)
132 err
= request_irq(irq
->irqn
, irq
->handler
, 0, irq
->name
, irq
->data
);
134 dev_err(&dev
->pdev
->dev
, "Failed to request irq %s (%d)\n",
139 irq_set_affinity_hint(irq
->irqn
, &irq
->affinity_hint_mask
);
144 static void efa_setup_comp_irq(struct efa_dev
*dev
, struct efa_eq
*eq
,
149 cpu
= vector
- EFA_COMP_EQS_VEC_BASE
;
150 snprintf(eq
->irq
.name
, EFA_IRQNAME_SIZE
, "efa-comp%d@pci:%s", cpu
,
151 pci_name(dev
->pdev
));
152 eq
->irq
.handler
= efa_intr_msix_comp
;
154 eq
->irq
.vector
= vector
;
155 eq
->irq
.irqn
= pci_irq_vector(dev
->pdev
, vector
);
156 cpumask_set_cpu(cpu
, &eq
->irq
.affinity_hint_mask
);
159 static void efa_free_irq(struct efa_dev
*dev
, struct efa_irq
*irq
)
161 irq_set_affinity_hint(irq
->irqn
, NULL
);
162 free_irq(irq
->irqn
, irq
->data
);
165 static void efa_setup_mgmnt_irq(struct efa_dev
*dev
)
169 snprintf(dev
->admin_irq
.name
, EFA_IRQNAME_SIZE
,
170 "efa-mgmnt@pci:%s", pci_name(dev
->pdev
));
171 dev
->admin_irq
.handler
= efa_intr_msix_mgmnt
;
172 dev
->admin_irq
.data
= dev
;
173 dev
->admin_irq
.vector
= dev
->admin_msix_vector_idx
;
174 dev
->admin_irq
.irqn
= pci_irq_vector(dev
->pdev
,
175 dev
->admin_msix_vector_idx
);
176 cpu
= cpumask_first(cpu_online_mask
);
178 &dev
->admin_irq
.affinity_hint_mask
);
179 dev_info(&dev
->pdev
->dev
, "Setup irq:%d name:%s\n",
181 dev
->admin_irq
.name
);
184 static int efa_set_mgmnt_irq(struct efa_dev
*dev
)
186 efa_setup_mgmnt_irq(dev
);
188 return efa_request_irq(dev
, &dev
->admin_irq
);
191 static int efa_request_doorbell_bar(struct efa_dev
*dev
)
193 u8 db_bar_idx
= dev
->dev_attr
.db_bar
;
194 struct pci_dev
*pdev
= dev
->pdev
;
199 db_bar
= BIT(db_bar_idx
);
200 if (!(db_bar
& EFA_BASE_BAR_MASK
)) {
201 pci_mem_bars
= pci_select_bars(pdev
, IORESOURCE_MEM
);
202 if (db_bar
& ~pci_mem_bars
) {
204 "Doorbells BAR unavailable. Requested %#x, available %#x\n",
205 db_bar
, pci_mem_bars
);
209 err
= pci_request_selected_regions(pdev
, db_bar
, DRV_MODULE_NAME
);
212 "pci_request_selected_regions for bar %d failed %d\n",
218 dev
->db_bar_addr
= pci_resource_start(dev
->pdev
, db_bar_idx
);
219 dev
->db_bar_len
= pci_resource_len(dev
->pdev
, db_bar_idx
);
224 static void efa_release_doorbell_bar(struct efa_dev
*dev
)
226 if (!(BIT(dev
->dev_attr
.db_bar
) & EFA_BASE_BAR_MASK
))
227 efa_release_bars(dev
, BIT(dev
->dev_attr
.db_bar
));
230 static void efa_update_hw_hints(struct efa_dev
*dev
,
231 struct efa_com_get_hw_hints_result
*hw_hints
)
233 struct efa_com_dev
*edev
= &dev
->edev
;
235 if (hw_hints
->mmio_read_timeout
)
236 edev
->mmio_read
.mmio_read_timeout
=
237 hw_hints
->mmio_read_timeout
* 1000;
239 if (hw_hints
->poll_interval
)
240 edev
->aq
.poll_interval
= hw_hints
->poll_interval
;
242 if (hw_hints
->admin_completion_timeout
)
243 edev
->aq
.completion_timeout
=
244 hw_hints
->admin_completion_timeout
;
247 static void efa_stats_init(struct efa_dev
*dev
)
249 atomic64_t
*s
= (atomic64_t
*)&dev
->stats
;
252 for (i
= 0; i
< sizeof(dev
->stats
) / sizeof(*s
); i
++, s
++)
256 static void efa_set_host_info(struct efa_dev
*dev
)
258 struct efa_admin_set_feature_resp resp
= {};
259 struct efa_admin_set_feature_cmd cmd
= {};
260 struct efa_admin_host_info
*hinf
;
261 u32 bufsz
= sizeof(*hinf
);
264 if (!efa_com_check_supported_feature_id(&dev
->edev
,
265 EFA_ADMIN_HOST_INFO
))
268 /* Failures in host info set shall not disturb probe */
269 hinf
= dma_alloc_coherent(&dev
->pdev
->dev
, bufsz
, &hinf_dma
,
274 strscpy(hinf
->os_dist_str
, utsname()->release
,
275 sizeof(hinf
->os_dist_str
));
276 hinf
->os_type
= EFA_ADMIN_OS_LINUX
;
277 strscpy(hinf
->kernel_ver_str
, utsname()->version
,
278 sizeof(hinf
->kernel_ver_str
));
279 hinf
->kernel_ver
= LINUX_VERSION_CODE
;
280 EFA_SET(&hinf
->driver_ver
, EFA_ADMIN_HOST_INFO_DRIVER_MAJOR
, 0);
281 EFA_SET(&hinf
->driver_ver
, EFA_ADMIN_HOST_INFO_DRIVER_MINOR
, 0);
282 EFA_SET(&hinf
->driver_ver
, EFA_ADMIN_HOST_INFO_DRIVER_SUB_MINOR
, 0);
283 EFA_SET(&hinf
->driver_ver
, EFA_ADMIN_HOST_INFO_DRIVER_MODULE_TYPE
, 0);
284 EFA_SET(&hinf
->bdf
, EFA_ADMIN_HOST_INFO_BUS
, dev
->pdev
->bus
->number
);
285 EFA_SET(&hinf
->bdf
, EFA_ADMIN_HOST_INFO_DEVICE
,
286 PCI_SLOT(dev
->pdev
->devfn
));
287 EFA_SET(&hinf
->bdf
, EFA_ADMIN_HOST_INFO_FUNCTION
,
288 PCI_FUNC(dev
->pdev
->devfn
));
289 EFA_SET(&hinf
->spec_ver
, EFA_ADMIN_HOST_INFO_SPEC_MAJOR
,
290 EFA_COMMON_SPEC_VERSION_MAJOR
);
291 EFA_SET(&hinf
->spec_ver
, EFA_ADMIN_HOST_INFO_SPEC_MINOR
,
292 EFA_COMMON_SPEC_VERSION_MINOR
);
293 EFA_SET(&hinf
->flags
, EFA_ADMIN_HOST_INFO_INTREE
, 1);
294 EFA_SET(&hinf
->flags
, EFA_ADMIN_HOST_INFO_GDR
, 0);
296 efa_com_set_feature_ex(&dev
->edev
, &resp
, &cmd
, EFA_ADMIN_HOST_INFO
,
299 dma_free_coherent(&dev
->pdev
->dev
, bufsz
, hinf
, hinf_dma
);
302 static void efa_destroy_eq(struct efa_dev
*dev
, struct efa_eq
*eq
)
304 efa_com_eq_destroy(&dev
->edev
, &eq
->eeq
);
305 efa_free_irq(dev
, &eq
->irq
);
308 static int efa_create_eq(struct efa_dev
*dev
, struct efa_eq
*eq
, u8 msix_vec
)
312 efa_setup_comp_irq(dev
, eq
, msix_vec
);
313 err
= efa_request_irq(dev
, &eq
->irq
);
317 err
= efa_com_eq_init(&dev
->edev
, &eq
->eeq
, efa_process_eqe
,
318 dev
->dev_attr
.max_eq_depth
, msix_vec
);
320 goto err_free_comp_irq
;
325 efa_free_irq(dev
, &eq
->irq
);
329 static int efa_create_eqs(struct efa_dev
*dev
)
331 unsigned int neqs
= dev
->dev_attr
.max_eq
;
335 neqs
= min_t(unsigned int, neqs
,
336 dev
->num_irq_vectors
- EFA_COMP_EQS_VEC_BASE
);
339 dev
->eqs
= kcalloc(neqs
, sizeof(*dev
->eqs
), GFP_KERNEL
);
343 for (i
= 0; i
< neqs
; i
++) {
344 err
= efa_create_eq(dev
, &dev
->eqs
[i
],
345 i
+ EFA_COMP_EQS_VEC_BASE
);
347 goto err_destroy_eqs
;
353 for (i
--; i
>= 0; i
--)
354 efa_destroy_eq(dev
, &dev
->eqs
[i
]);
360 static void efa_destroy_eqs(struct efa_dev
*dev
)
364 for (i
= 0; i
< dev
->neqs
; i
++)
365 efa_destroy_eq(dev
, &dev
->eqs
[i
]);
370 static const struct ib_device_ops efa_dev_ops
= {
371 .owner
= THIS_MODULE
,
372 .driver_id
= RDMA_DRIVER_EFA
,
373 .uverbs_abi_ver
= EFA_UVERBS_ABI_VERSION
,
375 .alloc_hw_port_stats
= efa_alloc_hw_port_stats
,
376 .alloc_hw_device_stats
= efa_alloc_hw_device_stats
,
377 .alloc_pd
= efa_alloc_pd
,
378 .alloc_ucontext
= efa_alloc_ucontext
,
379 .create_cq
= efa_create_cq
,
380 .create_qp
= efa_create_qp
,
381 .create_user_ah
= efa_create_ah
,
382 .dealloc_pd
= efa_dealloc_pd
,
383 .dealloc_ucontext
= efa_dealloc_ucontext
,
384 .dereg_mr
= efa_dereg_mr
,
385 .destroy_ah
= efa_destroy_ah
,
386 .destroy_cq
= efa_destroy_cq
,
387 .destroy_qp
= efa_destroy_qp
,
388 .get_hw_stats
= efa_get_hw_stats
,
389 .get_link_layer
= efa_port_link_layer
,
390 .get_port_immutable
= efa_get_port_immutable
,
392 .mmap_free
= efa_mmap_free
,
393 .modify_qp
= efa_modify_qp
,
394 .query_device
= efa_query_device
,
395 .query_gid
= efa_query_gid
,
396 .query_pkey
= efa_query_pkey
,
397 .query_port
= efa_query_port
,
398 .query_qp
= efa_query_qp
,
399 .reg_user_mr
= efa_reg_mr
,
400 .reg_user_mr_dmabuf
= efa_reg_user_mr_dmabuf
,
402 INIT_RDMA_OBJ_SIZE(ib_ah
, efa_ah
, ibah
),
403 INIT_RDMA_OBJ_SIZE(ib_cq
, efa_cq
, ibcq
),
404 INIT_RDMA_OBJ_SIZE(ib_pd
, efa_pd
, ibpd
),
405 INIT_RDMA_OBJ_SIZE(ib_qp
, efa_qp
, ibqp
),
406 INIT_RDMA_OBJ_SIZE(ib_ucontext
, efa_ucontext
, ibucontext
),
409 static int efa_ib_device_add(struct efa_dev
*dev
)
411 struct efa_com_get_hw_hints_result hw_hints
;
412 struct pci_dev
*pdev
= dev
->pdev
;
417 err
= efa_com_get_device_attr(&dev
->edev
, &dev
->dev_attr
);
421 dev_dbg(&dev
->pdev
->dev
, "Doorbells bar (%d)\n", dev
->dev_attr
.db_bar
);
422 err
= efa_request_doorbell_bar(dev
);
426 err
= efa_com_get_hw_hints(&dev
->edev
, &hw_hints
);
428 goto err_release_doorbell_bar
;
430 efa_update_hw_hints(dev
, &hw_hints
);
432 /* Try to enable all the available aenq groups */
433 err
= efa_com_set_aenq_config(&dev
->edev
, EFA_AENQ_ENABLED_GROUPS
);
435 goto err_release_doorbell_bar
;
437 err
= efa_create_eqs(dev
);
439 goto err_release_doorbell_bar
;
441 efa_set_host_info(dev
);
443 dev
->ibdev
.node_type
= RDMA_NODE_UNSPECIFIED
;
444 dev
->ibdev
.node_guid
= dev
->dev_attr
.guid
;
445 dev
->ibdev
.phys_port_cnt
= 1;
446 dev
->ibdev
.num_comp_vectors
= dev
->neqs
?: 1;
447 dev
->ibdev
.dev
.parent
= &pdev
->dev
;
449 ib_set_device_ops(&dev
->ibdev
, &efa_dev_ops
);
451 dev
->ibdev
.driver_def
= efa_uapi_defs
;
453 err
= ib_register_device(&dev
->ibdev
, "efa_%d", &pdev
->dev
);
455 goto err_destroy_eqs
;
457 ibdev_info(&dev
->ibdev
, "IB device registered\n");
462 efa_destroy_eqs(dev
);
463 err_release_doorbell_bar
:
464 efa_release_doorbell_bar(dev
);
468 static void efa_ib_device_remove(struct efa_dev
*dev
)
470 ibdev_info(&dev
->ibdev
, "Unregister ib device\n");
471 ib_unregister_device(&dev
->ibdev
);
472 efa_destroy_eqs(dev
);
473 efa_com_dev_reset(&dev
->edev
, EFA_REGS_RESET_NORMAL
);
474 efa_release_doorbell_bar(dev
);
477 static void efa_disable_msix(struct efa_dev
*dev
)
479 pci_free_irq_vectors(dev
->pdev
);
482 static int efa_enable_msix(struct efa_dev
*dev
)
484 int max_vecs
, num_vecs
;
487 * Reserve the max msix vectors we might need, one vector is reserved
490 max_vecs
= min_t(int, pci_msix_vec_count(dev
->pdev
),
491 num_online_cpus() + 1);
492 dev_dbg(&dev
->pdev
->dev
, "Trying to enable MSI-X, vectors %d\n",
495 dev
->admin_msix_vector_idx
= EFA_MGMNT_MSIX_VEC_IDX
;
496 num_vecs
= pci_alloc_irq_vectors(dev
->pdev
, 1,
497 max_vecs
, PCI_IRQ_MSIX
);
500 dev_err(&dev
->pdev
->dev
, "Failed to enable MSI-X. error %d\n",
505 dev_dbg(&dev
->pdev
->dev
, "Allocated %d MSI-X vectors\n", num_vecs
);
507 dev
->num_irq_vectors
= num_vecs
;
512 static int efa_device_init(struct efa_com_dev
*edev
, struct pci_dev
*pdev
)
517 err
= efa_com_dev_reset(edev
, EFA_REGS_RESET_NORMAL
);
521 err
= efa_com_validate_version(edev
);
525 dma_width
= efa_com_get_dma_width(edev
);
531 err
= dma_set_mask_and_coherent(&pdev
->dev
, DMA_BIT_MASK(dma_width
));
533 dev_err(&pdev
->dev
, "dma_set_mask_and_coherent failed %d\n", err
);
537 dma_set_max_seg_size(&pdev
->dev
, UINT_MAX
);
541 static struct efa_dev
*efa_probe_device(struct pci_dev
*pdev
)
543 struct efa_com_dev
*edev
;
548 err
= pci_enable_device_mem(pdev
);
550 dev_err(&pdev
->dev
, "pci_enable_device_mem() failed!\n");
554 pci_set_master(pdev
);
556 dev
= ib_alloc_device(efa_dev
, ibdev
);
558 dev_err(&pdev
->dev
, "Device alloc failed\n");
560 goto err_disable_device
;
563 pci_set_drvdata(pdev
, dev
);
566 edev
->dmadev
= &pdev
->dev
;
568 xa_init(&dev
->cqs_xa
);
570 pci_mem_bars
= pci_select_bars(pdev
, IORESOURCE_MEM
);
571 if (EFA_BASE_BAR_MASK
& ~pci_mem_bars
) {
572 dev_err(&pdev
->dev
, "BARs unavailable. Requested %#x, available %#x\n",
573 (int)EFA_BASE_BAR_MASK
, pci_mem_bars
);
575 goto err_ibdev_destroy
;
577 err
= pci_request_selected_regions(pdev
, EFA_BASE_BAR_MASK
, DRV_MODULE_NAME
);
579 dev_err(&pdev
->dev
, "pci_request_selected_regions failed %d\n",
581 goto err_ibdev_destroy
;
584 dev
->reg_bar_addr
= pci_resource_start(pdev
, EFA_REG_BAR
);
585 dev
->reg_bar_len
= pci_resource_len(pdev
, EFA_REG_BAR
);
586 dev
->mem_bar_addr
= pci_resource_start(pdev
, EFA_MEM_BAR
);
587 dev
->mem_bar_len
= pci_resource_len(pdev
, EFA_MEM_BAR
);
589 edev
->reg_bar
= devm_ioremap(&pdev
->dev
,
592 if (!edev
->reg_bar
) {
593 dev_err(&pdev
->dev
, "Failed to remap register bar\n");
595 goto err_release_bars
;
598 err
= efa_com_mmio_reg_read_init(edev
);
600 dev_err(&pdev
->dev
, "Failed to init readless MMIO\n");
604 err
= efa_device_init(edev
, pdev
);
606 dev_err(&pdev
->dev
, "EFA device init failed\n");
609 goto err_reg_read_destroy
;
612 err
= efa_enable_msix(dev
);
614 goto err_reg_read_destroy
;
616 edev
->aq
.msix_vector_idx
= dev
->admin_msix_vector_idx
;
617 edev
->aenq
.msix_vector_idx
= dev
->admin_msix_vector_idx
;
619 err
= efa_set_mgmnt_irq(dev
);
621 goto err_disable_msix
;
623 err
= efa_com_admin_init(edev
, &aenq_handlers
);
625 goto err_free_mgmnt_irq
;
630 efa_free_irq(dev
, &dev
->admin_irq
);
632 efa_disable_msix(dev
);
633 err_reg_read_destroy
:
634 efa_com_mmio_reg_read_destroy(edev
);
636 devm_iounmap(&pdev
->dev
, edev
->reg_bar
);
638 efa_release_bars(dev
, EFA_BASE_BAR_MASK
);
640 ib_dealloc_device(&dev
->ibdev
);
642 pci_disable_device(pdev
);
646 static void efa_remove_device(struct pci_dev
*pdev
)
648 struct efa_dev
*dev
= pci_get_drvdata(pdev
);
649 struct efa_com_dev
*edev
;
652 efa_com_admin_destroy(edev
);
653 efa_free_irq(dev
, &dev
->admin_irq
);
654 efa_disable_msix(dev
);
655 efa_com_mmio_reg_read_destroy(edev
);
656 devm_iounmap(&pdev
->dev
, edev
->reg_bar
);
657 efa_release_bars(dev
, EFA_BASE_BAR_MASK
);
658 xa_destroy(&dev
->cqs_xa
);
659 ib_dealloc_device(&dev
->ibdev
);
660 pci_disable_device(pdev
);
663 static int efa_probe(struct pci_dev
*pdev
, const struct pci_device_id
*ent
)
668 dev
= efa_probe_device(pdev
);
672 err
= efa_ib_device_add(dev
);
674 goto err_remove_device
;
679 efa_remove_device(pdev
);
683 static void efa_remove(struct pci_dev
*pdev
)
685 struct efa_dev
*dev
= pci_get_drvdata(pdev
);
687 efa_ib_device_remove(dev
);
688 efa_remove_device(pdev
);
691 static void efa_shutdown(struct pci_dev
*pdev
)
693 struct efa_dev
*dev
= pci_get_drvdata(pdev
);
695 efa_destroy_eqs(dev
);
696 efa_com_dev_reset(&dev
->edev
, EFA_REGS_RESET_SHUTDOWN
);
697 efa_free_irq(dev
, &dev
->admin_irq
);
698 efa_disable_msix(dev
);
701 static struct pci_driver efa_pci_driver
= {
702 .name
= DRV_MODULE_NAME
,
703 .id_table
= efa_pci_tbl
,
705 .remove
= efa_remove
,
706 .shutdown
= efa_shutdown
,
709 module_pci_driver(efa_pci_driver
);