OSDN Git Service

net/sched: Make etf report drops on error_queue
authorJesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Tue, 3 Jul 2018 22:43:00 +0000 (15:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jul 2018 13:30:28 +0000 (22:30 +0900)
commit4b15c7075352668d4467ced7594b676707d11cae
tree18de5104ec6df0136c947556e6c9bc0dbad8fd2e
parent3048cf84d152344f874e993558770bba73a65c8f
net/sched: Make etf report drops on error_queue

Use the socket error queue for reporting dropped packets if the
socket has enabled that feature through the SO_TXTIME API.

Packets are dropped either on enqueue() if they aren't accepted by the
qdisc or on dequeue() if the system misses their deadline. Those are
reported as different errors so applications can react accordingly.

Userspace can retrieve the errors through the socket error queue and the
corresponding cmsg interfaces. A struct sock_extended_err* is used for
returning the error data, and the packet's timestamp can be retrieved by
adding both ee_data and ee_info fields as e.g.:

    ((__u64) serr->ee_data << 32) + serr->ee_info

This feature is disabled by default and must be explicitly enabled by
applications. Enabling it can bring some overhead for the Tx cycles
of the application.

Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
include/uapi/linux/errqueue.h
include/uapi/linux/net_tstamp.h
net/core/sock.c
net/sched/sch_etf.c