]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
9 years agomwifiex: more_task flag for main_process
Shengzhen Li [Wed, 11 Feb 2015 17:42:24 +0000 (23:12 +0530)]
mwifiex: more_task flag for main_process

This patch handles a corner case where TX packet would remain in
driver queue till next packet comes in.
Here is sequence:
1. TX packet is queued via hard_start_xmit and main_work is queued
2. SDIO interrupt comes in which directly call mwifiex_main_process.
This starts executing main superloop.
3. Now work from step1 is scheduled but at first check itself it sees
mwifiex_processing is set and exits.
4. Now if superloop from step2 has passed TX processing part of superloop
this packet would remain in queue until next packet/command/SDIO interrupt
arrives and queues main_work.

This patch fixes this corner case by defining more_task flag which is set when
mwifiex_processing is found to be true. At end of superloop we again check if
more_task flag is set and if set, execute superloop again.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agolibertas: remove unnecessary check before calling debugfs_remove
Bas Peters [Wed, 11 Feb 2015 08:33:06 +0000 (09:33 +0100)]
libertas: remove unnecessary check before calling debugfs_remove

Debugfs_remove will check for error or NULL for us, so it is not
necessary to do this here.

Signed-off-by: Bas Peters <baspeters93@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Modify some USB de-initialize code.
Taehee Yoo [Tue, 10 Feb 2015 16:40:30 +0000 (01:40 +0900)]
rtlwifi: Modify some USB de-initialize code.

Delete SET_USB_STOP macro and rtl_usb_deinit because
those are called twice in USB de-initialize routine.
Add some de-initialize workqueue function in USB disconnect routine.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k_htc: Add new USB ID
Leon Nardella [Sat, 7 Feb 2015 19:10:07 +0000 (17:10 -0200)]
ath9k_htc: Add new USB ID

This device is a dongle made by Philips to enhance their TVs with wireless capabilities,
but works flawlessly on any upstream kernel, provided that the ath9k_htc module is attached to it.
It's correctly recognized by lsusb as "0471:209e Philips (or NXP) PTA01 Wireless Adapter" and the
patch has been tested on real hardware.

Signed-off-by: Leon Nardella <leon.nardella@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Clear ACM_CTRL AC3_VO bit correctly
Jes Sorensen [Fri, 6 Feb 2015 22:24:32 +0000 (17:24 -0500)]
rtlwifi: Clear ACM_CTRL AC3_VO bit correctly

All hw driver components in the rtlwifi driver, except for the
rtl8192de component has this bug. They would clear BE bit in the
ACM_CTRL register instead of the VO bit when processing the VO queue.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Fix escan timer causing oops.
Hante Meuleman [Fri, 6 Feb 2015 17:36:47 +0000 (18:36 +0100)]
brcmfmac: Fix escan timer causing oops.

In some rare circumstances the escan protection timer can expire
before the setup completed (due to long timeouts on IOCTL). This
patch avoids this situation by setting the timer after the setup
completed correctly.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Dont sleep when ctrl frames to transmit.
Hante Meuleman [Fri, 6 Feb 2015 17:36:46 +0000 (18:36 +0100)]
brcmfmac: Dont sleep when ctrl frames to transmit.

The SDIO watchdog will put the device in sleep mode when there is
no activity for some time and nothing to do anymore. This check
is incomplete and should also check if there is a control frame
to transmit.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: make sdio suspend wait for threads to freeze
Arend van Spriel [Fri, 6 Feb 2015 17:36:45 +0000 (18:36 +0100)]
brcmfmac: make sdio suspend wait for threads to freeze

Borrowed the idea of the PM freezer to make sdio suspend wait for
watchdog and DPC thread to freeze at a safe point in their thread
routine. The suspend takes 20-25 msec.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: add debugfs file containing revision info
Arend van Spriel [Fri, 6 Feb 2015 17:36:44 +0000 (18:36 +0100)]
brcmfmac: add debugfs file containing revision info

Make the revision info visible in debugfs. The new debugfs
file is named 'revinfo'.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Remove error print for invalid key index.
Hante Meuleman [Fri, 6 Feb 2015 17:36:43 +0000 (18:36 +0100)]
brcmfmac: Remove error print for invalid key index.

When a key is set or cleared with an unsupported key index then
brcmfmac will print an error. With most wpa_supplicants this is
happening a lot. The error print is confusing and not needed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: use helper function for changing SDIO state
Arend van Spriel [Fri, 6 Feb 2015 17:36:42 +0000 (18:36 +0100)]
brcmfmac: use helper function for changing SDIO state

Changing the SDIO state of the driver involves changing the bus
interface state. Adding a helper function makes sure that knowledge
is in one place.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: use alloc_workqueue's format strings capabilities for WQ names
Avinash Patil [Fri, 6 Feb 2015 14:28:05 +0000 (19:58 +0530)]
mwifiex: use alloc_workqueue's format strings capabilities for WQ names

alloc_workqueue() has string format formation ability e.g. wqname%ifname
will be treated as wqnameifname. Use this and remove string operations
while defining strings for workqueue names.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcm80211: drop unreachable else case
Nicholas Mc Guire [Fri, 6 Feb 2015 13:26:50 +0000 (08:26 -0500)]
brcm80211: drop unreachable else case

the if/elseif/else is exhaustive - there is no 4th case given the
  rssi_ctrl_mask = RADIO_2055_NBRSSI_SEL | RADIO_2055_WBRSSI_G1_SEL |
  RADIO_2055_WBRSSI_G2_SEL;
so this unreachable else case (dead code) can be dropped.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: use msecs_to_jiffies for time conversion
Nicholas Mc Guire [Fri, 6 Feb 2015 10:26:45 +0000 (05:26 -0500)]
brcmfmac: use msecs_to_jiffies for time conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Restart TSF2 timers on wakeup
Sujith Manoharan [Thu, 5 Feb 2015 04:52:44 +0000 (10:22 +0530)]
ath9k: Restart TSF2 timers on wakeup

When coming out of WoW sleep, check and restart
timers based on TSF2.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Clear additional WoW events
Sujith Manoharan [Thu, 5 Feb 2015 04:52:43 +0000 (10:22 +0530)]
ath9k: Clear additional WoW events

The events for patterns 8..15 need to be
cleared on wakeup.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle additional patterns on wakeup
Sujith Manoharan [Thu, 5 Feb 2015 04:52:42 +0000 (10:22 +0530)]
ath9k: Handle additional patterns on wakeup

Handle the user-configured patterns in the range 8..15
when waking up and update wow_status correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check MCI PowerSave state
Sujith Manoharan [Thu, 5 Feb 2015 04:52:41 +0000 (10:22 +0530)]
ath9k: Check MCI PowerSave state

The power save state of MCI has to be disabled
when enabling WoW sleep, check this properly.
ar9003_mci_state() doesn't handle MCI_STATE_GET_WLAN_PS_STATE
right now, but this will be done later when proper
support for MCI/PS is added.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add new MCI states
Sujith Manoharan [Thu, 5 Feb 2015 04:52:40 +0000 (10:22 +0530)]
ath9k: Add new MCI states

Several new MCI states have to handled,
add them to the list.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Set keep awake timer
Sujith Manoharan [Thu, 5 Feb 2015 04:52:39 +0000 (10:22 +0530)]
ath9k: Set keep awake timer

When MCI is enabled and WoW sleep is enabled,
make sure that the RTC keep awake timer is set
with the required value. This is also required
when the AR_WA is programmed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix descriptors for keep-alive frame
Sujith Manoharan [Thu, 5 Feb 2015 04:52:38 +0000 (10:22 +0530)]
ath9k: Fix descriptors for keep-alive frame

Along with AR9462, AR9565 also has an extra field
in the TX descriptor which needs to be zeroed out
for the keep alive frame. This makes the earlier
REG_WRITE redundant, so it can be removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Wed, 25 Feb 2015 23:13:07 +0000 (18:13 -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-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>
9 years agonet: dsa: Introduce dsa_is_port_initialized
Guenter Roeck [Wed, 25 Feb 2015 07:02:02 +0000 (23:02 -0800)]
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>
9 years agoMerge branch 'sf2_hwbridge'
David S. Miller [Wed, 25 Feb 2015 22:04:15 +0000 (17:04 -0500)]
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>
9 years agonet: dsa: bcm_sf2: add HW bridging support
Florian Fainelli [Tue, 24 Feb 2015 21:15:34 +0000 (13:15 -0800)]
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>
9 years agonet: dsa: integrate with SWITCHDEV for HW bridging
Florian Fainelli [Tue, 24 Feb 2015 21:15:33 +0000 (13:15 -0800)]
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>
9 years agonet: dsa: Ensure that port array elements are initialized before being used
Guenter Roeck [Tue, 24 Feb 2015 21:15:32 +0000 (13:15 -0800)]
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>
9 years agoi40e/i40evf: Update driver versions
Sravanthi Tangeda [Fri, 6 Feb 2015 08:52:21 +0000 (08:52 +0000)]
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>
9 years agoi40evf: Add more info to interrupt vector names
Carolyn Wyborny [Fri, 6 Feb 2015 08:52:20 +0000 (08:52 +0000)]
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>
9 years agoi40e: Use ethtool private flags to display NPAR status
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>
9 years agoi40e: Set FLAG_RD when sending buffer FW must read
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>
9 years agoi40e: print Rx packet split status
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>
9 years agoi40e: setup FCoE device type
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>
9 years agoi40e: Set BUF flag for Set Version AQ command
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>
9 years agoi40e: Add support for getlink, setlink ndo ops
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>
9 years agoi40e: Implement configfs for NPAR BW configuration
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>
9 years agoi40e: Add NPAR BW get and set functions
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>
9 years agoi40e: enable packet split only when IOMMU present
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>
9 years agoi40evf: allow enabling of debug prints via ethtool
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>
9 years agoi40e: Add method to keep track of current rxnfc settings
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>
9 years agoi40e/i40evf: Use advertised speed settings in ethtool and refactor get_settings
Catherine Sullivan [Fri, 6 Feb 2015 08:52:08 +0000 (08:52 +0000)]
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>
9 years agoi40e/i40evf: Fix output of i40e_debug_aq() for big endian machines
Paul M Stillwell Jr [Fri, 6 Feb 2015 08:52:07 +0000 (08:52 +0000)]
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>
9 years agonet: via-rhine: add BQL support
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>
9 years agoipv6: remove dead debug code from ip6_tunnel.c
Ian Morris [Tue, 24 Feb 2015 12:01:25 +0000 (12:01 +0000)]
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>
9 years agoMerge branch 'bonding-next'
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>
9 years agobonding: Implement port churn-machine (AD standard 43.4.17).
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>
===================================

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>
9 years agobonding: Verify RX LACPDU has proper dest mac-addr
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>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/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>
9 years agoMerge branch 'bcmgenet-next'
David S. Miller [Tue, 24 Feb 2015 16:39:11 +0000 (11:39 -0500)]
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>
9 years agonet: bcmgenet: rename bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT
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>
9 years agonet: bcmgenet: precalculate TxCB->bd_addr
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>
9 years agonet: bcmgenet: rework Tx queue init
Petri Gynther [Mon, 23 Feb 2015 19:00:45 +0000 (11:00 -0800)]
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>
9 years agonet: bcmgenet: bcmgenet_init_tx_ring() cleanup
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>
9 years agoMerge branch 'pktgen-next'
David S. Miller [Tue, 24 Feb 2015 03:04:35 +0000 (22:04 -0500)]
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>
9 years agopktgen: Correct documentation of module name and command
Ben Hutchings [Tue, 24 Feb 2015 02:33:29 +0000 (02:33 +0000)]
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>
9 years agosamples/pktgen: Show the results rather than just commenting where they are
Ben Hutchings [Tue, 24 Feb 2015 02:33:20 +0000 (02:33 +0000)]
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>
9 years agosamples/pktgen: Trap SIGINT
Ben Hutchings [Tue, 24 Feb 2015 02:33:08 +0000 (02:33 +0000)]
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>
9 years agosamples/pktgen: Use bash as interpreter
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>
9 years agosamples/pktgen: Remove setting of obsolete max_before_softirq parameter
Ben Hutchings [Tue, 24 Feb 2015 02:32:48 +0000 (02:32 +0000)]
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>
9 years agosamples/pktgen: Correct comments about the thread config
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>
9 years agosamples/pktgen: Delete unused function pg()
Ben Hutchings [Tue, 24 Feb 2015 02:32:17 +0000 (02:32 +0000)]
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>
9 years agosamples/pktgen: Add sample scripts for pktgen facility
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>
9 years agopktgen: Fix grammar errors and some poor wording in documentation
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>
9 years agopktgen: Delete the original date from documentation
Ben Hutchings [Tue, 24 Feb 2015 02:31:13 +0000 (02:31 +0000)]
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>
9 years agoi40evf: don't wait forever
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>
9 years agoi40evf: refactor reset
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>
9 years agoi40evf: disable NAPI polling sooner
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>
9 years agoi40e: Fix i40e_ndo_set_vf_spoofchk
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>
9 years agoi40e/i40evf: Bump Driver Versions
Sravanthi Tangeda [Sat, 24 Jan 2015 09:58:42 +0000 (09:58 +0000)]
i40e/i40evf: Bump Driver Versions

Bump i40e to 1.2.8 and i40evf to 1.2.2

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>
9 years agoi40e/i40evf: Remove unused variable an_enable and function update_link_info
Catherine Sullivan [Sat, 24 Jan 2015 09:58:41 +0000 (09:58 +0000)]
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>
9 years agoi40e: Fix the EMPR interrupt received handling
Anjali Singhai Jain [Sat, 24 Jan 2015 09:58:40 +0000 (09:58 +0000)]
i40e: Fix the EMPR interrupt received handling

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>
9 years agoi40e/i40evf: i40e_register.h updates
Anjali Singhai Jain [Sat, 24 Jan 2015 09:58:39 +0000 (09:58 +0000)]
i40e/i40evf: i40e_register.h updates

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>
9 years agoi40e: Use #define for the VSI connection type
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>
9 years agoi40e/i40evf: restrict VC opcodes to their initial values
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>
9 years agoi40e/i40evf: Refactor the receive routines
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>
9 years agoi40e: rename debugfs clear_stats option
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>
9 years agoi40e: update Shadow RAM read/write functions
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>
9 years agoigbvf: cleanup msleep() and min/max() usage
Jeff Kirsher [Sat, 21 Feb 2015 04:55:56 +0000 (20:55 -0800)]
igbvf: cleanup msleep() and min/max() usage

Fixed a few cases of when we used msleep() when we should have been
using usleep_range().  Also updated the usage of min/max() to use
min_t/max_t().

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
9 years agoigbvf: Fix code comments and whitespace
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>
9 years agoe1000e: initial support for i219
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>
9 years agoMerge branch 'be2net-next'
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>
9 years agobe2net: move be_func_init() call inside be_setup()
Sathya Perla [Mon, 23 Feb 2015 09:20:16 +0000 (04:20 -0500)]
be2net: move be_func_init() call inside be_setup()

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>
9 years agobe2net: refactor adapter resource cleanup sequence into be_cleanup()
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>
9 years agobe2net: refactor adapter resource initialzation sequence into be_resume()
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>
9 years agobe2net: remove code duplication relating to Lancer reset sequence
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>
9 years agobe2net: refactor error detect/recovery function
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>
9 years agobe2net: use a wrapper to schedule and cancel error detection task
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>
9 years agobe2net: refactor function initalization sequence into be_func_init()
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>
9 years agobe2net: get rid of be_get_initial_config() call from be_probe()
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>
9 years agobe2net: move adapter fields alloc/free code to new routines
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>
9 years agobridge: add vlan info to bridge setlink and dellink notification messages
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>
9 years agonet: __aligned(size) is preferred over __attribute__((aligned(size)))
Ameen Ali [Sun, 22 Feb 2015 21:40:36 +0000 (23:40 +0200)]
net: __aligned(size) is preferred over __attribute__((aligned(size)))

Signed-off-by: Ameen Ali <AmeenAli023@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobatman-adv: Fix use of seq_has_overflowed()
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>
9 years agonet: Remove state argument from skb_find_text()
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>
9 years agoethtool: use "ops" name consistenty in ethtool_set_rxfh()
Dan Carpenter [Fri, 20 Feb 2015 10:54:05 +0000 (13:54 +0300)]
ethtool: use "ops" name consistenty in ethtool_set_rxfh()

"dev->ethtool_ops" and "ops" are the same, but we should use "ops"
everywhere to be consistent.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Replace "#include <asm/uaccess>" with "#include <linux/uaccess>"
Alex W Slater [Thu, 19 Feb 2015 21:58:07 +0000 (21:58 +0000)]
ipv6: Replace "#include <asm/uaccess>" with "#include <linux/uaccess>"

Fix checkpatch.pl warning "Use #include <linux/uaccess.h> instead of <asm/uaccess.h>"

Signed-off-by: Alex W Slater <alex.slater.dev@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'bna-next'
David S. Miller [Sun, 22 Feb 2015 03:05:30 +0000 (22:05 -0500)]
Merge branch 'bna-next'

Rasesh Mody says:

====================
bna: Update the Driver and Firmware Version

These patches re-brands the BNA driver to QLogic. The patches update the BNA
driver version to 3.2.25.1 and firmware version to 3.2.5.1.

The patches are tested against 3.19.0.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobna: Update the Driver and Firmware Version
Rasesh Mody [Thu, 19 Feb 2015 21:02:32 +0000 (16:02 -0500)]
bna: Update the Driver and Firmware Version

This patch updates the BNA driver version to 3.2.25.1 and the firmware version
to 3.2.5.1

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobna: QLogic BR-series Adapters Driver Rebranding
Rasesh Mody [Thu, 19 Feb 2015 21:02:31 +0000 (16:02 -0500)]
bna: QLogic BR-series Adapters Driver Rebranding

Re-brand the BNA driver to QLogic.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agosunvnet: failed trigger should not cause BUG_ON()
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>