libnl 3.7.0
|
SR-IOV VF link module. More...
Data Structures | |
struct | nl_vf_vlan_info |
SRIOV VF VFLAN settings. More... | |
struct | nl_vf_vlans |
SRIOV VF VLANs information. More... | |
struct | nl_vf_rate |
VF Rate information structure. More... | |
struct | rtnl_link_vf |
SRIOV VF object. More... | |
Typedefs | |
typedef struct nl_vf_vlan_info | nl_vf_vlan_info_t |
SRIOV VF VFLAN settings. | |
typedef struct nl_vf_vlans | nl_vf_vlans_t |
SRIOV VF VLANs information. | |
Enumerations | |
enum | rtnl_link_rate_api_t { RTNL_LINK_VF_RATE_API_UNSPEC , RTNL_LINK_VF_RATE_API_OLD , RTNL_LINK_VF_RATE_API_NEW , __RTNL_LINK_VF_RATE_API_MAX } |
enum | rtnl_link_vf_stats_t { RTNL_LINK_VF_STATS_RX_PACKETS , RTNL_LINK_VF_STATS_TX_PACKETS , RTNL_LINK_VF_STATS_RX_BYTES , RTNL_LINK_VF_STATS_TX_BYTES , RTNL_LINK_VF_STATS_BROADCAST , RTNL_LINK_VF_STATS_MULTICAST , __RTNL_LINK_VF_STATS_MAX } |
Functions | |
int | rtnl_link_sriov_clone (struct rtnl_link *dst, struct rtnl_link *src) |
void | rtnl_link_sriov_dump_details (struct rtnl_link *link, struct nl_dump_params *p) |
void | rtnl_link_sriov_dump_stats (struct rtnl_link *link, struct nl_dump_params *p) |
void | rtnl_link_sriov_free_data (struct rtnl_link *link) |
int | rtnl_link_sriov_fill_vflist (struct nl_msg *msg, struct rtnl_link *link) |
int | rtnl_link_sriov_parse_vflist (struct rtnl_link *link, struct nlattr **tb) |
Utilities | |
char * | rtnl_link_vf_linkstate2str (uint32_t ls, char *buf, size_t len) |
int | rtnl_link_vf_str2linkstate (const char *name) |
char * | rtnl_link_vf_vlanproto2str (uint16_t proto, char *buf, size_t len) |
int | rtnl_link_vf_str2vlanproto (const char *name) |
int | rtnl_link_vf_str2guid (uint64_t *guid, const char *guid_s) |
SR-IOV Sub-Object | |
int | rtnl_link_vf_add (struct rtnl_link *link, struct rtnl_link_vf *vf_data) |
Add a SRIOV VF object to a link object. More... | |
struct rtnl_link_vf * | rtnl_link_vf_alloc (void) |
Allocate a new SRIOV VF object. More... | |
void | rtnl_link_vf_free (struct rtnl_link_vf *vf_data) |
Free SRIOV VF object. More... | |
struct rtnl_link_vf * | rtnl_link_vf_get (struct rtnl_link *link, uint32_t vf_num) |
Lookup SRIOV VF in link object by VF index. More... | |
void | rtnl_link_vf_put (struct rtnl_link_vf *vf_data) |
Return SRIOV VF object to the owning link object. More... | |
int | rtnl_link_vf_get_addr (struct rtnl_link_vf *vf_data, struct nl_addr **addr) |
Get link layer address of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_addr (struct rtnl_link_vf *vf_data, struct nl_addr *addr) |
Set link layer address of SRIOV Virtual Function object. More... | |
void | rtnl_link_vf_set_ib_node_guid (struct rtnl_link_vf *vf_data, uint64_t guid) |
Set the Infiniband node GUID for the SRIOV Virtual Function object. More... | |
void | rtnl_link_vf_set_ib_port_guid (struct rtnl_link_vf *vf_data, uint64_t guid) |
Set the Infiniband port GUID for the SRIOV Virtual Function object. More... | |
int | rtnl_link_vf_get_index (struct rtnl_link_vf *vf_data, uint32_t *vf_index) |
Get index of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_index (struct rtnl_link_vf *vf_data, uint32_t vf_index) |
Set index of SRIOV Virtual Function object. More... | |
int | rtnl_link_vf_get_linkstate (struct rtnl_link_vf *vf_data, uint32_t *vf_linkstate) |
Get link state of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_linkstate (struct rtnl_link_vf *vf_data, uint32_t vf_linkstate) |
Set link state of SRIOV Virtual Function object. More... | |
int | rtnl_link_vf_get_rate (struct rtnl_link_vf *vf_data, struct nl_vf_rate *vf_rate) |
Get TX Rate Limit of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_rate (struct rtnl_link_vf *vf_data, struct nl_vf_rate *vf_rate) |
Set TX Rate Limit of SRIOV Virtual Function object. More... | |
int | rtnl_link_vf_get_rss_query_en (struct rtnl_link_vf *vf_data, uint32_t *vf_rss_query_en) |
Get RSS Query EN value of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_rss_query_en (struct rtnl_link_vf *vf_data, uint32_t vf_rss_query_en) |
Set RSS configuration querying of SRIOV Virtual Function Object. More... | |
int | rtnl_link_vf_get_spoofchk (struct rtnl_link_vf *vf_data, uint32_t *vf_spoofchk) |
Get spoof checking value of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_spoofchk (struct rtnl_link_vf *vf_data, uint32_t vf_spoofchk) |
Set spoof checking value of SRIOV Virtual Function Object. More... | |
int | rtnl_link_vf_get_stat (struct rtnl_link_vf *vf_data, rtnl_link_vf_stats_t stat, uint64_t *vf_stat) |
Get value of stat counter for SRIOV Virtual Function. More... | |
int | rtnl_link_vf_get_trust (struct rtnl_link_vf *vf_data, uint32_t *vf_trust) |
Get trust setting of SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_trust (struct rtnl_link_vf *vf_data, uint32_t vf_trust) |
Set user trust setting on SRIOV Virtual Function Object. More... | |
int | rtnl_link_vf_get_vlans (struct rtnl_link_vf *vf_data, nl_vf_vlans_t **vf_vlans) |
Get an array of VLANS on SRIOV Virtual Function. More... | |
void | rtnl_link_vf_set_vlans (struct rtnl_link_vf *vf_data, nl_vf_vlans_t *vf_vlans) |
Add a SRIOV VF VLANs object to the SRIOV Virtual Function Object. More... | |
int | rtnl_link_vf_vlan_alloc (nl_vf_vlans_t **vf_vlans, int vlan_count) |
Allocate a SRIOV VF VLAN object. More... | |
void | rtnl_link_vf_vlan_free (nl_vf_vlans_t *vf_vlans) |
Free an allocated SRIOV VF VLANs object. More... | |
void | rtnl_link_vf_vlan_put (nl_vf_vlans_t *vf_vlans) |
Return SRIOV VF VLANs object to the owning SRIOV VF object. More... | |
SR-IOV VF link module.
SR-IOV (Single Root Input/Output Virtualization) is a network interface that allows for the isolation of the PCI Express resources. In a virtual environment, SR-IOV allows multiple virtual machines can share a single PCI Express hardware interface. This is done via VFs (Virtual Functions), virtual hardware devices with their own PCI address.
enum rtnl_link_rate_api_t |
enum rtnl_link_vf_stats_t |
void rtnl_link_sriov_dump_details | ( | struct rtnl_link * | link, |
struct nl_dump_params * | p | ||
) |
void rtnl_link_sriov_dump_stats | ( | struct rtnl_link * | link, |
struct nl_dump_params * | p | ||
) |
int rtnl_link_sriov_fill_vflist | ( | struct nl_msg * | msg, |
struct rtnl_link * | link | ||
) |
int rtnl_link_sriov_parse_vflist | ( | struct rtnl_link * | link, |
struct nlattr ** | tb | ||
) |
int rtnl_link_vf_add | ( | struct rtnl_link * | link, |
struct rtnl_link_vf * | vf_data | ||
) |
Add a SRIOV VF object to a link object.
link | Link object to add to |
vf_data | SRIOV VF object to add |
link
or vf_data
not provided Definition at line 711 of file sriov.c.
References rtnl_link_vf_alloc().
struct rtnl_link_vf * rtnl_link_vf_alloc | ( | void | ) |
Allocate a new SRIOV VF object.
The SRIOV VF object must be returned to the link object with rtnl_link_vf_put() when operations are done to prevent memory leaks.
Definition at line 746 of file sriov.c.
Referenced by rtnl_link_vf_add().
void rtnl_link_vf_free | ( | struct rtnl_link_vf * | vf_data | ) |
Free SRIOV VF object.
vf_data | SRIOV VF data object |
Definition at line 764 of file sriov.c.
References nl_addr_put(), and rtnl_link_vf_vlan_put().
Referenced by rtnl_link_vf_put().
struct rtnl_link_vf * rtnl_link_vf_get | ( | struct rtnl_link * | link, |
uint32_t | vf_num | ||
) |
Lookup SRIOV VF in link object by VF index.
The SRIOV VF object must be returned to the link object with rtnl_link_vf_put() when operations are done to prevent memory leaks.
void rtnl_link_vf_put | ( | struct rtnl_link_vf * | vf_data | ) |
Return SRIOV VF object to the owning link object.
vf_data | SRIOV VF data object |
Definition at line 820 of file sriov.c.
References rtnl_link_vf_free().
int rtnl_link_vf_get_addr | ( | struct rtnl_link_vf * | vf_data, |
struct nl_addr ** | addr | ||
) |
Get link layer address of SRIOV Virtual Function.
vf_data | SRIOV VF object |
addr | Pointer to store Link Layer address |
void rtnl_link_vf_set_addr | ( | struct rtnl_link_vf * | vf_data, |
struct nl_addr * | addr | ||
) |
Set link layer address of SRIOV Virtual Function object.
vf_data | SRIOV VF object |
addr | New link layer address |
This function increments the reference counter of the address object and overwrites any existing link layer address previously assigned.
Definition at line 873 of file sriov.c.
References nl_addr_get(), and nl_addr_put().
void rtnl_link_vf_set_ib_node_guid | ( | struct rtnl_link_vf * | vf_data, |
uint64_t | guid | ||
) |
void rtnl_link_vf_set_ib_port_guid | ( | struct rtnl_link_vf * | vf_data, |
uint64_t | guid | ||
) |
int rtnl_link_vf_get_index | ( | struct rtnl_link_vf * | vf_data, |
uint32_t * | vf_index | ||
) |
Get index of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_index | Pointer to store VF index |
void rtnl_link_vf_set_index | ( | struct rtnl_link_vf * | vf_data, |
uint32_t | vf_index | ||
) |
Set index of SRIOV Virtual Function object.
vf_data | SRIOV VF object |
vf_index | Index value |
int rtnl_link_vf_get_linkstate | ( | struct rtnl_link_vf * | vf_data, |
uint32_t * | vf_linkstate | ||
) |
Get link state of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_linkstate | Pointer to store VF link state |
void rtnl_link_vf_set_linkstate | ( | struct rtnl_link_vf * | vf_data, |
uint32_t | vf_linkstate | ||
) |
Set link state of SRIOV Virtual Function object.
vf_data | SRIOV VF object |
vf_linkstate | Link state value |
Not all hardware supports setting link state. If the feature is unsupported, the link change request will fail with -NLE_OPNOTSUPP
int rtnl_link_vf_get_rate | ( | struct rtnl_link_vf * | vf_data, |
struct nl_vf_rate * | vf_rate | ||
) |
Get TX Rate Limit of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_rate | Pointer to store VF rate limiting data |
When the older rate API has been implemented, the rate member of the struct will be set, and the api member will be set to RTNL_LINK_VF_API_OLD. When the newer rate API has been implemented, the max_tx_rate and/or the minx_tx_rate will be set, and the api member will be set to RTNL_LINK_VF_API_NEW.
Old rate API supports only a maximum TX rate. ip link set dev vf 0 rate New rate API supports minumum and maximum TX rates. ip link set dev vf 0 min_tx_rate ip link set dev vf 0 max_tx_rate
Definition at line 1017 of file sriov.c.
References nl_vf_rate::api, nl_vf_rate::max_tx_rate, nl_vf_rate::min_tx_rate, nl_vf_rate::rate, RTNL_LINK_VF_RATE_API_NEW, RTNL_LINK_VF_RATE_API_OLD, and RTNL_LINK_VF_RATE_API_UNSPEC.
void rtnl_link_vf_set_rate | ( | struct rtnl_link_vf * | vf_data, |
struct nl_vf_rate * | vf_rate | ||
) |
Set TX Rate Limit of SRIOV Virtual Function object.
vf_data | SRIOV VF object |
vf_rate | Rate limiting structure |
When setting the rate, the API level must be specificed. Valid API levels: RTNL_LINK_VF_RATE_API_NEW RTNL_LINK_VF_RATE_API_OLD
When using the new API, if either the min_tx_rate or max_tx_rate has been set, and the other is being changed, you must specify the currently set values to preserve them. If this is not done, that setting will be disabled.
Old rate API supports only a maximum TX rate. ip link set dev vf 0 rate New rate API supports minumum and maximum TX rates. ip link set dev vf 0 min_tx_rate ip link set dev vf 0 max_tx_rate
Not all hardware supports min_tx_rate.
Definition at line 1083 of file sriov.c.
References nl_vf_rate::api, nl_vf_rate::max_tx_rate, nl_vf_rate::min_tx_rate, nl_vf_rate::rate, RTNL_LINK_VF_RATE_API_NEW, and RTNL_LINK_VF_RATE_API_OLD.
int rtnl_link_vf_get_rss_query_en | ( | struct rtnl_link_vf * | vf_data, |
uint32_t * | vf_rss_query_en | ||
) |
Get RSS Query EN value of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_rss_query_en | Pointer to store VF RSS Query value |
void rtnl_link_vf_set_rss_query_en | ( | struct rtnl_link_vf * | vf_data, |
uint32_t | vf_rss_query_en | ||
) |
Set RSS configuration querying of SRIOV Virtual Function Object.
vf_data | SRIOV VF object |
vf_rss_query_en | RSS Query value |
int rtnl_link_vf_get_spoofchk | ( | struct rtnl_link_vf * | vf_data, |
uint32_t * | vf_spoofchk | ||
) |
Get spoof checking value of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_spoofchk | Pointer to store VF spoofchk value |
void rtnl_link_vf_set_spoofchk | ( | struct rtnl_link_vf * | vf_data, |
uint32_t | vf_spoofchk | ||
) |
Set spoof checking value of SRIOV Virtual Function Object.
vf_data | |
vf_spoofchk |
int rtnl_link_vf_get_stat | ( | struct rtnl_link_vf * | vf_data, |
rtnl_link_vf_stats_t | stat, | ||
uint64_t * | vf_stat | ||
) |
Get value of stat counter for SRIOV Virtual Function.
vf_data | SRIOV VF object |
stat | Identifier of statistical counter |
vf_stat | Pointer to store VF stat value in |
int rtnl_link_vf_get_trust | ( | struct rtnl_link_vf * | vf_data, |
uint32_t * | vf_trust | ||
) |
Get trust setting of SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_trust | Pointer to store VF trust value |
void rtnl_link_vf_set_trust | ( | struct rtnl_link_vf * | vf_data, |
uint32_t | vf_trust | ||
) |
Set user trust setting on SRIOV Virtual Function Object.
vf_data | |
vf_trust |
int rtnl_link_vf_get_vlans | ( | struct rtnl_link_vf * | vf_data, |
nl_vf_vlans_t ** | vf_vlans | ||
) |
Get an array of VLANS on SRIOV Virtual Function.
vf_data | SRIOV VF object |
vf_vlans | Pointer to nl_vf_vlans_t struct to store vlan info. |
The SRIOV VF VLANs object must be returned to the SRIOV VF object with rtnl_link_vf_vlans_put() when operations are done to prevent memory leaks.
Definition at line 1261 of file sriov.c.
References nl_vf_vlans::ce_refcnt.
void rtnl_link_vf_set_vlans | ( | struct rtnl_link_vf * | vf_data, |
nl_vf_vlans_t * | vf_vlans | ||
) |
Add a SRIOV VF VLANs object to the SRIOV Virtual Function Object.
vf_data | SRIOV VF object |
vf_vlans | SRIOV VF VLANs object |
This function assigns ownership of the SRIOV VF object vf_vlans
to the SRIOV Virtual Function object vf_data
. Do not use rtnl_link_vf_vlan_put() on vf_vlans
after this.
int rtnl_link_vf_vlan_alloc | ( | nl_vf_vlans_t ** | vf_vlans, |
int | vlan_count | ||
) |
Allocate a SRIOV VF VLAN object.
vf_vlans | Pointer to store VLAN object at |
vlan_count | Number of VLANs that will be stored in VLAN object |
The SRIOV VF VLANs object must be returned to the sRIOV VF object with rtnl_link_vf_vlan_put() when operations are done to prevent memory leaks.
Definition at line 1314 of file sriov.c.
References nl_vf_vlans::ce_refcnt, nl_vf_vlans::size, and nl_vf_vlans::vlans.
void rtnl_link_vf_vlan_free | ( | nl_vf_vlans_t * | vf_vlans | ) |
Free an allocated SRIOV VF VLANs object.
vf_vlans | SRIOV VF VLANs object |
Definition at line 1345 of file sriov.c.
References nl_vf_vlans::ce_refcnt, and nl_vf_vlans::vlans.
Referenced by rtnl_link_vf_vlan_put().
void rtnl_link_vf_vlan_put | ( | nl_vf_vlans_t * | vf_vlans | ) |
Return SRIOV VF VLANs object to the owning SRIOV VF object.
vf_vlans | SRIOV VF VLANs object |
Definition at line 1363 of file sriov.c.
References nl_vf_vlans::ce_refcnt, and rtnl_link_vf_vlan_free().
Referenced by rtnl_link_vf_free().
char * rtnl_link_vf_linkstate2str | ( | uint32_t | ls, |
char * | buf, | ||
size_t | len | ||
) |
char * rtnl_link_vf_vlanproto2str | ( | uint16_t | proto, |
char * | buf, | ||
size_t | len | ||
) |