[Open-FCoE] Compiling target with 2.6.29.1

Joe Eykholt jeykholt at cisco.com
Tue Apr 14 17:04:04 UTC 2009


Karthik G Balaji wrote:
> Hi,
> 
> I am trying to make target work with 2.6.29. It is on the line with
> Sivaram's patch posted few weeks ago. I am facing an issue when trying to
> do,
> 
> /open-fcoe-target# fcconf eth0 enable
> fcconf: fcc_fcoe_config: FCoE create of eth0 failed
> fcconf: fcc_fcoe_config: error 17 (null)
> fcconf: fcc_fcoe_config: exiting at fcc_fcoe.c:142
> 
> I tried to look at the code,
> 
> fd = fcc_fcoe_open_wait();
>     rc = ioctl(fd, FCOE_CREATE_INTERFACE, &cfg);
>     if (rc < 0) {
>         SA_LOG_ERR_EXIT(errno, "FCoE create of %s failed", pp->fp_name);
> 
> Tracing back I find that this error originates from
> fcoe_create_interface(struct fcoe_info *fci, void *ptr),
> 
> fc->real_dev = (void *)dev_get_by_name(&init_net, cfg->local_ifname);
> <----This function signature is changed
>     if (fc->real_dev == NULL) {
>         SA_LOG("could not get network device for %s",
>                cfg->local_ifname);
>         rc = -ENODEV;
>         goto out;
>     }
> 
>     if (fcoe_find_fcdev(fc->real_dev->name) != NULL) {
>         rc = -EEXIST;                 <---------- This is the error
> returned.
>         goto out;
>     }
> 
> 
> The only change made here is,
> -       fc->real_dev = (void *)dev_get_by_name(cfg->local_ifname);
> +       fc->real_dev = (void *)dev_get_by_name(&init_net,
> cfg->local_ifname);
> 
> I could not figure out why this error occurs. If someone can explain this it
> would be really helpful.
> 
> Thanks,
> - Karthik
> _______________________________________________
> devel mailing list
> devel at open-fcoe.org
> http://www.open-fcoe.org/mailman/listinfo/devel

Error number 17 is EEXIST, which is trying to say the interface is already
configured for FCoE, so you can't configure it again.

The confusion comes up because fcconf was meant for configuring initiators,
not targets.   It happens to work for targets as well, but after enabling
the fcoe interface it gets an error because it can't find /dev/openfc, which
gets created only for initiators (in this old code).  So, that makes you
think it didn't work when it actually did, and perhaps you repeat the
fcconf and get EEXIST after that.

Someday someone will really fix this by using /sys to enable the target,
just like the initiator works now.

	Joe




More information about the devel mailing list