Skip to content

Commit

Permalink
Merge branch 'master' into voq-inbandif-port
Browse files Browse the repository at this point in the history
  • Loading branch information
vganesan-nokia authored Feb 23, 2021
2 parents 742bd71 + 96ecb73 commit e54c3af
Show file tree
Hide file tree
Showing 8 changed files with 1,113 additions and 620 deletions.
1 change: 0 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pool:

container:
image: sonicdev-microsoft.azurecr.io:443/sonic-slave-buster:latest
options: --privileged

steps:
- task: DownloadPipelineArtifact@2
Expand Down
76 changes: 76 additions & 0 deletions doc/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
* [QoS Show commands](#qos-show-commands)
* [PFC](#pfc)
* [Queue And Priority-Group](#queue-and-priority-group)
* [Buffer Pool](#buffer-pool)
* [QoS config commands](#qos-config-commands)
* [sFlow](#sflow)
* [sFlow Show commands](#sflow-show-commands)
Expand Down Expand Up @@ -340,6 +341,7 @@ This command displays the full list of show commands available in the software;
aaa Show AAA configuration
acl Show ACL related information
arp Show IP ARP table
buffer_pool Show details of the Buffer-pools
clock Show date and time
ecn Show ECN configuration
environment Show environmentals (voltages, fans, temps)
Expand Down Expand Up @@ -1985,6 +1987,34 @@ Optionally, you can display configured console ports only by specifying the `-b`

This sub-section explains the list of configuration options available for console management module.

**config console enable**

This command is used to enable SONiC console switch feature.

- Usage:
```
config console enable
```

- Example:
```
admin@sonic:~$ sudo config console enable
```

**config console disable**

This command is used to disable SONiC console switch feature.

- Usage:
```
config console disable
```

- Example:
```
admin@sonic:~$ sudo config console disable
```

**config console add**

This command is used to add a console port setting.
Expand Down Expand Up @@ -6169,6 +6199,52 @@ This command displays the user persistet-watermark for the queues (Egress shared
admin@sonic:~$ sonic-clear priority-group persistent-watermark headroom
```
#### Buffer Pool
This sub-section explains the following buffer pool parameters that can be displayed using "show buffer_pool" command.
1) buffer pool watermark
2) buffer pool persistent-watermark
**show buffer_pool watermark**
This command displays the user watermark for all the buffer pools
- Usage:
```
show buffer_pool watermark
```
- Example:
```
admin@sonic:~$ show buffer_pool watermark
Shared pool maximum occupancy:
Pool Bytes
--------------------- -------
ingress_lossless_pool 0
lossy_pool 2464
```
**show buffer_pool persistent-watermark**
This command displays the user persistent-watermark for all the buffer pools
- Usage:
```
show buffer_pool persistent-watermark
```
- Example:
```
admin@sonic:~$ show buffer_pool persistent-watermark
Shared pool maximum occupancy:
Pool Bytes
--------------------- -------
ingress_lossless_pool 0
lossy_pool 2464
```
### QoS config commands
Expand Down
16 changes: 8 additions & 8 deletions scripts/centralize_database
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ import redis
import argparse

def centralize_to_target_db(target_dbname):
target_dbport = SonicDBConfig.get_port(target_dbname)
target_dbhost = SonicDBConfig.get_hostname(target_dbname)
target_dbport = SonicDBConfig.getDbPort(target_dbname)
target_dbhost = SonicDBConfig.getDbHostname(target_dbname)

dblists = SonicDBConfig.get_dblist()
dblists = SonicDBConfig.getDbList()
for dbname in dblists:
dbport = SonicDBConfig.get_port(dbname)
dbhost = SonicDBConfig.get_hostname(dbname)
dbport = SonicDBConfig.getDbPort(dbname)
dbhost = SonicDBConfig.getDbHostname(dbname)
# if the db is on the same instance, no need to move
if dbport == target_dbport and dbhost == target_dbhost:
continue

dbsocket = SonicDBConfig.get_socket(dbname)
dbid = SonicDBConfig.get_dbid(dbname)
dbsocket = SonicDBConfig.getDbSock(dbname)
dbid = SonicDBConfig.getDbId(dbname)

r = redis.Redis(host=dbhost, unix_socket_path=dbsocket, db=dbid)

Expand Down Expand Up @@ -49,7 +49,7 @@ Example : centralize_database APPL_DB
if args.target_db:
try:
centralize_to_target_db(args.target_db)
print(SonicDBConfig.get_instancename(args.target_db))
print(SonicDBConfig.getDbInst(args.target_db))
except Exception as ex:
template = "An exception of type {0} occurred. Arguments:\n{1!r}"
message = template.format(type(ex).__name__, ex.args)
Expand Down
34 changes: 21 additions & 13 deletions scripts/neighbor_advertiser
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ def get_vlan_addr_prefix(vlan_intf_name, ip_ver):
return vlan_addr, vlan_prefix


def get_link_local_addr(vlan_interface):
try:
out = subprocess.check_output(['ip', '-6', 'addr', 'show', vlan_interface])
out = out.decode('UTF-8')
for line in out.splitlines():
keys = line.split()
if keys[0] == 'inet6':
ip = IPNetwork(keys[1])
if str(ip.ip).startswith("fe80"):
# Link local ipv6 address
return str(ip.ip)
except Exception:
log.log_error('failed to get %s addresses from o.s.' % vlan_interface)

return None


def get_vlan_addresses(vlan_interface):
vlan_id = get_vlan_interface_vlan_id(vlan_interface)
vxlan_id = get_vlan_interface_vxlan_id(vlan_interface)
Expand All @@ -235,19 +252,10 @@ def get_vlan_addresses(vlan_interface):
ipv6_addr, ipv6_prefix = get_vlan_addr_prefix(vlan_interface, 6)

if len(ipv6_addr):
try:
out = subprocess.check_output(['ip', '-6', 'addr', 'show', vlan_interface])
out = out.decode('UTF-8')
for line in out.splitlines():
keys = line.split()
if keys[0] == 'inet6':
ip = IPNetwork(keys[1])
if str(ip.ip).startswith("fe80") and str(ip.ip) not in ipv6_addr:
# Link local ipv6 address
ipv6_addr.append(str(ip.ip))
ipv6_prefix.append('128')
except Exception:
log.log_error('failed to get %s addresses from o.s.' % vlan_interface)
link_local_addr = get_link_local_addr(vlan_interface)
if link_local_addr and link_local_addr not in ipv6_addr:
ipv6_addr.append(link_local_addr)
ipv6_prefix.append('128')

metadata = config_db.get_table('DEVICE_METADATA')
mac_addr = metadata['localhost']['mac']
Expand Down
Loading

0 comments on commit e54c3af

Please sign in to comment.