@@ -52,11 +52,11 @@ int main(int argc, char **argv)
5252 int ch , delay = 1 , n = 0 ;
5353 int single = 0 ;
5454 unsigned int i , j ;
55- struct ff_traffic_args traffic = {0 , 0 , 0 , 0 }, otr ;
55+ struct ff_traffic_args traffic = {0 , 0 , 0 , 0 , 0 , 0 }, otr ;
5656 struct ff_traffic_args ptraffic [RTE_MAX_LCORE ], potr [RTE_MAX_LCORE ];
5757 int proc_id = 0 , max_proc_id = -1 ;
58- uint64_t rxp , rxb , txp , txb ;
59- uint64_t prxp , prxb , ptxp , ptxb ;
58+ uint64_t rxp , rxb , txp , txb , rxd , txd ;
59+ uint64_t prxp , prxb , ptxp , ptxb , prxd , ptxd ;
6060 int title_line = 40 ;
6161
6262 ff_ipc_init ();
@@ -106,8 +106,9 @@ int main(int argc, char **argv)
106106 return -1 ;
107107 }
108108
109- printf ("%lu,%lu,%lu,%lu\n" , traffic .rx_packets , traffic .rx_bytes ,
110- traffic .tx_packets , traffic .tx_bytes );
109+ printf ("%lu,%lu,%lu,%lu,%lu,%lu\n" , traffic .rx_packets , traffic .rx_bytes ,
110+ traffic .tx_packets , traffic .tx_bytes ,
111+ traffic .rx_dropped , traffic .tx_dropped );
111112 } else {
112113 for (j = proc_id ; j <= max_proc_id ; j ++ ) {
113114 ff_set_proc_id (j );
@@ -117,19 +118,21 @@ int main(int argc, char **argv)
117118 return -1 ;
118119 }
119120
120- printf ("%9d,%20lu,%20lu,%20lu,%20lu,\n" ,
121+ printf ("%9d,%20lu,%20lu,%20lu,%20lu,%20lu,%20lu, \n" ,
121122 j , ptraffic [j ].rx_packets , ptraffic [j ].rx_bytes ,
122- ptraffic [j ].tx_packets , ptraffic [j ].tx_bytes );
123+ ptraffic [j ].tx_packets , ptraffic [j ].tx_bytes ,
124+ traffic .rx_dropped , traffic .tx_dropped );
123125
124126 ADD_S (rx_packets );
125127 ADD_S (rx_bytes );
126128 ADD_S (tx_packets );
127129 ADD_S (tx_bytes );
128130 }
129131
130- printf ("%9s,%20lu,%20lu,%20lu,%20lu,\n" ,
132+ printf ("%9s,%20lu,%20lu,%20lu,%20lu,%20lu,%20lu \n" ,
131133 "total" , traffic .rx_packets , traffic .rx_bytes ,
132- traffic .tx_packets , traffic .tx_bytes );
134+ traffic .tx_packets , traffic .tx_bytes ,
135+ traffic .rx_dropped , traffic .tx_dropped );
133136 }
134137 ff_ipc_exit ();
135138 return 0 ;
@@ -145,36 +148,43 @@ int main(int argc, char **argv)
145148
146149 if (i % title_line == 0 ) {
147150 printf ("|--------------------|--------------------|" );
148- printf ("--------------------|--------------------|\n" );
149- printf ("|%20s|%20s|%20s|%20s|\n" , "rx packets" , "rx bytes" ,
150- "tx packets" , "tx bytes" );
151+ printf ("--------------------|--------------------|"
152+ "--------------------|--------------------|\n" );
153+ printf ("|%20s|%20s|%20s|%20s|%20s|%20s|\n" , "rx packets" , "rx bytes" ,
154+ "tx packets" , "tx bytes" , "rx_dropped" , "tx_dropped" );
151155 printf ("|--------------------|--------------------|" );
152- printf ("--------------------|--------------------|\n" );
156+ printf ("--------------------|--------------------|"
157+ "--------------------|--------------------|\n" );
153158 }
154159
155160 if (i ) {
156161 rxp = DIFF (rx_packets );
157162 rxb = DIFF (rx_bytes );
158163 txp = DIFF (tx_packets );
159164 txb = DIFF (tx_bytes );
165+ rxd = DIFF (rx_dropped );
166+ txd = DIFF (tx_dropped );
160167
161- printf ("|%20lu|%20lu|%20lu|%20lu|\n" , rxp , rxb , txp , txb );
168+ printf ("|%20lu|%20lu|%20lu|%20lu|%20lu|%20lu|\n" ,
169+ rxp , rxb , txp , txb , rxd , txd );
162170 }
163171 } else {
164172 /*
165173 * get and show traffic from proc_id to max_proc_id.
166174 */
167175 if (i % (title_line / (max_proc_id - proc_id + 2 )) == 0 ) {
168176 printf ("|---------|--------------------|--------------------|"
177+ "--------------------|--------------------|"
169178 "--------------------|--------------------|\n" );
170- printf ("|%9s|%20s|%20s|%20s|%20s|\n" ,
179+ printf ("|%9s|%20s|%20s|%20s|%20s|%20s|%20s| \n" ,
171180 "proc_id" , "rx packets" , "rx bytes" ,
172- "tx packets" , "tx bytes" );
181+ "tx packets" , "tx bytes" , "rx_dropped" , "tx_dropped" );
173182 printf ("|---------|--------------------|--------------------|"
183+ "--------------------|--------------------|"
174184 "--------------------|--------------------|\n" );
175185 }
176186
177- rxp = rxb = txp = txb = 0 ;
187+ rxp = rxb = txp = txb = rxd = txd = 0 ;
178188 for (j = proc_id ; j <= max_proc_id ; j ++ ) {
179189 potr [j ] = ptraffic [j ];
180190
@@ -190,18 +200,23 @@ int main(int argc, char **argv)
190200 prxb = DIFF_P (rx_bytes );
191201 ptxp = DIFF_P (tx_packets );
192202 ptxb = DIFF_P (tx_bytes );
193- printf ("|%9d|%20lu|%20lu|%20lu|%20lu|\n" ,
194- j , prxp , prxb , ptxp , ptxb );
203+ prxd = DIFF_P (rx_dropped );
204+ ptxd = DIFF_P (tx_dropped );
205+ printf ("|%9d|%20lu|%20lu|%20lu|%20lu|%20lu|%20lu|\n" ,
206+ j , prxp , prxb , ptxp , ptxb , prxd , ptxd );
195207
196208 rxp += prxp ;
197209 rxb += prxb ;
198210 txp += ptxp ;
199211 txb += ptxb ;
212+ rxd += prxd ;
213+ txd += ptxd ;
200214
201215 if (j == max_proc_id ) {
202- printf ("|%9s|%20lu|%20lu|%20lu|%20lu|\n" ,
203- "total" , rxp , rxb , txp , txb );
216+ printf ("|%9s|%20lu|%20lu|%20lu|%20lu|%20lu|%20lu| \n" ,
217+ "total" , rxp , rxb , txp , txb , rxd , txd );
204218 printf ("| | |"
219+ " | |"
205220 " | |"
206221 " |\n" );
207222 }
0 commit comments