Commit 96664483 authored by Greg Rose's avatar Greg Rose Committed by Jeff Kirsher

i40e: Implement configfs for NPAR BW configuration

Add configfs controls to get, set and commit NPAR BW configurations.

We export three controls:
	min_bw - Can take a value from 0 to 100 inclusive
	max_bw - Can take a value from 1 to 100 inclusive
	commit - A write-only control that accepts only a value of 1 and will
		cause the BW settings to be permanently committed to NVM so
		that they are persistent across power cycles and system
		resets

The BW values are relative and are expressed as percentages.  For more
information on the interpretation of the BW settings see the Dell
specifications for NPAR.

Also update the copyright year.

Change-ID: Id7496ca65630b5037e32ba6a5a748fbc1632881b
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Tested-By: default avatarJim Young <james.m.young@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent f4492db1
################################################################################
#
# Intel Ethernet Controller XL710 Family Linux Driver
# Copyright(c) 2013 - 2014 Intel Corporation.
# Copyright(c) 2013 - 2015 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
......@@ -37,6 +37,7 @@ i40e-objs := i40e_main.o \
i40e_hmc.o \
i40e_lan_hmc.o \
i40e_nvm.o \
i40e_configfs.o \
i40e_debugfs.o \
i40e_diag.o \
i40e_txrx.o \
......
......@@ -688,6 +688,7 @@ int i40e_vlan_rx_add_vid(struct net_device *netdev,
int i40e_vlan_rx_kill_vid(struct net_device *netdev,
__always_unused __be16 proto, u16 vid);
#endif
int i40e_open(struct net_device *netdev);
int i40e_vsi_open(struct i40e_vsi *vsi);
void i40e_vlan_stripping_disable(struct i40e_vsi *vsi);
int i40e_vsi_add_vlan(struct i40e_vsi *vsi, s16 vid);
......@@ -698,7 +699,6 @@ bool i40e_is_vsi_in_vlan(struct i40e_vsi *vsi);
struct i40e_mac_filter *i40e_find_mac(struct i40e_vsi *vsi, u8 *macaddr,
bool is_vf, bool is_netdev);
#ifdef I40E_FCOE
int i40e_open(struct net_device *netdev);
int i40e_close(struct net_device *netdev);
int i40e_setup_tc(struct net_device *netdev, u8 tc);
void i40e_netpoll(struct net_device *netdev);
......@@ -735,7 +735,10 @@ int i40e_ptp_set_ts_config(struct i40e_pf *pf, struct ifreq *ifr);
int i40e_ptp_get_ts_config(struct i40e_pf *pf, struct ifreq *ifr);
void i40e_ptp_init(struct i40e_pf *pf);
void i40e_ptp_stop(struct i40e_pf *pf);
#if IS_ENABLED(CONFIG_CONFIGFS_FS)
int i40e_configfs_init(void);
void i40e_configfs_exit(void);
#endif /* CONFIG_CONFIGFS_FS */
i40e_status i40e_get_npar_bw_setting(struct i40e_pf *pf);
i40e_status i40e_set_npar_bw_setting(struct i40e_pf *pf);
i40e_status i40e_commit_npar_bw_setting(struct i40e_pf *pf);
......
This diff is collapsed.
......@@ -4835,11 +4835,7 @@ static int i40e_setup_tc(struct net_device *netdev, u8 tc)
*
* Returns 0 on success, negative value on failure
**/
#ifdef I40E_FCOE
int i40e_open(struct net_device *netdev)
#else
static int i40e_open(struct net_device *netdev)
#endif
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
......@@ -7741,7 +7737,7 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
return err;
}
static const struct net_device_ops i40e_netdev_ops = {
const struct net_device_ops i40e_netdev_ops = {
.ndo_open = i40e_open,
.ndo_stop = i40e_close,
.ndo_start_xmit = i40e_lan_xmit_frame,
......@@ -9943,6 +9939,10 @@ static int __init i40e_init_module(void)
pr_info("%s: %s - version %s\n", i40e_driver_name,
i40e_driver_string, i40e_driver_version_str);
pr_info("%s: %s\n", i40e_driver_name, i40e_copyright);
#if IS_ENABLED(CONFIG_CONFIGFS_FS)
i40e_configfs_init();
#endif /* CONFIG_CONFIGFS_FS */
i40e_dbg_init();
return pci_register_driver(&i40e_driver);
}
......@@ -9958,5 +9958,8 @@ static void __exit i40e_exit_module(void)
{
pci_unregister_driver(&i40e_driver);
i40e_dbg_exit();
#if IS_ENABLED(CONFIG_CONFIGFS_FS)
i40e_configfs_exit();
#endif /* CONFIG_CONFIGFS_FS */
}
module_exit(i40e_exit_module);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment