drivers/net/ethernet/intel/ice/ice_idc.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/ice/ice_idc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/ice/ice_idc.c- Extension
.c- Size
- 10365 bytes
- Lines
- 465
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ice.hice_lib.hice_dcb_lib.h
Detected Declarations
function ice_get_auxiliary_drvfunction ice_send_event_to_auxfunction ice_add_rdma_qsetfunction ice_del_rdma_qsetfunction ice_rdma_request_resetfunction ice_rdma_update_vsi_filterfunction ice_alloc_rdma_qvectorfunction ice_free_rdma_qvectorfunction ice_adev_releasefunction ice_plug_aux_devfunction ice_unplug_aux_devfunction ice_init_rdmafunction ice_init_rdmafunction ice_deinit_rdmaexport ice_add_rdma_qsetexport ice_del_rdma_qsetexport ice_rdma_request_resetexport ice_rdma_update_vsi_filterexport ice_alloc_rdma_qvectorexport ice_free_rdma_qvector
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2021, Intel Corporation. */
/* Inter-Driver Communication */
#include "ice.h"
#include "ice_lib.h"
#include "ice_dcb_lib.h"
static DEFINE_XARRAY_ALLOC1(ice_aux_id);
/**
* ice_get_auxiliary_drv - retrieve iidc_rdma_core_auxiliary_drv struct
* @cdev: pointer to iidc_rdma_core_dev_info struct
*
* This function has to be called with a device_lock on the
* cdev->adev.dev to avoid race conditions.
*
* Return: pointer to the matched auxiliary driver struct
*/
static struct iidc_rdma_core_auxiliary_drv *
ice_get_auxiliary_drv(struct iidc_rdma_core_dev_info *cdev)
{
struct auxiliary_device *adev;
adev = cdev->adev;
if (!adev || !adev->dev.driver)
return NULL;
return container_of(adev->dev.driver,
struct iidc_rdma_core_auxiliary_drv, adrv.driver);
}
/**
* ice_send_event_to_aux - send event to RDMA AUX driver
* @pf: pointer to PF struct
* @event: event struct
*/
void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_rdma_event *event)
{
struct iidc_rdma_core_auxiliary_drv *iadrv;
struct iidc_rdma_core_dev_info *cdev;
if (WARN_ON_ONCE(!in_task()))
return;
cdev = pf->cdev_info;
if (!cdev)
return;
mutex_lock(&pf->adev_mutex);
if (!cdev->adev)
goto finish;
device_lock(&cdev->adev->dev);
iadrv = ice_get_auxiliary_drv(cdev);
if (iadrv && iadrv->event_handler)
iadrv->event_handler(cdev, event);
device_unlock(&cdev->adev->dev);
finish:
mutex_unlock(&pf->adev_mutex);
}
/**
* ice_add_rdma_qset - Add Leaf Node for RDMA Qset
* @cdev: pointer to iidc_rdma_core_dev_info struct
* @qset: Resource to be allocated
*
* Return: Zero on success or error code encountered
*/
int ice_add_rdma_qset(struct iidc_rdma_core_dev_info *cdev,
struct iidc_rdma_qset_params *qset)
{
u16 max_rdmaqs[ICE_MAX_TRAFFIC_CLASS];
struct ice_vsi *vsi;
struct device *dev;
struct ice_pf *pf;
u32 qset_teid;
u16 qs_handle;
int status;
int i;
if (WARN_ON(!cdev || !qset))
return -EINVAL;
pf = pci_get_drvdata(cdev->pdev);
dev = ice_pf_to_dev(pf);
if (!ice_is_rdma_ena(pf))
return -EINVAL;
Annotation
- Immediate include surface: `ice.h`, `ice_lib.h`, `ice_dcb_lib.h`.
- Detected declarations: `function ice_get_auxiliary_drv`, `function ice_send_event_to_aux`, `function ice_add_rdma_qset`, `function ice_del_rdma_qset`, `function ice_rdma_request_reset`, `function ice_rdma_update_vsi_filter`, `function ice_alloc_rdma_qvector`, `function ice_free_rdma_qvector`, `function ice_adev_release`, `function ice_plug_aux_dev`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.