@@ -73,6 +73,22 @@ struct Counters {
7373 : active_cycles(0 )
7474 , tx_bytes(0 )
7575 , rx_bytes(0 )
76+ , tx_data_pkts(0 )
77+ , rx_data_pkts(0 )
78+ , tx_grant_pkts(0 )
79+ , rx_grant_pkts(0 )
80+ , tx_done_pkts(0 )
81+ , rx_done_pkts(0 )
82+ , tx_resend_pkts(0 )
83+ , rx_resend_pkts(0 )
84+ , tx_busy_pkts(0 )
85+ , rx_busy_pkts(0 )
86+ , tx_ping_pkts(0 )
87+ , rx_ping_pkts(0 )
88+ , tx_unknown_pkts(0 )
89+ , rx_unknown_pkts(0 )
90+ , tx_error_pkts(0 )
91+ , rx_error_pkts(0 )
7692 {}
7793
7894 /* *
@@ -88,6 +104,22 @@ struct Counters {
88104 active_cycles.add (other->active_cycles );
89105 tx_bytes.add (other->tx_bytes );
90106 rx_bytes.add (other->rx_bytes );
107+ tx_data_pkts.add (other->tx_data_pkts );
108+ rx_data_pkts.add (other->rx_data_pkts );
109+ tx_grant_pkts.add (other->tx_grant_pkts );
110+ rx_grant_pkts.add (other->rx_grant_pkts );
111+ tx_done_pkts.add (other->tx_done_pkts );
112+ rx_done_pkts.add (other->rx_done_pkts );
113+ tx_resend_pkts.add (other->tx_resend_pkts );
114+ rx_resend_pkts.add (other->rx_resend_pkts );
115+ tx_busy_pkts.add (other->tx_busy_pkts );
116+ rx_busy_pkts.add (other->rx_busy_pkts );
117+ tx_ping_pkts.add (other->tx_ping_pkts );
118+ rx_ping_pkts.add (other->rx_ping_pkts );
119+ tx_unknown_pkts.add (other->tx_unknown_pkts );
120+ rx_unknown_pkts.add (other->rx_unknown_pkts );
121+ tx_error_pkts.add (other->tx_error_pkts );
122+ rx_error_pkts.add (other->rx_error_pkts );
91123 }
92124
93125 /* *
@@ -98,6 +130,22 @@ struct Counters {
98130 stats->active_cycles = active_cycles.get ();
99131 stats->tx_bytes = tx_bytes.get ();
100132 stats->rx_bytes = rx_bytes.get ();
133+ stats->tx_data_pkts = tx_data_pkts.get ();
134+ stats->rx_data_pkts = rx_data_pkts.get ();
135+ stats->tx_grant_pkts = tx_grant_pkts.get ();
136+ stats->rx_grant_pkts = rx_grant_pkts.get ();
137+ stats->tx_done_pkts = tx_done_pkts.get ();
138+ stats->rx_done_pkts = rx_done_pkts.get ();
139+ stats->tx_resend_pkts = tx_resend_pkts.get ();
140+ stats->rx_resend_pkts = rx_resend_pkts.get ();
141+ stats->tx_busy_pkts = tx_busy_pkts.get ();
142+ stats->rx_busy_pkts = rx_busy_pkts.get ();
143+ stats->tx_ping_pkts = tx_ping_pkts.get ();
144+ stats->rx_ping_pkts = rx_ping_pkts.get ();
145+ stats->tx_unknown_pkts = tx_unknown_pkts.get ();
146+ stats->rx_unknown_pkts = rx_unknown_pkts.get ();
147+ stats->tx_error_pkts = tx_error_pkts.get ();
148+ stats->rx_error_pkts = rx_error_pkts.get ();
101149 }
102150
103151 // / CPU time spent actively processing Homa messages in cycles.
@@ -108,6 +156,54 @@ struct Counters {
108156
109157 // / Number of bytes received by the transport.
110158 Stat<uint64_t > rx_bytes;
159+
160+ // / Number of data packets sent.
161+ Stat<uint64_t > tx_data_pkts;
162+
163+ // / Number of data packets received.
164+ Stat<uint64_t > rx_data_pkts;
165+
166+ // / Number of grant packets sent.
167+ Stat<uint64_t > tx_grant_pkts;
168+
169+ // / Number of grant packets received.
170+ Stat<uint64_t > rx_grant_pkts;
171+
172+ // / Number of done packets sent.
173+ Stat<uint64_t > tx_done_pkts;
174+
175+ // / Number of done packets received.
176+ Stat<uint64_t > rx_done_pkts;
177+
178+ // / Number of resend packets sent.
179+ Stat<uint64_t > tx_resend_pkts;
180+
181+ // / Number of resend packets received.
182+ Stat<uint64_t > rx_resend_pkts;
183+
184+ // / Number of busy packets sent.
185+ Stat<uint64_t > tx_busy_pkts;
186+
187+ // / Number of busy packets received.
188+ Stat<uint64_t > rx_busy_pkts;
189+
190+ // / Number of ping packets sent.
191+ Stat<uint64_t > tx_ping_pkts;
192+
193+ // / Number of ping packets received.
194+ Stat<uint64_t > rx_ping_pkts;
195+
196+ // / Number of unknown packets sent.
197+ Stat<uint64_t > tx_unknown_pkts;
198+
199+ // / Number of unknown packets received.
200+ Stat<uint64_t > rx_unknown_pkts;
201+
202+ // / Number of error packets sent.
203+ Stat<uint64_t > tx_error_pkts;
204+
205+ // / Number of error packets received.
206+ Stat<uint64_t > rx_error_pkts;
111207};
112208
113209/* *
0 commit comments