2010-01-09 10:25:48 +08:00
|
|
|
/*******************************************************************************
|
|
|
|
|
|
|
|
Intel 10 Gigabit PCI Express Linux driver
|
2013-01-08 13:02:28 +08:00
|
|
|
Copyright(c) 1999 - 2013 Intel Corporation.
|
2010-01-09 10:25:48 +08:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
|
|
under the terms and conditions of the GNU General Public License,
|
|
|
|
version 2, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
The full GNU General Public License is included in this distribution in
|
|
|
|
the file called "COPYING".
|
|
|
|
|
|
|
|
Contact Information:
|
2014-02-22 09:23:50 +08:00
|
|
|
Linux NICS <linux.nics@intel.com>
|
2010-01-09 10:25:48 +08:00
|
|
|
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
|
|
|
|
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
|
|
|
|
|
|
|
*******************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _IXGBE_SRIOV_H_
|
|
|
|
#define _IXGBE_SRIOV_H_
|
|
|
|
|
2014-01-17 11:41:04 +08:00
|
|
|
/* ixgbe driver limit the max number of VFs could be enabled to
|
|
|
|
* 63 (IXGBE_MAX_VF_FUNCTIONS - 1)
|
|
|
|
*/
|
|
|
|
#define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1)
|
|
|
|
|
2014-03-25 15:45:27 +08:00
|
|
|
#ifdef CONFIG_PCI_IOV
|
2010-01-09 10:25:48 +08:00
|
|
|
void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
|
2014-03-25 15:45:27 +08:00
|
|
|
#endif
|
2010-01-09 10:25:48 +08:00
|
|
|
void ixgbe_msg_task(struct ixgbe_adapter *adapter);
|
|
|
|
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);
|
2010-01-23 06:46:40 +08:00
|
|
|
void ixgbe_disable_tx_rx(struct ixgbe_adapter *adapter);
|
|
|
|
void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter);
|
2010-05-05 06:12:06 +08:00
|
|
|
int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int queue, u8 *mac);
|
|
|
|
int ixgbe_ndo_set_vf_vlan(struct net_device *netdev, int queue, u16 vlan,
|
|
|
|
u8 qos);
|
2016-01-28 02:33:30 +08:00
|
|
|
int ixgbe_link_mbps(struct ixgbe_adapter *adapter);
|
net-next:v4: Add support to configure SR-IOV VF minimum and maximum Tx rate through ip tool.
o min_tx_rate puts lower limit on the VF bandwidth. VF is guaranteed
to have a bandwidth of at least this value.
max_tx_rate puts cap on the VF bandwidth. VF can have a bandwidth
of up to this value.
o A new handler set_vf_rate for attr IFLA_VF_RATE has been introduced
which takes 4 arguments:
netdev, VF number, min_tx_rate, max_tx_rate
o ndo_set_vf_rate replaces ndo_set_vf_tx_rate handler.
o Drivers that currently implement ndo_set_vf_tx_rate should now call
ndo_set_vf_rate instead and reject attempt to set a minimum bandwidth
greater than 0 for IFLA_VF_TX_RATE when IFLA_VF_RATE is not yet
implemented by driver.
o If user enters only one of either min_tx_rate or max_tx_rate, then,
userland should read back the other value from driver and set both
for IFLA_VF_RATE.
Drivers that have not yet implemented IFLA_VF_RATE should always
return min_tx_rate as 0 when read from ip tool.
o If both IFLA_VF_TX_RATE and IFLA_VF_RATE options are specified, then
IFLA_VF_RATE should override.
o Idea is to have consistent display of rate values to user.
o Usage example: -
./ip link set p4p1 vf 0 rate 900
./ip link show p4p1
32: p4p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT qlen 1000
link/ether 00:0e:1e:08:b0:f0 brd ff:ff:ff:ff:ff:ff
vf 0 MAC 3e:a0:ca:bd:ae:5a, tx rate 900 (Mbps), max_tx_rate 900Mbps
vf 1 MAC f6:c6:7c:3f:3d:6c
vf 2 MAC 56:32:43:98:d7:71
vf 3 MAC d6:be:c3:b5:85:ff
vf 4 MAC ee:a9:9a:1e:19:14
vf 5 MAC 4a:d0:4c:07:52:18
vf 6 MAC 3a:76:44:93:62:f9
vf 7 MAC 82:e9:e7:e3:15:1a
./ip link set p4p1 vf 0 max_tx_rate 300 min_tx_rate 200
./ip link show p4p1
32: p4p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT qlen 1000
link/ether 00:0e:1e:08:b0:f0 brd ff:ff:ff:ff:ff:ff
vf 0 MAC 3e:a0:ca:bd:ae:5a, tx rate 300 (Mbps), max_tx_rate 300Mbps,
min_tx_rate 200Mbps
vf 1 MAC f6:c6:7c:3f:3d:6c
vf 2 MAC 56:32:43:98:d7:71
vf 3 MAC d6:be:c3:b5:85:ff
vf 4 MAC ee:a9:9a:1e:19:14
vf 5 MAC 4a:d0:4c:07:52:18
vf 6 MAC 3a:76:44:93:62:f9
vf 7 MAC 82:e9:e7:e3:15:1a
./ip link set p4p1 vf 0 max_tx_rate 600 rate 300
./ip link show p4p1
32: p4p1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode
DEFAULT qlen 1000
link/ether 00:0e:1e:08:b0:f brd ff:ff:ff:ff:ff:ff
vf 0 MAC 3e:a0:ca:bd:ae:5, tx rate 600 (Mbps), max_tx_rate 600Mbps,
min_tx_rate 200Mbps
vf 1 MAC f6:c6:7c:3f:3d:6c
vf 2 MAC 56:32:43:98:d7:71
vf 3 MAC d6:be:c3:b5:85:ff
vf 4 MAC ee:a9:9a:1e:19:14
vf 5 MAC 4a:d0:4c:07:52:18
vf 6 MAC 3a:76:44:93:62:f9
vf 7 MAC 82:e9:e7:e3:15:1a
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-22 21:59:05 +08:00
|
|
|
int ixgbe_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate,
|
|
|
|
int max_tx_rate);
|
2011-09-29 13:57:33 +08:00
|
|
|
int ixgbe_ndo_set_vf_spoofchk(struct net_device *netdev, int vf, bool setting);
|
2015-03-31 02:35:24 +08:00
|
|
|
int ixgbe_ndo_set_vf_rss_query_en(struct net_device *netdev, int vf,
|
|
|
|
bool setting);
|
2015-08-28 14:58:33 +08:00
|
|
|
int ixgbe_ndo_set_vf_trust(struct net_device *netdev, int vf, bool setting);
|
2010-05-05 06:12:06 +08:00
|
|
|
int ixgbe_ndo_get_vf_config(struct net_device *netdev,
|
|
|
|
int vf, struct ifla_vf_info *ivi);
|
2011-03-11 10:03:07 +08:00
|
|
|
void ixgbe_check_vf_rate_limit(struct ixgbe_adapter *adapter);
|
2012-12-11 16:26:43 +08:00
|
|
|
int ixgbe_disable_sriov(struct ixgbe_adapter *adapter);
|
2011-11-07 15:44:17 +08:00
|
|
|
#ifdef CONFIG_PCI_IOV
|
2012-12-11 16:26:33 +08:00
|
|
|
void ixgbe_enable_sriov(struct ixgbe_adapter *adapter);
|
2011-10-21 15:55:15 +08:00
|
|
|
#endif
|
2012-12-11 16:26:43 +08:00
|
|
|
int ixgbe_pci_sriov_configure(struct pci_dev *dev, int num_vfs);
|
2011-08-24 10:37:55 +08:00
|
|
|
|
2012-10-19 10:34:34 +08:00
|
|
|
static inline void ixgbe_set_vmvir(struct ixgbe_adapter *adapter,
|
|
|
|
u16 vid, u16 qos, u32 vf)
|
|
|
|
{
|
|
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
|
|
u32 vmvir = vid | (qos << VLAN_PRIO_SHIFT) | IXGBE_VMVIR_VLANA_DEFAULT;
|
|
|
|
|
|
|
|
IXGBE_WRITE_REG(hw, IXGBE_VMVIR(vf), vmvir);
|
|
|
|
}
|
2010-01-09 10:25:48 +08:00
|
|
|
|
|
|
|
#endif /* _IXGBE_SRIOV_H_ */
|
|
|
|
|