Commit graph

504517 commits

Author SHA1 Message Date
David S. Miller 9003019192 Merge branch 'rocker-next'
Scott Feldman says:

====================
rocker cleanups

Pushing out some rocker cleanups I've had in my queue for a while.  Nothing
major, just some sync-up with changes that already went into device code
(hard-coding desc err return values and lport renaming).  Also fixup
port fowarding transitions prompted by some DSA discussions about how to
restore port state when port leaves bridge.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-26 11:22:03 -05:00
Scott Feldman e47172ab7e rocker: put port in FORWADING state after leaving bridge
Cleanup the port forwarding state transitions for the cases when the port
joins or leaves a bridge, or is brought admin UP or DOWN.  When port is
bridged, we can rely on bridge driver putting port in correct state using
STP callback into port driver, regardless if bridge is enabled for STP or not.
When port is not bridged, we can reuse some of the STP code to enabled or
disable forwarding depending on UP or DOWN.

Tested by trying all the transitions from bridge/not bridge, and UP/DOWN, and
verifying port is in the correct forwarding state after each transition.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-26 11:21:57 -05:00
Scott Feldman 4a6bb6d359 rocker: rename lport to pport
This is just a rename of physical ports from "lport" to "pport".  Not a
functional change.  OF-DPA uses logical ports (lport) for tunnels, but the
driver (and device) were using "lport" for physical ports.  Renaming physical
ports references to "pport", freeing up "lport" for use later with tunnels.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-26 11:21:57 -05:00
Scott Feldman 7eb344f873 rocker: fix non-portable err return codes
The rocker device returns error codes if something goes wrong with descriptor
processing.  Originally the device used standard errno codes for different
errors, but since those errno codes aren't portable across ARCHs, the device
now returns hard-coded error codes that stay constant across diff ARCHs.  Fix
driver to use those same hard-coded values.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-26 11:21:57 -05:00
David S. Miller 009f33ed6f 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-24

This series contains updates to i40e and i40evf only, which bumps their
versions to i40e 1.2.9 and i40evf 1.2.3.

Paul fixes i40e_debug_aq() for big endian machines by adding the
appropriate LExx_TO_CPU wrappers.

Catherine adds a requested speed variable to the link_status to store the
last speeds we requested from the firmware and use the advertised speed
settings in get_settings in ethtool now that we have it.  Due to the
new code addition, she also refactors get_settings to improve readability
and to accommodate some of the longer lines of code by adding two
functions i40e_get_settings_link_up() and i40e_get_settings_link_down().

Carolyn adds a struct to the VSI struct to keep track of RXNFC settings
done via ethtool.  Adds more information to the interrupt vector
names, specifically to the VF misc vector name so that we can distinguish
between all the interrupts.

Ashish enables the i40evf driver to enable debug prints via ethtool.

Mitch updates i40e to enable packet split only when IOMMU is in use,
since it shows a distinct advantage over the single-buffer path
because it minimizes DMA mapping and unmapping.  Also adds the receive
routine in use to the features log message to be able to print the
receive packet split status.

Greg adds the ability to get, set and commit permanently the NPAR
partition BW configuration through configfs.  Enables an application
to query the i40e driver's private flags to get the status of NPAR
enablement via ethtool.

Neerav adds 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 the case of a PF VSI and not available for
any other VSI type.

Kevin fixes i40e by ensuring the BUF and FLAG_RD flags are set for
indirect admin queue command.

Vasu updates the driver to setup FCoE netdev device type as "fcoe", so that
it shows up in sysfs as FCoE device.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 18:13:07 -05:00
Guenter Roeck d79d210736 net: dsa: Introduce dsa_is_port_initialized
To avoid race conditions when using the ds->ports[] array,
we need to check if the accessed port has been initialized.
Introduce and use helper function dsa_is_port_initialized
for that purpose and use it where needed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 17:57:48 -05:00
David S. Miller bb66be1c54 Merge branch 'sf2_hwbridge'
Florian Fainelli says:

====================
net: dsa: integration with SWITCHDEV for HW bridging

This patch set provides the DSA and SWITCHDEV integration bits together and
modifies the bcm_sf2 driver accordingly such that it works properly with HW
bridging.

Changes in v3:

- add back the null pointer check in dsa_slave_br_port_mask from Guenter
- slightly rework patch 1 commit message not to mention the function name
  we add in patch 2

Changes in v2:

- avoid a race condition in how DSA network devices are created, patch from
  Guenter Roeck
- provide a consistent and work STP state once a port leaves the bridge
- retain a bridge device pointer to properly flag port/bridge membership
- properly flush the ARL (Address Resolution Logic) in bcm_sf2.c
- properly retain port membership when individually bringing devices up/down
  while they are members of a bridge

We discussed on the mailing-list the possibility of standardizing a "fdb_flush"
operation for DSA switch drivers, looking at the Marvell and Broadcom switches,
I am not convinced this is practical or diserable as the terminologies vary
here, but there is nothing preventing us from doing it later.

Many thanks to Guenter and Andrew for both testing and providing feedback.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 17:04:15 -05:00
Florian Fainelli 12f460f234 net: dsa: bcm_sf2: add HW bridging support
Implement the bridge join, leave and set_stp callbacks by making that
we do the following:

- when a port joins the bridge, all existing ports in the bridge get
  their VLAN control register updated with that joining port
- the joining port is including all existing bridge ports in its own
  VLAN control register

The leave operation is fairly similar, special care must be taken to
make sure that port leaving the bridging is not removing itself from its
own VLAN control register.

Since the various BR_* states apply directly to our HW semantics, we
just need to translate these constants into their corresponding HW
settings, and voila!

We make sure to trigger a fast-ageing process for ports that are
joining/leaving the bridge and transition from incompatible states, this
is equivalent to triggering an ARL flush for that port.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 17:03:38 -05:00
Florian Fainelli b73adef677 net: dsa: integrate with SWITCHDEV for HW bridging
In order to support bridging offloads in DSA switch drivers, select
NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
NDOs that we are required to implement.

To facilitate the integratation at the DSA driver level, we implement 3
types of operations:

- port_join_bridge
- port_leave_bridge
- port_stp_update

DSA will resolve which switch ports that are currently bridge port
members as some Switch hardware/drivers need to know about that to limit
the register programming to just the relevant registers (especially for
slow MDIO buses).

We also take care of setting the correct STP state when slave network
devices are brought up/down while being bridge members.

Finally, when a port is leaving the bridge, we make sure we set in
BR_STATE_FORWARDING state, otherwise the bridge layer would leave it
disabled as a result of having left the bridge.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 17:03:38 -05:00
Guenter Roeck d87d6f44d7 net: dsa: Ensure that port array elements are initialized before being used
A network device notifier can be called for one or more of the created
slave devices before all slave devices have been registered. This can
result in a mismatch between ds->phys_port_mask and the registered devices
by the time the call is made, and it can result in a slave device being
added to a bridge before its entry in ds->ports[] has been initialized.

Rework the initialization code to initialize entries in ds->ports[] in
dsa_slave_create. With this change, dsa_slave_create no longer needs
to return slave_dev but can return an error code instead.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-25 17:03:38 -05:00
Sravanthi Tangeda 5b8eb1766f i40e/i40evf: Update driver versions
Bump i40e to 1.2.9 and i40evf 1.2.3

Also update the copyright year.

Change-ID: I345d777e94abd0acffe6a28793f675d251a86299
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>
2015-02-24 23:38:40 -08:00
Carolyn Wyborny 9a21a007b6 i40evf: Add more info to interrupt vector names
This patch adds the netdev name to the VF misc vector name.  Without
this patch, all the interrupts show the same info, so it difficult to
distinguish them.

Change-ID: I247828697e1373ecfb5f8dc1bc9618e98a7f4942
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>
2015-02-24 23:24:12 -08:00
Greg Rose 7e45ab4408 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>
2015-02-24 23:09:32 -08:00
Kevin Scott 3b38cd17f8 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>
2015-02-24 22:55:02 -08:00
Mitch Williams aba237d124 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>
2015-02-24 22:40:24 -08:00
Vasu Dev ccafbce41b 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>
2015-02-24 22:26:00 -08:00
Kevin Scott a6db5a4d01 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>
2015-02-24 22:11:33 -08:00
Neerav Parikh 51616018dd 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>
2015-02-24 21:57:05 -08:00
Greg Rose 96664483a3 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>
2015-02-24 21:42:40 -08:00
Greg Rose f4492db16d 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>
2015-02-24 21:28:11 -08:00
Mitch Williams 2bc7ee8ac5 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>
2015-02-24 21:13:35 -08:00
Ashish Shah 0e888980a3 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>
2015-02-24 20:59:12 -08:00
Carolyn Wyborny 88eee9bc54 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>
2015-02-24 20:44:40 -08:00
Catherine Sullivan e827845c7d 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>
2015-02-24 20:29:54 -08:00
Paul M Stillwell Jr f1abd7dbb3 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>
2015-02-24 18:35:38 -08:00
Tino Reichardt 92bf200881 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>
2015-02-24 16:30:02 -05:00
Ian Morris 49e64dcda2 ipv6: remove dead debug code from ip6_tunnel.c
The IP6_TNL_TRACE macro is no longer used anywhere in the code so remove definition.

Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-24 16:25:25 -05:00
David S. Miller 8ff3ac060f 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>
2015-02-24 16:05:54 -05:00
Mahesh Bandewar 14c9551a32 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>

===================================

BEGIN=True + PortEnable=False
           |
           v
 +------------------------+   ActorPort.Sync=True  +------------------+
 |   ACTOR_CHURN_MONITOR  | ---------------------> |  NO_ACTOR_CHURN  |
 |========================|                        |==================|
 |    ActorChurn=False    |  ActorPort.Sync=False  | ActorChurn=False |
 | ActorChurn.Timer=Start | <--------------------- |                  |
 +------------------------+                        +------------------+
           |                                                ^
           |                                                |
  ActorChurn.Timer=Expired                                  |
           |                                       ActorPort.Sync=True
           |                                                |
           |                +-----------------+             |
           |                |   ACTOR_CHURN   |             |
           |                |=================|             |
           +--------------> | ActorChurn=True | ------------+
                            |                 |
                            +-----------------+

Similar for the Partner-churn-detection.

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-24 16:05:48 -05:00
Mahesh Bandewar bb54e58929 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>
2015-02-24 16:05:47 -05:00
David S. Miller 2a12d6cf75 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>
2015-02-24 11:48:48 -05:00
David S. Miller 1e0629d3f8 Merge branch 'bcmgenet-next'
Petri Gynther says:

====================
net: bcmgenet: Tx init improvements

Four small patches to improve bcmgenet Tx init:
1. bcmgenet_init_tx_ring() cleanup
2. rework Tx queue init
3. precalculate TxCB->bd_addr
4. rename bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-24 11:39:11 -05:00
Petri Gynther 51a966a718 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>
2015-02-24 11:39:04 -05:00
Petri Gynther 014012a491 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>
2015-02-24 11:39:04 -05:00
Petri Gynther 16c6d66788 net: bcmgenet: rework Tx queue init
1. Rename bcmgenet_init_multiq() to bcmgenet_init_tx_queues()
2. Fix bcmgenet_init_tx_queues() function description
3. Move Tx default queue init inside bcmgenet_init_tx_queues()
4. Modify bcmgenet_init_dma() to call bcmgenet_init_tx_queues()

Signed-off-by: Petri Gynther <pgynther@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-24 11:39:04 -05:00
Petri Gynther 4f8b2d7d1b 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>
2015-02-24 11:39:04 -05:00
David S. Miller 8ca40c1457 Merge branch 'pktgen-next'
Ben Hutchings says:

====================
pktgen documentation cleanup and samples

This series cleans up the pktgen documentation, adds and improves the
original sample scripts.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:04:35 -05:00
Ben Hutchings 4e081e0cbd pktgen: Correct documentation of module name and command
Drop the '.o' suffix so this text properly covers both the
built-in and modular cases.

'insmod pktgen' obviously won't work; the command should be modprobe.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:04:25 -05:00
Ben Hutchings 4062bd25f0 samples/pktgen: Show the results rather than just commenting where they are
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:04:25 -05:00
Ben Hutchings 16b5d0c4a2 samples/pktgen: Trap SIGINT
Otherwise ^C stops the script, not just pktgen.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:04:21 -05:00
Ben Hutchings db72aba30a 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>
2015-02-23 22:04:10 -05:00
Ben Hutchings 06481f22c6 samples/pktgen: Remove setting of obsolete max_before_softirq parameter
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:04:10 -05:00
Ben Hutchings 2ad1cdf2ea 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>
2015-02-23 22:03:18 -05:00
Ben Hutchings 865367db65 samples/pktgen: Delete unused function pg()
This function is not used and wouldn't do anything useful as
pktgen does not have an 'inject' command.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:03:18 -05:00
Ben Hutchings 7c95a9d962 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>
2015-02-23 22:03:18 -05:00
Ben Hutchings ca5b542cce 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>
2015-02-23 22:03:18 -05:00
Ben Hutchings 98e688f405 pktgen: Delete the original date from documentation
This has been updated quite a few times since 2004, and git can
keep track of the actual date for us.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-23 22:03:18 -05:00
Mitch Williams 54e16f64f0 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>
2015-02-23 17:13:21 -08:00
Mitch Williams ac833bbf79 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>
2015-02-23 17:13:20 -08:00
Mitch Williams 748c434bfa 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>
2015-02-23 17:13:19 -08:00