Skip to contentSkip to conversation

tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support

SCSI Geert Uytterhoeven 2 participants 2 messages Jun 8, 2011 1 message not in the archive SCSI

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 30 lines

   [SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support

   This is a comprehensive patch for FC-FC4 provider. tcm_fc is a FC-FC4 provider which glues target core (TCM) with Fiber channel library (libfc). tcm_fc uses existing FC4 provider hooks from Fiber channel library. This Fiber channel library is used by FCoE (transport - FC over Ethernet) protocol driver as well.

drivers/target/tcm_fc/tfc_conf.c new file +19 -0
 
+static int __init ft_init(void)
+{
+       if (ft_register_configfs())
+               return -1;
+       if (fc_fc4_register_provider(FC_TYPE_FCP, &ft_prov)) {
+               ft_deregister_configfs();
+               return -1;
+       }
+       blocking_notifier_chain_register(&fc_lport_notifier_head, &ft_notifier);
+       fc_lport_iterate(ft_lport_add, NULL);
+       return 0;
+}
+
+static void __exit ft_exit(void)
+{
+       blocking_notifier_chain_unregister(&fc_lport_notifier_head,
+                                          &ft_notifier);
+       fc_fc4_deregister_provider(FC_TYPE_FCP, &ft_prov);
+       fc_lport_iterate(ft_lport_del, NULL);

drivers/target/tcm_fc/tfc_conf.c

Quoted 10 lines
drivers/target/tcm_fc/tfc_conf.c new file +10 -0
+       ft_deregister_configfs();
+       synchronize_rcu();
+}
+
+#ifdef MODULE
+MODULE_DESCRIPTION("FC TCM fabric driver " FT_VERSION);
+MODULE_LICENSE("GPL");
+module_init(ft_init);
+module_exit(ft_exit);
+#endif /* MODULE */

If CONFIG_TCM_FC=y, this gives:

| drivers/target/tcm_fc/tfc_conf.c:642: warning: ‘ft_init’ defined but not used

Shouldn't the #ifdef MODULE and #endif just be removed?

Who else initializes this module if it's builtin?
E.g. ft_register_configfs() is global, but not used outside this source file?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
--
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

#2 lore raw

Hi Geert,

Response in-line.

Quoted 40 lines · Geert Uytterhoeven
Quoted 28 lines

[SCSI] tcm_fc: Adding FC_FC4 provider (tcm_fc) for FCoE target (TCM - target core) support

This is a comprehensive patch for FC-FC4 provider. tcm_fc is a FC-FC4 provider which glues target core (TCM) with Fiber channel library (libfc). tcm_fc uses existing FC4 provider hooks from Fiber channel library. This Fiber channel library is used by FCoE (transport - FC over Ethernet) protocol driver as well.

drivers/target/tcm_fc/tfc_conf.c new file +19 -0
+static int __init ft_init(void)
+{
+       if (ft_register_configfs())
+               return -1;
+       if (fc_fc4_register_provider(FC_TYPE_FCP,&ft_prov)) {
+               ft_deregister_configfs();
+               return -1;
+       }
+       blocking_notifier_chain_register(&fc_lport_notifier_head,&ft_notifier);
+       fc_lport_iterate(ft_lport_add, NULL);
+       return 0;
+}
+
+static void __exit ft_exit(void)
+{
+       blocking_notifier_chain_unregister(&fc_lport_notifier_head,
+&ft_notifier);
+       fc_fc4_deregister_provider(FC_TYPE_FCP,&ft_prov);
+       fc_lport_iterate(ft_lport_del, NULL);

drivers/target/tcm_fc/tfc_conf.c

Quoted 10 lines
drivers/target/tcm_fc/tfc_conf.c new file +10 -0
+       ft_deregister_configfs();
+       synchronize_rcu();
+}
+
+#ifdef MODULE
+MODULE_DESCRIPTION("FC TCM fabric driver " FT_VERSION);
+MODULE_LICENSE("GPL");
+module_init(ft_init);
+module_exit(ft_exit);
+#endif /* MODULE */

If CONFIG_TCM_FC=y, this gives:

Quoted 3 lines

| drivers/target/tcm_fc/tfc_conf.c:642: warning: ‘ft_init’ defined but not used

Shouldn't the #ifdef MODULE and #endif just be removed?

Agree. Will get it fixed.

Quoted 5 lines

Who else initializes this module if it's builtin?
E.g. ft_register_configfs() is global, but not used outside this source file?

Gr{oetje,eeting}s,

Quoted 8 lines

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Thanks
-- KIran P.
--
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