cascardo/linux.git
9 years agobnx2: disable toggling of rxvlan if necessary
Ivan Vecera [Thu, 26 Feb 2015 13:48:07 +0000 (14:48 +0100)]
bnx2: disable toggling of rxvlan if necessary

The bnx2 driver uses .ndo_fix_features to force enable of Rx VLAN tag
stripping when the card cannot disable it. The driver should remove
NETIF_F_HW_VLAN_CTAG_RX flag from hw_features instead so it is fixed
for the ethtool.

Cc: Sony Chacko <sony.chacko@qlogic.com>
Cc: Dept-HSGLinuxNICDev@qlogic.com
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: macb: Properly add DMACFG bit definitions
Arun Chandran [Sun, 1 Mar 2015 06:08:03 +0000 (11:38 +0530)]
net: macb: Properly add DMACFG bit definitions

Add *_SIZE macros for the bits ENDIA_DESC and
ENDIA_PKT

Signed-off-by: Arun Chandran <achandran@mvista.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: macb: Add on the fly CPU endianness detection
Arun Chandran [Sun, 1 Mar 2015 06:08:02 +0000 (11:38 +0530)]
net: macb: Add on the fly CPU endianness detection

Program management descriptor's access mode according to the
dynamically detected CPU endianness.

Signed-off-by: Arun Chandran <achandran@mvista.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoDriver: Vmxnet3: Copy TCP header to mapped frame for IPv6 packets
Shrikrishna Khare [Sun, 1 Mar 2015 04:33:09 +0000 (20:33 -0800)]
Driver: Vmxnet3: Copy TCP header to mapped frame for IPv6 packets

Allows for packet parsing to be done by the fast path. This performance
optimization already exists for IPv4. Add similar logic for IPv6.

Signed-off-by: Amitabha Banerjee <banerjeea@vmware.com>
Signed-off-by: Shrikrishna Khare <skhare@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'ebpf_support_for_cls_bpf'
David S. Miller [Sun, 1 Mar 2015 19:05:24 +0000 (14:05 -0500)]
Merge branch 'ebpf_support_for_cls_bpf'

Daniel Borkmann says:

====================
eBPF support for cls_bpf

This is the non-RFC version of my patchset posted before netdev01 [1]
conference. It contains a couple of eBPF cleanups and preparation
patches to get eBPF support into cls_bpf. The last patch adds the
actual support. I'll post the iproute2 parts after the kernel bits
are merged, an initial preview link to the code is mentioned in the
last patch.

Patch 4 and 5 were originally one patch, but I've split them into
two parts upon request as patch 4 only is also needed for Alexei's
tracing patches that go via tip tree.

Tested with tc and all in-kernel available BPF test suites.

I have configured and built LLVM with --enable-experimental-targets=BPF
but as Alexei put it, the plan is to get rid of the experimental
status in future [2].

Thanks a lot!

v1 -> v2:
 - Removed arch patches from this series
  - x86 is already queued in tip tree, under x86/mm
  - arm64 just reposted directly to arm folks
 - Rest is unchanged

  [1] http://thread.gmane.org/gmane.linux.network/350191
  [2] http://article.gmane.org/gmane.linux.kernel/1874969
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocls_bpf: add initial eBPF support for programmable classifiers
Daniel Borkmann [Sun, 1 Mar 2015 11:31:48 +0000 (12:31 +0100)]
cls_bpf: add initial eBPF support for programmable classifiers

This work extends the "classic" BPF programmable tc classifier by
extending its scope also to native eBPF code!

This allows for user space to implement own custom, 'safe' C like
classifiers (or whatever other frontend language LLVM et al may
provide in future), that can then be compiled with the LLVM eBPF
backend to an eBPF elf file. The result of this can be loaded into
the kernel via iproute2's tc. In the kernel, they can be JITed on
major archs and thus run in native performance.

Simple, minimal toy example to demonstrate the workflow:

  #include <linux/ip.h>
  #include <linux/if_ether.h>
  #include <linux/bpf.h>

  #include "tc_bpf_api.h"

  __section("classify")
  int cls_main(struct sk_buff *skb)
  {
    return (0x800 << 16) | load_byte(skb, ETH_HLEN + __builtin_offsetof(struct iphdr, tos));
  }

  char __license[] __section("license") = "GPL";

The classifier can then be compiled into eBPF opcodes and loaded
via tc, for example:

  clang -O2 -emit-llvm -c cls.c -o - | llc -march=bpf -filetype=obj -o cls.o
  tc filter add dev em1 parent 1: bpf cls.o [...]

As it has been demonstrated, the scope can even reach up to a fully
fledged flow dissector (similarly as in samples/bpf/sockex2_kern.c).

For tc, maps are allowed to be used, but from kernel context only,
in other words, eBPF code can keep state across filter invocations.
In future, we perhaps may reattach from a different application to
those maps e.g., to read out collected statistics/state.

Similarly as in socket filters, we may extend functionality for eBPF
classifiers over time depending on the use cases. For that purpose,
cls_bpf programs are using BPF_PROG_TYPE_SCHED_CLS program type, so
we can allow additional functions/accessors (e.g. an ABI compatible
offset translation to skb fields/metadata). For an initial cls_bpf
support, we allow the same set of helper functions as eBPF socket
filters, but we could diverge at some point in time w/o problem.

I was wondering whether cls_bpf and act_bpf could share C programs,
I can imagine that at some point, we introduce i) further common
handlers for both (or even beyond their scope), and/or if truly needed
ii) some restricted function space for each of them. Both can be
abstracted easily through struct bpf_verifier_ops in future.

The context of cls_bpf versus act_bpf is slightly different though:
a cls_bpf program will return a specific classid whereas act_bpf a
drop/non-drop return code, latter may also in future mangle skbs.
That said, we can surely have a "classify" and "action" section in
a single object file, or considered mentioned constraint add a
possibility of a shared section.

The workflow for getting native eBPF running from tc [1] is as
follows: for f_bpf, I've added a slightly modified ELF parser code
from Alexei's kernel sample, which reads out the LLVM compiled
object, sets up maps (and dynamically fixes up map fds) if any, and
loads the eBPF instructions all centrally through the bpf syscall.

The resulting fd from the loaded program itself is being passed down
to cls_bpf, which looks up struct bpf_prog from the fd store, and
holds reference, so that it stays available also after tc program
lifetime. On tc filter destruction, it will then drop its reference.

Moreover, I've also added the optional possibility to annotate an
eBPF filter with a name (e.g. path to object file, or something
else if preferred) so that when tc dumps currently installed filters,
some more context can be given to an admin for a given instance (as
opposed to just the file descriptor number).

Last but not least, bpf_prog_get() and bpf_prog_put() needed to be
exported, so that eBPF can be used from cls_bpf built as a module.
Thanks to 60a3b2253c41 ("net: bpf: make eBPF interpreter images
read-only") I think this is of no concern since anything wanting to
alter eBPF opcode after verification stage would crash the kernel.

  [1] http://git.breakpoint.cc/cgit/dborkman/iproute2.git/log/?h=ebpf

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: move read-only fields to bpf_prog and shrink bpf_prog_aux
Daniel Borkmann [Sun, 1 Mar 2015 11:31:47 +0000 (12:31 +0100)]
ebpf: move read-only fields to bpf_prog and shrink bpf_prog_aux

is_gpl_compatible and prog_type should be moved directly into bpf_prog
as they stay immutable during bpf_prog's lifetime, are core attributes
and they can be locked as read-only later on via bpf_prog_select_runtime().

With a bit of rearranging, this also allows us to shrink bpf_prog_aux
to exactly 1 cacheline.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: add sched_cls_type and map it to sk_filter's verifier ops
Daniel Borkmann [Sun, 1 Mar 2015 11:31:46 +0000 (12:31 +0100)]
ebpf: add sched_cls_type and map it to sk_filter's verifier ops

As discussed recently and at netconf/netdev01, we want to prevent making
bpf_verifier_ops registration available for modules, but have them at a
controlled place inside the kernel instead.

The reason for this is, that out-of-tree modules can go crazy and define
and register any verfifier ops they want, doing all sorts of crap, even
bypassing available GPLed eBPF helper functions. We don't want to offer
such a shiny playground, of course, but keep strict control to ourselves
inside the core kernel.

This also encourages us to design eBPF user helpers carefully and
generically, so they can be shared among various subsystems using eBPF.

For the eBPF traffic classifier (cls_bpf), it's a good start to share
the same helper facilities as we currently do in eBPF for socket filters.

That way, we have BPF_PROG_TYPE_SCHED_CLS look like it's own type, thus
one day if there's a good reason to diverge the set of helper functions
from the set available to socket filters, we keep ABI compatibility.

In future, we could place all bpf_prog_type_list at a central place,
perhaps.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter code
Daniel Borkmann [Sun, 1 Mar 2015 11:31:45 +0000 (12:31 +0100)]
ebpf: remove CONFIG_BPF_SYSCALL ifdefs in socket filter code

This gets rid of CONFIG_BPF_SYSCALL ifdefs in the socket filter code,
now that the BPF internal header can deal with it.

While going over it, I also changed eBPF related functions to a sk_filter
prefix to be more consistent with the rest of the file.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs
Daniel Borkmann [Sun, 1 Mar 2015 11:31:44 +0000 (12:31 +0100)]
ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs

Socket filter code and other subsystems with upcoming eBPF support should
not need to deal with the fact that we have CONFIG_BPF_SYSCALL defined or
not.

Having the bpf syscall as a config option is a nice thing and I'd expect
it to stay that way for expert users (I presume one day the default setting
of it might change, though), but code making use of it should not care if
it's actually enabled or not.

Instead, hide this via header files and let the rest deal with it.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: export BPF_PSEUDO_MAP_FD to uapi
Daniel Borkmann [Sun, 1 Mar 2015 11:31:43 +0000 (12:31 +0100)]
ebpf: export BPF_PSEUDO_MAP_FD to uapi

We need to export BPF_PSEUDO_MAP_FD to user space, as it's used in the
ELF BPF loader where instructions are being loaded that need map fixups.

An initial stage loads all maps into the kernel, and later on replaces
related instructions in the eBPF blob with BPF_PSEUDO_MAP_FD as source
register and the actual fd as immediate value.

The kernel verifier recognizes this keyword and replaces the map fd with
a real pointer internally.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: constify various function pointer structs
Daniel Borkmann [Sun, 1 Mar 2015 11:31:42 +0000 (12:31 +0100)]
ebpf: constify various function pointer structs

We can move bpf_map_ops and bpf_verifier_ops and other structs into ro
section, bpf_map_type_list and bpf_prog_type_list into read mostly.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoebpf: remove kernel test stubs
Daniel Borkmann [Sun, 1 Mar 2015 11:31:41 +0000 (12:31 +0100)]
ebpf: remove kernel test stubs

Now that we have BPF_PROG_TYPE_SOCKET_FILTER up and running, we can
remove the test stubs which were added to get the verifier suite up.

We can just let the test cases probe under socket filter type instead.
In the fill/spill test case, we cannot (yet) access fields from the
context (skb), but we may adapt that test case in future.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 's390-next'
David S. Miller [Sun, 1 Mar 2015 04:39:05 +0000 (23:39 -0500)]
Merge branch 's390-next'

Ursula Braun says:

====================
s390: network patches for net-next

here are some s390 related patches for net-next
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMAINTAINERS: update S390 NETWORK DRIVERS maintainer
Ursula Braun [Fri, 27 Feb 2015 11:52:34 +0000 (12:52 +0100)]
MAINTAINERS: update S390 NETWORK DRIVERS maintainer

remove Frank Blaschka as S390 NETWORK DRIVERS maintainer

Acked-by: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoqeth: Fix command sizes
Stefan Raspl [Fri, 27 Feb 2015 11:52:33 +0000 (12:52 +0100)]
qeth: Fix command sizes

This patch adjusts two instances where we were using the (too big)
struct qeth_ipacmd_setadpparms size instead of the commands' actual
size. This didn't do any harm, but wasted a few bytes.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agos390: remove claw driver
Ursula Braun [Fri, 27 Feb 2015 11:52:32 +0000 (12:52 +0100)]
s390: remove claw driver

claw devices are outdated and no longer supported.
This patch removes the claw driver.

Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: cleanup static functions
Eric Dumazet [Fri, 27 Feb 2015 03:08:59 +0000 (19:08 -0800)]
tcp: cleanup static functions

tcp_fastopen_create_child() is static and should not be exported.

tcp4_gso_segment() and tcp6_gso_segment() should be static.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agohyperv: Implement netvsc_get_channels() ethool op
Andrew Schwartzmeyer [Fri, 27 Feb 2015 00:27:14 +0000 (16:27 -0800)]
hyperv: Implement netvsc_get_channels() ethool op

This adds support for reporting the actual and maximum combined channels
count of the hv_netvsc driver via 'ethtool --show-channels'.

This required adding 'max_chn' to 'struct netvsc_device', and assigning
it 'rsscap.num_recv_que' in 'rndis_filter_device_add'. Now we can access
the combined maximum channel count via 'struct netvsc_device' in the
ethtool callback.

Signed-off-by: Andrew Schwartzmeyer <andrew@schwartzmeyer.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'tcp-tso'
David S. Miller [Sat, 28 Feb 2015 20:10:47 +0000 (15:10 -0500)]
Merge branch 'tcp-tso'

Eric Dumazet says:

====================
tcp: tso improvements

This patch serie reworks tcp_tso_should_defer() a bit
to get less bursts, and better ECN behavior.

We also removed tso_deferred field in tcp socket.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: tso: allow CA_CWR state in tcp_tso_should_defer()
Eric Dumazet [Thu, 26 Feb 2015 22:10:20 +0000 (14:10 -0800)]
tcp: tso: allow CA_CWR state in tcp_tso_should_defer()

Another TCP issue is triggered by ECN.

Under pressure, receiver gets ECN marks, and send back ACK packets
with ECE TCP flag. Senders enter CA_CWR state.

In this state, tcp_tso_should_defer() is short cut :

if (icsk->icsk_ca_state != TCP_CA_Open)
    goto send_now;

This means that about all ACK packets we receive are triggering
a partial send, and because cwnd is kept small, we can only send
a small amount of data for each incoming ACK,
which in return generate more ACK packets.

Allowing CA_Open and CA_CWR states to enable TSO defer in
tcp_tso_should_defer() brings performance back :
TSO autodefer has more chance to defer under pressure.

This patch increases TSO and LRO/GRO efficiency back to normal levels,
and does not impact overall ECN behavior.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: tso: restore IW10 after TSO autosizing
Eric Dumazet [Thu, 26 Feb 2015 22:10:19 +0000 (14:10 -0800)]
tcp: tso: restore IW10 after TSO autosizing

With sysctl_tcp_min_tso_segs being 4, it is very possible
that tcp_tso_should_defer() decides not sending last 2 MSS
of initial window of 10 packets. This also applies if
autosizing decides to send X MSS per GSO packet, and cwnd
is not a multiple of X.

This patch implements an heuristic based on age of first
skb in write queue : If it was sent very recently (less than half srtt),
we can predict that no ACK packet will come in less than half rtt,
so deferring might cause an under utilization of our window.

This is visible on initial send (IW10) on web servers,
but more generally on some RPC, as the last part of the message
might need an extra RTT to get delivered.

Tested:

Ran following packetdrill test
// A simple server-side test that sends exactly an initial window (IW10)
// worth of packets.

`sysctl -e -q net.ipv4.tcp_min_tso_segs=4`

0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0    setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0    bind(3, ..., ...) = 0
+0    listen(3, 1) = 0

+.1   < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 7>
+0    > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 6>
+.1   < . 1:1(0) ack 1 win 257
+0    accept(3, ..., ...) = 4

+0    write(4, ..., 14600) = 14600
+0    > . 1:5841(5840) ack 1 win 457
+0    > . 5841:11681(5840) ack 1 win 457
// Following packet should be sent right now.
+0    > P. 11681:14601(2920) ack 1 win 457

+.1   < . 1:1(0) ack 14601 win 257

+0    close(4) = 0
+0    > F. 14601:14601(0) ack 1
+.1   < F. 1:1(0) ack 14602 win 257
+0    > . 14602:14602(0) ack 2

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: tso: remove tp->tso_deferred
Eric Dumazet [Thu, 26 Feb 2015 22:10:18 +0000 (14:10 -0800)]
tcp: tso: remove tp->tso_deferred

TSO relies on ability to defer sending a small amount of packets.
Heuristic is to wait for future ACKS in hope to send more packets at once.
Current algorithm uses a per socket tso_deferred field as a pseudo timer.

This pseudo timer relies on future ACK, but there is no guarantee
we receive them in time.

Fix would be to use a real timer, but cost of such timer is probably too
expensive for typical cases.

This patch changes the logic to test the time of last transmit,
because we should not add bursts of more than 1ms for any given flow.

We've used this patch for about two years at Google, before FQ/pacing
as it would reduce a fair amount of bursts.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agousbnet: Fix tx_packets stat for FLAG_MULTI_FRAME drivers
Ben Hutchings [Thu, 26 Feb 2015 19:34:37 +0000 (19:34 +0000)]
usbnet: Fix tx_packets stat for FLAG_MULTI_FRAME drivers

Currently the usbnet core does not update the tx_packets statistic for
drivers with FLAG_MULTI_PACKET and there is no hook in the TX
completion path where they could do this.

cdc_ncm and dependent drivers are bumping tx_packets stat on the
transmit path while asix and sr9800 aren't updating it at all.

Add a packet count in struct skb_data so these drivers can fill it
in, initialise it to 1 for other drivers, and add the packet count
to the tx_packets statistic on completion.

Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Tested-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'tipc-next'
David S. Miller [Fri, 27 Feb 2015 23:18:52 +0000 (18:18 -0500)]
Merge branch 'tipc-next'

Erik Hugne says:

====================
tipc: bug fix and some improvements

Most important is a fix for a nullptr exception that would occur when
name table subscriptions fail. The remaining patches are performance
improvements and cosmetic changes.

v2: remove unnecessary whitespace in patch #2
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotipc: make media address offset a common define
Erik Hugne [Fri, 27 Feb 2015 07:56:58 +0000 (08:56 +0100)]
tipc: make media address offset a common define

With the exception of infiniband media which does not use media
offsets, the media address is always located at offset 4 in the
media info field as defined by the protocol, so we move the
definition to the generic bearer.h

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotipc: rename media/msg related definitions
Erik Hugne [Fri, 27 Feb 2015 07:56:57 +0000 (08:56 +0100)]
tipc: rename media/msg related definitions

The TIPC_MEDIA_ADDR_SIZE and TIPC_MEDIA_ADDR_OFFSET names
are misleading, as they actually define the size and offset of
the whole media info field and not the address part. This patch
does not have any functional changes.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotipc: purge links when bearer is disabled
Erik Hugne [Fri, 27 Feb 2015 07:56:56 +0000 (08:56 +0100)]
tipc: purge links when bearer is disabled

If a bearer is disabled by manual intervention, all links over that
bearer should be purged, indicated with the 'shutting_down' flag.
Otherwise tipc will get confused if a new bearer is enabled using
a different media type.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotipc: fix nullpointer bug when subscribing to events
Erik Hugne [Fri, 27 Feb 2015 07:56:55 +0000 (08:56 +0100)]
tipc: fix nullpointer bug when subscribing to events

If a subscription request is sent to a topology server
connection, and any error occurs (malformed request, oom
or limit reached) while processing this request, TIPC should
terminate the subscriber connection. While doing so, it tries
to access fields in an already freed (or never allocated)
subscription element leading to a nullpointer exception.
We fix this by removing the subscr_terminate function and
terminate the connection immediately upon any subscription
failure.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotipc: only create header copy for name distr messages
Erik Hugne [Fri, 27 Feb 2015 07:56:54 +0000 (08:56 +0100)]
tipc: only create header copy for name distr messages

The TIPC name distributor pushes topology updates to the cluster
neighbors. Currently this is done in a unicast manner, and the
skb holding the update is cloned for each cluster member. This
is unnecessary, as we only modify the destnode field in the header
so we change it to do pskb_copy instead.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoteam: allow TSO being set on master
Jiri Pirko [Wed, 25 Feb 2015 18:52:11 +0000 (19:52 +0100)]
team: allow TSO being set on master

This patch allows TSO being set/unset on the master, so that GSO
segmentation is done after team layer.

Similar patch is present for bonding:
b0ce3508b25e ("bonding: allow TSO being set on bonding master")
and bridge:
f902e8812ef6 ("bridge: Add ability to enable TSO")

Suggested-by: Jiri Prochazka <jprochaz@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'fib_trie_remove_leaf_info'
David S. Miller [Fri, 27 Feb 2015 21:37:23 +0000 (16:37 -0500)]
Merge branch 'fib_trie_remove_leaf_info'

Alexander Duyck says:

====================
fib_trie: Remove leaf_info structure

This patch set removes the leaf_info structure from the IPv4 fib_trie.  The
general idea is that the leaf_info structure itself only held about 6
actual bits of data, beyond that it was mostly just waste.  As such we can
drop the structure, move the 1 byte representing the prefix/suffix length
into the fib_alias and just link it all into one list.

My testing shows that this saves somewhere between 4 to 10ns depending on
the type of test performed.  I'm suspecting that this represents 1 to 2 L1
cache misses saved per look-up.

One side effect of this change is that semantic_match_miss will now only
increment once per leaf instead of once per leaf_info miss.  However the
stat is already skewed now that we perform a preliminary check on the leaf
as a part of the look-up.

I also have gone through and addressed a number of ordering issues in the
first patch since I had misread the behavior of list_add_tail.

I have since run some additional testing and verified the resulting lists
are in the same order when combining multiple prefix length and tos values
in a single leaf.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agofib_trie: Remove leaf_info
Alexander Duyck [Wed, 25 Feb 2015 23:31:51 +0000 (15:31 -0800)]
fib_trie: Remove leaf_info

At this point the leaf_info hash is redundant.  By adding the suffix length
to the fib_alias hash list we no longer have need of leaf_info as we can
determine the prefix length from fa_slen.  So we can compress things by
dropping the leaf_info structure from fib_trie and instead directly connect
the leaves to the fib_alias hash list.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agofib_trie: Add slen to fib alias
Alexander Duyck [Wed, 25 Feb 2015 23:31:44 +0000 (15:31 -0800)]
fib_trie: Add slen to fib alias

Make use of an empty spot in the alias to store the suffix length so that
we don't need to pull that information from the leaf_info structure.

This patch also makes a slight change to the user statistics.  Instead of
incrementing semantic_match_miss once per leaf_info miss we now just
increment it once per leaf if a match was not found.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agofib_trie: Replace plen with slen in leaf_info
Alexander Duyck [Wed, 25 Feb 2015 23:31:37 +0000 (15:31 -0800)]
fib_trie: Replace plen with slen in leaf_info

This replaces the prefix length variable in the leaf_info structure with a
suffix length value, or host identifier length in bits.  By doing this it
makes it easier to sort out since the tnodes and leaf are carrying this
value as well since it is compatible with the ->pos field in tnodes.

I also cleaned up one spot that had some list manipulation that could be
simplified.  I basically updated it so that we just use hlist_add_head_rcu
instead of calling hlist_add_before_rcu on the first node in the list.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agofib_trie: Convert fib_alias to hlist from list
Alexander Duyck [Wed, 25 Feb 2015 23:31:31 +0000 (15:31 -0800)]
fib_trie: Convert fib_alias to hlist from list

There isn't any advantage to having it as a list and by making it an hlist
we make the fib_alias more compatible with the list_info in terms of the
type of list used.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'ip_level_multicast_join_leave'
David S. Miller [Fri, 27 Feb 2015 21:25:30 +0000 (16:25 -0500)]
Merge branch 'ip_level_multicast_join_leave'

Madhu Challa says:

====================
Multicast group join/leave at ip level

This series enables configuring multicast group join/leave at ip level
by extending the "ip address" command.

It adds a new control socket mc_autojoin_sock and ifa_flag IFA_F_MCAUTOJOIN
to invoke the corresponding igmp group join/leave api.

Since the igmp group join/leave api takes the rtnl_lock the code had to
be refactored by adding a shim layer prefixed by __ that can be invoked
by code that already has the rtnl_lock. This way we avoid proliferation of
work queues.

The first patch in this series does the refactoring for igmp v6.
Its based on igmp v4 changes that were added by Eric Dumazet.

The second patch in this series does the group join/leave based on the
setting of the IFA_F_MCAUTOJOIN flag.

v5:
- addressed comments from Daniel Borkmann.
 - removed blank line in patch 1/2
 - removed unused variable, const arg in patch 2/2
v4:
- addressed comments from Yoshifuji Hideaki.
 - Remove WARN_ON not needed because we return a value from v2.
- addressed comments from Daniel Borkmann.
 - rename sock to mc_autojoin_sk
 - ip_mc_config() pass ifa so it needs one less argument.
 - igmp_net_{init|destroy}() use inet_ctl_sock_{create|destroy}
 - inet_rtm_newaddr() change scope of ret.
 - igmp_net_init() no need to initialize sock to NULL.
v3:
- addressed comments from David Miller.
 - fixed indentation and local variable order.
v2:
- addressed comments from Eric Dumazet.
 - removed workqueue and call __ip_mc_{join|leave}_group or
   __ipv6_sock_mc_{join|drop}
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomulticast: Extend ip address command to enable multicast group join/leave on
Madhu Challa [Wed, 25 Feb 2015 17:58:35 +0000 (09:58 -0800)]
multicast: Extend ip address command to enable multicast group join/leave on

Joining multicast group on ethernet level via "ip maddr" command would
not work if we have an Ethernet switch that does igmp snooping since
the switch would not replicate multicast packets on ports that did not
have IGMP reports for the multicast addresses.

Linux vxlan interfaces created via "ip link add vxlan" have the group option
that enables then to do the required join.

By extending ip address command with option "autojoin" we can get similar
functionality for openvswitch vxlan interfaces as well as other tunneling
mechanisms that need to receive multicast traffic. The kernel code is
structured similar to how the vxlan driver does a group join / leave.

example:
ip address add 224.1.1.10/24 dev eth5 autojoin
ip address del 224.1.1.10/24 dev eth5

Signed-off-by: Madhu Challa <challa@noironetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoigmp v6: add __ipv6_sock_mc_join and __ipv6_sock_mc_drop
Madhu Challa [Wed, 25 Feb 2015 17:58:34 +0000 (09:58 -0800)]
igmp v6: add __ipv6_sock_mc_join and __ipv6_sock_mc_drop

Based on the igmp v4 changes from Eric Dumazet.
959d10f6bbf6("igmp: add __ip_mc_{join|leave}_group()")

These changes are needed to perform igmp v6 join/leave while
RTNL is held.

Make ipv6_sock_mc_join and ipv6_sock_mc_drop wrappers around
__ipv6_sock_mc_join and  __ipv6_sock_mc_drop to avoid
proliferation of work queues.

Signed-off-by: Madhu Challa <challa@noironetworks.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoudp: In udp_flow_src_port use random hash value if skb_get_hash fails
Tom Herbert [Tue, 24 Feb 2015 17:17:31 +0000 (09:17 -0800)]
udp: In udp_flow_src_port use random hash value if skb_get_hash fails

In the unlikely event that skb_get_hash is unable to deduce a hash
in udp_flow_src_port we use a consistent random value instead.
This is specified in GRE/UDP draft section 3.2.1:
https://tools.ietf.org/html/draft-ietf-tsvwg-gre-in-udp-encap-04

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobridge: fix link notification skb size calculation to include vlan ranges
Roopa Prabhu [Thu, 26 Feb 2015 07:55:40 +0000 (23:55 -0800)]
bridge: fix link notification skb size calculation to include vlan ranges

my previous patch skipped vlan range optimizations during skb size
calculations for simplicity.

This incremental patch considers vlan ranges during
skb size calculations. This leads to a bit of code duplication
in the fill and size calculation functions. But, I could not find a
prettier way to do this. will take any suggestions.

Previously, I had reused the existing br_get_link_af_size size calculation
function to calculate skb size for notifications. Reusing it this time
around creates some change in behaviour issues for the usual
.get_link_af_size callback.

This patch adds a new br_get_link_af_size_filtered() function to
base the size calculation on the incoming filter flag and include
vlan ranges.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Reviewed-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'rocker-next'
David S. Miller [Thu, 26 Feb 2015 16:22:03 +0000 (11:22 -0500)]
Merge branch 'rocker-next'

Scott Feldman says:

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

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

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorocker: put port in FORWADING state after leaving bridge
Scott Feldman [Thu, 26 Feb 2015 04:15:38 +0000 (20:15 -0800)]
rocker: put port in FORWADING state after leaving bridge

Cleanup the port forwarding state transitions for the cases when the port
joins or leaves a bridge, or is brought admin UP or DOWN.  When port is
bridged, we can rely on bridge driver putting port in correct state using
STP callback into port driver, regardless if bridge is enabled for STP or not.
When port is not bridged, we can reuse some of the STP code to enabled or
disable forwarding depending on UP or DOWN.

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

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorocker: rename lport to pport
Scott Feldman [Thu, 26 Feb 2015 04:15:37 +0000 (20:15 -0800)]
rocker: rename lport to pport

This is just a rename of physical ports from "lport" to "pport".  Not a
functional change.  OF-DPA uses logical ports (lport) for tunnels, but the
driver (and device) were using "lport" for physical ports.  Renaming physical
ports references to "pport", freeing up "lport" for use later with tunnels.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorocker: fix non-portable err return codes
Scott Feldman [Thu, 26 Feb 2015 04:15:36 +0000 (20:15 -0800)]
rocker: fix non-portable err return codes

The rocker device returns error codes if something goes wrong with descriptor
processing.  Originally the device used standard errno codes for different
errors, but since those errno codes aren't portable across ARCHs, the device
now returns hard-coded error codes that stay constant across diff ARCHs.  Fix
driver to use those same hard-coded values.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
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./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./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>