Skip to content

Commit 6a551c1

Browse files
hreineckemartinkpetersen
authored andcommitted
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>
1 parent fa06883 commit 6a551c1

File tree

4 files changed

+23
-18
lines changed

4 files changed

+23
-18
lines changed

drivers/scsi/fcoe/fcoe_ctlr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ static int fcoe_ctlr_parse_adv(struct fcoe_ctlr *fip,
991991
LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
992992
"in FIP adv\n", desc->fip_dtype);
993993
/* standard says ignore unknown descriptors >= 128 */
994-
if (desc->fip_dtype < FIP_DT_VENDOR_BASE)
994+
if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
995995
return -EINVAL;
996996
break;
997997
}
@@ -1232,7 +1232,7 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb)
12321232
LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
12331233
"in FIP adv\n", desc->fip_dtype);
12341234
/* standard says ignore unknown descriptors >= 128 */
1235-
if (desc->fip_dtype < FIP_DT_VENDOR_BASE)
1235+
if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
12361236
goto drop;
12371237
if (desc_cnt <= 2) {
12381238
LIBFCOE_FIP_DBG(fip, "FIP descriptors "
@@ -1410,7 +1410,7 @@ static void fcoe_ctlr_recv_clr_vlink(struct fcoe_ctlr *fip,
14101410
break;
14111411
default:
14121412
/* standard says ignore unknown descriptors >= 128 */
1413-
if (desc->fip_dtype < FIP_DT_VENDOR_BASE)
1413+
if (desc->fip_dtype < FIP_DT_NON_CRITICAL)
14141414
goto err;
14151415
break;
14161416
}
@@ -2338,7 +2338,7 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,
23382338
LIBFCOE_FIP_DBG(fip, "unexpected descriptor type %x "
23392339
"in FIP probe\n", dtype);
23402340
/* standard says ignore unknown descriptors >= 128 */
2341-
if (dtype < FIP_DT_VENDOR_BASE)
2341+
if (dtype < FIP_DT_NON_CRITICAL)
23422342
return -EINVAL;
23432343
break;
23442344
}

drivers/scsi/fnic/fnic_fcs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void fnic_fcoe_send_vlan_req(struct fnic *fnic)
359359

360360
vlan->fip.fip_ver = FIP_VER_ENCAPS(FIP_VER);
361361
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;
363363
vlan->fip.fip_dl_len = htons(sizeof(vlan->desc) / FIP_BPW);
364364

365365
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)
551551
goto drop;
552552
/* pass it on to fcoe */
553553
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) {
555555
/* set the vlan as used */
556556
fnic_fcoe_process_vlan_resp(fnic, skb);
557557
ret = 0;

drivers/scsi/fnic/fnic_fip.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626

2727
#define FINC_MAX_FLOGI_REJECTS 8
2828

29-
/*
30-
* FIP_DT_VLAN descriptor.
31-
*/
32-
struct fip_vlan_desc {
33-
struct fip_desc fd_desc;
34-
__be16 fd_vlan;
35-
} __attribute__((packed));
36-
3729
struct vlan {
3830
__be16 vid;
3931
__be16 type;

include/scsi/fc/fc_fip.h

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
/*
2323
* This version is based on:
2424
* 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)
2626
*/
2727

2828
#define FIP_DEF_PRI 128 /* default selection priority */
@@ -109,8 +109,9 @@ enum fip_reset_subcode {
109109
* Subcodes for FIP_OP_VLAN.
110110
*/
111111
enum fip_vlan_subcode {
112-
FIP_SC_VL_REQ = 1, /* request */
113-
FIP_SC_VL_REP = 2, /* reply */
112+
FIP_SC_VL_REQ = 1, /* vlan request */
113+
FIP_SC_VL_NOTE = 2, /* vlan notification */
114+
FIP_SC_VL_VN2VN_NOTE = 3, /* VN2VN vlan notification */
114115
};
115116

116117
/*
@@ -130,6 +131,8 @@ enum fip_vn2vn_subcode {
130131
enum fip_flag {
131132
FIP_FL_FPMA = 0x8000, /* supports FPMA fabric-provided MACs */
132133
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 */
133136
FIP_FL_REC_OR_P2P = 0x0008, /* configured addr or point-to-point */
134137
FIP_FL_AVAIL = 0x0004, /* available for FLOGI/ELP */
135138
FIP_FL_SOL = 0x0002, /* this is a solicited message */
@@ -161,7 +164,9 @@ enum fip_desc_type {
161164
FIP_DT_VLAN = 14, /* vlan number */
162165
FIP_DT_FC4F = 15, /* FC-4 features */
163166
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 */
165170
};
166171

167172
/*
@@ -258,6 +263,14 @@ enum fip_fka_flags {
258263

259264
/* FIP_DT_FKA flags */
260265

266+
/*
267+
* FIP_DT_VLAN descriptor
268+
*/
269+
struct fip_vlan_desc {
270+
struct fip_desc fd_desc;
271+
__be16 fd_vlan; /* Note: highest 4 bytes are unused */
272+
} __attribute__((packed));
273+
261274
/*
262275
* FIP_DT_FC4F - FC-4 features.
263276
*/

0 commit comments

Comments
 (0)