On Wed, 2015-07-15 at 15:15 +0000, Sawan Chandak wrote:
> 
> From: Vasu Dev [mailto:[email protected]]
> Sent: Wednesday, July 15, 2015 4:09 AM
> 
> Please use inline response instead top post.
> 
> On Tue, 2015-07-14 at 13:09 +0000, Sawan Chandak wrote:
> > Disabling AUTO_VLAN will not work.
> > if AUTO_VLAN is disabled, then how do we set the VLAN of the fcoe interface 
> > ?
> 
> Just configure AUTO_VLAN disabled fcoe for the vlan interface as I explained 
> before to disable fip vlan discovery.
> [Sawan]: If we disable AUTO_VL AN and don’t do fip vlan discovery, how can we 
> ensure that a specific VLAN is used on the FCoE interface?
> 

Just configure the fcoe for a specific vlan interface while AUTO_VLAN disabled 
as I mentioned before, this will create fcoe only on the specified specific 
vlan while skipping VLAN discovery completely. This is the only use of existing 
AUTO_VLAN option and this option can be used in any fcoe mode whether it is 
fabric or vn2vn mode. 

Below are detailed steps to create fcoe on a specific vlan id Y for ethX
interface:-

#ip link set ethX up
#ip link add link ethX ethX.Y type vlan id Y #ip link set ethX.X up #cp 
/etc/fcoe/cfg-ethx /etc/fcoe/cfg-ethX.X ## edit cfg-ethX.X and set 
AUTO_VLAN="no" to disable VLAN discovery completely and then re-start or start 
the fcoe service.

I confirmed above steps with latest fcoe utils as of now.
[Sawan]: Thanks for all the info and on detail steps. 

> > The idea of having,  DEFAULT_VLAN configuration option, is not to skip VLAN 
> >  discovery, but to have another level of tolerance to the openfcoe tools, 
> > if the FIP VLAN request fails or is not supported by the FCF.
> > There are some switches that don’t support FIP VLAN discovery and expect 
> > Initiator to fallback discovery to default VLAN for FCOE traffic.
> > 
> 
> Works for me if you still want default vlan fall back though vlan can be 
> configured to skip AUTO VLAN as I explained. Also, fabric switch requires 
> vlan discovery and if that is not working then you might want to know that it 
> is broken instead silently defaulting a vlan. If you still want this then fix 
> the issue I reported with the patch below beside updating documentation for 
> new default vlan option.
> [Sawan] : The idea behind below patch is not to disable FIP VLAN 
> discovery.  We want FIP VLAN discovery to happen, but If AUTO_VLAN is 
> enabled and if FCoE instances is not created on the VLAN interfaces, 
> due to fabric switch not supporting it or some issue with the switch

Exactly for such fabric or switch issue should be caught instead of falling 
back to default vlan. So either fabric/switch does vlan discovert or don't as 
currently implemented using AUTO_VLAN option.
However I'm not oppose to having third option to fall back to default VLAN as I 
mentioned in last responses since it would be still an additional option for 
anyone need to use. 

So given above steps and details if you still want on top of AUTO_VLAN option 
then go ahead with new fall back option and it should not be too bad to 
maintain this additional option though it is not absolutely required in my 
opinion. In that case patch would need two issues to be fixed which I mentioned 
before.
[Sawan]: Will give a try with above steps and AUTO LAN disable option. Agree 
with you, if it work as per our requirement, then we might not need fallback 
patch which is suggested.

Thanks,
Sawan
 
BTW, what switch fabric is failing on AUTO VLAN which is requiring new fall 
back.

Thanks,
Vasu

> , then FIP VLAN discovery should be done with user specified VLAN ID 
> mentioned in  DEFAULT_VLAN parameter. 
> FCOE interface/instance should be created with user specified VLAN ID in this 
> case and FIP VLAN discovery should be done with user specified VLAN ID.  
> 
> Thanks,
> Sawan
> 
> Thanks,
> Vasu
> 
> > Thanks,
> > Sawan
> > 
> > -----Original Message-----
> > From: Vasu Dev [mailto:[email protected]]
> > Sent: Thursday, July 09, 2015 4:32 AM
> > To: Sawan Chandak
> > Cc: [email protected]; Giridhar Malavali; Saurav Kashyap; 
> > Chad Dupuis
> > Subject: Re: [PATCH] fcoemon: Default FIP VLAN support.
> > 
> > On Tue, 2015-07-07 at 06:45 -0400, Sawan Chandak wrote:
> > > Currently with fcoe-utils if the FIP VLAN request fails or is not 
> > > supported by the FCF then discovery will fail since the tools will not 
> > > know which VLAN to send FIP traffic.
> > > To add another level of tolerance to the openfcoe tools, add a 
> > > configuration parameter where user can specify a manual VLAN for 
> > > FIP traffic to be sent on if the FIP VLAN request fails or is not 
> > > supported by the FCF.
> > > 
> > 
> > Instead of adding new DEFAULT_VLAN config option, disabling AUTO_VLAN 
> > should do same thing unless I'm missing something. 
> > 
> > I mean FCoE fabric is configured with VLAN and some switch doesn't even 
> > allow FLOGI until VLAN discovery succeed but for some reason if user wants 
> > to skip VLAN discovery and instead wants to use a specific so called 
> > default vlan here then they could do so by simply disabling existing 
> > AUTO_VLAN config option.
> > 
> > Also, this patch breaks AUTO_VLAN since with the patch fcoemon succeed in 
> > creating fcoe instance for discovered vlan but then the interface remains 
> > disabled. Is AUTO_VLAN working for you with this patch ?
> > 
> > Thanks,
> > Vasu
> > 
> > 
> > > Signed-off-by: Chad Dupuis <[email protected]>
> > > Signed-off-by: Sawan Chandak <[email protected]>
> > > ---
> > >  fcoemon.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
> > >  1 file changed, 44 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/fcoemon.c b/fcoemon.c index c0af99b..5578680 100644
> > > --- a/fcoemon.c
> > > +++ b/fcoemon.c
> > > @@ -105,6 +105,7 @@
> > >  #define CFG_IF_VAR_AUTOVLAN    "AUTO_VLAN"
> > >  #define CFG_IF_VAR_MODE        "MODE"
> > >  #define CFG_IF_VAR_FIP_RESP    "FIP_RESP"
> > > +#define CFG_IF_VAR_DEFAULTVLAN "DEFAULT_VLAN"
> > >  
> > >  enum fcoe_mode {
> > >   FCOE_MODE_FABRIC = 0,
> > > @@ -135,6 +136,9 @@ struct fcoe_port {
> > >   int auto_vlan;
> > >   int auto_created;
> > >   int ready;
> > > + int default_vlan;
> > > + int default_vlan_set;
> > > + int default_vid;
> > >  
> > >   /* following track data required to manage FCoE interface state */
> > >   enum fcp_action action;      /* current state */
> > > @@ -603,6 +607,24 @@ static int fcm_read_config_files(void)
> > >           if (!strncasecmp(val, "vn2vn", 5) && rc == 1)
> > >                   next->mode = FCOE_MODE_VN2VN;
> > >  
> > > +         /* DEFAULT_VLAN ID */
> > > +         rc = fcm_read_config_variable(file, val, sizeof(val),
> > > +                                         fp, CFG_IF_VAR_DEFAULTVLAN);
> > > +         if (rc < 0) {
> > > +                 FCM_LOG("Invalid format for %s variable in %s",
> > > +                         CFG_IF_VAR_DEFAULTVLAN, file);
> > > +                 fclose(fp);
> > > +                 free(next);
> > > +                 continue;
> > > +                }
> > > +
> > > +         /* if found, set default vlan id */
> > > +         if (atoi(val) > 0 && rc == 1) {
> > > +                 next->default_vlan = 1;
> > > +                 next->default_vid = atoi(val);
> > > +                 FCM_LOG("Default VLAN ID = %d", next->default_vid);
> > > +                }
> > > +
> > >           fclose(fp);
> > >  
> > >           if (!fcoe_config.port) {
> > > @@ -1007,9 +1029,18 @@ fcm_vlan_disc_handler(struct fiphdr *fh, struct 
> > > sockaddr_ll *sa, void *arg)
> > >           case FIP_TLV_VLAN:
> > >                   if (tlv->tlv_len != 1) {
> > >                           FCM_LOG_ERR(EINVAL, "bad length on VLAN TLV");
> > > -                         break;
> > > +                         if (p->default_vlan) {
> > > +                                 FCM_LOG_DBG("%s: Default VLAN set\n", 
> > > __func__);
> > > +                                 p->default_vlan_set =1;
> > > +                                }
> > > +                         else
> > > +                                 break;
> > >                   }
> > > -                 vid = ntohs(((struct fip_tlv_vlan *)tlv)->vlan);
> > > +
> > > +                 if (p-> default_vlan && p->default_vlan_set)
> > > +                         vid =  p->default_vid;
> > > +                 else
> > > +                         vid = ntohs(((struct fip_tlv_vlan *)tlv)->vlan);
> > >                   FCM_LOG_DBG("%s: vid=%d\n", __func__, vid);
> > >                   if (vid) {
> > >                           vp = fcm_new_vlan(sa->sll_ifindex, vid, vn2vn); 
> > > @@ -2907,6
> > > +2938,14 @@ void fcm_vlan_disc_timeout(void *arg)
> > >   p->vlan_disc_count++;
> > >   fcm_send_fip_request(p);
> > >   sa_timer_set(&p->vlan_disc_timer, FCM_VLAN_DISC_TIMEOUT);
> > > + if ( p->vlan_disc_count >= 3) {
> > > +         if (p->default_vlan) {
> > > +                 p->default_vlan_set = 1;
> > > +                 FCM_LOG_DBG("%s: Default VLAN set [%d]",
> > > +                                 p->ifname, p->default_vid);
> > > +         }
> > > + }
> > > +
> > >  }
> > >  
> > >  static int fcm_start_vlan_disc(struct fcoe_port *p) @@ -3254,6
> > > +3293,9 @@ static void fcm_dump(void)
> > >           FCM_LOG("auto_vlan: %d\n", curr->auto_vlan);
> > >           FCM_LOG("auto_created: %d\n", curr->auto_created);
> > >           FCM_LOG("ready: %d\n", curr->ready);
> > > +         FCM_LOG("default_vlan: %d\n", curr->default_vlan);
> > > +         FCM_LOG("default_vlan_set: %d\n", curr->default_vlan_set);
> > > +         FCM_LOG("default_vid: %d\n", curr->default_vid);
> > >           FCM_LOG("action: %d\n", curr->action);
> > >           FCM_LOG("last_action: %d\n", curr->last_action);
> > >           FCM_LOG("last_msg_type: %d\n", curr->last_msg_type);
> > 
> > 
> 
> 


_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

Reply via email to