fcoe: Rename 'fip_frame' to 'fip_vn2vn_notify_frame'
Subsystems (2)
Hannes Reinecke
maintainerPATCH 1/2 fcoe: Rename 'fip_frame' to 'fip_vn2vn_notify_frame'
Do not use a generic name to avoid confusions with other usages.
--- drivers/scsi/fcoe/fcoe_ctlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/fcoe/fcoe_ctlr.c +2 -2
@@ -1989,7 +1989,7 @@ static void fcoe_ctlr_vn_send(struct fcoe_ctlr *fip, const u8 *dest, size_t min_len) {struct sk_buff *skb; -struct fip_frame { +struct fip_vn2vn_probe_frame {struct ethhdr eth;struct fip_header fip;struct fip_mac_desc mac;
@@ -2016,7 +2016,7 @@ static void fcoe_ctlr_vn_send(struct fcoe_ctlr *fip,if (!skb)return ; - frame = (struct fip_frame *)skb->data; + frame = (struct fip_vn2vn_probe_frame *)skb->data;memset (frame,0 , len);memcpy (frame->eth.h_dest, dest,ETH_ALEN );
Signature · 1 line
1.8.5.6
Hannes Reinecke
maintainerPATCH 2/2 fcoe: implement FIP VLAN responder
When running in VN2VN mode there is no central instance which would send out any FIP VLAN discovery notifications. So this patch adds a new sysfs attribute 'fip_vlan_responder' which will activate a FIP VLAN discovery responder.
--- drivers/scsi/fcoe/fcoe.c | 6 ++ drivers/scsi/fcoe/fcoe_ctlr.c | 224 +++++++++++++++++++++++++++++++++++++++++ drivers/scsi/fcoe/fcoe_sysfs.c | 39 +++++++ include/scsi/libfc.h | 1 + include/scsi/libfcoe.h | 5 +- 5 files changed, 274 insertions(+), 1 deletion(-)
drivers/scsi/fcoe/fcoe.c +6 -0
@@ -673,6 +673,12 @@ static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) fcoe = port->priv; ctlr =fcoe_to_ctlr (fcoe); +/* Figure out the VLAN ID, if any */ +if (netdev->priv_flags &IFF_802_1Q_VLAN ) + lport->vlan =vlan_dev_vlan_id (netdev); +else + lport->vlan =0 ; +/* * Determine max frame size based on underlying device and optional * user-configured limit. If the MFS is too low, fcoe_link_ok()
drivers/scsi/fcoe/fcoe_ctlr.c +224 -0
259 lines not on this page · raw message
drivers/scsi/fcoe/fcoe_sysfs.c +39 -0
@@ -385,6 +385,44 @@ static FCOE_DEVICE_ATTR(ctlr, enabled, S_IRUGO | S_IWUSR, show_ctlr_enabled_state, store_ctlr_enabled); +static ssize_t store_ctlr_fip_resp (struct device *dev, +struct device_attribute *attr, +const char *buf,size_t count) +{ +struct fcoe_ctlr_device *ctlr =dev_to_ctlr (dev); +struct fcoe_ctlr *fip =fcoe_ctlr_device_priv (ctlr); + +mutex_lock (&fip->ctlr_mutex); +if ((buf[1 ] =='\0' ) || ((buf[1 ] =='\n' ) && (buf[2 ] =='\0' ))) { +if (buf[0 ] =='1' ) { + fip->fip_resp =1 ; +mutex_unlock (&fip->ctlr_mutex); +return count; + } +if (buf[0 ] =='0' ) { + fip->fip_resp =0 ; +mutex_unlock (&fip->ctlr_mutex); +return count; + } + } +mutex_unlock (&fip->ctlr_mutex); +return -EINVAL ; +} + +static ssize_t show_ctlr_fip_resp (struct device *dev, +struct device_attribute *attr, +char *buf) +{ +struct fcoe_ctlr_device *ctlr =dev_to_ctlr (dev); +struct fcoe_ctlr *fip =fcoe_ctlr_device_priv (ctlr); + +return sprintf (buf,"%d\n" , fip->fip_resp ?1 :0 ); +} + +static FCOE_DEVICE_ATTR(ctlr, fip_vlan_responder, S_IRUGO | S_IWUSR, + show_ctlr_fip_resp, + store_ctlr_fip_resp); + static ssize_t store_private_fcoe_ctlr_fcf_dev_loss_tmo(struct device *dev, struct device_attribute *attr,
@@ -467,6 +505,7 @@ static struct attribute_group fcoe_ctlr_lesb_attr_group = { };static struct attribute *fcoe_ctlr_attrs[] = { + &device_attr_fcoe_ctlr_fip_vlan_responder.attr, &device_attr_fcoe_ctlr_fcf_dev_loss_tmo.attr, &device_attr_fcoe_ctlr_enabled.attr, &device_attr_fcoe_ctlr_mode.attr,
include/scsi/libfc.h +1 -0
@@ -878,6 +878,7 @@ struct fc_lport {struct libfc_function_template tt;u8 link_up;u8 qfull; +u16 vlan;enum fc_lport_state state;unsigned long boot_time;struct fc_host_statistics host_stats;
include/scsi/libfcoe.h +4 -1
@@ -110,8 +110,10 @@ enum fip_mode {* @flogi_req_send: send of FLOGI requested * @flogi_count: number of FLOGI attempts in AUTO mode. * @map_dest: use the FC_MAP mode for destination MAC addresses. +* @fip_resp: start FIP VLAN discovery responder * @spma: supports SPMA server-provided MACs mode * @probe_tries: number of FC_IDs probed +* @priority: DCBx FCoE APP priority * @dest_addr: MAC address of the selected FC forwarder. * @ctl_src_addr: the native MAC address of our local port. * @send: LLD-supplied function to handle sending FIP Ethernet frames
@@ -149,7 +151,8 @@ struct fcoe_ctlr {u16 flogi_oxid;u8 flogi_req_send;u8 flogi_count; -u8 map_dest; +bool map_dest; +bool fip_resp;u8 spma;u8 probe_tries;u8 priority;
Signature · 1 line
1.8.5.6
Re: [PATCH 2/2] fcoe: implement FIP VLAN responder
Quoted 6 lines · Hannes Reinecke
When running in VN2VN mode there is no central instance which would send out any FIP VLAN discovery notifications. So this patch adds a new sysfs attribute '
fip_vlan_responder' which will activate a FIP VLAN discovery responder.Signed-off-by Hannes Reinecke <[email protected]>
Signature · 10 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Martin K. Petersen
AppliedRe: [PATCH 2/2] fcoe: implement FIP VLAN responder
In reply to Hannes ReineckeQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Hannes" == Hannes Reinecke <[email protected]> writes:
Hannes> When running in VN2VN mode there is no central instance which Hannes> would send out any FIP VLAN discovery notifications. So this Hannes> patch adds a new sysfs attribute 'fip_vlan_responder' which will Hannes> activate a FIP VLAN discovery responder.
Applied to 4.8/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 4 lines · Hannes Reinecke
Do not use a generic name to avoid confusions with other usages.
Signed-off-by Hannes Reinecke <[email protected]>
Very nice :-)
Signature · 10 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Martin K. Petersen
AppliedQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Hannes" == Hannes Reinecke <[email protected]> writes:
Hannes> Do not use a generic name to avoid confusions with other usages.
Applied to 4.8/scsi-queue.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering