Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/if_var.h
Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | struct if_snd_tag_alloc_header { | ||||
uint32_t type; /* send tag type, see IF_SND_TAG_XXX */ | uint32_t type; /* send tag type, see IF_SND_TAG_XXX */ | ||||
uint32_t flowid; /* mbuf hash value */ | uint32_t flowid; /* mbuf hash value */ | ||||
uint32_t flowtype; /* mbuf hash type */ | uint32_t flowtype; /* mbuf hash type */ | ||||
}; | }; | ||||
struct if_snd_tag_alloc_rate_limit { | struct if_snd_tag_alloc_rate_limit { | ||||
struct if_snd_tag_alloc_header hdr; | struct if_snd_tag_alloc_header hdr; | ||||
uint64_t max_rate; /* in bytes/s */ | uint64_t max_rate; /* in bytes/s */ | ||||
uint32_t flags; /* M_NOWAIT or M_WAITOK */ | |||||
uint32_t reserved; /* alignment */ | |||||
}; | }; | ||||
struct if_snd_tag_rate_limit_params { | struct if_snd_tag_rate_limit_params { | ||||
uint64_t max_rate; /* in bytes/s */ | uint64_t max_rate; /* in bytes/s */ | ||||
uint32_t queue_level; /* 0 (empty) .. 65535 (full) */ | uint32_t queue_level; /* 0 (empty) .. 65535 (full) */ | ||||
#define IF_SND_QUEUE_LEVEL_MIN 0 | #define IF_SND_QUEUE_LEVEL_MIN 0 | ||||
#define IF_SND_QUEUE_LEVEL_MAX 65535 | #define IF_SND_QUEUE_LEVEL_MAX 65535 | ||||
uint32_t reserved; /* padding */ | uint32_t flags; /* M_NOWAIT or M_WAITOK */ | ||||
}; | }; | ||||
union if_snd_tag_alloc_params { | union if_snd_tag_alloc_params { | ||||
struct if_snd_tag_alloc_header hdr; | struct if_snd_tag_alloc_header hdr; | ||||
struct if_snd_tag_alloc_rate_limit rate_limit; | struct if_snd_tag_alloc_rate_limit rate_limit; | ||||
struct if_snd_tag_alloc_rate_limit unlimited; | struct if_snd_tag_alloc_rate_limit unlimited; | ||||
}; | }; | ||||
union if_snd_tag_modify_params { | union if_snd_tag_modify_params { | ||||
struct if_snd_tag_rate_limit_params rate_limit; | struct if_snd_tag_rate_limit_params rate_limit; | ||||
struct if_snd_tag_rate_limit_params unlimited; | struct if_snd_tag_rate_limit_params unlimited; | ||||
}; | }; | ||||
union if_snd_tag_query_params { | union if_snd_tag_query_params { | ||||
struct if_snd_tag_rate_limit_params rate_limit; | struct if_snd_tag_rate_limit_params rate_limit; | ||||
struct if_snd_tag_rate_limit_params unlimited; | struct if_snd_tag_rate_limit_params unlimited; | ||||
}; | }; | ||||
/* Query return flags */ | |||||
#define RT_NOSUPPORT 0x00000000 /* Not supported */ | |||||
#define RT_IS_INDIRECT 0x00000001 /* | |||||
* Interface like a lagg, select | |||||
* the actual interface for | |||||
* capabilities. | |||||
*/ | |||||
#define RT_IS_SELECTABLE 0x00000002 /* | |||||
* No rate table, you select | |||||
* rates and the first | |||||
* number_of_rates are created. | |||||
*/ | |||||
#define RT_IS_FIXED_TABLE 0x00000004 /* A fixed table is attached */ | |||||
#define RT_IS_UNUSABLE 0x00000008 /* It is not usable for this */ | |||||
struct if_ratelimit_query_results { | |||||
const uint64_t *rate_table; /* Pointer to table if present */ | |||||
uint32_t flags; /* Flags indicating results */ | |||||
uint32_t max_flows; /* Max flows using, 0=unlimited */ | |||||
uint32_t number_of_rates; /* How many unique rates can be created */ | |||||
uint32_t min_segment_burst; /* The amount the adapter bursts at each send */ | |||||
}; | |||||
typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, | typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, | ||||
struct m_snd_tag **); | struct m_snd_tag **); | ||||
typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); | typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); | ||||
typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); | typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); | ||||
typedef void (if_snd_tag_free_t)(struct m_snd_tag *); | typedef void (if_snd_tag_free_t)(struct m_snd_tag *); | ||||
typedef void (if_ratelimit_query_t)(struct ifnet *, | |||||
struct if_ratelimit_query_results *); | |||||
/* | /* | ||||
* Structure defining a network interface. | * Structure defining a network interface. | ||||
*/ | */ | ||||
struct ifnet { | struct ifnet { | ||||
/* General book keeping of interface lists. */ | /* General book keeping of interface lists. */ | ||||
CK_STAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained (CK_) */ | CK_STAILQ_ENTRY(ifnet) if_link; /* all struct ifnets are chained (CK_) */ | ||||
LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ | LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ | ||||
CK_STAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if (CK_) */ | CK_STAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if (CK_) */ | ||||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Lines | struct ifnet { | ||||
/* | /* | ||||
* Network adapter send tag support: | * Network adapter send tag support: | ||||
*/ | */ | ||||
if_snd_tag_alloc_t *if_snd_tag_alloc; | if_snd_tag_alloc_t *if_snd_tag_alloc; | ||||
if_snd_tag_modify_t *if_snd_tag_modify; | if_snd_tag_modify_t *if_snd_tag_modify; | ||||
if_snd_tag_query_t *if_snd_tag_query; | if_snd_tag_query_t *if_snd_tag_query; | ||||
if_snd_tag_free_t *if_snd_tag_free; | if_snd_tag_free_t *if_snd_tag_free; | ||||
if_ratelimit_query_t *if_ratelimit_query; | |||||
/* Ethernet PCP */ | /* Ethernet PCP */ | ||||
uint8_t if_pcp; | uint8_t if_pcp; | ||||
/* | /* | ||||
* Netdump hooks to be called while dumping. | * Netdump hooks to be called while dumping. | ||||
*/ | */ | ||||
struct netdump_methods *if_netdump_methods; | struct netdump_methods *if_netdump_methods; | ||||
▲ Show 20 Lines • Show All 389 Lines • Show Last 20 Lines |