1 /* This file is part of the Emulex RoCE Device Driver for
2 * RoCE (RDMA over Converged Ethernet) adapters.
3 * Copyright (C) 2012-2015 Emulex. All rights reserved.
4 * EMULEX and SLI are trademarks of Emulex.
7 * This software is available to you under a choice of one of two licenses.
8 * You may choose to be licensed under the terms of the GNU General Public
9 * License (GPL) Version 2, available from the file COPYING in the main
10 * directory of this source tree, or the BSD license below:
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
16 * - Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
19 * - Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in
21 * the documentation and/or other materials provided with the distribution.
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
32 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * Contact Information:
36 * linux-drivers@emulex.com
40 * Costa Mesa, CA 92626
43 #include <linux/module.h>
44 #include <linux/idr.h>
45 #include <rdma/ib_verbs.h>
46 #include <rdma/ib_user_verbs.h>
47 #include <rdma/ib_addr.h>
48 #include <rdma/ib_mad.h>
50 #include <linux/netdevice.h>
51 #include <net/addrconf.h>
54 #include "ocrdma_verbs.h"
55 #include "ocrdma_ah.h"
57 #include "ocrdma_hw.h"
58 #include "ocrdma_stats.h"
59 #include "ocrdma_abi.h"
61 MODULE_VERSION(OCRDMA_ROCE_DRV_VERSION);
62 MODULE_DESCRIPTION(OCRDMA_ROCE_DRV_DESC " " OCRDMA_ROCE_DRV_VERSION);
63 MODULE_AUTHOR("Emulex Corporation");
64 MODULE_LICENSE("Dual BSD/GPL");
66 static LIST_HEAD(ocrdma_dev_list);
67 static DEFINE_SPINLOCK(ocrdma_devlist_lock);
68 static DEFINE_IDR(ocrdma_dev_id);
70 static union ib_gid ocrdma_zero_sgid;
72 void ocrdma_get_guid(struct ocrdma_dev *dev, u8 *guid)
76 memcpy(&mac_addr[0], &dev->nic_info.mac_addr[0], ETH_ALEN);
77 guid[0] = mac_addr[0] ^ 2;
78 guid[1] = mac_addr[1];
79 guid[2] = mac_addr[2];
82 guid[5] = mac_addr[3];
83 guid[6] = mac_addr[4];
84 guid[7] = mac_addr[5];
87 static bool ocrdma_add_sgid(struct ocrdma_dev *dev, union ib_gid *new_sgid)
92 memset(&ocrdma_zero_sgid, 0, sizeof(union ib_gid));
95 spin_lock_irqsave(&dev->sgid_lock, flags);
96 for (i = 0; i < OCRDMA_MAX_SGID; i++) {
97 if (!memcmp(&dev->sgid_tbl[i], &ocrdma_zero_sgid,
98 sizeof(union ib_gid))) {
99 /* found free entry */
100 memcpy(&dev->sgid_tbl[i], new_sgid,
101 sizeof(union ib_gid));
102 spin_unlock_irqrestore(&dev->sgid_lock, flags);
104 } else if (!memcmp(&dev->sgid_tbl[i], new_sgid,
105 sizeof(union ib_gid))) {
106 /* entry already present, no addition is required. */
107 spin_unlock_irqrestore(&dev->sgid_lock, flags);
111 spin_unlock_irqrestore(&dev->sgid_lock, flags);
115 static bool ocrdma_del_sgid(struct ocrdma_dev *dev, union ib_gid *sgid)
122 spin_lock_irqsave(&dev->sgid_lock, flags);
123 /* first is default sgid, which cannot be deleted. */
124 for (i = 1; i < OCRDMA_MAX_SGID; i++) {
125 if (!memcmp(&dev->sgid_tbl[i], sgid, sizeof(union ib_gid))) {
126 /* found matching entry */
127 memset(&dev->sgid_tbl[i], 0, sizeof(union ib_gid));
132 spin_unlock_irqrestore(&dev->sgid_lock, flags);
136 static int ocrdma_addr_event(unsigned long event, struct net_device *netdev,
139 struct ib_event gid_event;
140 struct ocrdma_dev *dev;
142 bool updated = false;
143 bool is_vlan = false;
145 is_vlan = netdev->priv_flags & IFF_802_1Q_VLAN;
147 netdev = rdma_vlan_dev_real_dev(netdev);
150 list_for_each_entry_rcu(dev, &ocrdma_dev_list, entry) {
151 if (dev->nic_info.netdev == netdev) {
161 mutex_lock(&dev->dev_lock);
164 updated = ocrdma_add_sgid(dev, gid);
167 updated = ocrdma_del_sgid(dev, gid);
173 /* GID table updated, notify the consumers about it */
174 gid_event.device = &dev->ibdev;
175 gid_event.element.port_num = 1;
176 gid_event.event = IB_EVENT_GID_CHANGE;
177 ib_dispatch_event(&gid_event);
179 mutex_unlock(&dev->dev_lock);
183 static int ocrdma_inetaddr_event(struct notifier_block *notifier,
184 unsigned long event, void *ptr)
186 struct in_ifaddr *ifa = ptr;
188 struct net_device *netdev = ifa->ifa_dev->dev;
190 ipv6_addr_set_v4mapped(ifa->ifa_address, (struct in6_addr *)&gid);
191 return ocrdma_addr_event(event, netdev, &gid);
194 static struct notifier_block ocrdma_inetaddr_notifier = {
195 .notifier_call = ocrdma_inetaddr_event
198 #if IS_ENABLED(CONFIG_IPV6)
200 static int ocrdma_inet6addr_event(struct notifier_block *notifier,
201 unsigned long event, void *ptr)
203 struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
204 union ib_gid *gid = (union ib_gid *)&ifa->addr;
205 struct net_device *netdev = ifa->idev->dev;
206 return ocrdma_addr_event(event, netdev, gid);
209 static struct notifier_block ocrdma_inet6addr_notifier = {
210 .notifier_call = ocrdma_inet6addr_event
213 #endif /* IPV6 and VLAN */
215 static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device,
218 return IB_LINK_LAYER_ETHERNET;
221 static int ocrdma_port_immutable(struct ib_device *ibdev, u8 port_num,
222 struct ib_port_immutable *immutable)
224 struct ib_port_attr attr;
227 err = ocrdma_query_port(ibdev, port_num, &attr);
231 immutable->pkey_tbl_len = attr.pkey_tbl_len;
232 immutable->gid_tbl_len = attr.gid_tbl_len;
233 immutable->core_cap_flags = RDMA_CORE_PORT_IBA_ROCE;
234 immutable->max_mad_size = IB_MGMT_MAD_SIZE;
239 static int ocrdma_register_device(struct ocrdma_dev *dev)
241 strlcpy(dev->ibdev.name, "ocrdma%d", IB_DEVICE_NAME_MAX);
242 ocrdma_get_guid(dev, (u8 *)&dev->ibdev.node_guid);
243 memcpy(dev->ibdev.node_desc, OCRDMA_NODE_DESC,
244 sizeof(OCRDMA_NODE_DESC));
245 dev->ibdev.owner = THIS_MODULE;
246 dev->ibdev.uverbs_abi_ver = OCRDMA_ABI_VERSION;
247 dev->ibdev.uverbs_cmd_mask =
248 OCRDMA_UVERBS(GET_CONTEXT) |
249 OCRDMA_UVERBS(QUERY_DEVICE) |
250 OCRDMA_UVERBS(QUERY_PORT) |
251 OCRDMA_UVERBS(ALLOC_PD) |
252 OCRDMA_UVERBS(DEALLOC_PD) |
253 OCRDMA_UVERBS(REG_MR) |
254 OCRDMA_UVERBS(DEREG_MR) |
255 OCRDMA_UVERBS(CREATE_COMP_CHANNEL) |
256 OCRDMA_UVERBS(CREATE_CQ) |
257 OCRDMA_UVERBS(RESIZE_CQ) |
258 OCRDMA_UVERBS(DESTROY_CQ) |
259 OCRDMA_UVERBS(REQ_NOTIFY_CQ) |
260 OCRDMA_UVERBS(CREATE_QP) |
261 OCRDMA_UVERBS(MODIFY_QP) |
262 OCRDMA_UVERBS(QUERY_QP) |
263 OCRDMA_UVERBS(DESTROY_QP) |
264 OCRDMA_UVERBS(POLL_CQ) |
265 OCRDMA_UVERBS(POST_SEND) |
266 OCRDMA_UVERBS(POST_RECV);
268 dev->ibdev.uverbs_cmd_mask |=
269 OCRDMA_UVERBS(CREATE_AH) |
270 OCRDMA_UVERBS(MODIFY_AH) |
271 OCRDMA_UVERBS(QUERY_AH) |
272 OCRDMA_UVERBS(DESTROY_AH);
274 dev->ibdev.node_type = RDMA_NODE_IB_CA;
275 dev->ibdev.phys_port_cnt = 1;
276 dev->ibdev.num_comp_vectors = dev->eq_cnt;
278 /* mandatory verbs. */
279 dev->ibdev.query_device = ocrdma_query_device;
280 dev->ibdev.query_port = ocrdma_query_port;
281 dev->ibdev.modify_port = ocrdma_modify_port;
282 dev->ibdev.query_gid = ocrdma_query_gid;
283 dev->ibdev.get_link_layer = ocrdma_link_layer;
284 dev->ibdev.alloc_pd = ocrdma_alloc_pd;
285 dev->ibdev.dealloc_pd = ocrdma_dealloc_pd;
287 dev->ibdev.create_cq = ocrdma_create_cq;
288 dev->ibdev.destroy_cq = ocrdma_destroy_cq;
289 dev->ibdev.resize_cq = ocrdma_resize_cq;
291 dev->ibdev.create_qp = ocrdma_create_qp;
292 dev->ibdev.modify_qp = ocrdma_modify_qp;
293 dev->ibdev.query_qp = ocrdma_query_qp;
294 dev->ibdev.destroy_qp = ocrdma_destroy_qp;
296 dev->ibdev.query_pkey = ocrdma_query_pkey;
297 dev->ibdev.create_ah = ocrdma_create_ah;
298 dev->ibdev.destroy_ah = ocrdma_destroy_ah;
299 dev->ibdev.query_ah = ocrdma_query_ah;
300 dev->ibdev.modify_ah = ocrdma_modify_ah;
302 dev->ibdev.poll_cq = ocrdma_poll_cq;
303 dev->ibdev.post_send = ocrdma_post_send;
304 dev->ibdev.post_recv = ocrdma_post_recv;
305 dev->ibdev.req_notify_cq = ocrdma_arm_cq;
307 dev->ibdev.get_dma_mr = ocrdma_get_dma_mr;
308 dev->ibdev.reg_phys_mr = ocrdma_reg_kernel_mr;
309 dev->ibdev.dereg_mr = ocrdma_dereg_mr;
310 dev->ibdev.reg_user_mr = ocrdma_reg_user_mr;
312 dev->ibdev.alloc_fast_reg_mr = ocrdma_alloc_frmr;
313 dev->ibdev.alloc_fast_reg_page_list = ocrdma_alloc_frmr_page_list;
314 dev->ibdev.free_fast_reg_page_list = ocrdma_free_frmr_page_list;
316 /* mandatory to support user space verbs consumer. */
317 dev->ibdev.alloc_ucontext = ocrdma_alloc_ucontext;
318 dev->ibdev.dealloc_ucontext = ocrdma_dealloc_ucontext;
319 dev->ibdev.mmap = ocrdma_mmap;
320 dev->ibdev.dma_device = &dev->nic_info.pdev->dev;
322 dev->ibdev.process_mad = ocrdma_process_mad;
323 dev->ibdev.get_port_immutable = ocrdma_port_immutable;
325 if (ocrdma_get_asic_type(dev) == OCRDMA_ASIC_GEN_SKH_R) {
326 dev->ibdev.uverbs_cmd_mask |=
327 OCRDMA_UVERBS(CREATE_SRQ) |
328 OCRDMA_UVERBS(MODIFY_SRQ) |
329 OCRDMA_UVERBS(QUERY_SRQ) |
330 OCRDMA_UVERBS(DESTROY_SRQ) |
331 OCRDMA_UVERBS(POST_SRQ_RECV);
333 dev->ibdev.create_srq = ocrdma_create_srq;
334 dev->ibdev.modify_srq = ocrdma_modify_srq;
335 dev->ibdev.query_srq = ocrdma_query_srq;
336 dev->ibdev.destroy_srq = ocrdma_destroy_srq;
337 dev->ibdev.post_srq_recv = ocrdma_post_srq_recv;
339 return ib_register_device(&dev->ibdev, NULL);
342 static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
344 mutex_init(&dev->dev_lock);
345 dev->sgid_tbl = kzalloc(sizeof(union ib_gid) *
346 OCRDMA_MAX_SGID, GFP_KERNEL);
349 spin_lock_init(&dev->sgid_lock);
351 dev->cq_tbl = kzalloc(sizeof(struct ocrdma_cq *) *
352 OCRDMA_MAX_CQ, GFP_KERNEL);
356 if (dev->attr.max_qp) {
357 dev->qp_tbl = kzalloc(sizeof(struct ocrdma_qp *) *
358 OCRDMA_MAX_QP, GFP_KERNEL);
363 dev->stag_arr = kzalloc(sizeof(u64) * OCRDMA_MAX_STAG, GFP_KERNEL);
364 if (dev->stag_arr == NULL)
367 ocrdma_alloc_pd_pool(dev);
369 spin_lock_init(&dev->av_tbl.lock);
370 spin_lock_init(&dev->flush_q_lock);
373 pr_err("%s(%d) error.\n", __func__, dev->id);
377 static void ocrdma_free_resources(struct ocrdma_dev *dev)
379 kfree(dev->stag_arr);
382 kfree(dev->sgid_tbl);
385 /* OCRDMA sysfs interface */
386 static ssize_t show_rev(struct device *device, struct device_attribute *attr,
389 struct ocrdma_dev *dev = dev_get_drvdata(device);
391 return scnprintf(buf, PAGE_SIZE, "0x%x\n", dev->nic_info.pdev->vendor);
394 static ssize_t show_fw_ver(struct device *device, struct device_attribute *attr,
397 struct ocrdma_dev *dev = dev_get_drvdata(device);
399 return scnprintf(buf, PAGE_SIZE, "%s\n", &dev->attr.fw_ver[0]);
402 static ssize_t show_hca_type(struct device *device,
403 struct device_attribute *attr, char *buf)
405 struct ocrdma_dev *dev = dev_get_drvdata(device);
407 return scnprintf(buf, PAGE_SIZE, "%s\n", &dev->model_number[0]);
410 static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
411 static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
412 static DEVICE_ATTR(hca_type, S_IRUGO, show_hca_type, NULL);
414 static struct device_attribute *ocrdma_attributes[] = {
420 static void ocrdma_remove_sysfiles(struct ocrdma_dev *dev)
424 for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++)
425 device_remove_file(&dev->ibdev.dev, ocrdma_attributes[i]);
428 static void ocrdma_add_default_sgid(struct ocrdma_dev *dev)
430 /* GID Index 0 - Invariant manufacturer-assigned EUI-64 */
431 union ib_gid *sgid = &dev->sgid_tbl[0];
433 sgid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL);
434 ocrdma_get_guid(dev, &sgid->raw[8]);
437 static void ocrdma_init_ipv4_gids(struct ocrdma_dev *dev,
438 struct net_device *net)
440 struct in_device *in_dev;
442 in_dev = in_dev_get(net);
445 ipv6_addr_set_v4mapped(ifa->ifa_address,
446 (struct in6_addr *)&gid);
447 ocrdma_add_sgid(dev, &gid);
454 static void ocrdma_init_ipv6_gids(struct ocrdma_dev *dev,
455 struct net_device *net)
457 #if IS_ENABLED(CONFIG_IPV6)
458 struct inet6_dev *in6_dev;
460 struct inet6_ifaddr *ifp;
461 in6_dev = in6_dev_get(net);
463 read_lock_bh(&in6_dev->lock);
464 list_for_each_entry(ifp, &in6_dev->addr_list, if_list) {
465 pgid = (union ib_gid *)&ifp->addr;
466 ocrdma_add_sgid(dev, pgid);
468 read_unlock_bh(&in6_dev->lock);
469 in6_dev_put(in6_dev);
474 static void ocrdma_init_gid_table(struct ocrdma_dev *dev)
476 struct net_device *net_dev;
478 for_each_netdev(&init_net, net_dev) {
479 struct net_device *real_dev = rdma_vlan_dev_real_dev(net_dev) ?
480 rdma_vlan_dev_real_dev(net_dev) : net_dev;
482 if (real_dev == dev->nic_info.netdev) {
483 ocrdma_add_default_sgid(dev);
484 ocrdma_init_ipv4_gids(dev, net_dev);
485 ocrdma_init_ipv6_gids(dev, net_dev);
490 static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
493 struct ocrdma_dev *dev;
495 dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(struct ocrdma_dev));
497 pr_err("Unable to allocate ib device\n");
500 dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL);
504 memcpy(&dev->nic_info, dev_info, sizeof(*dev_info));
505 dev->id = idr_alloc(&ocrdma_dev_id, NULL, 0, 0, GFP_KERNEL);
509 status = ocrdma_init_hw(dev);
513 status = ocrdma_alloc_resources(dev);
517 ocrdma_init_service_level(dev);
518 ocrdma_init_gid_table(dev);
519 status = ocrdma_register_device(dev);
523 for (i = 0; i < ARRAY_SIZE(ocrdma_attributes); i++)
524 if (device_create_file(&dev->ibdev.dev, ocrdma_attributes[i]))
526 spin_lock(&ocrdma_devlist_lock);
527 list_add_tail_rcu(&dev->entry, &ocrdma_dev_list);
528 spin_unlock(&ocrdma_devlist_lock);
530 ocrdma_add_port_stats(dev);
531 /* Interrupt Moderation */
532 INIT_DELAYED_WORK(&dev->eqd_work, ocrdma_eqd_set_task);
533 schedule_delayed_work(&dev->eqd_work, msecs_to_jiffies(1000));
535 pr_info("%s %s: %s \"%s\" port %d\n",
536 dev_name(&dev->nic_info.pdev->dev), hca_name(dev),
537 port_speed_string(dev), dev->model_number,
539 pr_info("%s ocrdma%d driver loaded successfully\n",
540 dev_name(&dev->nic_info.pdev->dev), dev->id);
544 ocrdma_remove_sysfiles(dev);
546 ocrdma_free_resources(dev);
547 ocrdma_cleanup_hw(dev);
549 idr_remove(&ocrdma_dev_id, dev->id);
552 ib_dealloc_device(&dev->ibdev);
553 pr_err("%s() leaving. ret=%d\n", __func__, status);
557 static void ocrdma_remove_free(struct rcu_head *rcu)
559 struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu);
561 idr_remove(&ocrdma_dev_id, dev->id);
563 ib_dealloc_device(&dev->ibdev);
566 static void ocrdma_remove(struct ocrdma_dev *dev)
568 /* first unregister with stack to stop all the active traffic
569 * of the registered clients.
571 cancel_delayed_work_sync(&dev->eqd_work);
572 ocrdma_remove_sysfiles(dev);
573 ib_unregister_device(&dev->ibdev);
575 ocrdma_rem_port_stats(dev);
577 spin_lock(&ocrdma_devlist_lock);
578 list_del_rcu(&dev->entry);
579 spin_unlock(&ocrdma_devlist_lock);
581 ocrdma_free_resources(dev);
582 ocrdma_cleanup_hw(dev);
584 call_rcu(&dev->rcu, ocrdma_remove_free);
587 static int ocrdma_open(struct ocrdma_dev *dev)
589 struct ib_event port_event;
591 port_event.event = IB_EVENT_PORT_ACTIVE;
592 port_event.element.port_num = 1;
593 port_event.device = &dev->ibdev;
594 ib_dispatch_event(&port_event);
598 static int ocrdma_close(struct ocrdma_dev *dev)
601 struct ocrdma_qp *qp, **cur_qp;
602 struct ib_event err_event;
603 struct ib_qp_attr attrs;
604 int attr_mask = IB_QP_STATE;
606 attrs.qp_state = IB_QPS_ERR;
607 mutex_lock(&dev->dev_lock);
609 cur_qp = dev->qp_tbl;
610 for (i = 0; i < OCRDMA_MAX_QP; i++) {
612 if (qp && qp->ibqp.qp_type != IB_QPT_GSI) {
613 /* change the QP state to ERROR */
614 _ocrdma_modify_qp(&qp->ibqp, &attrs, attr_mask);
616 err_event.event = IB_EVENT_QP_FATAL;
617 err_event.element.qp = &qp->ibqp;
618 err_event.device = &dev->ibdev;
619 ib_dispatch_event(&err_event);
623 mutex_unlock(&dev->dev_lock);
625 err_event.event = IB_EVENT_PORT_ERR;
626 err_event.element.port_num = 1;
627 err_event.device = &dev->ibdev;
628 ib_dispatch_event(&err_event);
632 static void ocrdma_shutdown(struct ocrdma_dev *dev)
638 /* event handling via NIC driver ensures that all the NIC specific
639 * initialization done before RoCE driver notifies
642 static void ocrdma_event_handler(struct ocrdma_dev *dev, u32 event)
651 case BE_DEV_SHUTDOWN:
652 ocrdma_shutdown(dev);
657 static struct ocrdma_driver ocrdma_drv = {
658 .name = "ocrdma_driver",
660 .remove = ocrdma_remove,
661 .state_change_handler = ocrdma_event_handler,
662 .be_abi_version = OCRDMA_BE_ROCE_ABI_VERSION,
665 static void ocrdma_unregister_inet6addr_notifier(void)
667 #if IS_ENABLED(CONFIG_IPV6)
668 unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
672 static void ocrdma_unregister_inetaddr_notifier(void)
674 unregister_inetaddr_notifier(&ocrdma_inetaddr_notifier);
677 static int __init ocrdma_init_module(void)
681 ocrdma_init_debugfs();
683 status = register_inetaddr_notifier(&ocrdma_inetaddr_notifier);
687 #if IS_ENABLED(CONFIG_IPV6)
688 status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier);
693 status = be_roce_register_driver(&ocrdma_drv);
700 #if IS_ENABLED(CONFIG_IPV6)
701 ocrdma_unregister_inet6addr_notifier();
704 ocrdma_unregister_inetaddr_notifier();
708 static void __exit ocrdma_exit_module(void)
710 be_roce_unregister_driver(&ocrdma_drv);
711 ocrdma_unregister_inet6addr_notifier();
712 ocrdma_unregister_inetaddr_notifier();
713 ocrdma_rem_debugfs();
714 idr_destroy(&ocrdma_dev_id);
717 module_init(ocrdma_init_module);
718 module_exit(ocrdma_exit_module);