1. Dec 20, 2017
    • Gal Pressman's avatar
      net/mlx5e: Prevent possible races in VXLAN control flow · 0c1cc8b2
      Gal Pressman authored
      When calling add/remove VXLAN port, a lock must be held in order to
      prevent race scenarios when more than one add/remove happens at the
      same time.
      Fix by holding our state_lock (mutex) as done by all other parts of the
      driver.
      Note that the spinlock protecting the radix-tree is still needed in
      order to synchronize radix-tree access from softirq context.
      
      Fixes: b3f63c3d
      
       ("net/mlx5e: Add netdev support for VXLAN tunneling")
      Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      0c1cc8b2
    • Gal Pressman's avatar
      net/mlx5e: Add refcount to VXLAN structure · 23f4cc2c
      Gal Pressman authored
      A refcount mechanism must be implemented in order to prevent unwanted
      scenarios such as:
      - Open an IPv4 VXLAN interface
      - Open an IPv6 VXLAN interface (different socket)
      - Remove one of the interfaces
      
      With current implementation, the UDP port will be removed from our VXLAN
      database and turn off the offloads for the other interface, which is
      still active.
      The reference count mechanism will only allow UDP port removals once all
      consumers are gone.
      
      Fixes: b3f63c3d
      
       ("net/mlx5e: Add netdev support for VXLAN tunneling")
      Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      23f4cc2c
    • Gal Pressman's avatar
      net/mlx5e: Fix possible deadlock of VXLAN lock · 63235141
      Gal Pressman authored
      mlx5e_vxlan_lookup_port is called both from mlx5e_add_vxlan_port (user
      context) and mlx5e_features_check (softirq), but the lock acquired does
      not disable bottom half and might result in deadlock. Fix it by simply
      replacing spin_lock() with spin_lock_bh().
      While at it, replace all unnecessary spin_lock_irq() to spin_lock_bh().
      
      lockdep's WARNING: inconsistent lock state
      [  654.028136] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      [  654.028229] swapper/5/0 [HC0[0]:SC1[9]:HE1:SE0] takes:
      [  654.028321]  (&(&vxlan_db->lock)->rlock){+.?.}, at: [<ffffffffa06e7f0e>] mlx5e_vxlan_lookup_port+0x1e/0x50 [mlx5_core]
      [  654.028528] {SOFTIRQ-ON-W} state was registered at:
      [  654.028607]   _raw_spin_lock+0x3c/0x70
      [  654.028689]   mlx5e_vxlan_lookup_port+0x1e/0x50 [mlx5_core]
      [  654.028794]   mlx5e_vxlan_add_port+0x2e/0x120 [mlx5_core]
      [  654.028878]   process_one_work+0x1e9/0x640
      [  654.028942]   worker_thread+0x4a/0x3f0
      [  654.029002]   kthread+0x141/0x180
      [  654.029056]   ret_from_fork+0x24/0x30
      [  654.029114] irq event stamp: 579088
      [  654.029174] hardirqs last  enabled at (579088): [<ffffffff818f475a>] ip6_finish_output2+0x49a/0x8c0
      [  654.029309] hardirqs last disabled at (579087): [<ffffffff818f470e>] ip6_finish_output2+0x44e/0x8c0
      [  654.029446] softirqs last  enabled at (579030): [<ffffffff810b3b3d>] irq_enter+0x6d/0x80
      [  654.029567] softirqs last disabled at (579031): [<ffffffff810b3c05>] irq_exit+0xb5/0xc0
      [  654.029684] other info that might help us debug this:
      [  654.029781]  Possible unsafe locking scenario:
      
      [  654.029868]        CPU0
      [  654.029908]        ----
      [  654.029947]   lock(&(&vxlan_db->lock)->rlock);
      [  654.030045]   <Interrupt>
      [  654.030090]     lock(&(&vxlan_db->lock)->rlock);
      [  654.030162]
       *** DEADLOCK ***
      
      Fixes: b3f63c3d
      
       ("net/mlx5e: Add netdev support for VXLAN tunneling")
      Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      63235141
    • Moni Shoua's avatar
      net/mlx5: Fix error flow in CREATE_QP command · dbff26e4
      Moni Shoua authored
      In error flow, when DESTROY_QP command should be executed, the wrong
      mailbox was set with data, not the one that is written to hardware,
      Fix that.
      
      Fixes: 09a7d9ec
      
       '{net,IB}/mlx5: QP/XRCD commands via mlx5 ifc'
      Signed-off-by: default avatarMoni Shoua <monis@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      dbff26e4
    • Eugenia Emantayev's avatar
      net/mlx5: Fix misspelling in the error message and comment · 777ec2b2
      Eugenia Emantayev authored
      Fix misspelling in word syndrome.
      
      Fixes: e126ba97
      
       ("mlx5: Add driver for Mellanox Connect-IB adapters")
      Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      777ec2b2
    • Eugenia Emantayev's avatar
      net/mlx5e: Fix defaulting RX ring size when not needed · 696a97cf
      Eugenia Emantayev authored
      Fixes the bug when turning on/off CQE compression mechanism
      resets the RX rings size to default value when it is not
      needed.
      
      Fixes: 2fc4bfb7
      
       ("net/mlx5e: Dynamic RQ type infrastructure")
      Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      696a97cf
    • Gal Pressman's avatar
      net/mlx5e: Fix features check of IPv6 traffic · 2989ad1e
      Gal Pressman authored
      The assumption that the next header field contains the transport
      protocol is wrong for IPv6 packets with extension headers.
      Instead, we should look the inner-most next header field in the buffer.
      This will fix TSO offload for tunnels over IPv6 with extension headers.
      
      Performance testing: 19.25x improvement, cool!
      Measuring bandwidth of 16 threads TCP traffic over IPv6 GRE tap.
      CPU: Intel(R) Xeon(R) CPU E5-2660 v2 @ 2.20GHz
      NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex]
      TSO: Enabled
      Before: 4,926.24  Mbps
      Now   : 94,827.91 Mbps
      
      Fixes: b3f63c3d
      
       ("net/mlx5e: Add netdev support for VXLAN tunneling")
      Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      2989ad1e
    • Huy Nguyen's avatar
      net/mlx5e: Fix ETS BW check · ff089191
      Huy Nguyen authored
      Fix bug that allows ets bw sum to be 0% when ets tc type exists.
      
      Fixes: 08fb1dac
      
       ('net/mlx5e: Support DCBNL IEEE ETS')
      Signed-off-by: default avatarMoshe Shemesh <moshe@mellanox.com>
      Reviewed-by: default avatarHuy Nguyen <huyn@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      ff089191
    • Eran Ben Elisha's avatar
      net/mlx5: Fix rate limit packet pacing naming and struct · 37e92a9d
      Eran Ben Elisha authored
      In mlx5_ifc, struct size was not complete, and thus driver was sending
      garbage after the last defined field. Fixed it by adding reserved field
      to complete the struct size.
      
      In addition, rename all set_rate_limit to set_pp_rate_limit to be
      compliant with the Firmware <-> Driver definition.
      
      Fixes: 7486216b ("{net,IB}/mlx5: mlx5_ifc updates")
      Fixes: 1466cc5b
      
       ("net/mlx5: Rate limit tables support")
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      37e92a9d
    • Saeed Mahameed's avatar
      Revert "mlx5: move affinity hints assignments to generic code" · 231243c8
      Saeed Mahameed authored
      Before the offending commit, mlx5 core did the IRQ affinity itself,
      and it seems that the new generic code have some drawbacks and one
      of them is the lack for user ability to modify irq affinity after
      the initial affinity values got assigned.
      
      The issue is still being discussed and a solution in the new generic code
      is required, until then we need to revert this patch.
      
      This fixes the following issue:
      echo <new affinity> > /proc/irq/<x>/smp_affinity
      fails with  -EIO
      
      This reverts commit a435393a.
      Note: kept mlx5_get_vector_affinity in include/linux/mlx5/driver.h since
      it is used in mlx5_ib driver.
      
      Fixes: a435393a
      
       ("mlx5: move affinity hints assignments to generic code")
      Cc: Sagi Grimberg <sagi@grimberg.me>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Jes Sorensen <jsorensen@fb.com>
      Reported-by: default avatarJes Sorensen <jsorensen@fb.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      231243c8
    • Kamal Heib's avatar
      net/mlx5: FPGA, return -EINVAL if size is zero · bae115a2
      Kamal Heib authored
      Currently, if a size of zero is passed to
      mlx5_fpga_mem_{read|write}_i2c()
      the "err" return value will not be initialized, which triggers gcc
      warnings:
      
      [..]/mlx5/core/fpga/sdk.c:87 mlx5_fpga_mem_read_i2c() error:
      uninitialized symbol 'err'.
      [..]/mlx5/core/fpga/sdk.c:115 mlx5_fpga_mem_write_i2c() error:
      uninitialized symbol 'err'.
      
      fix that.
      
      Fixes: a9956d35
      
       ('net/mlx5: FPGA, Add SBU infrastructure')
      Signed-off-by: default avatarKamal Heib <kamalh@mellanox.com>
      Reviewed-by: default avatarYevgeny Kliteynik <kliteyn@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      bae115a2
    • Phil Sutter's avatar
      ipv4: fib: Fix metrics match when deleting a route · d03a4557
      Phil Sutter authored
      The recently added fib_metrics_match() causes a regression for routes
      with both RTAX_FEATURES and RTAX_CC_ALGO if the latter has
      TCP_CONG_NEEDS_ECN flag set:
      
      | # ip link add d0 type dummy
      | # ip link set d0 up
      | # ip route add 172.29.29.0/24 dev d0 features ecn congctl dctcp
      | # ip route del 172.29.29.0/24 dev d0 features ecn congctl dctcp
      | RTNETLINK answers: No such process
      
      During route insertion, fib_convert_metrics() detects that the given CC
      algo requires ECN and hence sets DST_FEATURE_ECN_CA bit in
      RTAX_FEATURES.
      
      During route deletion though, fib_metrics_match() compares stored
      RTAX_FEATURES value with that from userspace (which obviously has no
      knowledge about DST_FEATURE_ECN_CA) and fails.
      
      Fixes: 5f9ae3d9
      
       ("ipv4: do metrics match when looking up and deleting a route")
      Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d03a4557
    • Fredrik Hallenberg's avatar
      net: stmmac: Fix bad RX timestamp extraction · a1762456
      Fredrik Hallenberg authored
      
      
      As noted in dwmac4_wrback_get_rx_timestamp_status the timestamp is found
      in the context descriptor following the current descriptor. However the
      current code looks for the context descriptor in the current
      descriptor, which will always fail.
      
      Signed-off-by: default avatarFredrik Hallenberg <megahallon@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a1762456
    • Fredrik Hallenberg's avatar
      net: stmmac: Fix TX timestamp calculation · 200922c9
      Fredrik Hallenberg authored
      
      
      When using GMAC4 the value written in PTP_SSIR should be shifted however
      the shifted value is also used in subsequent calculations which results
      in a bad timestamp value.
      
      Signed-off-by: default avatarFredrik Hallenberg <megahallon@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      200922c9
    • Jon Maloy's avatar
      tipc: fix list sorting bug in function tipc_group_update_member() · 3db09601
      Jon Maloy authored
      
      
      When, during a join operation, or during message transmission, a group
      member needs to be added to the group's 'congested' list, we sort it
      into the list in ascending order, according to its current advertised
      window size. However, we miss the case when the member is already on
      that list. This will have the result that the member, after the window
      size has been decremented, might be at the wrong position in that list.
      This again may have the effect that we during broadcast and multicast
      transmissions miss the fact that a destination is not yet ready for
      reception, and we end up sending anyway. From this point on, the
      behavior during the remaining session is unpredictable, e.g., with
      underflowing window sizes.
      
      We now correct this bug by unconditionally removing the member from
      the list before (re-)sorting it in.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3db09601
    • Xin Long's avatar
      ip6_tunnel: get the min mtu properly in ip6_tnl_xmit · c9fefa08
      Xin Long authored
      
      
      Now it's using IPV6_MIN_MTU as the min mtu in ip6_tnl_xmit, but
      IPV6_MIN_MTU actually only works when the inner packet is ipv6.
      
      With IPV6_MIN_MTU for ipv4 packets, the new pmtu for inner dst
      couldn't be set less than 1280. It would cause tx_err and the
      packet to be dropped when the outer dst pmtu is close to 1280.
      
      Jianlin found it by running ipv4 traffic with the topo:
      
        (client) gre6 <---> eth1 (route) eth2 <---> gre6 (server)
      
      After changing eth2 mtu to 1300, the performance became very
      low, or the connection was even broken. The issue also affects
      ip4ip6 and ip6ip6 tunnels.
      
      So if the inner packet is ipv4, 576 should be considered as the
      min mtu.
      
      Note that for ip4ip6 and ip6ip6 tunnels, the inner packet can
      only be ipv4 or ipv6, but for gre6 tunnel, it may also be ARP.
      This patch using 576 as the min mtu for non-ipv6 packet works
      for all those cases.
      
      Reported-by: default avatarJianlin Shi <jishi@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c9fefa08
    • Xin Long's avatar
      ip6_gre: remove the incorrect mtu limit for ipgre tap · 2c52129a
      Xin Long authored
      The same fix as the patch "ip_gre: remove the incorrect mtu limit for
      ipgre tap" is also needed for ip6_gre.
      
      Fixes: 61e84623
      
       ("net: centralize net_device min/max MTU checking")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2c52129a
    • Xin Long's avatar
      ip_gre: remove the incorrect mtu limit for ipgre tap · cfddd4c3
      Xin Long authored
      ipgre tap driver calls ether_setup(), after commit 61e84623
      ("net: centralize net_device min/max MTU checking"), the range
      of mtu is [min_mtu, max_mtu], which is [68, 1500] by default.
      
      It causes the dev mtu of the ipgre tap device to not be greater
      than 1500, this limit value is not correct for ipgre tap device.
      
      Besides, it's .change_mtu already does the right check. So this
      patch is just to set max_mtu as 0, and leave the check to it's
      .change_mtu.
      
      Fixes: 61e84623
      
       ("net: centralize net_device min/max MTU checking")
      Reported-by: default avatarJianlin Shi <jishi@redhat.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cfddd4c3
    • Xin Long's avatar
      vxlan: update skb dst pmtu on tx path · a93bf0ff
      Xin Long authored
      
      
      Unlike ip tunnels, now vxlan doesn't do any pmtu update for
      upper dst pmtu, even if it doesn't match the lower dst pmtu
      any more.
      
      The problem can be reproduced when reducing the vxlan lower
      dev's pmtu when running netperf. In jianlin's testing, the
      performance went to 1/7 of the previous.
      
      This patch is to update the upper dst pmtu to match the lower
      dst pmtu on tx path so that packets can be sent out even when
      lower dev's pmtu has been changed.
      
      It also works for metadata dst.
      
      Note that this patch doesn't process any pmtu icmp packet.
      But even in the future, the support for pmtu icmp packets
      process of udp tunnels will also needs this.
      
      The same thing will be done for geneve in another patch.
      
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a93bf0ff
    • Alexander Kochetkov's avatar
      net: arc_emac: restart stalled EMAC · 78aa0975
      Alexander Kochetkov authored
      Under certain conditions EMAC stop reception of incoming packets and
      continuously increment R_MISS register instead of saving data into
      provided buffer. The commit implement workaround for such situation.
      Then the stall detected EMAC will be restarted.
      
      On device the stall looks like the device lost it's dynamic IP address.
      ifconfig shows that interface error counter rapidly increments.
      At the same time on the DHCP server we can see continues DHCP-requests
      from device.
      
      In real network stalls happen really rarely. To make them frequent the
      broadcast storm[1] should be simulated. For simulation it is necessary
      to make following connections:
          1. connect radxarock to 1st port of switch
          2. connect some PC to 2nd port of switch
          3. connect two other free ports together using standard ethernet cable,
             in order to make a switching loop.
      
      After that, is necessary to make a broadcast storm. For example, running on
      PC 'ping' to some IP address triggers ARP-request storm. After some
      time (~10sec), EMAC on rk3188 will stall.
      
      Observed and tested on rk3188 radxarock.
      
      [1] https://en.wikipedia.org/wiki/Broadcast_radiation
      
      
      
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78aa0975
    • Alexander Kochetkov's avatar
      net: arc_emac: fix arc_emac_rx() error paths · e688822d
      Alexander Kochetkov authored
      
      
      arc_emac_rx() has some issues found by code review.
      
      In case netdev_alloc_skb_ip_align() or dma_map_single() failure
      rx fifo entry will not be returned to EMAC.
      
      In case dma_map_single() failure previously allocated skb became
      lost to driver. At the same time address of newly allocated skb
      will not be provided to EMAC.
      
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e688822d
    • Sean Wang's avatar
      net: mediatek: setup proper state for disabled GMAC on the default · 7352e252
      Sean Wang authored
      
      
      The current solution would setup fixed and force link of 1Gbps to the both
      GMAC on the default. However, The GMAC should always be put to link down
      state when the GMAC is disabled on certain target boards. Otherwise,
      the driver possibly receives unexpected data from the floating hardware
      connection through the unused GMAC. Although the driver had been added
      certain protection in RX path to get rid of such kind of unexpected data
      sent to the upper stack.
      
      Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7352e252
    • Petr Machata's avatar
      mlxsw: spectrum_router: Remove batch neighbour deletion causing FW bug · 8ba6b30e
      Petr Machata authored
      This reverts commit 63dd00fa
      
      .
      
      RAUHT DELETE_ALL seems to trigger a bug in FW. That manifests by later
      calls to RAUHT ADD of an IPv6 neighbor to fail with "bad parameter"
      error code.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Fixes: 63dd00fa
      
       ("mlxsw: spectrum_router: Add batch neighbour deletion")
      Reviewed-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>
      8ba6b30e
  2. Dec 19, 2017
    • Brian King's avatar
      tg3: Fix rx hang on MTU change with 5717/5719 · 748a240c
      Brian King authored
      
      
      This fixes a hang issue seen when changing the MTU size from 1500 MTU
      to 9000 MTU on both 5717 and 5719 chips. In discussion with Broadcom,
      they've indicated that these chipsets have the same phy as the 57766
      chipset, so the same workarounds apply. This has been tested by IBM
      on both Power 8 and Power 9 systems as well as by Broadcom on x86
      hardware and has been confirmed to resolve the hang issue.
      
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      748a240c
    • David S. Miller's avatar
      Merge tag 'mac80211-for-davem-2017-12-19' of... · c6479d62
      David S. Miller authored
      Merge tag 'mac80211-for-davem-2017-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      
      
      Johannes Berg says:
      
      ====================
      A few more fixes:
       * hwsim:
         - set To-DS bit in some frames missing it
         - fix sleeping in atomic
       * nl80211:
         - doc cleanup
         - fix locking in an error path
       * build:
         - don't append to created certs C files
         - ship certificate pre-hexdumped
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c6479d62
    • Johannes Berg's avatar
      cfg80211: ship certificates as hex files · 04a7279f
      Johannes Berg authored
      
      
      Not only does this remove the need for the hexdump code in most
      normal kernel builds (still there for the extra directory), but
      it also removes the need to ship binary files, which apparently
      is somewhat problematic, as Randy reported.
      
      While at it, also add the generated files to clean-files.
      
      Reported-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      04a7279f
    • Jonathan Corbet's avatar
      nl80211: Remove obsolete kerneldoc line · 958a1b5a
      Jonathan Corbet authored
      Commit ca986ad9
      
       (nl80211: allow multiple active scheduled scan
      requests) removed WIPHY_FLAG_SUPPORTS_SCHED_SCAN but left the kerneldoc
      description in place, leading to this docs-build warning:
      
         ./include/net/cfg80211.h:3278: warning: Excess enum value
                 'WIPHY_FLAG_SUPPORTS_SCHED_SCAN' description in 'wiphy_flags'
      
      Remove the line and gain a bit of peace.
      
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      958a1b5a
    • Jia-Ju Bai's avatar
      mac80211_hwsim: Fix a possible sleep-in-atomic bug in hwsim_get_radio_nl · 162bd5e5
      Jia-Ju Bai authored
      
      
      The driver may sleep under a spinlock.
      The function call path is:
      hwsim_get_radio_nl (acquire the spinlock)
        nlmsg_new(GFP_KERNEL) --> may sleep
      
      To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.
      
      This bug is found by my static analysis tool(DSAC) and checked by my code review.
      
      Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@163.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      162bd5e5
    • Thierry Reding's avatar
      cfg80211: always rewrite generated files from scratch · 5d324073
      Thierry Reding authored
      Currently the certs C code generation appends to the generated files,
      which is most likely a leftover from commit 715a1233 ("wireless:
      don't write C files on failures"). This causes duplicate code in the
      generated files if the certificates have their timestamps modified
      between builds and thereby trigger the generation rules.
      
      Fixes: 715a1233
      
       ("wireless: don't write C files on failures")
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      5d324073
    • Adiel Aloni's avatar
      mac80211_hwsim: enable TODS BIT in null data frame · b65c7b8a
      Adiel Aloni authored
      
      
      Same as in ieee80211_nullfunc_get, enable the TODS bit, otherwise the
      nullfunc packet will not be handled in ap rx path.
      (will be dropped in ieee80211_accept_frame()).
      
      Signed-off-by: default avatarAdiel Aloni <adiel.aloni@intel.com>
      Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b65c7b8a
    • Alexey Khoroshilov's avatar
      net: phy: xgene: disable clk on error paths · ab144360
      Alexey Khoroshilov authored
      
      
      There are several error paths in xgene_mdio_probe(),
      where clk is left undisabled. The patch fixes them.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ab144360
    • Russell King's avatar
      net: phy: marvell: avoid pause mode on SGMII-to-Copper for 88e151x · 6623c0fb
      Russell King authored
      
      
      Observed on the 88e1512 in SGMII-to-Copper mode, negotiating pause
      is unreliable.  While the pause bits can be set in the advertisment
      register, they clear shortly after negotiation with a link partner
      commences irrespective of the cause of the negotiation.
      
      While these bits may be correctly conveyed to the link partner on the
      first negotiation, a subsequent negotiation (eg, due to negotiation
      restart by the link partner, or reconnection of the cable) will result
      in the link partner seeing these bits as zero, while the kernel
      believes that it has advertised pause modes.
      
      This leads to the local kernel evaluating (eg) symmetric pause mode,
      while the remote end evaluates that we have no pause mode capability.
      
      Since we can't guarantee the advertisment, disable pause mode support
      with this PHY when used in SGMII-to-Copper mode.
      
      The 88e1510 in RGMII-to-Copper mode appears to behave correctly.
      
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6623c0fb
    • Nikolay Aleksandrov's avatar
      net: bridge: fix early call to br_stp_change_bridge_id and plug newlink leaks · 84aeb437
      Nikolay Aleksandrov authored
      The early call to br_stp_change_bridge_id in bridge's newlink can cause
      a memory leak if an error occurs during the newlink because the fdb
      entries are not cleaned up if a different lladdr was specified, also
      another minor issue is that it generates fdb notifications with
      ifindex = 0. Another unrelated memory leak is the bridge sysfs entries
      which get added on NETDEV_REGISTER event, but are not cleaned up in the
      newlink error path. To remove this special case the call to
      br_stp_change_bridge_id is done after netdev register and we cleanup the
      bridge on changelink error via br_dev_delete to plug all leaks.
      
      This patch makes netlink bridge destruction on newlink error the same as
      dellink and ioctl del which is necessary since at that point we have a
      fully initialized bridge device.
      
      To reproduce the issue:
      $ ip l add br0 address 00:11:22:33:44:55 type bridge group_fwd_mask 1
      RTNETLINK answers: Invalid argument
      
      $ rmmod bridge
      [ 1822.142525] =============================================================================
      [ 1822.143640] BUG bridge_fdb_cache (Tainted: G           O    ): Objects remaining in bridge_fdb_cache on __kmem_cache_shutdown()
      [ 1822.144821] -----------------------------------------------------------------------------
      
      [ 1822.145990] Disabling lock debugging due to kernel taint
      [ 1822.146732] INFO: Slab 0x0000000092a844b2 objects=32 used=2 fp=0x00000000fef011b0 flags=0x1ffff8000000100
      [ 1822.147700] CPU: 2 PID: 13584 Comm: rmmod Tainted: G    B      O     4.15.0-rc2+ #87
      [ 1822.148578] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
      [ 1822.150008] Call Trace:
      [ 1822.150510]  dump_stack+0x78/0xa9
      [ 1822.151156]  slab_err+0xb1/0xd3
      [ 1822.151834]  ? __kmalloc+0x1bb/0x1ce
      [ 1822.152546]  __kmem_cache_shutdown+0x151/0x28b
      [ 1822.153395]  shutdown_cache+0x13/0x144
      [ 1822.154126]  kmem_cache_destroy+0x1c0/0x1fb
      [ 1822.154669]  SyS_delete_module+0x194/0x244
      [ 1822.155199]  ? trace_hardirqs_on_thunk+0x1a/0x1c
      [ 1822.155773]  entry_SYSCALL_64_fastpath+0x23/0x9a
      [ 1822.156343] RIP: 0033:0x7f929bd38b17
      [ 1822.156859] RSP: 002b:00007ffd160e9a98 EFLAGS: 00000202 ORIG_RAX: 00000000000000b0
      [ 1822.157728] RAX: ffffffffffffffda RBX: 00005578316ba090 RCX: 00007f929bd38b17
      [ 1822.158422] RDX: 00007f929bd9ec60 RSI: 0000000000000800 RDI: 00005578316ba0f0
      [ 1822.159114] RBP: 0000000000000003 R08: 00007f929bff5f20 R09: 00007ffd160e8a11
      [ 1822.159808] R10: 00007ffd160e9860 R11: 0000000000000202 R12: 00007ffd160e8a80
      [ 1822.160513] R13: 0000000000000000 R14: 0000000000000000 R15: 00005578316ba090
      [ 1822.161278] INFO: Object 0x000000007645de29 @offset=0
      [ 1822.161666] INFO: Object 0x00000000d5df2ab5 @offset=128
      
      Fixes: 30313a3d ("bridge: Handle IFLA_ADDRESS correctly when creating bridge device")
      Fixes: 5b8d5429
      
       ("bridge: netlink: register netdevice before executing changelink")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84aeb437
    • Xin Long's avatar
      sctp: add SCTP_CID_RECONF conversion in sctp_cname · d1969759
      Xin Long authored
      Whenever a new type of chunk is added, the corresp conversion in
      sctp_cname should be added. Otherwise, in some places, pr_debug
      will print it as "unknown chunk".
      
      Fixes: cc16f00f
      
       ("sctp: add support for generating stream reconf ssn reset request chunk")
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarMarcelo R. Leitner <marcelo.leitner@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1969759
    • Xin Long's avatar
      sctp: fix the issue that a __u16 variable may overflow in sctp_ulpq_renege · 5c468674
      Xin Long authored
      
      
      Now when reneging events in sctp_ulpq_renege(), the variable freed
      could be increased by a __u16 value twice while freed is of __u16
      type. It means freed may overflow at the second addition.
      
      This patch is to fix it by using __u32 type for 'freed', while at
      it, also to remove 'if (chunk)' check, as all renege commands are
      generated in sctp_eat_data and it can't be NULL.
      
      Reported-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
      Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5c468674
    • Hemanth Puranik's avatar
      net: qcom/emac: Change the order of mac up and sgmii open · ac3241d5
      Hemanth Puranik authored
      
      
      This patch fixes the order of mac_up and sgmii_open for the
      reasons noted below:
      
      - If open takes more time(if the SGMII block is not responding or
        if we want to do some delay based task) in this situation we
        will hit NETDEV watchdog
      - The main reason : We should signal to upper layers that we are
        ready to receive packets "only" when the entire path is initialized
        not the other way around, this is followed in the reset path where
        we do mac_down, sgmii_reset and mac_up. This also makes the driver
        uniform across the reset and open paths.
      - In the future there may be need for delay based tasks to be done in
        sgmii open which will result in NETDEV watchdog
      - As per the documentation the order of init should be sgmii, mac, rings
        and DMA
      
      Signed-off-by: default avatarHemanth Puranik <hpuranik@codeaurora.org>
      Acked-by: default avatarTimur Tabi <timur@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac3241d5
    • Zhao Qiang's avatar
      net: phy: marvell: Limit 88m1101 autoneg errata to 88E1145 as well. · c505873e
      Zhao Qiang authored
      88E1145 also need this autoneg errata.
      
      Fixes: f2899788
      
       ("net: phy: marvell: Limit errata to 88m1101")
      Signed-off-by: default avatarZhao Qiang <qiang.zhao@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c505873e
    • Jon Maloy's avatar
      tipc: remove leaving group member from all lists · 3f42f5fe
      Jon Maloy authored
      
      
      A group member going into state LEAVING should never go back to any
      other state before it is finally deleted. However, this might happen
      if the socket needs to send out a RECLAIM message during this interval.
      Since we forget to remove the leaving member from the group's 'active'
      or 'pending' list, the member might be selected for reclaiming, change
      state to RECLAIMING, and get stuck in this state instead of being
      deleted. This might lead to suppression of the expected 'member down'
      event to the receiver.
      
      We fix this by removing the member from all lists, except the RB tree,
      at the moment it goes into state LEAVING.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3f42f5fe
    • Jon Maloy's avatar
      tipc: fix lost member events bug · 23483399
      Jon Maloy authored
      
      
      Group messages are not supposed to be returned to sender when the
      destination socket disappears. This is done correctly for regular
      traffic messages, by setting the 'dest_droppable' bit in the header.
      But we forget to do that in group protocol messages. This has the effect
      that such messages may sometimes bounce back to the sender, be perceived
      as a legitimate peer message, and wreak general havoc for the rest of
      the session. In particular, we have seen that a member in state LEAVING
      may go back to state RECLAIMED or REMITTED, hence causing suppression
      of an otherwise expected 'member down' event to the user.
      
      We fix this by setting the 'dest_droppable' bit even in group protocol
      messages.
      
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23483399
  3. Dec 18, 2017
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · b36025b1
      David S. Miller authored
      
      
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2017-12-17
      
      The following pull-request contains BPF updates for your *net* tree.
      
      The main changes are:
      
      1) Fix a corner case in generic XDP where we have non-linear skbs
         but enough tailroom in the skb to not miss to linearizing there,
         from Song.
      
      2) Fix BPF JIT bugs in s390x and ppc64 to not recache skb data when
         BPF context is not skb, from Daniel.
      
      3) Fix a BPF JIT bug in sparc64 where recaching skb data after helper
         call would use the wrong register for the skb, from Daniel.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b36025b1