1. 29 10月, 2019 1 次提交
  2. 26 6月, 2018 1 次提交
  3. 09 5月, 2018 1 次提交
  4. 09 3月, 2018 1 次提交
  5. 29 9月, 2017 2 次提交
    • S
      iw_cxgb4: add referencing to wait objects · 2015f26c
      Steve Wise 提交于
      For messages sent from the host to fw that solicit a reply from fw,
      the c4iw_wr_wait struct pointer is passed in the host->fw message, and
      included in the fw->host fw6_msg reply.  This allows the sender to wait
      until the reply is received, and the code processing the ingress reply
      to wake up the sender.
      
      If c4iw_wait_for_reply() times out, however, we need to keep the
      c4iw_wr_wait object around in case the reply eventually does arrive.
      Otherwise we have touch-after-free bugs in the wake_up paths.
      
      This was hit due to a bad kernel driver that blocked ingress processing
      of cxgb4 for a long time, causing iw_cxgb4 timeouts, but eventually
      resuming ingress processing and thus hitting the touch-after-free bug.
      
      So I want to fix iw_cxgb4 such that we'll at least keep the wait object
      around until the reply comes.  If it never comes we leak a small amount of
      memory, but if it does come late, we won't potentially crash the system.
      
      So add a kref struct in the c4iw_wr_wait struct, and take a reference
      before sending a message to FW that will generate a FW6 reply.  And remove
      the reference (and potentially free the wait object) when the reply
      is processed.
      
      The ep code also uses the wr_wait for non FW6 CPL messages and doesn't
      embed the c4iw_wr_wait object in the message sent to firmware.  So for
      those cases we add c4iw_wake_up_noref().
      
      The mr/mw, cq, and qp object create/destroy paths do need this reference
      logic.  For these paths, c4iw_ref_send_wait() is introduced to take the
      wr_wait reference, send the msg to fw, and then wait for the reply.
      
      So going forward, iw_cxgb4 either uses c4iw_ofld_send(),
      c4iw_wait_for_reply() and c4iw_wake_up_noref() like is done in the some
      of the endpoint logic, or c4iw_ref_send_wait() and c4iw_wake_up_deref()
      (formerly c4iw_wake_up()) when sending messages with the c4iw_wr_wait
      object pointer embedded in the message and resulting FW6 reply.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      2015f26c
    • S
      iw_cxgb4: allocate wait object for each memory object · a3f12da0
      Steve Wise 提交于
      Remove the local stack allocated c4iw_wr_wait object in preparation for
      correctly handling timeouts.
      
      Also refactored some code to simplify it and make errpath unwinding
      more readable.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      a3f12da0
  6. 27 9月, 2017 1 次提交
  7. 16 8月, 2017 1 次提交
  8. 21 6月, 2017 1 次提交
    • Y
      net: introduce __skb_put_[zero, data, u8] · de77b966
      yuan linyu 提交于
      follow Johannes Berg, semantic patch file as below,
      @@
      identifier p, p2;
      expression len;
      expression skb;
      type t, t2;
      @@
      (
      -p = __skb_put(skb, len);
      +p = __skb_put_zero(skb, len);
      |
      -p = (t)__skb_put(skb, len);
      +p = __skb_put_zero(skb, len);
      )
      ... when != p
      (
      p2 = (t2)p;
      -memset(p2, 0, len);
      |
      -memset(p, 0, len);
      )
      
      @@
      identifier p;
      expression len;
      expression skb;
      type t;
      @@
      (
      -t p = __skb_put(skb, len);
      +t p = __skb_put_zero(skb, len);
      )
      ... when != p
      (
      -memset(p, 0, len);
      )
      
      @@
      type t, t2;
      identifier p, p2;
      expression skb;
      @@
      t *p;
      ...
      (
      -p = __skb_put(skb, sizeof(t));
      +p = __skb_put_zero(skb, sizeof(t));
      |
      -p = (t *)__skb_put(skb, sizeof(t));
      +p = __skb_put_zero(skb, sizeof(t));
      )
      ... when != p
      (
      p2 = (t2)p;
      -memset(p2, 0, sizeof(*p));
      |
      -memset(p, 0, sizeof(*p));
      )
      
      @@
      expression skb, len;
      @@
      -memset(__skb_put(skb, len), 0, len);
      +__skb_put_zero(skb, len);
      
      @@
      expression skb, len, data;
      @@
      -memcpy(__skb_put(skb, len), data, len);
      +__skb_put_data(skb, data, len);
      
      @@
      expression SKB, C, S;
      typedef u8;
      identifier fn = {__skb_put};
      fresh identifier fn2 = fn ## "_u8";
      @@
      - *(u8 *)fn(SKB, S) = C;
      + fn2(SKB, C);
      Signed-off-by: Nyuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      de77b966
  9. 16 6月, 2017 1 次提交
    • J
      networking: make skb_put & friends return void pointers · 4df864c1
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions (skb_put, __skb_put and pskb_put) return void *
      and remove all the casts across the tree, adding a (u8 *) cast only
      where the unsigned char pointer was used directly, all done with the
      following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_put, __skb_put };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_put, __skb_put };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
      which actually doesn't cover pskb_put since there are only three
      users overall.
      
      A handful of stragglers were converted manually, notably a macro in
      drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
      instances in net/bluetooth/hci_sock.c. In the former file, I also
      had to fix one whitespace problem spatch introduced.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4df864c1
  10. 26 4月, 2017 2 次提交
  11. 21 4月, 2017 2 次提交
  12. 17 11月, 2016 1 次提交
  13. 08 10月, 2016 1 次提交
    • S
      iw_cxgb4: add fast-path for small REG_MR operations · 49b53a93
      Steve Wise 提交于
      When processing a REG_MR work request, if fw supports the
      FW_RI_NSMR_TPTE_WR work request, and if the page list for this
      registration is <= 2 pages, and the current state of the mr is INVALID,
      then use FW_RI_NSMR_TPTE_WR to pass down a fully populated TPTE for FW
      to write.  This avoids FW having to do an async read of the TPTE blocking
      the SQ until the read completes.
      
      To know if the current MR state is INVALID or not, iw_cxgb4 must track the
      state of each fastreg MR.  The c4iw_mr struct state is updated as REG_MR
      and LOCAL_INV WRs are posted and completed, when a reg_mr is destroyed,
      and when RECV completions are processed that include a local invalidation.
      
      This optimization increases small IO IOPS for both iSER and NVMF.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      49b53a93
  14. 03 8月, 2016 1 次提交
  15. 23 6月, 2016 1 次提交
  16. 14 5月, 2016 3 次提交
  17. 02 3月, 2016 1 次提交
  18. 01 3月, 2016 1 次提交
  19. 24 12月, 2015 2 次提交
  20. 29 10月, 2015 2 次提交
  21. 22 10月, 2015 1 次提交
    • A
      RDMA/cxgb4: re-fix 32-bit build warning · b61e564a
      Arnd Bergmann 提交于
      Casting a pointer to __be64 produces a warning on 32-bit architectures:
      
      drivers/infiniband/hw/cxgb4/mem.c:147:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
          req->wr.wr_lo = (__force __be64)&wr_wait;
      
      This was fixed at least twice for this driver in different places,
      and accidentally reverted once more. This puts the correct version
      back in place.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 6198dd8d ("iw_cxgb4: 32b platform fixes")
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      b61e564a
  22. 31 8月, 2015 1 次提交
  23. 05 5月, 2015 1 次提交
  24. 17 4月, 2015 1 次提交
    • M
      cxgb4: drop __GFP_NOFAIL allocation · f72f116a
      Michal Hocko 提交于
      set_filter_wr is requesting __GFP_NOFAIL allocation although it can return
      ENOMEM without any problems obviously (t4_l2t_set_switching does that
      already).  So the non-failing requirement is too strong without any
      obvious reason.  Drop __GFP_NOFAIL and reorganize the code to have the
      failure paths easier.
      
      The same applies to _c4iw_write_mem_dma_aligned which uses __GFP_NOFAIL
      and then checks the return value and returns -ENOMEM on failure.  This
      doesn't make any sense what so ever.  Either the allocation cannot fail or
      it can.
      
      del_filter_wr seems to be safe as well because the filter entry is not
      marked as pending and the return value is propagated up the stack up to
      c4iw_destroy_listen.
      Signed-off-by: NMichal Hocko <mhocko@suse.cz>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Hariprasad S <hariprasad@chelsio.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f72f116a
  25. 16 1月, 2015 2 次提交
  26. 13 1月, 2015 1 次提交
  27. 16 12月, 2014 2 次提交
  28. 14 11月, 2014 1 次提交
  29. 11 11月, 2014 1 次提交
  30. 12 4月, 2014 1 次提交
  31. 02 4月, 2014 1 次提交