forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
....@@ -32,21 +32,12 @@
3232 MODULE_AUTHOR("Cavium Networks, <support@cavium.com>");
3333 MODULE_DESCRIPTION("Cavium LiquidIO Intelligent Server Adapter Virtual Function Driver");
3434 MODULE_LICENSE("GPL");
35
-MODULE_VERSION(LIQUIDIO_VERSION);
3635
3736 static int debug = -1;
3837 module_param(debug, int, 0644);
3938 MODULE_PARM_DESC(debug, "NETIF_MSG debug bits");
4039
4140 #define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
42
-
43
-struct liquidio_rx_ctl_context {
44
- int octeon_id;
45
-
46
- wait_queue_head_t wc;
47
-
48
- int cond;
49
-};
5041
5142 struct oct_timestamp_resp {
5243 u64 rh;
....@@ -108,8 +99,8 @@
10899 }
109100
110101 /**
111
- * \brief Cause device to go quiet so it can be safely removed/reset/etc
112
- * @param oct Pointer to Octeon device
102
+ * pcierror_quiesce_device - Cause device to go quiet so it can be safely removed/reset/etc
103
+ * @oct: Pointer to Octeon device
113104 */
114105 static void pcierror_quiesce_device(struct octeon_device *oct)
115106 {
....@@ -152,8 +143,8 @@
152143 }
153144
154145 /**
155
- * \brief Cleanup PCI AER uncorrectable error status
156
- * @param dev Pointer to PCI device
146
+ * cleanup_aer_uncorrect_error_status - Cleanup PCI AER uncorrectable error status
147
+ * @dev: Pointer to PCI device
157148 */
158149 static void cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
159150 {
....@@ -172,8 +163,8 @@
172163 }
173164
174165 /**
175
- * \brief Stop all PCI IO to a given device
176
- * @param dev Pointer to Octeon device
166
+ * stop_pci_io - Stop all PCI IO to a given device
167
+ * @oct: Pointer to Octeon device
177168 */
178169 static void stop_pci_io(struct octeon_device *oct)
179170 {
....@@ -214,9 +205,9 @@
214205 }
215206
216207 /**
217
- * \brief called when PCI error is detected
218
- * @param pdev Pointer to PCI device
219
- * @param state The current pci connection state
208
+ * liquidio_pcie_error_detected - called when PCI error is detected
209
+ * @pdev: Pointer to PCI device
210
+ * @state: The current pci connection state
220211 *
221212 * This function is called after a PCI bus error affecting
222213 * this device has been detected.
....@@ -265,8 +256,8 @@
265256 };
266257
267258 /**
268
- * \brief Print link information
269
- * @param netdev network device
259
+ * print_link_info - Print link information
260
+ * @netdev: network device
270261 */
271262 static void print_link_info(struct net_device *netdev)
272263 {
....@@ -287,8 +278,8 @@
287278 }
288279
289280 /**
290
- * \brief Routine to notify MTU change
291
- * @param work work_struct data structure
281
+ * octnet_link_status_change - Routine to notify MTU change
282
+ * @work: work_struct data structure
292283 */
293284 static void octnet_link_status_change(struct work_struct *work)
294285 {
....@@ -305,8 +296,8 @@
305296 }
306297
307298 /**
308
- * \brief Sets up the mtu status change work
309
- * @param netdev network device
299
+ * setup_link_status_change_wq - Sets up the mtu status change work
300
+ * @netdev: network device
310301 */
311302 static int setup_link_status_change_wq(struct net_device *netdev)
312303 {
....@@ -337,9 +328,9 @@
337328 }
338329
339330 /**
340
- * \brief Update link status
341
- * @param netdev network device
342
- * @param ls link status structure
331
+ * update_link_status - Update link status
332
+ * @netdev: network device
333
+ * @ls: link status structure
343334 *
344335 * Called on receipt of a link status response from the core application to
345336 * update each interface's link status.
....@@ -383,13 +374,13 @@
383374 }
384375
385376 /**
386
- * \brief PCI probe handler
387
- * @param pdev PCI device structure
388
- * @param ent unused
377
+ * liquidio_vf_probe - PCI probe handler
378
+ * @pdev: PCI device structure
379
+ * @ent: unused
389380 */
390381 static int
391382 liquidio_vf_probe(struct pci_dev *pdev,
392
- const struct pci_device_id *ent __attribute__((unused)))
383
+ const struct pci_device_id __maybe_unused *ent)
393384 {
394385 struct octeon_device *oct_dev = NULL;
395386
....@@ -425,8 +416,8 @@
425416 }
426417
427418 /**
428
- * \brief PCI FLR for each Octeon device.
429
- * @param oct octeon device
419
+ * octeon_pci_flr - PCI FLR for each Octeon device.
420
+ * @oct: octeon device
430421 */
431422 static void octeon_pci_flr(struct octeon_device *oct)
432423 {
....@@ -446,12 +437,13 @@
446437 }
447438
448439 /**
449
- *\brief Destroy resources associated with octeon device
450
- * @param pdev PCI device structure
451
- * @param ent unused
440
+ * octeon_destroy_resources - Destroy resources associated with octeon device
441
+ * @oct: octeon device
452442 */
453443 static void octeon_destroy_resources(struct octeon_device *oct)
454444 {
445
+ struct octeon_device_priv *oct_priv =
446
+ (struct octeon_device_priv *)oct->priv;
455447 struct msix_entry *msix_entries;
456448 int i;
457449
....@@ -467,15 +459,14 @@
467459
468460 schedule_timeout_uninterruptible(HZ / 10);
469461
470
- /* fallthrough */
462
+ fallthrough;
471463 case OCT_DEV_HOST_OK:
472
- /* fallthrough */
473464 case OCT_DEV_IO_QUEUES_DONE:
474
- if (wait_for_pending_requests(oct))
475
- dev_err(&oct->pci_dev->dev, "There were pending requests\n");
476
-
477465 if (lio_wait_for_instr_fetch(oct))
478466 dev_err(&oct->pci_dev->dev, "IQ had pending instructions\n");
467
+
468
+ if (wait_for_pending_requests(oct))
469
+ dev_err(&oct->pci_dev->dev, "There were pending requests\n");
479470
480471 /* Disable the input and output queues now. No more packets will
481472 * arrive from Octeon, but we should wait for all packet
....@@ -485,7 +476,33 @@
485476
486477 if (lio_wait_for_oq_pkts(oct))
487478 dev_err(&oct->pci_dev->dev, "OQ had pending packets\n");
488
- /* fall through */
479
+
480
+ /* Force all requests waiting to be fetched by OCTEON to
481
+ * complete.
482
+ */
483
+ for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) {
484
+ struct octeon_instr_queue *iq;
485
+
486
+ if (!(oct->io_qmask.iq & BIT_ULL(i)))
487
+ continue;
488
+ iq = oct->instr_queue[i];
489
+
490
+ if (atomic_read(&iq->instr_pending)) {
491
+ spin_lock_bh(&iq->lock);
492
+ iq->fill_cnt = 0;
493
+ iq->octeon_read_index = iq->host_write_index;
494
+ iq->stats.instr_processed +=
495
+ atomic_read(&iq->instr_pending);
496
+ lio_process_iq_request_list(oct, iq, 0);
497
+ spin_unlock_bh(&iq->lock);
498
+ }
499
+ }
500
+
501
+ lio_process_ordered_list(oct, 1);
502
+ octeon_free_sc_done_list(oct);
503
+ octeon_free_sc_zombie_list(oct);
504
+
505
+ fallthrough;
489506 case OCT_DEV_INTR_SET_DONE:
490507 /* Disable interrupts */
491508 oct->fn_list.disable_interrupt(oct, OCTEON_ALL_INTR);
....@@ -514,15 +531,15 @@
514531 else
515532 cn23xx_vf_ask_pf_to_do_flr(oct);
516533
517
- /* fallthrough */
534
+ fallthrough;
518535 case OCT_DEV_MSIX_ALLOC_VECTOR_DONE:
519536 octeon_free_ioq_vector(oct);
520537
521
- /* fallthrough */
538
+ fallthrough;
522539 case OCT_DEV_MBOX_SETUP_DONE:
523540 oct->fn_list.free_mbox(oct);
524541
525
- /* fallthrough */
542
+ fallthrough;
526543 case OCT_DEV_IN_RESET:
527544 case OCT_DEV_DROQ_INIT_DONE:
528545 mdelay(100);
....@@ -532,11 +549,11 @@
532549 octeon_delete_droq(oct, i);
533550 }
534551
535
- /* fallthrough */
552
+ fallthrough;
536553 case OCT_DEV_RESP_LIST_INIT_DONE:
537554 octeon_delete_response_list(oct);
538555
539
- /* fallthrough */
556
+ fallthrough;
540557 case OCT_DEV_INSTR_QUEUE_INIT_DONE:
541558 for (i = 0; i < MAX_OCTEON_INSTR_QUEUES(oct); i++) {
542559 if (!(oct->io_qmask.iq & BIT_ULL(i)))
....@@ -544,87 +561,60 @@
544561 octeon_delete_instr_queue(oct, i);
545562 }
546563
547
- /* fallthrough */
564
+ fallthrough;
548565 case OCT_DEV_SC_BUFF_POOL_INIT_DONE:
549566 octeon_free_sc_buffer_pool(oct);
550567
551
- /* fallthrough */
568
+ fallthrough;
552569 case OCT_DEV_DISPATCH_INIT_DONE:
553570 octeon_delete_dispatch_list(oct);
554571 cancel_delayed_work_sync(&oct->nic_poll_work.work);
555572
556
- /* fallthrough */
573
+ fallthrough;
557574 case OCT_DEV_PCI_MAP_DONE:
558575 octeon_unmap_pci_barx(oct, 0);
559576 octeon_unmap_pci_barx(oct, 1);
560577
561
- /* fallthrough */
578
+ fallthrough;
562579 case OCT_DEV_PCI_ENABLE_DONE:
563580 pci_clear_master(oct->pci_dev);
564581 /* Disable the device, releasing the PCI INT */
565582 pci_disable_device(oct->pci_dev);
566583
567
- /* fallthrough */
584
+ fallthrough;
568585 case OCT_DEV_BEGIN_STATE:
569586 /* Nothing to be done here either */
570587 break;
571588 }
589
+
590
+ tasklet_kill(&oct_priv->droq_tasklet);
572591 }
573592
574593 /**
575
- * \brief Callback for rx ctrl
576
- * @param status status of request
577
- * @param buf pointer to resp structure
594
+ * send_rx_ctrl_cmd - Send Rx control command
595
+ * @lio: per-network private data
596
+ * @start_stop: whether to start or stop
578597 */
579
-static void rx_ctl_callback(struct octeon_device *oct,
580
- u32 status, void *buf)
581
-{
582
- struct octeon_soft_command *sc = (struct octeon_soft_command *)buf;
583
- struct liquidio_rx_ctl_context *ctx;
584
-
585
- ctx = (struct liquidio_rx_ctl_context *)sc->ctxptr;
586
-
587
- oct = lio_get_device(ctx->octeon_id);
588
- if (status)
589
- dev_err(&oct->pci_dev->dev, "rx ctl instruction failed. Status: %llx\n",
590
- CVM_CAST64(status));
591
- WRITE_ONCE(ctx->cond, 1);
592
-
593
- /* This barrier is required to be sure that the response has been
594
- * written fully before waking up the handler
595
- */
596
- wmb();
597
-
598
- wake_up_interruptible(&ctx->wc);
599
-}
600
-
601
-/**
602
- * \brief Send Rx control command
603
- * @param lio per-network private data
604
- * @param start_stop whether to start or stop
605
- */
606
-static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)
598
+static int send_rx_ctrl_cmd(struct lio *lio, int start_stop)
607599 {
608600 struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;
609
- int ctx_size = sizeof(struct liquidio_rx_ctl_context);
610
- struct liquidio_rx_ctl_context *ctx;
611601 struct octeon_soft_command *sc;
612602 union octnet_cmd *ncmd;
613603 int retval;
614604
615605 if (oct->props[lio->ifidx].rx_on == start_stop)
616
- return;
606
+ return 0;
617607
618608 sc = (struct octeon_soft_command *)
619609 octeon_alloc_soft_command(oct, OCTNET_CMD_SIZE,
620
- 16, ctx_size);
610
+ 16, 0);
611
+ if (!sc) {
612
+ netif_info(lio, rx_err, lio->netdev,
613
+ "Failed to allocate octeon_soft_command struct\n");
614
+ return -ENOMEM;
615
+ }
621616
622617 ncmd = (union octnet_cmd *)sc->virtdptr;
623
- ctx = (struct liquidio_rx_ctl_context *)sc->ctxptr;
624
-
625
- WRITE_ONCE(ctx->cond, 0);
626
- ctx->octeon_id = lio_get_device_id(oct);
627
- init_waitqueue_head(&ctx->wc);
628618
629619 ncmd->u64 = 0;
630620 ncmd->s.cmd = OCTNET_CMD_RX_CTL;
....@@ -637,29 +627,32 @@
637627 octeon_prepare_soft_command(oct, sc, OPCODE_NIC,
638628 OPCODE_NIC_CMD, 0, 0, 0);
639629
640
- sc->callback = rx_ctl_callback;
641
- sc->callback_arg = sc;
642
- sc->wait_time = 5000;
630
+ init_completion(&sc->complete);
631
+ sc->sc_status = OCTEON_REQUEST_PENDING;
643632
644633 retval = octeon_send_soft_command(oct, sc);
645634 if (retval == IQ_SEND_FAILED) {
646635 netif_info(lio, rx_err, lio->netdev, "Failed to send RX Control message\n");
636
+ octeon_free_soft_command(oct, sc);
647637 } else {
648638 /* Sleep on a wait queue till the cond flag indicates that the
649639 * response arrived or timed-out.
650640 */
651
- if (sleep_cond(&ctx->wc, &ctx->cond) == -EINTR)
652
- return;
641
+ retval = wait_for_sc_completion_timeout(oct, sc, 0);
642
+ if (retval)
643
+ return retval;
644
+
653645 oct->props[lio->ifidx].rx_on = start_stop;
646
+ WRITE_ONCE(sc->caller_is_done, true);
654647 }
655648
656
- octeon_free_soft_command(oct, sc);
649
+ return retval;
657650 }
658651
659652 /**
660
- * \brief Destroy NIC device interface
661
- * @param oct octeon device
662
- * @param ifidx which interface to destroy
653
+ * liquidio_destroy_nic_device - Destroy NIC device interface
654
+ * @oct: octeon device
655
+ * @ifidx: which interface to destroy
663656 *
664657 * Cleanup associated with each interface for an Octeon device when NIC
665658 * module is being unloaded or if initialization fails during load.
....@@ -667,6 +660,8 @@
667660 static void liquidio_destroy_nic_device(struct octeon_device *oct, int ifidx)
668661 {
669662 struct net_device *netdev = oct->props[ifidx].netdev;
663
+ struct octeon_device_priv *oct_priv =
664
+ (struct octeon_device_priv *)oct->priv;
670665 struct napi_struct *napi, *n;
671666 struct lio *lio;
672667
....@@ -696,6 +691,8 @@
696691 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
697692 netif_napi_del(napi);
698693
694
+ tasklet_enable(&oct_priv->droq_tasklet);
695
+
699696 if (atomic_read(&lio->ifstate) & LIO_IFSTATE_REGISTERED)
700697 unregister_netdev(netdev);
701698
....@@ -713,8 +710,8 @@
713710 }
714711
715712 /**
716
- * \brief Stop complete NIC functionality
717
- * @param oct octeon device
713
+ * liquidio_stop_nic_module - Stop complete NIC functionality
714
+ * @oct: octeon device
718715 */
719716 static int liquidio_stop_nic_module(struct octeon_device *oct)
720717 {
....@@ -746,8 +743,8 @@
746743 }
747744
748745 /**
749
- * \brief Cleans up resources at unload time
750
- * @param pdev PCI device structure
746
+ * liquidio_vf_remove - Cleans up resources at unload time
747
+ * @pdev: PCI device structure
751748 */
752749 static void liquidio_vf_remove(struct pci_dev *pdev)
753750 {
....@@ -772,8 +769,8 @@
772769 }
773770
774771 /**
775
- * \brief PCI initialization for each Octeon device.
776
- * @param oct octeon device
772
+ * octeon_pci_os_setup - PCI initialization for each Octeon device.
773
+ * @oct: octeon device
777774 */
778775 static int octeon_pci_os_setup(struct octeon_device *oct)
779776 {
....@@ -801,8 +798,8 @@
801798 }
802799
803800 /**
804
- * \brief Unmap and free network buffer
805
- * @param buf buffer
801
+ * free_netbuf - Unmap and free network buffer
802
+ * @buf: buffer
806803 */
807804 static void free_netbuf(void *buf)
808805 {
....@@ -821,8 +818,8 @@
821818 }
822819
823820 /**
824
- * \brief Unmap and free gather buffer
825
- * @param buf buffer
821
+ * free_netsgbuf - Unmap and free gather buffer
822
+ * @buf: buffer
826823 */
827824 static void free_netsgbuf(void *buf)
828825 {
....@@ -844,11 +841,11 @@
844841
845842 i = 1;
846843 while (frags--) {
847
- struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
844
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
848845
849846 pci_unmap_page((lio->oct_dev)->pci_dev,
850847 g->sg[(i >> 2)].ptr[(i & 3)],
851
- frag->size, DMA_TO_DEVICE);
848
+ skb_frag_size(frag), DMA_TO_DEVICE);
852849 i++;
853850 }
854851
....@@ -862,8 +859,8 @@
862859 }
863860
864861 /**
865
- * \brief Unmap and free gather buffer with response
866
- * @param buf buffer
862
+ * free_netsgbuf_with_resp - Unmap and free gather buffer with response
863
+ * @buf: buffer
867864 */
868865 static void free_netsgbuf_with_resp(void *buf)
869866 {
....@@ -888,11 +885,11 @@
888885
889886 i = 1;
890887 while (frags--) {
891
- struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
888
+ skb_frag_t *frag = &skb_shinfo(skb)->frags[i - 1];
892889
893890 pci_unmap_page((lio->oct_dev)->pci_dev,
894891 g->sg[(i >> 2)].ptr[(i & 3)],
895
- frag->size, DMA_TO_DEVICE);
892
+ skb_frag_size(frag), DMA_TO_DEVICE);
896893 i++;
897894 }
898895
....@@ -906,16 +903,21 @@
906903 }
907904
908905 /**
909
- * \brief Net device open for LiquidIO
910
- * @param netdev network device
906
+ * liquidio_open - Net device open for LiquidIO
907
+ * @netdev: network device
911908 */
912909 static int liquidio_open(struct net_device *netdev)
913910 {
914911 struct lio *lio = GET_LIO(netdev);
915912 struct octeon_device *oct = lio->oct_dev;
913
+ struct octeon_device_priv *oct_priv =
914
+ (struct octeon_device_priv *)oct->priv;
916915 struct napi_struct *napi, *n;
916
+ int ret = 0;
917917
918918 if (!oct->props[lio->ifidx].napi_enabled) {
919
+ tasklet_disable(&oct_priv->droq_tasklet);
920
+
919921 list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list)
920922 napi_enable(napi);
921923
....@@ -932,26 +934,38 @@
932934 netif_info(lio, ifup, lio->netdev, "Interface Open, ready for traffic\n");
933935 start_txqs(netdev);
934936
937
+ INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats);
938
+ lio->stats_wk.ctxptr = lio;
939
+ schedule_delayed_work(&lio->stats_wk.work, msecs_to_jiffies
940
+ (LIQUIDIO_NDEV_STATS_POLL_TIME_MS));
941
+
935942 /* tell Octeon to start forwarding packets to host */
936
- send_rx_ctrl_cmd(lio, 1);
943
+ ret = send_rx_ctrl_cmd(lio, 1);
944
+ if (ret)
945
+ return ret;
937946
938947 dev_info(&oct->pci_dev->dev, "%s interface is opened\n", netdev->name);
939948
940
- return 0;
949
+ return ret;
941950 }
942951
943952 /**
944
- * \brief Net device stop for LiquidIO
945
- * @param netdev network device
953
+ * liquidio_stop - jNet device stop for LiquidIO
954
+ * @netdev: network device
946955 */
947956 static int liquidio_stop(struct net_device *netdev)
948957 {
949958 struct lio *lio = GET_LIO(netdev);
950959 struct octeon_device *oct = lio->oct_dev;
960
+ struct octeon_device_priv *oct_priv =
961
+ (struct octeon_device_priv *)oct->priv;
951962 struct napi_struct *napi, *n;
963
+ int ret = 0;
952964
953965 /* tell Octeon to stop forwarding packets to host */
954
- send_rx_ctrl_cmd(lio, 0);
966
+ ret = send_rx_ctrl_cmd(lio, 0);
967
+ if (ret)
968
+ return ret;
955969
956970 netif_info(lio, ifdown, lio->netdev, "Stopping interface!\n");
957971 /* Inform that netif carrier is down */
....@@ -977,16 +991,20 @@
977991 oct->props[lio->ifidx].napi_enabled = 0;
978992
979993 oct->droq[0]->ops.poll_mode = 0;
994
+
995
+ tasklet_enable(&oct_priv->droq_tasklet);
980996 }
997
+
998
+ cancel_delayed_work_sync(&lio->stats_wk.work);
981999
9821000 dev_info(&oct->pci_dev->dev, "%s interface is stopped\n", netdev->name);
9831001
984
- return 0;
1002
+ return ret;
9851003 }
9861004
9871005 /**
988
- * \brief Converts a mask based on net device flags
989
- * @param netdev network device
1006
+ * get_new_flags - Converts a mask based on net device flags
1007
+ * @netdev: network device
9901008 *
9911009 * This routine generates a octnet_ifflags mask from the net device flags
9921010 * received from the OS.
....@@ -1054,8 +1072,8 @@
10541072 }
10551073
10561074 /**
1057
- * \brief Net device set_multicast_list
1058
- * @param netdev network device
1075
+ * liquidio_set_mcast_list - Net device set_multicast_list
1076
+ * @netdev: network device
10591077 */
10601078 static void liquidio_set_mcast_list(struct net_device *netdev)
10611079 {
....@@ -1093,10 +1111,9 @@
10931111 /* Apparently, any activity in this call from the kernel has to
10941112 * be atomic. So we won't wait for response.
10951113 */
1096
- nctrl.wait_time = 0;
10971114
10981115 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
1099
- if (ret < 0) {
1116
+ if (ret) {
11001117 dev_err(&oct->pci_dev->dev, "DEVFLAGS change failed in core (ret: 0x%x)\n",
11011118 ret);
11021119 }
....@@ -1105,8 +1122,9 @@
11051122 }
11061123
11071124 /**
1108
- * \brief Net device set_mac_address
1109
- * @param netdev network device
1125
+ * liquidio_set_mac - Net device set_mac_address
1126
+ * @netdev: network device
1127
+ * @p: opaque pointer to sockaddr
11101128 */
11111129 static int liquidio_set_mac(struct net_device *netdev, void *p)
11121130 {
....@@ -1133,8 +1151,6 @@
11331151 nctrl.ncmd.s.more = 1;
11341152 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
11351153 nctrl.netpndev = (u64)netdev;
1136
- nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
1137
- nctrl.wait_time = 100;
11381154
11391155 nctrl.udd[0] = 0;
11401156 /* The MAC Address is presented in network byte order. */
....@@ -1145,6 +1161,13 @@
11451161 dev_err(&oct->pci_dev->dev, "MAC Address change failed\n");
11461162 return -ENOMEM;
11471163 }
1164
+
1165
+ if (nctrl.sc_status ==
1166
+ FIRMWARE_STATUS_CODE(OCTEON_REQUEST_NO_PERMISSION)) {
1167
+ dev_err(&oct->pci_dev->dev, "MAC Address change failed: no permission\n");
1168
+ return -EPERM;
1169
+ }
1170
+
11481171 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
11491172 ether_addr_copy(((u8 *)&lio->linfo.hw_addr) + 2, addr->sa_data);
11501173
....@@ -1198,7 +1221,6 @@
11981221 lstats->rx_packets = pkts;
11991222 lstats->rx_dropped = drop;
12001223
1201
- octnet_get_link_stats(netdev);
12021224 lstats->multicast = oct->link_stats.fromwire.fw_total_mcast;
12031225
12041226 /* detailed rx_errors: */
....@@ -1220,10 +1242,9 @@
12201242 }
12211243
12221244 /**
1223
- * \brief Handler for SIOCSHWTSTAMP ioctl
1224
- * @param netdev network device
1225
- * @param ifr interface request
1226
- * @param cmd command
1245
+ * hwtstamp_ioctl - Handler for SIOCSHWTSTAMP ioctl
1246
+ * @netdev: network device
1247
+ * @ifr: interface request
12271248 */
12281249 static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr)
12291250 {
....@@ -1278,10 +1299,10 @@
12781299 }
12791300
12801301 /**
1281
- * \brief ioctl handler
1282
- * @param netdev network device
1283
- * @param ifr interface request
1284
- * @param cmd command
1302
+ * liquidio_ioctl - ioctl handler
1303
+ * @netdev: network device
1304
+ * @ifr: interface request
1305
+ * @cmd: command
12851306 */
12861307 static int liquidio_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
12871308 {
....@@ -1330,10 +1351,10 @@
13301351 tx_buffer_free(skb);
13311352 }
13321353
1333
-/* \brief Send a data packet that will be timestamped
1334
- * @param oct octeon device
1335
- * @param ndata pointer to network data
1336
- * @param finfo pointer to private network data
1354
+/* send_nic_timestamp_pkt - Send a data packet that will be timestamped
1355
+ * @oct: octeon device
1356
+ * @ndata: pointer to network data
1357
+ * @finfo: pointer to private network data
13371358 */
13381359 static int send_nic_timestamp_pkt(struct octeon_device *oct,
13391360 struct octnic_data_pkt *ndata,
....@@ -1384,9 +1405,10 @@
13841405 return retval;
13851406 }
13861407
1387
-/** \brief Transmit networks packets to the Octeon interface
1388
- * @param skbuff skbuff struct to be passed to network layer.
1389
- * @param netdev pointer to network device
1408
+/**
1409
+ * liquidio_xmit - Transmit networks packets to the Octeon interface
1410
+ * @skb: skbuff struct to be passed to network layer.
1411
+ * @netdev: pointer to network device
13901412 * @returns whether the packet was transmitted to the device okay or not
13911413 * (NETDEV_TX_OK or NETDEV_TX_BUSY)
13921414 */
....@@ -1486,7 +1508,7 @@
14861508 ndata.reqtype = REQTYPE_NORESP_NET;
14871509
14881510 } else {
1489
- struct skb_frag_struct *frag;
1511
+ skb_frag_t *frag;
14901512 struct octnic_gather *g;
14911513 int i, frags;
14921514
....@@ -1524,11 +1546,9 @@
15241546 frag = &skb_shinfo(skb)->frags[i - 1];
15251547
15261548 g->sg[(i >> 2)].ptr[(i & 3)] =
1527
- dma_map_page(&oct->pci_dev->dev,
1528
- frag->page.p,
1529
- frag->page_offset,
1530
- frag->size,
1531
- DMA_TO_DEVICE);
1549
+ skb_frag_dma_map(&oct->pci_dev->dev,
1550
+ frag, 0, skb_frag_size(frag),
1551
+ DMA_TO_DEVICE);
15321552 if (dma_mapping_error(&oct->pci_dev->dev,
15331553 g->sg[i >> 2].ptr[i & 3])) {
15341554 dma_unmap_single(&oct->pci_dev->dev,
....@@ -1539,7 +1559,7 @@
15391559 frag = &skb_shinfo(skb)->frags[j - 1];
15401560 dma_unmap_page(&oct->pci_dev->dev,
15411561 g->sg[j >> 2].ptr[j & 3],
1542
- frag->size,
1562
+ skb_frag_size(frag),
15431563 DMA_TO_DEVICE);
15441564 }
15451565 dev_err(&oct->pci_dev->dev, "%s DMA mapping error 3\n",
....@@ -1547,7 +1567,8 @@
15471567 return NETDEV_TX_BUSY;
15481568 }
15491569
1550
- add_sg_size(&g->sg[(i >> 2)], frag->size, (i & 3));
1570
+ add_sg_size(&g->sg[(i >> 2)], skb_frag_size(frag),
1571
+ (i & 3));
15511572 i++;
15521573 }
15531574
....@@ -1574,7 +1595,7 @@
15741595 irh->vlan = skb_vlan_tag_get(skb) & VLAN_VID_MASK;
15751596 }
15761597
1577
- xmit_more = skb->xmit_more;
1598
+ xmit_more = netdev_xmit_more();
15781599
15791600 if (unlikely(cmdsetup.s.timestamp))
15801601 status = send_nic_timestamp_pkt(oct, &ndata, finfo, xmit_more);
....@@ -1615,10 +1636,12 @@
16151636 return NETDEV_TX_OK;
16161637 }
16171638
1618
-/** \brief Network device Tx timeout
1619
- * @param netdev pointer to network device
1639
+/**
1640
+ * liquidio_tx_timeout - Network device Tx timeout
1641
+ * @netdev: pointer to network device
1642
+ * @txqueue: index of the hung transmit queue
16201643 */
1621
-static void liquidio_tx_timeout(struct net_device *netdev)
1644
+static void liquidio_tx_timeout(struct net_device *netdev, unsigned int txqueue)
16221645 {
16231646 struct lio *lio;
16241647
....@@ -1638,8 +1661,6 @@
16381661 struct lio *lio = GET_LIO(netdev);
16391662 struct octeon_device *oct = lio->oct_dev;
16401663 struct octnic_ctrl_pkt nctrl;
1641
- struct completion compl;
1642
- u16 response_code;
16431664 int ret = 0;
16441665
16451666 memset(&nctrl, 0, sizeof(struct octnic_ctrl_pkt));
....@@ -1648,26 +1669,15 @@
16481669 nctrl.ncmd.s.cmd = OCTNET_CMD_ADD_VLAN_FILTER;
16491670 nctrl.ncmd.s.param1 = vid;
16501671 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
1651
- nctrl.wait_time = 100;
16521672 nctrl.netpndev = (u64)netdev;
16531673 nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
1654
- init_completion(&compl);
1655
- nctrl.completion = &compl;
1656
- nctrl.response_code = &response_code;
16571674
16581675 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
1659
- if (ret < 0) {
1676
+ if (ret) {
16601677 dev_err(&oct->pci_dev->dev, "Add VLAN filter failed in core (ret: 0x%x)\n",
16611678 ret);
1662
- return -EIO;
1679
+ return -EPERM;
16631680 }
1664
-
1665
- if (!wait_for_completion_timeout(&compl,
1666
- msecs_to_jiffies(nctrl.wait_time)))
1667
- return -EPERM;
1668
-
1669
- if (READ_ONCE(response_code))
1670
- return -EPERM;
16711681
16721682 return 0;
16731683 }
....@@ -1687,14 +1697,15 @@
16871697 nctrl.ncmd.s.cmd = OCTNET_CMD_DEL_VLAN_FILTER;
16881698 nctrl.ncmd.s.param1 = vid;
16891699 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
1690
- nctrl.wait_time = 100;
16911700 nctrl.netpndev = (u64)netdev;
16921701 nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
16931702
16941703 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
1695
- if (ret < 0) {
1704
+ if (ret) {
16961705 dev_err(&oct->pci_dev->dev, "Del VLAN filter failed in core (ret: 0x%x)\n",
16971706 ret);
1707
+ if (ret > 0)
1708
+ ret = -EIO;
16981709 }
16991710 return ret;
17001711 }
....@@ -1720,14 +1731,15 @@
17201731 nctrl.ncmd.s.cmd = command;
17211732 nctrl.ncmd.s.param1 = rx_cmd;
17221733 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
1723
- nctrl.wait_time = 100;
17241734 nctrl.netpndev = (u64)netdev;
17251735 nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
17261736
17271737 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
1728
- if (ret < 0) {
1738
+ if (ret) {
17291739 dev_err(&oct->pci_dev->dev, "DEVFLAGS RXCSUM change failed in core (ret:0x%x)\n",
17301740 ret);
1741
+ if (ret > 0)
1742
+ ret = -EIO;
17311743 }
17321744 return ret;
17331745 }
....@@ -1755,18 +1767,48 @@
17551767 nctrl.ncmd.s.more = vxlan_cmd_bit;
17561768 nctrl.ncmd.s.param1 = vxlan_port;
17571769 nctrl.iq_no = lio->linfo.txpciq[0].s.q_no;
1758
- nctrl.wait_time = 100;
17591770 nctrl.netpndev = (u64)netdev;
17601771 nctrl.cb_fn = liquidio_link_ctrl_cmd_completion;
17611772
17621773 ret = octnet_send_nic_ctrl_pkt(lio->oct_dev, &nctrl);
1763
- if (ret < 0) {
1774
+ if (ret) {
17641775 dev_err(&oct->pci_dev->dev,
17651776 "DEVFLAGS VxLAN port add/delete failed in core (ret : 0x%x)\n",
17661777 ret);
1778
+ if (ret > 0)
1779
+ ret = -EIO;
17671780 }
17681781 return ret;
17691782 }
1783
+
1784
+static int liquidio_udp_tunnel_set_port(struct net_device *netdev,
1785
+ unsigned int table, unsigned int entry,
1786
+ struct udp_tunnel_info *ti)
1787
+{
1788
+ return liquidio_vxlan_port_command(netdev,
1789
+ OCTNET_CMD_VXLAN_PORT_CONFIG,
1790
+ htons(ti->port),
1791
+ OCTNET_CMD_VXLAN_PORT_ADD);
1792
+}
1793
+
1794
+static int liquidio_udp_tunnel_unset_port(struct net_device *netdev,
1795
+ unsigned int table,
1796
+ unsigned int entry,
1797
+ struct udp_tunnel_info *ti)
1798
+{
1799
+ return liquidio_vxlan_port_command(netdev,
1800
+ OCTNET_CMD_VXLAN_PORT_CONFIG,
1801
+ htons(ti->port),
1802
+ OCTNET_CMD_VXLAN_PORT_DEL);
1803
+}
1804
+
1805
+static const struct udp_tunnel_nic_info liquidio_udp_tunnels = {
1806
+ .set_port = liquidio_udp_tunnel_set_port,
1807
+ .unset_port = liquidio_udp_tunnel_unset_port,
1808
+ .tables = {
1809
+ { .n_entries = 1024, .tunnel_types = UDP_TUNNEL_TYPE_VXLAN, },
1810
+ },
1811
+};
17701812
17711813 /** \brief Net device fix features
17721814 * @param netdev pointer to network device
....@@ -1836,30 +1878,6 @@
18361878 return 0;
18371879 }
18381880
1839
-static void liquidio_add_vxlan_port(struct net_device *netdev,
1840
- struct udp_tunnel_info *ti)
1841
-{
1842
- if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
1843
- return;
1844
-
1845
- liquidio_vxlan_port_command(netdev,
1846
- OCTNET_CMD_VXLAN_PORT_CONFIG,
1847
- htons(ti->port),
1848
- OCTNET_CMD_VXLAN_PORT_ADD);
1849
-}
1850
-
1851
-static void liquidio_del_vxlan_port(struct net_device *netdev,
1852
- struct udp_tunnel_info *ti)
1853
-{
1854
- if (ti->type != UDP_TUNNEL_TYPE_VXLAN)
1855
- return;
1856
-
1857
- liquidio_vxlan_port_command(netdev,
1858
- OCTNET_CMD_VXLAN_PORT_CONFIG,
1859
- htons(ti->port),
1860
- OCTNET_CMD_VXLAN_PORT_DEL);
1861
-}
1862
-
18631881 static const struct net_device_ops lionetdevops = {
18641882 .ndo_open = liquidio_open,
18651883 .ndo_stop = liquidio_stop,
....@@ -1874,8 +1892,8 @@
18741892 .ndo_do_ioctl = liquidio_ioctl,
18751893 .ndo_fix_features = liquidio_fix_features,
18761894 .ndo_set_features = liquidio_set_features,
1877
- .ndo_udp_tunnel_add = liquidio_add_vxlan_port,
1878
- .ndo_udp_tunnel_del = liquidio_del_vxlan_port,
1895
+ .ndo_udp_tunnel_add = udp_tunnel_nic_add_port,
1896
+ .ndo_udp_tunnel_del = udp_tunnel_nic_del_port,
18791897 };
18801898
18811899 static int lio_nic_info(struct octeon_recv_info *recv_info, void *buf)
....@@ -1914,8 +1932,8 @@
19141932 }
19151933
19161934 /**
1917
- * \brief Setup network interfaces
1918
- * @param octeon_dev octeon device
1935
+ * setup_nic_devices - Setup network interfaces
1936
+ * @octeon_dev: octeon device
19191937 *
19201938 * Called during init time for each device. It assumes the NIC
19211939 * is already up and running. The link information for each
....@@ -1924,8 +1942,7 @@
19241942 static int setup_nic_devices(struct octeon_device *octeon_dev)
19251943 {
19261944 int retval, num_iqueues, num_oqueues;
1927
- struct liquidio_if_cfg_context *ctx;
1928
- u32 resp_size, ctx_size, data_size;
1945
+ u32 resp_size, data_size;
19291946 struct liquidio_if_cfg_resp *resp;
19301947 struct octeon_soft_command *sc;
19311948 union oct_nic_if_cfg if_cfg;
....@@ -1956,23 +1973,17 @@
19561973
19571974 for (i = 0; i < octeon_dev->ifcount; i++) {
19581975 resp_size = sizeof(struct liquidio_if_cfg_resp);
1959
- ctx_size = sizeof(struct liquidio_if_cfg_context);
19601976 data_size = sizeof(struct lio_version);
19611977 sc = (struct octeon_soft_command *)
19621978 octeon_alloc_soft_command(octeon_dev, data_size,
1963
- resp_size, ctx_size);
1979
+ resp_size, 0);
19641980 resp = (struct liquidio_if_cfg_resp *)sc->virtrptr;
1965
- ctx = (struct liquidio_if_cfg_context *)sc->ctxptr;
19661981 vdata = (struct lio_version *)sc->virtdptr;
19671982
19681983 *((u64 *)vdata) = 0;
19691984 vdata->major = cpu_to_be16(LIQUIDIO_BASE_MAJOR_VERSION);
19701985 vdata->minor = cpu_to_be16(LIQUIDIO_BASE_MINOR_VERSION);
19711986 vdata->micro = cpu_to_be16(LIQUIDIO_BASE_MICRO_VERSION);
1972
-
1973
- WRITE_ONCE(ctx->cond, 0);
1974
- ctx->octeon_id = lio_get_device_id(octeon_dev);
1975
- init_waitqueue_head(&ctx->wc);
19761987
19771988 if_cfg.u64 = 0;
19781989
....@@ -1986,31 +1997,36 @@
19861997 OPCODE_NIC_IF_CFG, 0, if_cfg.u64,
19871998 0);
19881999
1989
- sc->callback = lio_if_cfg_callback;
1990
- sc->callback_arg = sc;
1991
- sc->wait_time = 5000;
2000
+ init_completion(&sc->complete);
2001
+ sc->sc_status = OCTEON_REQUEST_PENDING;
19922002
19932003 retval = octeon_send_soft_command(octeon_dev, sc);
19942004 if (retval == IQ_SEND_FAILED) {
19952005 dev_err(&octeon_dev->pci_dev->dev,
19962006 "iq/oq config failed status: %x\n", retval);
19972007 /* Soft instr is freed by driver in case of failure. */
1998
- goto setup_nic_dev_fail;
2008
+ octeon_free_soft_command(octeon_dev, sc);
2009
+ return(-EIO);
19992010 }
20002011
20012012 /* Sleep on a wait queue till the cond flag indicates that the
20022013 * response arrived or timed-out.
20032014 */
2004
- if (sleep_cond(&ctx->wc, &ctx->cond) == -EINTR) {
2005
- dev_err(&octeon_dev->pci_dev->dev, "Wait interrupted\n");
2006
- goto setup_nic_wait_intr;
2007
- }
2015
+ retval = wait_for_sc_completion_timeout(octeon_dev, sc, 0);
2016
+ if (retval)
2017
+ return retval;
20082018
20092019 retval = resp->status;
20102020 if (retval) {
2011
- dev_err(&octeon_dev->pci_dev->dev, "iq/oq config failed\n");
2012
- goto setup_nic_dev_fail;
2021
+ dev_err(&octeon_dev->pci_dev->dev,
2022
+ "iq/oq config failed, retval = %d\n", retval);
2023
+ WRITE_ONCE(sc->caller_is_done, true);
2024
+ return -EIO;
20132025 }
2026
+
2027
+ snprintf(octeon_dev->fw_info.liquidio_firmware_version,
2028
+ 32, "%s",
2029
+ resp->cfg_info.liquidio_firmware_version);
20142030
20152031 octeon_swap_8B_data((u64 *)(&resp->cfg_info),
20162032 (sizeof(struct liquidio_if_cfg_info)) >> 3);
....@@ -2022,7 +2038,8 @@
20222038 dev_err(&octeon_dev->pci_dev->dev,
20232039 "Got bad iqueues (%016llx) or oqueues (%016llx) from firmware.\n",
20242040 resp->cfg_info.iqmask, resp->cfg_info.oqmask);
2025
- goto setup_nic_dev_fail;
2041
+ WRITE_ONCE(sc->caller_is_done, true);
2042
+ goto setup_nic_dev_done;
20262043 }
20272044 dev_dbg(&octeon_dev->pci_dev->dev,
20282045 "interface %d, iqmask %016llx, oqmask %016llx, numiqueues %d, numoqueues %d\n",
....@@ -2033,7 +2050,8 @@
20332050
20342051 if (!netdev) {
20352052 dev_err(&octeon_dev->pci_dev->dev, "Device allocation failed\n");
2036
- goto setup_nic_dev_fail;
2053
+ WRITE_ONCE(sc->caller_is_done, true);
2054
+ goto setup_nic_dev_done;
20372055 }
20382056
20392057 SET_NETDEV_DEV(netdev, &octeon_dev->pci_dev->dev);
....@@ -2070,6 +2088,8 @@
20702088 lio->linfo.link.u64 = resp->cfg_info.linfo.link.u64;
20712089 lio->linfo.macaddr_is_admin_asgnd =
20722090 resp->cfg_info.linfo.macaddr_is_admin_asgnd;
2091
+ lio->linfo.macaddr_spoofchk =
2092
+ resp->cfg_info.linfo.macaddr_spoofchk;
20732093
20742094 lio->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
20752095
....@@ -2094,6 +2114,8 @@
20942114
20952115 netdev->hw_enc_features =
20962116 (lio->enc_dev_capability & ~NETIF_F_LRO);
2117
+ netdev->udp_tunnel_nic_info = &liquidio_udp_tunnels;
2118
+
20972119 netdev->vlan_features = lio->dev_capability;
20982120 /* Add any unchangeable hw features */
20992121 lio->dev_capability |= NETIF_F_HW_VLAN_CTAG_FILTER |
....@@ -2108,6 +2130,8 @@
21082130 /* MTU range: 68 - 16000 */
21092131 netdev->min_mtu = LIO_MIN_MTU_SIZE;
21102132 netdev->max_mtu = LIO_MAX_MTU_SIZE;
2133
+
2134
+ WRITE_ONCE(sc->caller_is_done, true);
21112135
21122136 /* Point to the properties for octeon device to which this
21132137 * interface belongs.
....@@ -2132,7 +2156,7 @@
21322156 lio->linfo.num_txpciq,
21332157 lio->linfo.num_rxpciq)) {
21342158 dev_err(&octeon_dev->pci_dev->dev, "I/O queues creation failed\n");
2135
- goto setup_nic_dev_fail;
2159
+ goto setup_nic_dev_free;
21362160 }
21372161
21382162 ifstate_set(lio, LIO_IFSTATE_DROQ_OPS);
....@@ -2155,7 +2179,7 @@
21552179 if (lio_setup_glists(octeon_dev, lio, num_iqueues)) {
21562180 dev_err(&octeon_dev->pci_dev->dev,
21572181 "Gather list allocation failed\n");
2158
- goto setup_nic_dev_fail;
2182
+ goto setup_nic_dev_free;
21592183 }
21602184
21612185 /* Register ethtool support */
....@@ -2170,15 +2194,15 @@
21702194 OCTNIC_LROIPV4 | OCTNIC_LROIPV6);
21712195
21722196 if (setup_link_status_change_wq(netdev))
2173
- goto setup_nic_dev_fail;
2197
+ goto setup_nic_dev_free;
21742198
21752199 if (setup_rx_oom_poll_fn(netdev))
2176
- goto setup_nic_dev_fail;
2200
+ goto setup_nic_dev_free;
21772201
21782202 /* Register the network device with the OS */
21792203 if (register_netdev(netdev)) {
21802204 dev_err(&octeon_dev->pci_dev->dev, "Device registration failed\n");
2181
- goto setup_nic_dev_fail;
2205
+ goto setup_nic_dev_free;
21822206 }
21832207
21842208 dev_dbg(&octeon_dev->pci_dev->dev,
....@@ -2201,30 +2225,27 @@
22012225 dev_dbg(&octeon_dev->pci_dev->dev,
22022226 "NIC ifidx:%d Setup successful\n", i);
22032227
2204
- octeon_free_soft_command(octeon_dev, sc);
2205
-
22062228 octeon_dev->no_speed_setting = 1;
22072229 }
22082230
22092231 return 0;
22102232
2211
-setup_nic_dev_fail:
2212
-
2213
- octeon_free_soft_command(octeon_dev, sc);
2214
-
2215
-setup_nic_wait_intr:
2233
+setup_nic_dev_free:
22162234
22172235 while (i--) {
22182236 dev_err(&octeon_dev->pci_dev->dev,
22192237 "NIC ifidx:%d Setup failed\n", i);
22202238 liquidio_destroy_nic_device(octeon_dev, i);
22212239 }
2240
+
2241
+setup_nic_dev_done:
2242
+
22222243 return -ENODEV;
22232244 }
22242245
22252246 /**
2226
- * \brief initialize the NIC
2227
- * @param oct octeon device
2247
+ * liquidio_init_nic_module - initialize the NIC
2248
+ * @oct: octeon device
22282249 *
22292250 * This initialization routine is called once the Octeon device application is
22302251 * up and running
....@@ -2264,8 +2285,8 @@
22642285 }
22652286
22662287 /**
2267
- * \brief Device initialization for each Octeon device that is probed
2268
- * @param octeon_dev octeon device
2288
+ * octeon_device_init - Device initialization for each Octeon device that is probed
2289
+ * @oct: octeon device
22692290 */
22702291 static int octeon_device_init(struct octeon_device *oct)
22712292 {
....@@ -2351,8 +2372,8 @@
23512372 }
23522373 atomic_set(&oct->status, OCT_DEV_MSIX_ALLOC_VECTOR_DONE);
23532374
2354
- dev_info(&oct->pci_dev->dev, "OCTEON_CN23XX VF Version: %s, %d ioqs\n",
2355
- LIQUIDIO_VERSION, oct->sriov_info.rings_per_vf);
2375
+ dev_info(&oct->pci_dev->dev, "OCTEON_CN23XX VF: %d ioqs\n",
2376
+ oct->sriov_info.rings_per_vf);
23562377
23572378 /* Setup the interrupt handler and record the INT SUM register address*/
23582379 if (octeon_setup_interrupt(oct, oct->sriov_info.rings_per_vf))