@@ -47,6 +47,7 @@ extern BufferOrch *gBufferOrch;
47
47
#define MAX_VALID_VLAN_ID 4094
48
48
49
49
#define PORT_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 1000
50
+ #define PORT_BUFFER_DROP_STAT_POLLING_INTERVAL_MS 60000
50
51
#define QUEUE_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS 10000
51
52
#define QUEUE_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS " 10000"
52
53
#define PG_WATERMARK_FLEX_STAT_COUNTER_POLL_MSECS " 10000"
@@ -145,6 +146,12 @@ const vector<sai_port_stat_t> port_stat_ids =
145
146
SAI_PORT_STAT_ETHER_IN_PKTS_128_TO_255_OCTETS,
146
147
};
147
148
149
+ const vector<sai_port_stat_t > port_buffer_drop_stat_ids =
150
+ {
151
+ SAI_PORT_STAT_IN_DROPPED_PKTS,
152
+ SAI_PORT_STAT_OUT_DROPPED_PKTS
153
+ };
154
+
148
155
static const vector<sai_queue_stat_t > queue_stat_ids =
149
156
{
150
157
SAI_QUEUE_STAT_PACKETS,
@@ -187,6 +194,7 @@ static char* hostif_vlan_tag[] = {
187
194
PortsOrch::PortsOrch (DBConnector *db, vector<table_name_with_pri_t > &tableNames) :
188
195
Orch(db, tableNames),
189
196
port_stat_manager(PORT_STAT_COUNTER_FLEX_COUNTER_GROUP, StatsMode::READ, PORT_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS, true ),
197
+ port_buffer_drop_stat_manager(PORT_BUFFER_DROP_STAT_FLEX_COUNTER_GROUP, StatsMode::READ, PORT_BUFFER_DROP_STAT_POLLING_INTERVAL_MS, true ),
190
198
queue_stat_manager(QUEUE_STAT_COUNTER_FLEX_COUNTER_GROUP, StatsMode::READ, QUEUE_STAT_FLEX_COUNTER_POLLING_INTERVAL_MS, true )
191
199
{
192
200
SWSS_LOG_ENTER ();
@@ -1845,6 +1853,13 @@ bool PortsOrch::initPort(const string &alias, const int index, const set<int> &l
1845
1853
counter_stats.emplace (sai_serialize_port_stat (it));
1846
1854
}
1847
1855
port_stat_manager.setCounterIdList (p.m_port_id , CounterType::PORT, counter_stats);
1856
+ std::unordered_set<std::string> port_buffer_drop_stats;
1857
+ for (const auto & it: port_buffer_drop_stat_ids)
1858
+ {
1859
+ port_buffer_drop_stats.emplace (sai_serialize_port_stat (it));
1860
+ }
1861
+ port_buffer_drop_stat_manager.setCounterIdList (p.m_port_id , CounterType::PORT, port_buffer_drop_stats);
1862
+
1848
1863
PortUpdate update = { p, true };
1849
1864
notify (SUBJECT_TYPE_PORT_CHANGE, static_cast <void *>(&update));
1850
1865
0 commit comments