1. 17 Apr, 2019 40 commits
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 6b0a7f84
      David S. Miller authored
      Conflict resolution of af_smc.c from Stephen Rothwell.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6b0a7f84
    • David S. Miller's avatar
      Merge branch 's390-next' · cea0aa9c
      David S. Miller authored
      Julian Wiedmann says:
      
      ====================
      s390/qeth: updates 2019-04-17
      
      please apply some additional qeth patches to net-next. This patchset
      converts the driver to use the kernel's multiqueue model.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cea0aa9c
    • Julian Wiedmann's avatar
      s390/qeth: stop/wake TX queues based on their fill level · 54a50941
      Julian Wiedmann authored
      Current xmit code only stops the txq after attempting to fill an
      IO buffer that hasn't been TX-completed yet. In many-connection
      scenarios, this can result in frequent rejected TX attempts, requeuing
      of skbs with NETDEV_TX_BUSY and extra overhead.
      
      Now that we have a proper 1-to-1 relation between stack-side txqs and
      our HW Queues, overhaul the stop/wake logic so that the xmit code
      stops the txq as needed.
      Given that we might map multiple skbs into a single buffer, it's crucial
      to ensure that the queue always provides an _entirely_ empty IO buffer.
      Otherwise large skbs (eg TSO) might not fit into the last available
      buffer. So whenever qeth_do_send_packet() first utilizes an _empty_
      buffer, it updates & checks the used_buffers count.
      
      This now ensures that an skb passed to qeth_xmit() can always be mapped
      into an IO buffer, so remove all of the -EBUSY roll-back handling in the
      TX path. We preserve the minimal safety-checks ("Is this IO buffer
      really available?"), just in case some nasty future bug ever attempts to
      corrupt an in-use buffer.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      54a50941
    • Julian Wiedmann's avatar
      s390/qeth: simplify QoS code · e6c15b5f
      Julian Wiedmann authored
      qeth_get_priority_queue() is no longer used for IQD devices, remove the
      special-casing of their mcast queue.
      
      This effectively reverts
      commit 70deb016 ("qeth: omit outbound queue 3 for unicast packets in Priority Queuing on HiperSockets").
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6c15b5f
    • Julian Wiedmann's avatar
      s390/qeth: add TX multiqueue support for OSA devices · 73dc2daf
      Julian Wiedmann authored
      This adds trivial support for multiple TX queues on OSA-style devices
      (both real HW and z/VM NICs). For now we expose the driver's existing
      QoS mechanism via .ndo_select_queue, and adjust the number of available
      TX queues when qeth_update_from_chp_desc() detects that the
      HW configuration has changed.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73dc2daf
    • Julian Wiedmann's avatar
      s390/qeth: add TX multiqueue support for IQD devices · 3a18d754
      Julian Wiedmann authored
      qeth has been supporting multiple HW Output Queues for a long time. But
      rather than exposing those queues to the stack, it uses its own queue
      selection logic in .ndo_start_xmit... with all the drawbacks that
      entails.
      Start off by switching IQD devices over to a proper mqs net_device,
      and converting all the netdev_queue management code.
      
      One oddity with IQD devices is the requirement to place all mcast
      traffic on the _highest_ established HW queue. Doing so via
      .ndo_select_queue seems straight-forward - but that won't work if only
      some of the HW queues are active
      (ie. when dev->real_num_tx_queues < dev->num_tx_queues), since
      netdev_cap_txqueue() will not allow us to put skbs on the higher queues.
      
      To make this work, we
      1. let .ndo_select_queue() map all mcast traffic to netdev_queue 0, and
      2. later re-map the netdev_queue and HW queue indices in
         .ndo_start_xmit and the TX completion handler.
      
      With this patch we default to a fixed set of 1 ucast and 1 mcast queue.
      Support for dynamic reconfiguration is added at a later time.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a18d754
    • Julian Wiedmann's avatar
      s390/qeth: don't keep statistics for tx timeout · 333ef9d1
      Julian Wiedmann authored
      struct netdev_queue contains a counter for tx timeouts, which gets
      updated by dev_watchdog(). So let's not attempt to maintain our own
      statistics, in particular not by overloading the skb-error counter.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      333ef9d1
    • Julian Wiedmann's avatar
      s390/qeth: don't bother updating the last-tx time · fdd1a530
      Julian Wiedmann authored
      As the documentation for netif_trans_update() says, netdev_start_xmit()
      already updates the last-tx time after every good xmit. So don't
      duplicate that effort.
      
      One odd case is that qeth_flush_buffers() also gets called from our
      TX completion handler, to flush out any partially filled buffer when
      we switch the queue to non-packing mode. But as the TX completion
      handler will _always_ wake the txq, we don't have to worry about
      the TX watchdog there.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdd1a530
    • Julian Wiedmann's avatar
      s390/qeth: handle error from qeth_update_from_chp_desc() · a4cdc9ba
      Julian Wiedmann authored
      Subsequent code relies on the values that qeth_update_from_chp_desc()
      reads from the CHP descriptor. Rather than dealing with weird errors
      later on, just handle it properly here.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4cdc9ba
    • Julian Wiedmann's avatar
      s390/qeth: clarify naming for some QDIO helpers · 41c47da3
      Julian Wiedmann authored
      The naming of several QDIO helpers doesn't match their actual
      functionality, or the structures they operate on. Clean this up.
      
      s/qeth_alloc_qdio_buffers/qeth_alloc_qdio_queues
      s/qeth_free_qdio_buffers/qeth_free_qdio_queues
      s/qeth_alloc_qdio_out_buf/qeth_alloc_output_queue
      s/qeth_clear_outq_buffers/qeth_drain_output_queue
      s/qeth_clear_qdio_buffers/qeth_drain_output_queues
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      41c47da3
    • David S. Miller's avatar
      Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 3a6f7892
      David S. Miller authored
      Jeff Kirsher says:
      
      ====================
      40GbE Intel Wired LAN Driver Updates 2019-04-16
      
      This series contains updates to i40e driver only.
      
      Adam fixes i40e so that queues can be restored to its original value if
      configuring queue channels fails.  Bumped the maximum API version
      supported and added the API version to error messages to clarify
      supported firmware API versions.  Fixed the problem with the driver
      being able to add only 7 multicast MAC address filters instead of 16.
      
      Aleksandr adds support for Dynamic Device Personalization (DDP) which
      allows loading profiles that change the way internal parser interprets
      processed frames.
      
      Nick fixes an issue where if we modify the VLAN stripping options when a
      port VLAN is configured, it will break traffic for the VSI, so prevent
      changes from being made.
      
      Jake fixes an issue where a device reset can mess up the clock time
      because we reset the clock time based on the kernel time every reset.
      This causes us to potentially completely reset the PTP time, and can
      cause unexpected behavior in programs like ptp4l.
      
      Piotr fixes an LED blink issue with the 'ethtool -p' command, so that
      identification blinking will work on all hardware.
      
      Chinh fixed the error returned to correctly reflect the current state
      when LLDP or DCBx is not in an operational state.
      
      Grzegorz cleans up a misleading error message when untrusted VF tries to
      exceed addresses beyond the NIC limit.
      
      Carolyn fixes the error return code to correctly reflect the error case.
      
      v2: updated the URL provided in the DDP patch (#2)
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a6f7892
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.1-2' of git://github.com/cminyard/linux-ipmi · fe5cdef2
      Linus Torvalds authored
      Pull IPMI fixes from Corey Minyard:
       "Fixes for some bugs cause by recent changes. One crash if you feed bad
        data to the module parameters, one BUG that sometimes occurs when a
        user closes the connection, and one bug that cause the driver to not
        work if the configuration information only comes in from SMBIOS"
      
      * tag 'for-linus-5.1-2' of git://github.com/cminyard/linux-ipmi:
        ipmi: fix sleep-in-atomic in free_user at cleanup SRCU user->release_barrier
        ipmi: ipmi_si_hardcode.c: init si_type array to fix a crash
        ipmi: Fix failure on SMBIOS specified devices
      fe5cdef2
    • David S. Miller's avatar
      Merge branch 'stmmac-Enable-Flow-Control' · e77b8ba6
      David S. Miller authored
      Jose Abreu says:
      
      ====================
      net: stmmac: Enable Flow Control
      
      I don't know of any specific reason why Flow Control is off by default but
      do let me know if there is any.
      
      Tested in B2B between XGMAC2 and GMAC5.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e77b8ba6
    • Jose Abreu's avatar
      net: stmmac: Set Flow Control to automatic mode in the driver · e9989339
      Jose Abreu authored
      By default Flow Control feature is not being enabled in stmmac.
      
      This is a useful feature that can prevent loss of packets and now that
      XGMAC already supports it (along with GMAC and QoS) it makes sense to
      activate it.
      
      Switch the module parameter to FLOW_AUTO so that Flow Control is
      activated.
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9989339
    • Jose Abreu's avatar
      net: stmmac: dwxgmac: Finish the Flow Control implementation · ff82cfc7
      Jose Abreu authored
      Finish the implementation of Flow Control feature. In order for it to
      work correctly we need to set EHFC bit and the correct threshold values
      for activating and deactivating it.
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ff82cfc7
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 2a3a028f
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Handle init flow failures properly in iwlwifi driver, from Shahar S
          Matityahu.
      
       2) mac80211 TXQs need to be unscheduled on powersave start, from Felix
          Fietkau.
      
       3) SKB memory accounting fix in A-MDSU aggregation, from Felix Fietkau.
      
       4) Increase RCU lock hold time in mlx5 FPGA code, from Saeed Mahameed.
      
       5) Avoid checksum complete with XDP in mlx5, also from Saeed.
      
       6) Fix netdev feature clobbering in ibmvnic driver, from Thomas Falcon.
      
       7) Partial sent TLS record leak fix from Jakub Kicinski.
      
       8) Reject zero size iova range in vhost, from Jason Wang.
      
       9) Allow pending work to complete before clcsock release from Karsten
          Graul.
      
      10) Fix XDP handling max MTU in thunderx, from Matteo Croce.
      
      11) A lot of protocols look at the sa_family field of a sockaddr before
          validating it's length is large enough, from Tetsuo Handa.
      
      12) Don't write to free'd pointer in qede ptp error path, from Colin Ian
          King.
      
      13) Have to recompile IP options in ipv4_link_failure because it can be
          invoked from ARP, from Stephen Suryaputra.
      
      14) Doorbell handling fixes in qed from Denis Bolotin.
      
      15) Revert net-sysfs kobject register leak fix, it causes new problems.
          From Wang Hai.
      
      16) Spectre v1 fix in ATM code, from Gustavo A. R. Silva.
      
      17) Fix put of BROPT_VLAN_STATS_PER_PORT in bridging code, from Nikolay
          Aleksandrov.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (111 commits)
        socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW
        tcp: tcp_grow_window() needs to respect tcp_space()
        ocelot: Clean up stats update deferred work
        ocelot: Don't sleep in atomic context (irqs_disabled())
        net: bridge: fix netlink export of vlan_stats_per_port option
        qed: fix spelling mistake "faspath" -> "fastpath"
        tipc: set sysctl_tipc_rmem and named_timeout right range
        tipc: fix link established but not in session
        net: Fix missing meta data in skb with vlan packet
        net: atm: Fix potential Spectre v1 vulnerabilities
        net/core: work around section mismatch warning for ptp_classifier
        net: bridge: fix per-port af_packet sockets
        bnx2x: fix spelling mistake "dicline" -> "decline"
        route: Avoid crash from dereferencing NULL rt->from
        MAINTAINERS: normalize Woojung Huh's email address
        bonding: fix event handling for stacked bonds
        Revert "net-sysfs: Fix memory leak in netdev_register_kobject"
        rtnetlink: fix rtnl_valid_stats_req() nlmsg_len check
        qed: Fix the DORQ's attentions handling
        qed: Fix missing DORQ attentions
        ...
      2a3a028f
    • Corey Minyard's avatar
      ipmi: fix sleep-in-atomic in free_user at cleanup SRCU user->release_barrier · 3b9a9072
      Corey Minyard authored
      free_user() could be called in atomic context.
      
      This patch pushed the free operation off into a workqueue.
      
      Example:
      
       BUG: sleeping function called from invalid context at kernel/workqueue.c:2856
       in_atomic(): 1, irqs_disabled(): 0, pid: 177, name: ksoftirqd/27
       CPU: 27 PID: 177 Comm: ksoftirqd/27 Not tainted 4.19.25-3 #1
       Hardware name: AIC 1S-HV26-08/MB-DPSB04-06, BIOS IVYBV060 10/21/2015
       Call Trace:
        dump_stack+0x5c/0x7b
        ___might_sleep+0xec/0x110
        __flush_work+0x48/0x1f0
        ? try_to_del_timer_sync+0x4d/0x80
        _cleanup_srcu_struct+0x104/0x140
        free_user+0x18/0x30 [ipmi_msghandler]
        ipmi_free_recv_msg+0x3a/0x50 [ipmi_msghandler]
        deliver_response+0xbd/0xd0 [ipmi_msghandler]
        deliver_local_response+0xe/0x30 [ipmi_msghandler]
        handle_one_recv_msg+0x163/0xc80 [ipmi_msghandler]
        ? dequeue_entity+0xa0/0x960
        handle_new_recv_msgs+0x15c/0x1f0 [ipmi_msghandler]
        tasklet_action_common.isra.22+0x103/0x120
        __do_softirq+0xf8/0x2d7
        run_ksoftirqd+0x26/0x50
        smpboot_thread_fn+0x11d/0x1e0
        kthread+0x103/0x140
        ? sort_range+0x20/0x20
        ? kthread_destroy_worker+0x40/0x40
        ret_from_fork+0x1f/0x40
      
      Fixes: 77f82696 ("ipmi: fix use-after-free of user->release_barrier.rda")
      Reported-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
      Cc: stable@vger.kernel.org # 5.0
      Cc: Yang Yingliang <yangyingliang@huawei.com>
      3b9a9072
    • Arnd Bergmann's avatar
      socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW · e6986423
      Arnd Bergmann authored
      It looks like the new socket options only work correctly
      for native execution, but in case of compat mode fall back
      to the old behavior as we ignore the 'old_timeval' flag.
      
      Rework so we treat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW the
      same way in compat and native 32-bit mode.
      
      Cc: Deepa Dinamani <deepa.kernel@gmail.com>
      Fixes: a9beb86a ("sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Acked-by: default avatarDeepa Dinamani <deepa.kernel@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6986423
    • Eric Dumazet's avatar
      tcp: tcp_grow_window() needs to respect tcp_space() · 50ce163a
      Eric Dumazet authored
      For some reason, tcp_grow_window() correctly tests if enough room
      is present before attempting to increase tp->rcv_ssthresh,
      but does not prevent it to grow past tcp_space()
      
      This is causing hard to debug issues, like failing
      the (__tcp_select_window(sk) >= tp->rcv_wnd) test
      in __tcp_ack_snd_check(), causing ACK delays and possibly
      slow flows.
      
      Depending on tcp_rmem[2], MTU, skb->len/skb->truesize ratio,
      we can see the problem happening on "netperf -t TCP_RR -- -r 2000,2000"
      after about 60 round trips, when the active side no longer sends
      immediate acks.
      
      This bug predates git history.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Acked-by: default avatarWei Wang <weiwan@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50ce163a
    • David S. Miller's avatar
      Merge branch 'dpaa2-eth-Add-flow-steering-support-without-masking' · 17f780b3
      David S. Miller authored
      Ioana Ciocoi Radulescu says:
      
      ====================
      dpaa2-eth: Add flow steering support without masking
      
      On DPAA2 platforms that lack a TCAM (like LS1088A), masking of
      flow steering keys is not supported. Until now we didn't offer
      flow steering capabilities at all on these platforms.
      
      Introduce a limited support for flow steering, where we only
      allow ethtool rules that share a common key (i.e. have the same
      header fields). If a rule with a new composition key is wanted,
      the user must first manually delete all previous rules.
      
      First patch fixes a minor bug, the next two cleanup and prepare
      the code and the last one introduces the actual FS support.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      17f780b3
    • Ioana Ciocoi Radulescu's avatar
      dpaa2-eth: Add flow steering support without masking · 2d680237
      Ioana Ciocoi Radulescu authored
      On platforms that lack a TCAM (like LS1088A), masking of
      flow steering keys is not supported. Until now we didn't
      offer flow steering capabilities at all on these platforms,
      since our driver implementation configured a "comprehensive"
      FS key (containing all supported header fields), with masks
      used to ignore the fields not present in the rules provided
      by the user.
      
      We now allow ethtool rules that share a common key (i.e. have
      the same header fields). The FS key is now kept in the driver
      private data and initialized when the first rule is added to
      an empty table, rather than at probe time. If a rule with a new
      composition key is wanted, the user must first manually delete
      all previous rules.
      
      When building a FS table entry to pass to firmware, we still use
      the old building algorithm, which assumes an all-supported-fields
      key, and later collapse the fields which aren't actually needed.
      
      Masked rules are not supported; if provided, the mask value
      will be ignored. For firmware versions older than MC10.7.0
      (that only offer the legacy ABIs for configuring distribution
      keys) flow steering without masking support remains unavailable.
      Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d680237
    • Ioana Ciocoi Radulescu's avatar
      dpaa2-eth: Update hash key composition code · 3a1e6b84
      Ioana Ciocoi Radulescu authored
      Introduce an internal id bitfield to uniquely identify header fields
      supported by the Rx distribution keys. For the hash key, add a
      conversion from the RXH_* bitmask provided by ethtool to the internal
      ids.
      Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3a1e6b84
    • Ioana Ciocoi Radulescu's avatar
      dpaa2-eth: Add a couple of macros · 61f9bf00
      Ioana Ciocoi Radulescu authored
      Add two macros to simplify reading DPNI options.
      Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61f9bf00
    • Ioana Ciocoi Radulescu's avatar
      dpaa2-eth: Fix Rx classification status · df8e249b
      Ioana Ciocoi Radulescu authored
      Set the Rx flow classification enable flag only if key config
      operation is successful.
      
      Fixes 3f9b5c9 ("dpaa2-eth: Configure Rx flow classification key")
      Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      df8e249b
    • Claudiu Manoil's avatar
      ocelot: Clean up stats update deferred work · 1e1caa97
      Claudiu Manoil authored
      This is preventive cleanup that may save troubles later.
      No need to cancel repeateadly queued work if code is properly
      refactored.
      Don't let the ethtool -s process interfere with the stat workqueue
      scheduling.
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e1caa97
    • Claudiu Manoil's avatar
      ocelot: Don't sleep in atomic context (irqs_disabled()) · a8fd48b5
      Claudiu Manoil authored
      Preemption disabled at:
       [<ffff000008cabd54>] dev_set_rx_mode+0x1c/0x38
       Call trace:
       [<ffff00000808a5c0>] dump_backtrace+0x0/0x3d0
       [<ffff00000808a9a4>] show_stack+0x14/0x20
       [<ffff000008e6c0c0>] dump_stack+0xac/0xe4
       [<ffff0000080fe76c>] ___might_sleep+0x164/0x238
       [<ffff0000080fe890>] __might_sleep+0x50/0x88
       [<ffff0000082261e4>] kmem_cache_alloc+0x17c/0x1d0
       [<ffff000000ea0ae8>] ocelot_set_rx_mode+0x108/0x188 [mscc_ocelot_common]
       [<ffff000008cabcf0>] __dev_set_rx_mode+0x58/0xa0
       [<ffff000008cabd5c>] dev_set_rx_mode+0x24/0x38
      
      Fixes: a556c76a ("net: mscc: Add initial Ocelot switch support")
      Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8fd48b5
    • John Hurley's avatar
      nfp: flower: fix implicit fallthrough warning · 9bad65e5
      John Hurley authored
      The nfp_flower_copy_pre_actions function introduces a case statement with
      an intentional fallthrough. However, this generates a warning if built
      with the -Wimplicit-fallthrough flag.
      
      Remove the warning by adding a fall through comment.
      
      Fixes: 1c6952ca ("nfp: flower: generate merge flow rule")
      Signed-off-by: default avatarJohn Hurley <john.hurley@netronome.com>
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Reviewed-by: default avatarJiong Wang <jiong.wang@netronome.com>
      Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9bad65e5
    • Nikolay Aleksandrov's avatar
      net: bridge: fix netlink export of vlan_stats_per_port option · 600bea7d
      Nikolay Aleksandrov authored
      Since the introduction of the vlan_stats_per_port option the netlink
      export of it has been broken since I made a typo and used the ifla
      attribute instead of the bridge option to retrieve its state.
      Sysfs export is fine, only netlink export has been affected.
      
      Fixes: 9163a0fc ("net: bridge: add support for per-port vlan stats")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      600bea7d
    • Colin Ian King's avatar
      qed: fix spelling mistake "faspath" -> "fastpath" · 3321b6c2
      Colin Ian King authored
      There is a spelling mistake in a DP_INFO message, fix it.
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3321b6c2
    • Antoine Tenart's avatar
      net: phy: micrel: add Asym Pause workaround · 3aed3e2a
      Antoine Tenart authored
      The Micrel KSZ9031 PHY may fail to establish a link when the Asymmetric
      Pause capability is set. This issue is described in a Silicon Errata
      (DS80000691D or DS80000692D), which advises to always disable the
      capability. This patch implements the workaround by defining a KSZ9031
      specific get_feature callback to force the Asymmetric Pause capability
      bit to be cleared.
      
      This fixes issues where the link would not come up at boot time, or when
      the Asym Pause bit was set later on.
      Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3aed3e2a
    • David S. Miller's avatar
      Merge branch 'bnx2x-Support-for-timestamping-in-P2P-mode' · 9c03e227
      David S. Miller authored
      Sudarsana Reddy Kalluru says:
      
      ====================
      bnx2x: Support for timestamping in P2P mode.
      
      The patch series adds driver support for timestamping the ptp packets
      in peer-delay (P2P) mode.
       - Patch (1) performs the code cleanup.
       - Patch (2) adds the required implementation.
      
      Please consider applying it 'net-next' tree.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9c03e227
    • Sudarsana Reddy Kalluru's avatar
      bnx2x: Add support for detection of P2P event packets. · 00165c25
      Sudarsana Reddy Kalluru authored
      The patch adds support for detecting the P2P (peer-to-peer) event packets.
      This is required for timestamping the PTP packets in peer delay mode.
      Unmask the below bits (set to 0) for device to detect the p2p packets.
        NIG_REG_P0/1_LLH_PTP_PARAM_MASK
        NIG_REG_P0/1_TLLH_PTP_PARAM_MASK
          bit 1 - IPv4 DA 1 of 224.0.0.107.
          bit 3 - IPv6 DA 1 of 0xFF02:0:0:0:0:0:0:6B.
          bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E.
        NIG_REG_P0/1_LLH_PTP_RULE_MASK
        NIG_REG_P0/1_TLLH_PTP_RULE_MASK
          bit 2 - {IPv4 DA 1; UDP DP 0}
          bit 6 - MAC Ethertype 0 of 0x88F7.
          bit 9 - MAC DA 1 of 0x01-80-C2-00-00-0E.
      Signed-off-by: default avatarSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00165c25
    • Sudarsana Reddy Kalluru's avatar
      bnx2x: Replace magic numbers with macro definitions. · b320532c
      Sudarsana Reddy Kalluru authored
      This patch performs code cleanup by defining macros for the ptp-timestamp
      filters.
      Signed-off-by: default avatarSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: default avatarAriel Elior <aelior@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b320532c
    • Jie Liu's avatar
      tipc: set sysctl_tipc_rmem and named_timeout right range · 4bcd4ec1
      Jie Liu authored
      We find that sysctl_tipc_rmem and named_timeout do not have the right minimum
      setting. sysctl_tipc_rmem should be larger than zero, like sysctl_tcp_rmem.
      And named_timeout as a timeout setting should be not less than zero.
      
      Fixes: cc79dd1b ("tipc: change socket buffer overflow control to respect sk_rcvbuf")
      Fixes: a5325ae5 ("tipc: add name distributor resiliency queue")
      Signed-off-by: default avatarJie Liu <liujie165@huawei.com>
      Reported-by: default avatarQiang Ning <ningqiang1@huawei.com>
      Reviewed-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
      Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bcd4ec1
    • Tuong Lien's avatar
      tipc: fix link established but not in session · f7a93780
      Tuong Lien authored
      According to the link FSM, when a link endpoint got RESET_MSG (- a
      traditional one without the stopping bit) from its peer, it moves to
      PEER_RESET state and raises a LINK_DOWN event which then resets the
      link itself. Its state will become ESTABLISHING after the reset event
      and the link will be re-established soon after this endpoint starts to
      send ACTIVATE_MSG to the peer.
      
      There is no problem with this mechanism, however the link resetting has
      cleared the link 'in_session' flag (along with the other important link
      data such as: the link 'mtu') that was correctly set up at the 1st step
      (i.e. when this endpoint received the peer RESET_MSG). As a result, the
      link will become ESTABLISHED, but the 'in_session' flag is not set, and
      all STATE_MSG from its peer will be dropped at the link_validate_msg().
      It means the link not synced and will sooner or later face a failure.
      
      Since the link reset action is obviously needed for a new link session
      (this is also true in the other situations), the problem here is that
      the link is re-established a bit too early when the link endpoints are
      not really in-sync yet. The commit forces a resync as already done in
      the previous commit 91986ee1 ("tipc: fix link session and
      re-establish issues") by simply varying the link 'peer_session' value
      at the link_reset().
      Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarTuong Lien <tuong.t.lien@dektech.com.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f7a93780
    • Yuya Kusakabe's avatar
      net: Fix missing meta data in skb with vlan packet · d85e8be2
      Yuya Kusakabe authored
      skb_reorder_vlan_header() should move XDP meta data with ethernet header
      if XDP meta data exists.
      
      Fixes: de8f3a83 ("bpf: add meta pointer for direct access")
      Signed-off-by: default avatarYuya Kusakabe <yuya.kusakabe@gmail.com>
      Signed-off-by: default avatarTakeru Hayasaka <taketarou2@gmail.com>
      Co-developed-by: default avatarTakeru Hayasaka <taketarou2@gmail.com>
      Reviewed-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d85e8be2
    • Gustavo A. R. Silva's avatar
      xen-netfront: mark expected switch fall-through · a32b9d91
      Gustavo A. R. Silva authored
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/xen-netfront.c: In function ‘netback_changed’:
      drivers/net/xen-netfront.c:2038:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (dev->state == XenbusStateClosed)
            ^
      drivers/net/xen-netfront.c:2041:2: note: here
        case XenbusStateClosing:
        ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comment is modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a32b9d91
    • Gustavo A. R. Silva's avatar
      net: atm: Fix potential Spectre v1 vulnerabilities · 899537b7
      Gustavo A. R. Silva authored
      arg is controlled by user-space, hence leading to a potential
      exploitation of the Spectre variant 1 vulnerability.
      
      This issue was detected with the help of Smatch:
      
      net/atm/lec.c:715 lec_mcast_attach() warn: potential spectre issue 'dev_lec' [r] (local cap)
      
      Fix this by sanitizing arg before using it to index dev_lec.
      
      Notice that given that speculation windows are large, the policy is
      to kill the speculation on the first load and not worry if it can be
      completed with a dependent load/store [1].
      
      [1] https://lore.kernel.org/lkml/20180423164740.GY17484@dhcp22.suse.cz/Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      899537b7
    • Ard Biesheuvel's avatar
      net/core: work around section mismatch warning for ptp_classifier · ad910c7c
      Ard Biesheuvel authored
      The routine ptp_classifier_init() uses an initializer for an
      automatic struct type variable which refers to an __initdata
      symbol. This is perfectly legal, but may trigger a section
      mismatch warning when running the compiler in -fpic mode, due
      to the fact that the initializer may be emitted into an anonymous
      .data section thats lack the __init annotation. So work around it
      by using assignments instead.
      Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad910c7c
    • Nikolay Aleksandrov's avatar
      net: bridge: fix per-port af_packet sockets · 3b2e2904
      Nikolay Aleksandrov authored
      When the commit below was introduced it changed two visible things:
       - the skb was no longer passed through the protocol handlers with the
         original device
       - the skb was passed up the stack with skb->dev = bridge
      
      The first change broke af_packet sockets on bridge ports. For example we
      use them for hostapd which listens for ETH_P_PAE packets on the ports.
      We discussed two possible fixes:
       - create a clone and pass it through NF_HOOK(), act on the original skb
         based on the result
       - somehow signal to the caller from the okfn() that it was called,
         meaning the skb is ok to be passed, which this patch is trying to
         implement via returning 1 from the bridge link-local okfn()
      
      Note that we rely on the fact that NF_QUEUE/STOLEN would return 0 and
      drop/error would return < 0 thus the okfn() is called only when the
      return was 1, so we signal to the caller that it was called by preserving
      the return value from nf_hook().
      
      Fixes: 8626c56c ("bridge: fix potential use-after-free when hook returns QUEUE or STOLEN verdict")
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b2e2904