On 11/14/2012 09:41 AM, Yi Zou wrote:
//note: apologize if got this multiple times, mailing list was acting weird
//recently.
This series of patches try to merge some code across fcoe and bnx2fc to move
the common code into libfcoe. Things like update link speed based on ethtool
cmd and get link error status block are almost exactly the same. There may be
more that we can consolidate but these two are obvious.
The very first patch is probably the only important one as the rest is more
or less cleanups around it. I basically added a callback for the individual
fcoe transport driver to allow libfcoe to get the corresponding netdev w/o
worrying about individual per interface private structure.
Let me know if this looks ok, particularly Rob and Bhanu.
Patches are directly applicable on current open-fcoe.org tree. I did minor
testing on fcoe (got FCID) and compile-tested bnx2fc (load/unload as well).
Might have to respin later if runs into conflict.
Yi,
The changes look good to me. However, I do see a handful of function
calls to fcoe_netdev() within 'fcoe' driver. Although it works, it is
just unnecessary as you can directly call the function being in the same
module. for eg., fcoe_ddp_done() calls fcoe_netdev() to obtain netdev.
You can directly use fcoe_get_netdev(). Similarly in
fcoe_shost_config(), fcoe_ddp_setup(), fcoe_ddp_target, fcoe_link_ok,
fcoe_hostlist_add.
To minimize the code changes, you can probably change fcoe_get_netdev to
fcoe_netdev and vice versa. IOW, assign port->get_netdev = fcoe_netdev.
Only fcoe_transport would use new function fcoe_get_netdev() to obtain
the netdev from lport.
bnx2fc driver changes look good to me. I'll test it and get back to you.
Thanks,
Bhanu
---
Yi Zou (8):
libfcoe: add some missiong function comments
bnx2fc: use fcoe_get_lesb/fcoe_ctlr_get_lesb() directly from libfcoe
bnx2fc: use fcoe_link_speed_update() from the exported symbol in libfcoe
bnx2fc: add support to get_netdev for bnx2f_interface
libfcoe/fcoe: consolidate the fcoe_ctlr_get_lesb/fcoe_get_lesb
libfcoe/fcoe: move fcoe_link_speed_update() to libfcoe and export it
fcoe: add support to the get_netdev() for fcoe_interface
fcoe: prep work to start consolidate the usage of fcoe_netdev
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 87 ++++-------------------------------
drivers/scsi/fcoe/fcoe.c | 86 ++++-------------------------------
drivers/scsi/fcoe/fcoe.h | 10 ----
drivers/scsi/fcoe/fcoe_transport.c | 89 ++++++++++++++++++++++++++++++++++++
include/scsi/libfcoe.h | 16 ++++++
5 files changed, 126 insertions(+), 162 deletions(-)
_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel