| 318 | } |
| 319 | |
| 320 | static void |
| 321 | fs_dev_stats_save(struct sub_device *sdev) |
| 322 | { |
| 323 | struct rte_eth_stats stats; |
| 324 | int err; |
| 325 | |
| 326 | /* Attempt to read current stats. */ |
| 327 | err = rte_eth_stats_get(PORT_ID(sdev), &stats); |
| 328 | if (err) { |
| 329 | uint64_t timestamp = sdev->stats_snapshot.timestamp; |
| 330 | |
| 331 | WARN("Could not access latest statistics from sub-device %d.", |
| 332 | SUB_ID(sdev)); |
| 333 | if (timestamp != 0) |
| 334 | WARN("Using latest snapshot taken before %"PRIu64" seconds.", |
| 335 | (rte_rdtsc() - timestamp) / rte_get_tsc_hz()); |
| 336 | } |
| 337 | failsafe_stats_increment |
| 338 | (&PRIV(fs_dev(sdev))->stats_accumulator, |
| 339 | err ? &sdev->stats_snapshot.stats : &stats); |
| 340 | memset(&sdev->stats_snapshot, 0, sizeof(sdev->stats_snapshot)); |
| 341 | } |
| 342 | |
| 343 | static inline int |
| 344 | fs_rxtx_clean(struct sub_device *sdev) |
no test coverage detected