Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to add member to lag after deleting it from vlan #743

Open
leoli-nps opened this issue Jan 10, 2019 · 2 comments
Open

Failed to add member to lag after deleting it from vlan #743

leoli-nps opened this issue Jan 10, 2019 · 2 comments

Comments

@leoli-nps
Copy link
Contributor

<1> Show information before deleting member from vlan and add it to lag

admin@SWITCH101:~$ show vlan brief
+-----------+--------------+---------+----------------+-----------------------+
| VLAN ID   | IP Address   | Ports   | Port Tagging   | DHCP Helper Address   |
+===========+==============+=========+================+=======================+
+-----------+--------------+---------+----------------+-----------------------+
admin@SWITCH101:~$ show vlan config
Name    VID    Member    Mode
------  -----  --------  ------
admin@SWITCH101:~$show interfaces portchannel
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available, S - selected, D - deselected
No.    Team Dev    Protocol    Ports
-----  ----------  ----------  -------
admin@SWITCH101:~$sudo bridge vlan show dev Ethernet80
port    vlan ids
admin@SWITCH101:~$ ip link show Ethernet80
27: Ethernet80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 6c:ec:5a:08:18:67 brd ff:ff:ff:ff:ff:ff
admin@SWITCH101:~$

<2> Create vlan100

admin@SWITCH101:~$ sudo config vlan add 100
admin@SWITCH101:~$
admin@SWITCH101:~$ show vlan brief
+-----------+--------------+---------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports   | Port Tagging   | DHCP Helper Address   |
+===========+==============+=========+================+=======================+
|       100 |              |         |                |                       |
+-----------+--------------+---------+----------------+-----------------------+
admin@SWITCH101:~$ show vlan config
Name    VID    Member    Mode
------  -----  --------  ------
admin@SWITCH101:~$

<3> Add Ethernet80 to vlan100

admin@SWITCH101:~$ sudo config vlan member add 100 Ethernet80 -u
admin@SWITCH101:~$
admin@SWITCH101:~$ show vlan brief
+-----------+--------------+------------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports      | Port Tagging   | DHCP Helper Address   |
+===========+==============+============+================+=======================+
|       100 |              | Ethernet80 | untagged       |                       |
+-----------+--------------+------------+----------------+-----------------------+
admin@SWITCH101:~$ show vlan config
Name       VID  Member      Mode
-------  -----  ----------  --------
Vlan100    100  Ethernet80  untagged
admin@SWITCH101:~$ sudo bridge vlan show dev Ethernet80
port    vlan ids
Ethernet80       1 Egress Untagged
         100 PVID Egress Untagged

admin@SWITCH101:~$ ip link show Ethernet80
27: Ethernet80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc pfifo_fast master Bridge state UP mode DEFAULT group default qlen 1000
    link/ether 6c:ec:5a:08:18:67 brd ff:ff:ff:ff:ff:ff
admin@SWITCH101:~$

<4> Delete Ethernet80 from vlan100

admin@SWITCH101:~$ sudo config vlan member del 100 Ethernet80
admin@SWITCH101:~$
admin@SWITCH101:~$ show vlan brief
+-----------+--------------+---------+----------------+-----------------------+
|   VLAN ID | IP Address   | Ports   | Port Tagging   | DHCP Helper Address   |
+===========+==============+=========+================+=======================+
|       100 |              |         |                |                       |
+-----------+--------------+---------+----------------+-----------------------+
admin@SWITCH101:~$ show vlan config
Name    VID    Member    Mode
------  -----  --------  ------
admin@SWITCH101:~$ sudo bridge vlan show dev Ethernet80
port    vlan ids
Ethernet80       1 Egress Untagged

admin@SWITCH101:~$ ip link show Ethernet80
27: Ethernet80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9100 qdisc pfifo_fast master Bridge state UP mode DEFAULT group default qlen 1000
    link/ether 6c:ec:5a:08:18:67 brd ff:ff:ff:ff:ff:ff
admin@SWITCH101:~$

<5>Create PortChannel0001

admin@SWITCH101:~$ sudo config portchannel add PortChannel0001
admin@SWITCH101:~$
admin@SWITCH101:~$ show interfaces portchannel
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available, S - selected, D - deselected
  No.  Team Dev         Protocol     Ports
-----  ---------------  -----------  -------
 0001  PortChannel0001  LACP(A)(Dw)  N/A
admin@SWITCH101:~$

<6> Add Ethernet80 to PortChannel0001

admin@SWITCH101:~$ sudo config portchannel member add PortChannel0001 Ethernet80
admin@SWITCH101:~$
admin@SWITCH101:~$ show interfaces portchannel
Flags: A - active, I - inactive, Up - up, Dw - Down, N/A - not available, S - selected, D - deselected
  No.  Team Dev         Protocol     Ports
-----  ---------------  -----------  -------
 0001  PortChannel0001  LACP(A)(Dw)  N/A
admin@SWITCH101:~$
admin@SWITCH101:~$ redis-cli -n 4
127.0.0.1:6379[4]> keys *PORTCH*
1) "PORTCHANNEL|PortChannel0001"
2) "PORTCHANNEL_MEMBER|PortChannel0001|Ethernet80"
127.0.0.1:6379[4]> keys *PORTCHANNEL*
1) "PORTCHANNEL|PortChannel0001"
2) "PORTCHANNEL_MEMBER|PortChannel0001|Ethernet80"
127.0.0.1:6379[4]> HGETALL "PORTCHANNEL|PortChannel0001"
1) "admin_status"
2) "up"
3) "mtu"
4) "9100"
127.0.0.1:6379[4]> HGETALL "PORTCHANNEL_MEMBER|PortChannel0001|Ethernet80"
1) "NULL"
2) "NULL"
127.0.0.1:6379[4]>

<7> sonic version

admin@SWITCH101:~$ show version
SONiC Software Version: SONiC.201811.0-dirty-20181212.000146
Distribution: Debian 9.6
Kernel: 4.9.0-7-amd64
Build commit: befee1a
Build date: Wed Dec 12 10:16:47 UTC 2018
Built by: tyler@nps65

Docker images:
REPOSITORY                 TAG                              IMAGE ID            SIZE
docker-syncd-nephos        201811.0-dirty-20181212.000146   a5f7237f4ebd        304.3 MB
docker-syncd-nephos        latest                           a5f7237f4ebd        304.3 MB
docker-orchagent-nephos    201811.0-dirty-20181212.000146   4c92b12973c4        287.6 MB
docker-orchagent-nephos    latest                           4c92b12973c4        287.6 MB
docker-teamd               201811.0-dirty-20181212.000146   0c25062e0e7f        275.9 MB
docker-teamd               latest                           0c25062e0e7f        275.9 MB
docker-lldp-sv2            201811.0-dirty-20181212.000146   6560e0ee4ec1        275.8 MB
docker-lldp-sv2            latest                           6560e0ee4ec1        275.8 MB
docker-dhcp-relay          201811.0-dirty-20181212.000146   e720e22ea152        258 MB
docker-dhcp-relay          latest                           e720e22ea152        258 MB
docker-database            201811.0-dirty-20181212.000146   196d28732b57        256.6 MB
docker-database            latest                           196d28732b57        256.6 MB
docker-snmp-sv2            201811.0-dirty-20181212.000146   e0c8c73370e5        295.5 MB
docker-snmp-sv2            latest                           e0c8c73370e5        295.5 MB
docker-router-advertiser   201811.0-dirty-20181212.000146   86852a37e96d        254.3 MB
docker-router-advertiser   latest                           86852a37e96d        254.3 MB
docker-platform-monitor    201811.0-dirty-20181212.000146   ca94daeddd21        288.3 MB
docker-platform-monitor    latest                           ca94daeddd21        288.3 MB
docker-fpm-frr             201811.0-dirty-20181212.000146   9fa2269fcf07        282.7 MB
docker-fpm-frr             latest                           9fa2269fcf07        282.7 MB

admin@SWITCH101:~$

As you can see from step 4, when Ethernet80 is deleted from vlan100, its "master bridge" flag still exists. In teammgr, when add member to lag, it will judge whether the member is enslaved; if enslaved is True, it will return directly, and will not perform the operation of adding to lag. I think this is probably the reason for the failure to add member to lag, for reference.

@vemulabalaji
Copy link

Just to update, I observed a different issue on detaching a port from VLAN.
On detaching a port from VLAN, port status getting changed to Down.

@dawnbeauty
Copy link

dawnbeauty commented Apr 9, 2019

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this issue Feb 28, 2022
* [portstat] fix header used

Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>

* [portstat] fix print table_as_json

Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>

* Fix tx_ovr field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants