1. 11 4月, 2019 11 次提交
    • 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
  2. 10 4月, 2019 5 次提交
  3. 09 4月, 2019 24 次提交