]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agobnx2x: fix crash on big-endian when adding VLAN
Michal Schmidt [Wed, 2 Mar 2016 12:47:05 +0000 (13:47 +0100)]
bnx2x: fix crash on big-endian when adding VLAN

bnx2x crashes during the initialization of the 8021q module on ppc64.
The bug is a missing conversion from le32 in
bnx2x_handle_classification_eqe() when obtaining the cid value from
struct eth_event_data.

The fields in struct eth_event_data should all be declared as
little-endian and conversions added where missing.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix 84833 phy command handler
Yuval Mintz [Sun, 21 Feb 2016 13:07:29 +0000 (15:07 +0200)]
bnx2x: Fix 84833 phy command handler

Current initialization sequence is lacking, causing some configurations
to fail.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix led setting for 84858 phy.
Yuval Mintz [Sun, 21 Feb 2016 13:07:28 +0000 (15:07 +0200)]
bnx2x: Fix led setting for 84858 phy.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Correct 84858 PHY fw version
Yuval Mintz [Sun, 21 Feb 2016 13:07:27 +0000 (15:07 +0200)]
bnx2x: Correct 84858 PHY fw version

The phy's firmware version isn't being parsed properly as it's
currently parsed like the rest of the 848xx phys.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix 84833 RX CRC
Yuval Mintz [Sun, 21 Feb 2016 13:07:26 +0000 (15:07 +0200)]
bnx2x: Fix 84833 RX CRC

There's a problem in current 84833 phy configuration -
in case 1Gb link is configured and jumbo-sized packets are being
used, device will experience RX crc errors.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix link-forcing for KR2
Yuval Mintz [Sun, 21 Feb 2016 13:07:25 +0000 (15:07 +0200)]
bnx2x: Fix link-forcing for KR2

Currently, when link is using KR2 it cannot be forced to any speed other
than 20g.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.om>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Add missing HSI for big-endian machines
Yuval Mintz [Wed, 17 Feb 2016 11:15:14 +0000 (13:15 +0200)]
bnx2x: Add missing HSI for big-endian machines

Commit e5d3a51cefbb ("bnx2x: extend DCBx support") was missing HSI
changes for big-endian machine, breaking compilation on such
platforms.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Warn about grc timeouts in register dump
Yuval Mintz [Tue, 16 Feb 2016 16:08:01 +0000 (18:08 +0200)]
bnx2x: Warn about grc timeouts in register dump

There are several scenarios where taking a register dump from a device
might log benign GRC timeout attentions to system logs.
Most common of those is when taking the dump from a 2-port device.

Sadly, there's no easy way to mask the problematic attentions during the
flow - Changing this behvaior would require a firmware update.
For now, simply warn users to ignore the warnings.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: extend DCBx support
Yuval Mintz [Tue, 16 Feb 2016 16:08:00 +0000 (18:08 +0200)]
bnx2x: extend DCBx support

This adds support for default application priority.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Add support for single-port DCBx
Yuval Mintz [Tue, 16 Feb 2016 16:07:59 +0000 (18:07 +0200)]
bnx2x: Add support for single-port DCBx

Driver is currently looking at shared information for determining whether
DCBx can be supported for a given port.
On 4-port devices, up-to-date management firmware can support DCBx on
each port of a given engine independently - but that would cause bnx2x to
misinterpert the support and assume DCBx is supported on both.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Remove unneccessary EXPORT_SYMBOL
Yuval Mintz [Tue, 16 Feb 2016 16:07:57 +0000 (18:07 +0200)]
bnx2x: Remove unneccessary EXPORT_SYMBOL

bnx2x_schedule_sp_rtnl is exported by bnx2x, although no other module
uses it.

Reported-by: Benjamin Poirier <bpoirier@suse.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Prevent FW assertion when using Vxlan
Yuval Mintz [Fri, 18 Dec 2015 08:42:12 +0000 (10:42 +0200)]
bnx2x: Prevent FW assertion when using Vxlan

FW has a rare corner case in which a fragmented packet using lots
of frags would not be linearized, causing the FW to assert while trying
to transmit the packet.

To prevent this, we need to make sure the window of fragements containing
MSS worth of data contains 1 BD less than for regular packets due to
the additional parsing BD.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: remove rx_pkt/rx_calls
Eric Dumazet [Tue, 8 Dec 2015 18:28:30 +0000 (10:28 -0800)]
bnx2x: remove rx_pkt/rx_calls

These fields are updated but never read.
Remove the overhead.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: avoid soft lockup in bnx2x_poll()
Eric Dumazet [Tue, 8 Dec 2015 13:54:40 +0000 (05:54 -0800)]
bnx2x: avoid soft lockup in bnx2x_poll()

Under heavy TX load, bnx2x_poll() can loop forever and trigger
soft lockup bugs.

A napi poll handler must yield after one TX completion round,
risk of livelock is too high otherwise.

Bug is very easy to trigger using a debug build, and udp flood, because
of added cpu cycles in TX completion, and we do not receive enough
packets to break the loop.

Reported-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Ariel Elior <ariel.elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: simplify distinction between port and func stats
Michal Schmidt [Fri, 4 Dec 2015 16:22:36 +0000 (17:22 +0100)]
bnx2x: simplify distinction between port and func stats

The 'flags' field in bnx2x_stats_arr[] serves only one purpose - to tell
us if the statistic is a per-port stat and thus should not be shown for
virtual functions. It's strange that the field can have three different
values. A boolean will do just fine.

Also remove IS_FUNC_STAT(). It was used only once and it's in fact just
a negation of IS_PORT_STAT().

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: change FW GRO error message to WARN_ONCE
Michal Schmidt [Fri, 4 Dec 2015 16:22:35 +0000 (17:22 +0100)]
bnx2x: change FW GRO error message to WARN_ONCE

It's supposed to be impossible for TPA to give us anything else
than IPv4 or IPv6 here. But in case there is a way to reach this error
by some strange received frames, we don't want to flood the kernel log.
WARN_ONCE is better for this purpose.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: drop redundant error message about allocation failure
Michal Schmidt [Fri, 4 Dec 2015 16:22:34 +0000 (17:22 +0100)]
bnx2x: drop redundant error message about allocation failure

alloc_pages() already prints a warning when it fails. No need to emit
another message. Certainly not at KERN_ERR level, because it is no big
deal if this GFP_ATOMIC allocation fails occasionally.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Utilize FW 7.13.1.0.
Yuval Mintz [Sun, 22 Nov 2015 13:01:29 +0000 (15:01 +0200)]
bnx2x: Utilize FW 7.13.1.0.

Commit 46e8a249423ff "bnx2x: Add FW 7.13.1.0" added said .bin FW to
linux-firmware; This patch incorporates the FW in the bnx2x driver.

This introduces 2 fixes/enhancements:
 - In some management protocols there are outer-vlan configurations
that can be dynamically changed while device is running. This fixes
some corner cases where such a change did not take effect.

 - Prevent VFs from sending MAC control frames; FW would treat a VF
sending such a packet as malicious and block any further communication
done by the VF.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Show port statistics in Multi-function
Yuval Mintz [Thu, 19 Nov 2015 15:04:36 +0000 (17:04 +0200)]
bnx2x: Show port statistics in Multi-function

Today, port statistics are being presented when using `ethool -S' only
for single-function devices, but there are some port statistics which are
crucial for analyzing bottle-necks. E.g., HW Rx discards due to lack of
buffer space [when device isn't handling ingress traffic fast enough].

Judging the pros and cons, it was decided that in-order to better support
automatic dump-gathering tools, bnx2x should no longer hide those stats.
This leaves only VFs lacking the port statistics.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Add new SW stat 'tx_exhaustion_events'
Yuval Mintz [Thu, 19 Nov 2015 15:04:35 +0000 (17:04 +0200)]
bnx2x: Add new SW stat 'tx_exhaustion_events'

Driver already has an internal counter for number of times a given queue
had to be stopped due to Tx ring exhaustion.
This add the counter to the statistics presented by driver, e.g., by using
`ethtool -S'.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Fix vxlan removal
Yuval Mintz [Thu, 19 Nov 2015 09:56:51 +0000 (11:56 +0200)]
bnx2x: Fix vxlan removal

Commmit ac7eccd4d48fc "bnx2x: track vxlan port count" contains a bug -
Instead of achieving the required goal, vxlan configuration would not
be removed since we're decrementing the port instead of the counter.

CC: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agonet: move skb_mark_napi_id() into core networking stack
Eric Dumazet [Wed, 18 Nov 2015 14:30:59 +0000 (06:30 -0800)]
net: move skb_mark_napi_id() into core networking stack

We would like to automatically provide busy polling support
to all NAPI drivers, without them having to implement anything.

skb_mark_napi_id() can be called from napi_gro_receive() and
napi_get_frags().

Few drivers are still calling skb_mark_napi_id() because
they use netif_receive_skb(). They should eventually call
napi_gro_receive() instead. I will leave this to drivers
maintainers.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: remove bnx2x_low_latency_recv() support
Eric Dumazet [Wed, 18 Nov 2015 14:30:57 +0000 (06:30 -0800)]
bnx2x: remove bnx2x_low_latency_recv() support

Switch to native NAPI polling, as this reduces overhead and complexity.

Normal path is faster, since one cmpxchg() is not anymore requested,
and busy polling with the NAPI polling has same performance.

Tested:
lpk50:~# cat /proc/sys/net/core/busy_read
70
lpk50:~# nstat >/dev/null;./netperf -H lpk55 -t TCP_RR;nstat
MIGRATED TCP REQUEST/RESPONSE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to lpk55.prod.google.com () port 0 AF_INET : first burst 0
Local /Remote
Socket Size   Request  Resp.   Elapsed  Trans.
Send   Recv   Size     Size    Time     Rate
bytes  Bytes  bytes    bytes   secs.    per sec

16384  87380  1        1       10.00    40095.07
16384  87380
IpInReceives                    401062             0.0
IpInDelivers                    401062             0.0
IpOutRequests                   401079             0.0
TcpActiveOpens                  7                  0.0
TcpPassiveOpens                 3                  0.0
TcpAttemptFails                 3                  0.0
TcpEstabResets                  5                  0.0
TcpInSegs                       401036             0.0
TcpOutSegs                      401052             0.0
TcpOutRsts                      38                 0.0
UdpInDatagrams                  26                 0.0
UdpOutDatagrams                 27                 0.0
Ip6OutNoRoutes                  1                  0.0
TcpExtDelayedACKs               1                  0.0
TcpExtTCPPrequeued              98                 0.0
TcpExtTCPDirectCopyFromPrequeue 98                 0.0
TcpExtTCPHPHits                 4                  0.0
TcpExtTCPHPHitsToUser           98                 0.0
TcpExtTCPPureAcks               5                  0.0
TcpExtTCPHPAcks                 101                0.0
TcpExtTCPAbortOnData            6                  0.0
TcpExtBusyPollRxPackets         400832             0.0
TcpExtTCPOrigDataSent           400983             0.0
IpExtInOctets                   21273867           0.0
IpExtOutOctets                  21261254           0.0
IpExtInNoECTPkts                401064             0.0

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobnx2x: Add FW 7.13.1.0.
Yuval Mintz [Thu, 19 Nov 2015 16:41:26 +0000 (18:41 +0200)]
bnx2x: Add FW 7.13.1.0.

This adds new FW for bnx2x, which adds the following:
 - Ability to change outer vlan ID for some multi-function modes.
 - FW ability for Geneve RSS classification according to inner headers.
 - Prevent VFs from sending MAC control frames.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Kyle McMartin <kyle@kernel.org>
Orabug: 23718192
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2iscsi: Update the driver version
Jitendra Bhivare [Wed, 24 Feb 2016 06:48:45 +0000 (12:18 +0530)]
be2iscsi: Update the driver version

Driver version: 11.0.0.0

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Orabug: 23712824
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2iscsi: Replace _bh with _irqsave/irqrestore
Jitendra Bhivare [Thu, 14 Apr 2016 03:50:05 +0000 (09:20 +0530)]
be2iscsi: Replace _bh with _irqsave/irqrestore

Kernel panic - not syncing: Watchdog detected hard LOCKUP on cpu 21
Pid: 13242, comm: flush-8:80 Tainted: G        W  -- ------------    2.6.32-573.el6.x86_64 #1
Call Trace:
<NMI>  [<ffffffff81537a84>] ? panic+0xa7/0x16f
[<ffffffff810149c9>] ? sched_clock+0x9/0x10
[<ffffffff810ed4bd>] ? watchdog_overflow_callback+0xcd/0xd0
[<ffffffff81124037>] ? __perf_event_overflow+0xa7/0x240
[<ffffffff8101dc54>] ? x86_perf_event_set_period+0xf4/0x180
[<ffffffff81124684>] ? perf_event_overflow+0x14/0x20
[<ffffffff81024a02>] ? intel_pmu_handle_irq+0x202/0x3f0
[<ffffffff8153cd89>] ? perf_event_nmi_handler+0x39/0xb0
[<ffffffff8153e845>] ? notifier_call_chain+0x55/0x80
[<ffffffff81389ba0>] ? scsi_done+0x0/0x60
[<ffffffff8153e8aa>] ? atomic_notifier_call_chain+0x1a/0x20
[<ffffffff810a788e>] ? notify_die+0x2e/0x30
[<ffffffff8153c503>] ? do_nmi+0x1c3/0x350
[<ffffffff8153bdc0>] ? nmi+0x20/0x30
[<ffffffff81389ba0>] ? scsi_done+0x0/0x60
[<ffffffff81389ba0>] ? scsi_done+0x0/0x60
[<ffffffff8153b62e>] ? _spin_lock+0x1e/0x30
<<EOE>>  [<ffffffffa00e2eaf>] ? iscsi_queuecommand+0x7f/0x4e0 [libiscsi]
[<ffffffff81389df5>] ? scsi_dispatch_cmd+0xe5/0x310
[<ffffffff813927be>] ? scsi_request_fn+0x5be/0x750
[<ffffffff81089bad>] ? del_timer+0x7d/0xe0
[<ffffffff81273542>] ? __generic_unplug_device+0x32/0x40
[<ffffffff8126e823>] ? elv_insert+0xd3/0x190
[<ffffffff8126e920>] ? __elv_add_request+0x40/0x90

In beiscsi_alloc_pdu, _bh versions of spin_lock are being used for
protecting SGLs and WRBs. _bh versions are needed as the function gets
invoked in process context and BLOCK_IOPOLL softirq.

In spin_unlock_bh, after releasing the lock and enabling BH, do_softirq
is called which executes till last SOFTIRQ.

beiscsi_alloc_pdu is called under session lock. Through block layer,
iSCSI stack in some cases send IOs with interrupts disabled. In such paths,
CPU will get stuck for a while for session lock with interrupts disabled
because in other CPU do_softirq is executing under session lock thus
causing hard lock up.

Use spin_lock_irqsave/spin_lock_irqrestore as the driver can't be sure
in all paths interrupts are enabled.

Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Orabug: 23712824
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2iscsi: Remove unnecessary synchronize_irq() before free_irq()
Lars-Peter Clausen [Fri, 4 Mar 2016 10:15:06 +0000 (11:15 +0100)]
be2iscsi: Remove unnecessary synchronize_irq() before free_irq()

Calling synchronize_irq() right before free_irq() is quite useless. On one
hand the IRQ can easily fire again before free_irq() is entered, on the
other hand free_irq() itself calls synchronize_irq() internally (in a race
condition free way), before any state associated with the IRQ is freed.

Patch was generated using the following semantic patch:
// <smpl>
@@
expression irq;
@@
-synchronize_irq(irq);
 free_irq(irq, ...);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Orabug: 23712824
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2iscsi:Add missing error check in beiscsi_eeh_resume
Nicholas Krause [Sat, 27 Feb 2016 17:43:25 +0000 (12:43 -0500)]
be2iscsi:Add missing error check in beiscsi_eeh_resume

This adds the missing error check and path for if the call to the
function hwi_init_controller fails as this error path was clearly missed
when writing beiscsi_eeh_resume and thus we must add it now in order to
be able to handle this nonrecoverable failing function call gracefully
in beiscsi_eeh_resume.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Orabug: 23712824
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agoatl2: Disable unimplemented scatter/gather feature
Ben Hutchings [Wed, 20 Apr 2016 22:23:08 +0000 (23:23 +0100)]
atl2: Disable unimplemented scatter/gather feature

atl2 includes NETIF_F_SG in hw_features even though it has no support
for non-linear skbs.  This bug was originally harmless since the
driver does not claim to implement checksum offload and that used to
be a requirement for SG.

Now that SG and checksum offload are independent features, if you
explicitly enable SG *and* use one of the rare protocols that can use
SG without checkusm offload, this potentially leaks sensitive
information (before you notice that it just isn't working).  Therefore
this obscure bug has been designated CVE-2016-2117.

Reported-by: Justin Yackoski <jyackoski@crypto-nite.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: ec5f06156423 ("net: Kill link between CSUM and SG features.")
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23703754
(cherry picked from commit f43bfaeddc79effbf3d0fcb53ca477cca66f3db8)
Signed-off-by: Todd Vierling <todd.vierling@oracle.com>
9 years agobe2net: Fix provisioning of RSS for VFs in multi-partition configurations
Somnath Kotur [Mon, 6 Jun 2016 11:22:10 +0000 (07:22 -0400)]
be2net: Fix provisioning of RSS for VFs in multi-partition configurations

Currently, we do not distribute queue resources to enable RSS for VFs
in multi-channel/partition configurations.
Fix this by having each PF(SRIOV capable) calculate it's share of the
15 RSS Policy Tables available per port before provisioning resources for
all the VFs.
This  proportional share calculation is done based on division of the
PF's MAX VFs with the Total MAX VFs on that port. It also needs to
learn about the no: of NIC PFs on the port and subtract that from
the 15 RSS Policy Tables on the port.

Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: Enable Wake-On-LAN from shutdown for Skyhawk
Sriharsha Basavapatna [Mon, 6 Jun 2016 11:22:09 +0000 (07:22 -0400)]
be2net: Enable Wake-On-LAN from shutdown for Skyhawk

Skyhawk does support wake-up from ACPI shutdown state - S5, provided the
platform supports it (like Auxiliary power source etc). The changes listed
below are done to fix this.

1) There's no need to defer the HW configuration of WOL to be_suspend().
Remove this in be_suspend() and move it to be_set_wol() ethtool function
so it is configured directly in the context of ethtool. This automatically
takes care of the shutdown case.

2) The driver incorrectly uses WOL_CAP field in the FW response to
get_acpi_wol_cap() command, to determine if WOL is enabled. Instead the
driver must rely on the macaddr field in the response to infer WOL state.

3) In be_get_config() during init, if we find that WOL is enabled in FW,
call pci_enable_wake() to enable pmcsr.pme_en bit. This is needed to
support persistent WOL configuration provided by the FW in some platforms.

4) Remove code in be_set_wol() that writes to PCICFG_PM_CONTROL_OFFSET
to set pme_en bit; pci_enable_wake() sets that.

Fixes: 028991e49 ("Enabling Wake-on-LAN is not supported in S5 state")
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: use max-TXQs limit too while provisioning VF queue pairs
Suresh Reddy [Mon, 6 Jun 2016 11:22:08 +0000 (07:22 -0400)]
be2net: use max-TXQs limit too while provisioning VF queue pairs

When the PF driver provisions resources for VFs, it currently only looks
at max RSS queues available to calculate the number of VF queue pairs.
This logic breaks when there are less number of TX-queues than RSS-queues.
This patch fixes this problem by using the max-TXQs available in the
PF-pool in the calculations. As a part of this change the
be_calculate_vf_qs() routine is renamed as be_calculate_vf_res() and the
code that calculates limits on other related resources is moved here to
contain all resource calculation code inside one routine.

Signed-off-by: Suresh Reddy <suresh.reddy@broadcom.com>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobenet: be_resume needs to protect be_open with rtnl_lock
Hannes Frederic Sowa [Mon, 18 Apr 2016 19:19:42 +0000 (21:19 +0200)]
benet: be_resume needs to protect be_open with rtnl_lock

be_open calls down to functions which expects rtnl lock to be held.

Cc: Sathya Perla <sathya.perla@broadcom.com>
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Cc: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: Don't leak iomapped memory on removal.
Douglas Miller [Fri, 4 Mar 2016 21:36:56 +0000 (15:36 -0600)]
be2net: Don't leak iomapped memory on removal.

The adapter->pcicfg resource is either mapped via pci_iomap() or
derived from adapter->db. During be_remove() this resource was ignored
and so could remain mapped after remove.

Add a flag to track whether adapter->pcicfg was mapped or not, then
use that flag in be_unmap_pci_bars() to unmap if required.

Fixes: 25848c901 ("use PCI MMIO read instead of config read for errors")
Signed-off-by: Douglas Miller <dougmill@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: don't enable multicast flag in be_enable_if_filters() routine
Venkat Duvvuru [Wed, 2 Mar 2016 11:00:28 +0000 (06:00 -0500)]
be2net: don't enable multicast flag in be_enable_if_filters() routine

When the interface is opened (in be_open()) the routine
be_enable_if_filters() must be called to switch on the basic filtering
capabilities of an interface that are not changed at run-time.
These include the flags UNTAGGED, BROADCAST and PASS_L3L4_ERRORS.
Other flags such as MULTICAST and PROMISC must be enabled later by
be_set_rx_mode() based on the state in the netdev/adapter struct.

be_enable_if_filters() routine is wrongly trying to enable MULTICAST flag
without checking the current adapter state. This can cause the RX_FILTER
cmds to the FW to fail.  This patch fixes this problem by only enabling
the basic filtering flags in be_enable_if_filters().

The VF must be able to issue RX_FILTER cmd with any filter flag, as long
as the PF allowed those flags (if_cap_flags) in the iface it provisioned
for the VF. This rule is applicable even when the VF doesn't have the
FILTMGMT privilege. There is a bug in BE3 FW that wrongly fails RX_FILTER
multicast programming cmds on VFs that don't have FILTMGMT privilege.
This patch also helps in insulating the VF driver from be_open failures due
to the FW bug. A fix for the BE3 FW issue will be available in
versions >= 11.0.283.0 and 10.6.334.0

Reported-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@avagotech.com>
Signed-off-by: Sathya Perla <sathya.perla@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: Fix a UE caused by passing large frames to the ASIC
ajit.khaparde@broadcom.com [Mon, 22 Feb 2016 19:05:01 +0000 (00:35 +0530)]
be2net: Fix a UE caused by passing large frames to the ASIC

In QnQ configurations like Flex-10 where the VLANs are inserted by the
ASIC, on rare occasions the HW is encountering a scenario where the
final frame length ends to be greater than what the ASIC can support.

This is because when the TXULP pulls the TX WRB to check the length
of the frame to be transmitted it also adds the size of VLANs to be
inserted by the HW to the length of the frame indicated in the WRB,
which in some cases fails the range check.  This causes a UE.

Avoid this by trimming the skb length to accommodate the VLAN insertion.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: Declare some u16 fields as u32 to improve performance
ajit.khaparde@broadcom.com [Mon, 22 Feb 2016 19:03:48 +0000 (00:33 +0530)]
be2net: Declare some u16 fields as u32 to improve performance

When 16-bit integers are loaded on CPUs with high order native
register sizes, the CPU could use some extra ops before using them.
And currently some of the frequently used fields in the driver like
the producer and consumer indices of the queues are declared as u16.

This patch declares such fields as u32.  With this change we see the
64-byte packets per second numbers improve by about 4%.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agobe2net: Fix pcie error recovery in case of NIC+RoCE adapters
Padmanabh Ratnakar [Wed, 17 Feb 2016 21:39:34 +0000 (03:09 +0530)]
be2net: Fix pcie error recovery in case of NIC+RoCE adapters

Interrupts registered by RoCE driver are not unregistered when
msix interrupts are disabled during error recovery causing a
crash. Detach the adapter instance from RoCE driver when error
is detected to complete the cleanup. Attach the driver again after
the adapter is recovered from error.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: suresh.reddy <suresh.reddy@broadcom.com>
Orabug: 23641442
Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
9 years agoPCI: Mark Intel i40e NIC INTx masking as broken
Alex Williamson [Thu, 24 Mar 2016 19:03:49 +0000 (13:03 -0600)]
PCI: Mark Intel i40e NIC INTx masking as broken

Orabug: 23176970

All of the i40e (XL710/X710) 10/20/40GbE NICs lack support for indicating
INTx is asserted via the interrupt bit in the PCI status register.  The
DisINTx bit in the command register is functional, causing these devices to
be incorrectly detected as supporting INTx masking.  Quirk them to properly
indicate no INTx masking support.

Device IDs copied from i40e_devids.h.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: John Ronciak <john.ronciak@intel.com>
CC: Jesse Brandeburg <jesse.brandeburg@intel.com>
(cherry picked from commit 8bcf4525c5d43306c5fd07e132bc8650e3491aec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: fix an uninitialized variable bug
Dan Carpenter [Thu, 5 May 2016 13:18:02 +0000 (16:18 +0300)]
i40e: fix an uninitialized variable bug

Orabug: 23176970

We removed this initialization but it is required.  Let's put it back.

Fixes: 895106a577c4 ('i40e: trivial fixes')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1c306f7f62a38ee5f05f0ee994dfe82d654cf47c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Bump version from 1.5.10 to 1.5.16
Bimmy Pujari [Tue, 3 May 2016 22:13:20 +0000 (15:13 -0700)]
i40e: Bump version from 1.5.10 to 1.5.16

Orabug: 23176970

Signed-off-by: Bimmy Pujari <bimmy.pujari@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c74dff1aaaf2ee51368a0cbf2f903cc3d8690abc)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: don't add broadcast filter for VFs
Mitch Williams [Tue, 3 May 2016 22:13:19 +0000 (15:13 -0700)]
i40e: don't add broadcast filter for VFs

Orabug: 23176970

Now that all VSIs are configured to receive broadcasts as default, we
don't need to add a filter. This eliminates an annoying but harmless
error message each time VFs are created or reset.

Change-ID: I4cd6339684df45b0d2722133eeb84c14fa93ea19
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d96a83def2f70ea7b26268efdd44eb9f1e400171)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: properly report Rx packet hash
Mitch Williams [Tue, 3 May 2016 22:13:18 +0000 (15:13 -0700)]
i40e/i40evf: properly report Rx packet hash

Orabug: 23176970

This logic is inverted. If the RXHASH flag is set, then we should go
ahead and call skb_set_hash.

Change-ID: Ib2e30356dced1d3e939c8061ab6ad5bd94197e7c
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a876c3ba59a69a1d4ba240ee7cb50acf31116647)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: set context to use VSI RSS LUT for SR-IOV
Ashish Shah [Tue, 3 May 2016 22:13:17 +0000 (15:13 -0700)]
i40e: set context to use VSI RSS LUT for SR-IOV

Orabug: 23176970

For the SR-IOV VSIs, when the queue filtering section is valid,
the RSS LUT needs to be set to use the VSI specific lookup table
(otherwise it will use the PF RSS LUT table).

Change-ID: Ia9377cc818078238a75c3bdeade1b593a91b3480
Signed-off-by: Ashish Shah <ashish.n.shah@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 4b28cdba4859c2d1eb77144fe2383afb8daea1ca)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Correct UDP packet header for non_tunnel-ipv6
Akeem G Abodunrin [Tue, 3 May 2016 22:13:16 +0000 (15:13 -0700)]
i40e: Correct UDP packet header for non_tunnel-ipv6

Orabug: 23176970

This patch corrects Rx ptype payload layer for non_tunneled ipv6. It
should be layer 4 for UDP, instead of layer 3.

Change-ID: I9382e4458ab3c4e58f6d2e9f195d5d4ee513805e
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 73df8c9e3e3d1d5d38d48ba4bfb0f709f68c8e13)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: change Rx hang message into a WARN_ONCE
Jacob Keller [Tue, 3 May 2016 22:13:15 +0000 (15:13 -0700)]
i40e: change Rx hang message into a WARN_ONCE

Orabug: 23176970

Use WARN_ONCE in order to highlight the issue, but don't display
a warning every time. The user should be able to see the ethtool counter
we created if necessary to see how often it is occurring.

Change-ID: I40c4ea159819b64a7d33b7f5716749089791533a
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c420815d12b744ad8cf9312af13af794bad48216)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Refactor ethtool get_settings
Catherine Sullivan [Tue, 3 May 2016 22:13:14 +0000 (15:13 -0700)]
i40e: Refactor ethtool get_settings

Orabug: 23176970

Previously we were only looking at the FW supported PHY types if link
was down, because we want to be more specific when link is up. This
refactor changes this. When link is down, we still rely on the FW
supported PHY types, but when link is up, we select the possible
supported link modes from what we know about the current PHY type, and
AND that with the FW supported PHY types.

Change-ID: Ice5dad83f2a17932b0b8b59f07439696ad6aa013
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 06566e5dd4e53f57fc3daa12fb8b5252772d70de)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: lie to the VF
Mitch Williams [Tue, 3 May 2016 22:13:13 +0000 (15:13 -0700)]
i40e: lie to the VF

Orabug: 23176970

If an untrusted VF attempts to configure promiscuous mode, log a message
pointing out its naughty behavior. But then, instead of returning an
error to the offender, just lie to it and say everything's OK. It will
continue on its way, thinking it's in promiscuous mode, but receiving no
packets except its own.

Change-ID: I63369215b1720f3c531eedfc06af86ff8c0e3dc8
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit eee4172abcdcc610e40eb9513d19ff16c7820270)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add vf-true-promisc-support priv flag
Anjali Singhai Jain [Tue, 3 May 2016 22:13:12 +0000 (15:13 -0700)]
i40e: Add vf-true-promisc-support priv flag

Orabug: 23176970

This patch adds priv-flag knob to configure global true promisc
support. With this patch the user can decide the flavor of
promiscuous that the VFs will see when promiscuous mode is enabled
on the interface. Since this a global setting for the whole device,
the priv-flag is exposed only on the first PF of the device.

The default is true promisc support is off, which means the promisc
mode for the VF will be limited/defport mode.

For the PF, we still will be in limited promisc unless in MFP mode
irrespective of the flavor picked through this knob.

Usage:
On PF0
ethtool --show-priv-flags p261p1
Private flags for p261p1:
MFP                    : off
LinkPolling            : off
flow-director-atr      : on
veb-stats              : off
hw-atr-eviction        : off
vf-true-promisc-support: off

to enable setting true promisc
ethtool --set-priv-flags p261p1 vf-true-promisc-support on

At this point if the VF is set to trust and promisc is enabled
on the VF through
ip link set ... promisc on
The VF/VFs will be able to see ALL ingress traffic

Change-Id: I8fac4b6eb1af9ca77b5376b79c50bdce5055bd94
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b5569892309e2e62641076f43aef6919286343b4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c

9 years agoi40e: Implement the API function for aq_set_switch_config
Shannon Nelson [Tue, 3 May 2016 22:13:11 +0000 (15:13 -0700)]
i40e: Implement the API function for aq_set_switch_config

Orabug: 23176970

Add the support code for calling the AdminQ API call aq_set_switch_config

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f3d5849756f0da14edabb1835e35aea8b6bc7440)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add allmulti support for the VF
Anjali Singhai Jain [Tue, 3 May 2016 22:13:10 +0000 (15:13 -0700)]
i40e: Add allmulti support for the VF

Orabug: 23176970

This patch enables a feature to enable/disable all multicast
for a trusted VF.

Change-Id: I926eba7f8850c8d40f8ad7e08bbe4056bbd3985f
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f42a5c74da9996d602093d7760f6916444009a9d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for disabling all link and change bits needed for PHY interactions
Kevin Scott [Tue, 3 May 2016 22:13:09 +0000 (15:13 -0700)]
i40e: Add support for disabling all link and change bits needed for PHY interactions

Orabug: 23176970

Add flag to tell firmware to disable link on all ports.

This patch changes the bits set for telling firmware the PHY needs
to be modified by driver.  Without this patch, the setting will only
set that mode for the current port on the device.  Because the
MDIO interface is common for the copper device. The command needs to
set the mode for all ports.

Change-ID: I8baa7da91d384291ac95b41ae1a516604f8eb67f
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 06c0e39bbefd04b19ca50f29be698eeed21630b5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: constify i40e_client_ops structure
Julia Lawall [Sun, 1 May 2016 12:07:23 +0000 (14:07 +0200)]
i40e: constify i40e_client_ops structure

Orabug: 23176970

The i40e_client_ops structure is never modified, so declare it as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3949c4ac8cfa8ab3518a326c72eff1a2ff489bb9)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/infiniband/hw/i40iw/i40iw_main.c

9 years agoi40e: fix misleading indentation
Arnd Bergmann [Fri, 29 Apr 2016 17:44:05 +0000 (19:44 +0200)]
i40e: fix misleading indentation

Orabug: 23176970

Newly added code in i40e_vc_config_promiscuous_mode_msg() is indented
in a way that gcc rightly complains about:

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c: In function 'i40e_vc_config_promiscuous_mode_msg':
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1543:4: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
    if (f->vlan >= 0 && f->vlan <= I40E_MAX_VLANID)
    ^~
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c:1550:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
     aq_err = pf->hw.aq.asq_last_status;

From the context, it looks like the aq_err assignment was meant to be
inside of the conditional expression, so I'm adding the appropriate
curly braces now.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5676a8b9cd9a ("i40e: Add VF promiscuous mode driver support")
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ce927db48721235b3a08142b6d9f9a906e4e626f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Test memory before ethtool alloc succeeds
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:49 +0000 (11:33 -0700)]
i40e: Test memory before ethtool alloc succeeds

Orabug: 23176970

When testing on systems with very limited amounts of RAM, a bug was
found where, while changing the number of descriptors using ethtool,
the driver didn't test the limits of system memory before permanently
assuming it would be able to get receive buffer memory.

Work around this issue by pre-allocation of the receive buffer
memory, in the "ghost" ring, which is then used during reinit
using the new ring length.

Change-Id: I92d7a5fb59a6c884b2efdd1ec652845f101c3359
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 147e81ec7568933a51fe58b64244383e929870fb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Allocate Rx buffers properly
Mitch Williams [Mon, 18 Apr 2016 18:33:48 +0000 (11:33 -0700)]
i40evf: Allocate Rx buffers properly

Orabug: 23176970

Allocate the correct number of RX buffers, and don't fiddle with
next_to_use. The common RX code handles all of this. This fixes a memory
leak of one page each time the driver is opened.

Change-Id: Id06eca353086e084921f047acad28c14745684ee
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b163098ea1eece88a8834952dcbade1f17378731)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Remove unused hardware receive descriptor code
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:47 +0000 (11:33 -0700)]
i40e/i40evf: Remove unused hardware receive descriptor code

Orabug: 23176970

The hardware supports a 16 byte descriptor for receive, but the
driver was never using it in production.  There was no performance
benefit to the real driver of 16 byte descriptors, so drop a whole
lot of complexity while getting rid of the code.

Also since the previous patch made us use no-split mode all the
time, drop any support in the driver for any other value in dtype
and assume it is always zero (aka no-split).

Hooray for code removal!

Change-ID: I2257e902e4dad84a07b94db6d2e6f4ce69b27bc0
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bec60fc42b285344b027c87444c7fd6caade0ceb)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: refactor receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:46 +0000 (11:33 -0700)]
i40evf: refactor receive routine

Orabug: 23176970

This is part 2 of the Rx refactor series, just including
changes to i40evf.

This refactor aligns the receive routine with the one in
ixgbe which was highly optimized.  This reduces the code
we have to maintain and allows for (hopefully) more readable
and maintainable RX hot path.

In order to do this:
- consolidate the receive path into a single function that doesn't
  use packet split but *does* use pages for Rx buffers.
- remove the old _1buf routine
- consolidate several routines into helper functions
- remove VF ethtool control over packet split
- remove priv_flags interface since it is unused

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ab9ad98eb5f95b86490cc4c2ddbde5a0bc9bd5c6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40evf: Drop packet split receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:45 +0000 (11:33 -0700)]
i40evf: Drop packet split receive routine

Orabug: 23176970

As part of preparation for the rx-refactor, remove the
packet split receive routine and ancillary code.

Some of the split related context set up code stays in
i40e_virtchnl_pf.c in case an older VF driver tries to load
and still wants to use packet split.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 19b85e677df44b954c23a47395edf5a6c379771b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

9 years agoi40e: Refactor receive routine
Jesse Brandeburg [Thu, 21 Apr 2016 02:43:37 +0000 (19:43 -0700)]
i40e: Refactor receive routine

Orabug: 23176970

This is part 1 of the Rx refactor series, just including
changes to i40e.

This refactor aligns the receive routine with the one in
ixgbe which was highly optimized.  This reduces the code
we have to maintain and allows for (hopefully) more readable
and maintainable RX hot path.

In order to do this:
- consolidate the receive path into a single function that doesn't
  use packet split but *does* use pages for Rx buffers.
- remove the old _1buf routine
- consolidate several routines into helper functions
- remove ethtool control over packet split

Change-ID: I5ca100721de65992aa0114f8b4bac844b84758e0
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1a557afc4dd59b85a5cae2be6d351eaeb31d2664)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c

9 years agoi40e/i40evf: Remove reference to ring->dtype
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:43 +0000 (11:33 -0700)]
i40e/i40evf: Remove reference to ring->dtype

Orabug: 23176970

As part of the rx-refactor, the dtype variable in the i40e_ring
struct is no longer used, so remove it.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 04b3b779816502549e5f4bfaf5df90204ce2fe0e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Drop packet split receive routine
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:42 +0000 (11:33 -0700)]
i40e: Drop packet split receive routine

Orabug: 23176970

As part of preparation for the rx-refactor, remove the
packet split receive routine and ancillary code.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b32bfa17246d836125958e39996a674653e899a5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_txrx.c

9 years agoi40e/i40evf: Refactor tunnel interpretation
Jesse Brandeburg [Mon, 18 Apr 2016 18:33:41 +0000 (11:33 -0700)]
i40e/i40evf: Refactor tunnel interpretation

Orabug: 23176970

Refactor the interpretation of a tunnel.  This removes
some code and lets us start using the hardware's parsing.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit f8a952cb40407f3c127cab8ec77f1261f1e424b4)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: make use of BIT() macro to avoid signed left shift
Jacob Keller [Wed, 13 Apr 2016 23:08:27 +0000 (16:08 -0700)]
i40evf: make use of BIT() macro to avoid signed left shift

Orabug: 23176970

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ae63bff0d7f333677e7ec532e9c315c74a510403)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: make use of BIT() macro to prevent left shift of signed values
Jacob Keller [Wed, 13 Apr 2016 23:08:26 +0000 (16:08 -0700)]
i40e: make use of BIT() macro to prevent left shift of signed values

Orabug: 23176970

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2101bac2d4c26208fa0d1d9ffd8b83ad0199d61a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: fix I40E_MASK signed shift overflow warnings
Jacob Keller [Wed, 13 Apr 2016 23:08:25 +0000 (16:08 -0700)]
i40e/i40evf: fix I40E_MASK signed shift overflow warnings

Orabug: 23176970

GCC 6 has a new warning which will display when you attempt to left
shift a signed value beyond the storage size of the type. I40E_MASK
generates a mask value for 32bit registers. Properly typecast the mask
value and place the values in parenthesis to prevent macro expansion
issues.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit dcb57456e73f204beff12e4532aaf573d1115114)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf : Bump driver version from 1.5.5 to 1.5.10
Harshitha Ramamurthy [Wed, 13 Apr 2016 10:08:32 +0000 (03:08 -0700)]
i40e/i40evf : Bump driver version from 1.5.5 to 1.5.10

Orabug: 23176970

Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5a6fc256e7b64b3073688cc72fae357612cf31c6)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Update device ids for X722
Catherine Sullivan [Wed, 13 Apr 2016 10:08:31 +0000 (03:08 -0700)]
i40e: Update device ids for X722

Orabug: 23176970

Add a device ID for X722.

Change-Id: I574f2345ab341de98a6a1c212d0603af853e48b0
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a3aa5036cf3798c18fe22041fbfbac01642657e0)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Drop extra copy of function
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:30 +0000 (03:08 -0700)]
i40e: Drop extra copy of function

Orabug: 23176970

i40e_release_rx_desc was in two files, but was only used
and needed in txrx.c.  Get rid of the extra copy.

Change-Id: I86e18239aa03531fc198b6c052847475084a9200
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit de38fef610f4e72fdf506bb84ddb05b46f4bf653)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Use consistent type for vf_id
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:29 +0000 (03:08 -0700)]
i40e: Use consistent type for vf_id

Orabug: 23176970

The driver was all over the place using signed or unsigned types
for vf_id, when it should always be signed.

This fixes warnings of type unsafe comparisons from gcc with W=2.

Change-Id: I2cb681f83d0f68ca124d2e4131e4ac0d9f8a6b22
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a1b5a24fccc83430bb1fa6e0f9925fb8328abd34)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: PTP - avoid aggregate return warnings
Jesse Brandeburg [Wed, 13 Apr 2016 10:08:28 +0000 (03:08 -0700)]
i40e: PTP - avoid aggregate return warnings

Orabug: 23176970

Aggregate return warnings are when struct types are returned
and must be copied to the lvalue with a struct copy by the compiler.

This fixes warnings of type aggregate-return from gcc with W=2.

Change-Id: I896b1bf514544bf0faeb458869d79914b9f1b168
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit cdc3d93257e162dd12906a6e0207436c2d5c6873)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Fix uninitialized variable
Catherine Sullivan [Wed, 13 Apr 2016 10:08:27 +0000 (03:08 -0700)]
i40e: Fix uninitialized variable

Orabug: 23176970

We have an uninitialized variable warning for valid_len for one case in
validate_vf_mesg. To fix this, just initialize it to 0 at the top of the
function and remove all of the now redundant assignments to 0 in the
individual cases.

Change-Id: Iacbd97f4c521ed8d662eef803a598d8707708cfd
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 3ed439c56e0d82fd08275fff2c21278f92ed8ec5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: RSS Hash Option parameters
Carolyn Wyborny [Wed, 13 Apr 2016 10:08:26 +0000 (03:08 -0700)]
i40evf: RSS Hash Option parameters

Orabug: 23176970

This patch syncs the VF code for the changes made to the PF for the RSS
hash tuple settings.  Since the VF still cannot change the RSS hash
settings, change the code to make this clear to the user.  Previously,
the default settings were returned in this function. However, the
default can be changed by the PF so this does not make sense anymore.

Change-Id: I085eaf005fc7978b440d2a1bf2b2dd7cadaff39b
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b29699b39924db73993734a605665cf4bebef9ea)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove HMC AQ API implementation
Neerav Parikh [Sun, 1 May 2016 21:29:53 +0000 (14:29 -0700)]
i40e: Remove HMC AQ API implementation

Orabug: 23176970

Remove the code that implements the HMC AQ APIs and call these APIs.
This is done because these are obsolete APIs and are not supported
by firmware.

Change-ID: I5d771d8f37c3e16e7b0a972ff9b27e75aa2d05d4
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 2b79c58d80921acb7f784c340fd7532c4a8b8d95)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Limit the number of MAC and VLAN addresses that can be added for VFs
Anjali Singhai Jain [Wed, 13 Apr 2016 10:08:22 +0000 (03:08 -0700)]
i40e: Limit the number of MAC and VLAN addresses that can be added for VFs

Orabug: 23176970

If the VF is privileged/trusted it can do as it may please including
but not limited to hogging resources and playing unfair.
But if the VF is not privileged/trusted it still can add some number
(8) of MAC and VLAN addresses.
Other restrictions with respect to Port VLAN and normal VLAN still apply
to not privileged/trusted VF.

Change-Id: I3a9529201b184c8873e1ad2e300aff468c9e6296
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5f527ba962e277963b08f4c7f12fbeeac3f34e3c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Change the default for VFs to be not privileged
Anjali Singhai Jain [Thu, 26 May 2016 17:42:11 +0000 (13:42 -0400)]
i40e: Change the default for VFs to be not privileged

Orabug: 23176970

Make sure a VF is not trusted/privileged until its explicitly
set for trust through the new NDO op interface.

Change-Id: I476385c290d2b4901d8fceb29de43546accdc499
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(backport of commit 692fb0a75e816d2676f222c9db33e91f46ea1e03)

Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Add driver support for promiscuous mode
Anjali Singhai Jain [Tue, 12 Apr 2016 15:30:52 +0000 (08:30 -0700)]
i40evf: Add driver support for promiscuous mode

Orabug: 23176970

Add necessary Linux Ethernet driver support for promiscuous mode
operation. Add a flag so the VF knows it is in promiscuous mode
and two state flags to discreetly track multicast and unicast
promiscuous states.

Change-Id: Ib2f2dc7a7582304fec90fc917ebb7ded21ba1de4
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 47d3483988f649739ad8d6462eaa1723e5d077c3)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add VF promiscuous mode driver support
Anjali Singhai Jain [Tue, 12 Apr 2016 15:30:51 +0000 (08:30 -0700)]
i40e: Add VF promiscuous mode driver support

Orabug: 23176970

Add infrastructure for Network Function Virtualization VLAN tagged
packet steering feature.

Change-Id: I9b873d8fcc253858e6baba65ac68ec5b9363944e
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5676a8b9cd9a1c9822cdb3d88109f449eb2126c1)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add promiscuous on VLAN support
Greg Rose [Tue, 12 Apr 2016 15:30:50 +0000 (08:30 -0700)]
i40e: Add promiscuous on VLAN support

Orabug: 23176970

NFV use cases require the ability to steer packets to VSIs by VLAN tag
alone while being in promiscuous mode for multicast and unicast MAC
addresses.  These two new functions support that ability.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 6c41a7606967803702d0b5c2ba57acce71ec8d9d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Only offload VLAN tag if enabled
Jesse Brandeburg [Tue, 12 Apr 2016 15:30:49 +0000 (08:30 -0700)]
i40e/i40evf: Only offload VLAN tag if enabled

Orabug: 23176970

The driver was offloading the VLAN tag into the skb
any time there was a VLAN tag and the hardware stripping was
enabled.  Just check to make sure it's enabled before put_tag.

Change-Id: Ife95290c06edd9a616393b38679923938b382241
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit a149f2c323b62bc6cff91d874d853250250e8497)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Remove zero check
Greg Rose [Tue, 12 Apr 2016 15:30:48 +0000 (08:30 -0700)]
i40e: Remove zero check

Orabug: 23176970

A mirror rule ID may be zero so do not return invalid parameter when the
user passes in a zero value for a rule ID.

Change-ID: I261b8c24725ce2c6ed32f859da81093dfcbe2970
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit db0772782f6b99adbd8548e1d3830fe019c9f250)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add DeviceID for X722 QSFP+
Kamil Krawczyk [Tue, 12 Apr 2016 15:30:47 +0000 (08:30 -0700)]
i40e: Add DeviceID for X722 QSFP+

Orabug: 23176970

Change-ID: I1370fbc7774e815ac1ad56561e97488e829592fc
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bccf474435b668312e9fc8bd9586c2e256b66841)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add device capability which defines if update is available
Michal Kosiarz [Tue, 12 Apr 2016 15:30:46 +0000 (08:30 -0700)]
i40e: Add device capability which defines if update is available

Orabug: 23176970

Add device capability which defines if update is available and security
check is needed during update process.

Change-ID: I380787c878275e1df18b39198df3ee3666342282
Signed-off-by: Michal Kosiarz <michal.kosiarz@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 68a1c5a777f8e94d3bb0b0e287443492316ea5b5)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Allow PF driver to configure RSS
Mitch Williams [Tue, 12 Apr 2016 15:30:44 +0000 (08:30 -0700)]
i40evf: Allow PF driver to configure RSS

Orabug: 23176970

If the PF driver reports proper support, allow the PF driver to
configure RSS on the behalf of the VF driver. This will allow for RSS
support on future hardware without changes to the VF driver.

Unfortunately, the old RSS code still needs to stay as the driver needs
to be compatible with PF drivers that don't support this interface. But
this change still simplifies the data structures a bunch and makes this
code simpler to read and maintain.

Change-ID: I0375aad40788ecdc0cb24d5cfeccf07804e69771
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 43a3d9ba34c9ca313573201d3f45de5ab3494cec)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Specify AQ event opcode to wait for
Shannon Nelson [Tue, 12 Apr 2016 15:30:43 +0000 (08:30 -0700)]
i40e: Specify AQ event opcode to wait for

Orabug: 23176970

To add a little flexibility to the nvmupdate facility, this code adds the
ability to specify an AQ event opcode to wait on after the Exec_AQ request.

Change-ID: Iddbfd63c3de8df3edb9d3e90678b08989bc4946e
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit fed2db99824334b3a7219da6b45d70f448449d7d)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Code cleanup in i40e_add_fdir_ethtool
Shannon Nelson [Tue, 12 Apr 2016 15:30:42 +0000 (08:30 -0700)]
i40e: Code cleanup in i40e_add_fdir_ethtool

Orabug: 23176970

A little bit of code cleanup in prep for more cloud filter work.

Change-ID: I0dc33ce0d4c207944336a07437640fef920c100c
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bab3a34bb5f0b4056e37edf1bf6d097b147de453)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40evf: Don't Panic
Mitch Williams [Tue, 12 Apr 2016 15:30:41 +0000 (08:30 -0700)]
i40evf: Don't Panic

Orabug: 23176970

Under some circumstances the driver remove function may be called before
the driver is fully initialized. So we can't assume that we know where
our towel is at, or that all of the data structures are initialized.

To ensure that we don't panic, check that the vsi_res pointer is valid
before dereferencing it. Then drink beer and eat peanuts.

Change-ID: If697b4db57348e39f9538793e16aa755e3e1af03
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c0913c2e431c86026acba667f8655d90979bb79c)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add support for configuring VF RSS
Mitch Williams [Tue, 12 Apr 2016 15:30:40 +0000 (08:30 -0700)]
i40e: Add support for configuring VF RSS

Orabug: 23176970

Add support for configuring RSS on behalf of the VFs. This removes the
burden of dealing with different hardware interfaces from the VF
drivers, allowing for better future compatibility.

Change-ID: Icea75d3f37241ee8e447be5779e5abb53ddf04c0
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit c4e1868c3aa1992de1cba600e7083fcd49bd20b8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Add support for IPIP and SIT offloads
Alexander Duyck [Sat, 2 Apr 2016 07:06:56 +0000 (00:06 -0700)]
i40e/i40evf: Add support for IPIP and SIT offloads

Orabug: 23176970

Looking over the documentation it turns out enabling IPIP and SIT offloads
for i40e is pretty straightforward.  As such I decided to enable them with
this patch.  In my testing I am seeing an improvement of 8 to 10 Gb/s
for IPIP and SIT tunnels with this offload enabled.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 577389a5db766c44400e75e6a79f39d9b0d585f8)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Clean up feature flags
Alexander Duyck [Sat, 2 Apr 2016 07:05:14 +0000 (00:05 -0700)]
i40e/i40evf: Clean up feature flags

Orabug: 23176970

The feature flags list for i40e and i40evf is beginning to become pretty
massive.  I plan to add another 4 or so features to these drivers and
duplicating the flags for each and every flags list is becoming a bit
repetitive.

The primary change here is that we now build our features list around
hw_encap_features.  After that we assign that to vlan_features,
hw_features, and finally map that onto features.  In addition we end up
throwing features onto hw_encap_features that end up having no effect such
as the Rx offloads and SCTP_CRC.  However that should have no impact and
makes things a bit easier for us as hw_encap_features is one of the less
updated features maps available.

For i40evf I went through and sanity checked a few features as well.
Specifically RXCSUM was being set as a read-only feature which didn't make
much sense.  I have updated things so we can clear the NETIF_F_RXCSUM flag
since that is really a software feature and not a hardware one anyway so
disabling it is just a matter of ignoring the result from the hardware.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit b0fe3306432796c8f7adbede8ccd479bb7b53d0a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40evf/i40evf_main.c

9 years agoi40evf: properly handle VLAN features
Mitch Williams [Fri, 1 Apr 2016 20:34:31 +0000 (13:34 -0700)]
i40evf: properly handle VLAN features

Orabug: 23176970

Correctly set the VLAN feature flags after setting the rest of the
netdev flags. And don't set them in hw_features, because these can't be
controlled by the VF driver.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit ba6cc7f6f194e3645368f87d951bedd7e3b75f39)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Bump patch from 1.5.2 to 1.5.5
Harshitha Ramamurthy [Fri, 1 Apr 2016 10:56:13 +0000 (03:56 -0700)]
i40e/i40evf: Bump patch from 1.5.2 to 1.5.5

Orabug: 23176970

Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 47c46778e1905721433a413b2522a8e2b3d6c354)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Input set mask constants for RSS, flow director, and flex bytes
Kiran Patil [Mon, 4 Apr 2016 14:01:10 +0000 (07:01 -0700)]
i40e: Input set mask constants for RSS, flow director, and flex bytes

Orabug: 23176970

Add defines for input set mask (RSS, flow director, flexible payload),
including defines specific to IPv6.

Change-ID: Ie95ef7d0916a4d6ca011c194283f959774c8dce9
Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 17a035be959ef0316ec86adb0c82ed3f057a853b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move NVM event wait check to NVM code
Shannon Nelson [Fri, 1 Apr 2016 10:56:11 +0000 (03:56 -0700)]
i40e: Move NVM event wait check to NVM code

Orabug: 23176970

The logic that checks AQ events for NVM done events is better kept
in nvm.c with the rest of the nvmupdate handling code.

Change-ID: I2ea58980df8ecaa3726b28a37bff3dfcb8df03dc
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit bab2fb60dcdd0f9d8715749d056ddd6c465b1875)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Add RSS configuration to virtual channel
Mitch Williams [Fri, 1 Apr 2016 10:56:10 +0000 (03:56 -0700)]
i40e: Add RSS configuration to virtual channel

Orabug: 23176970

Add opcodes and structures to support RSS configuration by PF driver on
behalf of the VF drivers. This reduces complexity in the VF driver and
allows us to support future hardware designs without modifying the VF
driver.

Change-ID: I8c75765c630eacb71f95967f1109a198542593ac
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 585954f8b808def857771037392c1621f167fa92)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Move NVM variable out of AQ struct
Shannon Nelson [Fri, 1 Apr 2016 10:56:09 +0000 (03:56 -0700)]
i40e: Move NVM variable out of AQ struct

Orabug: 23176970

The NVM update status info should stay collected together, not
spread across different structs.

Change-ID: Ic16f9e9fd79945d865bb7226184c889884585025
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 437f82a2290ed94f0d6a86b749101f1ad5ed6231)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e: Restrict VF poll mode to only single function mode devices
Shannon Nelson [Fri, 1 Apr 2016 10:56:08 +0000 (03:56 -0700)]
i40e: Restrict VF poll mode to only single function mode devices

Orabug: 23176970

The VFs can request their queues to be set up into polling mode, rather
than interrupt mode, which works well for supporting things like DPDK,
but this should not be available when working in an multi-function
support device.

Change-ID: Id36792e4e7422db8f2033336507211f68f14ff6f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 14c5f5d264c3ee28e8ec9fd4dffb29f5d1ea1d02)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Faster RX via avoiding FCoE
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:06 +0000 (03:56 -0700)]
i40e/i40evf: Faster RX via avoiding FCoE

Orabug: 23176970

As it turns out, calling into other files from hot path hurts
performance a lot.  In this case the majority of the time we
call "check FCoE" and the packet is *not* FCoE, but this call
was taking 5% of our total cycles spent on receive.

Change-ID: I080552c26e7060bc7b78504dc2763f6f0b3d8c76
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 1f15d66712bb64e39fe2c23b1b32f68f9e1d4ee7)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Drop unused tx_ring argument
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:05 +0000 (03:56 -0700)]
i40e/i40evf: Drop unused tx_ring argument

Orabug: 23176970

Some of the tx_ring arguments can be deleted since they are not used.

Change-ID: I99275b0f191d7f63ec2f05061919904940c36f31
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 84b079928a10559ebc6679e1e973a3ee5b20ba83)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
9 years agoi40e/i40evf: Move stack var deeper
Jesse Brandeburg [Fri, 1 Apr 2016 10:56:04 +0000 (03:56 -0700)]
i40e/i40evf: Move stack var deeper

Orabug: 23176970

A local variable could move down inside the context where it is used.

Change-ID: I9caba9e1eacf921037077f2665cbce83fd8e95d6
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit d1bd743b5b4d675e739b574284d1412ba996fe07)
Signed-off-by: Brian Maly <brian.maly@oracle.com>