Skip to content

Commit e3f4253

Browse files
committed
Add yang model for DPU_PORT information
1 parent 7e397b0 commit e3f4253

File tree

3 files changed

+129
-6
lines changed

3 files changed

+129
-6
lines changed

src/sonic-yang-models/doc/Configuration.md

+36
Original file line numberDiff line numberDiff line change
@@ -2973,6 +2973,42 @@ The ASIC_SENSORS table introduces the asic sensors polling configuration when th
29732973
}
29742974
```
29752975

2976+
### DPU PORT Configuration^M
2977+
2978+
The **DPU_PORT** table introduces the configuration for the DPUs(Data Processing Unit) PORT information available on the platform.
2979+
2980+
```json
2981+
{
2982+
"DPU_PORT": {
2983+
"dpu0": {
2984+
"state": "up",
2985+
"vip_ipv4": "192.168.1.1/24",
2986+
"vip_ipv6": "2001:db8::1/64",
2987+
"pa_ipv4": "192.168.1.10",
2988+
"pa_ipv6": "2001:db8::10",
2989+
"vdpu_id": "vdpu0",
2990+
"gnmi": 50052
2991+
},
2992+
"dpu1": {
2993+
"state": "down",
2994+
"vip_ipv4": "192.168.1.2/24",
2995+
"vip_ipv6": "2001:db8::2/64",
2996+
"pa_ipv4": "192.168.1.20",
2997+
"pa_ipv6": "2001:db8::20",
2998+
"vdpu_id": "vdpu1",
2999+
"gnmi": 50052
3000+
}
3001+
}
3002+
}
3003+
```
3004+
3005+
**state**: Administrative status of the DPU (`up` or `down`).
3006+
**vip_ipv4**: VIP IPv4 address from minigraph.
3007+
**vip_ipv6**: VIP IPv6 address from minigraph.
3008+
**pa_ipv4**: PA IPv4 address from minigraph.
3009+
**pa_ipv6**: PA IPv6 address from minigraph.
3010+
**vdpu_id**: ID of VDPUs from minigraph.
3011+
**gnmi**: Port gNMI runs on.
29763012

29773013
# For Developers
29783014

src/sonic-yang-models/tests/files/sample_config_db.json

+21-1
Original file line numberDiff line numberDiff line change
@@ -2767,6 +2767,26 @@
27672767
"midplane_interface": "dpu1"
27682768
}
27692769
},
2770+
"DPU_PORT": {
2771+
"dpu0": {
2772+
"state": "up",
2773+
"vip_ipv4": "192.168.1.1/24",
2774+
"vip_ipv6": "2001:db8::1/64",
2775+
"pa_ipv4": "192.168.1.10",
2776+
"pa_ipv6": "2001:db8::10",
2777+
"vdpu_id": "vdpu0",
2778+
"gnmi": 50052
2779+
},
2780+
"dpu1": {
2781+
"state": "down",
2782+
"vip_ipv4": "192.168.1.2/24",
2783+
"vip_ipv6": "2001:db8::2/64",
2784+
"pa_ipv4": "192.168.1.20",
2785+
"pa_ipv6": "2001:db8::20",
2786+
"vdpu_id": "vdpu1",
2787+
"gnmi": 50052
2788+
}
2789+
},
27702790
"XCVRD_LOG": {
27712791
"Y_CABLE": {
27722792
"log_verbosity": "notice"
@@ -2783,7 +2803,7 @@
27832803
"client_key": "grpcclient.key",
27842804
"ca_crt": "root.pem",
27852805
"grpc_ssl_credential": "azureclient.ms"
2786-
}
2806+
}
27872807
},
27882808
"BANNER_MESSAGE": {
27892809
"global": {

src/sonic-yang-models/yang-models/sonic-smart-switch.yang

+72-5
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,30 @@ module sonic-smart-switch {
99
prefix inet;
1010
}
1111

12-
import sonic-types {
13-
prefix stypes;
14-
}
12+
import sonic-types {
13+
prefix stypes;
14+
}
1515

1616
import sonic-port {
17-
prefix port;
18-
}
17+
prefix port;
18+
}
19+
20+
organization
21+
"SONiC";
22+
23+
contact
24+
"SONiC";
1925

2026
description "Smart Switch yang Module for SONiC OS";
2127

2228
revision 2023-10-17 {
2329
description "First Revision";
2430
}
2531

32+
revision 2025-01-11 {
33+
description "Add new container DPU_PORT";
34+
}
35+
2636
container sonic-smart-switch {
2737

2838
container MID_PLANE_BRIDGE {
@@ -74,6 +84,63 @@ module sonic-smart-switch {
7484
/* end of container DPUS_LIST */
7585
}
7686
/* end of container DPUS */
87+
88+
container DPU_PORT {
89+
description "DPU_PORTs part of config_db.json";
90+
91+
list DPU_PORT_LIST {
92+
description "Name of the DPU port";
93+
key "PORT_NAME";
94+
95+
leaf PORT_NAME {
96+
description "Name of the DPU port";
97+
type string;
98+
}
99+
100+
leaf state {
101+
description "Admin state of DPU device";
102+
type enumeration {
103+
enum up {
104+
description "Admin state is up";
105+
}
106+
enum down {
107+
description "Admin state is down";
108+
}
109+
}
110+
}
111+
112+
leaf vip_ipv4 {
113+
description "VIP IPv4 address from minigraph";
114+
type inet:ipv4-prefix;
115+
}
116+
117+
leaf vip_ipv6 {
118+
description "VIP IPv6 address from minigraph";
119+
type inet:ipv6-prefix;
120+
}
121+
122+
leaf pa_ipv4 {
123+
description "PA IPv4 address from minigraph";
124+
type inet:ipv4-address;
125+
}
126+
127+
leaf pa_ipv6 {
128+
description "PA IPv6 address from minigraph";
129+
type inet:ipv6-address;
130+
}
131+
132+
leaf vdpu_id {
133+
description "ID of VDPUs from minigraph";
134+
type string;
135+
}
136+
137+
leaf gnmi {
138+
description "Port gNMI runs on.";
139+
type inet:port-number;
140+
}
141+
}
142+
}
143+
/* end of container DPU_PORT */
77144
}
78145
/* end of container sonic-smart-switch */
79146
}

0 commit comments

Comments
 (0)