blob: dad925706f4cf554537d4978c28286357854486c [file] [log] [blame]
Greg Rose17367272010-01-09 02:25:48 +00001/*******************************************************************************
2
3 Intel 10 Gigabit PCI Express Linux driver
Don Skidmore434c5e32013-01-08 05:02:28 +00004 Copyright(c) 1999 - 2013 Intel Corporation.
Greg Rose17367272010-01-09 02:25:48 +00005
6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License,
8 version 2, as published by the Free Software Foundation.
9
10 This program is distributed in the hope it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 more details.
14
15 You should have received a copy of the GNU General Public License along with
16 this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19 The full GNU General Public License is included in this distribution in
20 the file called "COPYING".
21
22 Contact Information:
Jacob Kellerb89aae72014-02-22 01:23:50 +000023 Linux NICS <linux.nics@intel.com>
Greg Rose17367272010-01-09 02:25:48 +000024 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28
29#ifndef _IXGBE_SRIOV_H_
30#define _IXGBE_SRIOV_H_
31
ethan.zhaodcc23e32014-01-16 19:41:04 -080032/* ixgbe driver limit the max number of VFs could be enabled to
33 * 63 (IXGBE_MAX_VF_FUNCTIONS - 1)
34 */
35#define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1)
36
Jacob Kellerb335e752014-03-25 07:45:27 +000037#ifdef CONFIG_PCI_IOV
Greg Rose17367272010-01-09 02:25:48 +000038void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
Jacob Kellerb335e752014-03-25 07:45:27 +000039#endif
Greg Rose17367272010-01-09 02:25:48 +000040void ixgbe_msg_task(struct ixgbe_adapter *adapter);
Greg Rose17367272010-01-09 02:25:48 +000041int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
Greg Rose767081a2010-01-22 22:46:40 +000042void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
43void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
Greg Rose7f016482010-05-04 22:12:06 +000044int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
45int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
46 u8 qos);
Sucheta Chakrabortyed616682014-05-22 09:59:05 -040047int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate,
48 int max_tx_rate);
Greg Rosede4c7f62011-09-29 05:57:33 +000049int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);
Vlad Zolotarove65ce0d2015-03-30 21:35:24 +030050int ixgbe_ndo_set_vf_rss_query_en(struct net_device *netdev, int vf,
51 bool setting);
Hiroshi Shimamoto54011e42015-08-28 06:58:33 +000052int ixgbe_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting);
Greg Rose7f016482010-05-04 22:12:06 +000053int ixgbe_ndo_get_vf_config(struct net_device *netdev,
54 int vf, struct ifla_vf_info *ivi);
Lior Levyff4ab202011-03-11 02:03:07 +000055void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
Greg Roseda36b642012-12-11 08:26:43 +000056int ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
Rose, Gregory V01264102011-11-07 07:44:17 +000057#ifdef CONFIG_PCI_IOV
Greg Rose60a1a682012-12-11 08:26:33 +000058void ixgbe_enable_sriov(struct ixgbe_adapter *adapter);
Greg Rose9487dc82011-10-21 07:55:15 +000059#endif
Greg Roseda36b642012-12-11 08:26:43 +000060int ixgbe_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
Greg Rosec6bda302011-08-24 02:37:55 +000061
John Fastabend610a63f2012-10-19 02:34:34 +000062static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,
63 u16 vid, u16 qos, u32 vf)
64{
65 struct ixgbe_hw *hw = &adapter->hw;
66 u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT;
67
68 IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir);
69}
Greg Rose17367272010-01-09 02:25:48 +000070
71#endif /* _IXGBE_SRIOV_H_ */
72