1 Subject: Update open-FCoE with latest patches from Intel
2 From: John Fastabend <john.r.fastabend@intel.com>
3 Date: Fri Dec 5 16:35:38 2008 +0100:
6 This updates the open-FCoE stack to version 1.0.5.
8 Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
9 Acked-by: Hannes Reinecke <hare@suse.de>
11 diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
12 index de29ccd..77f8857 100644
13 --- a/drivers/scsi/fcoe/libfcoe.c
14 +++ b/drivers/scsi/fcoe/libfcoe.c
15 @@ -59,7 +59,7 @@ static int debug_fcoe;
16 MODULE_AUTHOR("Open-FCoE.org");
17 MODULE_DESCRIPTION("FCoE");
18 MODULE_LICENSE("GPL");
19 -MODULE_VERSION("1.0.4");
20 +MODULE_VERSION("1.0.5");
23 LIST_HEAD(fcoe_hostlist);
24 @@ -453,10 +453,9 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
25 /* adjust skb netowrk/transport offsets to match mac/fcoe/fc */
26 skb_push(skb, elen + hlen);
27 skb_reset_mac_header(skb);
28 - skb_set_network_header(skb, elen);
29 - skb_set_transport_header(skb, elen + hlen);
30 + skb_reset_network_header(skb);
32 - skb->protocol = htons(ETH_P_FCOE);
33 + skb->protocol = htons(ETH_P_802_3);
34 skb->dev = fc->real_dev;
36 /* fill up mac and fcoe headers */
37 @@ -473,7 +472,7 @@ int fcoe_xmit(struct fc_lport *lp, struct fc_frame *fp)
39 memcpy(eh->h_source, fc->data_src_addr, ETH_ALEN);
41 - hp = (struct fcoe_hdr *)skb_network_header(skb);
42 + hp = (struct fcoe_hdr *)(eh + 1);
43 memset(hp, 0, sizeof(*hp));
45 FC_FCOE_ENCAPS_VER(hp, FC_FCOE_VER);
46 diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
47 index aee2f9c..0cd8d0c 100644
48 --- a/drivers/scsi/libfc/fc_disc.c
49 +++ b/drivers/scsi/libfc/fc_disc.c
50 @@ -45,9 +45,6 @@ static int fc_disc_debug;
54 -static struct mutex disc_list_lock;
55 -static struct list_head disc_list;
58 unsigned char retry_count;
60 @@ -66,7 +63,6 @@ struct fc_disc {
61 struct fc_gpn_ft_resp partial_buf; /* partial name buffer */
62 struct delayed_work disc_work;
64 - struct list_head list;
67 static void fc_disc_gpn_ft_req(struct fc_disc *);
68 @@ -87,26 +83,23 @@ static void fc_disc_restart(struct fc_disc *);
69 struct fc_rport *fc_disc_lookup_rport(const struct fc_lport *lport,
72 - struct fc_disc *disc;
73 + struct fc_disc *disc = lport->disc;
74 struct fc_rport *rport, *found = NULL;
75 struct fc_rport_libfc_priv *rdata;
78 - mutex_lock(&disc_list_lock);
79 - list_for_each_entry(disc, &disc_list, list) {
80 - if (disc->lport == lport) {
81 - list_for_each_entry(rdata, &disc->rports, peers) {
82 - rport = PRIV_TO_RPORT(rdata);
83 - if (rport->port_id == port_id) {
86 - get_device(&found->dev);
93 + list_for_each_entry(rdata, &disc->rports, peers) {
94 + rport = PRIV_TO_RPORT(rdata);
95 + if (rport->port_id == port_id) {
98 + get_device(&found->dev);
102 - mutex_unlock(&disc_list_lock);
105 FC_DEBUG_DISC("The rport (%6x) for lport (%6x) "
106 @@ -127,19 +120,15 @@ static inline struct fc_disc *fc_disc_alloc(struct fc_lport *lport)
107 struct fc_disc *disc;
109 disc = kzalloc(sizeof(struct fc_disc), GFP_KERNEL);
110 - INIT_LIST_HEAD(&disc->list);
111 INIT_DELAYED_WORK(&disc->disc_work, fc_disc_timeout);
112 mutex_init(&disc->disc_mutex);
113 INIT_LIST_HEAD(&disc->rports);
116 + lport->disc = disc;
117 disc->delay = FC_DISC_DELAY;
118 disc->event = DISC_EV_NONE;
120 - mutex_lock(&disc_list_lock);
121 - list_add_tail(&disc->list, &disc_list);
122 - mutex_unlock(&disc_list_lock);
127 @@ -182,23 +171,19 @@ static void fc_disc_rport_event(struct fc_lport *lport,
128 enum fc_lport_event event)
130 struct fc_rport_libfc_priv *rdata = rport->dd_data;
131 - struct fc_disc *disc;
132 + struct fc_disc *disc = lport->disc;
135 FC_DEBUG_DISC("Received a %d event for port (%6x)\n", event,
138 if (event == RPORT_EV_CREATED) {
139 - mutex_lock(&disc_list_lock);
140 - list_for_each_entry(disc, &disc_list, list) {
141 - if (disc->lport == lport) {
143 - mutex_lock(&disc->disc_mutex);
144 - list_add_tail(&rdata->peers, &disc->rports);
145 - mutex_unlock(&disc->disc_mutex);
149 + mutex_lock(&disc->disc_mutex);
150 + list_add_tail(&rdata->peers, &disc->rports);
151 + mutex_unlock(&disc->disc_mutex);
153 - mutex_unlock(&disc_list_lock);
157 @@ -323,19 +308,9 @@ static void fc_disc_recv_req(struct fc_seq *sp, struct fc_frame *fp,
158 struct fc_lport *lport)
161 - struct fc_disc *disc;
164 - mutex_lock(&disc_list_lock);
165 - list_for_each_entry(disc, &disc_list, list) {
166 - if (disc->lport == lport) {
171 - mutex_unlock(&disc_list_lock);
172 + struct fc_disc *disc = lport->disc;
176 FC_DBG("Received a request for an lport not managed "
177 "by the discovery engine\n");
179 @@ -394,19 +369,9 @@ static void fc_disc_start(void (*disc_callback)(struct fc_lport *,
181 struct fc_rport *rport;
182 struct fc_rport_identifiers ids;
183 - struct fc_disc *disc;
186 - mutex_lock(&disc_list_lock);
187 - list_for_each_entry(disc, &disc_list, list) {
188 - if (disc->lport == lport) {
193 - mutex_unlock(&disc_list_lock);
194 + struct fc_disc *disc = lport->disc;
198 FC_DEBUG_DISC("No existing discovery job, "
199 "creating one for lport (%6x)\n",
200 fc_host_port_id(lport->host));
201 @@ -510,7 +475,7 @@ static int fc_disc_new_target(struct fc_disc *disc,
202 rport = fc_rport_rogue_create(&dp);
210 @@ -577,18 +542,16 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp)
211 if (disc->retry_count < FC_DISC_RETRY_LIMIT) {
212 /* go ahead and retry */
214 - delay = msecs_to_jiffies(500);
215 + delay = msecs_to_jiffies(FC_DISC_RETRY_DELAY);
218 - msecs_to_jiffies(lport->e_d_tov);
219 + delay = msecs_to_jiffies(lport->e_d_tov);
221 /* timeout faster first time */
222 if (!disc->retry_count)
226 - schedule_delayed_work(&disc->disc_work,
228 + schedule_delayed_work(&disc->disc_work, delay);
230 /* exceeded retries */
231 disc->event = DISC_EV_FAILED;
232 @@ -868,16 +831,12 @@ out:
234 void fc_disc_stop(struct fc_lport *lport)
236 - struct fc_disc *disc, *next;
237 + struct fc_disc *disc = lport->disc;
239 - mutex_lock(&disc_list_lock);
240 - list_for_each_entry_safe(disc, next, &disc_list, list) {
241 - if (disc->lport == lport) {
242 - cancel_delayed_work_sync(&disc->disc_work);
243 - fc_disc_stop_rports(disc);
246 + cancel_delayed_work_sync(&disc->disc_work);
247 + fc_disc_stop_rports(disc);
249 - mutex_unlock(&disc_list_lock);
253 @@ -889,18 +848,8 @@ void fc_disc_stop(struct fc_lport *lport)
255 void fc_disc_stop_final(struct fc_lport *lport)
257 - struct fc_disc *disc, *next;
259 lport->tt.rport_flush_queue();
261 - mutex_lock(&disc_list_lock);
262 - list_for_each_entry_safe(disc, next, &disc_list, list) {
263 - if (disc->lport == lport) {
264 - list_del(&disc->list);
268 - mutex_unlock(&disc_list_lock);
272 @@ -909,8 +858,6 @@ void fc_disc_stop_final(struct fc_lport *lport)
274 int fc_disc_init(struct fc_lport *lport)
276 - INIT_LIST_HEAD(&disc_list);
277 - mutex_init(&disc_list_lock);
279 if (!lport->tt.disc_start)
280 lport->tt.disc_start = fc_disc_start;
281 diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
282 index 04ced7f..2426501 100644
283 --- a/drivers/scsi/libfc/fc_fcp.c
284 +++ b/drivers/scsi/libfc/fc_fcp.c
286 MODULE_AUTHOR("Open-FCoE.org");
287 MODULE_DESCRIPTION("libfc");
288 MODULE_LICENSE("GPL");
289 +MODULE_VERSION("1.0.5");
291 static int fc_fcp_debug;
293 diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c
294 index 083d57b..de16203 100644
295 --- a/drivers/scsi/libfc/fc_lport.c
296 +++ b/drivers/scsi/libfc/fc_lport.c
297 @@ -577,6 +577,8 @@ int fc_fabric_logoff(struct fc_lport *lport)
299 lport->tt.disc_stop_final(lport);
300 mutex_lock(&lport->lp_mutex);
301 + kfree(lport->disc);
302 + lport->disc = NULL;
303 fc_lport_enter_logo(lport);
304 mutex_unlock(&lport->lp_mutex);
306 diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
307 index dac03e2..587be50 100644
308 --- a/include/scsi/libfc.h
309 +++ b/include/scsi/libfc.h
310 @@ -570,6 +570,8 @@ struct libfc_function_template {
311 void (*disc_stop_final) (struct fc_lport *);
317 struct list_head list;
319 @@ -578,6 +580,7 @@ struct fc_lport {
320 struct fc_exch_mgr *emp;
321 struct fc_rport *dns_rp;
322 struct fc_rport *ptp_rp;
323 + struct fc_disc *disc;
326 /* Operational Information */