Callback added to the RX port and applied to packets. 8< */
| 54 | |
| 55 | /* Callback added to the RX port and applied to packets. 8< */ |
| 56 | static uint16_t |
| 57 | add_timestamps(uint16_t port __rte_unused, uint16_t qidx __rte_unused, |
| 58 | struct rte_mbuf **pkts, uint16_t nb_pkts, |
| 59 | uint16_t max_pkts __rte_unused, void *_ __rte_unused) |
| 60 | { |
| 61 | unsigned i; |
| 62 | uint64_t now = rte_rdtsc(); |
| 63 | |
| 64 | for (i = 0; i < nb_pkts; i++) |
| 65 | *tsc_field(pkts[i]) = now; |
| 66 | return nb_pkts; |
| 67 | } |
| 68 | /* >8 End of callback addition and application. */ |
| 69 | |
| 70 | /* Callback is added to the TX port. 8< */ |