1. 12 4月, 2019 14 次提交
  2. 11 4月, 2019 13 次提交
    • L
      net: fou: remove redundant code in gue_udp_recv · 526bb57a
      Lorenzo Bianconi 提交于
      Remove not useful protocol version check in gue_udp_recv since just
      gue version 0 can hit that code. Moreover remove duplicated hdrlen
      computation
      Signed-off-by: NLorenzo Bianconi <lorenzo.bianconi@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      526bb57a
    • S
      fou: correct spelling of encapsulation · c9d52f21
      Simon Horman 提交于
      Correct spelling of encapsulation.
      Found by inspection.
      Signed-off-by: NSimon Horman <simon.horman@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9d52f21
    • D
      Merge branch 'net-sched-taprio-fix-picos_per_byte-miscalculation' · b8c7e2c3
      David S. Miller 提交于
      Leandro Dorileo says:
      
      ====================
      net/sched: taprio: fix picos_per_byte miscalculation
      
      This set fixes miscalculations based on invalid link speed values.
      
      Changes in v6:
       + Avoid locking a spinlock while calling __ethtool_get_link_ksettings()
         (suggested by: Cong Wang);
      
      Changes in v5:
       + Don't iterate over all the net_device maintained list (suggested by: Florian Fainelli);
      
      Changes in v4:
       + converted pr_info calls to netdev_dbg (suggested by: Florian Fainelli);
      
      Changes in v3:
       + yet pr_info() format warnings;
      
      Changes in v2:
       + fixed pr_info() format both on cbs and taprio patches;
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8c7e2c3
    • L
      net/sched: cbs: fix port_rate miscalculation · e0a7683d
      Leandro Dorileo 提交于
      The Credit Based Shaper heavily depends on link speed to calculate
      the scheduling credits, we can't properly calculate the credits if the
      device has failed to report the link speed.
      
      In that case we can't dequeue packets assuming a wrong port rate that will
      result into an inconsistent credit distribution.
      
      This patch makes sure we fail to dequeue case:
      
      1) __ethtool_get_link_ksettings() reports error or 2) the ethernet driver
      failed to set the ksettings' speed value (setting link speed to
      SPEED_UNKNOWN).
      
      Additionally we properly re calculate the port rate whenever the link speed
      is changed.
      
      Fixes: 3d0bd028 ("net/sched: Add support for HW offloading for CBS")
      Signed-off-by: NLeandro Dorileo <leandro.maciel.dorileo@intel.com>
      Reviewed-by: NVedang Patel <vedang.patel@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0a7683d
    • L
      net/sched: taprio: fix picos_per_byte miscalculation · 7b9eba7b
      Leandro Dorileo 提交于
      The Time Aware Priority Scheduler is heavily dependent to link speed,
      it relies on it to calculate transmission bytes per cycle, we can't
      properly calculate the so called budget if the device has failed
      to report the link speed.
      
      In that case we can't dequeue packets assuming a wrong budget.
      This patch makes sure we fail to dequeue case:
      
      1) __ethtool_get_link_ksettings() reports error or 2) the ethernet
      driver failed to set the ksettings' speed value (setting link speed
      to SPEED_UNKNOWN).
      
      Additionally we re calculate the budget whenever the link speed is
      changed.
      
      Fixes: 5a781ccb ("tc: Add support for configuring the taprio scheduler")
      Signed-off-by: NLeandro Dorileo <leandro.maciel.dorileo@intel.com>
      Reviewed-by: NVedang Patel <vedang.patel@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7b9eba7b
    • J
      net: strparser: fix comment · 93e21254
      Jakub Kicinski 提交于
      Fix comment.
      Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93e21254
    • D
      ipv4: Handle RTA_GATEWAY set to 0 · d73f80f9
      David Ahern 提交于
      Govindarajulu reported a regression with Network Manager which sends an
      RTA_GATEWAY attribute with the address set to 0. Fixup the handling of
      RTA_GATEWAY to only set fc_gw_family if the gateway address is actually
      set.
      
      Fixes: f35b794b ("ipv4: Prepare fib_config for IPv6 gateway")
      Reported-by: NGovindarajulu Varadarajan <govind.varadar@gmail.com>
      Signed-off-by: NDavid Ahern <dsahern@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d73f80f9
    • D
      Merge branch 'net-sched-move-back-qlen-to-per-CPU-accounting' · 44b9b6ca
      David S. Miller 提交于
      Paolo Abeni says:
      
      ====================
      net: sched: move back qlen to per CPU accounting
      
      The commit 46b1c18f ("net: sched: put back q.qlen into a single location")
      introduced some measurable regression in the contended scenarios for
      lock qdisc.
      
      As Eric suggested we could replace q.qlen access with calls to qdisc_is_empty()
      in the datapath and revert the above commit. The TC subsystem updates
      qdisc->is_empty in a somewhat loose way: notably 'is_empty' is set only when
      the qdisc dequeue() calls return a NULL ptr. That is, the invocation after
      the last packet is dequeued.
      
      The above is good enough for BYPASS implementation - the only downside is that
      we end up avoiding the optimization for a very small time-frame - but will
      break hard things when internal structures consistency for classful qdisc
      relies on child qdisc_is_empty().
      
      A more strict 'is_empty' update adds a relevant complexity to its life-cycle, so
      this series takes a different approach: we allow lockless qdisc to switch from
      per CPU accounting to global stats accounting when the NOLOCK bit is cleared.
      Since most pieces of infrastructure are already in place, this requires very
      little changes to the pfifo_fast qdisc, and any later NOLOCK qdisc can hook
      there with little effort - no need to maintain two different implementations.
      
      The first 2 patches removes direct qlen access from non core TC code, the 3rd
      and 4th patches place and use the infrastructure to allow stats account
      switching and the 5th patch is the actual revert.
      
       v1 -> v2:
        - fixed build issues
        - more descriptive commit message for patch 5/5
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44b9b6ca
    • P
      Revert: "net: sched: put back q.qlen into a single location" · 73eb628d
      Paolo Abeni 提交于
      This revert commit 46b1c18f ("net: sched: put back q.qlen into
      a single location").
      After the previous patch, when a NOLOCK qdisc is enslaved to a
      locking qdisc it switches to global stats accounting. As a consequence,
      when a classful qdisc accesses directly a child qdisc's qlen, such
      qdisc is not doing per CPU accounting and qlen value is consistent.
      
      In the control path nobody uses directly qlen since commit
      e5f0e8f8 ("net: sched: introduce and use qdisc tree flush/purge
      helpers"), so we can remove the contented atomic ops from the
      datapath.
      
      v1 -> v2:
       - complete the qdisc_qstats_atomic_qlen_dec() ->
         qdisc_qstats_cpu_qlen_dec() replacement, fix build issue
       - more descriptive commit message
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      73eb628d
    • P
      net: sched: when clearing NOLOCK, clear TCQ_F_CPUSTATS, too · 8a53e616
      Paolo Abeni 提交于
      Since stats updating is always consistent with TCQ_F_CPUSTATS flag,
      we can disable it at qdisc creation time flipping such bit.
      
      In my experiments, if the NOLOCK flag is cleared, per CPU stats
      accounting does not give any measurable performance gain, but it
      waste some memory.
      
      Let's clear TCQ_F_CPUSTATS together with NOLOCK, when enslaving
      a NOLOCK qdisc to 'lock' one.
      
      Use stats update helper inside pfifo_fast, to cope correctly with
      TCQ_F_CPUSTATS flag change.
      
      As a side effect, q.qlen value for any child qdiscs is always
      consistent for all lock classfull qdiscs.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8a53e616
    • P
      net: sched: always do stats accounting according to TCQ_F_CPUSTATS · 9c01c9f1
      Paolo Abeni 提交于
      The core sched implementation checks independently for NOLOCK flag
      to acquire/release the root spin lock and for qdisc_is_percpu_stats()
      to account per CPU values in many places.
      
      This change update the last few places checking the TCQ_F_NOLOCK to
      do per CPU stats accounting according to qdisc_is_percpu_stats()
      value.
      
      The above allows to clean dev_requeue_skb() implementation a bit
      and makes stats update always consistent with a single flag.
      
      v1 -> v2:
       - do not move qdisc_is_empty definition, fix build issue
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c01c9f1
    • P
      net: sched: prefer qdisc_is_empty() over direct qlen access · 1f5e6fdd
      Paolo Abeni 提交于
      When checking for root qdisc queue length, do not access directly q.qlen.
      In the following patches we will move back qlen accounting to per CPU
      values for NOLOCK qdiscs.
      
      Instead, prefer the qdisc_is_empty() helper usage.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f5e6fdd
    • P
      net: caif: avoid using qdisc_qlen() · b0a231a2
      Paolo Abeni 提交于
      Such helper does not cope correctly with NOLOCK qdiscs.
      In the following patches we will move back qlen to per CPU
      values for such qdiscs, so qdisc_qlen_sum() is not an option,
      too.
      Instead, use qlen only for lock qdiscs, and always set
      flow off for NOLOCK qdiscs with a not empty tx queue.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0a231a2
  3. 10 4月, 2019 5 次提交
  4. 09 4月, 2019 8 次提交
    • D
      310655b0
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 869e3305
      Linus Torvalds 提交于
      Pull networking fixes from David Miller:
      
       1) Off by one and bounds checking fixes in NFC, from Dan Carpenter.
      
       2) There have been many weird regressions in r8169 since we turned ASPM
          support on, some are still not understood nor completely resolved.
          Let's turn this back off for now. From Heiner Kallweit.
      
       3) Signess fixes for ethtool speed value handling, from Michael
          Zhivich.
      
       4) Handle timestamps properly in macb driver, from Paul Thomas.
      
       5) Two erspan fixes, it's the usual "skb ->data potentially reallocated
          and we're holding a stale protocol header pointer". From Lorenzo
          Bianconi.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        bnxt_en: Reset device on RX buffer errors.
        bnxt_en: Improve RX consumer index validity check.
        net: macb driver, check for SKBTX_HW_TSTAMP
        qlogic: qlcnic: fix use of SPEED_UNKNOWN ethtool constant
        broadcom: tg3: fix use of SPEED_UNKNOWN ethtool constant
        ethtool: avoid signed-unsigned comparison in ethtool_validate_speed()
        net: ip6_gre: fix possible use-after-free in ip6erspan_rcv
        net: ip_gre: fix possible use-after-free in erspan_rcv
        r8169: disable ASPM again
        MAINTAINERS: ieee802154: update documentation file pattern
        net: vrf: Fix ping failed when vrf mtu is set to 0
        selftests: add a tc matchall test case
        nfc: nci: Potential off by one in ->pipes[] array
        NFC: nci: Add some bounds checking in nci_hci_cmd_received()
      869e3305
    • L
      Merge branch 'fixes-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security · a556810d
      Linus Torvalds 提交于
      Pull TPM fixes from James Morris:
       "From Jarkko: These are critical fixes for v5.1. Contains also couple
        of new selftests for v5.1 features (partial reads in /dev/tpm0)"
      
      * 'fixes-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
        selftests/tpm2: Open tpm dev in unbuffered mode
        selftests/tpm2: Extend tests to cover partial reads
        KEYS: trusted: fix -Wvarags warning
        tpm: Fix the type of the return value in calc_tpm2_event_size()
        KEYS: trusted: allow trusted.ko to initialize w/o a TPM
        tpm: fix an invalid condition in tpm_common_poll
        tpm: turn on TPM on suspend for TPM 1.x
      a556810d
    • L
      Merge tag 'xtensa-20190408' of git://github.com/jcmvbkbc/linux-xtensa · 10d43397
      Linus Torvalds 提交于
      Pull xtensa fixes from Max Filippov:
      
       - fix syscall number passed to trace_sys_exit
      
       - fix syscall number initialization in start_thread
      
       - fix level interpretation in the return_address
      
       - fix format string warning in init_pmd
      
      * tag 'xtensa-20190408' of git://github.com/jcmvbkbc/linux-xtensa:
        xtensa: fix format string warning in init_pmd
        xtensa: fix return_address
        xtensa: fix initialization of pt_regs::syscall in start_thread
        xtensa: use actual syscall number in do_syscall_trace_leave
      10d43397
    • D
      Merge branch 'bnxt_en-fixes' · e063f459
      David S. Miller 提交于
      Michael Chan says:
      
      ====================
      bnxt_en: 2 bug fixes.
      
      The first patch prevents possible driver crash if we get a bad RX index
      from the hardware.  The second patch resets the device when the hardware
      reports buffer error to recover from the error.
      
      Please queue these for -stable also.  Thanks.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e063f459
    • M
      bnxt_en: Reset device on RX buffer errors. · 8e44e96c
      Michael Chan 提交于
      If the RX completion indicates RX buffers errors, the RX ring will be
      disabled by firmware and no packets will be received on that ring from
      that point on.  Recover by resetting the device.
      
      Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8e44e96c
    • M
      bnxt_en: Improve RX consumer index validity check. · a1b0e4e6
      Michael Chan 提交于
      There is logic to check that the RX/TPA consumer index is the expected
      index to work around a hardware problem.  However, the potentially bad
      consumer index is first used to index into an array to reference an entry.
      This can potentially crash if the bad consumer index is beyond legal
      range.  Improve the logic to use the consumer index for dereferencing
      after the validity check and log an error message.
      
      Fixes: fa7e2812 ("bnxt_en: Add workaround to detect bad opaque in rx completion (part 2)")
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a1b0e4e6
    • P
      net: macb driver, check for SKBTX_HW_TSTAMP · a6252047
      Paul Thomas 提交于
      Make sure SKBTX_HW_TSTAMP (i.e. SOF_TIMESTAMPING_TX_HARDWARE) has been
      enabled for this skb. It does fix the issue where normal socks that
      aren't expecting a timestamp will not wake up on select, but when a
      user does want a SOF_TIMESTAMPING_TX_HARDWARE it does work.
      Signed-off-by: NPaul Thomas <pthomas8589@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6252047