Skip to content

Commit

Permalink
Merge branch 'master' into psu_key_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoryboudreau authored Sep 13, 2024
2 parents aec46e0 + deb7b7c commit db9c29a
Show file tree
Hide file tree
Showing 9 changed files with 298 additions and 70 deletions.
10 changes: 5 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stages:
vmImage: ubuntu-20.04

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

steps:
- checkout: self
Expand All @@ -51,9 +51,9 @@ stages:
set -ex
sudo apt-get -y purge libhiredis-dev libnl-3-dev libnl-route-3-dev
sudo apt-get -y install libhiredis0.14
sudo dpkg -i ../target/debs/buster/{libyang_1.0.73_amd64.deb,libswsscommon_1.0.0_amd64.deb,python3-swsscommon_1.0.0_amd64.deb,libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb}
sudo python3 -m pip install ../target/python-wheels/buster/swsssdk*-py3-*.whl
sudo python3 -m pip install ../target/python-wheels/buster/sonic_py_common-1.0-py3-none-any.whl
sudo dpkg -i ../target/debs/bookworm/{libyang_1.0.73_amd64.deb,libswsscommon_1.0.0_amd64.deb,python3-swsscommon_1.0.0_amd64.deb,libnl-3-200_*.deb,libnl-genl-3-200_*.deb,libnl-nf-3-200_*.deb,libnl-route-3-200_*.deb}
sudo python3 -m pip install ../target/python-wheels/bookworm/swsssdk*-py3-*.whl
sudo python3 -m pip install ../target/python-wheels/bookworm/sonic_py_common-1.0-py3-none-any.whl
python3 setup.py bdist_wheel
cp dist/*.whl $(Build.ArtifactStagingDirectory)/
displayName: "Build"
Expand All @@ -69,7 +69,7 @@ stages:
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
sudo apt-add-repository https://packages.microsoft.com/debian/12/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
displayName: "Install .NET CORE"
Expand Down
12 changes: 6 additions & 6 deletions src/sonic_ax_impl/mibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
RIF_COUNTERS_AGGR_MAP = {
"SAI_PORT_STAT_IF_IN_OCTETS": "SAI_ROUTER_INTERFACE_STAT_IN_OCTETS",
"SAI_PORT_STAT_IF_IN_UCAST_PKTS": "SAI_ROUTER_INTERFACE_STAT_IN_PACKETS",
"SAI_PORT_STAT_IF_IN_ERRORS": "SAI_ROUTER_INTERFACE_STAT_IN_ERROR_PACKETS",
"SAI_PORT_STAT_IF_IN_DISCARDS": "SAI_ROUTER_INTERFACE_STAT_IN_ERROR_PACKETS",
"SAI_PORT_STAT_IF_OUT_OCTETS": "SAI_ROUTER_INTERFACE_STAT_OUT_OCTETS",
"SAI_PORT_STAT_IF_OUT_UCAST_PKTS": "SAI_ROUTER_INTERFACE_STAT_OUT_PACKETS",
"SAI_PORT_STAT_IF_OUT_ERRORS": "SAI_ROUTER_INTERFACE_STAT_OUT_ERROR_PACKETS"
"SAI_PORT_STAT_IF_OUT_DISCARDS": "SAI_ROUTER_INTERFACE_STAT_OUT_ERROR_PACKETS"
}

RIF_DROPS_AGGR_MAP = {
"SAI_PORT_STAT_IF_IN_ERRORS": "SAI_ROUTER_INTERFACE_STAT_IN_ERROR_PACKETS",
"SAI_PORT_STAT_IF_OUT_ERRORS": "SAI_ROUTER_INTERFACE_STAT_OUT_ERROR_PACKETS"
"SAI_PORT_STAT_IF_IN_DISCARDS": "SAI_ROUTER_INTERFACE_STAT_IN_ERROR_PACKETS",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "SAI_ROUTER_INTERFACE_STAT_OUT_ERROR_PACKETS"
}

redis_kwargs = {'unix_socket_path': '/var/run/redis/redis.sock'}
Expand Down Expand Up @@ -231,7 +231,7 @@ def init_db():
:return: db_conn
"""
Namespace.init_sonic_db_config()

# SyncD database connector. THIS MUST BE INITIALIZED ON A PER-THREAD BASIS.
# Redis PubSub objects (such as those within swsscommon) are NOT thread-safe.
db_conn = SonicV2Connector(**redis_kwargs)
Expand Down Expand Up @@ -575,7 +575,7 @@ def init_namespace_dbs():
db_conn = []
Namespace.init_sonic_db_config()
host_namespace_idx = 0
for idx, namespace in enumerate(SonicDBConfig.get_ns_list()):
for idx, namespace in enumerate(SonicDBConfig.get_ns_list()):
if namespace == multi_asic.DEFAULT_NAMESPACE:
host_namespace_idx = idx
db = SonicV2Connector(use_unix_socket_path=True, namespace=namespace)
Expand Down
3 changes: 0 additions & 3 deletions src/sonic_ax_impl/mibs/vendor/cisco/ciscoPfcExtMIB.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ def get_next(self, sub_id):
:return: the next sub id.
"""
try:
if not sub_id:
return self.if_range[0]

right = bisect_right(self.if_range, sub_id)
if right >= len(self.if_range):
return None
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tables/asic0/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
"SAI_PORT_STAT_IF_IN_ERRORS": "100",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "8",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
Expand All @@ -241,7 +241,7 @@
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "14",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tables/asic1/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@
"SAI_PORT_STAT_IF_IN_ERRORS": "100",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "13",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
Expand All @@ -602,7 +602,7 @@
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "15",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
Expand Down
12 changes: 6 additions & 6 deletions tests/mock_tables/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"SAI_PORT_STAT_IF_IN_ERRORS": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "5",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
Expand All @@ -37,7 +37,7 @@
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "10",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
Expand Down Expand Up @@ -828,7 +828,7 @@
"SAI_PORT_STAT_IF_IN_ERRORS": "100",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "7",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
Expand All @@ -853,7 +853,7 @@
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "11",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
Expand Down Expand Up @@ -3112,7 +3112,7 @@
"SAI_PORT_STAT_IF_IN_ERRORS": "100",
"SAI_PORT_STAT_ETHER_STATS_PKTS": "0",
"SAI_PORT_STAT_ETHER_STATS_BROADCAST_PKTS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_DISCARDS": "110",
"SAI_PORT_STAT_IP_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_IN_UNKNOWN_PROTOS": "0",
"SAI_PORT_STAT_IPV6_IN_DISCARDS": "0",
Expand All @@ -3137,7 +3137,7 @@
"SAI_PORT_STAT_IPV6_IN_UCAST_PKTS": "0",
"SAI_PORT_STAT_IPV6_IN_RECEIVES": "0",
"SAI_PORT_STAT_ETHER_STATS_PKTS_4096_TO_9216_OCTETS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "0",
"SAI_PORT_STAT_IF_OUT_DISCARDS": "120",
"SAI_PORT_STAT_ETHER_STATS_DROP_EVENTS": "0",
"SAI_PORT_STAT_IPV6_OUT_MCAST_PKTS": "0",
"SAI_PORT_STAT_ETHER_RX_OVERSIZE_PKTS": "0",
Expand Down
Loading

0 comments on commit db9c29a

Please sign in to comment.