Hello community,
here is the log from the commit of package fcoe-utils for openSUSE:Factory checked in at 2015-08-07 00:19:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fcoe-utils (Old)
and /work/SRC/openSUSE:Factory/.fcoe-utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcoe-utils"
Changes:
--------
--- /work/SRC/openSUSE:Factory/fcoe-utils/fcoe-utils.changes 2014-08-06 11:42:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/fcoe-utils.changes 2015-08-07 00:19:03.000000000 +0200
@@ -1,0 +2,53 @@
+Mon Aug 3 12:35:16 CEST 2015 - hare@suse.de
+
+- Update to version 1.0.30 (FATE#318849)
+ * Remove merged patches:
+ + 0001-man-Fix-small-typo-regarding-fcf-option.patch
+ + 0002-Don-t-call-AM_INIT_AUTOMAKE-twice.patch
+ + 0003-fipvlan-fails-on-powerpc.patch
+ + 0004-fipvlan-Only-shutdown-interfaces-if-no-vlans-are-cre.patch
+ + 0005-fipvlan-start-VLAN-interface-from-netlink-handler.patch
+ + 0006-fipvlan-Extract-create_missing_vlan-function-from-lo.patch
+ + 0007-fipvlan-create-VLANs-from-netlink-handler.patch
+ + 0008-fipvlan-Start-FCoE-from-netlink-handler.patch
+ + 0009-fipvlan-Update-wait-loop-to-wait-for-VLANs.patch
+ + 0010-fipvlan-Re-send-VLAN-discovery.patch
+ + 0011-fipvlan-update-manpage.patch
+ + 0012-fipvlan-Leave-link-up-if-requested.patch
+ + 0013-fipvlan-Update-manpage-to-reflect-correct-timeout.patch
+ + 0014-fipvlan-Do-not-shut-down-FCoE-connections-on-physica.patch
+ + 0015-fipvlan-break-out-of-receive-loop-on-error.patch
+ + 0016-fipvlan-handle-errors-from-fip-socket-creation.patch
+ + 0017-fipvlan-filter-interfaces-from-rtnl_getlink.patch
+ + 0018-Add-missing-DESTDIR-when-installing-bash-completion.patch
+ + 0019-Fix-build-with-Wl-as-needed.patch
+ + 0020-Fix-integer-formatting.patch
+ + 0021-fcnsq-Fixup-help-text.patch
+ + 0022-fcnsq-Fixup-64bit-integer-handling.patch
+ + 0023-fcoemon-add-systemd-service-file.patch
+ + 0024-fcoemon-systemd-socket-activation.patch
+ + 0025-doc-Update-QUICKSTART-INSTALL-docs-for-systemd-init-.patch
+ + 0026-FIPVLAN-Really-break-out-of-the-recv_loop-upon-fip_r.patch
+ + 0027-man-Fix-typo-in-fcoemon-documentation.patch
+ + 0032-fipvlan-Fix-crash-in-create_and_start_vlan.patch
+ + 0033-fipvlan-suppress-warning-interface-already-exists.patch
+ + 0034-fipvlan-do-not-crash-on-empty-MAC-address-in-lookup_.patch
+ * Add new patches from upstream:
+ + 0001-fcoemon-Rework-daemonizing-and-error-handling.patch
+ * Rename patches:
+ + Rename 0031-fcoemon-Fix-IEEE-state-machine.patch to
+ 0002-fcoemon-fix-IEEE-state-machine.patch
+ + Rename 0028-systemctl-cannot-start-fcoemon.socket.patch to
+ 0003-systemctl-cannot-start-fcoemon.socket.patch
+ + Rename 0029-fcoemon-Correctly-handle-options-in-the-service-file.patch to
+ 0004-fcoemon-Correctly-handle-options-in-the-service-file.patch
+ + Rename 0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch to
+ 0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
+ + Rename 0035-fipvlan-fixup-return-value-on-error.patch to
+ 0006-fipvlan-fixup-return-value-on-error.patch
+ + Rename 0036-fipvlan-clean-up-state-machine-for-pfd_add.patch to
+ 0007-fipvlan-clean-up-state-machine-for-pfd_add.patch
+ + Rename 0037-Use-correct-socket-for-fcoemon.socket.patch to
+ 0008-Use-correct-socket-for-fcoemon.socket.patch
+
+-------------------------------------------------------------------
Old:
----
0001-man-Fix-small-typo-regarding-fcf-option.patch
0002-Don-t-call-AM_INIT_AUTOMAKE-twice.patch
0003-fipvlan-fails-on-powerpc.patch
0004-fipvlan-Only-shutdown-interfaces-if-no-vlans-are-cre.patch
0005-fipvlan-start-VLAN-interface-from-netlink-handler.patch
0006-fipvlan-Extract-create_missing_vlan-function-from-lo.patch
0007-fipvlan-create-VLANs-from-netlink-handler.patch
0008-fipvlan-Start-FCoE-from-netlink-handler.patch
0009-fipvlan-Update-wait-loop-to-wait-for-VLANs.patch
0010-fipvlan-Re-send-VLAN-discovery.patch
0011-fipvlan-update-manpage.patch
0012-fipvlan-Leave-link-up-if-requested.patch
0013-fipvlan-Update-manpage-to-reflect-correct-timeout.patch
0014-fipvlan-Do-not-shut-down-FCoE-connections-on-physica.patch
0015-fipvlan-break-out-of-receive-loop-on-error.patch
0016-fipvlan-handle-errors-from-fip-socket-creation.patch
0017-fipvlan-filter-interfaces-from-rtnl_getlink.patch
0018-Add-missing-DESTDIR-when-installing-bash-completion.patch
0019-Fix-build-with-Wl-as-needed.patch
0020-Fix-integer-formatting.patch
0021-fcnsq-Fixup-help-text.patch
0022-fcnsq-Fixup-64bit-integer-handling.patch
0023-fcoemon-add-systemd-service-file.patch
0024-fcoemon-systemd-socket-activation.patch
0025-doc-Update-QUICKSTART-INSTALL-docs-for-systemd-init-.patch
0026-FIPVLAN-Really-break-out-of-the-recv_loop-upon-fip_r.patch
0027-man-Fix-typo-in-fcoemon-documentation.patch
0028-systemctl-cannot-start-fcoemon.socket.patch
0029-fcoemon-Correctly-handle-options-in-the-service-file.patch
0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
0031-fcoemon-Fix-IEEE-state-machine.patch
0032-fipvlan-Fix-crash-in-create_and_start_vlan.patch
0033-fipvlan-suppress-warning-interface-already-exists.patch
0034-fipvlan-do-not-crash-on-empty-MAC-address-in-lookup_.patch
0035-fipvlan-fixup-return-value-on-error.patch
0036-fipvlan-clean-up-state-machine-for-pfd_add.patch
0037-Use-correct-socket-for-fcoemon.socket.patch
fcoe-utils-1.0.29.tar.xz
New:
----
0001-fcoemon-Rework-daemonizing-and-error-handling.patch
0002-fcoemon-fix-IEEE-state-machine.patch
0003-systemctl-cannot-start-fcoemon.socket.patch
0004-fcoemon-Correctly-handle-options-in-the-service-file.patch
0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
0006-fipvlan-fixup-return-value-on-error.patch
0007-fipvlan-clean-up-state-machine-for-pfd_add.patch
0008-Use-correct-socket-for-fcoemon.socket.patch
fcoe-utils-1.0.30.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ fcoe-utils.spec ++++++
--- /var/tmp/diff_new_pack.hscxnv/_old 2015-08-07 00:19:05.000000000 +0200
+++ /var/tmp/diff_new_pack.hscxnv/_new 2015-08-07 00:19:05.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package fcoe-utils
#
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,8 +20,8 @@
Url: http://www.open-fcoe.org
BuildRequires: autoconf
BuildRequires: automake
-BuildRequires: libHBAAPI2-devel
-BuildRequires: libhbalinux2-devel
+BuildRequires: libHBAAPI2-devel >= 2.2.10
+BuildRequires: libhbalinux2-devel >= 1.0.17
BuildRequires: libtool
BuildRequires: open-lldp-devel
BuildRequires: systemd-devel
@@ -30,7 +30,7 @@
Requires: libhbalinux2
Requires: open-lldp
%systemd_requires
-Version: 1.0.29
+Version: 1.0.30
Release: 0
Summary: FCoE userspace management tools
License: GPL-2.0
@@ -38,45 +38,16 @@
# git://open-fcoe.org/fcoe/fcoe-utils.git
Source0: %{name}-%{version}.tar.xz
# Patches from git repository
-Patch1: 0001-man-Fix-small-typo-regarding-fcf-option.patch
-Patch2: 0002-Don-t-call-AM_INIT_AUTOMAKE-twice.patch
-Patch3: 0003-fipvlan-fails-on-powerpc.patch
-Patch4: 0004-fipvlan-Only-shutdown-interfaces-if-no-vlans-are-cre.patch
-Patch5: 0005-fipvlan-start-VLAN-interface-from-netlink-handler.patch
-Patch6: 0006-fipvlan-Extract-create_missing_vlan-function-from-lo.patch
-Patch7: 0007-fipvlan-create-VLANs-from-netlink-handler.patch
-Patch8: 0008-fipvlan-Start-FCoE-from-netlink-handler.patch
-Patch9: 0009-fipvlan-Update-wait-loop-to-wait-for-VLANs.patch
-Patch10: 0010-fipvlan-Re-send-VLAN-discovery.patch
-Patch11: 0011-fipvlan-update-manpage.patch
-Patch12: 0012-fipvlan-Leave-link-up-if-requested.patch
-Patch13: 0013-fipvlan-Update-manpage-to-reflect-correct-timeout.patch
-Patch14: 0014-fipvlan-Do-not-shut-down-FCoE-connections-on-physica.patch
-Patch15: 0015-fipvlan-break-out-of-receive-loop-on-error.patch
-Patch16: 0016-fipvlan-handle-errors-from-fip-socket-creation.patch
-Patch17: 0017-fipvlan-filter-interfaces-from-rtnl_getlink.patch
-Patch18: 0018-Add-missing-DESTDIR-when-installing-bash-completion.patch
-Patch19: 0019-Fix-build-with-Wl-as-needed.patch
-Patch20: 0020-Fix-integer-formatting.patch
-Patch21: 0021-fcnsq-Fixup-help-text.patch
-Patch22: 0022-fcnsq-Fixup-64bit-integer-handling.patch
-Patch23: 0023-fcoemon-add-systemd-service-file.patch
-Patch24: 0024-fcoemon-systemd-socket-activation.patch
-Patch25: 0025-doc-Update-QUICKSTART-INSTALL-docs-for-systemd-init-.patch
-Patch26: 0026-FIPVLAN-Really-break-out-of-the-recv_loop-upon-fip_r.patch
-Patch27: 0027-man-Fix-typo-in-fcoemon-documentation.patch
+Patch1: 0001-fcoemon-Rework-daemonizing-and-error-handling.patch
+Patch2: 0002-fcoemon-fix-IEEE-state-machine.patch
# Patches to be upstreamed
-Patch28: 0028-systemctl-cannot-start-fcoemon.socket.patch
-Patch29: 0029-fcoemon-Correctly-handle-options-in-the-service-file.patch
-Patch30: 0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
-Patch31: 0031-fcoemon-Fix-IEEE-state-machine.patch
-Patch32: 0032-fipvlan-Fix-crash-in-create_and_start_vlan.patch
-Patch33: 0033-fipvlan-suppress-warning-interface-already-exists.patch
-Patch34: 0034-fipvlan-do-not-crash-on-empty-MAC-address-in-lookup_.patch
-Patch35: 0035-fipvlan-fixup-return-value-on-error.patch
-Patch36: 0036-fipvlan-clean-up-state-machine-for-pfd_add.patch
-Patch37: 0037-Use-correct-socket-for-fcoemon.socket.patch
+Patch3: 0003-systemctl-cannot-start-fcoemon.socket.patch
+Patch4: 0004-fcoemon-Correctly-handle-options-in-the-service-file.patch
+Patch5: 0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch
+Patch6: 0006-fipvlan-fixup-return-value-on-error.patch
+Patch7: 0007-fipvlan-clean-up-state-machine-for-pfd_add.patch
+Patch8: 0008-Use-correct-socket-for-fcoemon.socket.patch
# Patches from Fedora
Patch101: fcoe-utils-1.0.29-make.patch
@@ -97,35 +68,6 @@
%patch6 -p1
%patch7 -p1
%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
-%patch17 -p1
-%patch18 -p1
-%patch19 -p1
-%patch20 -p1
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch24 -p1
-%patch25 -p1
-%patch26 -p1
-%patch27 -p1
-%patch28 -p1
-%patch29 -p1
-%patch30 -p1
-%patch31 -p1
-%patch32 -p1
-%patch33 -p1
-%patch34 -p1
-%patch35 -p1
-%patch36 -p1
-%patch37 -p1
%patch101 -p1
%build
++++++ 0001-fcoemon-Rework-daemonizing-and-error-handling.patch ++++++
From f3af6bad75d7f6c90b9a170cbf9e4748ab4bb24e Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn
Date: Mon, 18 May 2015 17:02:59 +0000
Subject: fcoemon: Rework daemonizing and error handling
Rework error handling, which leads to daemonizing later in order to get the
error handling into effect.
Signed-off-by: Johannes Thumshirn
Signed-off-by: Vasu Dev
---
fcoemon.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index 3b5210c..c5edd1b 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -3719,11 +3719,6 @@ int main(int argc, char **argv)
if (argc != optind)
fcm_usage();
- if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) {
- FCM_LOG("Starting daemon failed");
- exit(EXIT_FAILURE);
- }
-
umask(0);
/*
@@ -3770,22 +3765,40 @@ int main(int argc, char **argv)
}
fcm_fcoe_init();
- fcm_fc_events_init();
- fcm_link_init(); /* NETLINK_ROUTE protocol */
+ rc = fcm_fc_events_init();
+ if (rc != 0)
+ exit(1);
+
+ rc = fcm_link_init(); /* NETLINK_ROUTE protocol */
+ if (rc != 0)
+ goto err_cleanup;
+
fcm_dcbd_init();
- fcm_srv_create(&srv_info);
+ rc = fcm_srv_create(&srv_info);
+ if (rc != 0)
+ goto err_cleanup;
+
+ if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) {
+ FCM_LOG("Starting daemon failed");
+ goto err_cleanup;
+ }
+
sa_select_set_callback(fcm_handle_changes);
rc = sa_select_loop();
if (rc < 0) {
FCM_LOG_ERR(rc, "select error\n");
- exit(EXIT_FAILURE);
+ goto err_cleanup;
}
fcm_dcbd_shutdown();
fcm_srv_destroy(&srv_info);
if (rc == SIGHUP)
fcm_cleanup();
return 0;
+
+err_cleanup:
+ fcm_cleanup();
+ exit(1);
}
/*******************************************************
--
1.8.4.5
++++++ 0002-fcoemon-fix-IEEE-state-machine.patch ++++++
From 91c0c8c0a37af40b3fb4a37df6490a226348d152 Mon Sep 17 00:00:00 2001
From: Vasu Dev
Date: Fri, 5 Jun 2015 14:52:10 -0700
Subject: fcoemon: fix IEEE state machine
Fix IEEE state machine for these issues:-
- fcoeadm scan not working
- fcoeadm reset not working
- periodic fipvlan issuance even after fcoe instance created
These issues are due to current IEEE states are not correctly
handled. The validate_ieee_info() return either activate or
wait actions and out of that only activate is really used to
enable fcoe instance and none other action are applicable in
IEEE state machine, so reduced to only activate and then
advance the state machine to new IEEE_ACTIVE state to allow
processing of scan & reset command once interface activated.
This also fixes fipvlan issuance issue beside fixing scan and
reset fcoeadm commands.
Signed-off-by: Vasu Dev
Tested-By: Jack Morgan
---
fcoemon.c | 19 +++++++------------
fcoemon.h | 1 +
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index c5edd1b..c0af99b 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1341,6 +1341,7 @@ STR_ARR(ieee_states, "Unknown", "Out of range",
[IEEE_INIT] = "IEEE_INIT",
[IEEE_GET_STATE] = "IEEE_GET_STATE",
[IEEE_DONE] = "IEEE_DONE",
+ [IEEE_ACTIVE] = "IEEE_ACTIVE",
);
static void
@@ -3054,20 +3055,14 @@ static void fcm_netif_ieee_advance(struct fcm_netif *ff)
break;
case IEEE_DONE:
action = validate_ieee_info(ff);
- switch (action) {
- case FCP_DESTROY_IF:
- case FCP_ENABLE_IF:
- case FCP_ACTIVATE_IF:
+ if (action == FCP_ACTIVATE_IF) {
fcp_action_set(ff->ifname, action);
- break;
- case FCP_DISABLE_IF:
- case FCP_ERROR:
- fcp_action_set(ff->ifname, FCP_DISABLE_IF);
- break;
- case FCP_WAIT:
- default:
- break;
+ ieee_state_set(ff, IEEE_ACTIVE);
}
+ break;
+ case IEEE_ACTIVE:
+ /* TBD enable and disable if needed in IEEE mode */
+ break;
default:
break;
}
diff --git a/fcoemon.h b/fcoemon.h
index c2ed7b1..3869bae 100644
--- a/fcoemon.h
+++ b/fcoemon.h
@@ -80,6 +80,7 @@ enum ieee_state {
IEEE_INIT = 0, /* Starting state */
IEEE_GET_STATE, /* Getting IEEE DCB state */
IEEE_DONE, /* Received IEEE DCB state */
+ IEEE_ACTIVE, /* IEEE is in ACTIVE state */
IEEE_ERROR, /* Error receiving IEEE DCB state */
};
--
1.8.4.5
++++++ 0028-systemctl-cannot-start-fcoemon.socket.patch -> 0003-systemctl-cannot-start-fcoemon.socket.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0028-systemctl-cannot-start-fcoemon.socket.patch 2014-04-23 17:28:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0003-systemctl-cannot-start-fcoemon.socket.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From 444f3c66ee5a2b59a563d78cb70db7da2326d446 Mon Sep 17 00:00:00 2001
+From 4cb4df057df03ce1ccc81b2778b5090d1443ae15 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Fri, 21 Mar 2014 14:46:40 +0100
Subject: systemctl cannot start fcoemon.socket
@@ -27,5 +27,5 @@
PassCredentials=true
--
-1.8.1.4
+1.8.4.5
++++++ 0029-fcoemon-Correctly-handle-options-in-the-service-file.patch -> 0004-fcoemon-Correctly-handle-options-in-the-service-file.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0029-fcoemon-Correctly-handle-options-in-the-service-file.patch 2014-04-23 17:28:15.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0004-fcoemon-Correctly-handle-options-in-the-service-file.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From 5216ae2ef4434d92ff3d49c4d5a7b73b438aee2d Mon Sep 17 00:00:00 2001
+From 1e3d735a5cd1edefaeff75c43aed68661b8cda7e Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Fri, 11 Apr 2014 15:38:26 +0200
Subject: fcoemon: Correctly handle options in the service file
@@ -55,7 +55,7 @@
[Install]
WantedBy=multi-user.target
diff --git a/fcoemon.c b/fcoemon.c
-index 5e4f8d7..23fc2f6 100644
+index c0af99b..3ccdd5f 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -336,9 +336,9 @@ static int fcoe_vid_from_ifname(const char *ifname);
@@ -70,7 +70,7 @@
{"exec", 1, NULL, 'e'},
{"foreground", 0, NULL, 'f'},
{"version", 0, NULL, 'v'},
-@@ -3192,9 +3192,9 @@ static void fcm_usage(void)
+@@ -3229,9 +3229,9 @@ static void fcm_usage(void)
{
printf("Usage: %s\n"
"\t [-f|--foreground]\n"
@@ -82,7 +82,7 @@
"\t [-v|--version]\n"
"\t [-h|--help]\n\n", progname);
exit(1);
-@@ -3648,22 +3648,28 @@ int main(int argc, char **argv)
+@@ -3685,22 +3685,28 @@ int main(int argc, char **argv)
sa_log_flags = 0;
openlog(sa_log_prefix, LOG_CONS, LOG_DAEMON);
@@ -117,5 +117,5 @@
case 'v':
printf("%s\n", FCOE_UTILS_VERSION);
--
-1.8.1.4
+1.8.4.5
++++++ 0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch -> 0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0030-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch 2014-05-23 08:05:17.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0005-fcoe.service-Add-foreground-to-prevent-fcoemon-to-be.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From 1b7dc959d70679a3536ccbeb6b3a8d0905606537 Mon Sep 17 00:00:00 2001
+From 475d3e782f84beec9ce7b4557f2444df0e2f914f Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Wed, 16 Apr 2014 13:30:47 +0200
Subject: fcoe.service: Add '--foreground' to prevent fcoemon to be killed
@@ -29,5 +29,5 @@
[Install]
WantedBy=multi-user.target
--
-1.7.12.4
+1.8.4.5
++++++ 0035-fipvlan-fixup-return-value-on-error.patch -> 0006-fipvlan-fixup-return-value-on-error.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0035-fipvlan-fixup-return-value-on-error.patch 2014-05-23 08:05:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0006-fipvlan-fixup-return-value-on-error.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From 16765b7b091f8130ae001af7693895ffe0886a0e Mon Sep 17 00:00:00 2001
+From 311c26a073f4397f10408c288af28cf593f46336 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Tue, 13 May 2014 09:44:17 +0200
Subject: fipvlan: fixup return value on error
@@ -12,10 +12,10 @@
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
-index c5f3d3f..3300c68 100644
+index 288b011..9f3b07d 100644
--- a/fipvlan.c
+++ b/fipvlan.c
-@@ -982,7 +982,7 @@ int main(int argc, char **argv)
+@@ -981,7 +981,7 @@ int main(int argc, char **argv)
ns = rtnl_socket();
if (ns < 0) {
@@ -24,7 +24,7 @@
goto ns_err;
}
pfd_add(ns);
-@@ -1002,7 +1002,7 @@ int main(int argc, char **argv)
+@@ -1001,7 +1001,7 @@ int main(int argc, char **argv)
"no interfaces to perform discovery on");
else
FIP_LOG("no interfaces to perform discovery on");
@@ -34,5 +34,5 @@
do_vlan_discovery();
--
-1.7.12.4
+1.8.4.5
++++++ 0036-fipvlan-clean-up-state-machine-for-pfd_add.patch -> 0007-fipvlan-clean-up-state-machine-for-pfd_add.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0036-fipvlan-clean-up-state-machine-for-pfd_add.patch 2014-05-23 08:05:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0007-fipvlan-clean-up-state-machine-for-pfd_add.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From b19353bfa3186334611109456b232e596335c15e Mon Sep 17 00:00:00 2001
+From 53a1a696c33fc64c76bd29831ed61c8e50fbc495 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Wed, 14 May 2014 16:01:10 +0200
Subject: fipvlan: clean up state machine for pfd_add
@@ -12,10 +12,10 @@
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
-index 3300c68..2211fd1 100644
+index 9f3b07d..a183233 100644
--- a/fipvlan.c
+++ b/fipvlan.c
-@@ -397,10 +397,17 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
+@@ -398,10 +398,17 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
/* already tracking, update operstate and return */
iff->running = running;
if (!iff->running) {
@@ -35,7 +35,7 @@
if (!config.start)
return;
-@@ -440,6 +447,7 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
+@@ -441,6 +448,7 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
iff->ifindex = ifm->ifi_index;
iff->running = running;
iff->fip_ready = false;
@@ -43,7 +43,7 @@
if (ifla[IFLA_LINK])
iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]);
else
-@@ -827,7 +835,8 @@ static int probe_fip_interface(struct iff *iff)
+@@ -814,7 +822,8 @@ static int probe_fip_interface(struct iff *iff)
if (iff->req_sent)
return 0;
@@ -53,7 +53,7 @@
iff->ps = fip_socket(iff->ifindex, FIP_NONE);
if (iff->ps < 0) {
FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
-@@ -835,6 +844,8 @@ static int probe_fip_interface(struct iff *iff)
+@@ -822,6 +831,8 @@ static int probe_fip_interface(struct iff *iff)
}
setsockopt(iff->ps, SOL_PACKET, PACKET_ORIGDEV,
&origdev, sizeof(origdev));
@@ -63,5 +63,5 @@
iff->fip_ready = true;
}
--
-1.7.12.4
+1.8.4.5
++++++ 0037-Use-correct-socket-for-fcoemon.socket.patch -> 0008-Use-correct-socket-for-fcoemon.socket.patch ++++++
--- /work/SRC/openSUSE:Factory/fcoe-utils/0037-Use-correct-socket-for-fcoemon.socket.patch 2014-08-06 11:42:11.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.fcoe-utils.new/0008-Use-correct-socket-for-fcoemon.socket.patch 2015-08-07 00:19:03.000000000 +0200
@@ -1,4 +1,4 @@
-From 348489108793c83ec6ebbdba87888888219ca59d Mon Sep 17 00:00:00 2001
+From 7f267031c30b6bc9fe708efac4d00060c583ae64 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke
Date: Mon, 28 Jul 2014 11:24:19 +0200
Subject: Use correct socket for fcoemon.socket
++++++ fcoe-utils-1.0.29.tar.xz -> fcoe-utils-1.0.30.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/.gitignore new/fcoe-utils-1.0.30/.gitignore
--- old/fcoe-utils-1.0.29/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/fcoe-utils-1.0.30/.gitignore 2015-04-15 20:38:46.000000000 +0200
@@ -0,0 +1,32 @@
+# standard autotools stuff
+.deps/
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache/
+compile
+config.log
+config.status
+configure
+depcomp
+install-sh
+missing
+
+# other autoconf generated files
+fcoe-utils.spec
+fcoeplumb
+fcoe_utils_version.h
+
+# compile generated files
+*.o
+fcoeadm
+fcoemon
+fipvlan
+fcping
+fcnsq
+fcrls
+etc/initd/fcoe
+
+# build.sh generated files
+fcoe-utils-*.tar.gz
+fcoe-utils-*.rpm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/INSTALL new/fcoe-utils-1.0.30/INSTALL
--- old/fcoe-utils-1.0.29/INSTALL 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/INSTALL 2015-04-15 20:38:46.000000000 +0200
@@ -19,6 +19,9 @@
1) Bootstrap, configure, make and make install
# ./bootstrap.sh
+ Either execute the next line for System V init script install
# rpm --eval "%configure" | sh
+ or the following line to install systemd unit scripts
+ # rpm --eval "%configure --with-systemdsystemunitdir=/" | sh
# make
# make install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/Makefile.am new/fcoe-utils-1.0.30/Makefile.am
--- old/fcoe-utils-1.0.29/Makefile.am 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/Makefile.am 2015-04-15 20:38:46.000000000 +0200
@@ -9,21 +9,18 @@
## rules for building fcoeadm
fcoeadm_SOURCES = fcoeadm.c fcoeadm_display.c
-fcoeadm_LDADD = lib/libutil.a libopenfcoe.a
+fcoeadm_LDADD = lib/libutil.a libopenfcoe.a $(HBAAPI_LIBS)
fcoeadm_CFLAGS = $(AM_CFLAGS) $(HBAAPI_CFLAGS)
-fcoeadm_LDFLAGS = $(AM_LDFLAGS) $(HBAAPI_LIBS)
## rules for building fcoemon
fcoemon_SOURCES = fcoemon.c
-fcoemon_LDADD = lib/libutil.a
+fcoemon_LDADD = lib/libutil.a -lrt
fcoemon_CFLAGS = $(AM_CFLAGS) $(DCBD_CFLAGS)
-fcoemon_LDFLAGS = $(AM_LDFLAGS) -lrt
## rules for building fcping
fcping_SOURCES = fcping.c
-fcping_LDADD = lib/libutil.a
+fcping_LDADD = lib/libutil.a $(HBAAPI_LIBS) -lrt
fcping_CFLAGS = $(AM_CFLAGS) $(HBAAPI_CFLAGS)
-fcping_LDFLAGS = $(AM_LDFLAGS) $(HBAAPI_LIBS) -lrt
## rules for building fipvlan
fipvlan_SOURCES = fipvlan.c
@@ -38,12 +35,20 @@
## header files that need to be distributed
noinst_HEADERS = fcoeadm_display.h fcoe_clif.h fcoemon.h \
include/fcoemon_utils.h include/fcoe_utils.h include/fc_scsi.h \
- include/fc_types.h include/fip.h include/net_types.h include/rtnetlink.h
+ include/fc_types.h include/fip.h include/net_types.h include/rtnetlink.h \
+ include/libopenfcoe.h include/scsi_netlink_fc.h include/scsi_netlink.h \
+ include/strarr.h include/fc_ns.h include/fc_gs.h include/fc_els.h include/scsi_bsg_fc.h \
+ include/linux/rtnetlink.h include/linux/types.h include/linux/dcbnl.h
## install configuration file in $(prefix)/etc/fcoe
fcoe_configdir = ${sysconfdir}/fcoe
dist_fcoe_config_DATA = etc/cfg-ethx
+## install systemd service files
+if HAVE_SYSTEMD
+dist_systemdsystemunit_DATA = etc/systemd/fcoe.service etc/systemd/fcoemon.socket
+endif
+
## man pages for fcoeadm and fcoemon
dist_man_MANS = doc/fcoeadm.8 doc/fcoemon.8 doc/fipvlan.8 doc/fcrls.8 \
doc/fcnsq.8 doc/fcping.8
@@ -65,15 +70,17 @@
init_ddir = ${sysconfdir}/init.d
init_d_SCRIPTS = etc/initd/fcoe
-dist_noinst_DATA = README COPYING INSTALL fcoe-utils.spec etc/config
+dist_noinst_DATA = README COPYING INSTALL CONFIGURE QUICKSTART fcoe-utils.spec etc/config
-BASH_COMPLETION_DIR=/etc/bash_completion.d/
+bashcompletiondir = $(sysconfdir)/bash_completion.d
+dist_bashcompletion_DATA = contrib/bash_completion/fcoeadm contrib/bash_completion/fcoemon
install-data-hook:
if [ ! -f ${DESTDIR}${fcoe_configdir}/config ] ; then \
cp ${srcdir}/etc/config ${DESTDIR}${fcoe_configdir}/config; \
- fi; \
- if [ ! -d "${BASH_COMPLETION_DIR}" ] ; then \
- mkdir ${BASH_COMPLETION_DIR}; \
- fi; \
- cp -f ${srcdir}/contrib/bash_completion/* ${BASH_COMPLETION_DIR}
+ fi;
+
+uninstall-hook:
+ rm ${DESTDIR}${fcoe_configdir}/config
+
+AM_DISTCHECK_CONFIGURE_FLAGS = --with-systemdsystemunitdir='$${prefix}/lib/systemd/system'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/QUICKSTART new/fcoe-utils-1.0.30/QUICKSTART
--- old/fcoe-utils-1.0.29/QUICKSTART 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/QUICKSTART 2015-04-15 20:38:46.000000000 +0200
@@ -201,7 +201,10 @@
2) Bootstrap, configure, make and make install
# cd fcoe-utils
# ./bootstrap.sh
+ Either execute the next line for System V init script install
# rpm --eval "%configure" | sh
+ or the following line to install systemd unit scripts
+ # rpm --eval "%configure --with-systemdsystemunitdir=/" | sh
# make
# make install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/configure.ac new/fcoe-utils-1.0.30/configure.ac
--- old/fcoe-utils-1.0.29/configure.ac 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/configure.ac 2015-04-15 20:38:46.000000000 +0200
@@ -1,5 +1,4 @@
-AC_INIT([fcoe-utils], [1.0.29], [fcoe-devel@open-fcoe.org])
-AM_INIT_AUTOMAKE([foreign])
+AC_INIT([fcoe-utils], [1.0.30], [fcoe-devel@open-fcoe.org])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_INIT_AUTOMAKE([foreign])
@@ -12,12 +11,20 @@
AC_SUBST([HBAAPI_CFLAGS])
AC_SUBST([HBAAPI_LIBS])
-PKG_CHECK_MODULES([LLDPAD], [lldpad >= 0.9.43])
+PKG_CHECK_MODULES([LLDPAD], [lldpad >= 0.9.46])
AC_SUBST([LLDPAD_CFLAGS])
-PKG_CHECK_MODULES([LIBHBALINUX], [libhbalinux >= 1.0.13])
+PKG_CHECK_MODULES([LIBHBALINUX], [libhbalinux >= 1.0.17])
AC_SUBST([LIBHBALINUX_CFLAGS])
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
+ [Directory for systemd service files]), [],
+ [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
+
AC_CONFIG_FILES([Makefile fcoe-utils.spec include/fcoe_utils_version.h])
AC_OUTPUT
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fcoeadm.8 new/fcoe-utils-1.0.30/doc/fcoeadm.8
--- old/fcoe-utils-1.0.29/doc/fcoeadm.8 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fcoeadm.8 2015-04-15 20:38:46.000000000 +0200
@@ -1,13 +1,13 @@
'\" t
.\" Title: fcoeadm
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\" Date: 11/08/2012
+.\" Generator: DocBook XSL Stylesheets v1.78.1 http://docbook.sf.net/
+.\" Date: 10/14/2013
.\" Manual: Open-FCoE Tools
.\" Source: Open-FCoE
.\" Language: English
.\"
-.TH "FCOEADM" "8" "11/08/2012" "Open\-FCoE" "Open\-FCoE Tools"
+.TH "FCOEADM" "8" "10/14/2013" "Open\-FCoE" "Open\-FCoE Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -39,7 +39,7 @@
.sp
\fBfcoeadm\fR \-i|\-\-interface [\fIethX\fR]
.sp
-\fBfcoeadm\fR \-f|\-\-fcfs [\fIethX\fR]
+\fBfcoeadm\fR \-f|\-\-fcf [\fIethX\fR]
.sp
\fBfcoeadm\fR \-t|\-\-target [\fIethX\fR]
.sp
@@ -91,7 +91,7 @@
Show information about the FCoE instance on the specified network interface, or all FCoE instances if no network interface is specified\&.
.RE
.PP
-\fB\-f\fR, \fB\-\-fcfs\fR [\fIethX\fR]
+\fB\-f\fR, \fB\-\-fcf\fR [\fIethX\fR]
.RS 4
Show information about the discovered Fibre Channel Forwarders (FCFs) on the specified network interface, or all discovered FCFs if no network interface is specified\&.
.RE
@@ -143,13 +143,9 @@
.RE
.SH "INTERFACE NAMES"
.sp
-The actual name for \fIethX\fR depends on the \fBAUTO_VLAN\fR setting in
-the fcoemon interface configuration (/etc/fcoe/cfg-ethX, see \fBfcoemon\fR)\&.
+The actual name for \fIethX\fR depends on the \fBAUTO_VLAN\fR setting in the fcoemon interface configuration (/etc/fcoe/cfg\-ethX, see \fBfcoemon\fR)\&.
.sp
-If \fBAUTO_VLAN\fR is set to \fIyes\fR, the interface name \fIethX\fR
-references the network device itself. If \fBAUTO_VLAN\fR is set to
-\fIno\fR, the interface name \fIethX\fR references the VLAN device\&.
-.RE
+If \fBAUTO_VLAN\fR is set to \fIyes\fR, the interface name \fIethX\fR references the network device itself\&. If \fBAUTO_VLAN\fR is set to \fIno\fR, the interface name \fIethX\fR references the VLAN device\&.
.SH "EXAMPLES"
.sp
Creates an FCoE instance on eth2\&.101
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fcoeadm.txt new/fcoe-utils-1.0.30/doc/fcoeadm.txt
--- old/fcoe-utils-1.0.29/doc/fcoeadm.txt 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fcoeadm.txt 2015-04-15 20:38:46.000000000 +0200
@@ -29,7 +29,7 @@
*fcoeadm* -i|--interface [_ethX_]
-*fcoeadm* -f|--fcfs [_ethX_]
+*fcoeadm* -f|--fcf [_ethX_]
*fcoeadm* -t|--target [_ethX_]
@@ -89,7 +89,7 @@
Show information about the FCoE instance on the specified network
interface, or all FCoE instances if no network interface is specified.
-*-f*, *--fcfs* [_ethX_]::
+*-f*, *--fcf* [_ethX_]::
Show information about the discovered Fibre Channel Forwarders (FCFs)
on the specified network interface, or all discovered FCFs if no
network interface is specified.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fcoemon.8 new/fcoe-utils-1.0.30/doc/fcoemon.8
--- old/fcoe-utils-1.0.29/doc/fcoemon.8 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fcoemon.8 2015-04-15 20:38:46.000000000 +0200
@@ -358,7 +358,7 @@
Note that the attached Ethernet peer device (e\&.g\&. FCoE capable switch port) must have compatible settings For DCB and FCoE to function properly\&.
.SS "/etc/init\&.d/fcoe"
.sp
-This is the \fBfcoe\fR system service script\&. This script is invoked by the init process or by the service command to start and stop the \fBfcoemon\fR\&.
+This is the \fBfcoe\fR system service script\&. This script is invoked by the init process or by the service command to start and stop the \fBfcoemon\fR\&. On systemd-enabled systems, \fBfcoemon\fR is controlled via the \fBfcoe.service\fR unit.
.SH "VLAN NAMING CONVENTIONS"
.sp
If a new VLAN device is created (see the description of the \fIAUTO_VLAN\fR setting above), it will have the name \fIdev\fR\&.\fIvlan\fR\-fcoe; where \fIdev\fR is the name of the Ethernet parent device and \fIvlan\fR is the discovered VLAN ID number\&.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fcoemon.txt new/fcoe-utils-1.0.30/doc/fcoemon.txt
--- old/fcoe-utils-1.0.29/doc/fcoemon.txt 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fcoemon.txt 2015-04-15 20:38:46.000000000 +0200
@@ -56,7 +56,7 @@
*-d*, *--debug*::
Enable debugging messages.
*-l*, *--legacy*::
- Force fcoemon to use the legacy /sys/modlue/libfcoe/parameters/
+ Force fcoemon to use the legacy /sys/module/libfcoe/parameters/
interface. The default is to use the newer /sys/bus/fcoe/ interfaces
if they are available.
*-s*, *--syslog*::
@@ -214,6 +214,7 @@
~~~~~~~~~~~~~~~~
This is the *fcoe* system service script. This script is invoked by the
init process or by the service command to start and stop the *fcoemon*.
+On systemd-enabled systems, *fcoemon* is controlled via the *fcoe.service* unit.
VLAN NAMING CONVENTIONS
-----------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fipvlan.8 new/fcoe-utils-1.0.30/doc/fipvlan.8
--- old/fcoe-utils-1.0.29/doc/fipvlan.8 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fipvlan.8 2015-04-15 20:38:46.000000000 +0200
@@ -1,13 +1,13 @@
'\" t
.\" Title: fipvlan
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.76.1 http://docbook.sf.net/
-.\" Date: 03/18/2013
+.\" Generator: DocBook XSL Stylesheets v1.78.1 http://docbook.sf.net/
+.\" Date: 12/02/2013
.\" Manual: Open-FCoE Tools
.\" Source: Open-FCoE
.\" Language: English
.\"
-.TH "FIPVLAN" "8" "03/18/2013" "Open\-FCoE" "Open\-FCoE Tools"
+.TH "FIPVLAN" "8" "12/02/2013" "Open\-FCoE" "Open\-FCoE Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -29,9 +29,9 @@
fipvlan \- Fibre Channel over Ethernet VLAN Discovery
.SH "SYNOPSIS"
.sp
-\fBfipvlan\fR [\-c|\-\-create] [\-s|\-\-start] [\-m|\-\-mode fabric|vn2vn] \fIinterfaces\fR
+\fBfipvlan\fR [\-c|\-\-create] [\-d|\-\-debug] [\-s|\-\-start] [\-m|\-\-mode fabric|vn2vn] [\-u|\-\-link\-up] \fIinterfaces\fR
.sp
-\fBfipvlan\fR \-a|\-\-auto [\-c|\-\-create] [\-d|\-\-debug] [\-s|\-\-start] [\-m|\-\-mode fabric|vn2vn] [\-l|\-\-link\-retry \fIcount\fR]
+\fBfipvlan\fR \-a|\-\-auto [\-c|\-\-create] [\-d|\-\-debug] [\-s|\-\-start] [\-m|\-\-mode fabric|vn2vn] [\-l|\-\-link\-retry \fIcount\fR] [\-u|\-\-link\-up]
.sp
\fBfipvlan\fR \-h|\-\-help
.sp
@@ -83,7 +83,12 @@
.RS 4
Retry check for link up to
\fIcount\fR
-times\&. The link state is checked every 500 ms\&. The default number of retries is 20\&.
+times\&. The link state is checked every 1000 ms\&. The default number of retries is 20\&.
+.RE
+.PP
+\fB\-u\fR, \fB\-\-link\-up\fR
+.RS 4
+Leave link up if a FIP response has been received\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/doc/fipvlan.txt new/fcoe-utils-1.0.30/doc/fipvlan.txt
--- old/fcoe-utils-1.0.29/doc/fipvlan.txt 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/doc/fipvlan.txt 2015-04-15 20:38:46.000000000 +0200
@@ -19,10 +19,12 @@
SYNOPSIS
--------
-*fipvlan* [-c|--create] [-s|--start] [-m|--mode fabric|vn2vn] _interfaces_
+*fipvlan* [-c|--create] [-d|--debug] [-s|--start]
+ [-m|--mode fabric|vn2vn] [-u|--link-up] _interfaces_
*fipvlan* -a|--auto [-c|--create] [-d|--debug]
[-s|--start] [-m|--mode fabric|vn2vn] [-l|--link-retry _count_]
+ [-u|--link-up]
*fipvlan* -h|--help
@@ -73,7 +75,10 @@
*-l*, *--link-retry* _count_::
Retry check for link up to _count_ times. The link state is
- checked every 500 ms. The default number of retries is 20.
+ checked every 1000 ms. The default number of retries is 20.
+
+*-u*, *--link-up*::
+ Leave link up if a FIP response has been received.
*-h*, *--help*::
Display a help message with basic usage instructions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/etc/systemd/fcoe.service new/fcoe-utils-1.0.30/etc/systemd/fcoe.service
--- old/fcoe-utils-1.0.29/etc/systemd/fcoe.service 1970-01-01 01:00:00.000000000 +0100
+++ new/fcoe-utils-1.0.30/etc/systemd/fcoe.service 2015-04-15 20:38:46.000000000 +0200
@@ -0,0 +1,14 @@
+[Unit]
+Description=Open-FCoE initiator daemon
+After=syslog.target network.target
+
+[Service]
+Type=simple
+EnvironmentFile=/etc/sysconfig/fcoe
+ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
+ExecStart=/usr/sbin/fcoemon $FCOEMON_OPTS
+
+[Install]
+WantedBy=multi-user.target
+Also=lldpad.socket
+Also=fcoemon.socket
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/etc/systemd/fcoemon.socket new/fcoe-utils-1.0.30/etc/systemd/fcoemon.socket
--- old/fcoe-utils-1.0.29/etc/systemd/fcoemon.socket 1970-01-01 01:00:00.000000000 +0100
+++ new/fcoe-utils-1.0.30/etc/systemd/fcoemon.socket 2015-04-15 20:38:46.000000000 +0200
@@ -0,0 +1,6 @@
+[Socket]
+ListenDatagram=@/com/intel/fcoemon
+PassCredentials=true
+
+[Install]
+WantedBy=sockets.target
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fcnsq.c new/fcoe-utils-1.0.30/fcnsq.c
--- old/fcoe-utils-1.0.29/fcnsq.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fcnsq.c 2015-04-15 20:38:46.000000000 +0200
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -228,7 +229,7 @@
rjt = gn_id(bsg, fcid, FC_NS_GPN_ID, &wwpn);
if (rjt)
goto fail;
- print_result("Port Name", "%16.16llx\n", wwpn);
+ print_result("Port Name", "%16.16jx\n", (uintmax_t)wwpn);
return 0;
fail:
if (rjt == (u16) ~0)
@@ -249,7 +250,7 @@
rjt = gn_id(bsg, fcid, FC_NS_GNN_ID, &wwnn);
if (rjt)
goto fail;
- print_result("Node Name", "%16.16llx\n", wwnn);
+ print_result("Node Name", "%16.16jx\n", (uintmax_t)wwnn);
return 0;
fail:
if (rjt == (u16) ~0)
@@ -365,7 +366,7 @@
" --gspn <port id>\n"
" --gsnn <world wide node name>\n"
"Options:\n"
- " --quiet print minimal results on success, and no error messages\n"
+ " --quiet|-q print minimal results on success, and no error messages\n"
"\n"
"Port IDs and World Wide Names must be specified in hexadecimal.\n"
);
@@ -376,11 +377,12 @@
{
char *bsg;
int bsg_dev;
- u32 port_id;
- u64 wwnn;
+ u32 port_id = 0;
+ u64 wwnn = 0;
int rc = 0;
enum commands cmd = 0;
char c;
+ uintmax_t wwnn_tmp = 0;
while(1) {
c = getopt_long_only(argc, argv, "", options, NULL);
@@ -399,13 +401,17 @@
if (cmd)
help(-1);
cmd = c;
- sscanf(optarg, "%x", &port_id);
+ if (sscanf(optarg, "%x", &port_id) != 1)
+ help(-1);
break;
case GSNN_NN:
if (cmd)
help(-1);
cmd = c;
- sscanf(optarg, "%llx", &wwnn);
+ if (sscanf(optarg, "%jx", &wwnn_tmp) == 1)
+ wwnn = (u64)wwnn_tmp;
+ else
+ help(-1);
break;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fcoeadm.c new/fcoe-utils-1.0.30/fcoeadm.c
--- old/fcoe-utils-1.0.29/fcoeadm.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fcoeadm.c 2015-04-15 20:38:46.000000000 +0200
@@ -286,7 +286,7 @@
}
ifname = argv[optind];
- rc = fcoeadm_action(cmd, ifname, CLIF_FLAGS_NONE);
+ rc = fcoeadm_action(cmd, ifname, flags);
break;
case 'r':
cmd = CLIF_RESET_CMD;
@@ -303,8 +303,7 @@
ifname = argv[optind];
rc = fcoe_validate_fcoe_conn(ifname);
if (!rc)
- rc = fcoeadm_action(cmd, ifname,
- CLIF_FLAGS_NONE);
+ rc = fcoeadm_action(cmd, ifname, flags);
break;
case 'i':
@@ -405,8 +404,7 @@
rc = display_port_stats(ifname, stat_interval);
break;
case 'p':
- rc = fcoeadm_action(CLIF_PID_CMD, NULL,
- CLIF_FLAGS_NONE);
+ rc = fcoeadm_action(CLIF_PID_CMD, NULL, flags);
break;
case 'b':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fcoeadm_display.c new/fcoe-utils-1.0.30/fcoeadm_display.c
--- old/fcoe-utils-1.0.29/fcoeadm_display.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fcoeadm_display.c 2015-04-15 20:38:46.000000000 +0200
@@ -110,7 +110,13 @@
{ "Unknown", HBA_PORTSPEED_UNKNOWN },
{ "1 Gbit", HBA_PORTSPEED_1GBIT },
{ "2 Gbit", HBA_PORTSPEED_2GBIT },
+ { "4 Gbit", HBA_PORTSPEED_4GBIT },
{ "10 Gbit", HBA_PORTSPEED_10GBIT },
+ { "8 Gbit", HBA_PORTSPEED_8GBIT },
+ { "16 Gbit", HBA_PORTSPEED_16GBIT },
+ { "32 Gbit", HBA_PORTSPEED_32GBIT },
+ { "20 Gbit", HBA_PORTSPEED_20GBIT },
+ { "40 Gbit", HBA_PORTSPEED_40GBIT },
{ "Not Negotiated", HBA_PORTSPEED_NOT_NEGOTIATED },
{ NULL, 0 }
};
@@ -1417,8 +1423,8 @@
if (!buf)
buf = temp;
printf(" Connection Mode: %s\n", buf);
- printf(" Fabric Name: 0x%016lx\n", fcf->fabric_name);
- printf(" Switch Name 0x%016lx\n", fcf->switch_name);
+ printf(" Fabric Name: 0x%016" PRIx64 "\n", fcf->fabric_name);
+ printf(" Switch Name 0x%016" PRIx64 "\n", fcf->switch_name);
mac2str(fcf->mac, mac, MAX_STR_LEN);
printf(" MAC Address: %s\n", mac);
printf(" FCF Priority: %u\n", fcf->priority);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fcoemon.c new/fcoe-utils-1.0.30/fcoemon.c
--- old/fcoe-utils-1.0.29/fcoemon.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fcoemon.c 2015-04-15 20:38:46.000000000 +0200
@@ -800,12 +800,12 @@
for (i = 0; i < ARRAY_SIZE(fc_host_event_code_names); i++) {
if (fe->event_code == fc_host_event_code_names[i].value) {
/* only do u32 data even len is not, e.g. vendor */
- FCM_LOG("FC_HOST_EVENT %d at %" PRIu64 " secs on host%d:"
- "code %d=%s datalen %d data=%d\n",
- fe->event_num, fe->seconds,
- fe->host_no, fe->event_code,
- fc_host_event_code_names[i].name,
- fe->event_datalen, fe->event_data);
+ FCM_LOG_DBG("FC_HOST_EVENT %d at %" PRIu64 " secs on "
+ "host%d code %d=%s datalen %d data=%d\n",
+ fe->event_num, fe->seconds,
+ fe->host_no, fe->event_code,
+ fc_host_event_code_names[i].name,
+ fe->event_datalen, fe->event_data);
break;
}
}
@@ -1357,12 +1357,8 @@
getstr(&ieee_states, new_state));
}
- if (new_state == IEEE_GET_STATE) {
- ff->ieee_state = new_state;
+ if (new_state == IEEE_GET_STATE)
clear_ieee_info(ff);
- ieee_get_req(ff);
- return;
- }
ff->ieee_state = new_state;
ff->ieee_resp_pending = 0;
@@ -2637,7 +2633,7 @@
if (ep) {
FCM_LOG_DEV(ff, "Invalid get oper response "
- "parse error byte %ld, resp %s", ep - cp, cp);
+ "parse error byte %td, resp %s", ep - cp, cp);
fcm_dcbd_state_set(ff, FCD_ERROR);
} else {
if (val && fcoe_config.debug)
@@ -3035,6 +3031,50 @@
/*
* Called for all ports. For FCoE ports and candidates,
+ * get IEEE DCBX information and set the next action.
+ */
+static void fcm_netif_ieee_advance(struct fcm_netif *ff)
+{
+ enum fcp_action action;
+
+ ASSERT(ff);
+ ASSERT(fcm_clif);
+
+ if (fcm_clif->cl_busy)
+ return;
+
+ if (ff->ieee_resp_pending)
+ return;
+
+ switch (ff->ieee_state) {
+ case IEEE_INIT:
+ break;
+ case IEEE_GET_STATE:
+ ieee_get_req(ff);
+ break;
+ case IEEE_DONE:
+ action = validate_ieee_info(ff);
+ switch (action) {
+ case FCP_DESTROY_IF:
+ case FCP_ENABLE_IF:
+ case FCP_ACTIVATE_IF:
+ fcp_action_set(ff->ifname, action);
+ break;
+ case FCP_DISABLE_IF:
+ case FCP_ERROR:
+ fcp_action_set(ff->ifname, FCP_DISABLE_IF);
+ break;
+ case FCP_WAIT:
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+/*
+ * Called for all ports. For FCoE ports and candidates,
* get information and send to dcbd.
*/
static void fcm_netif_advance(struct fcm_netif *ff)
@@ -3161,8 +3201,10 @@
/*
* Perform pending actions (dcbd queries) on network interfaces.
*/
- TAILQ_FOREACH(ff, &fcm_netif_head, ff_list)
+ TAILQ_FOREACH(ff, &fcm_netif_head, ff_list) {
fcm_netif_advance(ff);
+ fcm_netif_ieee_advance(ff);
+ }
/*
* Perform actions on FCoE ports
@@ -3546,12 +3588,54 @@
sendto(snum, rbuf, MSG_RBUF, 0, (struct sockaddr *)&from, fromlen);
}
+static int fcm_systemd_socket(void)
+{
+ char *env, *ptr;
+ unsigned int p, l;
+
+ env = getenv("LISTEN_PID");
+ if (!env)
+ return -1;
+
+ p = strtoul(env, &ptr, 10);
+ if (ptr && ptr == env) {
+ FCM_LOG_DBG("Invalid value '%s' for LISTEN_PID\n", env);
+ return -1;
+ }
+ if ((pid_t)p != getpid()) {
+ FCM_LOG_DBG("Invalid PID '%d' from LISTEN_PID\n", p);
+ return -1;
+ }
+ env = getenv("LISTEN_FDS");
+ if (!env) {
+ FCM_LOG_DBG("LISTEN_FDS is not set\n");
+ return -1;
+ }
+ l = strtoul(env, &ptr, 10);
+ if (ptr && ptr == env) {
+ FCM_LOG_DBG("Invalid value '%s' for LISTEN_FDS\n", env);
+ return -1;
+ }
+ if (l != 1) {
+ FCM_LOG_DBG("LISTEN_FDS specified %d fds\n", l);
+ return -1;
+ }
+ /* systemd returns fds with an offset of '3' */
+ return 3;
+}
+
static int fcm_srv_create(struct fcm_srv_info *srv_info)
{
socklen_t addrlen;
struct sockaddr_un addr;
int rc = 0;
+ srv_info->srv_sock = fcm_systemd_socket();
+ if (srv_info->srv_sock > 0) {
+ FCM_LOG_DBG("Using systemd socket\n");
+ goto out_done;
+ }
+
srv_info->srv_sock = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (srv_info->srv_sock < 0) {
FCM_LOG_ERR(errno, "Failed to create socket\n");
@@ -3570,7 +3654,7 @@
rc = errno;
goto err_close;
}
-
+out_done:
sa_select_add_fd(srv_info->srv_sock, fcm_srv_receive,
NULL, NULL, srv_info);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fcping.c new/fcoe-utils-1.0.30/fcping.c
--- old/fcoe-utils-1.0.29/fcping.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fcping.c 2015-04-15 20:38:46.000000000 +0200
@@ -25,6 +25,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -810,17 +811,17 @@
printf("Maximum ECHO data allowed by the Fabric (0x%06x) : %d bytes.\n"
"Maximum ECHO data allowed by the Source (0x%06x) : %d bytes.\n"
"Maximum ECHO data allowed by the Target (0x%06x) : %d bytes.\n"
- "Maximum ECHO data requested from user input (-s) : %lu "
+ "Maximum ECHO data requested from user input (-s) : %" PRIu32 " "
"(default %d) bytes.\n",
FC_WKA_FABRIC_CONTROLLER, flen, sid, slen, fp_did, dlen,
- fp_len - FP_LEN_ECHO, FP_LEN_DEF);
+ (uint32_t)(fp_len - FP_LEN_ECHO), FP_LEN_DEF);
/* fp_len is the total payload, including 4 bytes for ECHO command */
fp_len = MIN(fp_len, plen + FP_LEN_ECHO);
- printf("Actual FC ELS ECHO data size used : %lu bytes.\n"
+ printf("Actual FC ELS ECHO data size used : %" PRIu32 " bytes.\n"
"Actual FC ELS ECHO payload size used : %d bytes "
- "(including %ld bytes ECHO command).\n",
- fp_len - FP_LEN_ECHO, fp_len, FP_LEN_ECHO);
+ "(including %zu bytes ECHO command).\n",
+ (uint32_t)(fp_len - FP_LEN_ECHO), fp_len, FP_LEN_ECHO);
}
/*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/fipvlan.c new/fcoe-utils-1.0.30/fipvlan.c
--- old/fcoe-utils-1.0.29/fipvlan.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/fipvlan.c 2015-04-15 20:38:46.000000000 +0200
@@ -67,6 +67,7 @@
bool start;
bool vn2vn;
bool debug;
+ bool link_up;
int link_retry;
char suffix[256];
} config = {
@@ -76,6 +77,7 @@
.create = false,
.vn2vn = false,
.debug = false,
+ .link_up = false,
.link_retry = 20,
.suffix = "",
};
@@ -139,6 +141,7 @@
bool req_sent;
bool resp_recv;
bool fip_ready;
+ bool fcoe_started;
TAILQ_ENTRY(iff) list_node;
struct iff_list_head vlans;
};
@@ -157,15 +160,18 @@
struct fcf_list_head fcfs = TAILQ_HEAD_INITIALIZER(fcfs);
static struct fcf_list_head vn2vns = TAILQ_HEAD_INITIALIZER(vn2vns);
+static int create_and_start_vlan(struct fcf *fcf, bool vn2vn);
+
static struct fcf *lookup_fcf(struct fcf_list_head *head, int ifindex,
uint16_t vlan, unsigned char *mac)
{
struct fcf *fcf;
TAILQ_FOREACH(fcf, head, list_node)
- if ((ifindex == fcf->ifindex) && (vlan == fcf->vlan) &&
- (memcmp(mac, fcf->mac_addr, ETHER_ADDR_LEN) == 0))
- return fcf;
+ if ((ifindex == fcf->ifindex) && (vlan == fcf->vlan)) {
+ if ((!mac) || (memcmp(mac, fcf->mac_addr, ETHER_ADDR_LEN) == 0))
+ return fcf;
+ }
return NULL;
}
@@ -316,6 +322,9 @@
fcf->vlan = vlan;
memcpy(fcf->mac_addr, tlvs.mac->mac_addr, ETHER_ADDR_LEN);
TAILQ_INSERT_TAIL(head, fcf, list_node);
+ if (!config.create)
+ continue;
+ create_and_start_vlan(fcf, vn2vn);
}
return 0;
@@ -362,8 +371,14 @@
struct rtattr *linkinfo[__IFLA_INFO_MAX];
struct rtattr *vlan[__IFLA_VLAN_MAX];
struct iff *iff, *real_dev;
+ struct fcf_list_head *head;
bool running;
+ if (config.vn2vn)
+ head = &vn2vns;
+ else
+ head = &fcfs;
+
FIP_LOG_DBG("RTM_NEWLINK: ifindex %d, type %d, flags %x",
ifm->ifi_index, ifm->ifi_type, ifm->ifi_flags);
@@ -378,12 +393,38 @@
running = !!(ifm->ifi_flags & (IFF_RUNNING | IFF_SLAVE));
iff = lookup_iff(ifm->ifi_index, NULL);
if (iff) {
+ int ifindex;
+
/* already tracking, update operstate and return */
iff->running = running;
- if (iff->running)
- pfd_add(iff->ps);
- else
+ if (!iff->running) {
pfd_remove(iff->ps);
+ return;
+ }
+ pfd_add(iff->ps);
+ if (!config.start)
+ return;
+
+ FIP_LOG_DBG("Checking for FCoE on %sif %d",
+ iff->is_vlan ? "VLAN " : "", iff->ifindex);
+ if (iff->is_vlan) {
+ real_dev = find_vlan_real_dev(iff);
+ if (!real_dev) {
+ FIP_LOG_ERR(ENODEV, "VLAN %d without a parent",
+ iff->ifindex);
+ return;
+ }
+ ifindex = real_dev->ifindex;
+ } else
+ ifindex = iff->ifindex;
+
+ if (!iff->fcoe_started &&
+ lookup_fcf(head, ifindex, iff->vid, NULL)) {
+ printf("Starting FCoE on interface %s\n",
+ iff->ifname);
+ fcoe_instance_start(iff->ifname);
+ iff->fcoe_started = true;
+ }
return;
}
@@ -416,11 +457,16 @@
parse_vlaninfo(vlan, linkinfo[IFLA_INFO_DATA]);
iff->vid = *(int *)RTA_DATA(vlan[IFLA_VLAN_ID]);
real_dev = find_vlan_real_dev(iff);
- if (real_dev)
- TAILQ_INSERT_TAIL(&real_dev->vlans,
- iff, list_node);
- else
+ if (!real_dev) {
free(iff);
+ return;
+ }
+ TAILQ_INSERT_TAIL(&real_dev->vlans, iff, list_node);
+ if (!iff->running) {
+ FIP_LOG_DBG("vlan if %d not running, "
+ "starting", iff->ifindex);
+ rtnl_set_iff_up(iff->ifindex, NULL);
+ }
return;
}
/* ignore bonding interfaces */
@@ -435,7 +481,7 @@
/* command line arguments */
-#define GETOPT_STR "acdf:l:m:shv"
+#define GETOPT_STR "acdf:l:m:suhv"
static const struct option long_options[] = {
{ "auto", no_argument, NULL, 'a' },
@@ -445,6 +491,7 @@
{ "suffix", required_argument, NULL, 'f' },
{ "link-retry", required_argument, NULL, 'l' },
{ "mode", required_argument, NULL, 'm' },
+ { "link-up", required_argument, NULL, 'u' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
@@ -462,6 +509,7 @@
" -f, --suffix Append the suffix to VLAN interface name\n"
" -l, --link-retry Number of retries for link up\n"
" -m, --mode Link mode, either fabric or vn2vn\n"
+ " -u, --link-up Leave link up after FIP response\n"
" -h, --help Display this help and exit\n"
" -v, --version Display version information and exit\n",
exe);
@@ -471,7 +519,7 @@
static void parse_cmdline(int argc, char **argv)
{
- char c;
+ signed char c;
while (1) {
c = getopt_long(argc, argv, GETOPT_STR, long_options, NULL);
@@ -508,6 +556,9 @@
exit(1);
}
break;
+ case 'u':
+ config.link_up = true;
+ break;
case 'h':
help(0);
break;
@@ -539,59 +590,61 @@
return -1;
}
-static void
-create_missing_vlans_list(struct fcf_list_head *list, const char *label)
+static int
+create_and_start_vlan(struct fcf *fcf, bool vn2vn)
{
- struct fcf *fcf;
struct iff *real_dev, *vlan;
char vlan_name[IFNAMSIZ];
int rc;
- if (!config.create)
- return;
-
- TAILQ_FOREACH(fcf, list, list_node) {
- real_dev = lookup_iff(fcf->ifindex, NULL);
- if (!real_dev) {
- FIP_LOG_ERR(ENODEV,
- "lost device %d with discovered %s?\n",
- fcf->ifindex, label);
- continue;
- }
- if (!fcf->vlan) {
- /*
- * If the vlan notification has VLAN id 0,
- * skip creating vlan interface, and FCoE is
- * started on the physical interface itself.
- */
- FIP_LOG_DBG("VLAN id is 0 for %s\n", real_dev->ifname);
- continue;
- }
+ real_dev = lookup_iff(fcf->ifindex, NULL);
+ if (!real_dev) {
+ FIP_LOG_ERR(ENODEV,
+ "lost device %d with discovered %s?\n",
+ fcf->ifindex, vn2vn ? "VN2VN" : "FCF");
+ return -ENXIO;
+ }
+ if (!fcf->vlan) {
+ /*
+ * If the vlan notification has VLAN id 0,
+ * skip creating vlan interface, and FCoE is
+ * started on the physical interface itself.
+ */
+ FIP_LOG_DBG("VLAN id is 0 for %s\n", real_dev->ifname);
+ vlan = real_dev;
+ } else {
vlan = lookup_vlan(fcf->ifindex, fcf->vlan);
if (vlan) {
FIP_LOG_DBG("VLAN %s.%d already exists as %s\n",
real_dev->ifname, fcf->vlan, vlan->ifname);
- continue;
+ rc = 0;
+ } else {
+ snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
+ real_dev->ifname, fcf->vlan, config.suffix);
+ rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
+ if (rc < 0)
+ printf("Failed to create VLAN device %s\n\t%s\n",
+ vlan_name, strerror(-rc));
+ else
+ printf("Created VLAN device %s\n", vlan_name);
+ return rc;
}
- snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
- real_dev->ifname, fcf->vlan, config.suffix);
- rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
- if (rc < 0)
- printf("Failed to create VLAN device %s\n\t%s\n",
- vlan_name, strerror(-rc));
- else
- printf("Created VLAN device %s\n", vlan_name);
- rtnl_set_iff_up(0, vlan_name);
}
- printf("\n");
-}
+ if (!config.start)
+ return rc;
-static void create_missing_vlans(void)
-{
- if (!TAILQ_EMPTY(&fcfs))
- create_missing_vlans_list(&fcfs, "FCF");
- if (!TAILQ_EMPTY(&vn2vns))
- create_missing_vlans_list(&vn2vns, "VN2VN");
+ if (!vlan->running) {
+ FIP_LOG_DBG("%s if %d not running, starting",
+ vlan == real_dev ? "real" : "vlan",
+ vlan->ifindex);
+ rtnl_set_iff_up(vlan->ifindex, NULL);
+ } else if (!vlan->fcoe_started) {
+ printf("Starting FCoE on interface %s\n",
+ vlan->ifname);
+ fcoe_instance_start(vlan->ifname);
+ vlan->fcoe_started = true;
+ }
+ return rc;
}
static int fcoe_mod_instance_start(const char *ifname)
@@ -666,34 +719,6 @@
}
}
-static void start_fcoe(void)
-{
- struct fcf_list_head *head;
- struct fcf *fcf;
- struct iff *iff;
-
- if (config.vn2vn)
- head = &vn2vns;
- else
- head = &fcfs;
-
- TAILQ_FOREACH(fcf, head, list_node) {
- if (fcf->vlan)
- iff = lookup_vlan(fcf->ifindex, fcf->vlan);
- else
- iff = lookup_iff(fcf->ifindex, NULL);
- if (!iff) {
- FIP_LOG_ERR(ENODEV,
- "Cannot start FCoE on VLAN %d, ifindex %d, "
- "because the VLAN device does not exist",
- fcf->vlan, fcf->ifindex);
- continue;
- }
- printf("Starting FCoE on interface %s\n", iff->ifname);
- fcoe_instance_start(iff->ifname);
- }
-}
-
static void print_list(struct fcf_list_head *list, const char *label)
{
struct iff *iff;
@@ -749,9 +774,15 @@
rtnl_recv(pfd[0].fd, rtnl_listener_handler, NULL);
/* everything else should be FIP packet sockets */
for (i = 1; i < pfd_len; i++) {
- if (pfd[i].revents & POLLIN)
- fip_recv(pfd[i].fd, fip_vlan_handler, NULL);
+ if (pfd[i].revents & POLLIN) {
+ rc = fip_recv(pfd[i].fd, fip_vlan_handler,
+ NULL);
+ if (rc < 0)
+ break;
+ }
}
+ if (i < pfd_len)
+ break;
}
}
@@ -763,7 +794,7 @@
static int probe_fip_interface(struct iff *iff)
{
- int origdev = 1;
+ int origdev = 1, rc;
if (iff->resp_recv)
return 0;
@@ -785,6 +816,10 @@
if (!iff->fip_ready) {
iff->ps = fip_socket(iff->ifindex, FIP_NONE);
+ if (iff->ps < 0) {
+ FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
+ return 0;
+ }
setsockopt(iff->ps, SOL_PACKET, PACKET_ORIGDEV,
&origdev, sizeof(origdev));
pfd_add(iff->ps);
@@ -792,20 +827,21 @@
}
if (config.vn2vn)
- fip_send_vlan_request(iff->ps, iff->ifindex, iff->mac_addr,
- FIP_ALL_VN2VN);
+ rc = fip_send_vlan_request(iff->ps, iff->ifindex,
+ iff->mac_addr, FIP_ALL_VN2VN);
else
- fip_send_vlan_request(iff->ps, iff->ifindex, iff->mac_addr,
- FIP_ALL_FCF);
- iff->req_sent = true;
- return 0;
+ rc = fip_send_vlan_request(iff->ps, iff->ifindex,
+ iff->mac_addr, FIP_ALL_FCF);
+ if (rc == 0)
+ iff->req_sent = true;
+ return rc == 0 ? 0 : 1;
}
static int send_vlan_requests(void)
{
struct iff *iff;
- int i;
int skipped = 0;
+ int i;
if (config.automode) {
TAILQ_FOREACH(iff, &interfaces, list_node) {
@@ -829,51 +865,70 @@
struct iff *iff;
int retry_count = 0;
int skip_retry_count = 0;
- int skipped = 0;
+ int skipped = 0, retry_iff = 0;
retry:
skipped += send_vlan_requests();
if (skipped && skip_retry_count++ < config.link_retry) {
- FIP_LOG_DBG("waiting for IFF_RUNNING [%d]\n", skip_retry_count);
+ FIP_LOG_DBG("waiting for IFF_RUNNING [%d/%d]\n",
+ skip_retry_count, config.link_retry);
recv_loop(500);
skipped = 0;
retry_count = 0;
goto retry;
}
recv_loop(200);
- TAILQ_FOREACH(iff, &interfaces, list_node)
+ TAILQ_FOREACH(iff, &interfaces, list_node) {
+ if (!iff->fip_ready) {
+ FIP_LOG_DBG("if %d: skipping, FIP not ready\n",
+ iff->ifindex);
+ continue;
+ }
+ if (!iff->running && iff->linkup_sent) {
+ FIP_LOG_DBG("if %d: waiting for IFF_RUNNING [%d]\n",
+ iff->ifindex, retry_count);
+ retry_iff++;
+ continue;
+ }
/* if we did not receive a response, retry */
- if (iff->req_sent && !iff->resp_recv &&
- retry_count++ < MAX_VLAN_RETRIES) {
- FIP_LOG_DBG("VLAN discovery RETRY [%d]", retry_count);
- goto retry;
+ if (iff->req_sent && !iff->resp_recv) {
+ FIP_LOG_DBG("if %d: VLAN discovery RETRY [%d]",
+ iff->ifindex, retry_count);
+ iff->req_sent = false;
+ retry_iff++;
+ continue;
+ }
+ if (config.create) {
+ struct iff *vlan;
+
+ TAILQ_FOREACH(vlan, &iff->vlans, list_node) {
+ if (!vlan->running) {
+ FIP_LOG_DBG("vlan %d: waiting for "
+ "IFF_RUNNING [%d]",
+ vlan->ifindex, retry_count);
+ retry_iff++;
+ continue;
+ }
+ }
}
+ }
+ if (retry_iff && retry_count++ < config.link_retry) {
+ recv_loop(1000);
+ retry_iff = 0;
+ goto retry;
+ }
}
static void cleanup_interfaces(void)
{
struct iff *iff;
- int i;
- int skipped = 0;
- if (config.automode) {
- TAILQ_FOREACH(iff, &interfaces, list_node) {
- if (iff->linkup_sent &&
- (!iff->running || !iff->req_sent || !iff->resp_recv)) {
- FIP_LOG_DBG("shutdown if %d",
- iff->ifindex);
- rtnl_set_iff_down(iff->ifindex, NULL);
- iff->linkup_sent = false;
- }
- }
- } else {
- for (i = 0; i < config.namec; i++) {
- iff = lookup_iff(0, config.namev[i]);
- if (!iff) {
- skipped++;
+ TAILQ_FOREACH(iff, &interfaces, list_node) {
+ if (iff->linkup_sent) {
+ if (config.link_up && iff->resp_recv)
continue;
- }
- if (iff->linkup_sent &&
- (!iff->running || !iff->req_sent || !iff->resp_recv)) {
+ if (iff->fcoe_started)
+ continue;
+ if (TAILQ_EMPTY(&iff->vlans)) {
FIP_LOG_DBG("shutdown if %d",
iff->ifindex);
rtnl_set_iff_down(iff->ifindex, NULL);
@@ -881,8 +936,8 @@
}
}
}
-
}
+
/* this is to not require headers from libcap */
static inline int capget(cap_user_header_t hdrp, cap_user_data_t datap)
{
@@ -934,29 +989,24 @@
determine_libfcoe_interface();
find_interfaces(ns);
- while ((TAILQ_EMPTY(&interfaces)) && ++find_cnt < 5) {
- FIP_LOG_DBG("no interfaces found, trying again");
- find_interfaces(ns);
- }
+ if (config.automode)
+ while ((TAILQ_EMPTY(&interfaces)) && ++find_cnt < 5) {
+ FIP_LOG_DBG("no interfaces found, trying again");
+ find_interfaces(ns);
+ }
if (TAILQ_EMPTY(&interfaces)) {
- FIP_LOG_ERR(ENODEV, "no interfaces to perform discovery on");
+ if (config.automode)
+ FIP_LOG_ERR(ENODEV,
+ "no interfaces to perform discovery on");
+ else
+ FIP_LOG("no interfaces to perform discovery on");
exit(1);
}
do_vlan_discovery();
rc = print_results();
- if (!rc && config.create) {
- create_missing_vlans();
- /*
- * need to listen for the RTM_NETLINK messages
- * about the new VLAN devices
- */
- recv_loop(500);
- }
- if (!rc && config.start)
- start_fcoe();
cleanup_interfaces();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcoe-utils-1.0.29/lib/fip.c new/fcoe-utils-1.0.30/lib/fip.c
--- old/fcoe-utils-1.0.29/lib/fip.c 2013-10-09 15:39:48.000000000 +0200
+++ new/fcoe-utils-1.0.30/lib/fip.c 2015-04-15 20:38:46.000000000 +0200
@@ -95,10 +95,11 @@
* @mac: MAC address to add or delete
* @multi: false if unicast, true if multicast address
*/
-static void
+static int
fip_socket_add_addr(int s, int ifindex, bool add, const __u8 *mac, bool multi)
{
struct packet_mreq mr;
+ int rc = 0;
memset(&mr, 0, sizeof(mr));
mr.mr_ifindex = ifindex;
@@ -107,9 +108,12 @@
memcpy(mr.mr_address, mac, ETHER_ADDR_LEN);
if (setsockopt(s, SOL_PACKET,
add ? PACKET_ADD_MEMBERSHIP : PACKET_DROP_MEMBERSHIP,
- &mr, sizeof(mr)) < 0)
+ &mr, sizeof(mr)) < 0) {
FIP_LOG_DBG("PACKET_%s_MEMBERSHIP:failed\n",
add ? "ADD" : "DROP");
+ rc = -errno;
+ }
+ return rc;
}
/**
@@ -118,16 +122,16 @@
* @ifindex: network interface index to send on
* @add: 1 to add 0 to del
*/
-static void fip_socket_sanmac(int s, int ifindex, int add)
+static int fip_socket_sanmac(int s, int ifindex, int add)
{
unsigned char smac[ETHER_ADDR_LEN];
if (fip_get_sanmac(ifindex, smac)) {
FIP_LOG_DBG("%s: no sanmac, ifindex %d\n", __func__, ifindex);
- return;
+ return -ENXIO;
}
- fip_socket_add_addr(s, ifindex, add, smac, false);
+ return fip_socket_add_addr(s, ifindex, add, smac, false);
}
/**
@@ -210,7 +214,11 @@
if (s < 0)
return s;
- fip_socket_sanmac(s, ifindex, 1);
+ rc = fip_socket_sanmac(s, ifindex, 1);
+ if (rc < 0) {
+ close(s);
+ return rc;
+ }
if (multi != FIP_NONE)
fip_socket_multi(s, ifindex, true, multi);