FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
kernel_datagram_source.hpp File Reference

kernel DatagramSource (ADR-0015, section 2): one UDP socket per subscription, bound to the group and port, SO_REUSEADDR, IP_MULTICAST_ALL off, joined any-source or source-specific (a unicast "group" is a local address: bound, not joined); recvmmsg in fixed batches; SO_TIMESTAMPING for kernel and NIC receive times. More...

#include "fastmm/net/datagram_source.hpp"
#include "fastmm/net/udp_socket.hpp"
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <cstddef>
#include <cstdint>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

struct  fastmm::net::DatagramSubscription
 
struct  fastmm::net::KernelSourceConfig
 
struct  fastmm::net::KernelSourceOpen
 Outcome of open(). err is 0 or -errno of the step that failed, for subscription line. More...
 
class  fastmm::net::KernelDatagramSource
 

Namespaces

namespace  fastmm
 
namespace  fastmm::net
 

Detailed Description

kernel DatagramSource (ADR-0015, section 2): one UDP socket per subscription, bound to the group and port, SO_REUSEADDR, IP_MULTICAST_ALL off, joined any-source or source-specific (a unicast "group" is a local address: bound, not joined); recvmmsg in fixed batches; SO_TIMESTAMPING for kernel and NIC receive times.

Runs unmodified under Onload.

open() allocates every buffer (headers, iovecs, addresses, control messages, payload slots: lines x batch x max_datagram bytes); poll() does not allocate. poll() makes one recvmmsg call per line and returns the datagrams delivered; with an edge-triggered reactor, call it until it returns 0 (every socket reported EAGAIN).

NIC timestamps need SIOCSHWTSTAMP on the interface first (enable_hw_timestamps(), CAP_NET_ADMIN); SOF_TIMESTAMPING_RX_HARDWARE alone does nothing.