Commit Graph

5846 Commits

Author SHA1 Message Date
Xichen96
0e48244cc2
[installer]: add processor.max_cstate=0 kernel cmdline to intel (#16340)
This is a fix for PR [kernel] Change grub cmdline to set c-states to 0 for "Intel" CPUs by shlomibitton · Pull Request #6051 · sonic-net/sonic-buildimage (github.com)

The original PR will disable intel idle driver but it cannot limit the max c-state to 1 due to system will fall back to acpi idle driver.

Currently intel_idle.max_cstate=0 is already present, which will disable intel idle driver. With the added option, common idle driver will be disabled as well, so there will not be idle management. This is to prevent a bug that can be triggered by idle instruction on intel platform.

Work item tracking
Microsoft ADO (number only): 24867921
2023-09-23 00:21:24 -07:00
mssonicbld
7aeb2fb69e
[submodule] Update submodule sonic-snmpagent to the latest HEAD automatically (#16576)
#### Why I did it
src/sonic-snmpagent
```
* 64f0def - (HEAD -> 202012, origin/202012) Support interface speed for PortChannels (#262) (2 days ago) [Lukas Stockner]
```
2023-09-18 11:03:12 -07:00
mssonicbld
ee7eaa298d
[submodule] Update submodule sonic-dbsyncd to the latest HEAD automatically (#14739)
#### Why I did it
src/sonic-dbsyncd
```
* d6b2000 - (HEAD -> 202012, origin/202012) Fix the LLDP_LOC_CHASSIS not getting populated if no remote neighbors are present (#39) (#58) (7 months ago) [abdosi]
* 0f8d503 - Use github code scanning instead of LGTM (#55) (8 months ago) [Liu Shilong]
```
2023-09-16 13:00:08 -07:00
Vaibhav Hemant Dixit
18534b6599
[submodule-update] Advance sonic-sairedis pointer to latest of 202012 (#16020)
#### Why I did it

Commits:

1. Use github code scanning instead of LGTM: https://github.com/sonic-net/sonic-sairedis/pull/1160
2. [202012][submodule][SAI]Advance SAI head : https://github.com/sonic-net/sonic-sairedis/pull/1211
3. Use github code scanning instead of LGTM: https://github.com/sonic-net/sonic-sairedis/pull/1223
4. [syncd] Add pre match logic for acl entry: https://github.com/sonic-net/sonic-sairedis/pull/1257
5. Fix pipeline issue caused by urllib3 v2: 26e5471a72

##### Work item tracking
- Microsoft ADO **(number only)**: 17914573
2023-09-16 12:51:22 -07:00
mssonicbld
9f06c8d2d3
[submodule] Update submodule sonic-snmpagent to the latest HEAD automatically (#16439)
#### Why I did it
src/sonic-snmpagent
```
* b292c01 - (HEAD -> 202012, origin/202012) Fix FdbUpdater crash when SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID attribute missing. (#286) (12 days ago) [Hua Liu]
```
2023-09-16 12:37:11 -07:00
Ashwin Srinivasan
f9d83c6e17
[202012] Move /var/log to RAM for Mellanox SN2700, Nokia 7215 and Dell S6100
### Why I did it
The commit by prgeor that was merged to master had conflict with 202012 branch and needed to be manually cherrypicked.


##### Work item tracking
- Microsoft ADO **(number only)**: 25086124

#### How I did it
Manually cherrypicked changes from PR #15077 

#### How to verify it
Built image with these changes and checked the filesystem:


**Mellanox-SN2700**
```
admin@str-msn2700-02:~$ show ver | grep -i "sonic software version"
SONiC Software Version: SONiC.202012-16544.362113-6980ffe77
admin@str-msn2700-02:~$
admin@str-msn2700-02:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           793M  8.4M  785M   2% /run
root-overlay     15G  6.4G  7.9G  45% /
/dev/sda3        15G  6.4G  7.9G  45% /host
tmpfs           792M  4.7M  788M   1% /var/log
tmpfs           3.9G  104M  3.8G   3% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup

admin@str-msn2700-02:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.7Gi       2.5Gi       3.9Gi       120Mi       1.4Gi       4.9Gi
Swap:            0B          0B          0B

```

**Nokia-M0-7215**

```
SONiC Software Version: SONiC.202012-16544.362113-6980ffe77
Platform: armhf-nokia_ixs7215_52x-r0
HwSKU: Nokia-M0-7215
ASIC: marvell

admin@str2-7215-acs-1:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.5G     0  1.5G   0% /dev
tmpfs           304M  7.3M  296M   3% /run
root-overlay     15G  5.0G  9.5G  35% /
/dev/sda2        15G  5.0G  9.5G  35% /host
tmpfs           303M  728K  303M   1% /var/log
tmpfs           1.5G     0  1.5G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup

admin@str2-7215-acs-1:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:          3.0Gi       632Mi       1.6Gi       9.0Mi       772Mi       2.3Gi
Swap:            0B          0B          0B

```

**Dell S6100**

```
SONiC Software Version: SONiC.202012-16544.362113-00aac5392
Platform: x86_64-dell_s6100_c2538-r0
HwSKU: Force10-S6100
ASIC: broadcom
ASIC Count: 1
Uptime: 19:50:04 up 2 min,  1 user,  load average: 3.38, 1.66, 0.65

admin@str-s6100-acs-4:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           797M  7.8M  789M   1% /run
root-overlay     14G  4.7G  8.8G  35% /
/dev/sda4        14G  4.7G  8.8G  35% /host
tmpfs           796M  6.7M  790M   1% /var/log
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup

admin@str-s6100-acs-4:~$ free -h
              total        used        free      shared  buff/cache   available
Mem:          7.8Gi       1.6Gi       4.9Gi        14Mi       1.3Gi       5.9Gi
Swap:            0B          0B          0B
admin@str-s6100-acs-4:~$

```

### Tested branch (Please provide the tested image version)

- [x] SONiC.202012-16544.362113-6980ffe77

#### Description for the changelog
Move /var/log to RAM for Mellanox SN2700, Nokia 7215 and Dell S6100 for the 202012 image.
2023-09-15 14:31:07 -07:00
zitingguo-ms
9f4a4bdc86
upgrade SAI xgs to 4.3.12.2 (#16354)
### Why I did it
Upgrade the SAI version to 4.3.12.2 to include the following changes:
- 4.3.10.2: [JIRA SONIC-68535][CSP CS00012273299] sai_query_attribute_capability for obj type SAI_OBJECT_TYPE_SWITCH
- 4.3.11.2: [JIRA SONIC-76883][CSP CS00012303308] SDK-367579: Skip flex port check when in iBodSync context
- 4.3.12.2: [JIRA SONIC-76472][CSP CS00012299690] Source suppressed broadcast packets count on interface TX discard statistics

##### Work item tracking
- Microsoft ADO **(number only)**: 24962692

#### How I did it
Upgrade the SAI version in sai.mk file.

#### How to verify it
Run SONiC basic test in SAI release pipeline: https://dev.azure.com/mssonic/internal/_build/results?buildId=361078&view=results
2023-09-14 22:43:14 -07:00
Aravind Mani
9b70262dc7
Dell S6100: Change platform API2.0 components order (#16521)
ADO: 25136360

#### Why I did it
sonic-mgmt component test failed 

#### How I did it
Change the order of components in platform file.
#### How to verify it
Run sonic-mgmt component API test scripts
2023-09-13 19:17:02 -07:00
Vivek
0dad269234 Run db_migrator for non first-time reboots (#16116)
- Why I did it
The recent change #15685 (comment) removed the db migration for non first reboots.
This is problematic for many deployments which doesn't rely on ZTP and push a custom config_db.json
Port to older branches after #15685 is ported back

- How I did it
Re-introduce the logic to run the db_migrator on non-first boots

- How to verify it
Verified reboot and warm-reboot cases

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
2023-09-07 14:33:12 +08:00
mssonicbld
99ace99ab2
[ci] Publish logs when building image job is canceled by timeout. (#10919) (#16433) 2023-09-04 16:34:07 +08:00
jcaiMR
5b6a935f99
avoid notify race between io and main pthreads (#16288)
Why I did it
Cherry-Pick #11926 into 202012

Work item tracking
Microsoft ADO (17850717):
How I did it
Create patch file to avoid notify race between io and main pthreads.

How to verify it
PR test, physical DUT for bgp related regression tests.
2023-08-29 18:05:03 +08:00
Samuel Angebault
a1ad1cf98c
[202012][Arista] Ignore poll errors during get_event_change (#16274)
#### Why I did it

When an exception happens during `get_change_event` it brings the process invoking it down.

##### Work item tracking
- Microsoft ADO **(number only)**: 24599154

#### How I did it

This is a backport of #16112
Handle exceptions gracefully within `get_change_event`

#### Description for the changelog

Ignore poll errors during get_event_change on Arista devices
2023-08-28 09:44:47 -07:00
Vaibhav Hemant Dixit
908933bd8c
[202012] Fix CONFIG_DB_INITIALIZED flag check logic and set/reset flag for warmboot (#16225)
Cherry pick of #15685

MSFT ADO: 24274591

#### Why I did it

Two changes:
### 1  Fix a day1 issue, where check to wait until `CONFIG_DB_INITIALIZED` is incorrect.
There are multiple places where same incorrect logic is used.

Current logic (`until [[ $($SONIC_DB_CLI CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]];`) will always result in pass, irrespective of the result of GET operation.
```
root@str2-7060cx-32s-29:~# sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED"
1
root@str2-7060cx-32s-29:~# until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]]; do echo "entered here"; done
root@str2-7060cx-32s-29:~# 

root@str2-7060cx-32s-29:~# 
root@str2-7060cx-32s-29:~# sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED"                                             
0
root@str2-7060cx-32s-29:~# until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") ]]; do echo "entered here"; done
root@str2-7060cx-32s-29:~# 
```

Fix this logic by checking for value of flag to be "1".
```
root@str2-7060cx-32s-29:~# until [[ $(sonic-db-cli CONFIG_DB GET "CONFIG_DB_INITIALIZED") -eq 1 ]]; do echo "entered here"; done
entered here
entered here
entered here
```

This gap in logic was highlighted when another fix was merged: https://github.com/sonic-net/sonic-buildimage/pull/14933
The issue being fixed here caused warmboot-finalizer to not wait until config-db is initialized.

### 2 Set and unset CONFIG_DB_INITIALIZED for warm-reboot case

Currently, during warm shutdown `CONFIG_DB_INITIALIZED`'s value is stored in redis db backup. This is restored back when the dump is loaded during warm-recovery.
So the value of `CONFIG_DB_INITIALIZED` does not depend on config db's state, however it remain what it was before reboot.

Fix this by setting `CONFIG_DB_INITIALIZED` to 0 as when the DB is loaded, and set it to 1 after db_migrator is done.
2023-08-24 11:48:56 -07:00
Aravind Mani
7fc5436d73
[202012]Dell s6100 Fix sonic-mgmt platform test failures (#16207)
ADO: 24709703
#### Why I did it
sonic-mgmt platform testcases failed.
#### How I did it
Implement platform API 2.0.
#### How to verify it
Run sonic-mgmt tests.
2023-08-22 11:41:19 -07:00
mssonicbld
5d5727f6b9
Revert "Revert "Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933)" (#15464)" (#15684) (#16223) 2023-08-22 05:14:25 +08:00
mssonicbld
32a52a13df
[E1031] add platform specific reboot command support (#15889) (#16216) 2023-08-21 06:27:54 +08:00
Zhijian Li
2bafae38d5 [Celestica-E1031] Enable CPU watchdog (#16083)
Enable CPU watchdog on Celestica-E1031.
2023-08-19 14:32:27 +08:00
mssonicbld
3fe7223dd6
[submodule] Update submodule sonic-utilities to the latest HEAD automatically (#14745)
#### Why I did it
src/sonic-utilities
```
* 7fe50faa - (HEAD -> 202012, origin/202012) UT change: for db_migrator test do not check for RESTAPI cert values (#2919) (6 minutes ago) [Vaibhav Hemant Dixit]
```
2023-08-17 09:52:07 -07:00
Vaibhav Hemant Dixit
9d00e93624
[submodule advance] Update sonic-utilities pointer to latest (#16100)
To include below fixes:

sonic-net/sonic-utilities#2896
sonic-net/sonic-utilities#2924

Work item tracking
Microsoft ADO (number only): 24419953
2023-08-11 11:52:59 -07:00
mssonicbld
ad0d5db480
[submodule] Update submodule sonic-swss-common to the latest HEAD automatically (#14743)
#### Why I did it
src/sonic-swss-common
```
* c942d74 - (HEAD -> 202012, origin/202012) [Ci][202012] Fix collect log error in azp template (#800) (6 weeks ago) [xumia]
* 14fa3e5 - Cherry-pick PRs in master branch to unblock PR checks. (#761) (5 months ago) [Liu Shilong]
```
2023-08-11 08:29:35 +00:00
mssonicbld
b5958d8110
[submodule] Update submodule sonic-platform-common to the latest HEAD automatically (#14740)
#### Why I did it
src/sonic-platform-common
```
* 6e44c97 - (HEAD -> 202012, origin/202012) Change Y cable simulator log level from error to warning due to false alarm (3 months ago) [ShiyanWangMS]
* df020b8 - Add missing sys imports (#343) (6 months ago) [spilkey-cisco]
* cb00d2e - Use github code scanning instead of LGTM (#328) (7 months ago) [Liu Shilong]
* dd74113 - [ssd_generic] Fix innodisk health regex (#287) (9 months ago) [Alexander Allen]
```
2023-08-11 07:20:07 +00:00
mssonicbld
559fe85353
[submodule] Update submodule sonic-linux-kernel to the latest HEAD automatically (#15784)
#### Why I did it
src/sonic-linux-kernel
```
* 694b338 - (HEAD -> 202012, origin/202012) [202012] Add crypto/zstd.ko module via CONFIG_CRYPTO_ZSTD (#320) (4 weeks ago) [Samuel Angebault]
```
2023-08-11 06:51:55 +00:00
mssonicbld
43f6281311
[submodule] Update submodule sonic-swss to the latest HEAD automatically (#14865)
#### Why I did it
src/sonic-swss
```
* f141880 - (HEAD -> 202012, origin/202012) [bugfix] vnet ping missing with secondary endpoints empty in priority routes. (#2736) (#2747) (3 weeks ago) [siqbal1986]
```
2023-08-10 16:07:22 -07:00
mssonicbld
e57100f8a8
[submodule] Update submodule dhcprelay to the latest HEAD automatically (#15781)
#### Why I did it
src/dhcprelay
```
* 3578eb3 - (HEAD -> 202012, origin/202012) [202012] fix dual-tor relay-reply handing issue (#40) (13 days ago) [jcaiMR]
```
2023-08-10 16:06:33 -07:00
mssonicbld
14f5f127c9
[submodule] Update submodule linkmgrd to the latest HEAD automatically (#15654)
#### Why I did it
src/linkmgrd
```
* 3f89fce - (HEAD -> 202012, origin/202012) [202012] Use Vlan MAC as src MAC for link prober by default #93 (#209) (6 weeks ago) [Jing Zhang]
```
2023-08-10 16:05:40 -07:00
Ikki Zhu
de97458395 [E1031] fix pca9548 initializes failed occasionally (#15712)
Why I did it
[E1031] fix pca9548 initializes failed occasionally in stress test.
When failure happened, ismt i2c bus hang up and need power cycle to
recover it.

How I did it
Add 0.5s delay between setuping and configuring pca9548 i2c mux.

How to verify it
Reboot stress test at least 100 times without failure.
2023-08-03 12:32:29 +08:00
lerry-lee
db1d6ab014
[CI/CD] Use remote PR test template from sonic-mgmt master to run PR test (#15976)
Why I did it
Use remote PR test template from sonic-mgmt master to run PR test.

How I did it
Modify PR test azure pipeline yml file.

How to verify it
PR test executing normally.

Signed-off-by: Chun'ang Li <chunangli@microsoft.com>
2023-08-01 16:19:04 +08:00
byu343
b32b5ec5ac
[202012][Arista] Clear all reload cause after reading (#15925)
### Why I did it
On 202012 images, there is an issue that certain reload causes are not cleared after reading and the uncleared causes may confuse the following reboot-cause reading after warm-reboot to master/202305.

##### Work item tracking
- Microsoft ADO **(number only)**: 24378183

#### How I did it
Clear the reload cause even in the case that it is determined as not important. 

#### How to verify it
1) Cold-boot to 202012
2) Warm-reboot to master
3) Check the reboot cause is 'warm-reboot' by 'show reboot-cause'
2023-07-31 15:02:44 -07:00
zitingguo-ms
ddf9f7411e
upgrade SAI to 4.3.8.1 (#15988)
### Why I did it
Upgrade SAI version to 4.3.8.1 to include the following change:
- CS00012288297: Fix TX queue for control packets
##### Work item tracking
- Microsoft ADO **(number only)**: 24669269
#### How I did it
Upgrade the SAI version in sai.mk file
2023-07-31 14:57:07 -07:00
Ying Xie
e47abd0a48 Potential fix for Celestica E1031 device hang (#15822)
set CPU max_cstate to 0

Co-authored-by: Sumukha Tumkur Vani <sumukhatv@outlook.com>
2023-07-27 12:32:45 +08:00
jcaiMR
3c8ae454b4
[202012] dhcprelay add Loopback0 as source interface in dualtor scenario (#15744)
#### Why I did it
1. sonic-build image side change to fix source interface selection in dual tor scenario.
dhcprelay related PR:
https://github.com/sonic-net/sonic-dhcp-relay/pull/40

2. Announce dhcprelay submodule to 3578eb3 (to invoke [#40](https://github.com/sonic-net/sonic-dhcp-relay/pull/40
) PR)

##### Work item tracking
- Microsoft ADO 24243215

#### How to verify it
run test case, dhcp_relay/test_dhcpv6_relay.py
2023-07-24 18:28:16 -07:00
xumia
b1e5a7aaf4
[Build][202012] Fix the PyYang python package installation issue (#15890) (#15903)
* [Build] Fix the PyYang python package installation issue (#15890)

Why I did it
Fix the armhf build failure.
How to reproduce the issue:

docker run -it debain:bullseye bash
apt-get update && apt-get install -y python3-pip
pip3 install PyYAML==5.4.1
Error message:

Collecting PyYAML==5.4.1
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmp6xabslgb_in_process.py get_requires_for_build_wheel /tmp/tmp_er01ztl
....
      raise AttributeError(attr)
  AttributeError: cython_sources
  ----------------------------------------
WARNING: Discarding d63f2d7597/PyYAML-5.4.1.tar.gz (sha256)=607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e (from https://pypi.org/simple/pyyaml/) (requires-python:>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*). Command errored out with exit status 1: /usr/bin/python3 /tmp/tmp6xabslgb_in_process.py get_requires_for_build_wheel /tmp/tmp_er01ztl Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement PyYAML==5.4.1
ERROR: No matching distribution found for PyYAML==5.4.1
root@fa2fa92edcfd:/#
But if adding the option --no-build-isolation, then it is good, see fix.

install "PyYAML==5.4.1" --no-build-isolation
The same error can be found in the multiple builds.

Work item tracking
Microsoft ADO (number only): 24567457

How I did it
Add a build option --no-build-isolation.

* Fix docker-platform-monitor python2 issue

* Fix wheel dependency issue

* Fix wheel dependency issue

* Fix the pip2 PyYAML in host image
2023-07-23 10:00:15 +08:00
StormLiangMS
d3217a1bd1
[sonic-frr] enable info log for graceful restart events (#15623)
#### Why I did it
cherry pick, #15535

Graceful restart is a key event for bgpd, related log print is debug level. To change it to info level to get more visibilities when this kind of event is triggered.

##### Work item tracking
- Microsoft ADO **(13875291)**:

#### How I did it
To create patch file to change from debug level to info level. 

#### How to verify it
To run PR test and capture the print.
2023-07-13 18:36:35 -07:00
Hua Liu
171525d453
Cherry-pick pam patch from #8715 (#15787)
Fix libtacsupport.so  can't parse tacplus_nss.conf issue and not reset server list before parse config file issue.

##### Work item tracking
- Microsoft ADO **(number only)**: 24433713

#### Why I did it
1. Fix libtacsupport.so can't parse tacplus_nss.conf correctly issue:
            Support debug=on setting.
            Support put server address and secret in same row.
2. Fix the parse_config_file method not reset server list before parse config file issue.

#### How I did it
Fix libtacsupport.so  can't parse tacplus_nss.conf issue and not reset server list before parse config file issue.

#### How to verify it
UT with CUnit cover all code in this plugin.
Also pass all current UT.

#### Which release branch to backport (provide reason below if selected)
    N/A

#### Tested branch (Please provide the tested image version)
Extract tacacs support functions into library, this will share TACACS config file parse code with other project.
Also fix memory leak issue in parse config code.

- [ ]  SONiC.202012-15723.312602-e230e2d3e

#### Description for the changelog
Fix libtacsupport.so  can't parse tacplus_nss.conf issue and not reset server list before parse config file issue.
2023-07-12 18:47:56 -07:00
Hua Liu
4df2bc9b44
[202012] [TACACS+] Add audisp-tacplus for per-command accounting. (#8750) (#15788)
This pull request integrate audisp-tacplus to SONiC for per-command accounting.

##### Work item tracking
- Microsoft ADO **(number only)**: 24433713

#### Why I did it
To support TACACS per-command accounting, we integrate audisp-tacplus project to sonic.

#### How I did it
1. Add auditd service to SONiC
2. Port and patch audisp-tacplus to SONiC

#### How to verify it
UT with CUnit to cover all new code in usersecret-filter.c
Also pass all current UT.

#### Tested branch (Please provide the tested image version)
Extract tacacs support functions into library, this will share TACACS config file parse code with other project.
Also fix memory leak issue in parse config code.

- [ ]  SONiC.202012-15723.312602-e230e2d3e

#### Description for the changelog
Add audisp-tacplus for per-command accounting.
2023-07-12 18:46:47 -07:00
Hua Liu
9a733fde99
Update submodule sonic-utilities (#15770)
sonic-utilities submodule update

#### Why I did it
sonic-utilities submodule update:
```
399b1e3 2023-07-06 [202012][Show][BGP] Show BGP Change for no neighbor scenario (#2886)
7b47641 2023-07-10 [[202012] [TACACS+] Add config command for AAA authorization and accounting. (#1889)
```
##### Work item tracking
- Microsoft ADO **(number only)**:24433713

#### How I did it
Update sonic-utilities submodule.

#### How to verify it
Pass all test case.

#### Tested branch (Please provide the tested image version)
- [ ] SONiC.202012-15703.306864-1ef589c19
2023-07-10 21:19:08 -07:00
Hua Liu
228c3d3321
[202012] [TACACS+] Add Config DB schema and HostCfg Enforcer plugin to support TACACS+ per-command authorization&accounting.(#9029) (#15718)
This pull request add Config DB schema and HostCfg Enforcer plugin to support TACACS+ per-command authorization&accounting.

##### Work item tracking
- Microsoft ADO **(number only)**: 24433713

#### Why I did it
    Support TACACS per-command authorization&accounting.

#### How I did it
    Change ConfigDB schema and HostCfg enforcer.
    Add UT to cover changed code.

#### How to verify it
    Build following project and pass all UTs:
    make target/python-wheels/sonic_host_services-1.0-py3-none-any.whl

#### Which release branch to backport (provide reason below if selected)
    N/A

#### Tested branch (Please provide the tested image version)
Extract tacacs support functions into library, this will share TACACS config file parse code with other project.
Also fix memory leak issue in parse config code.

- [ ]  SONiC.202012-15723.309781-38d8852cd

#### Description for the changelog
    Add Config DB schema and HostCfg Enforcer plugin to support TACACS+ per-command authorization&accounting.
2023-07-10 21:17:31 -07:00
Hua Liu
f75794abdc
[TACACS+]: Extract tacacs support functions into library and fix memory leak issue. (#8659) (#15703)
This pull request extract tacacs support functions into library to share TACACS config file parse code with other project. Also fix memory leak issue in parse config code.

#### Why I did it
To support TACACS per command authorization, we need reuse the TACACS config file parse code in bash plugin project.

##### Work item tracking
- Microsoft ADO **(number only)**: 24433713

#### How I did it
Add libtacsupport.pc.in to extract tacacs support functions into library.
Fix memory leak issue in TACACS config parse code by convert the dynamic memory allocation memory to static memory allocation.

#### How to verify it
Pass all current UT.
Check shared library generated manually.

#### Tested branch (Please provide the tested image version)
Extract tacacs support functions into library, this will share TACACS config file parse code with other project.
Also fix memory leak issue in parse config code.

- [ ] SONiC.202012-15703.306864-1ef589c19

#### Description for the changelog
Extract tacacs support functions into library, this will share TACACS config file parse code with other project.
Also fix memory leak issue in parse config code.
2023-07-10 21:16:43 -07:00
Nazarii Hnydyn
ff9a1d5a11
[202012][buildsystem]: Fix hiredis package version: 0.14.1-1. (#15719)
Backport #15461

#### Why I did it
* To fix `hiredis` compilation

#### How I did it
* Changed package version: `0.14.0-3~bpo9+1` -> `0.14.1-1`

#### How to verify it
1. make configure PLATFORM=mellanox
2. make target/sonic-mellanox.bin

#### Tested branch (Please provide the tested image version)
- [X] 202012 <!-- image version 1 -->
2023-07-10 09:53:41 -07:00
Chun'ang Li
4e628f0524
Refine PR test template format (#15637)
Why I did it
Refine PR test template format.

How I did it
Refine PR test template format.

How to verify it
PR test executed normally.

Signed-off-by: Chun'ang Li <chunangli@microsoft.com>
2023-07-10 10:48:21 +08:00
Yaqiang Zhu
6e7c000b93
[submodule][202012] Update submodule sonic-utilities to the latest HEAD (#15532)
#### Why I did it
Update submodule sonic-utilities to the latest HEAD
```
50296b90 - [202012][dhcp-relay] Fix dhcp6relay counter issue (#2866) (#2873) (Fri Jun 30 18:08:53 2023 +0800) <Yaqiang Zhu>
160030c4 - [202012][dhcp_relay] Add "Reconfigure", "Information-Request", "Malformed" counter options (#2844) (Sun Jun 11 20:35:30 2023 -0700) <kellyyeh>
e6289ced - [vlan][dhcp_relay] Clear dhcpv6 relay counter while deleting vlan (#2852) (Fri Jun 2 18:20:21 2023 +0000) <Yaqiang Zhu>
885082ec - correctly parsing complete ipv6 vnet info (#2827) (Thu May 25 06:01:40 2023 +0000) <Keith Lu>
```

##### Work item tracking
- Microsoft ADO 22635770
2023-07-06 00:18:12 -07:00
mssonicbld
6884c2e9f9
[submodule] Update submodule sonic-telemetry to the latest HEAD automatically (#15543)
#### Why I did it
src/sonic-telemetry
```
* 56aa539 - (HEAD -> 202012, origin/202012) Fix sonic-mgmt-common version in pipeline build (#124) (2 weeks ago) [Sachin Holla]
* 4264949 - Change log level (#118) (4 weeks ago) [Zain Budhwani]
```
2023-07-06 00:08:01 -07:00
Zhaohui Sun
71a8a66894
[202012] Fix caclmgrd crash issue when applying scale cacl rules (#15630)
Cherry pick PR for https://github.com/sonic-net/sonic-host-services/pull/62

#### Why I did it
Fix the issue https://github.com/sonic-net/sonic-buildimage/issues/10883.

##### Work item tracking
- Microsoft ADO **(17795594)**:

#### How I did it
For performance reason, libswsscommon is not thread safe by design.
caclmgrd share config DB connection cross thread, so change to use new db connector in child thread.

#### How to verify it
Load scale ipv4/ipv6 rules and verify if caclmgrd is crashed
2023-07-03 22:33:39 -07:00
jhli-cisco
d4515eecf8
Update cisco-8000.ini (#15644)
#### Why I did it
Aikido FPD update, power CPLD version display under fwutil CLI and fix for cpu lockup causing telemetry container crash or system reboot

##### Work item tracking
- Microsoft ADO **(number only)**: 24174212

#### How I did it
update cisco module to 202012.3.1.1
2023-07-03 11:18:22 -07:00
Stepan Blyshchak
bc58e2d841
[202012][mlnx-ffb.sh] Update issu-version location (#14927)
BACKPORT OF https://github.com/sonic-net/sonic-buildimage/pull/14925

#### Why I did it

ISSU version check fails due to inability to mount squashfs from 202211 on 201911

#### How I did it

Put ISSU version file under platform directory

#### How to verify it

202012 (with [202012][mlnx-ffb.sh] Update issu-version location  #14927) to master
2023-07-01 23:43:51 -07:00
Vaibhav Hemant Dixit
406852cf30 Revert "Fix for fast/cold-boot: call db_migrator only after old config is loaded (#14933)" (#15464)
This reverts commit 02b17839c3.

Reverts #14933

The earlier commit caused a race condition that particularly broke cross branch warm upgrade.

Issue happens when db_migrator is still migrating the DB and finalizer is checking DB for list of components to reconcile.

If migration is not complete, finalizer get an empty list to wait for. Due to this, finalizer concludes warmboot (deletes system wide warmboot flag) and cause all the services to do cold restart.

ADO: 24274591
2023-06-29 12:37:24 +08:00
xumia
51e0b6ddd9
[Ci] Support to build sonic-swss-common for test (#15566) (#15582)
[Ci] Support to build sonic-swss-common for test

- Microsoft ADO **(number only)**: 24341479
2023-06-28 03:14:20 +00:00
mssonicbld
6bb16f3e54
[celestica/e1031]: enable emc2305 fan controller timeout feature (#14401) (#15571) 2023-06-22 08:27:53 +08:00
Ikki Zhu
db12b8c9c0
dx010 fix possible cpld race read issue (#15339)
#### Why I did it
fix possible cpld race read issue between watchdog and reboot cause process

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
Use flock to limit parallel access to cpld sys file

#### How to verify it
It can be simulate and verified with following python script

```python3
import signal
import subprocess
import threading

exit_flag = False

def run_command(cmd):
    status = True
    result = ""
    try:
        p = subprocess.Popen(
            cmd, shell=True, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        raw_data, err = p.communicate()
        if err == '':
            result = raw_data.strip()
    except:
        status = False
    return status, result

def get_cpld_reg_value(getreg_path, register):
    #cmd = "echo {1} > {0}; cat {0}".format(getreg_path, register)
    cmd = "flock {0} -c 'echo {1} > {0}; cat {0}'".format(getreg_path,
register)
    status, result = run_command(cmd)
    return result if status else None

def cpld_read(thread_num, cpld_reg):
    while not exit_flag:
        val
= get_cpld_reg_value("/sys/devices/platform/dx010_cpld/getreg",
cpld_reg)
        print(f"Thread {thread_num}: get cpld reg {cpld_reg}, value
{val}")

def signal_handler(sig, frame):
    global exit_flag
    print("Ctrl+C detected. Quitting...")
    exit_flag = True

if __name__ == '__main__':
    # Register the signal handler for Ctrl+C
    signal.signal(signal.SIGINT, signal_handler)

    t1 = threading.Thread(target=cpld_read, args=(1, '0x103',))
    t2 = threading.Thread(target=cpld_read, args=(2, '0x141',))
    t1.start()
    t2.start()
    t1.join()
    t2.join()
```
2023-06-20 16:21:08 -07:00
mssonicbld
93b8694d82
[Build] Remove the additional space character in the mirrors.list file (#13812) (#15459)
Why I did it
Fix all mirror is commented out in sources.list in slave image issue. It will have an issue when installing more packages in the slave container.

It will add additional space character after running add-apt-repository command.

For example:
The original config in /etc/apt/sources.list

#deb [arch=amd64] http://deb.debian.org/debian/ bullseye main contrib non-free
Run the following command:

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable"
Then the setting changed to: (added a new space character after #)

# deb [arch=amd64] http://deb.debian.org/debian/ bullseye main contrib non-free
How I did it
Fix the regex string to add the space pattern. After fixed, whether there is a space character or not, it will not be an issue.

How to verify it

Co-authored-by: xumia <59720581+xumia@users.noreply.github.com>
2023-06-19 23:23:42 +08:00