hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
....@@ -50,7 +50,7 @@
5050 * Here the io threads are per cpu but the l2 thread is just one
5151 */
5252 struct fcoe_percpu_s bnx2fc_global;
53
-DEFINE_SPINLOCK(bnx2fc_global_lock);
53
+static DEFINE_SPINLOCK(bnx2fc_global_lock);
5454
5555 static struct cnic_ulp_ops bnx2fc_cnic_cb;
5656 static struct libfc_function_template bnx2fc_libfc_fcn_templ;
....@@ -108,22 +108,22 @@
108108 "\t\t0x10 - fcoe L2 fame related logs.\n"
109109 "\t\t0xff - LOG all messages.");
110110
111
-uint bnx2fc_devloss_tmo;
111
+static uint bnx2fc_devloss_tmo;
112112 module_param_named(devloss_tmo, bnx2fc_devloss_tmo, uint, S_IRUGO);
113113 MODULE_PARM_DESC(devloss_tmo, " Change devloss_tmo for the remote ports "
114114 "attached via bnx2fc.");
115115
116
-uint bnx2fc_max_luns = BNX2FC_MAX_LUN;
116
+static uint bnx2fc_max_luns = BNX2FC_MAX_LUN;
117117 module_param_named(max_luns, bnx2fc_max_luns, uint, S_IRUGO);
118118 MODULE_PARM_DESC(max_luns, " Change the default max_lun per SCSI host. Default "
119119 "0xffff.");
120120
121
-uint bnx2fc_queue_depth;
121
+static uint bnx2fc_queue_depth;
122122 module_param_named(queue_depth, bnx2fc_queue_depth, uint, S_IRUGO);
123123 MODULE_PARM_DESC(queue_depth, " Change the default queue depth of SCSI devices "
124124 "attached via bnx2fc.");
125125
126
-uint bnx2fc_log_fka;
126
+static uint bnx2fc_log_fka;
127127 module_param_named(log_fka, bnx2fc_log_fka, uint, S_IRUGO|S_IWUSR);
128128 MODULE_PARM_DESC(log_fka, " Print message to kernel log when fcoe is "
129129 "initiating a FIP keep alive when debug logging is enabled.");
....@@ -150,15 +150,11 @@
150150 struct fcoe_rcv_info *fr;
151151 struct sk_buff_head *list;
152152 struct sk_buff *skb, *next;
153
- struct sk_buff *head;
154153
155154 bg = &bnx2fc_global;
156155 spin_lock_bh(&bg->fcoe_rx_list.lock);
157156 list = &bg->fcoe_rx_list;
158
- head = list->next;
159
- for (skb = head; skb != (struct sk_buff *)list;
160
- skb = next) {
161
- next = skb->next;
157
+ skb_queue_walk_safe(list, skb, next) {
162158 fr = fcoe_dev_from_skb(skb);
163159 if (fr->fr_dev == lp) {
164160 __skb_unlink(skb, list);
....@@ -350,7 +346,7 @@
350346 return -ENOMEM;
351347 }
352348 frag = &skb_shinfo(skb)->frags[skb_shinfo(skb)->nr_frags - 1];
353
- cp = kmap_atomic(skb_frag_page(frag)) + frag->page_offset;
349
+ cp = kmap_atomic(skb_frag_page(frag)) + skb_frag_off(frag);
354350 } else {
355351 cp = skb_put(skb, tlen);
356352 }
....@@ -432,11 +428,9 @@
432428 struct fc_lport *lport;
433429 struct bnx2fc_interface *interface;
434430 struct fcoe_ctlr *ctlr;
435
- struct fc_frame_header *fh;
436431 struct fcoe_rcv_info *fr;
437432 struct fcoe_percpu_s *bg;
438433 struct sk_buff *tmp_skb;
439
- unsigned short oxid;
440434
441435 interface = container_of(ptype, struct bnx2fc_interface,
442436 fcoe_packet_type);
....@@ -468,9 +462,6 @@
468462 goto err;
469463
470464 skb_set_transport_header(skb, sizeof(struct fcoe_hdr));
471
- fh = (struct fc_frame_header *) skb_transport_header(skb);
472
-
473
- oxid = ntohs(fh->fh_ox_id);
474465
475466 fr = fcoe_dev_from_skb(skb);
476467 fr->fr_dev = lport;
....@@ -674,7 +665,10 @@
674665
675666 list_for_each_entry_safe(work, tmp, &work_list, list) {
676667 list_del_init(&work->list);
677
- bnx2fc_process_cq_compl(work->tgt, work->wqe);
668
+ bnx2fc_process_cq_compl(work->tgt, work->wqe,
669
+ work->rq_data,
670
+ work->num_rq,
671
+ work->task);
678672 kfree(work);
679673 }
680674
....@@ -953,7 +947,7 @@
953947 */
954948 if (interface->enabled)
955949 fcoe_ctlr_link_up(ctlr);
956
- };
950
+ }
957951 } else if (fcoe_ctlr_link_down(ctlr)) {
958952 switch (cdev->enabled) {
959953 case FCOE_CTLR_DISABLED:
....@@ -973,7 +967,7 @@
973967 put_cpu();
974968 fcoe_clean_pending_queue(lport);
975969 wait_for_upload = 1;
976
- };
970
+ }
977971 }
978972 }
979973 mutex_unlock(&bnx2fc_dev_lock);
....@@ -1079,9 +1073,8 @@
10791073 /**
10801074 * bnx2fc_update_src_mac - Update Ethernet MAC filters.
10811075 *
1082
- * @fip: FCoE controller.
1083
- * @old: Unicast MAC address to delete if the MAC is non-zero.
1084
- * @new: Unicast MAC address to add.
1076
+ * @lport: The local port
1077
+ * @addr: Location of data to copy
10851078 *
10861079 * Remove any previously-set unicast MAC filter.
10871080 * Add secondary FCoE MAC address filter for our OUI.
....@@ -1666,8 +1659,7 @@
16661659 /**
16671660 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
16681661 *
1669
- * @buffer: The name of the Ethernet interface to be destroyed
1670
- * @kp: The associated kernel parameter
1662
+ * @netdev: The net device that the FCoE interface is on
16711663 *
16721664 * Called from sysfs.
16731665 *
....@@ -2105,7 +2097,7 @@
21052097 return 0;
21062098 }
21072099
2108
-/**
2100
+/*
21092101 * Deperecated: Use bnx2fc_enabled()
21102102 */
21112103 static int bnx2fc_disable(struct net_device *netdev)
....@@ -2233,7 +2225,7 @@
22332225 return 0;
22342226 }
22352227
2236
-/**
2228
+/*
22372229 * Deprecated: Use bnx2fc_enabled()
22382230 */
22392231 static int bnx2fc_enable(struct net_device *netdev)
....@@ -2527,7 +2519,7 @@
25272519 /**
25282520 * bnx2fc_ulp_exit - shuts down adapter instance and frees all resources
25292521 *
2530
- * @dev cnic device handle
2522
+ * @dev: cnic device handle
25312523 */
25322524 static void bnx2fc_ulp_exit(struct cnic_dev *dev)
25332525 {
....@@ -2659,7 +2651,8 @@
26592651 /* Free all work in the list */
26602652 list_for_each_entry_safe(work, tmp, &p->work_list, list) {
26612653 list_del_init(&work->list);
2662
- bnx2fc_process_cq_compl(work->tgt, work->wqe);
2654
+ bnx2fc_process_cq_compl(work->tgt, work->wqe, work->rq_data,
2655
+ work->num_rq, work->task);
26632656 kfree(work);
26642657 }
26652658
....@@ -2956,7 +2949,7 @@
29562949 NULL,
29572950 };
29582951
2959
-/**
2952
+/*
29602953 * scsi_host_template structure used while registering with SCSI-ml
29612954 */
29622955 static struct scsi_host_template bnx2fc_shost_template = {
....@@ -2972,9 +2965,9 @@
29722965 .change_queue_depth = scsi_change_queue_depth,
29732966 .this_id = -1,
29742967 .cmd_per_lun = 3,
2975
- .use_clustering = ENABLE_CLUSTERING,
29762968 .sg_tablesize = BNX2FC_MAX_BDS_PER_CMD,
2977
- .max_sectors = 1024,
2969
+ .dma_boundary = 0x7fff,
2970
+ .max_sectors = 0x3fbf,
29782971 .track_queue_depth = 1,
29792972 .slave_configure = bnx2fc_slave_configure,
29802973 .shost_attrs = bnx2fc_host_attrs,
....@@ -2989,7 +2982,7 @@
29892982 .rport_event_callback = bnx2fc_rport_event_handler,
29902983 };
29912984
2992
-/**
2985
+/*
29932986 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface
29942987 * structure carrying callback function pointers
29952988 */