History

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

Moshe Shemesh committed 10 years ago

Commit 79aab091 parent 0815fe323 files · +161 −42Browse files

Showing the changes to include/uapi (1 of 23 files). Show all

Unified · Split

include/uapi/linux/if_link.h+18−1
@@ -619,7 +619,7 @@ enum { · 618 unmodified lines
619enum {619enum {
620 IFLA_VF_UNSPEC,620 IFLA_VF_UNSPEC,
621 IFLA_VF_MAC, /* Hardware queue specific attributes */621 IFLA_VF_MAC, /* Hardware queue specific attributes */
622 IFLA_VF_VLAN,622 IFLA_VF_VLAN, /* VLAN ID and QoS */
623 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */623 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
624 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */624 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
625 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */625 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
@@ -631,6 +631,7 @@ enum { · 5 unmodified lines
631 IFLA_VF_TRUST, /* Trust VF */631 IFLA_VF_TRUST, /* Trust VF */
632 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */632 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
633 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */633 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
634 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
634 __IFLA_VF_MAX,635 __IFLA_VF_MAX,
635};636};
636 637
@@ -647,6 +648,22 @@ struct ifla_vf_vlan { · 10 unmodified lines
647 __u32 qos;648 __u32 qos;
648};649};
649 650
651enum {
652 IFLA_VF_VLAN_INFO_UNSPEC,
653 IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
654 __IFLA_VF_VLAN_INFO_MAX,
655};
656
657#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
658#define MAX_VLAN_LIST_LEN 1
659
660struct ifla_vf_vlan_info {
661 __u32 vf;
662 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
663 __u32 qos;
664 __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
665};
666
650struct ifla_vf_tx_rate {667struct ifla_vf_tx_rate {
651 __u32 vf;668 __u32 vf;
652 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */669 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t