Greg Rose [Fri, 6 Feb 2015 08:52:19 +0000 (08:52 +0000)]
i40e: Use ethtool private flags to display NPAR status
Allow an application to query the i40e driver's private flags to get the
status of NPAR enablement. This will be used by applications to determine
if there are NPAR specific features available.
Change-ID: Ia6d9477a48f9c4cb41ca022bd433f77da3f2146c Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Kevin Scott [Fri, 6 Feb 2015 08:52:18 +0000 (08:52 +0000)]
i40e: Set FLAG_RD when sending buffer FW must read
Set FLAG_RD for send_driver_version AQ command.
Change-ID: I8253051eff85a1d4b5a4e12ce0395b65ceb91e62 Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Fri, 6 Feb 2015 08:52:17 +0000 (08:52 +0000)]
i40e: print Rx packet split status
Add the RX routine in use to the features log message.
Change-ID: Ifbbf28fb7f42b9a3d2828586488e9e6331107dd5 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Vasu Dev [Mon, 9 Feb 2015 18:00:30 +0000 (18:00 +0000)]
i40e: setup FCoE device type
Setup FCoE netdev device type as "fcoe", so that it shows up in
sysfs as FCoE device.
Change-ID: Ie13a1a332dba4d5802586926104ee01ef20da44f Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Kevin Scott [Fri, 6 Feb 2015 08:52:15 +0000 (08:52 +0000)]
i40e: Set BUF flag for Set Version AQ command
BUF flag must be set for indirect AQ command.
Change-ID: I6819718a47baf69d1a91ebaed89f735ed6e86025 Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Acked-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Neerav Parikh [Fri, 6 Feb 2015 08:52:14 +0000 (08:52 +0000)]
i40e: Add support for getlink, setlink ndo ops
Add support for bridge offload ndo_ops getlink and setlink to
enable bridge hardware mode as per the mode set via IFLA_BRIDGE_MODE.
The support is only enabled in case of a PF VSI and not available for
any other VSI type.
By default the i40e driver inserts a bridge as part of the bring-up
when a FDIR type VSI and/or a FCoE VSI is created. This bridge is
created in VEB mode by default i.e. after creating the bridge using
"Add VEB" AQ command the loopback for the PF's default VSI is enabled.
The patch adds capability where all the VSIs created as downlink to
the bridge inherits the loopback property and enables loopback only
if the uplink bridge is operating in VEB mode.
Hence, there is no need to explicitly enable loopback as part of
allocating resources for SR-IOV VFs and call to do that has been
removed.
In case a user-request is made either via "bridge" utility or using
the bridge netlink interface that requires to change the hardware
bridge mode then that would require a PF reset and rebuild of the
switch hierarchy.
Also update the copyright year.
Change-ID: I4d78fc1c83158efda29ba7be92239b74f75d6d25 Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-By: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Greg Rose [Fri, 6 Feb 2015 08:52:13 +0000 (08:52 +0000)]
i40e: Implement configfs for NPAR BW configuration
Add configfs controls to get, set and commit NPAR BW configurations.
We export three controls:
min_bw - Can take a value from 0 to 100 inclusive
max_bw - Can take a value from 1 to 100 inclusive
commit - A write-only control that accepts only a value of 1 and will
cause the BW settings to be permanently committed to NVM so
that they are persistent across power cycles and system
resets
The BW values are relative and are expressed as percentages. For more
information on the interpretation of the BW settings see the Dell
specifications for NPAR.
Also update the copyright year.
Change-ID: Id7496ca65630b5037e32ba6a5a748fbc1632881b Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-By: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Greg Rose [Fri, 6 Feb 2015 08:52:12 +0000 (08:52 +0000)]
i40e: Add NPAR BW get and set functions
We need to be able to get, set and commit permanently the NPAR
partition BW configuration through configfs. These are necessary
precursor functions for that feature.
Also update the copyright year.
Change-ID: I9d5ca160a9288145f1dd2042994028679fff55f3 Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Fri, 6 Feb 2015 08:52:11 +0000 (08:52 +0000)]
i40e: enable packet split only when IOMMU present
When an IOMMU is in use, the packet split receive path shows a distinct
advantage over the single-buffer path because it minimizes DMA mapping
and unmapping. However, this is not an advantage for systems with no
IOMMU. At init time, check to see if an IOMMU is enabled and enable
packet split receives.
Change-ID: I4f70d2e9c31bbea3dc8fd0c5734959a6e6602210 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Ashish Shah [Fri, 6 Feb 2015 08:52:10 +0000 (08:52 +0000)]
i40evf: allow enabling of debug prints via ethtool
Copy setting from ethtool to the HW specific struct to actually
enable prints. Change print from i40e to i40evf to differentiate
drivers in bare metal scenarios.
Also update the copyright year.
Change-ID: I06fee26247299a08f2e1c70fc811a9ea0931c4dd Signed-off-by: Ashish Shah <ashish.n.shah@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Carolyn Wyborny [Fri, 6 Feb 2015 08:52:09 +0000 (08:52 +0000)]
i40e: Add method to keep track of current rxnfc settings
This patch adds a struct to the VSI struct to keep track of rxnfc
settings done via ethtool. Without this patch, the device can only
list the options available, not the current settings and this is not
clear to the user. Without current settings, the available settings
never changing looks like a bug.
Also update the copyright year.
Change-ID: I087bbfdb33b330496a671630a7586773e3b3e589 Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: Use advertised speed settings in ethtool and refactor get_settings
Add a requested speed variable to the link_status struct to store the
last speeds we requested from the firmware (the speeds the FW will be
advertising with if autoneg is enabled).
Use the advertised speed settings in get_settings in ethtool now that
we have it. Also set the requested speed settings in set_settings in
ethtool as they are requested and initialize them in probe based on what
the firmware remembers as the last requested speeds.
To accommodate some longer lines in this new code, and improve
readability I have added two functions i40e_get_settings_link_up
and i40e_get_settings_link_down which get_settings now calls first.
It then does all of the settings that happen regardless of link
state. Some PHY types that supported the same settings were also combined.
Also update the copyright year.
Change-ID: Ica0c5ac81b6069ea6a7406fce7482f7816d4455c Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: Fix output of i40e_debug_aq() for big endian machines
The function i40e_debug_aq() prints information helpful in debugging
admin queue commands, but it doesn't do so correctly on big endian machines.
This patch adds the appropriate LExx_TO_CPU wrappers for big endian
architectures.
Also update the copyright year.
Change-ID: I4b2dc229ed5bf6dfe35632a58cddf53c21aff4b0 Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tino Reichardt [Tue, 24 Feb 2015 18:28:01 +0000 (10:28 -0800)]
net: via-rhine: add BQL support
Add Byte Queue Limits (BQL) support to via-rhine driver.
[edumazet] tweaked patch and changed TX_RING_SIZE from 16 to 64
Signed-off-by: Tino Reichardt <milky-kernel@mcmilk.de> Tested-by: Jamie Gloudon <jamie.gloudon@gmail.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 24 Feb 2015 21:05:54 +0000 (16:05 -0500)]
Merge branch 'bonding-next'
Mahesh Bandewar says:
====================
(Shortened) Bonding patch series
I'm shortening the earlier patch series to just two patches at this moment.
Andy is going to integrate remaining 3 patches with his netlink changes
and post the completed patches.
These two patches are the same one from the previous patch series with
some styling changes (Dave Miller's suggestions) for the churn-machine patch.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Mahesh Bandewar [Tue, 24 Feb 2015 01:50:11 +0000 (17:50 -0800)]
bonding: Implement port churn-machine (AD standard 43.4.17).
The Churn Detection machines detect the situation where a port is operable,
but the Actor and Partner have not attached the link to an Aggregator and
brought the link into operation within a bound time period. Under normal
operation of the LACP, agreement between Actor and Partner should be reached
very rapidly. Continued failure to reach agreement can be symptomatic of
device failure.
Actor-churn-detection state-machine Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com>
===================================
Mahesh Bandewar [Tue, 24 Feb 2015 01:50:10 +0000 (17:50 -0800)]
bonding: Verify RX LACPDU has proper dest mac-addr
The 802.1AX standard states:
"The DA in LACPDUs is the Slow_Protocols_Multicast address."
This patch enforces that and drops LACPDUs with destination MAC
addresses other than Slow_Protocols_Multicast address
Signed-off-by: Mahesh Bandewar <maheshb@google.com> Reviewed-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 24 Feb 2015 16:48:48 +0000 (11:48 -0500)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates 2015-02-23
This series contains updates to e1000e, igbvf, i40e and i40evf.
David adds support for i219 devices to the e1000e driver.
Jeff (me) provides two patches to cleanup igbvf, first cleans up the
whitespace issues found and the second cleans up the usage of msleep(),
min() and max() with usleep_range(), min_t() and max_t() respectively.
Kamil updates the shadow RAM read/write functions by refactoring them
to prepare for future work.
Shannon renames the debugfs command "clear_stats pf" to clear_stats port"
to clarify what the function really does.
Mitch refactors the receive routine, by splitting the receive hot path
code into two, one for packet split and one for single buffer, which
improves receive performance. Disables NAPI polling sooner when closing
the interface to fix an occasional panic during close which was
caused by the driver trying to delete and clean rings at the same time.
Also refactors reset for i40evf, since a recent change to the shutdown
flow messed up the reset flow. Since i40evf_down() now holds the
critical section lock, we cannot call it from the reset handler, which
also holds the lock.
Nicholas restricts the virtual channel opcodes should remain consistent
between updates to the opcode enum.
Neerav converts the VSI connection type to use a #define instead of
using a magic number.
Anjali updates the registers file to remove registers no longer available.
Also fixes the EMPR interrupt handling, so that we won't trigger another
EMPR when we receive an EMPR event.
Catherine cleans up the variable an_enable since it was set and never
used.
Greg fixes the netdev op that allows the operator to turn MAC/VLAN
spoof checking on and off so that it includes the flag for VLAN spoof
checking.
v2: Updated patch #10 in the series to use test_and_clear_bit() as
suggested by Sergei Shtylyov
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Mon, 23 Feb 2015 19:00:46 +0000 (11:00 -0800)]
net: bcmgenet: rename bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT
bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT are used only in Tx init.
Rename them accordingly:
- bcmgenet_hw_params->bds_cnt => bcmgenet_hw_params->tx_bds_per_q
- GENET_DEFAULT_BD_CNT => GENET_Q16_TX_BD_CNT
Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Mon, 23 Feb 2015 19:00:45 +0000 (11:00 -0800)]
net: bcmgenet: precalculate TxCB->bd_addr
There is 1-to-1 mapping between TxCBs and TxBDs. Precalculate TxCB->bd_addr
once in bcmgenet_init_dma() instead of doing it over and over needlessly in
bcmgenet_get_txcb().
Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Mon, 23 Feb 2015 19:00:45 +0000 (11:00 -0800)]
net: bcmgenet: bcmgenet_init_tx_ring() cleanup
1. Simplify function description
2. Rename function parameter write_ptr to start_ptr to better indicate use
3. Remove unnecessary local variable first_bd
4. Remove out-of-place comment "Unclassified traffic goes to ring 16"
5. Fix TDMA_WRITE_PTR register init
Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Tue, 24 Feb 2015 02:32:59 +0000 (02:32 +0000)]
samples/pktgen: Use bash as interpreter
These scripts use the non-POSIX 'function' and 'local' keywords so
they won't work with every /bin/sh. We could drop 'function' as it is
a no-op, but 'local' makes for cleaner scripts. Require use of bash.
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Tue, 24 Feb 2015 02:32:37 +0000 (02:32 +0000)]
samples/pktgen: Correct comments about the thread config
They all claimed to be two CPU examples using eth1, eth2 but
that is only true in one case!
Rob Jones pointed out spelling and grammar errors here, which I've
also corrected.
Cc: Rob Jones <rob.jones@codethink.co.uk> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Tue, 24 Feb 2015 02:32:07 +0000 (02:32 +0000)]
samples/pktgen: Add sample scripts for pktgen facility
These are Robert Olsson's samples which used to be available from
<ftp://robur.slu.se/pub/Linux/net-development/pktgen-testing/examples/>
but currently are not.
Change the documentation to refer to these consistently as 'sample
scripts', matching the directory name used here.
Cc: Robert Olsson <robert@herjulf.se> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Tue, 24 Feb 2015 02:31:52 +0000 (02:31 +0000)]
pktgen: Fix grammar errors and some poor wording in documentation
Thanks to Rob Jones for suggesting some of the changes.
Cc: Rob Jones <rob.jones@codethink.co.uk> Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Mitch Williams [Thu, 29 Jan 2015 07:17:20 +0000 (07:17 +0000)]
i40evf: don't wait forever
Under rare circumstances, after a reset, set_rx_mode might get called
while the watchdog is running, which will cause a deadlock on the
critical section lock. To correct this, add a counter and give up trying
to get the lock after fifty tries. Log a message if this happens but
don't take any other action. Because this happens after a reset, all of
the Rx filters are still in place and the device won't lose
connectivity.
We can also get stuck during shutdown, if the PF has stopped communicating
with us, or if a reset is occurring. If we can't get the lock after a reasonable
amount of time, just error out. Something else bad is happening anyway, so
adding this filter is the least of our concern right now.
Change-ID: I159731e2a82a06b389ee31b34ce336548e05baa0 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 29 Jan 2015 07:17:19 +0000 (07:17 +0000)]
i40evf: refactor reset
A recent change to the shutdown flow messed up the reset flow. Since
i40evf_down now holds the critical section lock, we cannot call it from
the reset handler, which also holds the lock. To do so causes a deadlock
accompanied by wailing and gnashing of teeth. This is easily triggered
by running an ethtool self-test on the PF device.
Instead, we move the relevant portions of i40evf_down into the reset
handler and bend them to our will. Additionally, we can optimize the
reinit path by not deleting the MAC and VLAN filters and then adding
them back again. Instead, we just set the 'add' flag and let the
watchdog resynchronize the filter list with the PF driver. We also
reword a few messages to make them more consistent with the rest of the
driver.
Change-ID: I03dd92ae736f7719fca3564b12a2cf9b98c6cb18 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 29 Jan 2015 07:17:18 +0000 (07:17 +0000)]
i40evf: disable NAPI polling sooner
When closing the interface, disable NAPI polling before any other
activities. This fixes an occasional panic during close caused by the
driver trying to delete and clean rings at the same time.
Change-ID: Ib4d427b13d310258ea85b248d535da70ecf0c1e9 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Greg Rose [Thu, 29 Jan 2015 07:17:17 +0000 (07:17 +0000)]
i40e: Fix i40e_ndo_set_vf_spoofchk
The netdev op that allows the operator to turn MAC/VLAN spoof checking on
and off did not include the flag for VLAN spoof checking. This patch
fixes that problem.
Change-ID: Ib4c9e639024a854592d97af22706544881ac3fcb Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Change-ID: I64f47c3367ea8ff2a53068e895d7a1f60726c871 Signed-off-by: Sravanthi Tangeda <sravanthi.tangeda@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e/i40evf: Remove unused variable an_enable and function update_link_info
An_enable was never used only set so lets remove it. The function
update_link_info only did two things, call get_link_info and set
an_enabled. Therefore we should also remove update_link_info and
change all references to it to get_link_info.
Change-ID: Ie3022680fa7a94bfd495a4f5fc76a73701d85569 Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
We shouldn't trigger another EMPR when we receive an EMPR event.
This patch handles EMPR event reception with a different state
so that we can do the right thing for NVM.
Change-ID: I9cac70b3658600f016a65beb6fb157e1c1f9adf9 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Some registers have been removed so take them out and
stop updating and looking at them.
Change-ID: I33da922c8de993a94dd8b8d8a2ae2146b8ca1a27 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Neerav Parikh [Sat, 24 Jan 2015 09:58:38 +0000 (09:58 +0000)]
i40e: Use #define for the VSI connection type
Use #defined VSI connection type values instead of using magic numbers.
Change-ID: I2f6cf7bf394d391e1c0fe61779e9e4ad8858154a Signed-off-by: Neerav Parikh <neerav.parikh@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Nicholas Nunley [Sat, 24 Jan 2015 09:58:37 +0000 (09:58 +0000)]
i40e/i40evf: restrict VC opcodes to their initial values
Until the time a more robust versioning scheme is needed/implemented all
established virtual channel opcode values should remain consistent between
updates to the opcode enum.
This patch repositions I40E_VIRTCHNL_OP_CONFIG_RSS to the end of the enum. In
its current position this opcode displaces the initial value of
I40E_VIRTCHNL_OP_EVENT and will cause PF/VF compatibility issues.
Going forward the expectation is either:
a) All future opcode additions will be added as the last element of the
enum. Once VF drivers start making use of the new commands the virtual
channel version will need to be incremented and drivers will need to
implement a simple version check whereby VF drivers can only load on
PFs with a >= version.
b) or, if needed, design and implement a more complicated API
negotiation capability.
In either case PF drivers should always maintain backwards compatibility with
earlier VF driver versions.
Change-ID: Ie245daa09a231b6680ed793d648bdcc76caefe58 Signed-off-by: Nicholas Nunley <nicholas.d.nunley@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Sat, 24 Jan 2015 09:58:35 +0000 (09:58 +0000)]
i40e/i40evf: Refactor the receive routines
Split the receive hot path code into two, one for packet split and one
for single buffer. This improves receive performance since we only need
to check if the ring is in packet split mode once per NAPI poll time,
not several times per packet. The single buffer code is further improved
by the removal of a bunch of code and several variables that are not
needed. On a receive-oriented test this can improve single-threaded
throughput.
Also refactor the packet split receive path to use a fixed buffer for
headers, like ixgbe does. This vastly reduces the number of DMA mappings
and unmappings we need to do, allowing for much better performance in
the presence of an IOMMU.
Lastly, correct packet split descriptor types now that we are actually
using them.
Change-ID: I3a194a93af3d2c31e77ff17644ac7376da6f3e4b Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Shannon Nelson [Sat, 24 Jan 2015 09:58:34 +0000 (09:58 +0000)]
i40e: rename debugfs clear_stats option
Change debugfs command from "clear_stats pf" to "clear_stats port"
to be clearer what the action is. Also, limit the action to the
base PF, not the NPAR partitions.
Change-ID: I22aa39c0962d83a83a985097b1000ed7f8c66f3f Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Kamil Krawczyk [Sat, 24 Jan 2015 09:58:33 +0000 (09:58 +0000)]
i40e: update Shadow RAM read/write functions
This change is to refactor the read/write functions to support
future work.
Change-ID: I13150d5e3042f2c617362c0140dc7e6473ebcdee Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com> Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <james.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jeff Kirsher [Wed, 21 Jan 2015 09:57:50 +0000 (09:57 +0000)]
igbvf: Fix code comments and whitespace
Fix the code comments to align with the drivers/net/ commenting style.
Also fix other checkpatch errors such as using tabs where possible and
properly wrap lines to conform to the 80 char limit (unless it is
a string).
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
David Ertman [Tue, 10 Feb 2015 09:10:43 +0000 (09:10 +0000)]
e1000e: initial support for i219
i219 is the next-generation LOM that will be available on systems with the
Sunrise Point Platform Controller Hub (PCH) chipset from Intel. This patch
provides the initial support for the device.
Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Tested-by: Carmen Edwards <carmenx.edwards@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David S. Miller [Mon, 23 Feb 2015 20:08:37 +0000 (15:08 -0500)]
Merge branch 'be2net-next'
Sathya Perla says:
====================
be2net: patch set
Hi Dave, the following patch set reduces code duplication
in probe/pci-resume/eeh-resume and remove/pci-suspend/eeh-error and UE-error
detect/recovery paths. New helper routines have been introduced for this
purpose. Pls apply this set to the net-next tree. Thanks!
Patch 1 refactors the alloc/free code of adapter struct's fields into
a new set of helper routines -- be_drv_init/cleanup().
Patch 2 gets rid of the be_get_initial_config() routine as be_get_config()
is the place holder for related code.
Patch 3 introduces a new helper routine be_func_init() to execute the
initialization code used in probe/pci-resume/eeh-resume to remove
code duplication.
Patch 4 introduces a wrapper for scheduling/canceling error detection
task on similar lines to the be_worker task.
Patch 5 refactors UE error detection and recovery code on similar lines
to EEH code. Cleaning up resources is done in the error detection routine
followed by error recovery.
Patch 6 gets rid of the lancer_test_and_set_rdy_state() routine as the
same code now available in be_func_init().
Patch 7 creates a new helper routine be_resume() for all the common code
in be_probe(), be_pci_resume() and be_eeh_resume(), to reduce code duplication.
Patch 8 creates a new helper routine be_cleanup() for all the common
cleanup code duplicated in the suspend/EEH err detection paths.
Patch 9 moves be_func_init() inside be_setup() as everytime be_setup()
is called, the driver will have to wait for the function/FW to be be
initialized.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Every time be_setup() is called, the driver will have to wait for the
function/FW to be properly initialized. So, it make sense to move this call
inside be_setup().
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Mon, 23 Feb 2015 09:20:15 +0000 (04:20 -0500)]
be2net: refactor adapter resource cleanup sequence into be_cleanup()
Most of the resource cleanup sequences performed in be_suspend(),
be_eeh_err_detected() and be_err_detection_task() are same. Moved the
common code to a new routine be_cleanup() to avoid code duplication.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Mon, 23 Feb 2015 09:20:14 +0000 (04:20 -0500)]
be2net: refactor adapter resource initialzation sequence into be_resume()
Most of the adapter initialisation sequences performed in be_resume(),
be_eeh_resume() and be_err_recover() are same. Renamed be_resume() to
be_pci_resume() and moved the common code to a new routine be_resume() to
avoid code duplication.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 23 Feb 2015 09:20:13 +0000 (04:20 -0500)]
be2net: remove code duplication relating to Lancer reset sequence
The steps needed for Lancer's reset/initialization sequence are:
a) wait for SLIPORT_STAUS RDY bit to be set
b) set the SLIPORT_CONTROL IP bit
c) repeat step "a"
The code needed for this sequence is already covered by the be_func_init()
routine (with minor modifications.) So, get rid of the
lancer_test_and_set_rdy_state() and lancer_provisioning_error() routines
that unnecessarily duplicate this code. Also fixed the error recovery
function to take care of these changes
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Mon, 23 Feb 2015 09:20:12 +0000 (04:20 -0500)]
be2net: refactor error detect/recovery function
Currently when an error is detected, the queue resources are being cleaned up
in the recovery routine. The resources are better cleaned up in the error
detection routine itself (similar to EEH code.)
So, this patch re-factors error processing logic to follow the following sequence:
- check if there is an error in adapter
- if error,
- cleanup resources
- attempt recovery
The patch renames lancer_recover_func() to be_err_recover() as this
routine will be used in the future for error recovery on Skyhawk too.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 23 Feb 2015 09:20:11 +0000 (04:20 -0500)]
be2net: use a wrapper to schedule and cancel error detection task
Also rename func_recovery_work/task to err_detection_work/task as error
detection is the primary goal of this task while recovery is not guaranteed.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 23 Feb 2015 09:20:10 +0000 (04:20 -0500)]
be2net: refactor function initalization sequence into be_func_init()
Function initialization sequence is executed in be_probe(), be_resume
and be_eeh_resume(). Move this code to a new routine called be_func_init()
to prevent code duplication.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 23 Feb 2015 09:20:09 +0000 (04:20 -0500)]
be2net: get rid of be_get_initial_config() call from be_probe()
Most of the code to fetch the adapter state is in be_setup()->be_get_config().
So, move the code from be_get_initial_config() to be_get_config().
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 23 Feb 2015 09:20:08 +0000 (04:20 -0500)]
be2net: move adapter fields alloc/free code to new routines
The members of be_adapter struct were being allocated in two separate
routines -- be_ctrl_init() and be_stats_init(). Also, some other members
were allocated elsewhere. This patch moves the alloc/free code into
be_drv_init/cleanup() routines. The be_pci_map_bars() routine that was
called from be_ctrl_init() is now called directly from be_probe().
The new routine be_drv_init() will now be the place-holder for allocating
memory for any new be_adapter{} members in the future.
Some routines needed to be moved to provide forward definitions for their
calls.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Sun, 22 Feb 2015 04:21:51 +0000 (20:21 -0800)]
bridge: add vlan info to bridge setlink and dellink notification messages
vlan add/deletes are not notified to userspace today. This patch adds
vlan info to bridge newlink/dellink notifications generated from the
bridge driver. Notifications use the RTEXT_FILTER_BRVLAN_COMPRESSED
flag to compress vlans into ranges whereever applicable.
The size calculations does not take ranges into account for
simplicity. This has the potential for allocating a larger skb than
required.
There is an existing inconsistency with bridge NEWLINK and DELLINK
change notifications. Both generate NEWLINK notifications. Since its
always a NEWLINK notification, this patch includes all vlans the port
belongs to in the notification. The NEWLINK and DELLINK request
messages however only include the vlans to be added and deleted.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Sun, 22 Feb 2015 21:47:56 +0000 (13:47 -0800)]
batman-adv: Fix use of seq_has_overflowed()
net-next commit 6d91147d183c ("batman-adv: Remove uses of return value
of seq_printf") incorrectly changed the overflow occurred return from
-1 to 1. Change it back so that the test of batadv_write_buffer_text's
return value in batadv_gw_client_seq_print_text works properly.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bojan Prtvar [Sun, 22 Feb 2015 10:46:35 +0000 (11:46 +0100)]
net: Remove state argument from skb_find_text()
Although it is clear that textsearch state is intentionally passed to
skb_find_text() as uninitialized argument, it was never used by the
callers. Therefore, we can simplify skb_find_text() by making it
local variable.
Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David L Stevens [Thu, 19 Feb 2015 18:15:49 +0000 (13:15 -0500)]
sunvnet: failed trigger should not cause BUG_ON()
An error return from __vnet_tx_trigger() sets the TX descriptor to
VIO_DESC_FREE while leaving port->tx_bufs[txi].skb set. This leads
to a BUG_ON() the next time this descriptor is used.
This patch frees the pending skb when getting a trigger error to
match the VIO_DESC_FREE state.
Signed-off-by: David L Stevens <david.stevens@oracle.com> Acked-by: Sowmini Varadhan <sowmini.varadhan@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Mahesh Bandewar [Thu, 19 Feb 2015 18:13:25 +0000 (10:13 -0800)]
bonding: simple code refactor
Remove duplicate code.
Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: Andy Gospodarek <gospo@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Arun Chandran [Wed, 18 Feb 2015 11:29:35 +0000 (16:59 +0530)]
net: macb: Add big endian CPU support
This patch converts all __raw_readl and __raw_writel function calls
to their corresponding readl_relaxed and writel_relaxed variants.
It also tells the driver to set ahb_endian_swp_mgmt_en bit in dma_cfg
when the CPU is configured in big endian mode.
Signed-off-by: Arun Chandran <achandran@mvista.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 20 Feb 2015 20:46:55 +0000 (15:46 -0500)]
Merge branch 'bnx2x-next'
Rasesh Mody says:
====================
bnx2-cnic: Driver Version Upgrades
This patch set includes bnx2 and cnic drivers' re-branding changes, fix for a
chip initialization issue and updates the bnx2 driver version to 2.2.6 and
cnic driver version to 2.5.21.
Please apply these patches to net-next.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Rasesh Mody [Wed, 18 Feb 2015 00:26:19 +0000 (19:26 -0500)]
bnx2: Fix for Chip Initialization
Do not enable filter SORT MODE in chip init routine. This patch addresses an
issue where BCM5716 sporadically drops packets when changing multicast list.
Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
hso: always read interface number from the current altsetting
Always read bInterfaceNumber from the current altsetting, not from the first one
available in the altsetting array. This is coming from code review, not related
to any specific bug.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 20 Feb 2015 19:07:02 +0000 (14:07 -0500)]
Merge branch 'be2net-next'
Sriharsha Basavapatna says:
====================
be2net patch-set
This patch set contains a few code refactoring changes to make it easy to
support new TX WRB formats in future ASICs. Please consider applying it to
net-next tree.
Patch 1: Refactors chip specific code to setup tx wrb into a separate routine.
Patch 2: Refactors tx enqueue function to remove a bit of duplicate code and
improves wrb setup steps.
Patch 3: Minor refactoring in tx compl to limit CQE accesses to 1 routine.
Patch 4: Adds a few inline functions.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
- Reduce code duplication by moving WRB-frags setup into a function.
- Do not setup WRB-header before frags are setup, which is unncessary if
there's errors while setting up frags. We should only grab an entry for
the header, setup the frags and if everything is fine setup the header.
- The error cleanup can be moved into a small function.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
The WRB header is setup by wrb_fill_hdr() routine. This routine currently
gets some of the WRB params as args and figures out rest of the WRB params
by looking at various fields in skb (like gso, checksum, vlan-tag etc).
All these params could instead be retrieved from the skb into a structure
and passed to this routine. This separates wrb_fill_hdr() to only provide
chip-specific code to fill the WRB. This also makes it simple to support
chips with different WRB formats.
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 19 Feb 2015 20:52:33 +0000 (15:52 -0500)]
Merge branch 'mv88e6171_indirect_phy'
Andrew Lunn says:
====================
Indirect phy access for mv88e6171
These two patches allow the mv88e6171 driver to access the port phys
using indirect addressing. Depending on pin strapping, the switch
either uses a single address on the host MDIO bus, requiring the port
phys are accessed indirectly, or the switch uses a number of addresses
on the host bus and the phys can be directly accessed.
The 370RD, the first supported platform to use the 6171 uses multiple
addresses, so this indirect mode was not required. However the
WRT1900AC has the switch configured to use a single address, and so
indirect access is needed.
The mv88e6352 already has all the needed code. Refactor it into the
shared mv88e6xxx and then use it in the mv88e6171 driver.
Tested on the 370RD and WRT1900AC.
It would be good if Guenter Roeck could test on his platform to ensure
i've not broken anything for the mv88e6352.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn [Sat, 14 Feb 2015 18:17:51 +0000 (19:17 +0100)]
net: dsa: mv88e6171: Enable access to phys via internal mdio bus
When the device is configured to use single chip addressing mode, the
phy devices of the port are not accessible on the host MDIO
bus. Instead the switch internal MDIO bus must be used. For this to
work, the phy polling unit must be enabled.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Andrew Lunn [Sat, 14 Feb 2015 18:17:50 +0000 (19:17 +0100)]
net: dsa: mv88e6352: Refactor shareable code
The mv88e6352 allows access to the port phys via an internal mdio bus
which is accessed using registers in the GLOBAL 2 range. The mv88e6171
and probably other devices use the same mechanism. Move this code into
the shared mv88e6xxx.c library.
Signed-off-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Vince Bridgers [Thu, 12 Feb 2015 16:47:45 +0000 (10:47 -0600)]
net: eth: altera: Change reset_mac failure message masks from err to dbg
This debug output is not really an error message since mac reset can fail
if the phy clocks are gated, specifically when the phy has been placed in
a powered down or isolation mode. The netdev output masks were changed from
err to dbg, and comments added in the code.
Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Vince Bridgers [Thu, 12 Feb 2015 16:47:33 +0000 (10:47 -0600)]
net: eth: altera: Change access ports to mdio for all xMII applications
Change use of Altera TSE's MDIO access from phy 0 registers to phy 1
registers. This allows support for GMII, MII, RGMII, and SGMII
designs where the external PHY is always accesible through
Altera TSE's MDIO phy 1 registers and Altera's PCS is accessible
through MDIO phy 0 registers for SGMII applications.
Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com> Tested-by: Kai Lin Ng <kailng@altera.com> Tested-by: Dalon Westergreen <dwesterg@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
u32 mtu = tp->netdev->mtu;
u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 4;
Use *switch* statement to replace the checking of *if*.
v1:
The USB_RX_EARLY_AGG contains timeout and size. Separate them, and
they could be set independently. Then, the ethtool could be used to
change the timeout according to situation of the platform.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>