@@ -78,6 +78,56 @@ sai_status_t SwitchBCM56850::create_qos_queues_per_port(
78
78
return SAI_STATUS_SUCCESS;
79
79
}
80
80
81
+ sai_status_t SwitchBCM56850::create_cpu_qos_queues (
82
+ _In_ sai_object_id_t port_id)
83
+ {
84
+ SWSS_LOG_ENTER ();
85
+
86
+ sai_attribute_t attr;
87
+
88
+ // CPU queues are of type multicast queues
89
+ const uint32_t port_qos_queues_count = 32 ;
90
+
91
+ std::vector<sai_object_id_t > queues;
92
+
93
+ for (uint32_t i = 0 ; i < port_qos_queues_count; ++i)
94
+ {
95
+ sai_object_id_t queue_id;
96
+
97
+ CHECK_STATUS (create (SAI_OBJECT_TYPE_QUEUE, &queue_id, m_switch_id, 0 , NULL ));
98
+
99
+ queues.push_back (queue_id);
100
+
101
+ attr.id = SAI_QUEUE_ATTR_TYPE;
102
+ attr.value .s32 = SAI_QUEUE_TYPE_MULTICAST;
103
+
104
+ CHECK_STATUS (set (SAI_OBJECT_TYPE_QUEUE, queue_id, &attr));
105
+
106
+ attr.id = SAI_QUEUE_ATTR_INDEX;
107
+ attr.value .u8 = (uint8_t )i;
108
+
109
+ CHECK_STATUS (set (SAI_OBJECT_TYPE_QUEUE, queue_id, &attr));
110
+
111
+ attr.id = SAI_QUEUE_ATTR_PORT;
112
+ attr.value .oid = port_id;
113
+
114
+ CHECK_STATUS (set (SAI_OBJECT_TYPE_QUEUE, queue_id, &attr));
115
+ }
116
+
117
+ attr.id = SAI_PORT_ATTR_QOS_NUMBER_OF_QUEUES;
118
+ attr.value .u32 = port_qos_queues_count;
119
+
120
+ CHECK_STATUS (set (SAI_OBJECT_TYPE_PORT, port_id, &attr));
121
+
122
+ attr.id = SAI_PORT_ATTR_QOS_QUEUE_LIST;
123
+ attr.value .objlist .count = port_qos_queues_count;
124
+ attr.value .objlist .list = queues.data ();
125
+
126
+ CHECK_STATUS (set (SAI_OBJECT_TYPE_PORT, port_id, &attr));
127
+
128
+ return SAI_STATUS_SUCCESS;
129
+ }
130
+
81
131
sai_status_t SwitchBCM56850::create_qos_queues ()
82
132
{
83
133
SWSS_LOG_ENTER ();
@@ -91,6 +141,8 @@ sai_status_t SwitchBCM56850::create_qos_queues()
91
141
CHECK_STATUS (create_qos_queues_per_port (port_id));
92
142
}
93
143
144
+ CHECK_STATUS (create_cpu_qos_queues (m_cpu_port_id));
145
+
94
146
return SAI_STATUS_SUCCESS;
95
147
}
96
148
0 commit comments