* [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
@ 2013-07-31 9:59 Jeff Kirsher
2013-07-31 20:38 ` David Miller
0 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2013-07-31 9:59 UTC (permalink / raw)
To: davem, bhelgaas; +Cc: Jeff Kirsher, netdev, gospo, sassmann, linux-pci
This series contains updates to ixgbe and pci.
The first patch for ixgbe from Greg Rose is the second submission. The
first submission of "ixgbe: Retain VLAN filtering in promiscuous + VT
mode" had a typo, which Joe Perches pointed out and is fixed in this
submission.
Alex updates the ixgbe driver to use the generic helper pci_vfs_assigned
instead of the driver specific function ixgbe_vfs_are_assigned.
Don Skidmore provides 4 patches for ixgbe, the first being a fix for
flow control ethtool reporting. Originally ixgbe_device_supports_autoneg_fc()
was expected to be called by only copper devices, which lead to false
information being displayed via ethtool. Two other patches add support
for fixed fiber for SFP+ devices and the addition of a quad-port x520
adapter. The last patch simply bumps the driver version.
Emil Tantilov provides 3 fixes for ixgbe, two of which resolve
semaphore lock issues. The third fix resolves several issues in the
previous implementation of the SFF data dumps of SFP+ modules.
The remaining ixgbe and pci patches are from Jacob Keller. The pci
patches exposes bus speed, link speed and bus width so that drivers
can take advantage of this information. In addition, adds a pci function
which obtains minimum link width and speed. Jacob also provides the
ixgbe patch to incorporate the pci function. He provides a patch that
fixes a lockdep issue created due to ixgbe_ptp_stop always running
cancel_work_sync even if the work item had not been created properly with
INIT_WORK. This issue was found and reported by Stephen Hemminger.
-v2-
* fix patch 3 to be a bool function based on David Miller's feedback
* fix patch 4 debug message based on David Miller's feedback
* fix patch 8 moved the extern declarations to pci.h based on Bjorn
Helgaas's feedback
* fix patch 11 update the error message to include encoding loss based
* fix patch 8/9/10 title based on Bjorn's feedback
The following are changes since commit 60ff779c4abba37a31bd8624ef45026f7fb1b70c:
9p: client: remove unused code and any reference to "cancelled" function
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Alexander Duyck (1):
ixgbe: Use pci_vfs_assigned instead of ixgbe_vfs_are_assigned
Don Skidmore (4):
ixgbe: fix fc autoneg ethtool reporting.
ixgbe: add new media type.
ixgbe: bump version number
ixgbe: add support for quad-port x520 adapter
Emil Tantilov (3):
ixgbe: fix semaphore lock for I2C read/writes on 82598
ixgbe: fix SFF data dumps of SFP+ modules
ixgbe: clear semaphore bits on timeouts
Greg Rose (1):
ixgbe: Retain VLAN filtering in promiscuous + VT mode
Jacob Keller (6):
PCI: expose pcie_link_speed and pcix_bus_speed arrays
PCI: move enum pcie_link_width into pci.h
PCI: Add function to obtain minimum link width and speed
ixgbe: call pcie_get_mimimum_link to check if device has enough
bandwidth
ixgbe: fix lockdep annotation issue for ptp's work item
ixgbe: rename LL_EXTENDED_STATS to use queue instead of q
drivers/net/ethernet/intel/ixgbe/ixgbe.h | 7 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 34 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 240 +++++++++++-
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 90 +++--
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 94 ++---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 167 +++++++-
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 470 ++++++++++++++++-------
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 41 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 12 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 101 +++--
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 12 +
drivers/pci/pci.c | 43 +++
drivers/pci/pci.h | 3 +
drivers/pci/probe.c | 4 +-
include/linux/pci.h | 15 +
include/linux/pci_hotplug.h | 13 -
17 files changed, 1001 insertions(+), 347 deletions(-)
--
1.7.11.7
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
2013-07-31 9:59 Jeff Kirsher
@ 2013-07-31 20:38 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2013-07-31 20:38 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: bhelgaas, netdev, gospo, sassmann, linux-pci
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 31 Jul 2013 02:59:22 -0700
> This series contains updates to ixgbe and pci.
...
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Looks good, pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
@ 2013-08-22 9:49 Jeff Kirsher
2013-08-22 20:01 ` David Miller
0 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2013-08-22 9:49 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann, sergei.shtylyov,
bhutchings
This series contains updates to igb and e1000e.
Akeem provides 3 igb patches, the first resets the link when EEE is enabled
or disabled if the link is up. His second patch changes a register read
which normally stores of the read value to "just-read" so that hardware
can accurately latch the register read. Lastly, he adds rcu_lock to avoid
a possible race condition with igb_update_stats function.
Mitch provides a fix for SR-IOV, where MSI-X interrupts are required, so
make sure that MSI-X is enabled before allowing the user to turn on SR-IOV.
Alex's igb patch make it so that we limit the lower bound for max_frame_size
to the size of a standard Ethernet frame. This allows for feature parity
with other Intel based drivers such as ixgbe.
Carolyn adds a SKU for a flashless i210 device and a fix for get_fw_version()
so that it works for all parts for igb. In addition, she has 2 igb patches
to refactor NVM code to accommodate devices with no flash. Lastly, she
adds code to check for the failure of pci_disable_link_state() to attempt
to work around a problem found with some systems.
Laura provides the remaining 2 igb patches. One removing the hard-coded
value for the size of the RETA indirection table, and creates a macro instead
for the RETA indirection table. The second adds the ethtool callbacks
necessary to change the RETA indirection table from userspace.
Bruce fixes a whitespace issue in a recent commit and resolves a jiffies
comparison warning by using time_after().
Li provides a fix for e1000e to avoid a kernel crash on shutdown by adding
one more check in e1000e_shutdown(). This is due to e1000e_shutdown()
trying to clear correctable errors on the upstream P2P bridge, when under
some cases we do not have the upstream P2P bridge.
v2:
- fixed patch 11 conditional statement from < to <= based on feedback
from Ben Hutchings
- fixed patch 12 patch description (adding the commit summary) based
on feedback from Sergei Shtylyov
The following are changes since commit f8825669b3165bbf4380eabfd641f693d02af866:
net: phy: mdio-octeon: use platform_set_drvdata()
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Akeem G Abodunrin (3):
igb: Reset the link when EEE setting changed
igb: Read register for latch_on without return value
igb: Added rcu_lock to avoid race
Alexander Duyck (1):
igb: Update MTU so that it is always at least a standard frame size
Bruce Allan (2):
e1000e: cleanup whitespace in recent commit
e1000e: resolve checkpatch JIFFIES_COMPARISON warning
Carolyn Wyborny (5):
igb: Refactor of init_nvm_params
igb: Refactor NVM read functions to accommodate devices with no flash
igb: Add device support for flashless SKU of i210 device
igb: Fix get_fw_version function for all parts
e1000e: Add code to check for failure of pci_disable_link_state call
Laura Mihaela Vasilescu (2):
igb: Add macro for size of RETA indirection table
igb: Expose RSS indirection table for ethtool
Li Zhang (1):
e1000e: Avoid kernel crash during shutdown
Mitch A Williams (1):
igb: don't allow SR-IOV without MSI-X
drivers/net/ethernet/intel/e1000e/ethtool.c | 2 +-
drivers/net/ethernet/intel/e1000e/hw.h | 3 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 92 ++++++++++-----
drivers/net/ethernet/intel/igb/e1000_82575.c | 117 ++++++++-----------
drivers/net/ethernet/intel/igb/e1000_defines.h | 34 ++++--
drivers/net/ethernet/intel/igb/e1000_hw.h | 3 +
drivers/net/ethernet/intel/igb/e1000_i210.c | 155 ++++++++++++++++---------
drivers/net/ethernet/intel/igb/e1000_i210.h | 5 +-
drivers/net/ethernet/intel/igb/e1000_nvm.c | 80 +++++++++----
drivers/net/ethernet/intel/igb/e1000_nvm.h | 1 +
drivers/net/ethernet/intel/igb/igb.h | 5 +
drivers/net/ethernet/intel/igb/igb_ethtool.c | 106 ++++++++++++++++-
drivers/net/ethernet/intel/igb/igb_main.c | 105 ++++++++++-------
drivers/net/ethernet/intel/igb/igb_ptp.c | 8 +-
14 files changed, 476 insertions(+), 240 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
2013-08-22 9:49 Jeff Kirsher
@ 2013-08-22 20:01 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2013-08-22 20:01 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann, sergei.shtylyov, bhutchings
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 22 Aug 2013 02:49:36 -0700
> This series contains updates to igb and e1000e.
...
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Pulled, thanks a lot Jeff.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
@ 2014-01-08 6:07 Jeff Kirsher
2014-01-08 6:50 ` David Miller
0 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-01-08 6:07 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann
This series contains updates to i40e only.
Anjali adds more functionality to debugfs to assist development and
testing of admin queue commands.
Greg makes sure broadcast promiscuous is disabled by default, otherwise
VLAN tagged packets out of the assigned VLAN domain are received. Also
provides a fix when the 8021q driver is loaded, so that VLAN 0 tagged
packets are accepted so that upper layers can interpret the priority
bits. Then provides a fix to let the VF to request the PF to set its
already assigned MAC address without generating an error. Greg also
adds helper functions to enable or disable internal switch loopback
when VFs are created or destroyed via the sysfs interface.
Shannon provides most of the changes, where he adds code to ensure
that the hardware waits to make sure that the firmware is ready as well
after reset. Also updates the code to use the new features in the
firmware. Provides a fix while in MFP mode where resources are
reduced, so use a smaller range of test registers than when in SFP mode.
Moves the PF ID initialization code to earlier in the driver
initialization function since a few operations need the information
before the first PF reset is called. Shannon adds a check for MAC
type before reading anything from the registers to ensure we dealing
with the correct MAC type. Then reworks Shadow RAM read word/buffer
functions as to not block whole NVM resources for SR read operations.
Mitch lastly provides a fix to correctly setup ARQ descriptors in
the cleanup code.
Catherine bumps the driver version due to all the recent changes.
v2:
- Added blank lines after local variable declarations to patch 01
as suggested by David Miller
- Used the suggested memset() line in patch 15 as suggested by David
Miller
The following are changes since commit da7c224b1baaeb7543dc7663ae78716f9a6864c1:
net: xfrm: xfrm_policy: silence compiler warning
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Anjali Singhai Jain (1):
i40e: Expose AQ debugfs hooks
Catherine Sullivan (1):
i40e: Bump version
Greg Rose (4):
i40e: Do not enable broadcast promiscuous by default
i40e: Stop accepting any VLAN tag on VLAN 0 filter set
i40e: Allow VF to set already assigned MAC address
i40e: Enable/Disable PF switch LB on SR-IOV configure changes
Kamil Krawczyk (1):
i40e: remove redundant AQ enable
Mitch Williams (1):
i40e: correctly setup ARQ descriptors
Shannon Nelson (7):
i40e: Add code to wait for FW to complete in reset path
i40e: update firmware api to 1.1
i40e: Reduce range of interrupt reg in reg test
i40e: move PF ID init from PF reset to SC init
i40e: check MAC type before any REG access
i40e: rework shadow ram read functions
i40e: whitespace paren and comment tweaks
drivers/net/ethernet/intel/i40e/i40e_adminq.c | 27 ++---
drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h | 126 +++++++++++++++------
drivers/net/ethernet/intel/i40e/i40e_common.c | 51 ++++++---
drivers/net/ethernet/intel/i40e/i40e_debugfs.c | 114 +++++++++++++++++++
drivers/net/ethernet/intel/i40e/i40e_diag.c | 6 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 29 ++---
drivers/net/ethernet/intel/i40e/i40e_nvm.c | 67 +++--------
drivers/net/ethernet/intel/i40e/i40e_register.h | 22 ++++
drivers/net/ethernet/intel/i40e/i40e_type.h | 11 +-
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 100 +++++++++++++---
10 files changed, 397 insertions(+), 156 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
2014-01-08 6:07 Jeff Kirsher
@ 2014-01-08 6:50 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2014-01-08 6:50 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, sassmann
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 7 Jan 2014 22:07:21 -0800
> This series contains updates to i40e only.
...
> v2:
> - Added blank lines after local variable declarations to patch 01
> as suggested by David Miller
> - Used the suggested memset() line in patch 15 as suggested by David
> Miller
Pulled, thanks Jeff.
^ permalink raw reply [flat|nested] 26+ messages in thread
* [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
@ 2014-03-19 3:41 Jeff Kirsher
2014-03-19 3:41 ` [net-next v2 01/15] i40e: support VF link state ndo Jeff Kirsher
` (15 more replies)
0 siblings, 16 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:41 UTC (permalink / raw)
To: davem; +Cc: Jeff Kirsher, netdev, gospo, sassmann
This series contains updates to i40e, i40evf, e1000e, ixgbe and ixgbevf.
Mitch adds support for the VF link state ndo which allows the PF driver
to control the virtual link state of the VF devices. Added
support for viewing and modifying RSS hash options and RSS hash look-up
table programming through ethtool for i40evf. Fixed complaint about
the use of min() where min_t() should be used in i40evf.
Anjali adds support for ethtool -k option for NTUPLE control for i40e.
Elizabeth cleans up and refactors i40e_open() to separate out the VSI
code into its own i40e_vsi_open().
Jesse enables the hardware feature head write back to avoid updating the
descriptor ring by marking each descriptor with a DD bit and instead
writes a memory location with an update to where the driver should clean
up to in i40e and i40evf. Reduces context descriptors for i40e/i40evf
since we do not need context descriptors for every packet, only for
TSO or timesync.
Dan Carpenter fixes a potential array underflow in i40e_vc_process_vf_msg().
Dave fixes an e1000e hardware unit hang where the check for pending Tx work
when link is lost was mistakenly moved to be done only when link is first
detected to be lost. Fixed a problem with poor network performance on
certain silicon in e1000e when configured for 100M HDX performance.
Carolyn adds register defines needed for time sync functions and the code
to call the updated defines.
Jacob adds the ixgbe function for writing PCI config word and checks
whether the adapter has been removed first.
Mark adds the bit __IXGBEVF_REMOVING to indicate that the module is being
removed because the __IXGBEVF_DOWN bit had been overloaded for this
purpose, but leads to trouble. ixgbevf_down function can now prevent
multiple executions by doing test_and_set_bit on __IXGBEVF_DOWN.
v2:
- dropped patch Mitch's patch "i40evf: correctly program RSS HLUT table"
based on feedback from Ben Hutchings so that Mitch can re-work the
patch solution
The following are changes since commit 8cfad496c4257441710735ccef622f3829870164:
ieee802154: properly unshare skbs in ieee802154 *_rcv functions
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
Anjali Singhai Jain (1):
i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control
Carolyn Wyborny (1):
igb: Add register defines needed for time sync functions
Catherine Sullivan (1):
i40e/i40evf: Bump build versions
Dan Carpenter (1):
i40e: potential array underflow in i40e_vc_process_vf_msg()
David Ertman (2):
e1000e: Fix Hardware Unit Hang
e1000e: Fix Explicitly set Transmit Control Register
Elizabeth Kappler (1):
i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()
Jacob Keller (1):
ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check
Jesse Brandeburg (2):
i40e/i40evf: enable hardware feature head write back
i40e/i40evf: reduce context descriptors
Mark Rustad (2):
ixgbevf: Indicate removal state explicitly
ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit
Mitch Williams (3):
i40e: support VF link state ndo
i40evf: correctly program RSS HLUT table
i40evf: use min_t
drivers/net/ethernet/intel/e1000e/netdev.c | 42 +++++++---
drivers/net/ethernet/intel/i40e/i40e.h | 4 +-
drivers/net/ethernet/intel/i40e/i40e_main.c | 89 ++++++++++++++++++---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 48 ++++++++++--
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 91 ++++++++++++++++++++--
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 4 +
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 48 ++++++++++--
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 +++---
drivers/net/ethernet/intel/igb/e1000_defines.h | 70 ++++++++++++++++-
drivers/net/ethernet/intel/igb/e1000_regs.h | 9 +++
drivers/net/ethernet/intel/igb/igb_ptp.c | 4 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 6 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 1 +
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 +++
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 18 +++--
16 files changed, 400 insertions(+), 71 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 26+ messages in thread
* [net-next v2 01/15] i40e: support VF link state ndo
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
@ 2014-03-19 3:41 ` Jeff Kirsher
2014-03-19 18:06 ` David Miller
2014-03-19 3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
` (14 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:41 UTC (permalink / raw)
To: davem
Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
Jeff Kirsher
From: Mitch Williams <mitch.a.williams@intel.com>
This netdev op allows the PF driver to control the virtual link state of
the VF devices. This can be used to deny naughty VF drivers access to
the wire, or to allow VFs (regardless of temperament) to communicate
with each other over the device's internal switch even though external
link is down.
Add the actual ndo function, and modify vc_notify_link_state to check
the link status of each VF before sending a message in the case when
physical link changes state.
Change-ID: Ib5a6924da78c540789f21d26b5e8086d71c29384
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 86 ++++++++++++++++++++--
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 4 +
3 files changed, 85 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 3daaf20..9c4f53e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6547,6 +6547,7 @@ static const struct net_device_ops i40e_netdev_ops = {
.ndo_set_vf_vlan = i40e_ndo_set_vf_port_vlan,
.ndo_set_vf_tx_rate = i40e_ndo_set_vf_bw,
.ndo_get_vf_config = i40e_ndo_get_vf_config,
+ .ndo_set_vf_link_state = i40e_ndo_set_vf_link_state,
#ifdef CONFIG_I40E_VXLAN
.ndo_add_vxlan_port = i40e_add_vxlan_port,
.ndo_del_vxlan_port = i40e_del_vxlan_port,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 7839343..f018238 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1920,15 +1920,28 @@ static void i40e_vc_vf_broadcast(struct i40e_pf *pf,
void i40e_vc_notify_link_state(struct i40e_pf *pf)
{
struct i40e_virtchnl_pf_event pfe;
+ struct i40e_hw *hw = &pf->hw;
+ struct i40e_vf *vf = pf->vf;
+ struct i40e_link_status *ls = &pf->hw.phy.link_info;
+ int i;
pfe.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
pfe.severity = I40E_PF_EVENT_SEVERITY_INFO;
- pfe.event_data.link_event.link_status =
- pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP;
- pfe.event_data.link_event.link_speed = pf->hw.phy.link_info.link_speed;
-
- i40e_vc_vf_broadcast(pf, I40E_VIRTCHNL_OP_EVENT, I40E_SUCCESS,
- (u8 *)&pfe, sizeof(struct i40e_virtchnl_pf_event));
+ for (i = 0; i < pf->num_alloc_vfs; i++) {
+ if (vf->link_forced) {
+ pfe.event_data.link_event.link_status = vf->link_up;
+ pfe.event_data.link_event.link_speed =
+ (vf->link_up ? I40E_LINK_SPEED_40GB : 0);
+ } else {
+ pfe.event_data.link_event.link_status =
+ ls->link_info & I40E_AQ_LINK_UP;
+ pfe.event_data.link_event.link_speed = ls->link_speed;
+ }
+ i40e_aq_send_msg_to_vf(hw, vf->vf_id, I40E_VIRTCHNL_OP_EVENT,
+ 0, (u8 *)&pfe, sizeof(pfe),
+ NULL);
+ vf++;
+ }
}
/**
@@ -2193,3 +2206,64 @@ int i40e_ndo_get_vf_config(struct net_device *netdev,
error_param:
return ret;
}
+
+/**
+ * i40e_ndo_set_vf_link_state
+ * @netdev: network interface device structure
+ * @vf_id: vf identifier
+ * @link: required link state
+ *
+ * Set the link state of a specified VF, regardless of physical link state
+ **/
+int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link)
+{
+ struct i40e_netdev_priv *np = netdev_priv(netdev);
+ struct i40e_pf *pf = np->vsi->back;
+ struct i40e_virtchnl_pf_event pfe;
+ struct i40e_hw *hw = &pf->hw;
+ struct i40e_vf *vf;
+ int ret = 0;
+
+ /* validate the request */
+ if (vf_id >= pf->num_alloc_vfs) {
+ dev_err(&pf->pdev->dev, "Invalid VF Identifier %d\n", vf_id);
+ ret = -EINVAL;
+ goto error_out;
+ }
+
+ vf = &(pf->vf[vf_id]);
+
+ pfe.event = I40E_VIRTCHNL_EVENT_LINK_CHANGE;
+ pfe.severity = I40E_PF_EVENT_SEVERITY_INFO;
+
+ switch (link) {
+ case IFLA_VF_LINK_STATE_AUTO:
+ vf->link_forced = false;
+ pfe.event_data.link_event.link_status =
+ pf->hw.phy.link_info.link_info & I40E_AQ_LINK_UP;
+ pfe.event_data.link_event.link_speed =
+ pf->hw.phy.link_info.link_speed;
+ break;
+ case IFLA_VF_LINK_STATE_ENABLE:
+ vf->link_forced = true;
+ vf->link_up = true;
+ pfe.event_data.link_event.link_status = true;
+ pfe.event_data.link_event.link_speed = I40E_LINK_SPEED_40GB;
+ break;
+ case IFLA_VF_LINK_STATE_DISABLE:
+ vf->link_forced = true;
+ vf->link_up = false;
+ pfe.event_data.link_event.link_status = false;
+ pfe.event_data.link_event.link_speed = 0;
+ break;
+ default:
+ ret = -EINVAL;
+ goto error_out;
+ }
+ /* Notify the VF of its new link state */
+ i40e_aq_send_msg_to_vf(hw, vf->vf_id, I40E_VIRTCHNL_OP_EVENT,
+ 0, (u8 *)&pfe, sizeof(pfe), NULL);
+
+error_out:
+ return ret;
+}
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
index bedf0ba..389c47f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h
@@ -98,6 +98,8 @@ struct i40e_vf {
unsigned long vf_caps; /* vf's adv. capabilities */
unsigned long vf_states; /* vf's runtime states */
+ bool link_forced;
+ bool link_up; /* only valid if vf link is forced */
};
void i40e_free_vfs(struct i40e_pf *pf);
@@ -116,6 +118,8 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev,
int i40e_ndo_set_vf_bw(struct net_device *netdev, int vf_id, int tx_rate);
int i40e_ndo_get_vf_config(struct net_device *netdev,
int vf_id, struct ifla_vf_info *ivi);
+int i40e_ndo_set_vf_link_state(struct net_device *netdev, int vf_id, int link);
+
void i40e_vc_notify_link_state(struct i40e_pf *pf);
void i40e_vc_notify_reset(struct i40e_pf *pf);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 02/15] i40evf: correctly program RSS HLUT table
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-19 3:41 ` [net-next v2 01/15] i40e: support VF link state ndo Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 18:07 ` David Miller
2014-03-19 3:42 ` [net-next v2 03/15] i40evf: use min_t Jeff Kirsher
` (13 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
Jeff Kirsher
From: Mitch Williams <mitch.a.williams@intel.com>
The HLUT programming loop in in i40evf_configure_rss was a) overly-
complicated, and b) just plain broken. Most of the entries ended up being
not written at all, so most of the flows ended up at queue zero.
Refactor the HLUT programming loop to simply walk through the registers
and write four values to each one, incrementing through the number of
available queues.
Change-ID: I75766179bc67e4e997187794f3144e28c83fd00d
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index d62e27f..7cb0cda 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1414,6 +1414,7 @@ restart_watchdog:
schedule_work(&adapter->adminq_task);
}
+#define NEXT_QUEUE(_j) (++_j >= adapter->vsi_res->num_queue_pairs ? _j = 0 : _j)
/**
* i40evf_configure_rss - Prepare for RSS if used
* @adapter: board private structure
@@ -1444,15 +1445,13 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter)
wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32));
/* Populate the LUT with max no. of queues in round robin fashion */
- for (i = 0, j = 0; i < I40E_VFQF_HLUT_MAX_INDEX; i++, j++) {
- if (j == adapter->vsi_res->num_queue_pairs)
- j = 0;
- /* lut = 4-byte sliding window of 4 lut entries */
- lut = (lut << 8) | (j &
- ((0x1 << 8) - 1));
- /* On i = 3, we have 4 entries in lut; write to the register */
- if ((i & 3) == 3)
- wr32(hw, I40E_VFQF_HLUT(i >> 2), lut);
+ j = adapter->vsi_res->num_queue_pairs;
+ for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) {
+ lut = NEXT_QUEUE(j);
+ lut |= NEXT_QUEUE(j) << 8;
+ lut |= NEXT_QUEUE(j) << 16;
+ lut |= NEXT_QUEUE(j) << 24;
+ wr32(hw, I40E_VFQF_HLUT(i), lut);
}
i40e_flush(hw);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 03/15] i40evf: use min_t
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-19 3:41 ` [net-next v2 01/15] i40e: support VF link state ndo Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 04/15] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
` (12 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Mitch Williams, netdev, gospo, sassmann, Catherine Sullivan,
Jeff Kirsher
From: Mitch Williams <mitch.a.williams@intel.com>
Checkpatch complained in an earlier patch about using min(), but that
change would have been completely unrelated to the point of that patch.
So fix it here.
Change-ID: I2cd87b39cfd406850d283b88f259757a6bcd14cd
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 7cb0cda..963387c 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1140,8 +1140,8 @@ static int i40evf_set_interrupt_capability(struct i40evf_adapter *adapter)
* than CPU's. So let's be conservative and only ask for
* (roughly) twice the number of vectors as there are CPU's.
*/
- v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
- v_budget = min(v_budget, (int)adapter->vf_res->max_vectors);
+ v_budget = min_t(int, pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
+ v_budget = min_t(int, v_budget, (int)adapter->vf_res->max_vectors);
/* A failure in MSI-X entry allocation isn't fatal, but it does
* mean we disable MSI-X capabilities of the adapter.
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 04/15] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (2 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 03/15] i40evf: use min_t Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 05/15] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
` (11 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Anjali Singhai Jain, netdev, gospo, sassmann, Catherine Sullivan,
Jeff Kirsher
From: Anjali Singhai Jain <anjali.singhai@intel.com>
This enables option '-k/-K' in ethtool for NTUPLE control.
NTUPLE control requires a reset, to take effect. When the feature is
turned off, the SW list of stored FD SB filters gets cleaned up.
Change-ID: I9d564b67a10d4afa11de3b320d601c3d2e6edc1f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 1 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 41 +++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index bd1b469..ac04112 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -558,6 +558,7 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
struct i40e_fdir_filter *input, bool add);
void i40e_fdir_check_and_reenable(struct i40e_pf *pf);
int i40e_get_current_fd_count(struct i40e_pf *pf);
+bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features);
void i40e_set_ethtool_ops(struct net_device *netdev);
struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
u8 *macaddr, s16 vlan,
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 9c4f53e..5015dad 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -6409,6 +6409,39 @@ sw_init_done:
}
/**
+ * i40e_set_ntuple - set the ntuple feature flag and take action
+ * @pf: board private structure to initialize
+ * @features: the feature set that the stack is suggesting
+ *
+ * returns a bool to indicate if reset needs to happen
+ **/
+bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features)
+{
+ bool need_reset = false;
+
+ /* Check if Flow Director n-tuple support was enabled or disabled. If
+ * the state changed, we need to reset.
+ */
+ if (features & NETIF_F_NTUPLE) {
+ /* Enable filters and mark for reset */
+ if (!(pf->flags & I40E_FLAG_FD_SB_ENABLED))
+ need_reset = true;
+ pf->flags |= I40E_FLAG_FD_SB_ENABLED;
+ } else {
+ /* turn off filters, mark for reset and clear SW filter list */
+ if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
+ need_reset = true;
+ i40e_fdir_filter_exit(pf);
+ }
+ pf->flags &= ~I40E_FLAG_FD_SB_ENABLED;
+ /* if ATR was disabled it can be re-enabled. */
+ if (!(pf->flags & I40E_FLAG_FD_ATR_ENABLED))
+ pf->flags |= I40E_FLAG_FD_ATR_ENABLED;
+ }
+ return need_reset;
+}
+
+/**
* i40e_set_features - set the netdev feature flags
* @netdev: ptr to the netdev being adjusted
* @features: the feature set that the stack is suggesting
@@ -6418,12 +6451,19 @@ static int i40e_set_features(struct net_device *netdev,
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
+ struct i40e_pf *pf = vsi->back;
+ bool need_reset;
if (features & NETIF_F_HW_VLAN_CTAG_RX)
i40e_vlan_stripping_enable(vsi);
else
i40e_vlan_stripping_disable(vsi);
+ need_reset = i40e_set_ntuple(pf, features);
+
+ if (need_reset)
+ i40e_do_reset(pf, (1 << __I40E_PF_RESET_REQUESTED));
+
return 0;
}
@@ -6595,6 +6635,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_RXCSUM |
+ NETIF_F_NTUPLE |
NETIF_F_RXHASH |
0;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 05/15] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (3 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 04/15] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
` (10 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Elizabeth Kappler, netdev, gospo, sassmann, Akeem G Abodunrin,
Catherine Sullivan, Jeff Kirsher
From: Elizabeth Kappler <elizabeth.m.kappler@intel.com>
This patch cleans up and moves a portion of i40e_open to i40e_vsi_open,
in order to have a shorter vsi_open function that does only that.
Change-ID: I1c418dda94dcfc0eb7d4386a70c330692ef5ecc9
Signed-off-by: Elizabeth Kappler <elizabeth.m.kappler@intel.com>
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e.h | 3 ++-
drivers/net/ethernet/intel/i40e/i40e_main.c | 40 +++++++++++++++++++++++------
2 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index ac04112..33cd8b6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -208,7 +208,7 @@ struct i40e_pf {
bool fc_autoneg_status;
u16 eeprom_version;
- u16 num_vmdq_vsis; /* num vmdq pools this pf has set up */
+ u16 num_vmdq_vsis; /* num vmdq vsis this pf has set up */
u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
u16 num_req_vfs; /* num vfs requested for this vf */
@@ -597,6 +597,7 @@ void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf);
int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);
+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);
int i40e_vsi_kill_vlan(struct i40e_vsi *vsi, s16 vid);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 5015dad..661cd42 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4235,7 +4235,6 @@ static int i40e_open(struct net_device *netdev)
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
- char int_name[IFNAMSIZ];
int err;
/* disallow open during test */
@@ -4244,6 +4243,31 @@ static int i40e_open(struct net_device *netdev)
netif_carrier_off(netdev);
+ err = i40e_vsi_open(vsi);
+ if (err)
+ return err;
+
+#ifdef CONFIG_I40E_VXLAN
+ vxlan_get_rx_port(netdev);
+#endif
+
+ return 0;
+}
+
+/**
+ * i40e_vsi_open -
+ * @vsi: the VSI to open
+ *
+ * Finish initialization of the VSI.
+ *
+ * Returns 0 on success, negative value on failure
+ **/
+int i40e_vsi_open(struct i40e_vsi *vsi)
+{
+ struct i40e_pf *pf = vsi->back;
+ char int_name[IFNAMSIZ];
+ int err;
+
/* allocate descriptors */
err = i40e_vsi_setup_tx_resources(vsi);
if (err)
@@ -4256,18 +4280,22 @@ static int i40e_open(struct net_device *netdev)
if (err)
goto err_setup_rx;
+ if (!vsi->netdev) {
+ err = EINVAL;
+ goto err_setup_rx;
+ }
snprintf(int_name, sizeof(int_name) - 1, "%s-%s",
- dev_driver_string(&pf->pdev->dev), netdev->name);
+ dev_driver_string(&pf->pdev->dev), vsi->netdev->name);
err = i40e_vsi_request_irq(vsi, int_name);
if (err)
goto err_setup_rx;
/* Notify the stack of the actual queue counts. */
- err = netif_set_real_num_tx_queues(netdev, vsi->num_queue_pairs);
+ err = netif_set_real_num_tx_queues(vsi->netdev, vsi->num_queue_pairs);
if (err)
goto err_set_queues;
- err = netif_set_real_num_rx_queues(netdev, vsi->num_queue_pairs);
+ err = netif_set_real_num_rx_queues(vsi->netdev, vsi->num_queue_pairs);
if (err)
goto err_set_queues;
@@ -4275,10 +4303,6 @@ static int i40e_open(struct net_device *netdev)
if (err)
goto err_up_complete;
-#ifdef CONFIG_I40E_VXLAN
- vxlan_get_rx_port(netdev);
-#endif
-
return 0;
err_up_complete:
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (4 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 05/15] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 18:09 ` David Miller
2014-03-19 3:42 ` [net-next v2 07/15] i40e/i40evf: reduce context descriptors Jeff Kirsher
` (9 subsequent siblings)
15 siblings, 1 reply; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Jesse Brandeburg, netdev, gospo, sassmann, Mitch Williams,
Catherine Sullivan, Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
The hardware supports a feature to avoid updating the descriptor
ring by marking each descriptor with a DD bit, and instead
writes a memory location with an update to where the driver
should clean up to. Enable this feature.
Change-ID: I5da4e0681f0b581a6401c950a81808792267fe57
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 5 +++
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 45 +++++++++++++++++++---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 3 ++
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 45 +++++++++++++++++++---
4 files changed, 86 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 661cd42..95433d4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -2181,6 +2181,11 @@ static int i40e_configure_tx_ring(struct i40e_ring *ring)
tx_ctx.fd_ena = !!(vsi->back->flags & (I40E_FLAG_FD_SB_ENABLED |
I40E_FLAG_FD_ATR_ENABLED));
tx_ctx.timesync_ena = !!(vsi->back->flags & I40E_FLAG_PTP);
+ /* FDIR VSI tx ring can still use RS bit and writebacks */
+ if (vsi->type != I40E_VSI_FDIR)
+ tx_ctx.head_wb_ena = 1;
+ tx_ctx.head_wb_addr = ring->dma +
+ (ring->count * sizeof(struct i40e_tx_desc));
/* As part of VSI creation/update, FW allocates certain
* Tx arbitration queue sets for each TC enabled for
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 88666ad..9892a69 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -619,6 +619,19 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)
}
/**
+ * i40e_get_head - Retrieve head from head writeback
+ * @tx_ring: tx ring to fetch head of
+ *
+ * Returns value of Tx ring head based on value stored
+ * in head write-back location
+ **/
+static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
+{
+ void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
+ return le32_to_cpu(*(volatile __le32 *)head);
+}
+
+/**
* i40e_clean_tx_irq - Reclaim resources after transmit completes
* @tx_ring: tx ring to clean
* @budget: how many cleans we're allowed
@@ -629,6 +642,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
{
u16 i = tx_ring->next_to_clean;
struct i40e_tx_buffer *tx_buf;
+ struct i40e_tx_desc *tx_head;
struct i40e_tx_desc *tx_desc;
unsigned int total_packets = 0;
unsigned int total_bytes = 0;
@@ -637,6 +651,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
tx_desc = I40E_TX_DESC(tx_ring, i);
i -= tx_ring->count;
+ tx_head = I40E_TX_DESC(tx_ring, i40e_get_head(tx_ring));
+
do {
struct i40e_tx_desc *eop_desc = tx_buf->next_to_watch;
@@ -647,9 +663,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
/* prevent any other reads prior to eop_desc */
read_barrier_depends();
- /* if the descriptor isn't done, no work yet to do */
- if (!(eop_desc->cmd_type_offset_bsz &
- cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))
+ /* we have caught up to head, no work left to do */
+ if (tx_head == tx_desc)
break;
/* clear next_to_watch to prevent false hangs */
@@ -905,6 +920,10 @@ int i40e_setup_tx_descriptors(struct i40e_ring *tx_ring)
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
+ /* add u32 for head writeback, align after this takes care of
+ * guaranteeing this is at least one cache line in size
+ */
+ tx_ring->size += sizeof(u32);
tx_ring->size = ALIGN(tx_ring->size, 4096);
tx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,
&tx_ring->dma, GFP_KERNEL);
@@ -2042,9 +2061,23 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
tx_bi = &tx_ring->tx_bi[i];
}
- tx_desc->cmd_type_offset_bsz =
- build_ctob(td_cmd, td_offset, size, td_tag) |
- cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT);
+ /* Place RS bit on last descriptor of any packet that spans across the
+ * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline.
+ */
+#define WB_STRIDE 0x3
+ if (((i & WB_STRIDE) != WB_STRIDE) &&
+ (first <= &tx_ring->tx_bi[i]) &&
+ (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) {
+ tx_desc->cmd_type_offset_bsz =
+ build_ctob(td_cmd, td_offset, size, td_tag) |
+ cpu_to_le64((u64)I40E_TX_DESC_CMD_EOP <<
+ I40E_TXD_QW1_CMD_SHIFT);
+ } else {
+ tx_desc->cmd_type_offset_bsz =
+ build_ctob(td_cmd, td_offset, size, td_tag) |
+ cpu_to_le64((u64)I40E_TXD_CMD <<
+ I40E_TXD_QW1_CMD_SHIFT);
+ }
netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
tx_ring->queue_index),
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index f018238..46fc2c6 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -230,6 +230,9 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_idx,
tx_ctx.qlen = info->ring_len;
tx_ctx.rdylist = le16_to_cpu(pf->vsi[vsi_idx]->info.qs_handle[0]);
tx_ctx.rdylist_act = 0;
+ tx_ctx.head_wb_ena = 1;
+ tx_ctx.head_wb_addr = info->dma_ring_addr +
+ (info->ring_len * sizeof(struct i40e_tx_desc));
/* clear the context in the HMC */
ret = i40e_clear_lan_tx_queue_context(hw, pf_queue_id);
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index b1d87c6..d4d9842 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -170,6 +170,19 @@ static bool i40e_check_tx_hang(struct i40e_ring *tx_ring)
}
/**
+ * i40e_get_head - Retrieve head from head writeback
+ * @tx_ring: tx ring to fetch head of
+ *
+ * Returns value of Tx ring head based on value stored
+ * in head write-back location
+ **/
+static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
+{
+ void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
+ return le32_to_cpu(*(volatile __le32 *)head);
+}
+
+/**
* i40e_clean_tx_irq - Reclaim resources after transmit completes
* @tx_ring: tx ring to clean
* @budget: how many cleans we're allowed
@@ -180,6 +193,7 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
{
u16 i = tx_ring->next_to_clean;
struct i40e_tx_buffer *tx_buf;
+ struct i40e_tx_desc *tx_head;
struct i40e_tx_desc *tx_desc;
unsigned int total_packets = 0;
unsigned int total_bytes = 0;
@@ -188,6 +202,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
tx_desc = I40E_TX_DESC(tx_ring, i);
i -= tx_ring->count;
+ tx_head = I40E_TX_DESC(tx_ring, i40e_get_head(tx_ring));
+
do {
struct i40e_tx_desc *eop_desc = tx_buf->next_to_watch;
@@ -198,9 +214,8 @@ static bool i40e_clean_tx_irq(struct i40e_ring *tx_ring, int budget)
/* prevent any other reads prior to eop_desc */
read_barrier_depends();
- /* if the descriptor isn't done, no work yet to do */
- if (!(eop_desc->cmd_type_offset_bsz &
- cpu_to_le64(I40E_TX_DESC_DTYPE_DESC_DONE)))
+ /* we have caught up to head, no work left to do */
+ if (tx_head == tx_desc)
break;
/* clear next_to_watch to prevent false hangs */
@@ -432,6 +447,10 @@ int i40evf_setup_tx_descriptors(struct i40e_ring *tx_ring)
/* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(struct i40e_tx_desc);
+ /* add u32 for head writeback, align after this takes care of
+ * guaranteeing this is at least one cache line in size
+ */
+ tx_ring->size += sizeof(u32);
tx_ring->size = ALIGN(tx_ring->size, 4096);
tx_ring->desc = dma_alloc_coherent(dev, tx_ring->size,
&tx_ring->dma, GFP_KERNEL);
@@ -1377,9 +1396,23 @@ static void i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
tx_bi = &tx_ring->tx_bi[i];
}
- tx_desc->cmd_type_offset_bsz =
- build_ctob(td_cmd, td_offset, size, td_tag) |
- cpu_to_le64((u64)I40E_TXD_CMD << I40E_TXD_QW1_CMD_SHIFT);
+ /* Place RS bit on last descriptor of any packet that spans across the
+ * 4th descriptor (WB_STRIDE aka 0x3) in a 64B cacheline.
+ */
+#define WB_STRIDE 0x3
+ if (((i & WB_STRIDE) != WB_STRIDE) &&
+ (first <= &tx_ring->tx_bi[i]) &&
+ (first >= &tx_ring->tx_bi[i & ~WB_STRIDE])) {
+ tx_desc->cmd_type_offset_bsz =
+ build_ctob(td_cmd, td_offset, size, td_tag) |
+ cpu_to_le64((u64)I40E_TX_DESC_CMD_EOP <<
+ I40E_TXD_QW1_CMD_SHIFT);
+ } else {
+ tx_desc->cmd_type_offset_bsz =
+ build_ctob(td_cmd, td_offset, size, td_tag) |
+ cpu_to_le64((u64)I40E_TXD_CMD <<
+ I40E_TXD_QW1_CMD_SHIFT);
+ }
netdev_tx_sent_queue(netdev_get_tx_queue(tx_ring->netdev,
tx_ring->queue_index),
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 07/15] i40e/i40evf: reduce context descriptors
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (5 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 08/15] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
` (8 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem
Cc: Jesse Brandeburg, netdev, gospo, sassmann, Catherine Sullivan,
Jeff Kirsher
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
We don't need context descriptors for every packet, only tso
or timesync. This fixes a bug in the driver where it would
always add a context even if all the passed in values
to the context descriptor function were 0/default values.
Change-ID: I0101d2b893380707b5c2de61aab3e16d4310e9a1
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 ++-
drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 9892a69..752e680 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1950,7 +1950,8 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
struct i40e_tx_context_desc *context_desc;
int i = tx_ring->next_to_use;
- if (!cd_type_cmd_tso_mss && !cd_tunneling && !cd_l2tag2)
+ if ((cd_type_cmd_tso_mss == I40E_TX_DESC_DTYPE_CONTEXT) &&
+ !cd_tunneling && !cd_l2tag2)
return;
/* grab the next descriptor */
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
index d4d9842..18f174d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c
@@ -1285,7 +1285,8 @@ static void i40e_create_tx_ctx(struct i40e_ring *tx_ring,
struct i40e_tx_context_desc *context_desc;
int i = tx_ring->next_to_use;
- if (!cd_type_cmd_tso_mss && !cd_tunneling && !cd_l2tag2)
+ if ((cd_type_cmd_tso_mss == I40E_TX_DESC_DTYPE_CONTEXT) &&
+ !cd_tunneling && !cd_l2tag2)
return;
/* grab the next descriptor */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 08/15] i40e: potential array underflow in i40e_vc_process_vf_msg()
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (6 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 07/15] i40e/i40evf: reduce context descriptors Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 09/15] i40e/i40evf: Bump build versions Jeff Kirsher
` (7 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Dan Carpenter, netdev, gospo, sassmann, Jeff Kirsher
From: Dan Carpenter <dan.carpenter@oracle.com>
If "vf_id" is smaller than hw->func_caps.vf_base_id then it leads to
an array underflow of the pf->vf[] array. This is unlikely to happen
unless the hardware is bad, but it's a small change and it silences a
static checker warning.
Fixes: 7efa84b7abc1 ('i40e: support VFs on PFs other than 0')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 46fc2c6..f0dc71b 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -1774,7 +1774,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode,
u32 v_retval, u8 *msg, u16 msglen)
{
struct i40e_hw *hw = &pf->hw;
- int local_vf_id = vf_id - hw->func_caps.vf_base_id;
+ unsigned int local_vf_id = vf_id - hw->func_caps.vf_base_id;
struct i40e_vf *vf;
int ret;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 09/15] i40e/i40evf: Bump build versions
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (7 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 08/15] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 10/15] e1000e: Fix Hardware Unit Hang Jeff Kirsher
` (6 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Catherine Sullivan, netdev, gospo, sassmann, Jeff Kirsher
From: Catherine Sullivan <catherine.sullivan@intel.com>
Bump to version 0.3.36 for i40e and 0.9.16 for i40evf.
Change-ID: I7b4ff97b32d2825181803c03c316381a7608a618
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 2 +-
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 95433d4..1133542 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -38,7 +38,7 @@ static const char i40e_driver_string[] =
#define DRV_VERSION_MAJOR 0
#define DRV_VERSION_MINOR 3
-#define DRV_VERSION_BUILD 34
+#define DRV_VERSION_BUILD 36
#define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \
__stringify(DRV_VERSION_MINOR) "." \
__stringify(DRV_VERSION_BUILD) DRV_KERN
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 963387c..21934bf 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -31,7 +31,7 @@ char i40evf_driver_name[] = "i40evf";
static const char i40evf_driver_string[] =
"Intel(R) XL710 X710 Virtual Function Network Driver";
-#define DRV_VERSION "0.9.14"
+#define DRV_VERSION "0.9.16"
const char i40evf_driver_version[] = DRV_VERSION;
static const char i40evf_copyright[] =
"Copyright (c) 2013 - 2014 Intel Corporation.";
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 10/15] e1000e: Fix Hardware Unit Hang
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (8 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 09/15] i40e/i40evf: Bump build versions Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 11/15] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
` (5 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: David Ertman, netdev, gospo, sassmann, Bruce Allan, Jeff Kirsher
From: David Ertman <davidx.m.ertman@intel.com>
The check for pending Tx work when link is lost was mistakenly moved to be
done only when link is first detected to be lost. It turns out there is a
small window of opportunity for additional Tx work to get queued up shortly
after link is dropped.
Move the check back to the place it was before in the watchdog task. Put in
additional debug information for other reset paths and a final catch-all for
false hangs in the scheduled function that prints out the hardware hang
message.
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 32 +++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index eafad41..d577723 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -1090,8 +1090,14 @@ static void e1000_print_hw_hang(struct work_struct *work)
adapter->tx_hang_recheck = true;
return;
}
- /* Real hang detected */
adapter->tx_hang_recheck = false;
+
+ if (er32(TDH(0)) == er32(TDT(0))) {
+ e_dbg("false hang detected, ignoring\n");
+ return;
+ }
+
+ /* Real hang detected */
netif_stop_queue(netdev);
e1e_rphy(hw, MII_BMSR, &phy_status);
@@ -1121,6 +1127,8 @@ static void e1000_print_hw_hang(struct work_struct *work)
eop, jiffies, eop_desc->upper.fields.status, er32(STATUS),
phy_status, phy_1000t_status, phy_ext_status, pci_status);
+ e1000e_dump(adapter);
+
/* Suggest workaround for known h/w issue */
if ((hw->mac.type == e1000_pchlan) && (er32(CTRL) & E1000_CTRL_TFCE))
e_err("Try turning off Tx pause (flow control) via ethtool\n");
@@ -4798,6 +4806,7 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter)
if (adapter->phy_hang_count > 1) {
adapter->phy_hang_count = 0;
+ e_dbg("PHY appears hung - resetting\n");
schedule_work(&adapter->reset_task);
}
}
@@ -4956,15 +4965,11 @@ static void e1000_watchdog_task(struct work_struct *work)
mod_timer(&adapter->phy_info_timer,
round_jiffies(jiffies + 2 * HZ));
- /* The link is lost so the controller stops DMA.
- * If there is queued Tx work that cannot be done
- * or if on an 8000ES2LAN which requires a Rx packet
- * buffer work-around on link down event, reset the
- * controller to flush the Tx/Rx packet buffers.
- * (Do the reset outside of interrupt context).
+ /* 8000ES2LAN requires a Rx packet buffer work-around
+ * on link down event; reset the controller to flush
+ * the Rx packet buffer.
*/
- if ((adapter->flags & FLAG_RX_NEEDS_RESTART) ||
- (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
+ if (adapter->flags & FLAG_RX_NEEDS_RESTART)
adapter->flags |= FLAG_RESTART_NOW;
else
pm_schedule_suspend(netdev->dev.parent,
@@ -4987,6 +4992,15 @@ link_up:
adapter->gotc_old = adapter->stats.gotc;
spin_unlock(&adapter->stats64_lock);
+ /* If the link is lost the controller stops DMA, but
+ * if there is queued Tx work it cannot be done. So
+ * reset the controller to flush the Tx packet buffers.
+ */
+ if (!netif_carrier_ok(netdev) &&
+ (e1000_desc_unused(tx_ring) + 1 < tx_ring->count))
+ adapter->flags |= FLAG_RESTART_NOW;
+
+ /* If reset is necessary, do it outside of interrupt context. */
if (adapter->flags & FLAG_RESTART_NOW) {
schedule_work(&adapter->reset_task);
/* return immediately since reset is imminent */
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 11/15] e1000e: Fix Explicitly set Transmit Control Register
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (9 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 10/15] e1000e: Fix Hardware Unit Hang Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 12/15] igb: Add register defines needed for time sync functions Jeff Kirsher
` (4 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: David Ertman, netdev, gospo, sassmann, Todd Fujinaka,
Jeff Kirsher
From: David Ertman <davidx.m.ertman@intel.com>
This patch causes the TCTL to be explicitly set to fix a problem with
poor network performance (throughput) on certain silicon when configured
for 100M HDX performance.
Cc: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Acked-by: Bruce W. Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index d577723..6bd1832 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -2898,7 +2898,7 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
struct e1000_hw *hw = &adapter->hw;
struct e1000_ring *tx_ring = adapter->tx_ring;
u64 tdba;
- u32 tdlen, tarc;
+ u32 tdlen, tctl, tarc;
/* Setup the HW Tx Head and Tail descriptor pointers */
tdba = tx_ring->dma;
@@ -2935,6 +2935,12 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
/* erratum work around: set txdctl the same for both queues */
ew32(TXDCTL(1), er32(TXDCTL(0)));
+ /* Program the Transmit Control Register */
+ tctl = er32(TCTL);
+ tctl &= ~E1000_TCTL_CT;
+ tctl |= E1000_TCTL_PSP | E1000_TCTL_RTLC |
+ (E1000_COLLISION_THRESHOLD << E1000_CT_SHIFT);
+
if (adapter->flags & FLAG_TARC_SPEED_MODE_BIT) {
tarc = er32(TARC(0));
/* set the speed mode bit, we'll clear it if we're not at
@@ -2965,6 +2971,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter)
/* enable Report Status bit */
adapter->txd_cmd |= E1000_TXD_CMD_RS;
+ ew32(TCTL, tctl);
+
hw->mac.ops.config_collision_dist(hw);
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 12/15] igb: Add register defines needed for time sync functions
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (10 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 11/15] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 13/15] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
` (3 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Carolyn Wyborny, netdev, gospo, sassmann, Jeff Kirsher
From: Carolyn Wyborny <carolyn.wyborny@intel.com>
This patch adds defines needed for implementing the auxiliary time sync
functions and also changes code to call the updated defines instead of
the old.
Reported-by: Richard Cochran <ricahrdcochran@gmail.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/igb/e1000_defines.h | 70 ++++++++++++++++++++++++--
drivers/net/ethernet/intel/igb/e1000_regs.h | 9 ++++
drivers/net/ethernet/intel/igb/igb_ptp.c | 4 +-
3 files changed, 78 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h
index 393c896..b05bf92 100644
--- a/drivers/net/ethernet/intel/igb/e1000_defines.h
+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h
@@ -43,7 +43,11 @@
#define E1000_WUFC_BC 0x00000010 /* Broadcast Wakeup Enable */
/* Extended Device Control */
+#define E1000_CTRL_EXT_SDP2_DATA 0x00000040 /* Value of SW Defineable Pin 2 */
#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Defineable Pin 3 */
+#define E1000_CTRL_EXT_SDP2_DIR 0x00000400 /* SDP2 Data direction */
+#define E1000_CTRL_EXT_SDP3_DIR 0x00000800 /* SDP3 Data direction */
+
/* Physical Func Reset Done Indication */
#define E1000_CTRL_EXT_PFRSTD 0x00004000
#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
@@ -190,7 +194,8 @@
/* enable link status from external LINK_0 and LINK_1 pins */
#define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */
#define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */
-#define E1000_CTRL_SWDPIO0 0x00400000 /* SWDPIN 0 Input or output */
+#define E1000_CTRL_SDP0_DIR 0x00400000 /* SDP0 Data direction */
+#define E1000_CTRL_SDP1_DIR 0x00800000 /* SDP1 Data direction */
#define E1000_CTRL_RST 0x04000000 /* Global reset */
#define E1000_CTRL_RFCE 0x08000000 /* Receive Flow Control enable */
#define E1000_CTRL_TFCE 0x10000000 /* Transmit flow control enable */
@@ -528,8 +533,67 @@
#define E1000_TIMINCA_16NS_SHIFT 24
-#define E1000_TSICR_TXTS 0x00000002
-#define E1000_TSIM_TXTS 0x00000002
+/* Time Sync Interrupt Cause/Mask Register Bits */
+
+#define TSINTR_SYS_WRAP (1 << 0) /* SYSTIM Wrap around. */
+#define TSINTR_TXTS (1 << 1) /* Transmit Timestamp. */
+#define TSINTR_RXTS (1 << 2) /* Receive Timestamp. */
+#define TSINTR_TT0 (1 << 3) /* Target Time 0 Trigger. */
+#define TSINTR_TT1 (1 << 4) /* Target Time 1 Trigger. */
+#define TSINTR_AUTT0 (1 << 5) /* Auxiliary Timestamp 0 Taken. */
+#define TSINTR_AUTT1 (1 << 6) /* Auxiliary Timestamp 1 Taken. */
+#define TSINTR_TADJ (1 << 7) /* Time Adjust Done. */
+
+#define TSYNC_INTERRUPTS TSINTR_TXTS
+#define E1000_TSICR_TXTS TSINTR_TXTS
+
+/* TSAUXC Configuration Bits */
+#define TSAUXC_EN_TT0 (1 << 0) /* Enable target time 0. */
+#define TSAUXC_EN_TT1 (1 << 1) /* Enable target time 1. */
+#define TSAUXC_EN_CLK0 (1 << 2) /* Enable Configurable Frequency Clock 0. */
+#define TSAUXC_SAMP_AUT0 (1 << 3) /* Latch SYSTIML/H into AUXSTMPL/0. */
+#define TSAUXC_ST0 (1 << 4) /* Start Clock 0 Toggle on Target Time 0. */
+#define TSAUXC_EN_CLK1 (1 << 5) /* Enable Configurable Frequency Clock 1. */
+#define TSAUXC_SAMP_AUT1 (1 << 6) /* Latch SYSTIML/H into AUXSTMPL/1. */
+#define TSAUXC_ST1 (1 << 7) /* Start Clock 1 Toggle on Target Time 1. */
+#define TSAUXC_EN_TS0 (1 << 8) /* Enable hardware timestamp 0. */
+#define TSAUXC_AUTT0 (1 << 9) /* Auxiliary Timestamp Taken. */
+#define TSAUXC_EN_TS1 (1 << 10) /* Enable hardware timestamp 0. */
+#define TSAUXC_AUTT1 (1 << 11) /* Auxiliary Timestamp Taken. */
+#define TSAUXC_PLSG (1 << 17) /* Generate a pulse. */
+#define TSAUXC_DISABLE (1 << 31) /* Disable SYSTIM Count Operation. */
+
+/* SDP Configuration Bits */
+#define AUX0_SEL_SDP0 (0 << 0) /* Assign SDP0 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP1 (1 << 0) /* Assign SDP1 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP2 (2 << 0) /* Assign SDP2 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP3 (3 << 0) /* Assign SDP3 to auxiliary time stamp 0. */
+#define AUX0_TS_SDP_EN (1 << 2) /* Enable auxiliary time stamp trigger 0. */
+#define AUX1_SEL_SDP0 (0 << 3) /* Assign SDP0 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP1 (1 << 3) /* Assign SDP1 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP2 (2 << 3) /* Assign SDP2 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP3 (3 << 3) /* Assign SDP3 to auxiliary time stamp 1. */
+#define AUX1_TS_SDP_EN (1 << 5) /* Enable auxiliary time stamp trigger 1. */
+#define TS_SDP0_SEL_TT0 (0 << 6) /* Target time 0 is output on SDP0. */
+#define TS_SDP0_SEL_TT1 (1 << 6) /* Target time 1 is output on SDP0. */
+#define TS_SDP0_SEL_FC0 (2 << 6) /* Freq clock 0 is output on SDP0. */
+#define TS_SDP0_SEL_FC1 (3 << 6) /* Freq clock 1 is output on SDP0. */
+#define TS_SDP0_EN (1 << 8) /* SDP0 is assigned to Tsync. */
+#define TS_SDP1_SEL_TT0 (0 << 9) /* Target time 0 is output on SDP1. */
+#define TS_SDP1_SEL_TT1 (1 << 9) /* Target time 1 is output on SDP1. */
+#define TS_SDP1_SEL_FC0 (2 << 9) /* Freq clock 0 is output on SDP1. */
+#define TS_SDP1_SEL_FC1 (3 << 9) /* Freq clock 1 is output on SDP1. */
+#define TS_SDP1_EN (1 << 11) /* SDP1 is assigned to Tsync. */
+#define TS_SDP2_SEL_TT0 (0 << 12) /* Target time 0 is output on SDP2. */
+#define TS_SDP2_SEL_TT1 (1 << 12) /* Target time 1 is output on SDP2. */
+#define TS_SDP2_SEL_FC0 (2 << 12) /* Freq clock 0 is output on SDP2. */
+#define TS_SDP2_SEL_FC1 (3 << 12) /* Freq clock 1 is output on SDP2. */
+#define TS_SDP2_EN (1 << 14) /* SDP2 is assigned to Tsync. */
+#define TS_SDP3_SEL_TT0 (0 << 15) /* Target time 0 is output on SDP3. */
+#define TS_SDP3_SEL_TT1 (1 << 15) /* Target time 1 is output on SDP3. */
+#define TS_SDP3_SEL_FC0 (2 << 15) /* Freq clock 0 is output on SDP3. */
+#define TS_SDP3_SEL_FC1 (3 << 15) /* Freq clock 1 is output on SDP3. */
+#define TS_SDP3_EN (1 << 17) /* SDP3 is assigned to Tsync. */
#define E1000_MDICNFG_EXT_MDIO 0x80000000 /* MDI ext/int destination */
#define E1000_MDICNFG_COM_MDIO 0x40000000 /* MDI shared w/ lan 0 */
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index abdd935..e9c5fdd 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -40,6 +40,7 @@
#define E1000_FCT 0x00030 /* Flow Control Type - RW */
#define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */
#define E1000_VET 0x00038 /* VLAN Ether Type - RW */
+#define E1000_TSSDP 0x0003C /* Time Sync SDP Configuration Register - RW */
#define E1000_ICR 0x000C0 /* Interrupt Cause Read - R/clr */
#define E1000_ITR 0x000C4 /* Interrupt Throttling Rate - RW */
#define E1000_ICS 0x000C8 /* Interrupt Cause Set - WO */
@@ -101,6 +102,14 @@
#define E1000_SYSTIMH 0x0B604 /* System time register High - RO */
#define E1000_TIMINCA 0x0B608 /* Increment attributes register - RW */
#define E1000_TSAUXC 0x0B640 /* Timesync Auxiliary Control register */
+#define E1000_TRGTTIML0 0x0B644 /* Target Time Register 0 Low - RW */
+#define E1000_TRGTTIMH0 0x0B648 /* Target Time Register 0 High - RW */
+#define E1000_TRGTTIML1 0x0B64C /* Target Time Register 1 Low - RW */
+#define E1000_TRGTTIMH1 0x0B650 /* Target Time Register 1 High - RW */
+#define E1000_AUXSTMPL0 0x0B65C /* Auxiliary Time Stamp 0 Register Low - RO */
+#define E1000_AUXSTMPH0 0x0B660 /* Auxiliary Time Stamp 0 Register High - RO */
+#define E1000_AUXSTMPL1 0x0B664 /* Auxiliary Time Stamp 1 Register Low - RO */
+#define E1000_AUXSTMPH1 0x0B668 /* Auxiliary Time Stamp 1 Register High - RO */
#define E1000_SYSTIMR 0x0B6F8 /* System time register Residue */
#define E1000_TSICR 0x0B66C /* Interrupt Cause Register */
#define E1000_TSIM 0x0B674 /* Interrupt Mask Register */
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 9c9c141..a894551a 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -799,7 +799,7 @@ void igb_ptp_init(struct igb_adapter *adapter)
/* Initialize the time sync interrupts for devices that support it. */
if (hw->mac.type >= e1000_82580) {
- wr32(E1000_TSIM, E1000_TSIM_TXTS);
+ wr32(E1000_TSIM, TSYNC_INTERRUPTS);
wr32(E1000_IMS, E1000_IMS_TS);
}
@@ -877,7 +877,7 @@ void igb_ptp_reset(struct igb_adapter *adapter)
case e1000_i211:
/* Enable the timer functions and interrupts. */
wr32(E1000_TSAUXC, 0x0);
- wr32(E1000_TSIM, E1000_TSIM_TXTS);
+ wr32(E1000_TSIM, TSYNC_INTERRUPTS);
wr32(E1000_IMS, E1000_IMS_TS);
break;
default:
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 13/15] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (11 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 12/15] igb: Add register defines needed for time sync functions Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 14/15] ixgbevf: Indicate removal state explicitly Jeff Kirsher
` (2 subsequent siblings)
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Jacob Keller, netdev, gospo, sassmann, Jeff Kirsher
From: Jacob Keller <jacob.e.keller@intel.com>
Inline with the current use for ixgbe_read_pci_cfg_word, create a
similar function for writing PCI config, which checks whether the
adapter has been removed first, if Live Error Recovery has been enabled.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 6 +-----
drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 1 +
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 +++++++++
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index f8ebe58..7fe2254 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -58,7 +58,6 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
**/
static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
{
- struct ixgbe_adapter *adapter = hw->back;
u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR);
u16 pcie_devctl2;
@@ -84,11 +83,8 @@ static void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
* 16ms to 55ms
*/
pcie_devctl2 = ixgbe_read_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2);
- if (ixgbe_removed(hw->hw_addr))
- return;
pcie_devctl2 |= IXGBE_PCI_DEVICE_CONTROL2_16ms;
- pci_write_config_word(adapter->pdev,
- IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
+ ixgbe_write_pci_cfg_word(hw, IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
out:
/* disable completion timeout resend */
gcr &= ~IXGBE_GCR_CMPL_TMOUT_RESEND;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
index d1d67ba..afa1cda 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
@@ -133,6 +133,7 @@ s32 ixgbe_init_thermal_sensor_thresh_generic(struct ixgbe_hw *hw);
#define IXGBE_FAILED_READ_CFG_WORD 0xffffU
u16 ixgbe_read_pci_cfg_word(struct ixgbe_hw *hw, u32 reg);
+void ixgbe_write_pci_cfg_word(struct ixgbe_hw *hw, u32 reg, u16 value);
static inline bool ixgbe_removed(void __iomem *addr)
{
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 18cd8ca..c773d6c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -361,6 +361,15 @@ static u32 ixgbe_read_pci_cfg_dword(struct ixgbe_hw *hw, u32 reg)
}
#endif /* CONFIG_PCI_IOV */
+void ixgbe_write_pci_cfg_word(struct ixgbe_hw *hw, u32 reg, u16 value)
+{
+ struct ixgbe_adapter *adapter = hw->back;
+
+ if (ixgbe_removed(hw->hw_addr))
+ return;
+ pci_write_config_word(adapter->pdev, reg, value);
+}
+
static void ixgbe_service_event_complete(struct ixgbe_adapter *adapter)
{
BUG_ON(!test_bit(__IXGBE_SERVICE_SCHED, &adapter->state));
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 14/15] ixgbevf: Indicate removal state explicitly
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (12 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 13/15] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 15/15] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
2014-03-19 8:17 ` [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Mark Rustad, netdev, gospo, sassmann, Jeff Kirsher
From: Mark Rustad <mark.d.rustad@intel.com>
Add a bit, __IXGBEVF_REMOVING, to indicate that the module is being
removed. The __IXGBEVF_DOWN bit had been overloaded for this purpose,
but that leads to trouble. A few places now check both __IXGBEVF_DOWN
and __IXGBEVF_REMOVING.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 +++--
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index 5482932..08fb88a 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -1,7 +1,7 @@
/*******************************************************************************
Intel 82599 Virtual Function driver
- Copyright(c) 1999 - 2012 Intel Corporation.
+ Copyright(c) 1999 - 2014 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,
@@ -412,7 +412,8 @@ struct ixgbevf_adapter {
enum ixbgevf_state_t {
__IXGBEVF_TESTING,
__IXGBEVF_RESETTING,
- __IXGBEVF_DOWN
+ __IXGBEVF_DOWN,
+ __IXGBEVF_REMOVING,
};
struct ixgbevf_cb {
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 8581079..940d924 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1,7 +1,7 @@
/*******************************************************************************
Intel 82599 Virtual Function driver
- Copyright(c) 1999 - 2012 Intel Corporation.
+ Copyright(c) 1999 - 2014 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,
@@ -608,7 +608,8 @@ static int ixgbevf_poll(struct napi_struct *napi, int budget)
napi_complete(napi);
if (adapter->rx_itr_setting & 1)
ixgbevf_set_itr(q_vector);
- if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+ if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+ !test_bit(__IXGBEVF_REMOVING, &adapter->state))
ixgbevf_irq_enable_queues(adapter,
1 << q_vector->v_idx);
@@ -833,7 +834,8 @@ static irqreturn_t ixgbevf_msix_other(int irq, void *data)
hw->mac.get_link_status = 1;
- if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+ if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+ !test_bit(__IXGBEVF_REMOVING, &adapter->state))
mod_timer(&adapter->watchdog_timer, jiffies);
IXGBE_WRITE_REG(hw, IXGBE_VTEIMS, adapter->eims_other);
@@ -2329,6 +2331,7 @@ static void ixgbevf_reset_task(struct work_struct *work)
/* If we're already down or resetting, just bail */
if (test_bit(__IXGBEVF_DOWN, &adapter->state) ||
+ test_bit(__IXGBEVF_REMOVING, &adapter->state) ||
test_bit(__IXGBEVF_RESETTING, &adapter->state))
return;
@@ -2413,7 +2416,8 @@ static void ixgbevf_watchdog_task(struct work_struct *work)
pf_has_reset:
/* Reset the timer */
- if (!test_bit(__IXGBEVF_DOWN, &adapter->state))
+ if (!test_bit(__IXGBEVF_DOWN, &adapter->state) &&
+ !test_bit(__IXGBEVF_REMOVING, &adapter->state))
mod_timer(&adapter->watchdog_timer,
round_jiffies(jiffies + (2 * HZ)));
@@ -3563,7 +3567,7 @@ static void ixgbevf_remove(struct pci_dev *pdev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
- set_bit(__IXGBEVF_DOWN, &adapter->state);
+ set_bit(__IXGBEVF_REMOVING, &adapter->state);
del_timer_sync(&adapter->watchdog_timer);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [net-next v2 15/15] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (13 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 14/15] ixgbevf: Indicate removal state explicitly Jeff Kirsher
@ 2014-03-19 3:42 ` Jeff Kirsher
2014-03-19 8:17 ` [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 3:42 UTC (permalink / raw)
To: davem; +Cc: Mark Rustad, netdev, gospo, sassmann, Jeff Kirsher
From: Mark Rustad <mark.d.rustad@intel.com>
The ixgbevf_down function can now prevent multiple executions by
doing test_and_set_bit on __IXGBEVF_DOWN. This did not work before
introduction of the __IXGBEVF_REMOVING bit, because of overloading
of __IXGBEVF_DOWN. Also add smp_mb__before_clear_bit call before
clearing the __IXGBEVF_DOWN bit.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 940d924..a2cba53 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1620,6 +1620,7 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter)
spin_unlock_bh(&adapter->mbx_lock);
+ smp_mb__before_clear_bit();
clear_bit(__IXGBEVF_DOWN, &adapter->state);
ixgbevf_napi_enable_all(adapter);
@@ -1744,7 +1745,8 @@ void ixgbevf_down(struct ixgbevf_adapter *adapter)
int i;
/* signal that we are down to the interrupt handler */
- set_bit(__IXGBEVF_DOWN, &adapter->state);
+ if (test_and_set_bit(__IXGBEVF_DOWN, &adapter->state))
+ return; /* do nothing if already down */
/* disable all enabled rx queues */
for (i = 0; i < adapter->num_rx_queues; i++)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
` (14 preceding siblings ...)
2014-03-19 3:42 ` [net-next v2 15/15] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
@ 2014-03-19 8:17 ` Jeff Kirsher
15 siblings, 0 replies; 26+ messages in thread
From: Jeff Kirsher @ 2014-03-19 8:17 UTC (permalink / raw)
To: davem; +Cc: netdev, gospo, sassmann
[-- Attachment #1: Type: text/plain, Size: 4838 bytes --]
On Tue, 2014-03-18 at 20:41 -0700, Jeff Kirsher wrote:
> This series contains updates to i40e, i40evf, e1000e, ixgbe and ixgbevf.
>
> Mitch adds support for the VF link state ndo which allows the PF driver
> to control the virtual link state of the VF devices. Added
> support for viewing and modifying RSS hash options and RSS hash look-up
> table programming through ethtool for i40evf. Fixed complaint about
> the use of min() where min_t() should be used in i40evf.
>
> Anjali adds support for ethtool -k option for NTUPLE control for i40e.
>
> Elizabeth cleans up and refactors i40e_open() to separate out the VSI
> code into its own i40e_vsi_open().
>
> Jesse enables the hardware feature head write back to avoid updating the
> descriptor ring by marking each descriptor with a DD bit and instead
> writes a memory location with an update to where the driver should clean
> up to in i40e and i40evf. Reduces context descriptors for i40e/i40evf
> since we do not need context descriptors for every packet, only for
> TSO or timesync.
>
> Dan Carpenter fixes a potential array underflow in i40e_vc_process_vf_msg().
>
> Dave fixes an e1000e hardware unit hang where the check for pending Tx work
> when link is lost was mistakenly moved to be done only when link is first
> detected to be lost. Fixed a problem with poor network performance on
> certain silicon in e1000e when configured for 100M HDX performance.
>
> Carolyn adds register defines needed for time sync functions and the code
> to call the updated defines.
>
> Jacob adds the ixgbe function for writing PCI config word and checks
> whether the adapter has been removed first.
>
> Mark adds the bit __IXGBEVF_REMOVING to indicate that the module is being
> removed because the __IXGBEVF_DOWN bit had been overloaded for this
> purpose, but leads to trouble. ixgbevf_down function can now prevent
> multiple executions by doing test_and_set_bit on __IXGBEVF_DOWN.
>
> v2:
> - dropped patch Mitch's patch "i40evf: correctly program RSS HLUT table"
> based on feedback from Ben Hutchings so that Mitch can re-work the
> patch solution
Or noticed I referenced the wrong patch name. v2 dropped the previous
patch 3 in the series which was "i40evf: Support RSS option in ethtool"
patch from Mitch.
>
> The following are changes since commit 8cfad496c4257441710735ccef622f3829870164:
> ieee802154: properly unshare skbs in ieee802154 *_rcv functions
> and are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next master
>
> Anjali Singhai Jain (1):
> i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control
>
> Carolyn Wyborny (1):
> igb: Add register defines needed for time sync functions
>
> Catherine Sullivan (1):
> i40e/i40evf: Bump build versions
>
> Dan Carpenter (1):
> i40e: potential array underflow in i40e_vc_process_vf_msg()
>
> David Ertman (2):
> e1000e: Fix Hardware Unit Hang
> e1000e: Fix Explicitly set Transmit Control Register
>
> Elizabeth Kappler (1):
> i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open()
>
> Jacob Keller (1):
> ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check
>
> Jesse Brandeburg (2):
> i40e/i40evf: enable hardware feature head write back
> i40e/i40evf: reduce context descriptors
>
> Mark Rustad (2):
> ixgbevf: Indicate removal state explicitly
> ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit
>
> Mitch Williams (3):
> i40e: support VF link state ndo
> i40evf: correctly program RSS HLUT table
> i40evf: use min_t
>
> drivers/net/ethernet/intel/e1000e/netdev.c | 42 +++++++---
> drivers/net/ethernet/intel/i40e/i40e.h | 4 +-
> drivers/net/ethernet/intel/i40e/i40e_main.c | 89 ++++++++++++++++++---
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 48 ++++++++++--
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 91 ++++++++++++++++++++--
> drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 4 +
> drivers/net/ethernet/intel/i40evf/i40e_txrx.c | 48 ++++++++++--
> drivers/net/ethernet/intel/i40evf/i40evf_main.c | 23 +++---
> drivers/net/ethernet/intel/igb/e1000_defines.h | 70 ++++++++++++++++-
> drivers/net/ethernet/intel/igb/e1000_regs.h | 9 +++
> drivers/net/ethernet/intel/igb/igb_ptp.c | 4 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c | 6 +-
> drivers/net/ethernet/intel/ixgbe/ixgbe_common.h | 1 +
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 +++
> drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 5 +-
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 18 +++--
> 16 files changed, 400 insertions(+), 71 deletions(-)
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 01/15] i40e: support VF link state ndo
2014-03-19 3:41 ` [net-next v2 01/15] i40e: support VF link state ndo Jeff Kirsher
@ 2014-03-19 18:06 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2014-03-19 18:06 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: mitch.a.williams, netdev, gospo, sassmann, catherine.sullivan
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 18 Mar 2014 20:41:59 -0700
> + vf = &(pf->vf[vf_id]);
These parenthesis are unnecessary, and in fact confusing. Someone reading
this is going to look again and again trying to figure out why they are
needed.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 02/15] i40evf: correctly program RSS HLUT table
2014-03-19 3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
@ 2014-03-19 18:07 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2014-03-19 18:07 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: mitch.a.williams, netdev, gospo, sassmann, catherine.sullivan
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 18 Mar 2014 20:42:00 -0700
> +#define NEXT_QUEUE(_j) (++_j >= adapter->vsi_res->num_queue_pairs ? _j = 0 : _j)
I would strong recommend breaking the increment out of the test
and using a function rather than a macro:
static int next_queue(struct i40evf_adapter *adapter, int j)
{
j += 1;
return j >= adapter->vsi_res->num_queue_pairs ? 0 : j;
}
..
j = next_queue(adapter, j);
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back
2014-03-19 3:42 ` [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
@ 2014-03-19 18:09 ` David Miller
0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2014-03-19 18:09 UTC (permalink / raw)
To: jeffrey.t.kirsher
Cc: jesse.brandeburg, netdev, gospo, sassmann, mitch.a.williams,
catherine.sullivan
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 18 Mar 2014 20:42:04 -0700
> +static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
> +{
> + void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
> + return le32_to_cpu(*(volatile __le32 *)head);
Please put an empty line between local variable declarations and code.
> +static inline u32 i40e_get_head(struct i40e_ring *tx_ring)
> +{
> + void *head = (struct i40e_tx_desc *)tx_ring->desc + tx_ring->count;
> + return le32_to_cpu(*(volatile __le32 *)head);
Likewise.
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2014-03-19 18:09 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19 3:41 [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-19 3:41 ` [net-next v2 01/15] i40e: support VF link state ndo Jeff Kirsher
2014-03-19 18:06 ` David Miller
2014-03-19 3:42 ` [net-next v2 02/15] i40evf: correctly program RSS HLUT table Jeff Kirsher
2014-03-19 18:07 ` David Miller
2014-03-19 3:42 ` [net-next v2 03/15] i40evf: use min_t Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 04/15] i40e: Patch to enable Ethtool/netdev feature flag for NTUPLE control Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 05/15] i40e: Refactor and cleanup i40e_open(), adding i40e_vsi_open() Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 06/15] i40e/i40evf: enable hardware feature head write back Jeff Kirsher
2014-03-19 18:09 ` David Miller
2014-03-19 3:42 ` [net-next v2 07/15] i40e/i40evf: reduce context descriptors Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 08/15] i40e: potential array underflow in i40e_vc_process_vf_msg() Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 09/15] i40e/i40evf: Bump build versions Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 10/15] e1000e: Fix Hardware Unit Hang Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 11/15] e1000e: Fix Explicitly set Transmit Control Register Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 12/15] igb: Add register defines needed for time sync functions Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 13/15] ixgbe: add ixgbe_write_pci_cfg_word with ixgbe_removed check Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 14/15] ixgbevf: Indicate removal state explicitly Jeff Kirsher
2014-03-19 3:42 ` [net-next v2 15/15] ixgbevf: Protect ixgbevf_down with __IXGBEVF_DOWN bit Jeff Kirsher
2014-03-19 8:17 ` [net-next v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
-- strict thread matches above, loose matches on Subject: below --
2014-01-08 6:07 Jeff Kirsher
2014-01-08 6:50 ` David Miller
2013-08-22 9:49 Jeff Kirsher
2013-08-22 20:01 ` David Miller
2013-07-31 9:59 Jeff Kirsher
2013-07-31 20:38 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).