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

[chassis][multi-asic]Fix show acl table for masic #2937

Merged

Conversation

arlakshm
Copy link
Contributor

@arlakshm arlakshm commented Aug 2, 2023

What I did

Fixes sonic-net/sonic-buildimage#16012
The show acl table command currently get the ports from host config_db on multi asic platforms.
This host config_db will not the phyiscal ports in the binding ports because the host doesnt have any front panel ports on the host. This causes the show acl table not to display the phyiscal ports in the output on multi asic devices/linecards.

The test iface_namingmode/test_iface_namingmode.py::test_show_acl_table fails because of this issue.

Details from the test failure

iface_namingmode/test_iface_namingmode.py::test_show_acl_table[alias-sonic-lc1-1] 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /var/src/sonic-mgmt-int/tests/iface_namingmode/test_iface_namingmode.py(818)test_show_acl_table()
-> for item in minigraph_acls['DataAcl']:
(Pdb) list 
813  
814         acl_table = dutHostGuest.shell('SONIC_CLI_IFACE_MODE={} show acl table DATAACL'.format(ifmode))['stdout']
815         logger.info('acl_table:\n{}'.format(acl_table))
816  
817         import pdb;pdb.set_trace()
818  ->     for item in minigraph_acls['DataAcl']:
819             if item in setup['physical_interfaces']:
820                 if mode == 'alias':
821                     assert setup['port_name_map'][item] in acl_table
822                 elif mode == 'default':
823                     assert item in acl_table
(Pdb) minigraph_acls['DataAcl']
[u'Ethernet32', u'Ethernet40', u'Ethernet208', u'Ethernet216', u'Ethernet128', u'Ethernet184']
(Pdb) setup['port_name_map']
{u'Ethernet8': 'TestAlias0', u'Ethernet184': 'TestAlias1', u'Ethernet280': 'TestAlias2', u'Ethernet248': 'TestAlias3', u'Ethernet104': 'TestAlias4', u'Ethernet240': 'TestAlias5', u'Ethernet264': 'TestAlias6', u'Ethernet96': 'TestAlias7', u'Ethernet168': 'TestAlias8', u'Ethernet120': 'TestAlias9', u'Ethernet144': 'TestAlias10', u'Ethernet208': 'TestAlias11', u'Ethernet160': 'TestAlias12', u'Ethernet224': 'TestAlias13', u'Ethernet56': 'TestAlias14', u'Ethernet128': 'TestAlias15', u'Ethernet72': 'TestAlias16', u'Ethernet32': 'TestAlias17', u'Ethernet16': 'TestAlias18', u'Ethernet0': 'TestAlias19', u'Ethernet192': 'TestAlias20', u'Ethernet200': 'TestAlias21', u'Ethernet88': 'TestAlias22', u'Ethernet80': 'TestAlias23', u'Ethernet112': 'TestAlias24', u'Ethernet256': 'TestAlias25', u'Ethernet152': 'TestAlias26', u'Ethernet136': 'TestAlias27', u'Ethernet272': 'TestAlias28', u'Ethernet48': 'TestAlias29', u'Ethernet232': 'TestAlias30', u'Ethernet216': 'TestAlias31', u'Ethernet176': 'TestAlias32', u'Ethernet40': 'TestAlias33', u'Ethernet64': 'TestAlias34', u'Ethernet24': 'TestAlias35'}
(Pdb) acl_table
u"Name     Type    Binding         Description    Stage    Status\n-------  ------  --------------  -------------  -------  --------------------------------------\nDATAACL  L3      PortChannel102  DATAACL        ingress  {'asic0': 'Active', 'asic1': 'Active'}\n                 PortChannel106"
(Pdb) mode
'alias'

How I did it

For the show acl table command the following approach is followed

  • for single asic, get the all the acl_tables from config_db on the host (No change)
  • for multi asic:
    • get the control_plane acl info from host.
    • get the dataplane and everflow acl table from each namespace and append the ports.

How to verify it

  • Verify with updated UT
  • test on chassis multi asic linecard

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

@rlhui rlhui merged commit 7435b1c into sonic-net:master Aug 18, 2023
@rlhui
Copy link
Contributor

rlhui commented Aug 18, 2023

@arlakshm , please help create ado, thx.

@arlakshm
Copy link
Contributor Author

arlakshm commented Sep 5, 2023

MSFT ADO 25067638

@gechiang
Copy link
Contributor

gechiang commented Sep 5, 2023

@yxieca , @StormLiangMS , Can you help approve this bug fix for the corresponding requested branches?
Thanks!

yxieca pushed a commit that referenced this pull request Sep 6, 2023
What I did
Fixes sonic-net/sonic-buildimage#16012
The show acl table command currently get the ports from host config_db on multi asic platforms.
This host config_db will not the phyiscal ports in the binding ports because the host doesnt have any front panel ports on the host. This causes the show acl table not to display the phyiscal ports in the output on multi asic devices/linecards.

The test iface_namingmode/test_iface_namingmode.py::test_show_acl_table fails because of this issue.
StormLiangMS pushed a commit that referenced this pull request Sep 21, 2023
What I did
Fixes sonic-net/sonic-buildimage#16012
The show acl table command currently get the ports from host config_db on multi asic platforms.
This host config_db will not the phyiscal ports in the binding ports because the host doesnt have any front panel ports on the host. This causes the show acl table not to display the phyiscal ports in the output on multi asic devices/linecards.

The test iface_namingmode/test_iface_namingmode.py::test_show_acl_table fails because of this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[multi-asic] show acl table command gets data from host config db and not from asic namespace db
7 participants