drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/qed/qed_nvmetcp.c- Extension
.c- Size
- 24650 bytes
- Lines
- 830
- 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.
- 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/types.hasm/byteorder.hasm/param.hlinux/delay.hlinux/dma-mapping.hlinux/etherdevice.hlinux/kernel.hlinux/log2.hlinux/module.hlinux/pci.hlinux/stddef.hlinux/string.hlinux/errno.hlinux/list.hlinux/qed/qed_nvmetcp_if.hqed.hqed_cxt.hqed_dev_api.hqed_hsi.hqed_hw.hqed_int.hqed_nvmetcp.hqed_ll2.hqed_mcp.hqed_sp.hqed_reg_addr.hqed_nvmetcp_fw_funcs.h
Detected Declarations
function qed_nvmetcp_async_eventfunction qed_sp_nvmetcp_func_startfunction qed_sp_nvmetcp_func_stopfunction qed_fill_nvmetcp_dev_infofunction qed_register_nvmetcp_opsfunction qed_nvmetcp_stopfunction qed_nvmetcp_startfunction hash_for_each_possiblefunction qed_sp_nvmetcp_conn_offloadfunction qed_sp_nvmetcp_conn_updatefunction qed_sp_nvmetcp_conn_terminatefunction qed_sp_nvmetcp_conn_clear_sqfunction qed_nvmetcp_allocate_connectionfunction qed_nvmetcp_acquire_connectionfunction qed_nvmetcp_release_connectionfunction qed_nvmetcp_free_connectionfunction qed_nvmetcp_allocfunction qed_nvmetcp_setupfunction qed_nvmetcp_freefunction qed_nvmetcp_acquire_connfunction qed_nvmetcp_release_connfunction qed_nvmetcp_offload_connfunction qed_nvmetcp_update_connfunction qed_nvmetcp_clear_conn_sqfunction qed_nvmetcp_destroy_connfunction qed_put_nvmetcp_opsexport qed_get_nvmetcp_opsexport qed_put_nvmetcp_ops
Annotated Snippet
if (p_conn) {
list_del(&p_conn->list_entry);
qed_nvmetcp_free_connection(p_hwfn, p_conn);
}
}
kfree(p_hwfn->p_nvmetcp_info);
p_hwfn->p_nvmetcp_info = NULL;
}
static int qed_nvmetcp_acquire_conn(struct qed_dev *cdev,
u32 *handle,
u32 *fw_cid, void __iomem **p_doorbell)
{
struct qed_hash_nvmetcp_con *hash_con;
int rc;
/* Allocate a hashed connection */
hash_con = kzalloc_obj(*hash_con, GFP_ATOMIC);
if (!hash_con)
return -ENOMEM;
/* Acquire the connection */
rc = qed_nvmetcp_acquire_connection(QED_AFFIN_HWFN(cdev),
&hash_con->con);
if (rc) {
DP_NOTICE(cdev, "Failed to acquire Connection\n");
kfree(hash_con);
return rc;
}
/* Added the connection to hash table */
*handle = hash_con->con->icid;
*fw_cid = hash_con->con->fw_cid;
hash_add(cdev->connections, &hash_con->node, *handle);
if (p_doorbell)
*p_doorbell = qed_nvmetcp_get_db_addr(QED_AFFIN_HWFN(cdev),
*handle);
return 0;
}
static int qed_nvmetcp_release_conn(struct qed_dev *cdev, u32 handle)
{
struct qed_hash_nvmetcp_con *hash_con;
hash_con = qed_nvmetcp_get_hash(cdev, handle);
if (!hash_con) {
DP_NOTICE(cdev, "Failed to find connection for handle %d\n",
handle);
return -EINVAL;
}
hlist_del(&hash_con->node);
qed_nvmetcp_release_connection(QED_AFFIN_HWFN(cdev), hash_con->con);
kfree(hash_con);
return 0;
}
static int qed_nvmetcp_offload_conn(struct qed_dev *cdev, u32 handle,
struct qed_nvmetcp_params_offload *conn_info)
{
struct qed_hash_nvmetcp_con *hash_con;
struct qed_nvmetcp_conn *con;
hash_con = qed_nvmetcp_get_hash(cdev, handle);
if (!hash_con) {
DP_NOTICE(cdev, "Failed to find connection for handle %d\n",
handle);
return -EINVAL;
}
/* Update the connection with information from the params */
con = hash_con->con;
/* FW initializations */
con->layer_code = NVMETCP_SLOW_PATH_LAYER_CODE;
con->sq_pbl_addr = conn_info->sq_pbl_addr;
con->nvmetcp_cccid_max_range = conn_info->nvmetcp_cccid_max_range;
con->nvmetcp_cccid_itid_table_addr = conn_info->nvmetcp_cccid_itid_table_addr;
con->default_cq = conn_info->default_cq;
SET_FIELD(con->offl_flags, NVMETCP_CONN_OFFLOAD_PARAMS_TARGET_MODE, 0);
SET_FIELD(con->offl_flags, NVMETCP_CONN_OFFLOAD_PARAMS_NVMETCP_MODE, 1);
SET_FIELD(con->offl_flags, NVMETCP_CONN_OFFLOAD_PARAMS_TCP_ON_CHIP_1B, 1);
/* Networking and TCP stack initializations */
Annotation
- Immediate include surface: `linux/types.h`, `asm/byteorder.h`, `asm/param.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/etherdevice.h`, `linux/kernel.h`, `linux/log2.h`.
- Detected declarations: `function qed_nvmetcp_async_event`, `function qed_sp_nvmetcp_func_start`, `function qed_sp_nvmetcp_func_stop`, `function qed_fill_nvmetcp_dev_info`, `function qed_register_nvmetcp_ops`, `function qed_nvmetcp_stop`, `function qed_nvmetcp_start`, `function hash_for_each_possible`, `function qed_sp_nvmetcp_conn_offload`, `function qed_sp_nvmetcp_conn_update`.
- 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.
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.