fnic: FIP VLAN Discovery Feature Support
Subsystems (2)
PATCH 1/3 fnic: FIP VLAN Discovery Feature Support
FIP VLAN discovery discovers the FCoE VLAN that will be used by all other FIP protocols as well as by the FCoE encapsulation for Fibre Channel payloads on the established virtual link. One of the goals of FC-BB-5 was to be as nonintrusive as possible on initiators and targets, and therefore FIP VLAN discovery occurs in the native VLAN used by the initiator or target to exchange Ethernet traffic. The FIP VLAN discovery protocol is the only FIP protocol running on the native VLAN; all other FIP protocols run on the discovered FCoE VLANs.
If an administrator has manually configured FCoE VLANs on ENodes and FCFs, there is no need to use this protocol. FIP and FCoE will run over the configured VLANs.
An ENode without FCoE VLANs configuration would use this automated discovery protocol to discover over which VLANs FCoE is running.
The ENode sends a FIP VLAN discovery request to a multicast MAC address called All-FCF-MACs, which is a multicast MAC address to which all FCFs listen.
All FCFs that can be reached in the native VLAN of the ENode are expected to respond on the same VLAN with a response that lists one or more FCoE VLANs that are available for the ENode's VN_Port login. This protocol has the sole purpose of allowing the ENode to discover all the available FCoE VLANs.
Now the ENode may enable a subset of these VLANs for FCoE Running the FIP protocol in these VLANs on a per VLAN basis. And FCoE data transactions also would occur on this VLAN. Hence, Except for FIP VLAN discovery, all other FIP and FCoE traffic runs on the selected FCoE VLAN. Its only the FIP VLAN Discovery protocol that is permitted to run on the Default native VLAN of the system.
[**** NOTE ****]
We are working on moving this feature definitions and functionality to libfcoe module. We need this patch to be approved, as Suse is looking forward to merge this feature in SLES 11 SP3 release. Once this patch is approved, we will submit patch which should move vlan discovery feature to libfoce.
--- drivers/scsi/fnic/fnic.h | 32 +++ drivers/scsi/fnic/fnic_fcs.c | 558 ++++++++++++++++++++++++++++++++++++++- drivers/scsi/fnic/fnic_fip.h | 68 +++++ drivers/scsi/fnic/fnic_main.c | 51 +++- drivers/scsi/fnic/vnic_dev.c | 10 + drivers/scsi/fnic/vnic_dev.h | 2 + drivers/scsi/fnic/vnic_devcmd.h | 67 +++++ 7 files changed, 784 insertions(+), 4 deletions(-) create mode 100644 drivers/scsi/fnic/fnic_fip.h
drivers/scsi/fnic/fnic.h +32 -0
@@ -192,6 +192,18 @@ enum fnic_state {struct mempool ; +enum fnic_evt { +FNIC_EVT_START_VLAN_DISC =1 , +FNIC_EVT_START_FCF_DISC =2 , +FNIC_EVT_MAX , +}; + +struct fnic_event { +struct list_head list; +struct fnic *fnic; +enum fnic_evt event; +}; +/* Per-instance private data structure */ struct fnic {struct fc_lport *lport;
@@ -254,6 +266,18 @@ struct fnic {struct sk_buff_head frame_queue;struct sk_buff_head tx_queue; +/*** FIP related data members -- start ***/ +void (*set_vlan)(struct fnic *,u16 vlan); +struct work_struct fip_frame_work; +struct sk_buff_head fip_frame_queue; +struct timer_list fip_timer; +struct list_head vlans; +spinlock_t vlans_lock; + +struct work_struct event_work; +struct list_head evlist; +/*** FIP related data members -- end ***/ +/* copy work queue cache line section */ ____cacheline_aligned struct vnic_wq_copy wq_copy[FNIC_WQ_COPY_MAX ];/* completion queue cache line section */
@@ -278,6 +302,7 @@ static inline struct fnic *fnic_from_ctlr(struct fcoe_ctlr *fip) }extern struct workqueue_struct *fnic_event_queue; +extern struct workqueue_struct *fnic_fip_queue;extern struct device_attribute *fnic_attrs[];void fnic_clear_intr_mode (struct fnic *fnic);
@@ -289,6 +314,7 @@ int fnic_send(struct fc_lport *, struct fc_frame *);void fnic_free_wq_buf (struct vnic_wq *wq,struct vnic_wq_buf *buf);void fnic_handle_frame (struct work_struct *work);void fnic_handle_link (struct work_struct *work); +void fnic_handle_event (struct work_struct *work);int fnic_rq_cmpl_handler (struct fnic *fnic,int );int fnic_alloc_rq_frame (struct vnic_rq *rq);void fnic_free_rq_buf (struct vnic_rq *rq,struct vnic_rq_buf *buf);
@@ -321,6 +347,12 @@ void fnic_handle_link_event(struct fnic *fnic);int fnic_is_abts_pending (struct fnic *,struct scsi_cmnd *); +void fnic_handle_fip_frame (struct work_struct *work); +void fnic_handle_fip_event (struct fnic *fnic); +void fnic_fcoe_reset_vlans (struct fnic *fnic); +void fnic_fcoe_evlist_free (struct fnic *fnic); +extern void fnic_handle_fip_timer (struct fnic *fnic); +static inline int fnic_chk_state_flags_locked (struct fnic *fnic,unsigned long st_flags) {
drivers/scsi/fnic/fnic_fcs.c +556 -2
597 lines not on this page · raw message
drivers/scsi/fnic/fnic_fip.h new file +68 -0
68 lines not on this page · raw message
drivers/scsi/fnic/fnic_main.c +49 -2
94 lines not on this page · raw message
drivers/scsi/fnic/vnic_dev.c +10 -0
@@ -584,6 +584,16 @@ int vnic_dev_init(struct vnic_dev *vdev, int arg)return vnic_dev_cmd (vdev,CMD_INIT , &a0, &a1, wait); } +u16 vnic_dev_set_default_vlan (struct vnic_dev *vdev,u16 new_default_vlan) +{ +u64 a0 = new_default_vlan, a1 =0 ; +int wait =1000 ; +int old_vlan =0 ; + + old_vlan =vnic_dev_cmd (vdev,CMD_SET_DEFAULT_VLAN , &a0, &a1, wait); +return (u16 )old_vlan; +} +int vnic_dev_link_status (struct vnic_dev *vdev) {if (vdev->linkstatus)
drivers/scsi/fnic/vnic_dev.h +2 -0
@@ -148,6 +148,8 @@ int vnic_dev_disable(struct vnic_dev *vdev);int vnic_dev_open (struct vnic_dev *vdev,int arg);int vnic_dev_open_done (struct vnic_dev *vdev,int *done);int vnic_dev_init (struct vnic_dev *vdev,int arg); +u16 vnic_dev_set_default_vlan (struct vnic_dev *vdev, +u16 new_default_vlan);int vnic_dev_soft_reset (struct vnic_dev *vdev,int arg);int vnic_dev_soft_reset_done (struct vnic_dev *vdev,int *done); void vnic_dev_set_intr_mode(struct vnic_dev *vdev,
drivers/scsi/fnic/vnic_devcmd.h +67 -0
73 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH 2/3 fnic: Kernel panic due to FIP mode misconfiguration
If switch configured in FIP and adapter configured in non-fip mode, driver panics while queueing FIP frame in non-existing fip_frame_queue. Added config check before queueing FIP frame in misconfiguration case to avoid kernel panic.
--- drivers/scsi/fnic/fnic_fcs.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/scsi/fnic/fnic_fcs.c +6 -0
@@ -603,6 +603,12 @@ static inline int fnic_import_rq_eth_pkt(struct fnic *fnic, struct sk_buff *skb)skb_reset_mac_header (skb); }if (eh->h_proto ==htons (ETH_P_FIP )) { +if (!(fnic->config.flags &VFCF_FIP_CAPABLE )) { +printk (KERN_ERR "Dropped FIP frame, as firmware " +"uses non-FIP mode, Enable FIP " +"using UCSM\n" ); + goto drop; + }skb_queue_tail (&fnic->fip_frame_queue, skb);queue_work (fnic_fip_queue, &fnic->fip_frame_work);return 1 ;/* let caller know packet was used */
Signature · 1 line
1.7.10.4
PATCH 3/3 fnic: Incremented driver version
In reply to Hiral PatelIncrementing driver versio after bug fixes and new feature commits.
--- drivers/scsi/fnic/fnic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/fnic/fnic.h +1 -1
@@ -38,7 +38,7 @@#define DRV_NAME "fnic"#define DRV_DESCRIPTION "Cisco FCoE HBA Driver" -#define DRV_VERSION "1.5.0.2" +#define DRV_VERSION "1.5.0.22"#define PFX DRV_NAME ": "#define DFX DRV_NAME "%d: "
Signature · 1 line
1.7.10.4