1. 24 Jul, 2018 15 commits
    • Jiri Pirko's avatar
      net: sched: cls_flower: implement chain templates · b95ec7eb
      Jiri Pirko authored
      Use the previously introduced template extension and implement
      callback to create, destroy and dump chain template. The existing
      parsing and dumping functions are re-used. Also, check if newly added
      filters fit the template if it is set.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b95ec7eb
    • Jiri Pirko's avatar
      net: sched: cls_flower: change fl_init_dissector to accept mask and dissector · 33fb5cba
      Jiri Pirko authored
      This function is going to be used for templates as well, so we need to
      pass the pointer separately.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33fb5cba
    • Jiri Pirko's avatar
      net: sched: cls_flower: move key/mask dumping into a separate function · f5749081
      Jiri Pirko authored
      Push key/mask dumping from fl_dump() into a separate function
      fl_dump_key(), that will be reused for template dumping.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f5749081
    • Jiri Pirko's avatar
      net: sched: introduce chain templates · 9f407f17
      Jiri Pirko authored
      Allow user to set a template for newly created chains. Template lock
      down the chain for particular classifier type/options combinations.
      The classifier needs to support templates, otherwise kernel would
      reply with error.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9f407f17
    • Jiri Pirko's avatar
      net: sched: introduce chain object to uapi · 32a4f5ec
      Jiri Pirko authored
      Allow user to create, destroy, get and dump chain objects. Do that by
      extending rtnl commands by the chain-specific ones. User will now be
      able to explicitly create or destroy chains (so far this was done only
      automatically according the filter/act needs and refcounting). Also, the
      user will receive notification about any chain creation or destuction.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32a4f5ec
    • Jiri Pirko's avatar
      net: sched: Avoid implicit chain 0 creation · f71e0ca4
      Jiri Pirko authored
      Currently, chain 0 is implicitly created during block creation. However
      that does not align with chain object exposure, creation and destruction
      api introduced later on. So make the chain 0 behave the same way as any
      other chain and only create it when it is needed. Since chain 0 is
      somehow special as the qdiscs need to hold pointer to the first chain
      tp, this requires to move the chain head change callback infra to the
      block structure.
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f71e0ca4
    • Jiri Pirko's avatar
      net: sched: push ops lookup bits into tcf_proto_lookup_ops() · f34e8bff
      Jiri Pirko authored
      Push all bits that take care of ops lookup, including module loading
      outside tcf_proto_create() function, into tcf_proto_lookup_ops()
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f34e8bff
    • David S. Miller's avatar
      Merge branch 'cpsw-add-MQPRIO-and-CBS-Qdisc-offload' · d3585edf
      David S. Miller authored
      Ivan Khoronzhuk says:
      
      ====================
      net: ethernet: ti: cpsw: add MQPRIO and CBS Qdisc offload
      
      This series adds MQPRIO and CBS Qdisc offload for TI cpsw driver.
      It potentially can be used in audio video bridging (AVB) and time
      sensitive networking (TSN).
      
      Patchset was tested on AM572x EVM and BBB boards. Last patch from this
      series adds detailed description of configuration with examples. For
      consistency reasons, in role of talker and listener, tools from
      patchset "TSN: Add qdisc based config interface for CBS" were used and
      can be seen here: https://www.spinics.net/lists/netdev/msg460869.html
      
      Based on net-next/master
      
      v5..v4:
      - corrected typo of "am57xx" board name, no functional changes
      
      v4..v3:
       - nothing, just rebase
      
      v3..v2:
       - corrected typo of "shaper" word, no functional changes
      
      v2..v1:
       - changed name cpsw.txt on ti-cpsw.txt
       - changed name cpsw_set_tc() on cpsw_set_mqprio()
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3585edf
    • Ivan Khoronzhuk's avatar
      Documentation: networking: cpsw: add MQPRIO & CBS offload examples · ae62372f
      Ivan Khoronzhuk authored
      This document describes MQPRIO and CBS Qdisc offload configuration
      for cpsw driver based on examples. It potentially can be used in
      audio video bridging (AVB) and time sensitive networking (TSN).
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ae62372f
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: restore shaper configuration while down/up · 4b4255ed
      Ivan Khoronzhuk authored
      Need to restore shapers configuration after interface was down/up.
      This is needed as appropriate configuration is still replicated in
      kernel settings. This only shapers context restore, so vlan
      configuration should be restored by user if needed, especially for
      devices with one port where vlan frames are sent via ALE.
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b4255ed
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: add CBS Qdisc offload · 57d90148
      Ivan Khoronzhuk authored
      The cpsw has up to 4 FIFOs per port and upper 3 FIFOs can feed rate
      limited queue with shaping. In order to set and enable shaping for
      those 3 FIFOs queues the network device with CBS qdisc attached is
      needed. The CBS configuration is added for dual-emac/single port mode
      only, but potentially can be used in switch mode also, based on
      switchdev for instance.
      
      Despite the FIFO shapers can work w/o cpdma level shapers the base
      usage must be in combine with cpdma level shapers as described in TRM,
      that are set as maximum rates for interface queues with sysfs.
      
      One of the possible configuration with txq shapers and CBS shapers:
      
                            Configured with echo RATE >
                        /sys/class/net/eth0/queues/tx-0/tx_maxrate
                   /---------------------------------------------------
                  /
                 /            cpdma level shapers
              +----+ +----+ +----+ +----+ +----+ +----+ +----+ +----+
              | c7 | | c6 | | c5 | | c4 | | c3 | | c2 | | c1 | | c0 |
              \    / \    / \    / \    / \    / \    / \    / \    /
               \  /   \  /   \  /   \  /   \  /   \  /   \  /   \  /
                \/     \/     \/     \/     \/     \/     \/     \/
      +---------|------|------|------|-------------------------------------+
      |    +----+      |      |  +---+                                     |
      |    |      +----+      |  |                                         |
      |    v      v           v  v                                         |
      | +----+ +----+ +----+ +----+ p        p+----+ +----+ +----+ +----+  |
      | |    | |    | |    | |    | o        o|    | |    | |    | |    |  |
      | | f3 | | f2 | | f1 | | f0 | r  CPSW  r| f3 | | f2 | | f1 | | f0 |  |
      | |    | |    | |    | |    | t        t|    | |    | |    | |    |  |
      | \    / \    / \    / \    / 0        1\    / \    / \    / \    /  |
      |  \  X   \  /   \  /   \  /             \  /   \  /   \  /   \  /   |
      |   \/ \   \/     \/     \/               \/     \/     \/     \/    |
      +-------\------------------------------------------------------------+
               \
                \ FIFO shaper, set with CBS offload added in this patch,
                 \ FIFO0 cannot be rate limited
                  ------------------------------------------------------
      
      CBS shaper configuration is supposed to be used with root MQPRIO Qdisc
      offload allowing to add sk_prio->tc->txq maps that direct traffic to
      appropriate tx queue and maps L2 priority to FIFO shaper.
      
      The CBS shaper is intended to be used for AVB where L2 priority
      (pcp field) is used to differentiate class of traffic. So additionally
      vlan needs to be created with appropriate egress sk_prio->l2 prio map.
      
      If CBS has several tx queues assigned to it, the sum of their
      bandwidth has not overlap bandwidth set for CBS. It's recomended the
      CBS bandwidth to be a little bit more.
      
      The CBS shaper is configured with CBS qdisc offload interface using tc
      tool from iproute2 packet.
      
      For instance:
      
      $ tc qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \
      map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1
      
      $ tc -g class show dev eth0
      +---(100:ffe2) mqprio
      |    +---(100:3) mqprio
      |    +---(100:4) mqprio
      |    
      +---(100:ffe1) mqprio
      |    +---(100:2) mqprio
      |    
      +---(100:ffe0) mqprio
           +---(100:1) mqprio
      
      $ tc qdisc add dev eth0 parent 100:1 cbs locredit -1440 \
      hicredit 60 sendslope -960000 idleslope 40000 offload 1
      
      $ tc qdisc add dev eth0 parent 100:2 cbs locredit -1470 \
      hicredit 62 sendslope -980000 idleslope 20000 offload 1
      
      The above code set CBS shapers for tc0 and tc1, for that txq0 and
      txq1 is used. Pay attention, the real set bandwidth can differ a bit
      due to discreteness of configuration parameters.
      
      Here parameters like locredit, hicredit and sendslope are ignored
      internally and are supposed to be set with assumption that maximum
      frame size for frame - 1500.
      
      It's supposed that interface speed is not changed while reconnection,
      not always is true, so inform user in case speed of interface was
      changed, as it can impact on dependent shapers configuration.
      
      For more examples see Documentation.
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      57d90148
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: add MQPRIO Qdisc offload · 7929a668
      Ivan Khoronzhuk authored
      That's possible to offload vlan to tc priority mapping with
      assumption sk_prio == L2 prio.
      
      Example:
      $ ethtool -L eth0 rx 1 tx 4
      
      $ qdisc replace dev eth0 handle 100: parent root mqprio num_tc 3 \
      map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 1
      
      $ tc -g class show dev eth0
      +---(100:ffe2) mqprio
      |    +---(100:3) mqprio
      |    +---(100:4) mqprio
      |    
      +---(100:ffe1) mqprio
      |    +---(100:2) mqprio
      |    
      +---(100:ffe0) mqprio
           +---(100:1) mqprio
      
      Here, 100:1 is txq0, 100:2 is txq1, 100:3 is txq2, 100:4 is txq3
      txq0 belongs to tc0, txq1 to tc1, txq2 and txq3 to tc2
      The offload part only maps L2 prio to classes of traffic, but not
      to transmit queues, so to direct traffic to traffic class vlan has
      to be created with appropriate egress map.
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7929a668
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpdma: fit rated channels in backward order · 4bb6c356
      Ivan Khoronzhuk authored
      According to TRM tx rated channels should be in 7..0 order,
      so correct it.
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4bb6c356
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: use cpdma channels in backward order for txq · 79b3325d
      Ivan Khoronzhuk authored
      The cpdma channel highest priority is from hi to lo number.
      The driver has limited number of descriptors that are shared between
      number of cpdma channels. Number of queues can be tuned with ethtool,
      that allows to not spend descriptors on not needed cpdma channels.
      In AVB usually only 2 tx queues can be enough with rate limitation.
      The rate limitation can be used only for hi priority queues. Thus, to
      use only 2 queues the 8 has to be created. It's wasteful.
      
      So, in order to allow using only needed number of rate limited
      tx queues, save resources, and be able to set rate limitation for
      them, let assign tx cpdma channels in backward order to queues.
      Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
      Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79b3325d
    • David S. Miller's avatar
      Merge tag 'mlx5e-updates-2018-07-18-v2' of... · b19c7bb1
      David S. Miller authored
      Merge tag 'mlx5e-updates-2018-07-18-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux
      
      Saeed Mahameed says:
      
      ====================
      mlx5e-updates-2018-07-18
      
      This series includes update for mlx5e net device driver.
      
      1) From Feras Daoud, Added the support for firmware log tracing,
      first by introducing the firmware API needed for the task and then
      For each PF do the following:
          1- Allocate memory for the tracer strings database and read it from the FW to the SW.
          2- Allocate and dma map tracer buffers.
      
          Traces that will be written into the buffer will be parsed as a group
          of one or more traces, referred to as trace message. The trace message
          represents a C-like printf string.
      Once a new trace is available  FW will generate an event indicates new trace/s are
      available and the driver will parse them and dump them using tracepoints
      event tracing
      
      Enable mlx5 fw tracing by:
      echo 1 > /sys/kernel/debug/tracing/events/mlx5/mlx5_fw/enable
      
      Read traces by:
      cat /sys/kernel/debug/tracing/trace
      
      2) From Roi Dayan, Remove redundant WARN when we cannot find neigh entry
      
      3) From Jianbo Liu, TC double vlan support
      - Support offloading tc double vlan headers match
      - Support offloading double vlan push/pop tc actions
      
      4) From Boris, re-visit UDP GSO, remove the splitting of UDP_GSO_L4 packets
      in the driver, and exposes UDP_GSO_L4 as a PARTIAL_GSO feature.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b19c7bb1
  2. 23 Jul, 2018 25 commits