TCP LISTEN Sockets

Onload User Guide (UG1586)

Document ID
UG1586
Release Date
2023-07-31
Revision
1.2 English

The following table shows typical output for a TCP LISTEN socket.

Table 1. Stackdump Output: TCP Stack Listen Socket
Sample Output Description
TCP TCP socket.
7:3 Stack:socket id.
lcl=0.0.0.0:50773 Listening on port 50773, local ip address not set (not bound to any IP address).
rmt=0.0.0.0:0 Remote ip:port address not set (not bound to any IP address).
LISTEN Connection is LISTENing.
lock: 10000000 UNLOCKED

Internal socket lock status, as a hexadecimal number, followed by status names including:

  • LOCKED
  • CONTENDED.
rx_wake=0000b6f4(RQ)

Internal sequence value that is incremented each time a receive queue is ‘woken’.

(RQ) indicates that a wake has been requested.

tx_wake=00000002

Internal sequence value that is incremented each time a transmit queue is ‘woken’.

(RQ) indicates that a wake has been requested.

flags:

Flags (if any), including:

  • WK_TX, WK_RX
  • TCP_PP
  • ORPH
  • ACCEPTQ
  • DEFERRED
  • AVOID_INT
  • O_ASYNC, O_NONBLOCK, O_NDELAY, O_APPEND, O_CLOEXEC
  • CACHE, PASSIVE_CACHE, CACHE_NO_FD
  • OS_BACKED
  • NONB_UNSYNCED.
ul_poll: User-level poll():
  • 369599500 spin cycles
  • in spin cycles
  • 100000 usec
  • in μs.
uid=0 User id that owns this socket.
s_flags: REUSE BOUND PBOUND

Socket flags, including:

  • CORK
  • SHUTRD, SHUTWR
  • TCP_NODELAY
  • ACK
  • REUSE
  • KALIVE
  • BCAST
  • OOBIN
  • LINGER
  • DONTROUTE
  • FILTER
  • BOUND, ABOUND, PBOUND
  • SNDBUF, RCVBUF
  • SW_FILTER_FULL
  • TRANSPARENT
  • SCALACTIVE, SCALPASSIVE
  • MAC_FILTER
  • REUSEPORT
  • BOUND_ALIEN
  • CONNECT_MUST_BIND
  • PMTU_DO
  • ALWAYS_DF
  • IP_TTL
  • DEFERRED_BIND
  • V6ONLY
  • NOMCAST.

The sample output allows bind to reuse local port.

rcvbuf=129940 Socket receive buffer size.
sndbuf=131072 Socket send buffer size.
bindtodev=0(0,0x0:0) Device to which the socket is bound, given as an interface, or -1 if unbound. This is followed by an (interface index, hardware port:vlan) tuple.
ttl=64 Initial TTL value.
rcvtimeo_ms=0 Timeout value (microseconds) before an error is generated for receive functions, as set by SO_RCVTIMEO.
sndtimeo_ms=0 Timeout value (microseconds) before an error is generated for send functions, as set by SO_SNDTIMEO.
sigown=0 The PID receiving signals from this socket.
cmsg=

Current message flags, including:

  • NO_MCAST_TX.
rx_errno=6b Zero whilst data can still arrive, otherwise contains error code.
tx_errno=20 Zero if transmit can still happen, otherwise contains error code.
so_error=0 Current socket error, or zero if no error.
os_sock=0 0 if the socket is handled by Onload, 1 if the socket is handled by the OS and not by Onload.
TX Socket is being used for transmit.
listenq:

Listen Queue:

This is a queue of half open connects (SYN received and SYNACK sent, waiting for final ACK).

  • max=1024
  • Maximum number of connections in the queue.
  • n=0
  • Current number of connections in the queue.
  • new=0
  • Length of buffer for first connection in the queue.
  • buckets=1
  • Number of buckets in hash table for queue lookup.
acceptq:

Accept Queue:

This is a queue of open connections, waiting for the application to call accept().

  • max=5
  • Maximum number of connections in the queue.
  • n=0
  • Current number of connections in the queue.
  • accepted=0
  • Number of connections that have been accepted, and so removed from queue.
defer_accept=0 Number of times TCP_DEFER_ACCEPT kicked in (see TCP Level Options), or 255 if TCP_DEFER_ACCEPT is disabled.
sockcache: Socket endpoint cache:
  • n=0
  • Number of endpoints currently known to this socket.
  • sock_n=0
  • Number of available cache entries for this socket.
  • cache=EMPTY
  • EMPTY, or yes if endpoints are in the cache (can be used for an accept).
  • pending=EMPTY
  • EMPTY, or yes if endpoints are waiting to be cached because they are in close-wait (closed but not dropped).
  • connected=EMPTY
  • EMPTY, or yes if endpoints are connected (accepted).
l_overflow=0 Number of times listen queue was full and had to reject a SYN request.
l_no_synrecv=0 Number of times unable to allocate internal resource for a SYN request.
aq_overflow=0 Number of times unable to promote a connection to the accept queue because the queue was full.
aq_no_sock=0 Number of times unable to promote a connection to the accept queue because could not create a socket.
aq_no_pkts=0 Number of times unable to promote a connection to the accept queue because could not create a packet buffer.
a_loop2_closed=0 Number of times the real client for a loopback has gone, and so the connection was closed.
a_no_fd=0 Number of times a file descriptor could not be acquired.
ack_rsts=0 Number of times received an ACK before SYN, so the connection was reset.
os=2 Number of sockets being processed in the kernel.
rx_pkts=0 Number of packets received.