You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Port configuration incremental update support (#985)
Due to historical reason, portsyncd and portmgrd both handle PORT table changes in CONFIG_DB and write APPL_DB according to configuration change. portmgrd handles fields including "mtu", "admin_status" and "learn_mode"; portsyncd handles all fields. There are a few issues here:
portsyncd is designed to listen to kernel port status change and fire the change event to high level, it should not handle CONFIG_DB change. portmgrd is the right place to handle port configuration change according to SONiC architecture.
Configuration change for "mtu", "admin_status" and "learn_mode" will be handled twice which is not necessary
portsyncd put all configuration to APPL_DB even if user only changes part of them. E.g. user changes "speed" of the port, portsyncd will put configuration like "mtu", "admin_status", "autoneg" to APPL_DB. This is not necessary too.
This HLD describes how to fix them.
Copy file name to clipboardexpand all lines: doc/port_auto_neg/port-auto-negotiation-design.md
+44-21
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@
41
41
| 0.1 || Junchao Chen | Initial version |
42
42
| 0.2 || Junchao Chen | Fix review comment |
43
43
| 0.3 || Dante (Kuo-Jung) Su | Add support for SFPs and operational states|
44
+
| 0.4 || Junchao Chen | Port incremental configuration |
44
45
45
46
### Scope
46
47
This document is the design document for port auto negotiation feature on SONiC. This includes the requirements, CLI change, DB schema change, DB migrator change, yang model change and swss change.
@@ -516,26 +517,39 @@ The new SONiC speed setting flow can be described in following pseudo code:
516
517
port = getPort(alias)
517
518
if autoneg changed:
518
519
setPortAutoNeg(port, autoneg)
519
-
520
-
if autoneg == true:
521
-
speed_list = vector()
522
-
if adv_speeds changed or autoneg changed:
523
-
// if adv_speeds == "all", leave speed_list empty which means all supported speeds
524
-
if adv_speeds != "all":
525
-
speed_list = adv_speeds
526
-
setPortAdvSpeed(port, speed_list)
527
-
528
-
interface_type_list = vector()
529
-
if adv_interface_types changed or autoneg changed:
530
-
// if adv_interface_types == "all", leave interface_type_list empty which means all supported types
setPortSpeed(port, speed) // for autoneg is off/not_set, apply the speed to SAI, this is for backward compatible
547
+
port.speed = speed
548
+
549
+
if interface_type changed:
550
+
if autoneg == off:
538
551
setInterfaceType(port, interface_type)
552
+
port.interface_type = interface_type
539
553
```
540
554
541
555
##### Getting Remote Advertisement
@@ -558,9 +572,18 @@ swss will do validation for auto negotiation related fields, although it still C
558
572
559
573
#### portsyncd and portmgrd Consideration
560
574
561
-
No changes for portsyncd and portmgrd.
575
+
Due to historical reason, portsyncd and portmgrd both handle **PORT** table changes in **CONFIG_DB** and write **APPL_DB** according to configuration change. portmgrd handles fields including "mtu", "admin_status" and "learn_mode"; portsyncd handles all fields. There are a few issues here:
576
+
577
+
1. portsyncd is designed to listen to kernel port status change and fire the change event to high level, it should not handle **CONFIG_DB** change. portmgrd is the right place to handle port configuration change according to SONiC architecture.
578
+
2. Configuration change for "mtu", "admin_status" and "learn_mode" will be handled twice which is not necessary
579
+
3. portsyncd put all configuration to **APPL_DB** even if user only changes part of them. E.g. user changes "speed" of the port, portsyncd will put configuration like "mtu", "admin_status", "autoneg" to **APPL_DB**. This is not necessary too.
580
+
581
+
To address these issues, a few changes shall be made:
562
582
563
-
Due to historical reason, portsyncd and portmgrd both handle **PORT** table changes in **CONFIG_DB** and write **APPL_DB** according to configuration change. portmgrd handles fields including "mtu", "admin_status" and "learn_mode"; portsyncd handles the rest fields.
583
+
1. portsyncd no longer listen to **CONFIG_DB** changes
584
+
2. portmgrd shall be extended to handle all port configuration changes
585
+
3. portmgrd shall implement incremental configuration update. It means that portmgrd shall not put configuration to **APPL_DB** if the field is not changed compare to previous value.
586
+
4. portsorch shall be changed to handle incremental port configuration changes
0 commit comments