libnl: SRIOV

libnl 3.12.0

SRIOV
Routing Library (libnl-route) » Links (Interfaces)

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.
struct rtnl_link_vf * | rtnl_link_vf_alloc (void)
| Allocate a new SRIOV VF object.
void | rtnl_link_vf_free (struct rtnl_link_vf *vf_data)
| Free SRIOV VF object.
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.
void | rtnl_link_vf_put (struct rtnl_link_vf *vf_data)
| Return SRIOV VF object to the owning link object.
int | rtnl_link_vf_get_addr (struct rtnl_link_vf *vf_data, struct nl_addr **addr)
| Get link layer address of SRIOV Virtual Function.
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.
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.
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.
int | rtnl_link_vf_get_index (struct rtnl_link_vf *vf_data, uint32_t *vf_index)
| Get index of SRIOV Virtual Function.
void | rtnl_link_vf_set_index (struct rtnl_link_vf *vf_data, uint32_t vf_index)
| Set index of SRIOV Virtual Function object.
int | rtnl_link_vf_get_linkstate (struct rtnl_link_vf *vf_data, uint32_t *vf_linkstate)
| Get link state of SRIOV Virtual Function.
void | rtnl_link_vf_set_linkstate (struct rtnl_link_vf *vf_data, uint32_t vf_linkstate)
| Set link state of SRIOV Virtual Function object.
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.
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.
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.
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.
int | rtnl_link_vf_get_spoofchk (struct rtnl_link_vf *vf_data, uint32_t *vf_spoofchk)
| Get spoof checking value of SRIOV Virtual Function.
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.
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.
int | rtnl_link_vf_get_trust (struct rtnl_link_vf *vf_data, uint32_t *vf_trust)
| Get trust setting of SRIOV Virtual Function.
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.
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.
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.
int | rtnl_link_vf_vlan_alloc (nl_vf_vlans_t **vf_vlans, int vlan_count)
| Allocate a SRIOV VF VLAN object.
void | rtnl_link_vf_vlan_free (nl_vf_vlans_t *vf_vlans)
| Free an allocated SRIOV VF VLANs object.
void | rtnl_link_vf_vlan_put (nl_vf_vlans_t *vf_vlans)
| Return SRIOV VF VLANs object to the owning SRIOV VF object.

## Detailed Description

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.

## Enumeration Type Documentation

## ◆ rtnl_link_rate_api_t

enum rtnl_link_rate_api_t

Enumerator
RTNL_LINK_VF_RATE_API_UNSPEC | Unspecified API type
RTNL_LINK_VF_RATE_API_OLD | Old Rate setting API
RTNL_LINK_VF_RATE_API_NEW | New Rate setting API

Definition at line 22 of file sriov.h.

## ◆ rtnl_link_vf_stats_t

enum rtnl_link_vf_stats_t

Enumerator
RTNL_LINK_VF_STATS_RX_PACKETS | Packets Received
RTNL_LINK_VF_STATS_TX_PACKETS | Packets Sent
RTNL_LINK_VF_STATS_RX_BYTES | Bytes Recieved
RTNL_LINK_VF_STATS_TX_BYTES | Bytes Sent
RTNL_LINK_VF_STATS_BROADCAST | Broadcast packets received
RTNL_LINK_VF_STATS_MULTICAST | Multicast packets received

Definition at line 34 of file sriov.h.

## Function Documentation

## ◆ rtnl_link_sriov_clone()

int rtnl_link_sriov_clone | ( | struct rtnl_link * | dst,
|  | struct rtnl_link * | src )

Definition at line 103 of file sriov.c.

## ◆ rtnl_link_sriov_dump_details()

void rtnl_link_sriov_dump_details | ( | struct rtnl_link * | link,
|  | struct nl_dump_params * | p )

Definition at line 229 of file sriov.c.

## ◆ rtnl_link_sriov_dump_stats()

void rtnl_link_sriov_dump_stats | ( | struct rtnl_link * | link,
|  | struct nl_dump_params * | p )

Definition at line 278 of file sriov.c.

## ◆ rtnl_link_sriov_free_data()

void rtnl_link_sriov_free_data | ( | struct rtnl_link * | link | ) |

Definition at line 293 of file sriov.c.

## ◆ rtnl_link_sriov_fill_vflist()

int rtnl_link_sriov_fill_vflist | ( | struct nl_msg * | msg,
|  | struct rtnl_link * | link )

Definition at line 511 of file sriov.c.

## ◆ rtnl_link_sriov_parse_vflist()

int rtnl_link_sriov_parse_vflist | ( | struct rtnl_link * | link,
|  | struct nlattr ** | tb )

Definition at line 537 of file sriov.c.

## ◆ rtnl_link_vf_add()

int rtnl_link_vf_add | ( | struct rtnl_link * | link,
|  | struct rtnl_link_vf * | vf_data )

Add a SRIOV VF object to a link object.

Parameters

  link | Link object to add to
  vf_data | SRIOV VF object to add

Returns
  0 if SRIOV VF object added successfully
  -NLE_OBJ_NOTFOUND if `link` or `vf_data` not provided
  -NLE_NOMEM if out of memory

Definition at line 732 of file sriov.c.

References rtnl_link_vf_alloc().

Here is the call graph for this function:

## ◆ rtnl_link_vf_alloc()

struct rtnl_link_vf * rtnl_link_vf_alloc | ( | void |  | ) |

Allocate a new SRIOV VF object.

Returns
  NULL if out of memory
  New VF Object

See also
  rtnl_link_vf_put()

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 767 of file sriov.c.

Referenced by rtnl_link_vf_add().

Here is the caller graph for this function:

## ◆ rtnl_link_vf_free()

void rtnl_link_vf_free | ( | struct rtnl_link_vf * | vf_data | ) |

Free SRIOV VF object.

Parameters

  vf_data | SRIOV VF data object

Definition at line 785 of file sriov.c.

References nl_addr_put(), and rtnl_link_vf_vlan_put().

Referenced by rtnl_link_vf_put().

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

## ◆ rtnl_link_vf_get()

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.

Returns
  NULL if VF not found
  VF Object

See also
  rtnl_link_vf_put()

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 814 of file sriov.c.

## ◆ rtnl_link_vf_put()

void rtnl_link_vf_put | ( | struct rtnl_link_vf * | vf_data | ) |

Return SRIOV VF object to the owning link object.

Parameters

  vf_data | SRIOV VF data object

See also
  rtnl_link_vf_alloc()
  rtnl_link_vf_get()

Definition at line 841 of file sriov.c.

References rtnl_link_vf_free().

Here is the call graph for this function:

## ◆ rtnl_link_vf_get_addr()

int rtnl_link_vf_get_addr | ( | struct rtnl_link_vf * | vf_data,
|  | struct nl_addr ** | addr )

Get link layer address of SRIOV Virtual Function.

Parameters

  vf_data | SRIOV VF object
  addr | Pointer to store Link Layer address

See also
  rtnl_link_get_num_vf()
  rtnl_link_vf_set_addr()

Attention
  The reference counter of the returned object is not incremented. Therefore, the returned pointer is only valid during the lifetime of the parent object. Increment the reference counter if the object is supposed to stay around after the parent object was freed.

Returns
  0 if addr is present and addr is set to pointer containing address
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the link layer address is not set

Definition at line 871 of file sriov.c.

## ◆ rtnl_link_vf_set_addr()

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.

Parameters

  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.

See also
  rtnl_link_vf_get_addr()

Definition at line 894 of file sriov.c.

References nl_addr_get(), and nl_addr_put().

Here is the call graph for this function:

## ◆ rtnl_link_vf_set_ib_node_guid()

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.

Parameters

  vf_data | SRIOV VF object
  guid | node GUID

Definition at line 910 of file sriov.c.

## ◆ rtnl_link_vf_set_ib_port_guid()

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.

Parameters

  vf_data | SRIOV VF object
  guid | port GUID

Definition at line 923 of file sriov.c.

## ◆ rtnl_link_vf_get_index()

int rtnl_link_vf_get_index | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t * | vf_index )

Get index of SRIOV Virtual Function.

Parameters

  vf_data | SRIOV VF object
  vf_index | Pointer to store VF index

See also
  rtnl_link_get_num_vf()

Returns
  0 if index is present and vf_index is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF index is not set

Definition at line 942 of file sriov.c.

## ◆ rtnl_link_vf_set_index()

void rtnl_link_vf_set_index | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t | vf_index )

Set index of SRIOV Virtual Function object.

Parameters

  vf_data | SRIOV VF object
  vf_index | Index value

See also
  rtnl_link_vf_get_index()

Definition at line 962 of file sriov.c.

## ◆ rtnl_link_vf_get_linkstate()

int rtnl_link_vf_get_linkstate | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t * | vf_linkstate )

Get link state of SRIOV Virtual Function.

Parameters

  vf_data | SRIOV VF object
  vf_linkstate | Pointer to store VF link state

See also
  rtnl_link_get_num_vf()
  rtnl_link_set_linkstate()

Returns
  0 if link state is present and vf_linkstate is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF link state is not set

Definition at line 982 of file sriov.c.

## ◆ rtnl_link_vf_set_linkstate()

void rtnl_link_vf_set_linkstate | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t | vf_linkstate )

Set link state of SRIOV Virtual Function object.

Parameters

  vf_data | SRIOV VF object
  vf_linkstate | Link state value

See also
  rtnl_link_get_linkstate()

Not all hardware supports setting link state. If the feature is unsupported, the link change request will fail with -NLE_OPNOTSUPP

Definition at line 1006 of file sriov.c.

## ◆ rtnl_link_vf_get_rate()

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.

Parameters

  vf_data | SRIOV VF object
  vf_rate | Pointer to store VF rate limiting data

See also
  rtnl_link_get_num_vf()
  rtnl_link_set_rate()

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

Returns
  0 if rate is present and vf_rate is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF rate is not set

Definition at line 1038 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.

## ◆ rtnl_link_vf_set_rate()

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.

Parameters

  vf_data | SRIOV VF object
  vf_rate | Rate limiting structure

See also
  rtnl_link_vf_get_rate()

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 1104 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.

## ◆ rtnl_link_vf_get_rss_query_en()

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.

Parameters

  vf_data | SRIOV VF object
  vf_rss_query_en | Pointer to store VF RSS Query value

See also
  rtnl_link_get_num_vf()
  rtnl_link_vf_set_rss_query_en()

Returns
  0 if rss_query_en is present and vf_rss_query_en is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF RSS Query EN value is not set

Definition at line 1132 of file sriov.c.

## ◆ rtnl_link_vf_set_rss_query_en()

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.

Parameters

  vf_data | SRIOV VF object
  vf_rss_query_en | RSS Query value

See also
  rtnl_link_vf_get_rss_query_en()

Definition at line 1153 of file sriov.c.

## ◆ rtnl_link_vf_get_spoofchk()

int rtnl_link_vf_get_spoofchk | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t * | vf_spoofchk )

Get spoof checking value of SRIOV Virtual Function.

Parameters

  vf_data | SRIOV VF object
  vf_spoofchk | Pointer to store VF spoofchk value

See also
  rtnl_link_get_num_vf()
  rtnl_link_set_spoofchk()

Returns
  0 if spoofchk is present and vf_spoofchk is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF spoofcheck is not set

Definition at line 1173 of file sriov.c.

## ◆ rtnl_link_vf_set_spoofchk()

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.

Parameters

  vf_data |
  vf_spoofchk |

See also
  rtnl_link_vf_get_spoofchk()

Definition at line 1194 of file sriov.c.

## ◆ rtnl_link_vf_get_stat()

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.

Parameters

  vf_data | SRIOV VF object
  stat | Identifier of statistical counter
  vf_stat | Pointer to store VF stat value in

See also
  rtnl_link_get_num_vf()

Returns
  0 if stat is present and vf_stat is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF stat is not set

Definition at line 1214 of file sriov.c.

## ◆ rtnl_link_vf_get_trust()

int rtnl_link_vf_get_trust | ( | struct rtnl_link_vf * | vf_data,
|  | uint32_t * | vf_trust )

Get trust setting of SRIOV Virtual Function.

Parameters

  vf_data | SRIOV VF object
  vf_trust | Pointer to store VF trust value

See also
  rtnl_link_get_num_vf()
  rtnl_link_set_trust()

Returns
  0 if trust is present and vf_trust is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF trust setting is not set

Definition at line 1240 of file sriov.c.

## ◆ rtnl_link_vf_set_trust()

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.

Parameters

  vf_data |
  vf_trust |

See also
  rtnl_link_vf_get_trust()

Definition at line 1260 of file sriov.c.

## ◆ rtnl_link_vf_get_vlans()

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.

Parameters

  vf_data | SRIOV VF object
  vf_vlans | Pointer to nl_vf_vlans_t struct to store vlan info.

See also
  rtnl_link_get_num_vf()

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.

Attention
  The reference counter of the returned object is not incremented. Therefore, the returned pointer is only valid during the lifetime of the parent object. Increment the reference counter if the object is supposed to stay around after the parent object was freed.

Returns
  0 if VLAN info is present and vf_vlans is set
  -NLE_OBJ_NOTFOUND if information for VF info is not found
  -NLE_NOATTR if the VF vlans is not set

Definition at line 1282 of file sriov.c.

References nl_vf_vlans::ce_refcnt.

## ◆ rtnl_link_vf_set_vlans()

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.

Parameters

  vf_data | SRIOV VF object
  vf_vlans | SRIOV VF VLANs object

See also
  rtnl_link_vf_get_vlans()
  rtnl_link_vf_vlan_alloc()

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.

Definition at line 1311 of file sriov.c.

## ◆ rtnl_link_vf_vlan_alloc()

int rtnl_link_vf_vlan_alloc | ( | nl_vf_vlans_t ** | vf_vlans,
|  | int | vlan_count )

Allocate a SRIOV VF VLAN object.

Parameters

  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.

Returns
  0 if VLAN object is created and vf_vlans is set.
  -NLE_NOMEM if object could not be allocated.
  -NLE_INVAL if vlan_count is more than supported by SRIOV VF

Definition at line 1335 of file sriov.c.

References nl_vf_vlans::ce_refcnt, nl_vf_vlans::size, and nl_vf_vlans::vlans.

## ◆ rtnl_link_vf_vlan_free()

void rtnl_link_vf_vlan_free | ( | nl_vf_vlans_t * | vf_vlans | ) |

Free an allocated SRIOV VF VLANs object.

Parameters

  vf_vlans | SRIOV VF VLANs object

Definition at line 1366 of file sriov.c.

References nl_vf_vlans::ce_refcnt, and nl_vf_vlans::vlans.

Referenced by rtnl_link_vf_vlan_put().

Here is the caller graph for this function:

## ◆ 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.

Parameters

  vf_vlans | SRIOV VF VLANs object

Definition at line 1384 of file sriov.c.

References nl_vf_vlans::ce_refcnt, and rtnl_link_vf_vlan_free().

Referenced by rtnl_link_vf_free().

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

## ◆ rtnl_link_vf_linkstate2str()

char * rtnl_link_vf_linkstate2str | ( | uint32_t | ls,
|  | char * | buf,
|  | size_t | len )

Definition at line 1414 of file sriov.c.

## ◆ rtnl_link_vf_str2linkstate()

int rtnl_link_vf_str2linkstate | ( | const char * | name | ) |

Definition at line 1420 of file sriov.c.

## ◆ rtnl_link_vf_vlanproto2str()

char * rtnl_link_vf_vlanproto2str | ( | uint16_t | proto,
|  | char * | buf,
|  | size_t | len )

Definition at line 1430 of file sriov.c.

## ◆ rtnl_link_vf_str2vlanproto()

int rtnl_link_vf_str2vlanproto | ( | const char * | name | ) |

Definition at line 1436 of file sriov.c.

## ◆ rtnl_link_vf_str2guid()

int rtnl_link_vf_str2guid | ( | uint64_t * | guid,
|  | const char * | guid_s )

Definition at line 1449 of file sriov.c.