diff options
Diffstat (limited to 'Documentation/networking')
-rw-r--r-- | Documentation/networking/packet_mmap.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Documentation/networking/packet_mmap.txt b/Documentation/networking/packet_mmap.txt index 98f71a5cef00..2546aa4dc232 100644 --- a/Documentation/networking/packet_mmap.txt +++ b/Documentation/networking/packet_mmap.txt | |||
@@ -493,6 +493,32 @@ The user can also use poll() to check if a buffer is available: | |||
493 | pfd.events = POLLOUT; | 493 | pfd.events = POLLOUT; |
494 | retval = poll(&pfd, 1, timeout); | 494 | retval = poll(&pfd, 1, timeout); |
495 | 495 | ||
496 | ------------------------------------------------------------------------------- | ||
497 | + PACKET_TIMESTAMP | ||
498 | ------------------------------------------------------------------------------- | ||
499 | |||
500 | The PACKET_TIMESTAMP setting determines the source of the timestamp in | ||
501 | the packet meta information. If your NIC is capable of timestamping | ||
502 | packets in hardware, you can request those hardware timestamps to used. | ||
503 | Note: you may need to enable the generation of hardware timestamps with | ||
504 | SIOCSHWTSTAMP. | ||
505 | |||
506 | PACKET_TIMESTAMP accepts the same integer bit field as | ||
507 | SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE | ||
508 | and SOF_TIMESTAMPING_RAW_HARDWARE values are recognized by | ||
509 | PACKET_TIMESTAMP. SOF_TIMESTAMPING_SYS_HARDWARE takes precedence over | ||
510 | SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set. | ||
511 | |||
512 | int req = 0; | ||
513 | req |= SOF_TIMESTAMPING_SYS_HARDWARE; | ||
514 | setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req)) | ||
515 | |||
516 | If PACKET_TIMESTAMP is not set, a software timestamp generated inside | ||
517 | the networking stack is used (the behavior before this setting was added). | ||
518 | |||
519 | See include/linux/net_tstamp.h and Documentation/networking/timestamping | ||
520 | for more information on hardware timestamps. | ||
521 | |||
496 | -------------------------------------------------------------------------------- | 522 | -------------------------------------------------------------------------------- |
497 | + THANKS | 523 | + THANKS |
498 | -------------------------------------------------------------------------------- | 524 | -------------------------------------------------------------------------------- |