1. 18 6月, 2019 2 次提交
  2. 03 6月, 2019 1 次提交
  3. 06 2月, 2019 1 次提交
  4. 08 1月, 2019 1 次提交
  5. 07 12月, 2018 1 次提交
  6. 01 10月, 2018 1 次提交
    • D
      IB/hfi1: Prepare resource waits for dual leg · 5da0fc9d
      Dennis Dalessandro 提交于
      Current implementation allows each qp to have only one send engine.  As
      such, each qp has only one list to queue prebuilt packets when send engine
      resources are not available. To improve performance, it is desired to
      support multiple send engines for each qp.
      
      This patch creates the framework to support two send engines
      (two legs) for each qp for the TID RDMA protocol, which can be easily
      extended to support more send engines. It achieves the goal by creating a
      leg specific struct, iowait_work in the iowait struct, to hold the
      work_struct and the tx_list as well as a pointer to the parent iowait
      struct.
      
      The hfi1_pkt_state now has an additional field to record the current legs
      work structure and that is now passed to all egress waiters to determine
      the leg that needs to wait via a new iowait helper.  The APIs are adjusted
      to use the new leg specific struct as required.
      
      Many new and modified helpers are added to support this change.
      Reviewed-by: NMitko Haralanov <mitko.haralanov@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NKaike Wan <kaike.wan@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      5da0fc9d
  7. 12 9月, 2018 1 次提交
  8. 22 6月, 2018 1 次提交
  9. 13 6月, 2018 1 次提交
    • K
      treewide: Use array_size() in kvzalloc_node() · 84ca176b
      Kees Cook 提交于
      The kvzalloc_node() function has no 2-factor argument form, so
      multiplication factors need to be wrapped in array_size(). This patch
      replaces cases of:
      
              kvzalloc_node(a * b, gfp, node)
      
      with:
              kvzalloc_node(array_size(a, b), gfp, node)
      
      as well as handling cases of:
      
              kvzalloc_node(a * b * c, gfp, node)
      
      with:
      
              kvzalloc_node(array3_size(a, b, c), gfp, node)
      
      This does, however, attempt to ignore constant size factors like:
      
              kvzalloc_node(4 * 1024, gfp, node)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kvzalloc_node(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kvzalloc_node(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kvzalloc_node(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kvzalloc_node(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
        kvzalloc_node(
      -	sizeof(TYPE) * (COUNT_ID)
      +	array_size(COUNT_ID, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * COUNT_ID
      +	array_size(COUNT_ID, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * (COUNT_CONST)
      +	array_size(COUNT_CONST, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * COUNT_CONST
      +	array_size(COUNT_CONST, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * (COUNT_ID)
      +	array_size(COUNT_ID, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * COUNT_ID
      +	array_size(COUNT_ID, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * (COUNT_CONST)
      +	array_size(COUNT_CONST, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * COUNT_CONST
      +	array_size(COUNT_CONST, sizeof(THING))
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
        kvzalloc_node(
      -	SIZE * COUNT
      +	array_size(COUNT, SIZE)
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kvzalloc_node(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kvzalloc_node(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kvzalloc_node(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kvzalloc_node(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kvzalloc_node(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kvzalloc_node(C1 * C2 * C3, ...)
      |
        kvzalloc_node(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants.
      @@
      expression E1, E2;
      constant C1, C2;
      @@
      
      (
        kvzalloc_node(C1 * C2, ...)
      |
        kvzalloc_node(
      -	E1 * E2
      +	array_size(E1, E2)
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      84ca176b
  10. 05 6月, 2018 1 次提交
  11. 02 2月, 2018 2 次提交
    • K
      IB/hfi1: Convert kzalloc_node and kcalloc to use kcalloc_node · 953a9ceb
      Kamenee Arumugam 提交于
      Kzalloc_node API doesn't check for overflows in size multiplication.
      While kcalloc API check for overflows in size multiplication
      but these implementations are not NUMA-aware.
      
      This conversion allowed for correcting an allocation used in the hot
      path to be on the local NUMA and ensure us overflow free multiplication
      for the size of a memory allocation.
      Reviewed-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NKamenee Arumugam <kamenee.arumugam@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      953a9ceb
    • A
      IB/hfi1: Fix for early release of sdma context · 473291b3
      Alex Estrin 提交于
      With IRQF_SHARED flag set and CONFIG_DEBUG_SHIRQ enabled
      module removal may result in panic in sdma_interrupt() routine
      if associated sdma context was released before pci_free_irq();
      
      [ 9198.939885] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [ 9198.940514] IP: sdma_make_progress+0xa5/0x450 [hfi1]
      [ 9198.941114] PGD 170bdc0067 P4D 170bdc0067 PUD 172063e067 PMD 0
      [ 9198.941783] Oops: 0000 [#1] SMP
      .....
      [ 9198.958877] CPU: 132 PID: 64173 Comm: rmmod Tainted: G           OE   4.14.0-rc4+ #1
      [ 9198.961032] Hardware name: Intel Corporation S7200AP/S7200AP, BIOS S72C610.86B.01.02.0118.080620171935 08/06/2017
      [ 9198.963323] task: ffff9681397f0000 task.stack: ffffae1647c40000
      [ 9198.965695] RIP: 0010:sdma_make_progress+0xa5/0x450 [hfi1]
      [ 9198.968082] RSP: 0018:ffffae1647c43be8 EFLAGS: 00010046
      [ 9198.970503] RAX: 0000000000000000 RBX: ffff9680ce8b5ca8 RCX: 0000000000000000
      [ 9198.973006] RDX: 0000000000000000 RSI: 0000000001a00d28 RDI: ffff9680ce8b5ca0
      [ 9198.975546] RBP: ffffae1647c43c40 R08: ffff96814325ec00 R09: 00000000ffffffff
      [ 9198.978142] R10: 000000004325e501 R11: ffff96814325ec00 R12: ffff9680ce8b5c44
      [ 9198.980779] R13: ffff9680ce8b5ca0 R14: 0000000000000000 R15: ffff9680ce8b5b00
      [ 9198.983462] FS:  00007f31196ba740(0000) GS:ffff96819df00000(0000) knlGS:0000000000000000
      [ 9198.986231] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 9198.989036] CR2: 0000000000000000 CR3: 000000170833f000 CR4: 00000000001406e0
      [ 9198.991911] Call Trace:
      [ 9198.994847]  sdma_engine_interrupt+0x82/0x100 [hfi1]
      [ 9198.997852]  sdma_interrupt+0x61/0xc0 [hfi1]
      [ 9199.000852]  __free_irq+0x1b3/0x2d0
      [ 9199.003873]  free_irq+0x35/0x70
      [ 9199.006909]  pci_free_irq+0x1c/0x30
      [ 9199.009999]  clean_up_interrupts+0x53/0xf0 [hfi1]
      [ 9199.013137]  hfi1_start_cleanup+0x117/0x190 [hfi1]
      [ 9199.016315]  postinit_cleanup+0x1d/0x270 [hfi1]
      [ 9199.019529]  remove_one+0x1f3/0x210 [hfi1]
      [ 9199.022738]  pci_device_remove+0x39/0xc0
      [ 9199.025974]  device_release_driver_internal+0x141/0x210
      [ 9199.029268]  driver_detach+0x3f/0x80
      [ 9199.032580]  bus_remove_driver+0x55/0xd0
      [ 9199.035931]  driver_unregister+0x2c/0x50
      [ 9199.039321]  pci_unregister_driver+0x2a/0xa0
      [ 9199.042755]  hfi1_mod_cleanup+0x10/0xb50 [hfi1]
      [ 9199.046196]  SyS_delete_module+0x171/0x250
      ...
      
      Fix by exporting sdma_clean() and removing from sdma_exit().
      sdma_exit() now just manipulates the engine state,
      leaving the memory free to sdma_clean() which is now called
      just before the dd is freed.
      Reviewed-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Reviewed-by: NMichael J Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: NAlex Estrin <alex.estrin@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      473291b3
  12. 06 12月, 2017 1 次提交
    • P
      drivers/infiniband: Remove now-redundant smp_read_barrier_depends() · adf90eb4
      Paul E. McKenney 提交于
      The smp_read_barrier_depends() does nothing at all except on DEC Alpha,
      and no current DEC Alpha systems use Infiniband:
      
      	lkml.kernel.org/r/20171023085921.jwbntptn6ictbnvj@tower
      
      This commit therefore makes Infiniband depend on !ALPHA and removes
      the now-ineffective invocations of smp_read_barrier_depends() from
      the InfiniBand driver.
      
      Please note that this patch should not be construed as my saying that
      InfiniBand's memory ordering is correct, but rather that this patch does
      not in any way affect InfiniBand's correctness.  In other words, the
      result of applying this patch is bug-for-bug compatible with the original.
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Cree <mcree@orcon.net.nz>
      Cc: Andrea Parri <parri.andrea@gmail.com>
      Cc: <linux-rdma@vger.kernel.org>
      Cc: <linux-alpha@vger.kernel.org>
      [ paulmck: Removed drivers/dma/ioat/dma.c per Jason Gunthorpe's feedback. ]
      Acked-by: NJason Gunthorpe <jgg@mellanox.com>
      adf90eb4
  13. 31 10月, 2017 1 次提交
  14. 25 10月, 2017 1 次提交
    • M
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns... · 6aa7de05
      Mark Rutland 提交于
      locking/atomics: COCCINELLE/treewide: Convert trivial ACCESS_ONCE() patterns to READ_ONCE()/WRITE_ONCE()
      
      Please do not apply this to mainline directly, instead please re-run the
      coccinelle script shown below and apply its output.
      
      For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
      preference to ACCESS_ONCE(), and new code is expected to use one of the
      former. So far, there's been no reason to change most existing uses of
      ACCESS_ONCE(), as these aren't harmful, and changing them results in
      churn.
      
      However, for some features, the read/write distinction is critical to
      correct operation. To distinguish these cases, separate read/write
      accessors must be used. This patch migrates (most) remaining
      ACCESS_ONCE() instances to {READ,WRITE}_ONCE(), using the following
      coccinelle script:
      
      ----
      // Convert trivial ACCESS_ONCE() uses to equivalent READ_ONCE() and
      // WRITE_ONCE()
      
      // $ make coccicheck COCCI=/home/mark/once.cocci SPFLAGS="--include-headers" MODE=patch
      
      virtual patch
      
      @ depends on patch @
      expression E1, E2;
      @@
      
      - ACCESS_ONCE(E1) = E2
      + WRITE_ONCE(E1, E2)
      
      @ depends on patch @
      expression E;
      @@
      
      - ACCESS_ONCE(E)
      + READ_ONCE(E)
      ----
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: davem@davemloft.net
      Cc: linux-arch@vger.kernel.org
      Cc: mpe@ellerman.id.au
      Cc: shuah@kernel.org
      Cc: snitzer@redhat.com
      Cc: thor.thayer@linux.intel.com
      Cc: tj@kernel.org
      Cc: viro@zeniv.linux.org.uk
      Cc: will.deacon@arm.com
      Link: http://lkml.kernel.org/r/1508792849-3115-19-git-send-email-paulmck@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      6aa7de05
  15. 18 10月, 2017 1 次提交
    • K
      IB/hfi1: Convert timers to use timer_setup() · 8064135e
      Kees Cook 提交于
      In preparation for unconditionally passing the struct timer_list pointer to
      all timer callbacks, switch to using the new timer_setup() and from_timer()
      to pass the timer pointer explicitly. Switches test of .data field to
      .function, since .data will be going away.
      
      Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
      Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Sean Hefty <sean.hefty@intel.com>
      Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
      Cc: linux-rdma@vger.kernel.org
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      8064135e
  16. 15 10月, 2017 2 次提交
  17. 27 9月, 2017 1 次提交
  18. 01 8月, 2017 2 次提交
  19. 28 6月, 2017 1 次提交
  20. 06 4月, 2017 2 次提交
  21. 02 3月, 2017 1 次提交
    • I
      sched/core: Remove the tsk_cpus_allowed() wrapper · 0c98d344
      Ingo Molnar 提交于
      So the original intention of tsk_cpus_allowed() was to 'future-proof'
      the field - but it's pretty ineffectual at that, because half of
      the code uses ->cpus_allowed directly ...
      
      Also, the wrapper makes the code longer than the original expression!
      
      So just get rid of it. This also shrinks <linux/sched.h> a bit.
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      0c98d344
  22. 16 11月, 2016 2 次提交
  23. 02 10月, 2016 3 次提交
  24. 26 5月, 2016 2 次提交
  25. 14 5月, 2016 1 次提交
  26. 11 3月, 2016 6 次提交