Lines Matching +full:software +full:- +full:generated

1 .. SPDX-License-Identifier: GPL-2.0
43 -------------------------------------------------------------
59 -------------------------------------------------------------------
72 ----------------------------------------------------------------------
97 Timestamps may also be generated for reasons other than being
102 Request rx timestamps generated by the network adapter.
106 are generated just after a device driver hands a packet to the
110 Request tx timestamps generated by the network adapter. This flag
115 are generated in the device driver as close as possible, but always
130 a timestamp is generated at each layer. This allows for fine
138 over-report measurement, because the timestamp is generated when all
145 timestamp is generated by the kernel when it receives packet a
156 generated control message. Changes to the bits take immediate
162 Report any software timestamps when available.
168 Report hardware timestamps as generated by
189 is derived from a per-socket u32 counter (that wraps). For datagram
205 The process can optionally override the default generated ID, by
212 cmsg->cmsg_level = SOL_SOCKET;
213 cmsg->cmsg_type = SCM_TS_OPT_ID;
214 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32));
230 a timestamp with counter N-1. SOF_TIMESTAMPING_OPT_ID_TCP
280 received the packet and its length at layer 2. A valid (non-zero)
286 Request both hardware and software timestamps for outgoing packets
288 are enabled at the same time. If both timestamps are generated,
296 Receive timestamps are generated early in the ingress path, before a
305 ignore the unexpected non-zero value. But it makes behavior subtly
332 cmsg->cmsg_level = SOL_SOCKET;
333 cmsg->cmsg_type = SO_TIMESTAMPING;
334 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32));
352 -------------------------
362 correlating a timestamp with data is non-trivial. A range of bytes
380 bytestreams, we chose that a timestamp is generated only when all
391 relevant sequence number in skb_shinfo(skb)->tskey. Because an skbuff
392 has only one such field, only one timestamp can be generated.
400 autocork. After linux-4.7, a better way to prevent coalescing is
403 These precautions ensure that the timestamp is generated only when all
417 page (`man 7 socket`) describes how timestamps generated with
422 ----------------------------
445 feature. At least one field is non-zero at any time. Most timestamps
452 as linuxptp. For the PTP clock API, see Documentation/driver-api/ptp.rst.
456 software timestamp will be generated in the recvmsg() call and passed
457 in ts[0] when a real software timestamp is missing. This happens also
489 is the first if ts[2] is non-zero, the second otherwise, in which
517 Reading from the error queue is always a non-blocking operation. To
532 implicitly defined. ts[0] holds a software timestamp if set, ts[1]
582 If the requested fine-grained filtering for incoming packets is not
589 /* possible values for hwtstamp_config->tx_type */
607 /* possible values for hwtstamp_config->rx_filter */
627 --------------------------------------------------------
646 Time stamps for outgoing packets are to be generated as follows:
648 - In hard_start_xmit(), check if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)
649 is set no-zero. If yes, then the driver is expected to do hardware time
651 - If this is possible for the skb and requested, then declare
653 SKBTX_IN_PROGRESS in skb_shinfo(skb)->tx_flags , e.g. with::
655 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
660 software generated time stamps by the network subsystem.
661 - Driver should call skb_tx_timestamp() as close to passing sk_buff to hardware
662 as possible. skb_tx_timestamp() provides a software time stamp if requested
664 - As soon as the driver has sent the packet and/or obtained a
670 should not fall back to software time stamping. The rationale is that
672 software time stamping and therefore could lead to unexpected deltas
676 ----------------------------------------------------------
717 - ``.port_txtstamp()``: a hook called prior to the transmission of
719 This is required for two-step timestamping, since the hardware
722 packet so that it can re-enqueue the packet back into the socket's
725 in skb->cb and enqueue a tx skb queue. Typically, a switch will have a
728 key-value pairs of PTP sequence ID/message type/domain number and the
736 One-step TX timestamping do not require packet cloning, since there is
737 no follow-up message required by the PTP protocol (because the
740 to be re-enqueued into its socket's error queue.
742 - ``.port_rxtstamp()``: On RX, the BPF classifier is run by DSA to
747 timestamps might either be available in-band (through metadata in the
748 DSA header, or attached in other ways to the packet), or out-of-band
764 mii_timestamper`` and add a pointer to it in ``phydev->mii_ts``. The presence
772 - Checking, in ``.ndo_eth_ioctl``, whether ``phy_has_hwtstamp(netdev->phydev)``
776 - On RX, special intervention may or may not be needed, depending on the
779 ``skb_defer_rx_timestamp(skb)`` is necessary or not - and if it is, don't
781 enabled, and ``skb->dev->phydev->mii_ts`` exists, its ``.rxtstamp()`` hook
792 - On TX, again, special intervention might or might not be needed. The
793 function that calls the ``mii_ts->txtstamp()`` hook is named
797 drivers already perform for software timestamping purposes. Therefore, if a
798 MAC supports software timestamping, it does not need to do anything further
818 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
829 the ``.ndo_eth_ioctl`` ("``priv->hwtstamp_tx_enabled == true``") and the
830 current skb requires a TX timestamp ("``skb_shinfo(skb)->tx_flags &
832 "``skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS``" flag. Note: as
840 "``skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS``" was set. With a stacked
847 "``skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS``", but also for
848 "``priv->hwtstamp_tx_enabled == true``". Because the rest of the system ensures