]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/rdma/ib_verbs.h
Merge branches 'x86/early-printk', 'x86/microcode' and 'core/objtool' into x86/urgent...
[linux.git] / include / rdma / ib_verbs.h
index 2cf2cee5a753529f705fda9ee9bb004ec787658e..9c0c2132a2d68a012ce3c7f3f12c2f966c040e43 100644 (file)
@@ -1151,7 +1151,7 @@ struct ib_qp_init_attr {
        struct ib_qp_cap        cap;
        enum ib_sig_type        sq_sig_type;
        enum ib_qp_type         qp_type;
-       enum ib_qp_create_flags create_flags;
+       u32                     create_flags;
 
        /*
         * Only needed for special QP types, or when using the RW API.
@@ -1488,25 +1488,6 @@ struct ib_rdmacg_object {
 #endif
 };
 
-#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
-struct ib_ucontext_per_mm {
-       struct ib_ucontext *context;
-
-       struct rb_root_cached umem_tree;
-       /*
-        * Protects .umem_rbroot and tree, as well as odp_mrs_count and
-        * mmu notifiers registration.
-        */
-       struct rw_semaphore umem_rwsem;
-
-       struct mmu_notifier mn;
-       atomic_t notifier_count;
-       /* A list of umems that don't have private mmu notifier counters yet. */
-       struct list_head no_private_counters;
-       unsigned int odp_mrs_count;
-};
-#endif
-
 struct ib_ucontext {
        struct ib_device       *device;
        struct ib_uverbs_file  *ufile;
@@ -1519,11 +1500,11 @@ struct ib_ucontext {
 
        bool cleanup_retryable;
 
-       struct pid             *tgid;
 #ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
        void (*invalidate_range)(struct ib_umem_odp *umem_odp,
                                 unsigned long start, unsigned long end);
-       struct ib_ucontext_per_mm per_mm;
+       struct mutex per_mm_list_lock;
+       struct list_head per_mm_list;
 #endif
 
        struct ib_rdmacg_object cg_obj;
@@ -2244,6 +2225,16 @@ struct rdma_netdev {
                            union ib_gid *gid, u16 mlid);
 };
 
+struct rdma_netdev_alloc_params {
+       size_t sizeof_priv;
+       unsigned int txqs;
+       unsigned int rxqs;
+       void *param;
+
+       int (*initialize_rdma_netdev)(struct ib_device *device, u8 port_num,
+                                     struct net_device *netdev, void *param);
+};
+
 struct ib_port_pkey_list {
        /* Lock to hold while modifying the list. */
        spinlock_t                    list_lock;
@@ -2545,8 +2536,8 @@ struct ib_device {
        /**
         * rdma netdev operation
         *
-        * Driver implementing alloc_rdma_netdev must return -EOPNOTSUPP if it
-        * doesn't support the specified rdma netdev type.
+        * Driver implementing alloc_rdma_netdev or rdma_netdev_get_params
+        * must return -EOPNOTSUPP if it doesn't support the specified type.
         */
        struct net_device *(*alloc_rdma_netdev)(
                                        struct ib_device *device,
@@ -2556,12 +2547,19 @@ struct ib_device {
                                        unsigned char name_assign_type,
                                        void (*setup)(struct net_device *));
 
+       int (*rdma_netdev_get_params)(struct ib_device *device, u8 port_num,
+                                     enum rdma_netdev_t type,
+                                     struct rdma_netdev_alloc_params *params);
+
        struct module               *owner;
        struct device                dev;
-       /* First group for device attributes, NULL terminated array */
-       const struct attribute_group    *groups[2];
+       /* First group for device attributes,
+        * Second group for driver provided attributes (optional).
+        * It is NULL terminated array.
+        */
+       const struct attribute_group    *groups[3];
 
-       struct kobject               *ports_parent;
+       struct kobject                  *ports_kobj;
        struct list_head             port_list;
 
        enum {
@@ -2644,9 +2642,9 @@ void ib_dealloc_device(struct ib_device *device);
 
 void ib_get_device_fw_str(struct ib_device *device, char *str);
 
-int ib_register_device(struct ib_device *device,
-                      int (*port_callback)(struct ib_device *,
-                                           u8, struct kobject *));
+int ib_register_device(struct ib_device *device, const char *name,
+                      int (*port_callback)(struct ib_device *, u8,
+                                           struct kobject *));
 void ib_unregister_device(struct ib_device *device);
 
 int ib_register_client   (struct ib_client *client);
@@ -2761,7 +2759,6 @@ static inline int ib_destroy_usecnt(atomic_t *usecnt,
  * @next_state: Next QP state
  * @type: QP type
  * @mask: Mask of supplied QP attributes
- * @ll : link layer of port
  *
  * This function is a helper function that a low-level driver's
  * modify_qp method can use to validate the consumer's input.  It
@@ -2770,8 +2767,7 @@ static inline int ib_destroy_usecnt(atomic_t *usecnt,
  * and that the attribute mask supplied is allowed for the transition.
  */
 bool ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state,
-                       enum ib_qp_type type, enum ib_qp_attr_mask mask,
-                       enum rdma_link_layer ll);
+                       enum ib_qp_type type, enum ib_qp_attr_mask mask);
 
 void ib_register_event_handler(struct ib_event_handler *event_handler);
 void ib_unregister_event_handler(struct ib_event_handler *event_handler);
@@ -4212,4 +4208,38 @@ struct ib_ucontext *ib_uverbs_get_ucontext(struct ib_uverbs_file *ufile);
 
 int uverbs_destroy_def_handler(struct ib_uverbs_file *file,
                               struct uverbs_attr_bundle *attrs);
+
+struct net_device *rdma_alloc_netdev(struct ib_device *device, u8 port_num,
+                                    enum rdma_netdev_t type, const char *name,
+                                    unsigned char name_assign_type,
+                                    void (*setup)(struct net_device *));
+
+int rdma_init_netdev(struct ib_device *device, u8 port_num,
+                    enum rdma_netdev_t type, const char *name,
+                    unsigned char name_assign_type,
+                    void (*setup)(struct net_device *),
+                    struct net_device *netdev);
+
+/**
+ * rdma_set_device_sysfs_group - Set device attributes group to have
+ *                              driver specific sysfs entries at
+ *                              for infiniband class.
+ *
+ * @device:    device pointer for which attributes to be created
+ * @group:     Pointer to group which should be added when device
+ *             is registered with sysfs.
+ * rdma_set_device_sysfs_group() allows existing drivers to expose one
+ * group per device to have sysfs attributes.
+ *
+ * NOTE: New drivers should not make use of this API; instead new device
+ * parameter should be exposed via netlink command. This API and mechanism
+ * exist only for existing drivers.
+ */
+static inline void
+rdma_set_device_sysfs_group(struct ib_device *dev,
+                           const struct attribute_group *group)
+{
+       dev->groups[1] = group;
+}
+
 #endif /* IB_VERBS_H */