FreeBSD kernel IPv4 code
sack_filter.c File Reference
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/queue.h>
#include <sys/socket.h>
#include <sys/mbuf.h>
#include <sys/sockopt.h>
#include <netinet/tcp.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_seq.h>
#include "sack_filter.h"
Include dependency graph for sack_filter.c:

Go to the source code of this file.

Macros

#define sack_blk_used(sf, i)   ((1 << i) & sf->sf_bits)
 
#define sack_blk_set(sf, i)   ((1 << i) | sf->sf_bits)
 
#define sack_blk_clr(sf, i)   (~(1 << i) & sf->sf_bits)
 

Functions

 __FBSDID ("$FreeBSD$")
 
void sack_filter_clear (struct sack_filter *sf, tcp_seq seq)
 
static void sack_filter_prune (struct sack_filter *sf, tcp_seq th_ack)
 
static int32_t is_sack_on_board (struct sack_filter *sf, struct sackblk *b)
 
static int32_t sack_filter_old (struct sack_filter *sf, struct sackblk *in, int numblks)
 
static void sack_move_to_empty (struct sack_filter *sf, uint32_t idx)
 
static int32_t sack_filter_new (struct sack_filter *sf, struct sackblk *in, int numblks, tcp_seq th_ack)
 
static int32_t sack_blocks_overlap_or_meet (struct sack_filter *sf, struct sackblk *sb, uint32_t skip)
 
static void sack_collapse (struct sack_filter *sf, int32_t src, int32_t into)
 
static void sack_board_collapse (struct sack_filter *sf)
 
int sack_filter_blks (struct sack_filter *sf, struct sackblk *in, int numblks, tcp_seq th_ack)
 
void sack_filter_reject (struct sack_filter *sf, struct sackblk *in)
 

Macro Definition Documentation

◆ sack_blk_clr

#define sack_blk_clr (   sf,
 
)    (~(1 << i) & sf->sf_bits)

Definition at line 95 of file sack_filter.c.

◆ sack_blk_set

#define sack_blk_set (   sf,
 
)    ((1 << i) | sf->sf_bits)

Definition at line 94 of file sack_filter.c.

◆ sack_blk_used

#define sack_blk_used (   sf,
 
)    ((1 << i) & sf->sf_bits)

Definition at line 93 of file sack_filter.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ is_sack_on_board()

static int32_t is_sack_on_board ( struct sack_filter sf,
struct sackblk b 
)
static

Our board has this entirely in whole or in part:

board |----------—| sack |----------—| <or> board |----------—| sack |-—|

Not near each other:

board |—| sack |—|

Not near each other:

board |—| sack |—|

The board block partial meets:

board |-----—| sack |-------—| <or> board |-----—| sack |-----------—|

up with this one (we have part of it). 1) Update the board block to the new end and 2) Update the start of this block to my end.

The board block partial meets:

board |-----—| sack |-------—| <or> board |-—| sack |-------—| 1) Update the board block to the new start and 2) Update the start of this block to my end.

Definition at line 145 of file sack_filter.c.

References sackblk::end, sack_blk_used, SACK_FILTER_BLOCKS, SEQ_GEQ, SEQ_GT, SEQ_LEQ, SEQ_LT, sack_filter::sf_ack, sack_filter::sf_blks, sack_filter::sf_cur, and sackblk::start.

Referenced by sack_filter_new(), and sack_filter_old().

Here is the caller graph for this function:

◆ sack_blocks_overlap_or_meet()

static int32_t sack_blocks_overlap_or_meet ( struct sack_filter sf,
struct sackblk sb,
uint32_t  skip 
)
static

The two board blocks meet:

board1 |-----—| board2 |-------—| <or> board1 |-----—| board2 |-----------—| <or> board1 |-----—| board2 |-----—|

The board block partial meets:

board |-----—| sack |-------—| <or> board |-—| sack |-------—| 1) Update the board block to the new start and 2) Update the start of this block to my end.

Definition at line 370 of file sack_filter.c.

References sackblk::end, sack_blk_used, SACK_FILTER_BLOCKS, SEQ_GEQ, SEQ_LEQ, sack_filter::sf_blks, and sackblk::start.

Referenced by sack_board_collapse().

Here is the caller graph for this function:

◆ sack_board_collapse()

static void sack_board_collapse ( struct sack_filter sf)
static

Definition at line 437 of file sack_filter.c.

References sack_blk_used, sack_blocks_overlap_or_meet(), sack_collapse(), SACK_FILTER_BLOCKS, sack_filter::sf_blks, and sack_filter::sf_cur.

Referenced by sack_filter_blks().

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

◆ sack_collapse()

static void sack_collapse ( struct sack_filter sf,
int32_t  src,
int32_t  into 
)
static

Definition at line 422 of file sack_filter.c.

References sackblk::end, sack_blk_clr, SEQ_GT, SEQ_LT, sack_filter::sf_bits, sack_filter::sf_blks, sack_filter::sf_used, and sackblk::start.

Referenced by sack_board_collapse().

Here is the caller graph for this function:

◆ sack_filter_blks()

int sack_filter_blks ( struct sack_filter sf,
struct sackblk in,
int  numblks,
tcp_seq  th_ack 
)

Definition at line 499 of file sack_filter.c.

References sack_blk_set, sack_board_collapse(), SACK_FILTER_BLOCKS, sack_filter_new(), sack_filter_old(), sack_filter_prune(), SEQ_GEQ, SEQ_GT, sack_filter::sf_ack, sack_filter::sf_bits, sack_filter::sf_blks, sack_filter::sf_cur, and sack_filter::sf_used.

Referenced by bbr_log_ack(), and rack_log_ack().

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

◆ sack_filter_clear()

◆ sack_filter_new()

static int32_t sack_filter_new ( struct sack_filter sf,
struct sackblk in,
int  numblks,
tcp_seq  th_ack 
)
static

Definition at line 305 of file sack_filter.c.

References is_sack_on_board(), sack_blk_set, sack_blk_used, SACK_FILTER_BLOCKS, sack_move_to_empty(), sack_filter::sf_bits, sack_filter::sf_blks, sack_filter::sf_cur, and sack_filter::sf_used.

Referenced by sack_filter_blks().

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

◆ sack_filter_old()

static int32_t sack_filter_old ( struct sack_filter sf,
struct sackblk in,
int  numblks 
)
static

Definition at line 247 of file sack_filter.c.

References is_sack_on_board().

Referenced by sack_filter_blks().

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

◆ sack_filter_prune()

static void sack_filter_prune ( struct sack_filter sf,
tcp_seq  th_ack 
)
static

Definition at line 114 of file sack_filter.c.

References sackblk::end, sack_blk_clr, sack_blk_used, SACK_FILTER_BLOCKS, SEQ_GT, sack_filter::sf_ack, sack_filter::sf_bits, sack_filter::sf_blks, sack_filter::sf_used, and sackblk::start.

Referenced by sack_filter_blks().

Here is the caller graph for this function:

◆ sack_filter_reject()

void sack_filter_reject ( struct sack_filter sf,
struct sackblk in 
)

Definition at line 561 of file sack_filter.c.

References sackblk::end, sack_blk_clr, sack_blk_used, SACK_FILTER_BLOCKS, SEQ_GT, SEQ_LT, sack_filter::sf_bits, sack_filter::sf_blks, sack_filter::sf_used, and sackblk::start.

Referenced by bbr_proc_sack_blk().

Here is the caller graph for this function:

◆ sack_move_to_empty()

static void sack_move_to_empty ( struct sack_filter sf,
uint32_t  idx 
)
static

Definition at line 287 of file sack_filter.c.

References sack_blk_clr, sack_blk_set, sack_blk_used, SACK_FILTER_BLOCKS, sack_filter::sf_bits, and sack_filter::sf_blks.

Referenced by sack_filter_new().

Here is the caller graph for this function: