Accepting request 455786 from network:fcoe

- Update to latest upstream release (FATE#320515) 
     Remove the following upstreamed patches:
	0007-fipvlan-clean-up-state-machine-for-pfd_add.patch
	0009-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch
	0010-fcoemon-fixup-log_nlmsg_error.patch
	0011-fcoemon-Add-debugging-message-for-recv.patch
	0013-Fallback-to-default-MAC-address-for-FIP.patch

OBS-URL: https://build.opensuse.org/request/show/455786
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fcoe-utils?expand=0&rev=12
This commit is contained in:
2017-02-13 23:36:41 +00:00
committed by Git OBS Bridge
10 changed files with 32 additions and 319 deletions

View File

@@ -1,67 +0,0 @@
From 53a1a696c33fc64c76bd29831ed61c8e50fbc495 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 14 May 2014 16:01:10 +0200
Subject: fipvlan: clean up state machine for pfd_add
pfd_add just adds the fd to the internal list without any checking.
So use the 'fip_ready' flag to track this.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
fipvlan.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/fipvlan.c b/fipvlan.c
index 9f3b07d..a183233 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -398,10 +398,17 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
/* already tracking, update operstate and return */
iff->running = running;
if (!iff->running) {
- pfd_remove(iff->ps);
+ if (iff->fip_ready) {
+ pfd_remove(iff->ps);
+ iff->fip_ready = false;
+ }
return;
}
- pfd_add(iff->ps);
+ if (iff->ps >= 0 && !iff->fip_ready) {
+ pfd_add(iff->ps);
+ iff->fip_ready = true;
+ }
+
if (!config.start)
return;
@@ -441,6 +448,7 @@ static void rtnl_recv_newlink(struct nlmsghdr *nh)
iff->ifindex = ifm->ifi_index;
iff->running = running;
iff->fip_ready = false;
+ iff->ps = -1;
if (ifla[IFLA_LINK])
iff->iflink = *(int *)RTA_DATA(ifla[IFLA_LINK]);
else
@@ -814,7 +822,8 @@ static int probe_fip_interface(struct iff *iff)
if (iff->req_sent)
return 0;
- if (!iff->fip_ready) {
+ if (iff->ps < 0) {
+ iff->fip_ready = false;
iff->ps = fip_socket(iff->ifindex, FIP_NONE);
if (iff->ps < 0) {
FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
@@ -822,6 +831,8 @@ static int probe_fip_interface(struct iff *iff)
}
setsockopt(iff->ps, SOL_PACKET, PACKET_ORIGDEV,
&origdev, sizeof(origdev));
+ }
+ if (!iff->fip_ready) {
pfd_add(iff->ps);
iff->fip_ready = true;
}
--
1.8.4.5

View File

@@ -1,75 +0,0 @@
From 0b4e0a99af9e0103c7b25cc3c7997c18bdc46bf4 Mon Sep 17 00:00:00 2001
From: "Milan P. Gandhi" <mgandhi@redhat.com>
Date: Mon, 28 Mar 2016 12:52:12 +0000
Subject: fcoemon.c: Add a check to verify if dcbd is to be initialized, else
do not try to connect to dcbd/lldpad
Some of the FCoE capable adapters e.g. BCM57810 network interfaces
has DCBX/LLDP client on-chip, and kernel documentation recommends
to keep software based DCBX/LLDP clients (e.g. lldpad) disabled.
https://www.kernel.org/doc/Documentation/scsi/bnx2fc.txt
It was found that, if lldpad is disabled while using above interfaces,
then fcoemon shows following errors every 10 seconds:
fcoemon: error 111 Connection refused
fcoemon: Failed to connect to lldpad
Below patch checks each interface configuration in /etc/fcoe/cfg-ethX
file to verify if there is at least 1 interface with DCB_REQUIRED flag
set to yes and will try to initialize dcbd only if there is at least 1
interface with DCB_REQUIRED="yes", else fcoemon will not try to
initialize dcbd or connect to lldpad, thus eliminating above errors:
X-Git-commit: 0231b0c71464af17a0cf392e55174c97a5986640
Signed-off-by: Milan P. Gandhi <mgandhi@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
---
fcoemon.c | 7 ++++++-
fcoemon.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/fcoemon.c b/fcoemon.c
index b5f4d71..6fe50a2 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -557,6 +557,9 @@ static int fcm_read_config_files(void)
if (!strncasecmp(val, "yes", 3) && rc == 1)
next->dcb_required = 1;
+ if (next->dcb_required == 1 && fcoe_config.dcb_init == 0)
+ fcoe_config.dcb_init = 1;
+
/* AUTO_VLAN */
rc = fcm_read_config_variable(file, val, sizeof(val),
fp, CFG_IF_VAR_AUTOVLAN);
@@ -3774,7 +3777,9 @@ int main(int argc, char **argv)
if (rc != 0)
goto err_cleanup;
- fcm_dcbd_init();
+ if (fcoe_config.dcb_init)
+ fcm_dcbd_init();
+
rc = fcm_srv_create(&srv_info);
if (rc != 0)
goto err_cleanup;
diff --git a/fcoemon.h b/fcoemon.h
index 3869bae..0e0e6a2 100644
--- a/fcoemon.h
+++ b/fcoemon.h
@@ -25,6 +25,7 @@
struct fcoe_config {
int debug;
int use_syslog;
+ int dcb_init;
struct fcoe_port *port;
} fcoe_config;
--
2.6.6

View File

@@ -1,28 +0,0 @@
From 7eb80f89a3f4a2d4697b2879b6c6a87618b8aa8b Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 28 Jun 2016 13:46:03 +0200
Subject: fcoemon: fixup log_nlmsg_error()
The error message is in the data, no the next message.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
fcoemon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fcoemon.c b/fcoemon.c
index 6fe50a2..1f95c95 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -755,7 +755,7 @@ static void log_nlmsg_error(struct nlmsghdr *hp, size_t rlen, const char *str)
struct nlmsgerr *ep;
if (NLMSG_OK(hp, rlen)) {
- ep = (struct nlmsgerr *)NLMSG_NEXT(hp, rlen);
+ ep = (struct nlmsgerr *)NLMSG_DATA(hp);
FCM_LOG_DBG("%s, err=%d, type=%d\n",
str, ep->error, ep->msg.nlmsg_type);
} else {
--
2.6.6

View File

@@ -1,28 +0,0 @@
From b470ddf5122c38d6b9e878ca1c9f33c101896931 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 28 Jun 2016 13:47:16 +0200
Subject: fcoemon: Add debugging message for 'recv'
We already have a debugging message for 'send', so add the
corresponding 'recv' debugging message, too.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
fcoemon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fcoemon.c b/fcoemon.c
index 1f95c95..58137df 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -2204,6 +2204,7 @@ static void fcm_dcbd_rx(void *arg)
len = strlen(buf);
ASSERT(len <= rc);
+ FCM_LOG_DBG("recv '%s', len=%d bytes succeeded", buf, (int)len);
switch (buf[CLIF_RSP_MSG_OFF]) {
case CMD_RESPONSE:
st = fcm_get_hex(buf + CLIF_STAT_OFF, CLIF_STAT_LEN,
--
2.6.6

View File

@@ -1,106 +0,0 @@
From f36193036751f88c6208e7f0feda36116978a1af Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 30 Jun 2016 07:48:38 +0200
Subject: Fallback to default MAC address for FIP
FIP is a normal ethernet protocol, and doesn't rely on DCB to
be active or supported. So we should default to the NIC MAC
if no SAN MAC is present.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
fcoemon.c | 4 ++--
fipvlan.c | 2 +-
include/fip.h | 2 +-
lib/fip.c | 8 ++++----
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index 32ba30c..1df3d82 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1057,7 +1057,7 @@ static int fcm_vlan_disc_socket(struct fcoe_port *p)
int fd;
int origdev = 1;
- fd = fip_socket(p->ifindex, FIP_NONE);
+ fd = fip_socket(p->ifindex, p->mac, FIP_NONE);
if (fd < 0) {
FCM_LOG_ERR(errno, "socket error");
return fd;
@@ -1496,7 +1496,7 @@ static void init_fip_vn2vn_responder(struct fcoe_port *p)
if (p->fip_responder_socket >= 0)
return;
- s = fip_socket(p->ifindex, FIP_ALL_VN2VN);
+ s = fip_socket(p->ifindex, p->mac, FIP_ALL_VN2VN);
if (s < 0) {
FCM_LOG_ERR(errno, "%s: Failed to get fip socket\n", p->ifname);
return;
diff --git a/fipvlan.c b/fipvlan.c
index 4acf3d1..3662885 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -824,7 +824,7 @@ static int probe_fip_interface(struct iff *iff)
if (iff->ps < 0) {
iff->fip_ready = false;
- iff->ps = fip_socket(iff->ifindex, FIP_NONE);
+ iff->ps = fip_socket(iff->ifindex, iff->mac_addr, FIP_NONE);
if (iff->ps < 0) {
FIP_LOG_DBG("if %d not ready\n", iff->ifindex);
return 0;
diff --git a/include/fip.h b/include/fip.h
index 443d3c4..0b6385c 100644
--- a/include/fip.h
+++ b/include/fip.h
@@ -144,7 +144,7 @@ struct fip_tlv_vlan {
/* libutil / fip.c functionality */
-int fip_socket(int ifindex, enum fip_multi multi);
+int fip_socket(int ifindex, unsigned char *mac, enum fip_multi multi);
/* FIP message handler, passed into fip_recv */
typedef int fip_handler(struct fiphdr *fh, struct sockaddr_ll *sa, void *arg);
diff --git a/lib/fip.c b/lib/fip.c
index 6657b61..b7f687b 100644
--- a/lib/fip.c
+++ b/lib/fip.c
@@ -122,13 +122,13 @@ fip_socket_add_addr(int s, int ifindex, bool add, const __u8 *mac, bool multi)
* @ifindex: network interface index to send on
* @add: 1 to add 0 to del
*/
-static int fip_socket_sanmac(int s, int ifindex, int add)
+static int fip_socket_sanmac(int s, int ifindex, unsigned char *mac, 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 -ENXIO;
+ memcpy(smac, mac, ETHER_ADDR_LEN);
}
return fip_socket_add_addr(s, ifindex, add, smac, false);
@@ -200,7 +200,7 @@ static void drain_socket(int s)
* @ifindex: ifindex of netdevice to bind to
* @multi: Indication of any multicast address to bind to
*/
-int fip_socket(int ifindex, enum fip_multi multi)
+int fip_socket(int ifindex, unsigned char *mac, enum fip_multi multi)
{
struct sockaddr_ll sa = {
.sll_family = AF_PACKET,
@@ -214,7 +214,7 @@ int fip_socket(int ifindex, enum fip_multi multi)
if (s < 0)
return s;
- rc = fip_socket_sanmac(s, ifindex, 1);
+ rc = fip_socket_sanmac(s, ifindex, mac, 1);
if (rc < 0) {
close(s);
return rc;
--
2.6.6

17
_service Normal file
View File

@@ -0,0 +1,17 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/morbidrsa/fcoe-utils.git</param>
<param name="scm">git</param>
<param name="filename">fcoe-utils</param>
<param name="versionformat">1.0.32</param>
<param name="revision">v1.0.32</param>
<param name="exclude">.git</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">fcoe-utils</param>
</service>
</services>

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23afe113e3ea29b1cb0344153c6e8dd64965b9be27c9b770462734b1e8a98df6
size 123316

3
fcoe-utils-1.0.32.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7d04e4ae49ecaab9971c84de0cfa4d427110f3ecad0a0ceda2a663bbd7577079
size 121536

View File

@@ -1,4 +1,14 @@
-------------------------------------------------------------------
Thu Feb 9 08:54:54 UTC 2017 - jthumshirn@suse.com
- Update to latest upstream release (FATE#320515)
Remove the following upstreamed patches:
0007-fipvlan-clean-up-state-machine-for-pfd_add.patch
0009-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch
0010-fcoemon-fixup-log_nlmsg_error.patch
0011-fcoemon-Add-debugging-message-for-recv.patch
0013-Fallback-to-default-MAC-address-for-FIP.patch
-------------------------------------------------------------------
Thu Jul 14 10:08:53 CEST 2016 - hare@suse.de
- fcoemon cannot start FIP responder (bsc#988887)

View File

@@ -1,7 +1,7 @@
#
# spec file for package fcoe-utils
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -29,7 +29,7 @@ Requires: device-mapper
Requires: iproute
Requires: open-lldp
%systemd_requires
Version: 1.0.31
Version: 1.0.32
Release: 0
Summary: FCoE userspace management tools
License: GPL-2.0
@@ -42,13 +42,8 @@ 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
Patch9: 0009-fcoemon.c-Add-a-check-to-verify-if-dcbd-is-to-be-ini.patch
Patch10: 0010-fcoemon-fixup-log_nlmsg_error.patch
Patch11: 0011-fcoemon-Add-debugging-message-for-recv.patch
Patch12: 0012-fcoemon-Retry-fcm_link_getlink-on-EBUSY.patch
Patch13: 0013-Fallback-to-default-MAC-address-for-FIP.patch
# Patches from Fedora
Patch101: fcoe-utils-1.0.29-make.patch
@@ -65,13 +60,8 @@ connections.
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch101 -p1
%build