1. 10 3月, 2017 3 次提交
  2. 22 2月, 2017 13 次提交
  3. 20 2月, 2017 1 次提交
  4. 31 1月, 2017 1 次提交
  5. 09 1月, 2017 1 次提交
  6. 26 12月, 2016 1 次提交
    • T
      ktime: Cleanup ktime_set() usage · 8b0e1953
      Thomas Gleixner 提交于
      ktime_set(S,N) was required for the timespec storage type and is still
      useful for situations where a Seconds and Nanoseconds part of a time value
      needs to be converted. For anything where the Seconds argument is 0, this
      is pointless and can be replaced with a simple assignment.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      8b0e1953
  7. 22 12月, 2016 1 次提交
    • T
      net: mvpp2: fix dma unmapping of TX buffers for fragments · 8354491c
      Thomas Petazzoni 提交于
      Since commit 71ce391d ("net: mvpp2: enable proper per-CPU TX
      buffers unmapping"), we are not correctly DMA unmapping TX buffers for
      fragments.
      
      Indeed, the mvpp2_txq_inc_put() function only stores in the
      txq_cpu->tx_buffs[] array the physical address of the buffer to be
      DMA-unmapped when skb != NULL. In addition, when DMA-unmapping, we use
      skb_headlen(skb) to get the size to be unmapped. Both of this works fine
      for TX descriptors that are associated directly to a SKB, but not the
      ones that are used for fragments, with a NULL pointer as skb:
      
       - We have a NULL physical address when calling DMA unmap
       - skb_headlen(skb) crashes because skb is NULL
      
      This causes random crashes when fragments are used.
      
      To solve this problem, we need to:
      
       - Store the physical address of the buffer to be unmapped
         unconditionally, regardless of whether it is tied to a SKB or not.
      
       - Store the length of the buffer to be unmapped, which requires a new
         field.
      
      Instead of adding a third array to store the length of the buffer to be
      unmapped, and as suggested by David Miller, this commit refactors the
      tx_buffs[] and tx_skb[] arrays of 'struct mvpp2_txq_pcpu' into a
      separate structure 'mvpp2_txq_pcpu_buf', to which a 'size' field is
      added. Therefore, instead of having three arrays to allocate/free, we
      have a single one, which also improve data locality, reducing the
      impact on the CPU cache.
      
      Fixes: 71ce391d ("net: mvpp2: enable proper per-CPU TX buffers unmapping")
      Reported-by: NRaphael G <raphael.glon@corp.ovh.com>
      Cc: Raphael G <raphael.glon@corp.ovh.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8354491c
  8. 26 11月, 2016 1 次提交
    • A
      mvpp2: use correct size for memset · e8f967c3
      Arnd Bergmann 提交于
      gcc-7 detects a short memset in mvpp2, introduced in the original
      merge of the driver:
      
      drivers/net/ethernet/marvell/mvpp2.c: In function 'mvpp2_cls_init':
      drivers/net/ethernet/marvell/mvpp2.c:3296:2: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
      
      The result seems to be that we write uninitialized data into the
      flow table registers, although we did not get any warning about
      that uninitialized data usage.
      
      Using sizeof() lets us initialize then entire array instead.
      
      Fixes: 3f518509 ("ethernet: Add new driver for Marvell Armada 375 network unit")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8f967c3
  9. 17 11月, 2016 1 次提交
  10. 18 10月, 2016 1 次提交
    • J
      ethernet/marvell: use core min/max MTU checking · 5777987e
      Jarod Wilson 提交于
      mvneta: min_mtu 68, max_mtu 9676
      - mtu validation routine mostly did range check, merge back into
        mvneta_change_mtu for simplicity
      
      mvpp2: min_mtu 68, max_mtu 9676
      - mtu validation routine mostly did range check, merge back into
        mvpp2_change_mtu for simplicity
      
      pxa168_eth: min_mtu 68, max_mtu 9500
      
      skge: min_mtu 60, max_mtu 9000
      
      sky2: min_mtu 68, max_mtu 1500 or 9000, depending on hw
      
      CC: netdev@vger.kernel.org
      CC: Mirko Lindner <mlindner@marvell.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5777987e
  11. 02 8月, 2016 1 次提交
  12. 29 6月, 2016 2 次提交
  13. 02 4月, 2016 2 次提交
  14. 01 4月, 2016 1 次提交
  15. 13 2月, 2016 1 次提交
    • A
      net: mvpp2: Return correct error codes · c2bb7bc5
      Amitoj Kaur Chawla 提交于
      The return value of kzalloc on failure of allocation of memory should
      be -ENOMEM and not -1.
      
      Found using Coccinelle. A simplified version of the semantic patch
      used is:
      
      //<smpl>
      @@
      expression *e;
      position p,q;
      @@
      
      e@q = kzalloc(...);
      if@p (e == NULL) {
      ...
      return
      - -1
      + -ENOMEM
      ;
      }
      //</smpl>
      
      This function may also return -1 after calling mpp2_prs_tcam_port_map_get.
      So that the function consistently returns meaningful error values on
      failure, the -1 is changed to -EINVAL.
      Signed-off-by: NAmitoj Kaur Chawla <amitoj1606@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2bb7bc5
  16. 05 12月, 2015 3 次提交
  17. 11 8月, 2015 3 次提交
    • M
      net: mvpp2: replace TX coalescing interrupts with hrtimer · edc660fa
      Marcin Wojtas 提交于
      The PP2 controller is capable of per-CPU TX processing, which means there are
      per-CPU banked register sets and queues. Current version of the driver supports
      TX packet coalescing - once on given CPU sent packets amount reaches a threshold
      value, an IRQ occurs. However, there is a single interrupt line responsible for
      CPU0/1 TX and RX events (the latter is not per-CPU, the hardware does not
      support RSS).
      
      When the top-half executes the interrupt cause is not known. This is why in
      NAPI poll function, along with RX processing, IRQ cause register on both
      CPU's is accessed in order to determine on which of them the TX coalescing
      threshold might have been reached. Thus the egress processing and releasing the
      buffers is able to take place on the corresponding CPU. Hitherto approach lead
      to an illegal usage of on_each_cpu function in softirq context.
      
      The problem is solved by resigning from TX coalescing interrupts and separating
      egress finalization from NAPI processing. For that purpose a method of using
      hrtimer is introduced. In main transmit function (mvpp2_tx) buffers are released
      once a software coalescing threshold is reached. In case not all the data is
      processed a timer is set on this CPU - in its interrupt context a tasklet is
      scheduled in which all queues are processed. At once only one timer per-CPU can
      be running, which is controlled by a dedicated flag.
      
      This commit removes TX processing from NAPI polling function, disables hardware
      coalescing and enables hrtimer with tasklet, using new per-CPU port structure
      (mvpp2_port_pcpu).
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      edc660fa
    • M
      net: mvpp2: enable proper per-CPU TX buffers unmapping · 71ce391d
      Marcin Wojtas 提交于
      mvpp2 driver allows usage of per-CPU TX processing. Once the packets are
      prepared independetly on each CPU, the hardware enqueues the descriptors in
      common TX queue. After they are sent, the buffers and associated sk_buffs
      should be released on the corresponding CPU.
      
      This is why a special index is maintained in order to point to the right data to
      be released after transmission takes place. Each per-CPU TX queue comprise an
      array of sent sk_buffs, freed in mvpp2_txq_bufs_free function. However, the
      index was used there also for obtaining a descriptor (and therefore a buffer to
      be DMA-unmapped) from common TX queue, which was wrong, because it was not
      referring to the current CPU.
      
      This commit enables proper unmapping of sent data buffers by indexing them in
      per-CPU queues using a dedicated array for keeping their physical addresses.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71ce391d
    • M
      net: mvpp2: remove excessive spinlocks from driver initialization · d53793c5
      Marcin Wojtas 提交于
      Using spinlocks protection during one-time driver initialization is not
      necessary. Moreover it resulted in invalid GFP_KERNEL allocation under the lock.
      
      This commit removes redundant spinlocks from buffer manager part of mvpp2
      initialization.
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Reported-by: NAlexandre Fournier <alexandre.fournier@wisp-e.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d53793c5
  18. 09 3月, 2015 1 次提交
  19. 02 11月, 2014 1 次提交
  20. 30 7月, 2014 1 次提交