Lines Matching +full:mcast +full:- +full:groups
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
18 #include <linux/dma-mapping.h>
45 #include <linux/pci-tph.h>
202 if (attr->gid_type == IB_GID_TYPE_IB)
205 if (attr->gid_type == IB_GID_TYPE_ROCE)
208 if (ipv6_addr_v4mapped((struct in6_addr *)&attr->gid))
279 * This device supports a per-device lkey or stag that can be
286 /* IB_QP_CREATE_INTEGRITY_EN is supported to implement T10-PI */
476 default: return -1;
568 default: return -1;
590 * @name - The name of the counter
591 * @flags - Flags of the counter; For example, IB_STAT_FLAG_OPTIONAL
592 * @priv - Driver private information; Core code should not use
602 * @lock - Mutex to protect parallel write access to lifespan and values
605 * @timestamp - Used by the core code to track when the last update was
606 * @lifespan - Used by the core code to determine how old the counters
610 * @descs - Array of pointers to static descriptors used for the counters
612 * @is_disabled - A bitmap to indicate each counter is currently disabled
614 * @num_counters - How many hardware counters there are. If name is
618 * @value - Array of u64 counters that are accessed by the sysfs code and
791 (_ptr)->device = _device; \
792 (_ptr)->handler = _handler; \
793 INIT_LIST_HEAD(&(_ptr)->list); \
865 * ib_rate_to_mult - Convert the IB rate enum to a multiple of the
873 * ib_rate_to_mbps - Convert the IB rate enum to Mbps.
881 * enum ib_mr_type - memory region type
886 * the normal mr constraints - see
890 * @IB_MR_TYPE_USER: memory region that is used for the user-space
911 * struct ib_mr_status - Memory region status container
924 * mult_to_ib_rate - Convert a multiple of 2.5 Gbit/sec to an IB rate
1131 * indices into a 2-entry table.
1179 /* reserve bits 26-31 for low level drivers' internal use */
1382 /* reserve bits 26-31 for low level drivers' internal use */
1493 ((IB_ACCESS_FLUSH_PERSISTENT << 1) - 1) | IB_ACCESS_OPTIONAL,
1497 * XXX: these are apparently used for ->rereg_user_mr, no idea why they
1504 IB_MR_REREG_SUPPORTED = ((IB_MR_REREG_ACCESS << 1) - 1)
1517 /* Driver is being hot-unplugged. This call should delete the actual object itself */
1519 /* uobj is being cleaned-up before being committed */
1548 /* FIXME, save memory: ufile->context == context */
1813 /* count times opened, mcast attaches, flow attaches */
1907 /* default unicast and multicast rule -
1911 /* default multicast rule -
1915 /* sniffer rule - receive all port traffic */
2161 /* All user-space flags at the top: Use enum ib_uverbs_flow_action_esp_flags
2162 * This is done in order to share the same flags between user-space and
2250 /* rdma netdev type - specifies protocol type */
2257 * struct rdma_netdev - rdma netdev
2328 !__same_type(((struct drv_struct *)NULL)->member, \
2332 ((struct ib_type *)rdma_zalloc_obj(ib_dev, ib_dev->ops.size_##ib_type, \
2336 ((struct ib_type *)rdma_zalloc_obj(ib_dev, ib_dev->ops.size_##ib_type, \
2356 return (u64)entry->start_pgoff << PAGE_SHIFT;
2360 * struct ib_device_ops - InfiniBand device operations
2432 * must return -EOPNOTSUPP if it doesn't support the specified type.
2444 * link layer is either IB or iWarp. It is no-op if @port_num port
2451 * of device of port at gid index available at @attr. Meta-info of
2520 * pre_destroy_cq - Prevent a cq from generating any new work
2525 * post_destroy_cq - Free all kernel resources
2619 * alloc_hw_[device,port]_stats - Allocate a struct rdma_hw_stats and
2621 * the sysfs core when the device is removed. A lifespan of -1 in the
2628 * get_hw_stats - Fill in the counter value(s) in the stats struct.
2629 * @index - The index in the value array we wish to have updated, or
2631 * Return codes -
2632 * < 0 - Error, no counters updated
2633 * index - Updated the single counter pointed to by index
2634 * num_counters - Updated all counters (will reset the timestamp
2643 * modify_hw_stat - Modify the counter configuration
2645 * Return codes - 0 on success or error code otherwise.
2686 * counter_bind_qp - Bind a QP to a counter.
2687 * @counter - The counter to be bound. If counter->id is zero then
2688 * the driver needs to allocate a new counter and set counter->id
2693 * counter_unbind_qp - Unbind the qp from the dynamically-allocated
2698 * counter_dealloc -De-allocate the hw counter
2702 * counter_alloc_stats - Allocate a struct rdma_hw_stats and fill in
2708 * counter_update_stats - Query the stats value of this counter
2713 * counter_init - Initialize the driver specific rdma counter struct.
2734 * add_sub_dev - Add a sub IB device
2741 * del_sub_dev - Delete a sub IB device
2746 * ufile_cleanup - Attempt to cleanup ubojects HW resources inside
2752 * report_port_event - Drivers need to implement this if they have
2821 const struct attribute_group *groups[4];
2872 /* A parent device has a list of sub-devices */
2887 if (is_numa_aware && dev->ops.get_numa_node)
2888 return kzalloc_node(size, gfp, dev->ops.get_numa_node(dev));
2937 * Iterates the DMA-mapped SGL in contiguous memory blocks aligned
2985 * rdma_block_iter_dma_address - get the aligned dma address of the current
2992 return biter->__dma_addr & ~(BIT_ULL(biter->__pg_bit) - 1);
2996 * rdma_for_each_block - iterate over contiguous memory blocks of the sg list
3011 * ib_get_client_data - Get IB client context
3023 return xa_load(&device->client_data, client->client_id);
3070 return copy_from_user(dest, udata->inbuf, len) ? -EFAULT : 0;
3075 return copy_to_user(udata->outbuf, src, len) ? -EFAULT : 0;
3100 return ib_is_buffer_cleared(udata->inbuf + offset, len);
3104 * ib_modify_qp_is_ok - Check that the supplied attribute mask
3112 * This function is a helper function that a low-level driver's
3132 * rdma_cap_ib_switch - Check if the device is IB switch
3142 return device->is_switch;
3146 * rdma_start_port - Return the first valid port number for the device
3159 * rdma_for_each_port - Iterate over all valid port numbers of the IB device
3160 * @device - The struct ib_device * to iterate over
3161 * @iter - The unsigned int to store the port number
3170 * rdma_end_port - Return the last valid port number for the device
3179 return rdma_cap_ib_switch(device) ? 0 : device->phys_port_cnt;
3192 return device->port_data[port_num].immutable.core_cap_flags &
3199 return device->port_data[port_num].immutable.core_cap_flags &
3206 return device->port_data[port_num].immutable.core_cap_flags &
3213 return device->port_data[port_num].immutable.core_cap_flags &
3220 return device->port_data[port_num].immutable.core_cap_flags &
3227 return device->port_data[port_num].immutable.core_cap_flags &
3241 return device->port_data[port_num].immutable.core_cap_flags &
3248 return device->port_data[port_num].immutable.core_cap_flags &
3253 * rdma_cap_ib_mad - Check if the port of a device supports Infiniband
3266 return device->port_data[port_num].immutable.core_cap_flags &
3271 * rdma_cap_opa_mad - Check if the port of device provides support for OPA
3291 return device->port_data[port_num].immutable.core_cap_flags &
3296 * rdma_cap_ib_smi - Check if the port of a device provides an Infiniband
3317 return device->port_data[port_num].immutable.core_cap_flags &
3322 * rdma_cap_ib_cm - Check if the port of device has the capability Infiniband
3327 * The InfiniBand Communication Manager is one of many pre-defined General
3338 return device->port_data[port_num].immutable.core_cap_flags &
3343 * rdma_cap_iw_cm - Check if the port of device has the capability IWARP
3356 return device->port_data[port_num].immutable.core_cap_flags &
3361 * rdma_cap_ib_sa - Check if the port of device has the capability Infiniband
3366 * An InfiniBand Subnet Administration (SA) service is a pre-defined General
3377 return device->port_data[port_num].immutable.core_cap_flags &
3382 * rdma_cap_ib_mcast - Check if the port of device has the capability Infiniband
3405 * rdma_cap_af_ib - Check if the port of device has the capability
3419 return device->port_data[port_num].immutable.core_cap_flags &
3424 * rdma_cap_eth_ah - Check if the port of device has the capability
3441 return device->port_data[port_num].immutable.core_cap_flags &
3446 * rdma_cap_opa_ah - Check if the port of device supports
3456 return (device->port_data[port_num].immutable.core_cap_flags &
3461 * rdma_max_mad_size - Return the max MAD size required by this RDMA Port.
3475 return device->port_data[port_num].immutable.max_mad_size;
3479 * rdma_cap_roce_gid_table - Check if the port of device uses roce_gid_table
3495 device->ops.add_gid && device->ops.del_gid;
3511 * rdma_core_cap_opa_port - Return whether the RDMA Port is OPA or not.
3520 return (device->port_data[port_num].immutable.core_cap_flags &
3525 * rdma_mtu_enum_to_int - Return the mtu of the port as an integer value.
3531 * -1 if enum value of mtu is not supported.
3543 * rdma_mtu_from_attr - Return the mtu of the port from the port attribute.
3554 return attr->phys_mtu;
3556 return ib_mtu_enum_to_int(attr->max_mtu);
3591 * the rkey for it into pd->unsafe_global_rkey. This can be used by
3605 * ib_alloc_pd - Allocates an unused protection domain.
3621 * ib_dealloc_pd - Deallocate kernel PD
3639 * rdma_create_ah - Creates an address handle for the given address vector.
3651 * rdma_create_user_ah - Creates an address handle for the given address vector.
3666 * ib_get_gids_from_rdma_hdr - Get sgid and dgid from GRH or IPv4 header
3678 * ib_get_rdma_header_version - Get the header version
3684 * ib_init_ah_attr_from_wc - Initializes address handle attributes from a
3706 * ib_create_ah_from_wc - Creates an address handle associated with the
3721 * rdma_modify_ah - Modifies the address vector associated with an address
3730 * rdma_query_ah - Queries the address vector associated with an address
3744 * rdma_destroy_ah_user - Destroys an address handle.
3752 * rdma_destroy_ah - Destroys an kernel address handle.
3772 if (!pd->device->ops.create_srq)
3773 return ERR_PTR(-EOPNOTSUPP);
3779 * ib_modify_srq - Modifies the attributes for the specified SRQ.
3783 * @srq_attr_mask: A bit-mask used to specify which attributes of the SRQ
3795 * ib_query_srq - Returns the attribute list and current values for the
3804 * ib_destroy_srq_user - Destroys the specified SRQ.
3811 * ib_destroy_srq - Destroys the specified kernel SRQ.
3824 * ib_post_srq_recv - Posts a list of work requests to the specified SRQ.
3836 return srq->device->ops.post_srq_recv(srq, recv_wr,
3844 * ib_create_qp - Creates a kernel QP associated with the specific protection
3858 * ib_modify_qp_with_udata - Modifies the attributes for the specified QP.
3862 * @attr_mask: A bit-mask used to specify which attributes of the QP
3874 * ib_modify_qp - Modifies the attributes for the specified QP and then
3879 * @qp_attr_mask: A bit-mask used to specify which attributes of the QP
3887 * ib_query_qp - Returns the attribute list and current values for the
3891 * @qp_attr_mask: A bit-mask used to select specific attributes to query.
3903 * ib_destroy_qp - Destroys the specified QP.
3910 * ib_destroy_qp - Destroys the specified kernel QP.
3921 * ib_open_qp - Obtain a reference to an existing sharable QP.
3922 * @xrcd - XRC domain
3931 * ib_close_qp - Release an external reference to a QP.
3940 * ib_post_send - Posts a list of work requests to the send queue of
3958 return qp->device->ops.post_send(qp, send_wr, bad_send_wr ? : &dummy);
3962 * ib_post_recv - Posts a list of work requests to the receive queue of
3975 return qp->device->ops.post_recv(qp, recv_wr, bad_recv_wr ? : &dummy);
4012 * ib_create_cq - Creates a CQ on the specified device.
4014 * @comp_handler: A user-specified callback that is invoked when a
4016 * @event_handler: A user-specified callback that is invoked when an
4034 * ib_resize_cq - Modifies the capacity of the CQ.
4043 * rdma_set_cq_moderation - Modifies moderation params of the CQ
4052 * ib_destroy_cq_user - Destroys the specified CQ.
4059 * ib_destroy_cq - Destroys the specified kernel CQ.
4072 * ib_poll_cq - poll a CQ for completion(s)
4081 * non-negative and < num_entries, then the CQ was emptied.
4086 return cq->device->ops.poll_cq(cq, num_entries, wc);
4090 * ib_req_notify_cq - Request completion notification on a CQ.
4119 return cq->device->ops.req_notify_cq(cq, flags);
4135 return IS_ENABLED(CONFIG_INFINIBAND_VIRT_DMA) && !dev->dma_device;
4146 return dma_pci_p2pdma_supported(dev->dma_device);
4150 * ib_virt_dma_to_ptr - Convert a dma_addr to a kernel pointer
4163 * ib_virt_dma_to_page - Convert a dma_addr to a struct page
4175 * ib_dma_mapping_error - check a DMA addr for error
4183 return dma_mapping_error(dev->dma_device, dma_addr);
4187 * ib_dma_map_single - Map a kernel virtual address to DMA address
4199 return dma_map_single(dev->dma_device, cpu_addr, size, direction);
4203 * ib_dma_unmap_single - Destroy a mapping created by ib_dma_map_single()
4214 dma_unmap_single(dev->dma_device, addr, size, direction);
4218 * ib_dma_map_page - Map a physical page to DMA address
4233 return dma_map_page(dev->dma_device, page, offset, size, direction);
4237 * ib_dma_unmap_page - Destroy a mapping created by ib_dma_map_page()
4248 dma_unmap_page(dev->dma_device, addr, size, direction);
4259 return dma_map_sg_attrs(dev->dma_device, sg, nents, direction,
4269 dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction,
4274 * ib_dma_map_sgtable_attrs - Map a scatter/gather table to DMA addresses
4288 nents = ib_dma_virt_map_sg(dev, sgt->sgl, sgt->orig_nents);
4290 return -EIO;
4291 sgt->nents = nents;
4294 return dma_map_sgtable(dev->dma_device, sgt, direction, dma_attrs);
4303 dma_unmap_sgtable(dev->dma_device, sgt, direction, dma_attrs);
4307 * ib_dma_map_sg - Map a scatter/gather list to DMA addresses
4321 * ib_dma_unmap_sg - Unmap a scatter/gather list of DMA addresses
4335 * ib_dma_max_seg_size - Return the size limit of a single DMA transfer
4344 return dma_get_max_seg_size(dev->dma_device);
4348 * ib_dma_sync_single_for_cpu - Prepare DMA region to be accessed by CPU
4360 dma_sync_single_for_cpu(dev->dma_device, addr, size, dir);
4364 * ib_dma_sync_single_for_device - Prepare DMA region to be accessed by device
4376 dma_sync_single_for_device(dev->dma_device, addr, size, dir);
4379 /* ib_reg_user_mr - register a memory region for virtual addresses from kernel
4385 /* ib_advise_mr - give an advice about an address range in a memory region */
4389 * ib_dereg_mr_user - Deregisters a memory region and removes it from the
4399 * ib_dereg_mr - Deregisters a kernel memory region and removes it from the
4420 * ib_update_fast_reg_key - updates the key portion of the fast_reg MR
4422 * @mr - struct ib_mr pointer to be updated.
4423 * @newkey - new key to be used.
4427 mr->lkey = (mr->lkey & 0xffffff00) | newkey;
4428 mr->rkey = (mr->rkey & 0xffffff00) | newkey;
4432 * ib_inc_rkey - increments the key portion of the given rkey. Can be used
4434 * @rkey - the rkey to increment.
4443 * ib_attach_mcast - Attaches the specified QP to a multicast group.
4457 * ib_detach_mcast - Detaches the specified QP from a multicast group.
4471 u64 device_cap = ib_dev->attrs.device_cap_flags;
4479 return -EINVAL;
4482 return -EINVAL;
4485 !(ib_dev->attrs.kernel_cap_flags & IBK_ON_DEMAND_PAGING))
4486 return -EOPNOTSUPP;
4492 return -EOPNOTSUPP;
4536 * be valid should use get_device(&ibdev->dev) to hold the memory.
4541 return refcount_inc_not_zero(&dev->refcount);
4585 mr->iova = 0;
4602 if (attr->type == RDMA_AH_ATTR_TYPE_ROCE)
4603 return attr->roce.dmac;
4609 if (attr->type == RDMA_AH_ATTR_TYPE_IB)
4610 attr->ib.dlid = (u16)dlid;
4611 else if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4612 attr->opa.dlid = dlid;
4617 if (attr->type == RDMA_AH_ATTR_TYPE_IB)
4618 return attr->ib.dlid;
4619 else if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4620 return attr->opa.dlid;
4626 attr->sl = sl;
4631 return attr->sl;
4637 if (attr->type == RDMA_AH_ATTR_TYPE_IB)
4638 attr->ib.src_path_bits = src_path_bits;
4639 else if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4640 attr->opa.src_path_bits = src_path_bits;
4645 if (attr->type == RDMA_AH_ATTR_TYPE_IB)
4646 return attr->ib.src_path_bits;
4647 else if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4648 return attr->opa.src_path_bits;
4655 if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4656 attr->opa.make_grd = make_grd;
4661 if (attr->type == RDMA_AH_ATTR_TYPE_OPA)
4662 return attr->opa.make_grd;
4668 attr->port_num = port_num;
4673 return attr->port_num;
4679 attr->static_rate = static_rate;
4684 return attr->static_rate;
4690 attr->ah_flags = flag;
4696 return attr->ah_flags;
4702 return &attr->grh;
4709 return &attr->grh;
4716 memcpy(grh->dgid.raw, dgid, sizeof(grh->dgid));
4724 grh->dgid.global.subnet_prefix = prefix;
4732 grh->dgid.global.interface_id = if_id;
4742 attr->ah_flags = IB_AH_GRH;
4744 grh->dgid = *dgid;
4745 grh->flow_label = flow_label;
4746 grh->sgid_index = sgid_index;
4747 grh->hop_limit = hop_limit;
4748 grh->traffic_class = traffic_class;
4749 grh->sgid_attr = NULL;
4763 * rdma_ah_find_type - Return address handle type.
4778 if (dev->type == RDMA_DEVICE_TYPE_SMI)
4785 * ib_lid_cpu16 - Return lid in 16bit CPU encoding.
4800 * ib_lid_be16 - Return lid in 16bit BE encoding.
4811 * ib_get_vector_affinity - Get the affinity mappings of a given completion
4817 * completion vector (returns all-cpus map if the device driver doesn't
4823 if (comp_vector < 0 || comp_vector >= device->num_comp_vectors ||
4824 !device->ops.get_vector_affinity)
4827 return device->ops.get_vector_affinity(device, comp_vector);
4832 * rdma_roce_rescan_device - Rescan all of the network devices in the system
4871 * rdma_device_to_ibdev - Get ib_device pointer from device pointer
4883 return coredev->owner;
4887 * ibdev_to_node - return the NUMA node for a given ib_device
4892 struct device *parent = ibdev->dev.parent;
4900 * rdma_device_to_drv_device - Helper macro to reach back to driver's
4905 * ops->device_group.
4916 return read_pnet(&device->coredev.rdma_net);
4924 * rdma_flow_label_to_udp_sport - generate a RoCE v2 UDP src port value based
4940 * rdma_calc_flow_label - generate a RDMA symmetric flow label value based on
4965 * rdma_get_udp_sport - Calculate and set UDP source port based on the flow
4984 /** ib_add_sub_device - Add a sub IB device on an existing one
4998 /** ib_del_sub_device_and_put - Delect an IB sub device while holding a 'get'
5008 ibdev->name_assign_type = RDMA_NAME_ASSIGN_TYPE_USER;