Add an option to fcoemon to force it to use the
legacy kernel interfaces.

Signed-off-by: Robert Love <robert.w.l...@intel.com>
---
 doc/fcoemon.8   |   22 ++++++++++++++++++----
 doc/fcoemon.txt |    6 +++++-
 fcoemon.c       |   10 ++++++++--
 3 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/doc/fcoemon.8 b/doc/fcoemon.8
index 4323244..9aa3d66 100644
--- a/doc/fcoemon.8
+++ b/doc/fcoemon.8
@@ -1,13 +1,22 @@
 '\" t
 .\"     Title: fcoemon
 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\"      Date: 01/16/2012
+.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
+.\"      Date: 10/08/2012
 .\"    Manual: Open-FCoE Tools
 .\"    Source: Open-FCoE
 .\"  Language: English
 .\"
-.TH "FCOEMON" "8" "01/16/2012" "Open\-FCoE" "Open\-FCoE Tools"
+.TH "FCOEMON" "8" "10/08/2012" "Open\-FCoE" "Open\-FCoE Tools"
+.\" -----------------------------------------------------------------
+.\" * Define some portability stuff
+.\" -----------------------------------------------------------------
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.\" http://bugs.debian.org/507673
+.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
+.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -20,7 +29,7 @@
 fcoemon \- Open\-FCoE service daemon
 .SH "SYNOPSIS"
 .sp
-\fBfcoemon\fR [\-f|\-\-foreground] [\-d|\-\-debug] [\-s|\-\-syslog]
+\fBfcoemon\fR [\-f|\-\-foreground] [\-l|\-\-legacy] [\-d|\-\-debug] 
[\-s|\-\-syslog]
 .sp
 \fBfcoemon\fR \-h|\-\-help
 .sp
@@ -50,6 +59,11 @@ in the foreground\&.
 Enable debugging messages\&.
 .RE
 .PP
+\fB\-l\fR, \fB\-\-legacy\fR
+.RS 4
+Force fcoemon to use the legacy /sys/modlue/libfcoe/parameters/ interface\&. 
The default is to use the newer /sys/bus/fcoe/ interfaces if they are 
available\&.
+.RE
+.PP
 \fB\-s\fR, \fB\-\-syslog\fR
 .RS 4
 Use syslogd for logging\&. The default behavior is to log to stdout and 
stderr\&.
diff --git a/doc/fcoemon.txt b/doc/fcoemon.txt
index 9dc9ba2..f2f2ad3 100644
--- a/doc/fcoemon.txt
+++ b/doc/fcoemon.txt
@@ -19,7 +19,7 @@ fcoemon - Open-FCoE service daemon
 
 SYNOPSIS
 --------
-*fcoemon* [-f|--foreground] [-d|--debug] [-s|--syslog]
+*fcoemon* [-f|--foreground] [-l|--legacy] [-d|--debug] [-s|--syslog]
 
 *fcoemon* -h|--help
 
@@ -55,6 +55,10 @@ OPTIONS
        Run *fcoemon* in the foreground.
 *-d*, *--debug*::
        Enable debugging messages.
+*-l*, *--legacy*::
+       Force fcoemon to use the legacy /sys/modlue/libfcoe/parameters/
+       interface. The default is to use the newer /sys/bus/fcoe/ interfaces
+       if they are available.
 *-s*, *--syslog*::
        Use syslogd for logging. The default behavior is to log to stdout
        and stderr.
diff --git a/fcoemon.c b/fcoemon.c
index 26f8cfa..04b54ef 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -98,6 +98,7 @@
 #define CFG_IF_VAR_AUTOVLAN    "AUTO_VLAN"
 
 
+static bool force_legacy = false;
 static sigset_t block_sigset;
 
 void fcm_vlan_disc_timeout(void *arg);
@@ -284,6 +285,7 @@ static void clear_dcbd_info(struct fcm_netif *ff);
  */
 static struct option fcm_options[] = {
        {"debug", 0, NULL, 'd'},
+       {"legacy", 0, NULL, 'l'},
        {"syslog", 0, NULL, 's'},
        {"exec", 1, NULL, 'e'},
        {"foreground", 0, NULL, 'f'},
@@ -1714,7 +1716,7 @@ static void fcm_fcoe_init(void)
        if (fcm_read_config_files())
                exit(1);
 
-       if (access(FCOE_BUS_CREATE, F_OK)) {
+       if (!force_legacy && access(FCOE_BUS_CREATE, F_OK)) {
                FCM_LOG_DBG("Using /sys/bus/fcoe interfaces\n");
                libfcoe_control = &libfcoe_bus_tmpl;
        } else {
@@ -2954,6 +2956,7 @@ static void fcm_usage(void)
        printf("Usage: %s\n"
               "\t [-f|--foreground]\n"
               "\t [-d|--debug]\n"
+              "\t [-l|--legacy]\n"
               "\t [-s|--syslog]\n"
               "\t [-v|--version]\n"
               "\t [-h|--help]\n\n", progname);
@@ -3404,7 +3407,7 @@ int main(int argc, char **argv)
        sa_log_flags = 0;
        openlog(sa_log_prefix, LOG_CONS, LOG_DAEMON);
 
-       while ((c = getopt_long(argc, argv, "fdhsv",
+       while ((c = getopt_long(argc, argv, "fdhlsv",
                                fcm_options, NULL)) != -1) {
                switch (c) {
                case 'f':
@@ -3414,6 +3417,9 @@ int main(int argc, char **argv)
                        fcoe_config.debug = 1;
                        enable_debug_log(1);
                        break;
+               case 'l':
+                       force_legacy = 1;
+                       break;
                case 's':
                        fcoe_config.use_syslog = 1;
                        enable_syslog(1);

_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to