FreeBSD kernel IPv4 code
tcp_lro.h File Reference
#include <sys/time.h>
#include <netinet/in.h>
Include dependency graph for tcp_lro.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  lro_address
 
struct  lro_parser
 
struct  lro_entry
 
struct  lro_mbuf_sort
 
struct  lro_ctrl
 
struct  tcp_ackent
 

Macros

#define TCP_LRO_ENTRIES   8
 
#define TSTMP_LRO   0x1000
 
#define TSTMP_HDWR   0x2000
 
#define HAS_TSTMP   0x4000
 
#define TCP_LRO_CPU_DECLARATION_THRESH   50
 
#define LRO_TYPE_NONE   0
 
#define LRO_TYPE_IPV4_TCP   1
 
#define LRO_TYPE_IPV6_TCP   2
 
#define LRO_TYPE_IPV4_UDP   3
 
#define LRO_TYPE_IPV6_UDP   4
 
#define LRO_FLAG_DECRYPTED   1
 
#define LRO_RAW_ADDRESS_MAX    (sizeof(union lro_address) / sizeof(u_long))
 
#define M_ACKCMP   M_PROTO4 /* Indicates LRO is sending in a Ack-compression mbuf */
 
#define M_LRO_EHDRSTRP   M_PROTO6 /* Indicates that LRO has stripped the etherenet header */
 
#define TCP_LRO_LENGTH_MAX   (65535 - 255) /* safe value with room for outer headers */
 
#define TCP_LRO_ACKCNT_MAX   65535 /* unlimited */
 
#define TCP_LRO_NO_ENTRIES   -2
 
#define TCP_LRO_CANNOT   -1
 
#define TCP_LRO_NOT_SUPPORTED   1
 

Functions

union lro_address __aligned (sizeof(u_long))
 
static bool lro_address_compare (const union lro_address *pa, const union lro_address *pb)
 
 LIST_HEAD (lro_head, lro_entry)
 
int tcp_lro_init (struct lro_ctrl *)
 
int tcp_lro_init_args (struct lro_ctrl *, struct ifnet *, unsigned, unsigned)
 
void tcp_lro_free (struct lro_ctrl *)
 
void tcp_lro_flush_inactive (struct lro_ctrl *, const struct timeval *)
 
void tcp_lro_flush (struct lro_ctrl *, struct lro_entry *)
 
void tcp_lro_flush_all (struct lro_ctrl *)
 
int tcp_lro_rx (struct lro_ctrl *, struct mbuf *, uint32_t)
 
void tcp_lro_queue_mbuf (struct lro_ctrl *, struct mbuf *)
 
void tcp_lro_reg_mbufq (void)
 
void tcp_lro_dereg_mbufq (void)
 

Variables

u_long raw [1]
 
struct {
   uint8_t   lro_type
 
   uint8_t   lro_flags
 
   uint16_t   vlan_id
 
   uint16_t   s_port
 
   uint16_t   d_port
 
   uint32_t   vxlan_vni
 
   union {
      struct in_addr   v4
 
      struct in6_addr   v6
 
   }   s_addr
 
   union {
      struct in_addr   v4
 
      struct in6_addr   v6
 
   }   d_addr
 
}; 
 
struct lro_parser __aligned
 

Macro Definition Documentation

◆ HAS_TSTMP

#define HAS_TSTMP   0x4000

Definition at line 59 of file tcp_lro.h.

◆ LRO_FLAG_DECRYPTED

#define LRO_FLAG_DECRYPTED   1

Definition at line 9 of file tcp_lro.h.

◆ LRO_RAW_ADDRESS_MAX

#define LRO_RAW_ADDRESS_MAX    (sizeof(union lro_address) / sizeof(u_long))

Definition at line 94 of file tcp_lro.h.

◆ LRO_TYPE_IPV4_TCP

#define LRO_TYPE_IPV4_TCP   1

Definition at line 4 of file tcp_lro.h.

◆ LRO_TYPE_IPV4_UDP

#define LRO_TYPE_IPV4_UDP   3

Definition at line 6 of file tcp_lro.h.

◆ LRO_TYPE_IPV6_TCP

#define LRO_TYPE_IPV6_TCP   2

Definition at line 5 of file tcp_lro.h.

◆ LRO_TYPE_IPV6_UDP

#define LRO_TYPE_IPV6_UDP   4

Definition at line 7 of file tcp_lro.h.

◆ LRO_TYPE_NONE

#define LRO_TYPE_NONE   0

Definition at line 3 of file tcp_lro.h.

◆ M_ACKCMP

#define M_ACKCMP   M_PROTO4 /* Indicates LRO is sending in a Ack-compression mbuf */

Definition at line 193 of file tcp_lro.h.

◆ M_LRO_EHDRSTRP

#define M_LRO_EHDRSTRP   M_PROTO6 /* Indicates that LRO has stripped the etherenet header */

Definition at line 194 of file tcp_lro.h.

◆ TCP_LRO_ACKCNT_MAX

#define TCP_LRO_ACKCNT_MAX   65535 /* unlimited */

Definition at line 197 of file tcp_lro.h.

◆ TCP_LRO_CANNOT

#define TCP_LRO_CANNOT   -1

Definition at line 211 of file tcp_lro.h.

◆ TCP_LRO_CPU_DECLARATION_THRESH

#define TCP_LRO_CPU_DECLARATION_THRESH   50

Definition at line 64 of file tcp_lro.h.

◆ TCP_LRO_ENTRIES

#define TCP_LRO_ENTRIES   8

Definition at line 41 of file tcp_lro.h.

◆ TCP_LRO_LENGTH_MAX

#define TCP_LRO_LENGTH_MAX   (65535 - 255) /* safe value with room for outer headers */

Definition at line 196 of file tcp_lro.h.

◆ TCP_LRO_NO_ENTRIES

#define TCP_LRO_NO_ENTRIES   -2

Definition at line 210 of file tcp_lro.h.

◆ TCP_LRO_NOT_SUPPORTED

#define TCP_LRO_NOT_SUPPORTED   1

Definition at line 212 of file tcp_lro.h.

◆ TSTMP_HDWR

#define TSTMP_HDWR   0x2000

Definition at line 58 of file tcp_lro.h.

◆ TSTMP_LRO

#define TSTMP_LRO   0x1000

Definition at line 57 of file tcp_lro.h.

Function Documentation

◆ __aligned()

union lro_address __aligned ( sizeof(u_long)  )

◆ LIST_HEAD()

LIST_HEAD ( lro_head  ,
lro_entry   
)

◆ lro_address_compare()

static bool lro_address_compare ( const union lro_address pa,
const union lro_address pb 
)
inlinestatic

Definition at line 100 of file tcp_lro.h.

References LRO_RAW_ADDRESS_MAX, lro_address::lro_type, LRO_TYPE_NONE, and lro_address::raw.

Referenced by tcp_lro_rx_common().

Here is the caller graph for this function:

◆ tcp_lro_dereg_mbufq()

void tcp_lro_dereg_mbufq ( void  )

Definition at line 142 of file tcp_lro.c.

References tcplro_stacks_wanting_mbufq.

Referenced by tcp_addbbr(), and tcp_addrack().

Here is the caller graph for this function:

◆ tcp_lro_flush()

void tcp_lro_flush ( struct lro_ctrl lc,
struct lro_entry le 
)

Definition at line 1383 of file tcp_lro.c.

References lro_ctrl::ifp, lro_ctrl::lro_flushed, lro_ctrl::lro_free, next, tcp_flush_out_entry(), and tcp_lro_condense().

Referenced by tcp_lro_flush_inactive(), and tcp_lro_rx_done().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcp_lro_flush_all()

◆ tcp_lro_flush_inactive()

void tcp_lro_flush_inactive ( struct lro_ctrl lc,
const struct timeval *  timeout 
)

Definition at line 596 of file tcp_lro.c.

References lro_entry::alloc_time, lro_ctrl::lro_active, next, tcp_lro_active_remove(), and tcp_lro_flush().

Here is the call graph for this function:

◆ tcp_lro_free()

◆ tcp_lro_init()

int tcp_lro_init ( struct lro_ctrl lc)

Definition at line 165 of file tcp_lro.c.

References tcp_lro_entries, and tcp_lro_init_args().

Here is the call graph for this function:

◆ tcp_lro_init_args()

int tcp_lro_init_args ( struct lro_ctrl lc,
struct ifnet *  ifp,
unsigned  lro_entries,
unsigned  lro_mbufs 
)

◆ tcp_lro_queue_mbuf()

void tcp_lro_queue_mbuf ( struct lro_ctrl lc,
struct mbuf *  mb 
)

Definition at line 1941 of file tcp_lro.c.

References lro_ctrl::ifp, lro_ctrl::lro_mbuf_count, lro_ctrl::lro_mbuf_data, lro_ctrl::lro_mbuf_max, lro_mbuf_sort::mb, lro_mbuf_sort::seq, and tcp_lro_flush_all().

Here is the call graph for this function:

◆ tcp_lro_reg_mbufq()

void tcp_lro_reg_mbufq ( void  )

Definition at line 136 of file tcp_lro.c.

References tcplro_stacks_wanting_mbufq.

Referenced by tcp_addbbr(), and tcp_addrack().

Here is the caller graph for this function:

◆ tcp_lro_rx()

int tcp_lro_rx ( struct lro_ctrl lc,
struct mbuf *  m,
uint32_t  csum 
)

Definition at line 1916 of file tcp_lro.c.

References lro_ctrl::ifp, lro_ctrl::lro_last_queue_time, tcp_bad_csums, TCP_LRO_CANNOT, and tcp_lro_rx_common().

Here is the call graph for this function:

Variable Documentation

◆ 

struct { ... }

◆ __aligned

struct lro_parser __aligned

◆ 

union { ... } d_addr

◆ d_port

uint16_t d_port

Definition at line 12 of file tcp_lro.h.

◆ lro_flags

uint8_t lro_flags

Definition at line 8 of file tcp_lro.h.

◆ lro_type

uint8_t lro_type

Definition at line 2 of file tcp_lro.h.

◆ raw

u_long raw[1]

Definition at line 0 of file tcp_lro.h.

◆ 

◆ s_port

uint16_t s_port

Definition at line 11 of file tcp_lro.h.

◆ v4

struct in_addr v4

Definition at line 15 of file tcp_lro.h.

◆ v6

struct in6_addr v6

Definition at line 16 of file tcp_lro.h.

◆ vlan_id

uint16_t vlan_id

Definition at line 10 of file tcp_lro.h.

◆ vxlan_vni

uint32_t vxlan_vni

Definition at line 13 of file tcp_lro.h.