From: Hannes Reinecke <h...@suse.de>

It doesn't really make any sense to ignore inactive
devices; the user has already specified which interfaces
fipvlan should test.
So instead we should be activating the interfaces before
sending any FIP request. If nothing has been received
we can always tear down the interface afterwards.

Signed-off-by: Hannes Reinecke <h...@suse.de>
Signed-off-by: Robert Love <robert.w.l...@intel.com>
---
 fipvlan.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/fipvlan.c b/fipvlan.c
index ecb89b3..87fe949 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -123,6 +123,7 @@ struct iff {
        bool running;
        bool is_vlan;
        short int vid;
+       bool linkup_sent;
        bool req_sent;
        bool resp_recv;
        TAILQ_ENTRY(iff) list_node;
@@ -610,6 +611,17 @@ int send_vlan_requests(void)
                        if (iff->resp_recv)
                                continue;
                        if (!iff->running) {
+                               if (iff->linkup_sent) {
+                                       FIP_LOG_DBG("if %d not running, "
+                                                   "waiting for link up",
+                                                   iff->ifindex);
+                               } else {
+                                       FIP_LOG_DBG("if %d not running, "
+                                                   "starting",
+                                                   iff->ifindex);
+                                       rtnl_set_iff_up(iff->ifindex, NULL);
+                                       iff->linkup_sent = true;
+                               }
                                skipped++;
                                iff->req_sent = false;
                                continue;
@@ -632,6 +644,17 @@ int send_vlan_requests(void)
                        if (iff->resp_recv)
                                continue;
                        if (!iff->running) {
+                               if (iff->linkup_sent) {
+                                       FIP_LOG_DBG("if %d not running, "
+                                                   "waiting for link up",
+                                                   iff->ifindex);
+                               } else {
+                                       FIP_LOG_DBG("if %d not running, "
+                                                   "starting",
+                                                   iff->ifindex);
+                                       rtnl_set_iff_up(iff->ifindex, NULL);
+                                       iff->linkup_sent = true;
+                               }
                                skipped++;
                                iff->req_sent = false;
                                continue;

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

Reply via email to