diff options
author | Yuval Mintz <Yuval.Mintz@qlogic.com> | 2016-05-11 16:36:20 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-12 07:04:07 +0300 |
commit | 08feecd7fc709077ce92d21a979f522a5f57170a (patch) | |
tree | 69859bb077bbca39d56b4d00369741cd16adc615 /drivers/net/ethernet/qlogic/qed/qed_sriov.h | |
parent | fefb0202cc5c12172abba78a8404e69c6d82d680 (diff) | |
download | linux-08feecd7fc709077ce92d21a979f522a5f57170a.tar.xz |
qed*: Support PVID configuration
This adds support for PF control over the VF vlan configuration.
I.e., `ip link ... vf <x> vlan <vid>' should now be supported.
1. <vid> != 0 => VF receives [unknowingly] only traffic tagged by
<vid> and tags all outgoing traffic sent by VF with <vid>.
2. <vid> == 0 ==> Remove the pvid configuration, reverting to previous.
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qed/qed_sriov.h')
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_sriov.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_sriov.h b/drivers/net/ethernet/qlogic/qed/qed_sriov.h index 2c94b445d07f..e65f403349c2 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_sriov.h +++ b/drivers/net/ethernet/qlogic/qed/qed_sriov.h @@ -24,6 +24,9 @@ #define QED_MAX_VF_CHAINS_PER_PF 16 #define QED_ETH_VF_NUM_VLAN_FILTERS 2 +#define QED_ETH_MAX_VF_NUM_VLAN_FILTERS \ + (MAX_NUM_VFS * QED_ETH_VF_NUM_VLAN_FILTERS) + enum qed_iov_vport_update_flag { QED_IOV_VP_UPDATE_ACTIVATE, QED_IOV_VP_UPDATE_VLAN_STRIP, @@ -40,6 +43,7 @@ struct qed_public_vf_info { /* These copies will later be reflected in the bulletin board, * but this copy should be newer. */ + u16 forced_vlan; u8 mac[ETH_ALEN]; }; @@ -98,6 +102,18 @@ enum vf_state { VF_STOPPED /* VF, Stopped */ }; +struct qed_vf_vlan_shadow { + bool used; + u16 vid; +}; + +struct qed_vf_shadow_config { + /* Shadow copy of all guest vlans */ + struct qed_vf_vlan_shadow vlans[QED_ETH_VF_NUM_VLAN_FILTERS + 1]; + + u8 inner_vlan_removal; +}; + /* PFs maintain an array of this structure, per VF */ struct qed_vf_info { struct qed_iov_vf_mbx vf_mbx; @@ -131,6 +147,16 @@ struct qed_vf_info { u16 igu_sbs[QED_MAX_VF_CHAINS_PER_PF]; u8 num_active_rxqs; struct qed_public_vf_info p_vf_info; + + /* Stores the configuration requested by VF */ + struct qed_vf_shadow_config shadow_config; + + /* A bitfield using bulletin's valid-map bits, used to indicate + * which of the bulletin board features have been configured. + */ + u64 configured_features; +#define QED_IOV_CONFIGURED_FEATURES_MASK ((1 << MAC_ADDR_FORCED) | \ + (1 << VLAN_ADDR_FORCED)) }; /* This structure is part of qed_hwfn and used only for PFs that have sriov |