Lines Matching defs:device
16 #include <linux/device.h>
150 struct ib_device *device;
237 * This device supports a per-device lkey or stag that can be
258 * This device supports the IB "base memory management extension",
261 * also be set by any iWarp device which must support FRs to comply
288 /* The device supports padding incoming writes to cacheline. */
732 struct ib_device *device;
744 struct ib_device *device;
751 (_ptr)->device = _device; \
847 * @IB_MR_TYPE_DM: memory region that is used for device
1481 struct ib_device *device;
1521 struct ib_device *device;
1535 struct ib_device *device;
1543 struct ib_device *device;
1562 struct ib_device *device;
1593 struct ib_device *device;
1639 struct ib_device *device;
1683 struct ib_device *device;
1741 struct ib_device *device;
1782 struct ib_device *device;
1790 struct ib_device *device;
1813 struct ib_device *device;
2071 struct ib_device *device;
2127 struct ib_device *device;
2223 int (*initialize_rdma_netdev)(struct ib_device *device, u8 port_num,
2234 struct ib_device *device;
2282 * struct ib_device_ops - InfiniBand device operations
2283 * This structure defines all the InfiniBand device operations, providers will
2305 int (*process_mad)(struct ib_device *device, int process_mad_flags,
2310 int (*query_device)(struct ib_device *device,
2313 int (*modify_device)(struct ib_device *device, int device_modify_mask,
2315 void (*get_dev_fw_str)(struct ib_device *device, char *str);
2318 int (*query_port)(struct ib_device *device, u8 port_num,
2320 int (*modify_port)(struct ib_device *device, u8 port_num,
2324 * The following mandatory functions are used only at device
2329 int (*get_port_immutable)(struct ib_device *device, u8 port_num,
2331 enum rdma_link_layer (*get_link_layer)(struct ib_device *device,
2335 * net device of device @device at port @port_num or NULL if such
2336 * a net device doesn't exist. The vendor driver should call dev_hold
2337 * on this net device. The HW vendor's device driver must guarantee
2338 * that this function returns NULL before the net device has finished
2341 struct net_device *(*get_netdev)(struct ib_device *device, u8 port_num);
2349 struct ib_device *device, u8 port_num, enum rdma_netdev_t type,
2353 int (*rdma_netdev_get_params)(struct ib_device *device, u8 port_num,
2357 * query_gid should be return GID value for @device, when @port_num
2361 int (*query_gid)(struct ib_device *device, u8 port_num, int index,
2365 * of device of port at gid index available at @attr. Meta-info of
2366 * that gid (for example, the network device related to this gid) is
2379 * gid of device @device at gid index gid_index of port port_num
2386 int (*query_pkey)(struct ib_device *device, u8 port_num, u16 index,
2460 struct ib_device *device,
2468 int (*set_vf_link_state)(struct ib_device *device, int vf, u8 port,
2470 int (*get_vf_config)(struct ib_device *device, int vf, u8 port,
2472 int (*get_vf_stats)(struct ib_device *device, int vf, u8 port,
2474 int (*get_vf_guid)(struct ib_device *device, int vf, u8 port,
2477 int (*set_vf_guid)(struct ib_device *device, int vf, u8 port, u64 guid,
2489 struct ib_dm *(*alloc_dm)(struct ib_device *device,
2511 * core when the device is removed. A lifespan of -1 in the return
2514 struct rdma_hw_stats *(*alloc_hw_stats)(struct ib_device *device,
2528 int (*get_hw_stats)(struct ib_device *device,
2531 * This function is called once for each port when a ib device is
2534 int (*init_port)(struct ib_device *device, u8 port_num,
2549 * Called after the device becomes registered, before clients are
2561 struct ib_qp *(*iw_get_qp)(struct ib_device *device, int qpn);
2618 /* device must be the first element in structure until,
2619 * union of ib_core_device and device exists in ib_device.
2621 struct device dev;
2631 struct device *dma_device;
2657 struct device dev;
2661 /* First group for device attributes,
2698 * Positive refcount indicates that the device is currently
2730 * @dev: An RDMA device that the net_dev use for communication.
2731 * @port: A physical port number on the RDMA device.
2735 * @client_data: The device's client data set by ib_set_client_data().
2781 void ib_dealloc_device(struct ib_device *device);
2783 void ib_get_device_fw_str(struct ib_device *device, char *str);
2785 int ib_register_device(struct ib_device *device, const char *name,
2786 struct device *dma_device);
2787 void ib_unregister_device(struct ib_device *device);
2789 void ib_unregister_device_and_put(struct ib_device *device);
2829 * @device:Device to get context for
2834 * registered to the device, once the ib_client remove() callback returns this
2837 static inline void *ib_get_client_data(struct ib_device *device,
2840 return xa_load(&device->client_data, client->client_id);
2842 void ib_set_client_data(struct ib_device *device, struct ib_client *client,
2844 void ib_set_device_ops(struct ib_device *device,
2965 int ib_query_port(struct ib_device *device,
2968 enum rdma_link_layer rdma_port_get_link_layer(struct ib_device *device,
2972 * rdma_cap_ib_switch - Check if the device is IB switch
2973 * @device: Device to check
2978 * Return: true if the device is IB switch.
2980 static inline bool rdma_cap_ib_switch(const struct ib_device *device)
2982 return device->is_switch;
2986 * rdma_start_port - Return the first valid port number for the device
2989 * @device: Device to be checked
2993 static inline u8 rdma_start_port(const struct ib_device *device)
2995 return rdma_cap_ib_switch(device) ? 0 : 1;
2999 * rdma_for_each_port - Iterate over all valid port numbers of the IB device
3000 * @device - The struct ib_device * to iterate over
3003 #define rdma_for_each_port(device, iter) \
3004 for (iter = rdma_start_port(device + BUILD_BUG_ON_ZERO(!__same_type( \
3006 iter <= rdma_end_port(device); (iter)++)
3009 * rdma_end_port - Return the last valid port number for the device
3012 * @device: Device to be checked
3016 static inline u8 rdma_end_port(const struct ib_device *device)
3018 return rdma_cap_ib_switch(device) ? 0 : device->phys_port_cnt;
3021 static inline int rdma_is_port_valid(const struct ib_device *device,
3024 return (port >= rdma_start_port(device) &&
3025 port <= rdma_end_port(device));
3028 static inline bool rdma_is_grh_required(const struct ib_device *device,
3031 return device->port_data[port_num].immutable.core_cap_flags &
3035 static inline bool rdma_protocol_ib(const struct ib_device *device, u8 port_num)
3037 return device->port_data[port_num].immutable.core_cap_flags &
3041 static inline bool rdma_protocol_roce(const struct ib_device *device, u8 port_num)
3043 return device->port_data[port_num].immutable.core_cap_flags &
3047 static inline bool rdma_protocol_roce_udp_encap(const struct ib_device *device, u8 port_num)
3049 return device->port_data[port_num].immutable.core_cap_flags &
3053 static inline bool rdma_protocol_roce_eth_encap(const struct ib_device *device, u8 port_num)
3055 return device->port_data[port_num].immutable.core_cap_flags &
3059 static inline bool rdma_protocol_iwarp(const struct ib_device *device, u8 port_num)
3061 return device->port_data[port_num].immutable.core_cap_flags &
3065 static inline bool rdma_ib_or_roce(const struct ib_device *device, u8 port_num)
3067 return rdma_protocol_ib(device, port_num) ||
3068 rdma_protocol_roce(device, port_num);
3071 static inline bool rdma_protocol_raw_packet(const struct ib_device *device, u8 port_num)
3073 return device->port_data[port_num].immutable.core_cap_flags &
3077 static inline bool rdma_protocol_usnic(const struct ib_device *device, u8 port_num)
3079 return device->port_data[port_num].immutable.core_cap_flags &
3084 * rdma_cap_ib_mad - Check if the port of a device supports Infiniband
3086 * @device: Device to check
3095 static inline bool rdma_cap_ib_mad(const struct ib_device *device, u8 port_num)
3097 return device->port_data[port_num].immutable.core_cap_flags &
3102 * rdma_cap_opa_mad - Check if the port of device provides support for OPA
3104 * @device: Device to check
3120 static inline bool rdma_cap_opa_mad(struct ib_device *device, u8 port_num)
3122 return device->port_data[port_num].immutable.core_cap_flags &
3127 * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband
3129 * @device: Device to check
3146 static inline bool rdma_cap_ib_smi(const struct ib_device *device, u8 port_num)
3148 return device->port_data[port_num].immutable.core_cap_flags &
3153 * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband
3155 * @device: Device to check
3167 static inline bool rdma_cap_ib_cm(const struct ib_device *device, u8 port_num)
3169 return device->port_data[port_num].immutable.core_cap_flags &
3174 * rdma_cap_iw_cm - Check if the port of device has the capability IWARP
3176 * @device: Device to check
3185 static inline bool rdma_cap_iw_cm(const struct ib_device *device, u8 port_num)
3187 return device->port_data[port_num].immutable.core_cap_flags &
3192 * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband
3194 * @device: Device to check
3206 static inline bool rdma_cap_ib_sa(const struct ib_device *device, u8 port_num)
3208 return device->port_data[port_num].immutable.core_cap_flags &
3213 * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband
3215 * @device: Device to check
3229 static inline bool rdma_cap_ib_mcast(const struct ib_device *device, u8 port_num)
3231 return rdma_cap_ib_sa(device, port_num);
3235 * rdma_cap_af_ib - Check if the port of device has the capability
3237 * @device: Device to check
3247 static inline bool rdma_cap_af_ib(const struct ib_device *device, u8 port_num)
3249 return device->port_data[port_num].immutable.core_cap_flags &
3254 * rdma_cap_eth_ah - Check if the port of device has the capability
3256 * @device: Device to check
3269 static inline bool rdma_cap_eth_ah(const struct ib_device *device, u8 port_num)
3271 return device->port_data[port_num].immutable.core_cap_flags &
3276 * rdma_cap_opa_ah - Check if the port of device supports
3278 * @device: Device to check
3281 * Return: true if we are running on an OPA device which supports
3284 static inline bool rdma_cap_opa_ah(struct ib_device *device, u8 port_num)
3286 return (device->port_data[port_num].immutable.core_cap_flags &
3293 * @device: Device
3302 static inline size_t rdma_max_mad_size(const struct ib_device *device, u8 port_num)
3304 return device->port_data[port_num].immutable.max_mad_size;
3308 * rdma_cap_roce_gid_table - Check if the port of device uses roce_gid_table
3309 * @device: Device to check
3312 * RoCE GID table mechanism manages the various GIDs for a device.
3320 static inline bool rdma_cap_roce_gid_table(const struct ib_device *device,
3323 return rdma_protocol_roce(device, port_num) &&
3324 device->ops.add_gid && device->ops.del_gid;
3328 * Check if the device supports READ W/ INVALIDATE.
3341 * @device: Device
3346 static inline bool rdma_core_cap_opa_port(struct ib_device *device,
3349 return (device->port_data[port_num].immutable.core_cap_flags &
3355 * @device: Device
3362 static inline int rdma_mtu_enum_to_int(struct ib_device *device, u8 port,
3365 if (rdma_core_cap_opa_port(device, port))
3373 * @device: Device
3379 static inline int rdma_mtu_from_attr(struct ib_device *device, u8 port,
3382 if (rdma_core_cap_opa_port(device, port))
3388 int ib_set_vf_link_state(struct ib_device *device, int vf, u8 port,
3390 int ib_get_vf_config(struct ib_device *device, int vf, u8 port,
3392 int ib_get_vf_stats(struct ib_device *device, int vf, u8 port,
3394 int ib_get_vf_guid(struct ib_device *device, int vf, u8 port,
3397 int ib_set_vf_guid(struct ib_device *device, int vf, u8 port, u64 guid,
3400 int ib_query_pkey(struct ib_device *device,
3403 int ib_modify_device(struct ib_device *device,
3407 int ib_modify_port(struct ib_device *device,
3411 int ib_find_gid(struct ib_device *device, union ib_gid *gid,
3414 int ib_find_pkey(struct ib_device *device,
3430 struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
3433 #define ib_alloc_pd(device, flags) \
3434 __ib_alloc_pd((device), (flags), KBUILD_MODNAME)
3504 * @device: Device on which the received message arrived.
3519 int ib_init_ah_attr_from_wc(struct ib_device *device, u8 port_num,
3590 if (!pd->device->ops.create_srq)
3654 return srq->device->ops.post_srq_recv(srq, recv_wr,
3762 return qp->device->ops.post_send(qp, send_wr, bad_send_wr ? : &dummy);
3779 return qp->device->ops.post_recv(qp, recv_wr, bad_recv_wr ? : &dummy);
3799 * @dev: The IB device
3816 * ib_create_cq - Creates a CQ on the specified device.
3817 * @device: The device on which to create the CQ.
3828 struct ib_cq *__ib_create_cq(struct ib_device *device,
3834 #define ib_create_cq(device, cmp_hndlr, evt_hndlr, cq_ctxt, cq_attr) \
3835 __ib_create_cq((device), (cmp_hndlr), (evt_hndlr), (cq_ctxt), (cq_attr), KBUILD_MODNAME)
3890 return cq->device->ops.poll_cq(cq, num_entries, wc);
3923 return cq->device->ops.req_notify_cq(cq, flags);
3941 return cq->device->ops.req_ncomp_notif ?
3942 cq->device->ops.req_ncomp_notif(cq, wc_cnt) :
3958 * @dev: The device for which the dma_addr was created
3970 * @dev: The device for which the dma_addr is to be created
3986 * @dev: The device for which the DMA address was created
4001 * @dev: The device for which the dma_addr is to be created
4020 * @dev: The device for which the DMA address was created
4057 * @dev: The device for which the DMA addresses are to be created
4071 * @dev: The device for which the DMA addresses were created
4085 * @dev: The device to query
4098 * @dev: The device for which the DMA address was created
4113 * ib_dma_sync_single_for_device - Prepare DMA region to be accessed by device
4114 * @dev: The device for which the DMA address was created
4130 * @dev: The device for which the DMA address is requested
4145 * @dev: The device for which the DMA addresses were allocated
4242 struct ib_xrcd *ib_alloc_xrcd_user(struct ib_device *device,
4293 * device: The device to lock
4295 * A device under an active registration lock cannot become unregistered. It
4296 * is only possible to obtain a registration lock on a device that is fully
4300 * device to still be registered. Uses that only require the device pointer to
4309 void ib_device_put(struct ib_device *device);
4566 * @device: the rdma device
4570 * completion vector (returns all-cpus map if the device driver doesn't
4574 ib_get_vector_affinity(struct ib_device *device, int comp_vector)
4576 if (comp_vector < 0 || comp_vector >= device->num_comp_vectors ||
4577 !device->ops.get_vector_affinity)
4580 return device->ops.get_vector_affinity(device, comp_vector);
4588 * @device: the rdma device
4596 struct net_device *rdma_alloc_netdev(struct ib_device *device, u8 port_num,
4601 int rdma_init_netdev(struct ib_device *device, u8 port_num,
4608 * rdma_set_device_sysfs_group - Set device attributes group to have
4612 * @device: device pointer for which attributes to be created
4613 * @group: Pointer to group which should be added when device
4616 * group per device to have sysfs attributes.
4618 * NOTE: New drivers should not make use of this API; instead new device
4630 * rdma_device_to_ibdev - Get ib_device pointer from device pointer
4632 * @device: device pointer for which ib_device pointer to retrieve
4634 * rdma_device_to_ibdev() retrieves ib_device pointer from device.
4637 static inline struct ib_device *rdma_device_to_ibdev(struct device *device)
4640 container_of(device, struct ib_core_device, dev);
4647 * @dev: device to get the NUMA node for.
4651 struct device *parent = ibdev->dev.parent;
4660 * ib_device holder structure from device pointer.
4669 bool rdma_dev_access_netns(const struct ib_device *device,