1. 06 4月, 2018 1 次提交
  2. 05 4月, 2018 4 次提交
    • M
      IB/uverbs: Introduce ESP steering match filter · 56ab0b38
      Matan Barak 提交于
      Adding a new ESP steering match filter that could match against
      spi and seq used in IPSec protocol.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      56ab0b38
    • M
      IB/uverbs: Add action_handle flow steering specification · 9b828441
      Matan Barak 提交于
      Binding a flow_action to flow steering rule requires using a new
      specification. Therefore, adding such an IB_FLOW_SPEC_ACTION_HANDLE flow
      specification.
      
      Flow steering rules could use flow_action(s) and as of that we need to
      avoid deleting flow_action(s) as long as they're being used.
      Moreover, when the attached rules are deleted, action_handle reference
      count should be decremented. Introducing a new mechanism of flow
      resources to keep track on the attached action_handle(s). Later on, this
      mechanism should be extended to other attached flow steering resources
      like flow counters.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      9b828441
    • M
      IB/uverbs: Add flow_action create and destroy verbs · 2eb9beae
      Matan Barak 提交于
      A verbs application may receive and transmits packets using a data
      path pipeline. Sometimes, the first stage in the receive pipeline or
      the last stage in the transmit pipeline involves transforming a
      packet, either in order to make it easier for later stages to process
      it or to prepare it for transmission over the wire. Such transformation
      could be stripping/encapsulating the packet (i.e. vxlan),
      decrypting/encrypting it (i.e. ipsec), altering headers, doing some
      complex FPGA changes, etc.
      
      Some hardware could do such transformations without software data path
      intervention at all. The flow steering API supports steering a
      packet (either to a QP or dropping it) and some simple packet
      immutable actions (i.e. tagging a packet). Complex actions, that may
      change the packet, could bloat the flow steering API extensively.
      Sometimes the same action should be applied to several flows.
      In this case, it's easier to bind several flows to the same action and
      modify it than change all matching flows.
      
      Introducing a new flow_action object that abstracts any packet
      transformation (out of a standard and well defined set of actions).
      This flow_action object could be tied to a flow steering rule via a
      new specification.
      
      Currently, we support esp flow_action, which encrypts or decrypts a
      packet according to the given parameters. However, we present a
      flexible schema that could be used to other transformation actions tied
      to flow rules.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      2eb9beae
    • M
      IB/uverbs: Refactor kern_spec_to_ib_spec_filter · 766d8551
      Matan Barak 提交于
      The current implementation of kern_spec_to_ib_spec_filter, which takes
      a uAPI based flow steering specification and creates the respective kernel
      API flow steering structure, gets a ib_uverbs_flow_spec structure.
      The new flow_action uAPI gets a match mask and filter from user-space
      which aren't encoded in the flow steering's ib_uverbs_flow_spec structure.
      Exporting the logic out of kern_spec_to_ib_spec_filter to get user-space
      blobs rather than ib_uverbs_flow_spec structure.
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      766d8551
  3. 20 3月, 2018 3 次提交
  4. 14 11月, 2017 1 次提交
  5. 27 9月, 2017 2 次提交
    • A
      IB/uverbs: clean up INIT_UDATA() macro usage · 40a20339
      Arnd Bergmann 提交于
      After changing INIT_UDATA_BUF_OR_NULL() to an inline function,
      this does the same change to INIT_UDATA for consistency.
      I'm keeping it separate as this part is much larger and
      we wouldn't want to backport this to stable kernels if we
      ever want to address the gcc warnings by backporting the
      first patch.
      
      Again, using an inline function gives us better type
      safety here among other issues with macros. I'm using
      u64_to_user_ptr() to convert the user pointer to simplify
      the logic rather than adding lots of new type casts.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      40a20339
    • A
      IB/uverbs: clean up INIT_UDATA_BUF_OR_NULL usage · 12f72772
      Arnd Bergmann 提交于
      We get a harmless warning about the fact that we use the result of a
      multiplication as a condition:
      
      drivers/infiniband/core/uverbs_main.c: In function 'ib_uverbs_write':
      drivers/infiniband/core/uverbs_main.c:787:40: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
      drivers/infiniband/core/uverbs_main.c:787:117: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
      drivers/infiniband/core/uverbs_main.c:790:50: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
      drivers/infiniband/core/uverbs_main.c:790:151: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
      
      This avoids the problem by using an inline function in place of
      the macro.
      
      Fixes: a96e4e2f ("IB/uverbs: New macro to set pointers to NULL if length is 0 in INIT_UDATA()")
      Suggested-by: NChristoph Hellwig <hch@infradead.org>
      Link: https://patchwork.kernel.org/patch/9940777/Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      12f72772
  6. 31 8月, 2017 2 次提交
  7. 22 4月, 2017 1 次提交
  8. 20 4月, 2017 1 次提交
  9. 06 4月, 2017 6 次提交
    • M
      IB/core: Change completion channel to use the reworked objects schema · 1e7710f3
      Matan Barak 提交于
      This patch adds the standard fd based type - completion_channel.
      The completion_channel is now prefixed with ib_uobject, similarly
      to the rest of the uobjects.
      This requires a few changes:
      (1) We define a new completion channel fd based object type.
      (2) completion_event and async_event are now two different types.
          This means they use different fops.
      (3) We release the completion_channel exactly as we release other
          idr based objects.
      (4) Since ib_uobjects are already kref-ed, we only add the kref to the
          async event.
      
      A fd object requires filling out several parameters. Its op pointer
      should point to uverbs_fd_ops and its size should be at least the
      size if ib_uobject. We use a macro to make the type declaration
      easier.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      1e7710f3
    • M
      IB/core: Add support for fd objects · cf8966b3
      Matan Barak 提交于
      The completion channel we use in verbs infrastructure is FD based.
      Previously, we had a separate way to manage this object. Since we
      strive for a single way to manage any kind of object in this
      infrastructure, we conceptually treat all objects as subclasses
      of ib_uobject.
      
      This commit adds the necessary mechanism to support FD based objects
      like their IDR counterparts. FD objects release need to be synchronized
      with context release. We use the cleanup_mutex on the uverbs_file for
      that.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      cf8966b3
    • M
      IB/core: Add lock to multicast handlers · f48b7269
      Matan Barak 提交于
      When two handlers used the same object in the old schema, we blocked
      the process in the kernel. The new schema just returns -EBUSY. This
      could lead to different behaviour in applications between the old
      schema and the new schema. In most cases, using such handlers
      concurrently could lead to crashing the process. For example, if
      thread A destroys a QP and thread B modifies it, we could have the
      destruction happens before the modification. In this case, we are
      accessing freed memory which could lead to crashing the process.
      This is true for most cases. However, attaching and detaching
      a multicast address from QP concurrently is safe. Therefore, we
      preserve the original behaviour by adding a lock there.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      f48b7269
    • M
      IB/core: Change idr objects to use the new schema · fd3c7904
      Matan Barak 提交于
      This changes only the handlers which deals with idr based objects to
      use the new idr allocation, fetching and destruction schema.
      This patch consists of the following changes:
      (1) Allocation, fetching and destruction is done via idr ops.
      (2) Context initializing and release is done through
          uverbs_initialize_ucontext and uverbs_cleanup_ucontext.
      (3) Ditching the live flag. Mostly, this is pretty straight
          forward. The only place that is a bit trickier is in
          ib_uverbs_open_qp. Commit [1] added code to check whether
          the uobject is already live and initialized. This mostly
          happens because of a race between open_qp and events.
          We delayed assigning the uobject's pointer in order to
          eliminate this race without using the live variable.
      
      [1] commit a040f95d
      	("IB/core: Fix XRC race condition in ib_uverbs_open_qp")
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      fd3c7904
    • M
      IB/core: Add idr based standard types · 6be60aed
      Matan Barak 提交于
      This patch adds the standard idr based types. These types are
      used in downstream patches in order to initialize, destroy and
      lookup IB standard objects which are based on idr objects.
      
      An idr object requires filling out several parameters. Its op pointer
      should point to uverbs_idr_ops and its size should be at least the
      size of ib_uobject. We add a macro to make the type declaration easier.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Reviewed-by: NYishai Hadas <yishaih@mellanox.com>
      Reviewed-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      6be60aed
    • M
      IB/core: Refactor idr to be per uverbs_file · 771addf6
      Matan Barak 提交于
      The current code creates an idr per type. Since types are currently
      common for all drivers and known in advance, this was good enough.
      However, the proposed ioctl based infrastructure allows each driver
      to declare only some of the common types and declare its own specific
      types.
      
      Thus, we decided to implement idr to be per uverbs_file.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NHaggai Eran <haggaie@mellanox.com>
      Reviewed-by: NSean Hefty <sean.hefty@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      771addf6
  10. 14 2月, 2017 1 次提交
  11. 14 12月, 2016 1 次提交
  12. 04 8月, 2016 1 次提交
  13. 23 6月, 2016 3 次提交
  14. 24 12月, 2015 1 次提交
  15. 22 10月, 2015 1 次提交
  16. 31 8月, 2015 4 次提交
  17. 13 6月, 2015 1 次提交
  18. 19 2月, 2015 1 次提交
  19. 06 2月, 2015 1 次提交
  20. 16 12月, 2014 1 次提交
  21. 02 8月, 2014 1 次提交
  22. 21 12月, 2013 1 次提交
  23. 17 12月, 2013 1 次提交