ocrdma_main.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /*******************************************************************
  2. * This file is part of the Emulex RoCE Device Driver for *
  3. * RoCE (RDMA over Converged Ethernet) adapters. *
  4. * Copyright (C) 2008-2012 Emulex. All rights reserved. *
  5. * EMULEX and SLI are trademarks of Emulex. *
  6. * www.emulex.com *
  7. * *
  8. * This program is free software; you can redistribute it and/or *
  9. * modify it under the terms of version 2 of the GNU General *
  10. * Public License as published by the Free Software Foundation. *
  11. * This program is distributed in the hope that it will be useful. *
  12. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND *
  13. * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, *
  14. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
  15. * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
  16. * TO BE LEGALLY INVALID. See the GNU General Public License for *
  17. * more details, a copy of which can be found in the file COPYING *
  18. * included with this package. *
  19. *
  20. * Contact Information:
  21. * linux-drivers@emulex.com
  22. *
  23. * Emulex
  24. * 3333 Susan Street
  25. * Costa Mesa, CA 92626
  26. *******************************************************************/
  27. #include <linux/module.h>
  28. #include <linux/idr.h>
  29. #include <rdma/ib_verbs.h>
  30. #include <rdma/ib_user_verbs.h>
  31. #include <rdma/ib_addr.h>
  32. #include <linux/netdevice.h>
  33. #include <net/addrconf.h>
  34. #include "ocrdma.h"
  35. #include "ocrdma_verbs.h"
  36. #include "ocrdma_ah.h"
  37. #include "be_roce.h"
  38. #include "ocrdma_hw.h"
  39. MODULE_VERSION(OCRDMA_ROCE_DEV_VERSION);
  40. MODULE_DESCRIPTION("Emulex RoCE HCA Driver");
  41. MODULE_AUTHOR("Emulex Corporation");
  42. MODULE_LICENSE("GPL");
  43. static LIST_HEAD(ocrdma_dev_list);
  44. static DEFINE_SPINLOCK(ocrdma_devlist_lock);
  45. static DEFINE_IDR(ocrdma_dev_id);
  46. static union ib_gid ocrdma_zero_sgid;
  47. void ocrdma_get_guid(struct ocrdma_dev *dev, u8 *guid)
  48. {
  49. u8 mac_addr[6];
  50. memcpy(&mac_addr[0], &dev->nic_info.mac_addr[0], ETH_ALEN);
  51. guid[0] = mac_addr[0] ^ 2;
  52. guid[1] = mac_addr[1];
  53. guid[2] = mac_addr[2];
  54. guid[3] = 0xff;
  55. guid[4] = 0xfe;
  56. guid[5] = mac_addr[3];
  57. guid[6] = mac_addr[4];
  58. guid[7] = mac_addr[5];
  59. }
  60. static void ocrdma_build_sgid_mac(union ib_gid *sgid, unsigned char *mac_addr,
  61. bool is_vlan, u16 vlan_id)
  62. {
  63. sgid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL);
  64. sgid->raw[8] = mac_addr[0] ^ 2;
  65. sgid->raw[9] = mac_addr[1];
  66. sgid->raw[10] = mac_addr[2];
  67. if (is_vlan) {
  68. sgid->raw[11] = vlan_id >> 8;
  69. sgid->raw[12] = vlan_id & 0xff;
  70. } else {
  71. sgid->raw[11] = 0xff;
  72. sgid->raw[12] = 0xfe;
  73. }
  74. sgid->raw[13] = mac_addr[3];
  75. sgid->raw[14] = mac_addr[4];
  76. sgid->raw[15] = mac_addr[5];
  77. }
  78. static bool ocrdma_add_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr,
  79. bool is_vlan, u16 vlan_id)
  80. {
  81. int i;
  82. union ib_gid new_sgid;
  83. unsigned long flags;
  84. memset(&ocrdma_zero_sgid, 0, sizeof(union ib_gid));
  85. ocrdma_build_sgid_mac(&new_sgid, mac_addr, is_vlan, vlan_id);
  86. spin_lock_irqsave(&dev->sgid_lock, flags);
  87. for (i = 0; i < OCRDMA_MAX_SGID; i++) {
  88. if (!memcmp(&dev->sgid_tbl[i], &ocrdma_zero_sgid,
  89. sizeof(union ib_gid))) {
  90. /* found free entry */
  91. memcpy(&dev->sgid_tbl[i], &new_sgid,
  92. sizeof(union ib_gid));
  93. spin_unlock_irqrestore(&dev->sgid_lock, flags);
  94. return true;
  95. } else if (!memcmp(&dev->sgid_tbl[i], &new_sgid,
  96. sizeof(union ib_gid))) {
  97. /* entry already present, no addition is required. */
  98. spin_unlock_irqrestore(&dev->sgid_lock, flags);
  99. return false;
  100. }
  101. }
  102. spin_unlock_irqrestore(&dev->sgid_lock, flags);
  103. return false;
  104. }
  105. static bool ocrdma_del_sgid(struct ocrdma_dev *dev, unsigned char *mac_addr,
  106. bool is_vlan, u16 vlan_id)
  107. {
  108. int found = false;
  109. int i;
  110. union ib_gid sgid;
  111. unsigned long flags;
  112. ocrdma_build_sgid_mac(&sgid, mac_addr, is_vlan, vlan_id);
  113. spin_lock_irqsave(&dev->sgid_lock, flags);
  114. /* first is default sgid, which cannot be deleted. */
  115. for (i = 1; i < OCRDMA_MAX_SGID; i++) {
  116. if (!memcmp(&dev->sgid_tbl[i], &sgid, sizeof(union ib_gid))) {
  117. /* found matching entry */
  118. memset(&dev->sgid_tbl[i], 0, sizeof(union ib_gid));
  119. found = true;
  120. break;
  121. }
  122. }
  123. spin_unlock_irqrestore(&dev->sgid_lock, flags);
  124. return found;
  125. }
  126. static void ocrdma_add_default_sgid(struct ocrdma_dev *dev)
  127. {
  128. /* GID Index 0 - Invariant manufacturer-assigned EUI-64 */
  129. union ib_gid *sgid = &dev->sgid_tbl[0];
  130. sgid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL);
  131. ocrdma_get_guid(dev, &sgid->raw[8]);
  132. }
  133. #if IS_ENABLED(CONFIG_VLAN_8021Q)
  134. static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev)
  135. {
  136. struct net_device *netdev, *tmp;
  137. u16 vlan_id;
  138. bool is_vlan;
  139. netdev = dev->nic_info.netdev;
  140. rcu_read_lock();
  141. for_each_netdev_rcu(&init_net, tmp) {
  142. if (netdev == tmp || vlan_dev_real_dev(tmp) == netdev) {
  143. if (!netif_running(tmp) || !netif_oper_up(tmp))
  144. continue;
  145. if (netdev != tmp) {
  146. vlan_id = vlan_dev_vlan_id(tmp);
  147. is_vlan = true;
  148. } else {
  149. is_vlan = false;
  150. vlan_id = 0;
  151. tmp = netdev;
  152. }
  153. ocrdma_add_sgid(dev, tmp->dev_addr, is_vlan, vlan_id);
  154. }
  155. }
  156. rcu_read_unlock();
  157. }
  158. #else
  159. static void ocrdma_add_vlan_sgids(struct ocrdma_dev *dev)
  160. {
  161. }
  162. #endif /* VLAN */
  163. static int ocrdma_build_sgid_tbl(struct ocrdma_dev *dev)
  164. {
  165. ocrdma_add_default_sgid(dev);
  166. ocrdma_add_vlan_sgids(dev);
  167. return 0;
  168. }
  169. #if IS_ENABLED(CONFIG_IPV6)
  170. static int ocrdma_inet6addr_event(struct notifier_block *notifier,
  171. unsigned long event, void *ptr)
  172. {
  173. struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
  174. struct net_device *netdev = ifa->idev->dev;
  175. struct ib_event gid_event;
  176. struct ocrdma_dev *dev;
  177. bool found = false;
  178. bool updated = false;
  179. bool is_vlan = false;
  180. u16 vid = 0;
  181. is_vlan = netdev->priv_flags & IFF_802_1Q_VLAN;
  182. if (is_vlan) {
  183. vid = vlan_dev_vlan_id(netdev);
  184. netdev = vlan_dev_real_dev(netdev);
  185. }
  186. rcu_read_lock();
  187. list_for_each_entry_rcu(dev, &ocrdma_dev_list, entry) {
  188. if (dev->nic_info.netdev == netdev) {
  189. found = true;
  190. break;
  191. }
  192. }
  193. rcu_read_unlock();
  194. if (!found)
  195. return NOTIFY_DONE;
  196. if (!rdma_link_local_addr((struct in6_addr *)&ifa->addr))
  197. return NOTIFY_DONE;
  198. mutex_lock(&dev->dev_lock);
  199. switch (event) {
  200. case NETDEV_UP:
  201. updated = ocrdma_add_sgid(dev, netdev->dev_addr, is_vlan, vid);
  202. break;
  203. case NETDEV_DOWN:
  204. updated = ocrdma_del_sgid(dev, netdev->dev_addr, is_vlan, vid);
  205. break;
  206. default:
  207. break;
  208. }
  209. if (updated) {
  210. /* GID table updated, notify the consumers about it */
  211. gid_event.device = &dev->ibdev;
  212. gid_event.element.port_num = 1;
  213. gid_event.event = IB_EVENT_GID_CHANGE;
  214. ib_dispatch_event(&gid_event);
  215. }
  216. mutex_unlock(&dev->dev_lock);
  217. return NOTIFY_OK;
  218. }
  219. static struct notifier_block ocrdma_inet6addr_notifier = {
  220. .notifier_call = ocrdma_inet6addr_event
  221. };
  222. #endif /* IPV6 and VLAN */
  223. static enum rdma_link_layer ocrdma_link_layer(struct ib_device *device,
  224. u8 port_num)
  225. {
  226. return IB_LINK_LAYER_ETHERNET;
  227. }
  228. static int ocrdma_register_device(struct ocrdma_dev *dev)
  229. {
  230. strlcpy(dev->ibdev.name, "ocrdma%d", IB_DEVICE_NAME_MAX);
  231. ocrdma_get_guid(dev, (u8 *)&dev->ibdev.node_guid);
  232. memcpy(dev->ibdev.node_desc, OCRDMA_NODE_DESC,
  233. sizeof(OCRDMA_NODE_DESC));
  234. dev->ibdev.owner = THIS_MODULE;
  235. dev->ibdev.uverbs_cmd_mask =
  236. OCRDMA_UVERBS(GET_CONTEXT) |
  237. OCRDMA_UVERBS(QUERY_DEVICE) |
  238. OCRDMA_UVERBS(QUERY_PORT) |
  239. OCRDMA_UVERBS(ALLOC_PD) |
  240. OCRDMA_UVERBS(DEALLOC_PD) |
  241. OCRDMA_UVERBS(REG_MR) |
  242. OCRDMA_UVERBS(DEREG_MR) |
  243. OCRDMA_UVERBS(CREATE_COMP_CHANNEL) |
  244. OCRDMA_UVERBS(CREATE_CQ) |
  245. OCRDMA_UVERBS(RESIZE_CQ) |
  246. OCRDMA_UVERBS(DESTROY_CQ) |
  247. OCRDMA_UVERBS(REQ_NOTIFY_CQ) |
  248. OCRDMA_UVERBS(CREATE_QP) |
  249. OCRDMA_UVERBS(MODIFY_QP) |
  250. OCRDMA_UVERBS(QUERY_QP) |
  251. OCRDMA_UVERBS(DESTROY_QP) |
  252. OCRDMA_UVERBS(POLL_CQ) |
  253. OCRDMA_UVERBS(POST_SEND) |
  254. OCRDMA_UVERBS(POST_RECV);
  255. dev->ibdev.uverbs_cmd_mask |=
  256. OCRDMA_UVERBS(CREATE_AH) |
  257. OCRDMA_UVERBS(MODIFY_AH) |
  258. OCRDMA_UVERBS(QUERY_AH) |
  259. OCRDMA_UVERBS(DESTROY_AH);
  260. dev->ibdev.node_type = RDMA_NODE_IB_CA;
  261. dev->ibdev.phys_port_cnt = 1;
  262. dev->ibdev.num_comp_vectors = 1;
  263. /* mandatory verbs. */
  264. dev->ibdev.query_device = ocrdma_query_device;
  265. dev->ibdev.query_port = ocrdma_query_port;
  266. dev->ibdev.modify_port = ocrdma_modify_port;
  267. dev->ibdev.query_gid = ocrdma_query_gid;
  268. dev->ibdev.get_link_layer = ocrdma_link_layer;
  269. dev->ibdev.alloc_pd = ocrdma_alloc_pd;
  270. dev->ibdev.dealloc_pd = ocrdma_dealloc_pd;
  271. dev->ibdev.create_cq = ocrdma_create_cq;
  272. dev->ibdev.destroy_cq = ocrdma_destroy_cq;
  273. dev->ibdev.resize_cq = ocrdma_resize_cq;
  274. dev->ibdev.create_qp = ocrdma_create_qp;
  275. dev->ibdev.modify_qp = ocrdma_modify_qp;
  276. dev->ibdev.query_qp = ocrdma_query_qp;
  277. dev->ibdev.destroy_qp = ocrdma_destroy_qp;
  278. dev->ibdev.query_pkey = ocrdma_query_pkey;
  279. dev->ibdev.create_ah = ocrdma_create_ah;
  280. dev->ibdev.destroy_ah = ocrdma_destroy_ah;
  281. dev->ibdev.query_ah = ocrdma_query_ah;
  282. dev->ibdev.modify_ah = ocrdma_modify_ah;
  283. dev->ibdev.poll_cq = ocrdma_poll_cq;
  284. dev->ibdev.post_send = ocrdma_post_send;
  285. dev->ibdev.post_recv = ocrdma_post_recv;
  286. dev->ibdev.req_notify_cq = ocrdma_arm_cq;
  287. dev->ibdev.get_dma_mr = ocrdma_get_dma_mr;
  288. dev->ibdev.dereg_mr = ocrdma_dereg_mr;
  289. dev->ibdev.reg_user_mr = ocrdma_reg_user_mr;
  290. /* mandatory to support user space verbs consumer. */
  291. dev->ibdev.alloc_ucontext = ocrdma_alloc_ucontext;
  292. dev->ibdev.dealloc_ucontext = ocrdma_dealloc_ucontext;
  293. dev->ibdev.mmap = ocrdma_mmap;
  294. dev->ibdev.dma_device = &dev->nic_info.pdev->dev;
  295. dev->ibdev.process_mad = ocrdma_process_mad;
  296. if (dev->nic_info.dev_family == OCRDMA_GEN2_FAMILY) {
  297. dev->ibdev.uverbs_cmd_mask |=
  298. OCRDMA_UVERBS(CREATE_SRQ) |
  299. OCRDMA_UVERBS(MODIFY_SRQ) |
  300. OCRDMA_UVERBS(QUERY_SRQ) |
  301. OCRDMA_UVERBS(DESTROY_SRQ) |
  302. OCRDMA_UVERBS(POST_SRQ_RECV);
  303. dev->ibdev.create_srq = ocrdma_create_srq;
  304. dev->ibdev.modify_srq = ocrdma_modify_srq;
  305. dev->ibdev.query_srq = ocrdma_query_srq;
  306. dev->ibdev.destroy_srq = ocrdma_destroy_srq;
  307. dev->ibdev.post_srq_recv = ocrdma_post_srq_recv;
  308. }
  309. return ib_register_device(&dev->ibdev, NULL);
  310. }
  311. static int ocrdma_alloc_resources(struct ocrdma_dev *dev)
  312. {
  313. mutex_init(&dev->dev_lock);
  314. dev->sgid_tbl = kzalloc(sizeof(union ib_gid) *
  315. OCRDMA_MAX_SGID, GFP_KERNEL);
  316. if (!dev->sgid_tbl)
  317. goto alloc_err;
  318. spin_lock_init(&dev->sgid_lock);
  319. dev->cq_tbl = kzalloc(sizeof(struct ocrdma_cq *) *
  320. OCRDMA_MAX_CQ, GFP_KERNEL);
  321. if (!dev->cq_tbl)
  322. goto alloc_err;
  323. if (dev->attr.max_qp) {
  324. dev->qp_tbl = kzalloc(sizeof(struct ocrdma_qp *) *
  325. OCRDMA_MAX_QP, GFP_KERNEL);
  326. if (!dev->qp_tbl)
  327. goto alloc_err;
  328. }
  329. spin_lock_init(&dev->av_tbl.lock);
  330. spin_lock_init(&dev->flush_q_lock);
  331. return 0;
  332. alloc_err:
  333. ocrdma_err("%s(%d) error.\n", __func__, dev->id);
  334. return -ENOMEM;
  335. }
  336. static void ocrdma_free_resources(struct ocrdma_dev *dev)
  337. {
  338. kfree(dev->qp_tbl);
  339. kfree(dev->cq_tbl);
  340. kfree(dev->sgid_tbl);
  341. }
  342. static struct ocrdma_dev *ocrdma_add(struct be_dev_info *dev_info)
  343. {
  344. int status = 0;
  345. struct ocrdma_dev *dev;
  346. dev = (struct ocrdma_dev *)ib_alloc_device(sizeof(struct ocrdma_dev));
  347. if (!dev) {
  348. ocrdma_err("Unable to allocate ib device\n");
  349. return NULL;
  350. }
  351. dev->mbx_cmd = kzalloc(sizeof(struct ocrdma_mqe_emb_cmd), GFP_KERNEL);
  352. if (!dev->mbx_cmd)
  353. goto idr_err;
  354. memcpy(&dev->nic_info, dev_info, sizeof(*dev_info));
  355. dev->id = idr_alloc(&ocrdma_dev_id, NULL, 0, 0, GFP_KERNEL);
  356. if (dev->id < 0)
  357. goto idr_err;
  358. status = ocrdma_init_hw(dev);
  359. if (status)
  360. goto init_err;
  361. status = ocrdma_alloc_resources(dev);
  362. if (status)
  363. goto alloc_err;
  364. status = ocrdma_build_sgid_tbl(dev);
  365. if (status)
  366. goto alloc_err;
  367. status = ocrdma_register_device(dev);
  368. if (status)
  369. goto alloc_err;
  370. spin_lock(&ocrdma_devlist_lock);
  371. list_add_tail_rcu(&dev->entry, &ocrdma_dev_list);
  372. spin_unlock(&ocrdma_devlist_lock);
  373. return dev;
  374. alloc_err:
  375. ocrdma_free_resources(dev);
  376. ocrdma_cleanup_hw(dev);
  377. init_err:
  378. idr_remove(&ocrdma_dev_id, dev->id);
  379. idr_err:
  380. kfree(dev->mbx_cmd);
  381. ib_dealloc_device(&dev->ibdev);
  382. ocrdma_err("%s() leaving. ret=%d\n", __func__, status);
  383. return NULL;
  384. }
  385. static void ocrdma_remove_free(struct rcu_head *rcu)
  386. {
  387. struct ocrdma_dev *dev = container_of(rcu, struct ocrdma_dev, rcu);
  388. ocrdma_free_resources(dev);
  389. ocrdma_cleanup_hw(dev);
  390. idr_remove(&ocrdma_dev_id, dev->id);
  391. kfree(dev->mbx_cmd);
  392. ib_dealloc_device(&dev->ibdev);
  393. }
  394. static void ocrdma_remove(struct ocrdma_dev *dev)
  395. {
  396. /* first unregister with stack to stop all the active traffic
  397. * of the registered clients.
  398. */
  399. ib_unregister_device(&dev->ibdev);
  400. spin_lock(&ocrdma_devlist_lock);
  401. list_del_rcu(&dev->entry);
  402. spin_unlock(&ocrdma_devlist_lock);
  403. call_rcu(&dev->rcu, ocrdma_remove_free);
  404. }
  405. static int ocrdma_open(struct ocrdma_dev *dev)
  406. {
  407. struct ib_event port_event;
  408. port_event.event = IB_EVENT_PORT_ACTIVE;
  409. port_event.element.port_num = 1;
  410. port_event.device = &dev->ibdev;
  411. ib_dispatch_event(&port_event);
  412. return 0;
  413. }
  414. static int ocrdma_close(struct ocrdma_dev *dev)
  415. {
  416. int i;
  417. struct ocrdma_qp *qp, **cur_qp;
  418. struct ib_event err_event;
  419. struct ib_qp_attr attrs;
  420. int attr_mask = IB_QP_STATE;
  421. attrs.qp_state = IB_QPS_ERR;
  422. mutex_lock(&dev->dev_lock);
  423. if (dev->qp_tbl) {
  424. cur_qp = dev->qp_tbl;
  425. for (i = 0; i < OCRDMA_MAX_QP; i++) {
  426. qp = cur_qp[i];
  427. if (qp) {
  428. /* change the QP state to ERROR */
  429. _ocrdma_modify_qp(&qp->ibqp, &attrs, attr_mask);
  430. err_event.event = IB_EVENT_QP_FATAL;
  431. err_event.element.qp = &qp->ibqp;
  432. err_event.device = &dev->ibdev;
  433. ib_dispatch_event(&err_event);
  434. }
  435. }
  436. }
  437. mutex_unlock(&dev->dev_lock);
  438. err_event.event = IB_EVENT_PORT_ERR;
  439. err_event.element.port_num = 1;
  440. err_event.device = &dev->ibdev;
  441. ib_dispatch_event(&err_event);
  442. return 0;
  443. }
  444. /* event handling via NIC driver ensures that all the NIC specific
  445. * initialization done before RoCE driver notifies
  446. * event to stack.
  447. */
  448. static void ocrdma_event_handler(struct ocrdma_dev *dev, u32 event)
  449. {
  450. switch (event) {
  451. case BE_DEV_UP:
  452. ocrdma_open(dev);
  453. break;
  454. case BE_DEV_DOWN:
  455. ocrdma_close(dev);
  456. break;
  457. };
  458. }
  459. static struct ocrdma_driver ocrdma_drv = {
  460. .name = "ocrdma_driver",
  461. .add = ocrdma_add,
  462. .remove = ocrdma_remove,
  463. .state_change_handler = ocrdma_event_handler,
  464. };
  465. static void ocrdma_unregister_inet6addr_notifier(void)
  466. {
  467. #if IS_ENABLED(CONFIG_IPV6)
  468. unregister_inet6addr_notifier(&ocrdma_inet6addr_notifier);
  469. #endif
  470. }
  471. static int __init ocrdma_init_module(void)
  472. {
  473. int status;
  474. #if IS_ENABLED(CONFIG_IPV6)
  475. status = register_inet6addr_notifier(&ocrdma_inet6addr_notifier);
  476. if (status)
  477. return status;
  478. #endif
  479. status = be_roce_register_driver(&ocrdma_drv);
  480. if (status)
  481. ocrdma_unregister_inet6addr_notifier();
  482. return status;
  483. }
  484. static void __exit ocrdma_exit_module(void)
  485. {
  486. be_roce_unregister_driver(&ocrdma_drv);
  487. ocrdma_unregister_inet6addr_notifier();
  488. }
  489. module_init(ocrdma_init_module);
  490. module_exit(ocrdma_exit_module);