]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/network/networkd-sriov.h
Merge pull request #16219 from ssahani/network-sr-iov
[thirdparty/systemd.git] / src / network / networkd-sriov.h
CommitLineData
518cd6b5
SS
1/* SPDX-License-Identifier: LGPL-2.1+
2 * Copyright © 2020 VMware, Inc. */
3#pragma once
4
5#include <linux/if_link.h>
6
7#include "conf-parser.h"
8#include "networkd-link.h"
9#include "networkd-network.h"
10#include "networkd-util.h"
11
12typedef enum SRIOVLinkState {
13 SR_IOV_LINK_STATE_AUTO = IFLA_VF_LINK_STATE_AUTO,
14 SR_IOV_LINK_STATE_ENABLE = IFLA_VF_LINK_STATE_ENABLE,
15 SR_IOV_LINK_STATE_DISABLE = IFLA_VF_LINK_STATE_DISABLE,
16 _SR_IOV_LINK_STATE_MAX,
17 _SR_IOV_LINK_STATE_INVALID = -1,
18} SRIOVLinkState;
19
20typedef struct SRIOV {
21 NetworkConfigSection *section;
22 Network *network;
23
24 uint32_t vf; /* 0 - 2147483646 */
25 uint32_t vlan; /* 0 - 4095, 0 disables VLAN filter */
26 uint32_t qos;
e64b31c8 27 uint16_t vlan_proto; /* ETH_P_8021Q or ETH_P_8021AD */
518cd6b5
SS
28 int vf_spoof_check_setting;
29 int query_rss;
30 int trust;
31 SRIOVLinkState link_state;
c3a5025d 32 struct ether_addr mac;
518cd6b5
SS
33} SRIOV;
34
35SRIOV *sr_iov_free(SRIOV *sr_iov);
36
37int sr_iov_configure(Link *link, SRIOV *sr_iov);
38int sr_iov_section_verify(SRIOV *sr_iov);
39
40DEFINE_NETWORK_SECTION_FUNCTIONS(SRIOV, sr_iov_free);
41
42CONFIG_PARSER_PROTOTYPE(config_parse_sr_iov_uint32);
43CONFIG_PARSER_PROTOTYPE(config_parse_sr_iov_boolean);
44CONFIG_PARSER_PROTOTYPE(config_parse_sr_iov_link_state);
e64b31c8 45CONFIG_PARSER_PROTOTYPE(config_parse_sr_iov_vlan_proto);
c3a5025d 46CONFIG_PARSER_PROTOTYPE(config_parse_sr_iov_mac);