aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2016-07-04 04:29:18 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2016-07-13 22:04:27 -0400
commit6a551c113252ca05d0f4ca307aa6d7118d0a5e45 (patch)
treedafc6377f1c0ec2d8426446cef4847253bc40541
parentfa06883281afaa158b2b350f16c377c448df6b61 (diff)
fc_fip: Update to latest FC-BB-6 draft
Update to latest FC-BB-6 draft to include FIP VN2VN VLAN notifications and additional flags. Signed-off-by: Hannes Reinecke <hare@suse.com> Acked-by: Johannes Thumshirn <jth@kernel.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--drivers/scsi/fcoe/fcoe_ctlr.c8
-rw-r--r--drivers/scsi/fnic/fnic_fcs.c4
-rw-r--r--drivers/scsi/fnic/fnic_fip.h8
-rw-r--r--include/scsi/fc/fc_fip.h21
4 files changed, 23 insertions, 18 deletions
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index ada4bdec9a4c..34b2b43f70e3 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -991,7 +991,7 @@ static int fcoe_ctlr_parse_adv(struct fcoe_ctlr *fip,
991 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x " 991 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
992 "in FIP adv\n", desc->fip_dtype); 992 "in FIP adv\n", desc->fip_dtype);
993 /* standard says ignore unknown descriptors >= 128 */ 993 /* standard says ignore unknown descriptors >= 128 */
994 if (desc->fip_dtype < FIP_DT_VENDOR_BASE) 994 if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
995 return -EINVAL; 995 return -EINVAL;
996 break; 996 break;
997 } 997 }
@@ -1232,7 +1232,7 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb)
1232 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x " 1232 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
1233 "in FIP adv\n", desc->fip_dtype); 1233 "in FIP adv\n", desc->fip_dtype);
1234 /* standard says ignore unknown descriptors >= 128 */ 1234 /* standard says ignore unknown descriptors >= 128 */
1235 if (desc->fip_dtype < FIP_DT_VENDOR_BASE) 1235 if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
1236 goto drop; 1236 goto drop;
1237 if (desc_cnt <= 2) { 1237 if (desc_cnt <= 2) {
1238 LIBFCOE_FIP_DBG(fip, "FIP descriptors " 1238 LIBFCOE_FIP_DBG(fip, "FIP descriptors "
@@ -1410,7 +1410,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
1410 break; 1410 break;
1411 default: 1411 default:
1412 /* standard says ignore unknown descriptors >= 128 */ 1412 /* standard says ignore unknown descriptors >= 128 */
1413 if (desc->fip_dtype < FIP_DT_VENDOR_BASE) 1413 if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
1414 goto err; 1414 goto err;
1415 break; 1415 break;
1416 } 1416 }
@@ -2338,7 +2338,7 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,
2338 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x " 2338 LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
2339 "in FIP probe\n", dtype); 2339 "in FIP probe\n", dtype);
2340 /* standard says ignore unknown descriptors >= 128 */ 2340 /* standard says ignore unknown descriptors >= 128 */
2341 if (dtype < FIP_DT_VENDOR_BASE) 2341 if (dtype < FIP_DT_NON_CRITICAL)
2342 return -EINVAL; 2342 return -EINVAL;
2343 break; 2343 break;
2344 } 2344 }
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 67669a9e73c1..fe402d0cdbc3 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -359,7 +359,7 @@ static void fnic_fcoe_send_vlan_req(struct fnic *fnic)
359 359
360 vlan->fip.fip_ver = FIP_VER_ENCAPS(FIP_VER); 360 vlan->fip.fip_ver = FIP_VER_ENCAPS(FIP_VER);
361 vlan->fip.fip_op = htons(FIP_OP_VLAN); 361 vlan->fip.fip_op = htons(FIP_OP_VLAN);
362 vlan->fip.fip_subcode = FIP_SC_VL_REQ; 362 vlan->fip.fip_subcode = FIP_SC_VL_NOTE;
363 vlan->fip.fip_dl_len = htons(sizeof(vlan->desc) / FIP_BPW); 363 vlan->fip.fip_dl_len = htons(sizeof(vlan->desc) / FIP_BPW);
364 364
365 vlan->desc.mac.fd_desc.fip_dtype = FIP_DT_MAC; 365 vlan->desc.mac.fd_desc.fip_dtype = FIP_DT_MAC;
@@ -551,7 +551,7 @@ static int fnic_fcoe_handle_fip_frame(struct fnic *fnic, struct sk_buff *skb)
551 goto drop; 551 goto drop;
552 /* pass it on to fcoe */ 552 /* pass it on to fcoe */
553 ret = 1; 553 ret = 1;
554 } else if (op == FIP_OP_VLAN && sub == FIP_SC_VL_REP) { 554 } else if (op == FIP_OP_VLAN && sub == FIP_SC_VL_NOTE) {
555 /* set the vlan as used */ 555 /* set the vlan as used */
556 fnic_fcoe_process_vlan_resp(fnic, skb); 556 fnic_fcoe_process_vlan_resp(fnic, skb);
557 ret = 0; 557 ret = 0;
diff --git a/drivers/scsi/fnic/fnic_fip.h b/drivers/scsi/fnic/fnic_fip.h
index 87e74c2ab971..7761f33ab5d4 100644
--- a/drivers/scsi/fnic/fnic_fip.h
+++ b/drivers/scsi/fnic/fnic_fip.h
@@ -26,14 +26,6 @@
26 26
27#define FINC_MAX_FLOGI_REJECTS 8 27#define FINC_MAX_FLOGI_REJECTS 8
28 28
29/*
30 * FIP_DT_VLAN descriptor.
31 */
32struct fip_vlan_desc {
33 struct fip_desc fd_desc;
34 __be16 fd_vlan;
35} __attribute__((packed));
36
37struct vlan { 29struct vlan {
38 __be16 vid; 30 __be16 vid;
39 __be16 type; 31 __be16 type;
diff --git a/include/scsi/fc/fc_fip.h b/include/scsi/fc/fc_fip.h
index ae25d4ab2548..9710254fd98c 100644
--- a/include/scsi/fc/fc_fip.h
+++ b/include/scsi/fc/fc_fip.h
@@ -22,7 +22,7 @@
22/* 22/*
23 * This version is based on: 23 * This version is based on:
24 * http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf 24 * http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf
25 * and T11 FC-BB-6 10-019v4.pdf (June 2010 VN2VN proposal) 25 * and T11 FC-BB-6 13-091v5.pdf (December 2013 VN2VN proposal)
26 */ 26 */
27 27
28#define FIP_DEF_PRI 128 /* default selection priority */ 28#define FIP_DEF_PRI 128 /* default selection priority */
@@ -109,8 +109,9 @@ enum fip_reset_subcode {
109 * Subcodes for FIP_OP_VLAN. 109 * Subcodes for FIP_OP_VLAN.
110 */ 110 */
111enum fip_vlan_subcode { 111enum fip_vlan_subcode {
112 FIP_SC_VL_REQ = 1, /* request */ 112 FIP_SC_VL_REQ = 1, /* vlan request */
113 FIP_SC_VL_REP = 2, /* reply */ 113 FIP_SC_VL_NOTE = 2, /* vlan notification */
114 FIP_SC_VL_VN2VN_NOTE = 3, /* VN2VN vlan notification */
114}; 115};
115 116
116/* 117/*
@@ -130,6 +131,8 @@ enum fip_vn2vn_subcode {
130enum fip_flag { 131enum fip_flag {
131 FIP_FL_FPMA = 0x8000, /* supports FPMA fabric-provided MACs */ 132 FIP_FL_FPMA = 0x8000, /* supports FPMA fabric-provided MACs */
132 FIP_FL_SPMA = 0x4000, /* supports SPMA server-provided MACs */ 133 FIP_FL_SPMA = 0x4000, /* supports SPMA server-provided MACs */
134 FIP_FL_FCF = 0x0020, /* originated from a controlling FCF */
135 FIP_FL_FDF = 0x0010, /* originated from an FDF */
133 FIP_FL_REC_OR_P2P = 0x0008, /* configured addr or point-to-point */ 136 FIP_FL_REC_OR_P2P = 0x0008, /* configured addr or point-to-point */
134 FIP_FL_AVAIL = 0x0004, /* available for FLOGI/ELP */ 137 FIP_FL_AVAIL = 0x0004, /* available for FLOGI/ELP */
135 FIP_FL_SOL = 0x0002, /* this is a solicited message */ 138 FIP_FL_SOL = 0x0002, /* this is a solicited message */
@@ -161,7 +164,9 @@ enum fip_desc_type {
161 FIP_DT_VLAN = 14, /* vlan number */ 164 FIP_DT_VLAN = 14, /* vlan number */
162 FIP_DT_FC4F = 15, /* FC-4 features */ 165 FIP_DT_FC4F = 15, /* FC-4 features */
163 FIP_DT_LIMIT, /* max defined desc_type + 1 */ 166 FIP_DT_LIMIT, /* max defined desc_type + 1 */
164 FIP_DT_VENDOR_BASE = 128, /* first vendor-specific desc_type */ 167 FIP_DT_NON_CRITICAL = 128, /* First non-critical descriptor */
168 FIP_DT_CLR_VLINKS = 128, /* Clear virtual links reason code */
169 FIP_DT_VENDOR_BASE = 241, /* first vendor-specific desc_type */
165}; 170};
166 171
167/* 172/*
@@ -259,6 +264,14 @@ enum fip_fka_flags {
259/* FIP_DT_FKA flags */ 264/* FIP_DT_FKA flags */
260 265
261/* 266/*
267 * FIP_DT_VLAN descriptor
268 */
269struct fip_vlan_desc {
270 struct fip_desc fd_desc;
271 __be16 fd_vlan; /* Note: highest 4 bytes are unused */
272} __attribute__((packed));
273
274/*
262 * FIP_DT_FC4F - FC-4 features. 275 * FIP_DT_FC4F - FC-4 features.
263 */ 276 */
264struct fip_fc4_feat { 277struct fip_fc4_feat {