1. 02 Dec, 2016 5 commits
  2. 01 Dec, 2016 11 commits
  3. 30 Nov, 2016 24 commits
    • Gao Feng's avatar
      driver: ipvlan: Remove useless member mtu_adj of struct ipvl_dev · 8f679ed8
      Gao Feng authored
      The mtu_adj is initialized to zero when alloc mem, there is no any
      assignment to mtu_adj. It is only used in ipvlan_adjust_mtu as one
      right value.
      So it is useless member of struct ipvl_dev, then remove it.
      Signed-off-by: default avatarGao Feng <fgao@ikuai8.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f679ed8
    • Souptick Joarder's avatar
      ethernet :mellanox :mlx5: Replace pci_pool_alloc by pci_pool_zalloc · fec668d3
      Souptick Joarder authored
      In alloc_cmd_box(), pci_pool_alloc() followed by memset will be
      replaced by pci_pool_zalloc()
      Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fec668d3
    • Souptick Joarder's avatar
      ethernet :mellanox :mlx4: Replace pci_pool_alloc by pci_pool_zalloc · 77d1337b
      Souptick Joarder authored
      In mlx4_alloc_cmd_mailbox(), pci_pool_alloc() followed by memset will be
      replaced by pci_pool_zalloc()
      Signed-off-by: default avatarSouptick joarder <jrdr.linux@gmail.com>
      Reviewed-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      77d1337b
    • Lorenzo Colitti's avatar
      net: ipv4: Don't crash if passing a null sk to ip_rt_update_pmtu. · d109e61b
      Lorenzo Colitti authored
      Commit e2d118a1 ("net: inet: Support UID-based routing in IP
      protocols.") made __build_flow_key call sock_net(sk) to determine
      the network namespace of the passed-in socket. This crashes if sk
      is NULL.
      
      Fix this by getting the network namespace from the skb instead.
      
      Fixes: e2d118a1 ("net: inet: Support UID-based routing in IP protocols.")
      Reported-by: default avatarErez Shitrit <erezsh@dev.mellanox.co.il>
      Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d109e61b
    • Josef Bacik's avatar
      bpf: add test for the verifier equal logic bug · e9548901
      Josef Bacik authored
      This is a test to verify that
      
      bpf: fix states equal logic for varlen access
      
      actually fixed the problem.  The problem was if the register we added to our map
      register was UNKNOWN in both the false and true branches and the only thing that
      changed was the range then we'd incorrectly assume that the true branch was
      valid, which it really wasnt.  This tests this case and properly fails without
      my fix in place and passes with it in place.
      Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
      Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
      Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9548901
    • David S. Miller's avatar
      Merge branch 'cpsw-per-channel-shaping' · ddf952a1
      David S. Miller authored
      Ivan Khoronzhuk says:
      
      ====================
      cpsw: add per channel shaper configuration
      
      This series is intended to allow user to set rate for per channel
      shapers at cpdma level. This patchset doesn't have impact on performance.
      The rate can be set with:
      
      echo 100 > /sys/class/net/ethX/queues/tx-0/tx_maxrate
      
      Tested on am572xx
      Based on net-next/master
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddf952a1
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: split tx budget according between channels · 8feb0a19
      Ivan Khoronzhuk authored
      Split device budget between channels according to channel rate.
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8feb0a19
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: optimize end of poll cycle · 342934a5
      Ivan Khoronzhuk authored
      Check budget fullness only after it's updated and update
      channel mask only once to keep budget balance between channels.
      It's also needed for farther changes.
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      342934a5
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: cpsw: add .ndo to set per-queue rate · 83fcad0c
      Ivan Khoronzhuk authored
      This patch allows to rate limit queues tx queues for cpsw interface.
      The rate is set in absolute Mb/s units and cannot be more a speed
      an interface is connected with.
      
      The rate for a tx queue can be tested with:
      
      ethtool -L eth0 rx 4 tx 4
      
      echo 100 > /sys/class/net/eth0/queues/tx-0/tx_maxrate
      echo 200 > /sys/class/net/eth0/queues/tx-1/tx_maxrate
      echo 50 > /sys/class/net/eth0/queues/tx-2/tx_maxrate
      echo 30 > /sys/class/net/eth0/queues/tx-3/tx_maxrate
      
      tc qdisc add dev eth0 root handle 1: multiq
      
      tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip\
      dport 5001 0xffff action skbedit queue_mapping 0
      
      tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip\
      dport 5002 0xffff action skbedit queue_mapping 1
      
      tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip\
      dport 5003 0xffff action skbedit queue_mapping 2
      
      tc filter add dev eth0 parent 1: protocol ip prio 1 u32 match ip\
      dport 5004 0xffff action skbedit queue_mapping 3
      
      iperf -c 192.168.2.1 -b 110M -p 5001 -f m -t 60
      iperf -c 192.168.2.1 -b 215M -p 5002 -f m -t 60
      iperf -c 192.168.2.1 -b 55M -p 5003 -f m -t 60
      iperf -c 192.168.2.1 -b 32M -p 5004 -f m -t 60
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      83fcad0c
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: davinci_cpdma: add set rate for a channel · 8f32b909
      Ivan Khoronzhuk authored
      The cpdma has 8 rate limited tx channels. This patch adds
      ability for cpdma driver to use 8 tx h/w shapers. If at least one
      channel is not rate limited then it must have higher number, this
      is because the rate limited channels have to have higher priority
      then not rate limited channels. The channel priority is set in low-hi
      direction already, so that when a new channel is added with ethtool
      and it doesn't have rate yet, it cannot affect on rate limited
      channels. It can be useful for TSN streams and just in cases when
      h/w rate limited channels are needed.
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f32b909
    • Ivan Khoronzhuk's avatar
      net: ethernet: ti: davinci_cpdma: add weight function for channels · 0fc6432c
      Ivan Khoronzhuk authored
      The weight of a channel is needed to split descriptors between
      channels. The weight can depend on maximum rate of channels, maximum
      rate of an interface or other reasons. The channel weight is in
      percentage and is independent for rx and tx channels.
      Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0fc6432c
    • David S. Miller's avatar
      Merge branch 'qed-XDP-support' · 348bfec2
      David S. Miller authored
      Yuval Mintz says:
      
      ====================
      qed*: Add XDP support
      
      This patch series is intended to add XDP to the qede driver, although
      it contains quite a bit of cleanups, refactorings and infrastructure
      changes as well.
      
      The content of this series can be roughly divided into:
      
       - Datapath improvements - mostly focused on having the datapath utilize
      parameters which can be more tightly contained in cachelines.
      Patches #1, #2, #8, #9 belong to this group.
      
       - Refactoring - done mostly in favour of XDP. Patches #3, #4, #5, #9.
      
       - Infrastructure changes - done in favour of XDP. Paches #6 and #7 belong
      to this category [#7 being by far the biggest patch in the series].
      
       - Actual XDP support - last two patches [#10, #11].
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      348bfec2
    • Mintz, Yuval's avatar
      qede: Add support for XDP_TX · cb6aeb07
      Mintz, Yuval authored
      Add support for forwarding via XDP. Once the eBPF is attached,
      driver would allocate & configure a designated transmission queue
      meant solely for forwarding packets. Said queue would share the
      receive-queue's interrupt line, and would have it's own Tx statistics.
      
      Infrastructure changes required for this [spread-out through the code]:
       - Determine the DMA direction of the receive buffers based on the presence
      of the eBPF program.
       - Turn the sw Tx ring into a union, as regular/XDP queues have different
      needs for releasing resources after completion [regular requires the SKB,
      XDP requires the transmitted page].
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cb6aeb07
    • Mintz, Yuval's avatar
      qede: Add basic XDP support · 496e0517
      Mintz, Yuval authored
      Add support for the ndo_xdp callback. This patch would support XDP_PASS,
      XDP_DROP and XDP_ABORTED commands.
      
      This also adds a per Rx queue statistic which counts number of packets
      which didn't reach the stack [due to XDP].
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      496e0517
    • Mintz, Yuval's avatar
      qede: Better utilize the qede_[rt]x_queue · 9eb22357
      Mintz, Yuval authored
      Improve the cacheline usage of both queues by reordering -
      This reduces the cachelines required for egress datapath processing
      from 3 to 2 and those required by ingress datapath processing by 2.
      
      It also changes a couple of datapath related functions that currently
      require either the fastpath or the qede_dev, changing them to be based
      on the tx/rx queue instead.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9eb22357
    • Mintz, Yuval's avatar
      qede: Don't check netdevice for rx-hash · 8a472530
      Mintz, Yuval authored
      Receive-hashing is a fixed feature, so there's no need to check
      during the ingress datapath whether it's set or not.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8a472530
    • Mintz, Yuval's avatar
      qed*: Handle-based L2-queues. · 3da7a37a
      Mintz, Yuval authored
      The driver needs to maintain several FW/HW-indices for each one of
      its queues. Currently, that mapping is done by the QED where it uses
      an rx/tx array of so-called hw-cids, populating them whenever a new
      queue is opened and clearing them upon destruction of said queues.
      
      This maintenance is far from ideal - there's no real reason why
      QED needs to maintain such a data-structure. It becomes even worse
      when considering the fact that the PF's queues and its child VFs' queues
      are all mapped into the same data-structure.
      As a by-product, the set of parameters an interface needs to supply for
      queue APIs is non-trivial, and some of the variables in the API
      structures have different meaning depending on their exact place
      in the configuration flow.
      
      This patch re-organizes the way L2 queues are configured and maintained.
      In short:
        - Required parameters for queue init are now well-defined.
        - Qed would allocate a queue-cid based on parameters.
          Upon initialization success, it would return a handle to caller.
        - Queue-handle would be maintained by entity requesting queue-init,
          not necessarily qed.
        - All further queue-APIs [update, destroy] would use the opaque
          handle as reference for the queue instead of various indices.
      
      The possible owners of such handles:
        - PF queues [qede] - complete handles based on provided configuration.
        - VF queues [qede] - fw-context-less handles, containing only relative
          information; Only the PF-side would need the absolute indices
          for configuration, so they're omitted here.
        - VF queues [qed, PF-side] - complete handles based on VF initialization.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3da7a37a
    • Mintz, Yuval's avatar
      qede: Revise state locking scheme · 567b3c12
      Mintz, Yuval authored
      As qede utilizes an internal-reload sequence as result of various
      configuration changes, the netif state wouldn't always accurately describe
      the status of the configuration.
      To compensate, we're storing an internal state of the device, which should
      only be accessed under the qede_lock.
      
      This patch fixes and improves several state/lock interactions:
        - The internal state should only be checked while locked.
        - While holding lock, it's preferable to check state rather than
          the netdevice's state.
        - The reload sequence is not 'atomic' - unload and subsequent load
          are not in the same critical section.
      
      This also add the 'locked' variant for the reload, which would later be
      used by XDP - useful in the case where the correct sequence is 'lock,
      check state and re-configure if good', instead of allowing the reload
      itself to make the decision regarding the configurability of the device.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      567b3c12
    • Mintz, Yuval's avatar
      qede: Refactor data-path Rx flow · f4fad34c
      Mintz, Yuval authored
      Driver's NAPI poll is using a long sequence for processing ingress
      packets, and it's going to get even longer once we do XDP.
      Break down the main loop into a series of sub-functions to allow
      better readability of the function.
      
      While we're at it, correct the accounting of the NAPI budget -
      currently we're counting only packets passed to the stack against
      the budget, even in case those are actually aggregations.
      After refactoring every CQE processed would be counted against the budget.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4fad34c
    • Mintz, Yuval's avatar
      qede: Refactor statistics gathering · 4dbcd640
      Mintz, Yuval authored
      Refactor logic for gathering statistics into a per-queue function.
      This improves readability of the driver statistics' flows.
      
      In addition, this would be required by the XDP forwarding queues
      [as we'll need the Txq statistics gathering methods for those as well].
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4dbcd640
    • Mintz, Yuval's avatar
      qede: Remove 'num_tc'. · 80439a17
      Mintz, Yuval authored
      Driver currently doesn't support multi-CoS, but it contains logic
      where multiple transmission queues could be theoretically manipulated.
      No point in maintaining the infrastructure at the moment.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      80439a17
    • Mintz, Yuval's avatar
      qed: Optimize qed_chain datapath usage · 6d937acf
      Mintz, Yuval authored
      The chain structure and functions are widely used by the qed* modules,
      both for configuration and datapath.
      E.g., qede's Tx has one such chain and its Rx has two.
      
      Currently, the strucutre's fields which are required for datapath
      related functions [produce/consume] are intertwined with fields which
      are required only for configuration purposes [init/destroy/etc.].
      
      This patch re-arranges the chain structure so that all the fields which
      are required for datapath usage could reside in a single cacheline instead
      of the two which are required today.
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d937acf
    • Mintz, Yuval's avatar
      qede: Optimize aggregation information size · 01e23015
      Mintz, Yuval authored
      Driver needs to maintain a structure per-each concurrent possible
      open aggregation, but the structure storing that metadata is far from
      being optimized - biggest waste in it is that there are 2 buffer metadata,
      one for a replacement buffer when the aggregation begins and the other for
      holding the first aggregation's buffer after it begins [as firmware might
      still update it]. Those 2 can safely be united into a single metadata
      structure.
      
      struct qede_agg_info changes the following:
      
      	/* size: 120, cachelines: 2, members: 9 */
      	/* sum members: 114, holes: 1, sum holes: 4 */
      	/* padding: 2 */
      	/* paddings: 2, sum paddings: 8 */
      	/* last cacheline: 56 bytes */
       -->
      	/* size: 48, cachelines: 1, members: 9 */
      	/* paddings: 1, sum paddings: 4 */
      	/* last cacheline: 48 bytes */
      Signed-off-by: default avatarYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      01e23015
    • Tobias Klauser's avatar
      ehea: Remove unnecessary memset of stats in netdev private data · f54b8cd6
      Tobias Klauser authored
      The memory for netdev private data is allocated using kzalloc/vzalloc in
      alloc_netdev_mqs, thus there is no need to zero the stats portion of it
      again in the driver's probe function.
      
      In any case, the size for the memset is wrong as the stats member is of
      type rtnl_link_stats64, not net_device_stats.
      Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f54b8cd6