]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge tag 'verbs_flow_counters' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 4 Jun 2018 14:48:11 +0000 (08:48 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 4 Jun 2018 14:48:11 +0000 (08:48 -0600)
Pull verbs counters series from Leon Romanovsky:

====================
Verbs flow counters support

This series comes to allow user space applications to monitor real time
traffic activity and events of the verbs objects it manages, e.g.: ibv_qp,
ibv_wq, ibv_flow.

The API enables generic counters creation and define mapping to
association with a verbs object, the current mlx5 driver is using this API
for flow counters.

With this API, an application can monitor the entire life cycle of object
activity, defined here as a static counters attachment.  This API also
allows dynamic counters monitoring of measurement points for a partial
period in the verbs object life cycle.

In addition it presents the implementation of the generic counters
interface.

This will be achieved by extending flow creation by adding a new flow
count specification type which allows the user to associate a previously
created flow counters using the generic verbs counters interface to the
created flow, once associated the user could read statistics by using the
read function of the generic counters interface.

The API includes:
1. create and destroyed API of a new counters objects
2. read the counters values from HW

Note:
Attaching API to allow application to define the measurement points per
objects is a user space only API and this data is passed to kernel when
the counted object (e.g. flow) is created with the counters object.
===================

* tag 'verbs_flow_counters':
  IB/mlx5: Add counters read support
  IB/mlx5: Add flow counters read support
  IB/mlx5: Add flow counters binding support
  IB/mlx5: Add counters create and destroy support
  IB/uverbs: Add support for flow counters
  IB/core: Add support for flow counters
  IB/core: Support passing uhw for create_flow
  IB/uverbs: Add read counters support
  IB/core: Introduce counters read verb
  IB/uverbs: Add create/destroy counters support
  IB/core: Introduce counters object and its create/destroy
  IB/uverbs: Add an ib_uobject getter to ioctl() infrastructure
  net/mlx5: Export flow counter related API
  net/mlx5: Use flow counter pointer as input to the query function

1  2 
drivers/infiniband/core/Makefile
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_std_types_flow_action.c
drivers/infiniband/core/verbs.c
drivers/infiniband/hw/mlx4/main.c
drivers/infiniband/hw/mlx5/main.c
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
include/rdma/ib_verbs.h
include/rdma/uverbs_ioctl.h
include/uapi/rdma/ib_user_verbs.h
include/uapi/rdma/mlx5-abi.h

Simple merge
Simple merge
Simple merge
Simple merge
index 0541581c5d84badf997e2b57ff3f9ac98b6b5741,7a563478d0b2e28b7f063c0f47538cbc9589d43a..3544150f34699de31bc0c8fb699b07b2d9610418
@@@ -3104,12 -3165,12 +3250,13 @@@ static struct mlx5_ib_flow_handler *_cr
        struct mlx5_ib_flow_handler *handler;
        struct mlx5_flow_act flow_act = {.flow_tag = MLX5_FS_DEFAULT_FLOW_TAG};
        struct mlx5_flow_spec *spec;
-       struct mlx5_flow_destination *rule_dst = dst;
+       struct mlx5_flow_destination dest_arr[2] = {};
+       struct mlx5_flow_destination *rule_dst = dest_arr;
        const void *ib_flow = (const void *)flow_attr + sizeof(*flow_attr);
        unsigned int spec_index;
 +      u32 prev_type = 0;
        int err = 0;
-       int dest_num = 1;
+       int dest_num = 0;
        bool is_egress = flow_attr->flags & IB_FLOW_ATTR_FLAGS_EGRESS;
  
        if (!is_valid_attr(dev->mdev, flow_attr))
Simple merge
index 095383a4bd1a6f560944b65266eacbc118df09f4,7ac6271a5ee0902eae1df44a7c9696f0469d2812..bd6bba3a6e04a1c8cc3b9933c4950eb201356517
@@@ -411,15 -411,26 +411,26 @@@ static inline int uverbs_attr_get_enum_
  static inline void *uverbs_attr_get_obj(const struct uverbs_attr_bundle *attrs_bundle,
                                        u16 idx)
  {
 -      struct ib_uobject *uobj =
 -              uverbs_attr_get(attrs_bundle, idx)->obj_attr.uobject;
 +      const struct uverbs_attr *attr;
  
 -      if (IS_ERR(uobj))
 -              return uobj;
 +      attr = uverbs_attr_get(attrs_bundle, idx);
 +      if (IS_ERR(attr))
 +              return ERR_CAST(attr);
  
 -      return uobj->object;
 +      return attr->obj_attr.uobject->object;
  }
  
+ static inline struct ib_uobject *uverbs_attr_get_uobject(const struct uverbs_attr_bundle *attrs_bundle,
+                                                        u16 idx)
+ {
+       const struct uverbs_attr *attr = uverbs_attr_get(attrs_bundle, idx);
+       if (IS_ERR(attr))
+               return ERR_CAST(attr);
+       return attr->obj_attr.uobject;
+ }
  static inline int uverbs_copy_to(const struct uverbs_attr_bundle *attrs_bundle,
                                 size_t idx, const void *from, size_t size)
  {
Simple merge
Simple merge