net: Update API for VF vlan protocol 802.1ad support
Introduce new rtnl UAPI that exposes a list of vlans per VF, giving the ability for user-space application to specify it for the VF, as an option to support 802.1ad. We adjusted IP Link tool to support this option. For future use cases, the new UAPI supports multiple vlans. For now we limit the list size to a single vlan in kernel. Add IFLA_VF_VLAN_LIST in addition to IFLA_VF_VLAN to keep backward compatibility with older versions of IP Link tool. Add a vlan protocol parameter to the ndo_set_vf_vlan callback. We kept 802.1Q as the drivers' default vlan protocol. Suitable ip link tool command examples: Set vf vlan protocol 802.1ad: ip link set eth0 vf 1 vlan 100 proto 802.1ad Set vf to VST (802.1Q) mode: ip link set eth0 vf 1 vlan 100 proto 802.1Q Or by omitting the new parameter ip link set eth0 vf 1 vlan 100 Signed-off-by: Moshe Shemesh <moshe@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
0815fe3a86
commit
79aab093a0
@@ -619,7 +619,7 @@ enum {
|
||||
enum {
|
||||
IFLA_VF_UNSPEC,
|
||||
IFLA_VF_MAC, /* Hardware queue specific attributes */
|
||||
IFLA_VF_VLAN,
|
||||
IFLA_VF_VLAN, /* VLAN ID and QoS */
|
||||
IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
|
||||
IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
|
||||
IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
|
||||
@@ -631,6 +631,7 @@ enum {
|
||||
IFLA_VF_TRUST, /* Trust VF */
|
||||
IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
|
||||
IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
|
||||
IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
|
||||
__IFLA_VF_MAX,
|
||||
};
|
||||
|
||||
@@ -647,6 +648,22 @@ struct ifla_vf_vlan {
|
||||
__u32 qos;
|
||||
};
|
||||
|
||||
enum {
|
||||
IFLA_VF_VLAN_INFO_UNSPEC,
|
||||
IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
|
||||
__IFLA_VF_VLAN_INFO_MAX,
|
||||
};
|
||||
|
||||
#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
|
||||
#define MAX_VLAN_LIST_LEN 1
|
||||
|
||||
struct ifla_vf_vlan_info {
|
||||
__u32 vf;
|
||||
__u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
|
||||
__u32 qos;
|
||||
__be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
|
||||
};
|
||||
|
||||
struct ifla_vf_tx_rate {
|
||||
__u32 vf;
|
||||
__u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
|
||||
|
Reference in New Issue
Block a user