Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 1999 - 2018 Intel Corporation. */
0003 
0004 #ifndef _IXGBE_SRIOV_H_
0005 #define _IXGBE_SRIOV_H_
0006 
0007 /*  ixgbe driver limit the max number of VFs could be enabled to
0008  *  63 (IXGBE_MAX_VF_FUNCTIONS - 1)
0009  */
0010 #define IXGBE_MAX_VFS_DRV_LIMIT  (IXGBE_MAX_VF_FUNCTIONS - 1)
0011 #define IXGBE_MAX_VFS_1TC       IXGBE_MAX_VF_FUNCTIONS
0012 #define IXGBE_MAX_VFS_4TC       32
0013 #define IXGBE_MAX_VFS_8TC       16
0014 
0015 #ifdef CONFIG_PCI_IOV
0016 void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
0017 #endif
0018 void ixgbe_msg_task(struct ixgbe_adapter *adapter);
0019 int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
0020 void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
0021 void ixgbe_set_all_vfs(struct ixgbe_adapter *adapter);
0022 int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
0023 int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
0024                u8 qos, __be16 vlan_proto);
0025 int ixgbe_link_mbps(struct ixgbe_adapter *adapter);
0026 int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate,
0027             int max_tx_rate);
0028 int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);
0029 int ixgbe_ndo_set_vf_rss_query_en(struct net_device *netdev, int vf,
0030                   bool setting);
0031 int ixgbe_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting);
0032 int ixgbe_ndo_get_vf_config(struct net_device *netdev,
0033                 int vf, struct ifla_vf_info *ivi);
0034 int ixgbe_ndo_set_vf_link_state(struct net_device *netdev, int vf, int state);
0035 void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
0036 void ixgbe_set_vf_link_state(struct ixgbe_adapter *adapter, int vf, int state);
0037 int ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
0038 #ifdef CONFIG_PCI_IOV
0039 void ixgbe_enable_sriov(struct ixgbe_adapter *adapter, unsigned int max_vfs);
0040 #endif
0041 int ixgbe_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
0042 
0043 static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,
0044                    u16 vid, u16 qos, u32 vf)
0045 {
0046     struct ixgbe_hw *hw = &adapter->hw;
0047     u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT;
0048 
0049     IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir);
0050 }
0051 
0052 #endif /* _IXGBE_SRIOV_H_ */
0053