drivers/net/ethernet/intel/i40e/i40e_client.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/intel/i40e/i40e_client.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/intel/i40e/i40e_client.c- Extension
.c- Size
- 20557 bytes
- Lines
- 749
- 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
linux/list.hlinux/errno.hlinux/net/intel/i40e_client.hi40e.h
Detected Declarations
function i40e_client_get_paramsfunction i40e_notify_client_of_vf_msgfunction i40e_notify_client_of_l2_param_changesfunction i40e_client_release_qvlistfunction i40e_notify_client_of_netdev_closefunction i40e_notify_client_of_vf_resetfunction i40e_notify_client_of_vf_enablefunction i40e_vf_client_capablefunction i40e_client_update_msix_infofunction i40e_auxiliary_dev_releasefunction i40e_register_auxiliary_devfunction i40e_client_add_instancefunction i40e_client_del_instancefunction i40e_client_subtaskfunction i40e_lan_add_devicefunction i40e_lan_del_devicefunction i40e_client_virtchnl_sendfunction i40e_client_setup_qvlistfunction i40e_client_request_resetfunction i40e_client_update_vsi_ctxtfunction i40e_client_device_registerfunction i40e_client_device_unregisterexport i40e_client_device_registerexport i40e_client_device_unregister
Annotated Snippet
if (qs_handle == I40E_AQ_VSI_QS_HANDLE_INVALID) {
dev_err(&vsi->back->pdev->dev, "Invalid queue set handle for TC = %d, vsi id = %d\n",
tc, vsi->id);
return -EINVAL;
}
}
params->mtu = vsi->netdev->mtu;
return 0;
}
/**
* i40e_notify_client_of_vf_msg - call the client vf message callback
* @vsi: the VSI with the message
* @vf_id: the absolute VF id that sent the message
* @msg: message buffer
* @len: length of the message
*
* If there is a client to this VSI, call the client
**/
void
i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id, u8 *msg, u16 len)
{
struct i40e_pf *pf = vsi->back;
struct i40e_client_instance *cdev = pf->cinst;
if (!cdev || !cdev->client)
return;
if (!cdev->client->ops || !cdev->client->ops->virtchnl_receive) {
dev_dbg(&pf->pdev->dev,
"Cannot locate client instance virtual channel receive routine\n");
return;
}
if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
dev_dbg(&pf->pdev->dev, "Client is not open, abort virtchnl_receive\n");
return;
}
cdev->client->ops->virtchnl_receive(&cdev->lan_info, cdev->client,
vf_id, msg, len);
}
/**
* i40e_notify_client_of_l2_param_changes - call the client notify callback
* @pf: PF device pointer
*
* If there is a client, call its callback
**/
void i40e_notify_client_of_l2_param_changes(struct i40e_pf *pf)
{
struct i40e_vsi *vsi = i40e_pf_get_main_vsi(pf);
struct i40e_client_instance *cdev = pf->cinst;
struct i40e_params params;
if (!cdev || !cdev->client)
return;
if (!cdev->client->ops || !cdev->client->ops->l2_param_change) {
dev_dbg(&pf->pdev->dev,
"Cannot locate client instance l2_param_change routine\n");
return;
}
if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {
dev_dbg(&pf->pdev->dev,
"Client is not open, abort l2 param change\n");
return;
}
memset(¶ms, 0, sizeof(params));
i40e_client_get_params(vsi, ¶ms);
memcpy(&cdev->lan_info.params, ¶ms, sizeof(struct i40e_params));
cdev->client->ops->l2_param_change(&cdev->lan_info, cdev->client,
¶ms);
}
/**
* i40e_client_release_qvlist - release MSI-X vector mapping for client
* @ldev: pointer to L2 context.
*
**/
static void i40e_client_release_qvlist(struct i40e_info *ldev)
{
struct i40e_qvlist_info *qvlist_info = ldev->qvlist_info;
u32 i;
if (!ldev->qvlist_info)
return;
for (i = 0; i < qvlist_info->num_vectors; i++) {
struct i40e_pf *pf = ldev->pf;
struct i40e_qv_info *qv_info;
u32 reg_idx;
Annotation
- Immediate include surface: `linux/list.h`, `linux/errno.h`, `linux/net/intel/i40e_client.h`, `i40e.h`.
- Detected declarations: `function i40e_client_get_params`, `function i40e_notify_client_of_vf_msg`, `function i40e_notify_client_of_l2_param_changes`, `function i40e_client_release_qvlist`, `function i40e_notify_client_of_netdev_close`, `function i40e_notify_client_of_vf_reset`, `function i40e_notify_client_of_vf_enable`, `function i40e_vf_client_capable`, `function i40e_client_update_msix_info`, `function i40e_auxiliary_dev_release`.
- 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.