1. 11 Aug, 2015 5 commits
  2. 10 Aug, 2015 22 commits
  3. 09 Aug, 2015 13 commits
    • David S. Miller's avatar
      Merge branch 'mlxsw-fixes' · 2cf1b5ce
      David S. Miller authored
      Jiri Pirko says:
      
      ====================
      mlxsw: Couple of fixes/adjustments
      
      Ido Schimmel (5):
        mlxsw: Call free_netdev when removing port
        mlxsw: Make system port to local port mapping explicit
        mlxsw: Simplify mlxsw_sx_port_xmit function
        mlxsw: Use correct skb length when dumping payload
        mlxsw: Fix use-after-free bug in mlxsw_sx_port_xmit
      
      Jiri Pirko (2):
        mlxsw: Make pci module dependent on HAS_DMA and HAS_IOMEM
        mlxsw: Strip FCS from incoming packets
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cf1b5ce
    • Ido Schimmel's avatar
      mlxsw: Fix use-after-free bug in mlxsw_sx_port_xmit · e577516b
      Ido Schimmel authored
      Store the length of the skb before transmitting it and use it for stats
      instead of skb->len, since skb might have been freed already.
      
      This issue was discovered using the Kernel Address sanitizer (KASan).
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e577516b
    • Ido Schimmel's avatar
      mlxsw: Use correct skb length when dumping payload · 3bfcd347
      Ido Schimmel authored
      Do not use the length of the transmitted skb (which was freed), but
      that of the response skb.
      
      This issue was discovered using the Kernel Address sanitizer (KASan).
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3bfcd347
    • Ido Schimmel's avatar
      mlxsw: Simplify mlxsw_sx_port_xmit function · d003462a
      Ido Schimmel authored
      Previously we only checked if the transmission queue is not full in the
      middle of the xmit function. This lead to complex logic due to the fact
      that sometimes we need to reallocate the headroom for our Tx header.
      
      Allow the switch driver to know if the transmission queue is not full
      before sending the packet and remove this complex logic.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d003462a
    • Jiri Pirko's avatar
      mlxsw: Strip FCS from incoming packets · 7b7b9cff
      Jiri Pirko authored
      FCS of incoming packets is already checked by HW. Just strip it out.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b7b9cff
    • Jiri Pirko's avatar
      mlxsw: Make pci module dependent on HAS_DMA and HAS_IOMEM · 74ed207e
      Jiri Pirko authored
      This resolves compile errors on um-allyesconfig.
      
      Note that there are many other drivers which have the same issue.
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      74ed207e
    • Ido Schimmel's avatar
      mlxsw: Make system port to local port mapping explicit · e61011b5
      Ido Schimmel authored
      System ports are unique identifiers in a multi-ASIC environment that
      represent all the available ports in the system. Local ports on the
      other hand, are unique only within the local ASIC.
      
      Since system port to local port mapping is not part of the HW-SW
      contract and since only single-ASIC configurations are currently
      supported, set an explicit 1:1 mapping by configuring the Switch System
      Port Record (SSPR) register.
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e61011b5
    • Ido Schimmel's avatar
      mlxsw: Call free_netdev when removing port · 26a80f6e
      Ido Schimmel authored
      When removing a port's netdevice we should also free the memory
      allocated by alloc_etherdev(). Do this by calling free_netdev() at the
      end of the teardown sequence.
      Reported-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26a80f6e
    • Masanari Iida's avatar
      net: ethernet: Fix double word "the the" in eth.c · ecea4991
      Masanari Iida authored
      This patch fix double word "the the" in
      Documentation/DocBook/networking/API-eth-get-headlen.html
      Documentation/DocBook/networking/netdev.html
      Documentation/DocBook/networking.xml
      
      These files are generated from comment in source,
      so I have to fix comment in net/ethernet/eth.c.
      Signed-off-by: default avatarMasanari Iida <standby24x7@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ecea4991
    • Shaohui Xie's avatar
      net: phy: add RealTek RTL8211DN phy id · 0024f892
      Shaohui Xie authored
      RTL8211DN is compatible with RTL8211E.
      Signed-off-by: default avatarShaohui Xie <Shaohui.Xie@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0024f892
    • Robert Shearman's avatar
      mpls: Enforce payload type of traffic sent using explicit NULL · 118d5234
      Robert Shearman authored
      RFC 4182 s2 states that if an IPv4 Explicit NULL label is the only
      label on the stack, then after popping the resulting packet must be
      treated as a IPv4 packet and forwarded based on the IPv4 header. The
      same is true for IPv6 Explicit NULL with an IPv6 packet following.
      
      Therefore, when installing the IPv4/IPv6 Explicit NULL label routes,
      add an attribute that specifies the expected payload type for use at
      forwarding time for determining the type of the encapsulated packet
      instead of inspecting the first nibble of the packet.
      Signed-off-by: default avatarRobert Shearman <rshearma@brocade.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      118d5234
    • David S. Miller's avatar
      Merge branch 'bpf-perf' · d74a790d
      David S. Miller authored
      Kaixu Xia says:
      
      ====================
      bpf: Introduce the new ability of eBPF programs to access hardware PMU counter
      
      This patchset is base on the net-next:
       git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
      commit 9dc20a64.
      
      Previous patch v6 url:
      https://lkml.org/lkml/2015/8/4/188
      
      changes in V7:
       - rebase the whole patch set to net-next tree(9dc20a64);
       - split out the core perf APIs into Patch 1/5;
       - change the return value of function perf_event_attrs()
         from struct perf_event * to const struct perf_event * in
         Patch 1/5;
       - rename the function perf_event_read_internal() to perf_event_
         read_local() and rewrite it in Patch 1/5;
       - rename the function check_func_limit() to check_map_func
         _compatibility() and remove the unnecessary pass pointer to
         a pointer in Patch 4/5;
      
      changes in V6:
       - make the Patch 1/4 commit message more meaning and readable;
       - remove the unnecessary comment in Patch 2/4 and make it clean;
       - declare the function perf_event_release_kernel() in include/
         linux/perf_event.h to fix the build error when CONFIG_PERF_EVENTS
         isn't configured in Patch 2/4;
       - add function perf_event_attrs() to get the struct perf_event_attr
         in Patch 2/4.
       - move the related code from kernel/trace/bpf_trace.c to kernel/
         events/core.c and add function perf_event_read_internal() to
         avoid poking inside of the event outside of perf code in Patch 3/4;
       - generial the func & map match-pair with an array in Patch 3/4;
      
      changes in V5:
       - move struct fd_array_map_ops* fd_ops to bpf_map;
       - move array perf event decrement refcnt function to
         map_free;
       - fix the NULL ptr of perf_event_get();
       - move bpf_perf_event_read() to kernel/bpf/bpf_trace.c;
       - get rid of the remaining struct bpf_prog;
       - move the unnecessay cast on void *;
      
      changes in V4:
       - make the bpf_prog_array_map more generic;
       - fix the bug of event refcnt leak;
       - use more useful errno in bpf_perf_event_read();
      
      changes in V3:
       - collapse V2 patches 1-3 into one;
       - drop the function map->ops->map_traverse_elem() and release
         the struct perf_event in map_free;
       - only allow to access bpf_perf_event_read() from programs;
       - update the perf_event_array_map elem via xchg();
       - pass index directly to bpf_perf_event_read() instead of
         MAP_KEY;
      
      changes in V2:
       - put atomic_long_inc_not_zero() between fdget() and fdput();
       - limit the event type to PERF_TYPE_RAW and PERF_TYPE_HARDWARE;
       - Only read the event counter on current CPU or on current
         process;
       - add new map type BPF_MAP_TYPE_PERF_EVENT_ARRAY to store the
         pointer to the struct perf_event;
       - according to the perf_event_map_fd and key, the function
         bpf_perf_event_read() can get the Hardware PMU counter value;
      
      Patch 5/5 is a simple example and shows how to use this new eBPF
      programs ability. The PMU counter data can be found in
      /sys/kernel/debug/tracing/trace(trace_pipe).(the cycles PMU
      value when 'kprobe/sys_write' sampling)
      
        $ cat /sys/kernel/debug/tracing/trace_pipe
        $ ./tracex6
             ...
             syslog-ng-548   [000] d..1    76.905673: : CPU-0   681765271
             syslog-ng-548   [000] d..1    76.905690: : CPU-0   681787855
             syslog-ng-548   [000] d..1    76.905707: : CPU-0   681810504
             syslog-ng-548   [000] d..1    76.905725: : CPU-0   681834771
             syslog-ng-548   [000] d..1    76.905745: : CPU-0   681859519
             syslog-ng-548   [000] d..1    76.905766: : CPU-0   681890419
             syslog-ng-548   [000] d..1    76.905783: : CPU-0   681914045
             syslog-ng-548   [000] d..1    76.905800: : CPU-0   681935950
             syslog-ng-548   [000] d..1    76.905816: : CPU-0   681958299
                    ls-690   [005] d..1    82.241308: : CPU-5   3138451
                    sh-691   [004] d..1    82.244570: : CPU-4   7324988
                 <...>-699   [007] d..1    99.961387: : CPU-7   3194027
                 <...>-695   [003] d..1    99.961474: : CPU-3   288901
                 <...>-695   [003] d..1    99.961541: : CPU-3   383145
                 <...>-695   [003] d..1    99.961591: : CPU-3   450365
                 <...>-695   [003] d..1    99.961639: : CPU-3   515751
                 <...>-695   [003] d..1    99.961686: : CPU-3   579047
             ...
      
      The detail of patches is as follow:
      
      Patch 1/5 add the necessary core perf APIs perf_event_attrs(),
      perf_event_get(),perf_event_read_local() when accessing events
      counters in eBPF programs
      
      Patch 2/5 rewrites part of the bpf_prog_array map code and make it
      more generic;
      
      Patch 3/5 introduces a new bpf map type. This map only stores the
      pointer to struct perf_event;
      
      Patch 4/5 implements function bpf_perf_event_read() that get the
      selected hardware PMU conuter;
      
      Patch 5/5 gives a simple example.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d74a790d
    • Kaixu Xia's avatar
      samples/bpf: example of get selected PMU counter value · 47efb302
      Kaixu Xia authored
      This is a simple example and shows how to use the new ability
      to get the selected Hardware PMU counter value.
      Signed-off-by: default avatarKaixu Xia <xiakaixu@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      47efb302