This is equivalent fix of 12637e4eeb51ed273e337e42c22f6ac6721dfc20 in fipvlan.

Some switch implementations (eg., HP virtual connect FlexFabric) can send a
vlan notification with vid 0, which is an indication that the switch will send
the packets on the physical interface itself, without any tag. Also, it is
expected that the priority information is delivered directly via outer vlan
tag.  Create fcoe on the physical interface when vlan notification has vid 0.
This change should help the CNAs that support this special switch. This should
not affect the functionality of software stack, as vlan notification with vid 0
is not expected to be received from the regular FCFs.

Signed-off-by: Bhanu Prakash Gollapudi <bprak...@broadcom.com>
---
 fipvlan.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/fipvlan.c b/fipvlan.c
index 0db2a8e..592cd51 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -521,6 +521,15 @@ void create_missing_vlans()
                                    fcf->ifindex);
                        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;
+               }
                vlan = lookup_vlan(fcf->ifindex, fcf->vlan);
                if (vlan) {
                        FIP_LOG_DBG("VLAN %s.%d already exists as %s",
@@ -562,7 +571,10 @@ void start_fcoe()
        struct iff *iff;
 
        TAILQ_FOREACH(fcf, &fcfs, list_node) {
-               iff = lookup_vlan(fcf->ifindex, fcf->vlan);
+               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, "
-- 
1.7.9.5


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

Reply via email to