drivers/infiniband/hw/efa/efa_com_cmd.c
Source file repositories/reference/linux-study-clean/drivers/infiniband/hw/efa/efa_com_cmd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/infiniband/hw/efa/efa_com_cmd.c- Extension
.c- Size
- 25537 bytes
- Lines
- 858
- Domain
- Driver Families
- Bucket
- drivers/infiniband
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
efa_com.hefa_com_cmd.h
Detected Declarations
function efa_com_create_qpfunction efa_com_modify_qpfunction efa_com_query_qpfunction efa_com_destroy_qpfunction efa_com_create_cqfunction efa_com_destroy_cqfunction efa_com_register_mrfunction efa_com_dereg_mrfunction efa_com_create_ahfunction efa_com_destroy_ahfunction efa_com_check_supported_feature_idfunction efa_com_get_feature_exfunction efa_com_get_featurefunction efa_com_get_device_attrfunction efa_com_get_hw_hintsfunction efa_com_set_feature_exfunction efa_com_set_featurefunction efa_com_set_aenq_configfunction efa_com_alloc_pdfunction efa_com_dealloc_pdfunction efa_com_alloc_uarfunction efa_com_dealloc_uarfunction efa_com_get_stats
Annotated Snippet
if (err) {
ibdev_err_ratelimited(
edev->efa_dev,
"Failed to get queue attributes2 %d\n", err);
return err;
}
result->inline_buf_size_ex = resp.u.queue_attr_2.inline_buf_size_ex;
} else {
result->inline_buf_size_ex = result->inline_buf_size;
}
err = efa_com_get_feature(edev, &resp, EFA_ADMIN_NETWORK_ATTR);
if (err) {
ibdev_err_ratelimited(edev->efa_dev,
"Failed to get network attributes %d\n",
err);
return err;
}
memcpy(result->addr, resp.u.network_attr.addr,
sizeof(resp.u.network_attr.addr));
result->mtu = resp.u.network_attr.mtu;
if (efa_com_check_supported_feature_id(edev,
EFA_ADMIN_EVENT_QUEUE_ATTR)) {
err = efa_com_get_feature(edev, &resp,
EFA_ADMIN_EVENT_QUEUE_ATTR);
if (err) {
ibdev_err_ratelimited(
edev->efa_dev,
"Failed to get event queue attributes %d\n",
err);
return err;
}
result->max_eq = resp.u.event_queue_attr.max_eq;
result->max_eq_depth = resp.u.event_queue_attr.max_eq_depth;
result->event_bitmask = resp.u.event_queue_attr.event_bitmask;
}
return 0;
}
int efa_com_get_hw_hints(struct efa_com_dev *edev,
struct efa_com_get_hw_hints_result *result)
{
struct efa_admin_get_feature_resp resp;
int err;
err = efa_com_get_feature(edev, &resp, EFA_ADMIN_HW_HINTS);
if (err) {
ibdev_err_ratelimited(edev->efa_dev,
"Failed to get hw hints %d\n", err);
return err;
}
result->admin_completion_timeout = resp.u.hw_hints.admin_completion_timeout;
result->driver_watchdog_timeout = resp.u.hw_hints.driver_watchdog_timeout;
result->mmio_read_timeout = resp.u.hw_hints.mmio_read_timeout;
result->poll_interval = resp.u.hw_hints.poll_interval;
return 0;
}
int efa_com_set_feature_ex(struct efa_com_dev *edev,
struct efa_admin_set_feature_resp *set_resp,
struct efa_admin_set_feature_cmd *set_cmd,
enum efa_admin_aq_feature_id feature_id,
dma_addr_t control_buf_dma_addr,
u32 control_buff_size)
{
struct efa_com_admin_queue *aq;
int err;
if (!efa_com_check_supported_feature_id(edev, feature_id)) {
ibdev_err_ratelimited(edev->efa_dev,
"Feature %d isn't supported\n",
feature_id);
return -EOPNOTSUPP;
}
aq = &edev->aq;
set_cmd->aq_common_descriptor.opcode = EFA_ADMIN_SET_FEATURE;
if (control_buff_size) {
set_cmd->aq_common_descriptor.flags = 0;
EFA_SET(&set_cmd->aq_common_descriptor.flags,
EFA_ADMIN_AQ_COMMON_DESC_CTRL_DATA, 1);
efa_com_set_dma_addr(control_buf_dma_addr,
Annotation
- Immediate include surface: `efa_com.h`, `efa_com_cmd.h`.
- Detected declarations: `function efa_com_create_qp`, `function efa_com_modify_qp`, `function efa_com_query_qp`, `function efa_com_destroy_qp`, `function efa_com_create_cq`, `function efa_com_destroy_cq`, `function efa_com_register_mr`, `function efa_com_dereg_mr`, `function efa_com_create_ah`, `function efa_com_destroy_ah`.
- Atlas domain: Driver Families / drivers/infiniband.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.